@memori.ai/memori-webcomponent 6.4.2 → 6.4.4

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.
@@ -236,7 +236,7 @@ to {
236
236
  * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
237
237
  * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
238
238
  */function Rf(){return Rf=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},Rf.apply(this,arguments)}function Pf({bounds:e,boundsOptions:n,center:r,children:i,className:o,id:s,placeholder:a,style:l,whenReady:u,zoom:d,...h},p){const[f]=(0,c.useState)({className:o,id:s,style:l}),[m,g]=(0,c.useState)(null);(0,c.useImperativeHandle)(p,(()=>m?.map??null),[m]);const v=(0,c.useCallback)((t=>{if(null!==t&&null===m){const i=new(0,If.Map)(t,h);null!=r&&null!=d?i.setView(r,d):null!=e&&i.fitBounds(e,n),null!=u&&i.whenReady(u),g(Af(i))}}),[]);(0,c.useEffect)((()=>()=>{m?.map.remove()}),[m]);const y=m?t(c).createElement(Tf,{value:m},i):a??null;return t(c).createElement("div",Rf({},f,{ref:v}),y)}!function(e){"use strict";var t="1.9.4";function n(e){var t,n,r,i;for(n=1,r=arguments.length;n<r;n++)for(t in i=arguments[n])e[t]=i[t];return e}var r=Object.create||function(){function e(){}return function(t){return e.prototype=t,new e}}();function i(e,t){var n=Array.prototype.slice;if(e.bind)return e.bind.apply(e,n.call(arguments,1));var r=n.call(arguments,2);return function(){return e.apply(t,r.length?r.concat(n.call(arguments)):arguments)}}var o=0;function s(e){return"_leaflet_id"in e||(e._leaflet_id=++o),e._leaflet_id}function a(e,t,n){var r,i,o,s;return s=function(){r=!1,i&&(o.apply(n,i),i=!1)},o=function(){r?i=arguments:(e.apply(n,arguments),setTimeout(s,t),r=!0)},o}function l(e,t,n){var r=t[1],i=t[0],o=r-i;return e===r&&n?e:((e-i)%o+o)%o+i}function c(){return!1}function u(e,t){if(!1===t)return e;var n=Math.pow(10,void 0===t?6:t);return Math.round(e*n)/n}function d(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function h(e){return d(e).split(/\s+/)}function p(e,t){for(var n in Object.prototype.hasOwnProperty.call(e,"options")||(e.options=e.options?r(e.options):{}),t)e.options[n]=t[n];return e.options}function f(e,t,n){var r=[];for(var i in e)r.push(encodeURIComponent(n?i.toUpperCase():i)+"="+encodeURIComponent(e[i]));return(t&&-1!==t.indexOf("?")?"&":"?")+r.join("&")}var m=/\{ *([\w_ -]+) *\}/g;function g(e,t){return e.replace(m,(function(e,n){var r=t[n];if(void 0===r)throw new Error("No value provided for variable "+e);return"function"==typeof r&&(r=r(t)),r}))}var v=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function y(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}var b="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function S(e){return window["webkit"+e]||window["moz"+e]||window["ms"+e]}var x=0;function _(e){var t=+new Date,n=Math.max(0,16-(t-x));return x=t+n,window.setTimeout(e,n)}var w=window.requestAnimationFrame||S("RequestAnimationFrame")||_,C=window.cancelAnimationFrame||S("CancelAnimationFrame")||S("CancelRequestAnimationFrame")||function(e){window.clearTimeout(e)};function A(e,t,n){if(!n||w!==_)return w.call(window,i(e,t));e.call(t)}function E(e){e&&C.call(window,e)}var T={__proto__:null,extend:n,create:r,bind:i,get lastId(){return o},stamp:s,throttle:a,wrapNum:l,falseFn:c,formatNum:u,trim:d,splitWords:h,setOptions:p,getParamString:f,template:g,isArray:v,indexOf:y,emptyImageUrl:b,requestFn:w,cancelFn:C,requestAnimFrame:A,cancelAnimFrame:E};function M(){}function I(e){if("undefined"!=typeof L&&L&&L.Mixin){e=v(e)?e:[e];for(var t=0;t<e.length;t++)e[t]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}M.extend=function(e){var t=function(){p(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=t.__super__=this.prototype,o=r(i);for(var s in o.constructor=t,t.prototype=o,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(t[s]=this[s]);return e.statics&&n(t,e.statics),e.includes&&(I(e.includes),n.apply(null,[o].concat(e.includes))),n(o,e),delete o.statics,delete o.includes,o.options&&(o.options=i.options?r(i.options):{},n(o.options,e.options)),o._initHooks=[],o.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var e=0,t=o._initHooks.length;e<t;e++)o._initHooks[e].call(this)}},t},M.include=function(e){var t=this.prototype.options;return n(this.prototype,e),e.options&&(this.prototype.options=t,this.mergeOptions(e.options)),this},M.mergeOptions=function(e){return n(this.prototype.options,e),this},M.addInitHook=function(e){var t=Array.prototype.slice.call(arguments,1),n="function"==typeof e?e:function(){this[e].apply(this,t)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n),this};var R={on:function(e,t,n){if("object"==typeof e)for(var r in e)this._on(r,e[r],t);else for(var i=0,o=(e=h(e)).length;i<o;i++)this._on(e[i],t,n);return this},off:function(e,t,n){if(arguments.length)if("object"==typeof e)for(var r in e)this._off(r,e[r],t);else{e=h(e);for(var i=1===arguments.length,o=0,s=e.length;o<s;o++)i?this._off(e[o]):this._off(e[o],t,n)}else delete this._events;return this},_on:function(e,t,n,r){if("function"==typeof t){if(!1===this._listens(e,t,n)){n===this&&(n=void 0);var i={fn:t,ctx:n};r&&(i.once=!0),this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(i)}}else console.warn("wrong listener type: "+typeof t)},_off:function(e,t,n){var r,i,o;if(this._events&&(r=this._events[e]))if(1!==arguments.length)if("function"==typeof t){var s=this._listens(e,t,n);if(!1!==s){var a=r[s];this._firingCount&&(a.fn=c,this._events[e]=r=r.slice()),r.splice(s,1)}}else console.warn("wrong listener type: "+typeof t);else{if(this._firingCount)for(i=0,o=r.length;i<o;i++)r[i].fn=c;delete this._events[e]}},fire:function(e,t,r){if(!this.listens(e,r))return this;var i=n({},t,{type:e,target:this,sourceTarget:t&&t.sourceTarget||this});if(this._events){var o=this._events[e];if(o){this._firingCount=this._firingCount+1||1;for(var s=0,a=o.length;s<a;s++){var l=o[s],c=l.fn;l.once&&this.off(e,c,l.ctx),c.call(l.ctx||this,i)}this._firingCount--}}return r&&this._propagateEvent(i),this},listens:function(e,t,n,r){"string"!=typeof e&&console.warn('"string" type argument expected');var i=t;"function"!=typeof t&&(r=!!t,i=void 0,n=void 0);var o=this._events&&this._events[e];if(o&&o.length&&!1!==this._listens(e,i,n))return!0;if(r)for(var s in this._eventParents)if(this._eventParents[s].listens(e,t,n,r))return!0;return!1},_listens:function(e,t,n){if(!this._events)return!1;var r=this._events[e]||[];if(!t)return!!r.length;n===this&&(n=void 0);for(var i=0,o=r.length;i<o;i++)if(r[i].fn===t&&r[i].ctx===n)return i;return!1},once:function(e,t,n){if("object"==typeof e)for(var r in e)this._on(r,e[r],t,!0);else for(var i=0,o=(e=h(e)).length;i<o;i++)this._on(e[i],t,n,!0);return this},addEventParent:function(e){return this._eventParents=this._eventParents||{},this._eventParents[s(e)]=e,this},removeEventParent:function(e){return this._eventParents&&delete this._eventParents[s(e)],this},_propagateEvent:function(e){for(var t in this._eventParents)this._eventParents[t].fire(e.type,n({layer:e.target,propagatedFrom:e.target},e),!0)}};R.addEventListener=R.on,R.removeEventListener=R.clearAllEventListeners=R.off,R.addOneTimeEventListener=R.once,R.fireEvent=R.fire,R.hasEventListeners=R.listens;var P=M.extend(R);function k(e,t,n){this.x=n?Math.round(e):e,this.y=n?Math.round(t):t}var O=Math.trunc||function(e){return e>0?Math.floor(e):Math.ceil(e)};function N(e,t,n){return e instanceof k?e:v(e)?new k(e[0],e[1]):null==e?e:"object"==typeof e&&"x"in e&&"y"in e?new k(e.x,e.y):new k(e,t,n)}function D(e,t){if(e)for(var n=t?[e,t]:e,r=0,i=n.length;r<i;r++)this.extend(n[r])}function B(e,t){return!e||e instanceof D?e:new D(e,t)}function z(e,t){if(e)for(var n=t?[e,t]:e,r=0,i=n.length;r<i;r++)this.extend(n[r])}function F(e,t){return e instanceof z?e:new z(e,t)}function U(e,t,n){if(isNaN(e)||isNaN(t))throw new Error("Invalid LatLng object: ("+e+", "+t+")");this.lat=+e,this.lng=+t,void 0!==n&&(this.alt=+n)}function j(e,t,n){return e instanceof U?e:v(e)&&"object"!=typeof e[0]?3===e.length?new U(e[0],e[1],e[2]):2===e.length?new U(e[0],e[1]):null:null==e?e:"object"==typeof e&&"lat"in e?new U(e.lat,"lng"in e?e.lng:e.lon,e.alt):void 0===t?null:new U(e,t,n)}k.prototype={clone:function(){return new k(this.x,this.y)},add:function(e){return this.clone()._add(N(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(N(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new k(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new k(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=O(this.x),this.y=O(this.y),this},distanceTo:function(e){var t=(e=N(e)).x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},equals:function(e){return(e=N(e)).x===this.x&&e.y===this.y},contains:function(e){return e=N(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+u(this.x)+", "+u(this.y)+")"}},D.prototype={extend:function(e){var t,n;if(!e)return this;if(e instanceof k||"number"==typeof e[0]||"x"in e)t=n=N(e);else if(t=(e=B(e)).min,n=e.max,!t||!n)return this;return this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)):(this.min=t.clone(),this.max=n.clone()),this},getCenter:function(e){return N((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,e)},getBottomLeft:function(){return N(this.min.x,this.max.y)},getTopRight:function(){return N(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(e){var t,n;return(e="number"==typeof e[0]||e instanceof k?N(e):B(e))instanceof D?(t=e.min,n=e.max):t=n=e,t.x>=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=B(e);var t=this.min,n=this.max,r=e.min,i=e.max,o=i.x>=t.x&&r.x<=n.x,s=i.y>=t.y&&r.y<=n.y;return o&&s},overlaps:function(e){e=B(e);var t=this.min,n=this.max,r=e.min,i=e.max,o=i.x>t.x&&r.x<n.x,s=i.y>t.y&&r.y<n.y;return o&&s},isValid:function(){return!(!this.min||!this.max)},pad:function(e){var t=this.min,n=this.max,r=Math.abs(t.x-n.x)*e,i=Math.abs(t.y-n.y)*e;return B(N(t.x-r,t.y-i),N(n.x+r,n.y+i))},equals:function(e){return!!e&&(e=B(e),this.min.equals(e.getTopLeft())&&this.max.equals(e.getBottomRight()))}},z.prototype={extend:function(e){var t,n,r=this._southWest,i=this._northEast;if(e instanceof U)t=e,n=e;else{if(!(e instanceof z))return e?this.extend(j(e)||F(e)):this;if(t=e._southWest,n=e._northEast,!t||!n)return this}return r||i?(r.lat=Math.min(t.lat,r.lat),r.lng=Math.min(t.lng,r.lng),i.lat=Math.max(n.lat,i.lat),i.lng=Math.max(n.lng,i.lng)):(this._southWest=new U(t.lat,t.lng),this._northEast=new U(n.lat,n.lng)),this},pad:function(e){var t=this._southWest,n=this._northEast,r=Math.abs(t.lat-n.lat)*e,i=Math.abs(t.lng-n.lng)*e;return new z(new U(t.lat-r,t.lng-i),new U(n.lat+r,n.lng+i))},getCenter:function(){return new U((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new U(this.getNorth(),this.getWest())},getSouthEast:function(){return new U(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(e){e="number"==typeof e[0]||e instanceof U||"lat"in e?j(e):F(e);var t,n,r=this._southWest,i=this._northEast;return e instanceof z?(t=e.getSouthWest(),n=e.getNorthEast()):t=n=e,t.lat>=r.lat&&n.lat<=i.lat&&t.lng>=r.lng&&n.lng<=i.lng},intersects:function(e){e=F(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),i=e.getNorthEast(),o=i.lat>=t.lat&&r.lat<=n.lat,s=i.lng>=t.lng&&r.lng<=n.lng;return o&&s},overlaps:function(e){e=F(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),i=e.getNorthEast(),o=i.lat>t.lat&&r.lat<n.lat,s=i.lng>t.lng&&r.lng<n.lng;return o&&s},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(e,t){return!!e&&(e=F(e),this._southWest.equals(e.getSouthWest(),t)&&this._northEast.equals(e.getNorthEast(),t))},isValid:function(){return!(!this._southWest||!this._northEast)}},U.prototype={equals:function(e,t){return!!e&&(e=j(e),Math.max(Math.abs(this.lat-e.lat),Math.abs(this.lng-e.lng))<=(void 0===t?1e-9:t))},toString:function(e){return"LatLng("+u(this.lat,e)+", "+u(this.lng,e)+")"},distanceTo:function(e){return V.distance(this,j(e))},wrap:function(){return V.wrapLatLng(this)},toBounds:function(e){var t=180*e/40075017,n=t/Math.cos(Math.PI/180*this.lat);return F([this.lat-t,this.lng-n],[this.lat+t,this.lng+n])},clone:function(){return new U(this.lat,this.lng,this.alt)}};var H,G={latLngToPoint:function(e,t){var n=this.projection.project(e),r=this.scale(t);return this.transformation._transform(n,r)},pointToLatLng:function(e,t){var n=this.scale(t),r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},scale:function(e){return 256*Math.pow(2,e)},zoom:function(e){return Math.log(e/256)/Math.LN2},getProjectedBounds:function(e){if(this.infinite)return null;var t=this.projection.bounds,n=this.scale(e);return new D(this.transformation.transform(t.min,n),this.transformation.transform(t.max,n))},infinite:!1,wrapLatLng:function(e){var t=this.wrapLng?l(e.lng,this.wrapLng,!0):e.lng;return new U(this.wrapLat?l(e.lat,this.wrapLat,!0):e.lat,t,e.alt)},wrapLatLngBounds:function(e){var t=e.getCenter(),n=this.wrapLatLng(t),r=t.lat-n.lat,i=t.lng-n.lng;if(0===r&&0===i)return e;var o=e.getSouthWest(),s=e.getNorthEast();return new z(new U(o.lat-r,o.lng-i),new U(s.lat-r,s.lng-i))}},V=n({},G,{wrapLng:[-180,180],R:6371e3,distance:function(e,t){var n=Math.PI/180,r=e.lat*n,i=t.lat*n,o=Math.sin((t.lat-e.lat)*n/2),s=Math.sin((t.lng-e.lng)*n/2),a=o*o+Math.cos(r)*Math.cos(i)*s*s,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),W=6378137,q={R:W,MAX_LATITUDE:85.0511287798,project:function(e){var t=Math.PI/180,n=this.MAX_LATITUDE,r=Math.max(Math.min(n,e.lat),-n),i=Math.sin(r*t);return new k(this.R*e.lng*t,this.R*Math.log((1+i)/(1-i))/2)},unproject:function(e){var t=180/Math.PI;return new U((2*Math.atan(Math.exp(e.y/this.R))-Math.PI/2)*t,e.x*t/this.R)},bounds:(H=W*Math.PI,new D([-H,-H],[H,H]))};function K(e,t,n,r){if(v(e))return this._a=e[0],this._b=e[1],this._c=e[2],void(this._d=e[3]);this._a=e,this._b=t,this._c=n,this._d=r}function J(e,t,n,r){return new K(e,t,n,r)}K.prototype={transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return t=t||1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t=t||1,new k((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}};var Q=n({},V,{code:"EPSG:3857",projection:q,transformation:function(){var e=.5/(Math.PI*q.R);return J(e,.5,-e,.5)}()}),Y=n({},Q,{code:"EPSG:900913"});function Z(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function X(e,t){var n,r,i,o,s,a,l="";for(n=0,i=e.length;n<i;n++){for(r=0,o=(s=e[n]).length;r<o;r++)l+=(r?"L":"M")+(a=s[r]).x+" "+a.y;l+=t?ze.svg?"z":"x":""}return l||"M0 0"}var $,ee=document.documentElement.style,te="ActiveXObject"in window,ne=te&&!document.addEventListener,re="msLaunchUri"in navigator&&!("documentMode"in document),ie=Be("webkit"),oe=Be("android"),se=Be("android 2")||Be("android 3"),ae=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),le=oe&&Be("Google")&&ae<537&&!("AudioNode"in window),ce=!!window.opera,ue=!re&&Be("chrome"),de=Be("gecko")&&!ie&&!ce&&!te,he=!ue&&Be("safari"),pe=Be("phantom"),fe="OTransition"in ee,me=0===navigator.platform.indexOf("Win"),ge=te&&"transition"in ee,ve="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!se,ye="MozPerspective"in ee,be=!window.L_DISABLE_3D&&(ge||ve||ye)&&!fe&&!pe,Se="undefined"!=typeof orientation||Be("mobile"),xe=Se&&ie,_e=Se&&ve,we=!window.PointerEvent&&window.MSPointerEvent,Ce=!(!window.PointerEvent&&!we),Ae="ontouchstart"in window||!!window.TouchEvent,Ee=!window.L_NO_TOUCH&&(Ae||Ce),Te=Se&&ce,Me=Se&&de,Ie=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Re=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",c,t),window.removeEventListener("testPassiveEventSupport",c,t)}catch(e){}return e}(),Pe=!!document.createElement("canvas").getContext,ke=!(!document.createElementNS||!Z("svg").createSVGRect),Oe=!!ke&&(($=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===($.firstChild&&$.firstChild.namespaceURI)),Ne=!ke&&function(){try{var e=document.createElement("div");e.innerHTML='<v:shape adj="1"/>';var t=e.firstChild;return t.style.behavior="url(#default#VML)",t&&"object"==typeof t.adj}catch(e){return!1}}(),Le=0===navigator.platform.indexOf("Mac"),De=0===navigator.platform.indexOf("Linux");function Be(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var ze={ie:te,ielt9:ne,edge:re,webkit:ie,android:oe,android23:se,androidStock:le,opera:ce,chrome:ue,gecko:de,safari:he,phantom:pe,opera12:fe,win:me,ie3d:ge,webkit3d:ve,gecko3d:ye,any3d:be,mobile:Se,mobileWebkit:xe,mobileWebkit3d:_e,msPointer:we,pointer:Ce,touch:Ee,touchNative:Ae,mobileOpera:Te,mobileGecko:Me,retina:Ie,passiveEvents:Re,canvas:Pe,svg:ke,vml:Ne,inlineSvg:Oe,mac:Le,linux:De},Fe=ze.msPointer?"MSPointerDown":"pointerdown",Ue=ze.msPointer?"MSPointerMove":"pointermove",je=ze.msPointer?"MSPointerUp":"pointerup",He=ze.msPointer?"MSPointerCancel":"pointercancel",Ge={touchstart:Fe,touchmove:Ue,touchend:je,touchcancel:He},Ve={touchstart:et,touchmove:$e,touchend:$e,touchcancel:$e},We={},qe=!1;function Ke(e,t,n){return"touchstart"===t&&Xe(),Ve[t]?(n=Ve[t].bind(this,n),e.addEventListener(Ge[t],n,!1),n):(console.warn("wrong event specified:",t),c)}function Je(e,t,n){Ge[t]?e.removeEventListener(Ge[t],n,!1):console.warn("wrong event specified:",t)}function Qe(e){We[e.pointerId]=e}function Ye(e){We[e.pointerId]&&(We[e.pointerId]=e)}function Ze(e){delete We[e.pointerId]}function Xe(){qe||(document.addEventListener(Fe,Qe,!0),document.addEventListener(Ue,Ye,!0),document.addEventListener(je,Ze,!0),document.addEventListener(He,Ze,!0),qe=!0)}function $e(e,t){if(t.pointerType!==(t.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in t.touches=[],We)t.touches.push(We[n]);t.changedTouches=[t],e(t)}}function et(e,t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&Qt(t),$e(e,t)}function tt(e){var t,n,r={};for(n in e)t=e[n],r[n]=t&&t.bind?t.bind(e):t;return e=r,r.type="dblclick",r.detail=2,r.isTrusted=!1,r._simulated=!0,r}var nt=200;function rt(e,t){e.addEventListener("dblclick",t);var n,r=0;function i(e){if(1===e.detail){if("mouse"!==e.pointerType&&(!e.sourceCapabilities||e.sourceCapabilities.firesTouchEvents)){var i=Zt(e);if(!i.some((function(e){return e instanceof HTMLLabelElement&&e.attributes.for}))||i.some((function(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement}))){var o=Date.now();o-r<=nt?2==++n&&t(tt(e)):n=1,r=o}}}else n=e.detail}return e.addEventListener("click",i),{dblclick:t,simDblclick:i}}function it(e,t){e.removeEventListener("dblclick",t.dblclick),e.removeEventListener("click",t.simDblclick)}var ot,st,at,lt,ct,ut=Tt(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),dt=Tt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ht="webkitTransition"===dt||"OTransition"===dt?dt+"End":"transitionend";function pt(e){return"string"==typeof e?document.getElementById(e):e}function ft(e,t){var n=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!n||"auto"===n)&&document.defaultView){var r=document.defaultView.getComputedStyle(e,null);n=r?r[t]:null}return"auto"===n?null:n}function mt(e,t,n){var r=document.createElement(e);return r.className=t||"",n&&n.appendChild(r),r}function gt(e){var t=e.parentNode;t&&t.removeChild(e)}function vt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function yt(e){var t=e.parentNode;t&&t.lastChild!==e&&t.appendChild(e)}function bt(e){var t=e.parentNode;t&&t.firstChild!==e&&t.insertBefore(e,t.firstChild)}function St(e,t){if(void 0!==e.classList)return e.classList.contains(t);var n=Ct(e);return n.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(n)}function xt(e,t){if(void 0!==e.classList)for(var n=h(t),r=0,i=n.length;r<i;r++)e.classList.add(n[r]);else if(!St(e,t)){var o=Ct(e);wt(e,(o?o+" ":"")+t)}}function _t(e,t){void 0!==e.classList?e.classList.remove(t):wt(e,d((" "+Ct(e)+" ").replace(" "+t+" "," ")))}function wt(e,t){void 0===e.className.baseVal?e.className=t:e.className.baseVal=t}function Ct(e){return e.correspondingElement&&(e=e.correspondingElement),void 0===e.className.baseVal?e.className:e.className.baseVal}function At(e,t){"opacity"in e.style?e.style.opacity=t:"filter"in e.style&&Et(e,t)}function Et(e,t){var n=!1,r="DXImageTransform.Microsoft.Alpha";try{n=e.filters.item(r)}catch(e){if(1===t)return}t=Math.round(100*t),n?(n.Enabled=100!==t,n.Opacity=t):e.style.filter+=" progid:"+r+"(opacity="+t+")"}function Tt(e){for(var t=document.documentElement.style,n=0;n<e.length;n++)if(e[n]in t)return e[n];return!1}function Mt(e,t,n){var r=t||new k(0,0);e.style[ut]=(ze.ie3d?"translate("+r.x+"px,"+r.y+"px)":"translate3d("+r.x+"px,"+r.y+"px,0)")+(n?" scale("+n+")":"")}function It(e,t){e._leaflet_pos=t,ze.any3d?Mt(e,t):(e.style.left=t.x+"px",e.style.top=t.y+"px")}function Rt(e){return e._leaflet_pos||new k(0,0)}if("onselectstart"in document)ot=function(){Ft(window,"selectstart",Qt)},st=function(){jt(window,"selectstart",Qt)};else{var Pt=Tt(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ot=function(){if(Pt){var e=document.documentElement.style;at=e[Pt],e[Pt]="none"}},st=function(){Pt&&(document.documentElement.style[Pt]=at,at=void 0)}}function kt(){Ft(window,"dragstart",Qt)}function Ot(){jt(window,"dragstart",Qt)}function Nt(e){for(;-1===e.tabIndex;)e=e.parentNode;e.style&&(Lt(),lt=e,ct=e.style.outlineStyle,e.style.outlineStyle="none",Ft(window,"keydown",Lt))}function Lt(){lt&&(lt.style.outlineStyle=ct,lt=void 0,ct=void 0,jt(window,"keydown",Lt))}function Dt(e){do{e=e.parentNode}while(!(e.offsetWidth&&e.offsetHeight||e===document.body));return e}function Bt(e){var t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}var zt={__proto__:null,TRANSFORM:ut,TRANSITION:dt,TRANSITION_END:ht,get:pt,getStyle:ft,create:mt,remove:gt,empty:vt,toFront:yt,toBack:bt,hasClass:St,addClass:xt,removeClass:_t,setClass:wt,getClass:Ct,setOpacity:At,testProp:Tt,setTransform:Mt,setPosition:It,getPosition:Rt,get disableTextSelection(){return ot},get enableTextSelection(){return st},disableImageDrag:kt,enableImageDrag:Ot,preventOutline:Nt,restoreOutline:Lt,getSizedParentNode:Dt,getScale:Bt};function Ft(e,t,n,r){if(t&&"object"==typeof t)for(var i in t)Vt(e,i,t[i],n);else for(var o=0,s=(t=h(t)).length;o<s;o++)Vt(e,t[o],n,r);return this}var Ut="_leaflet_events";function jt(e,t,n,r){if(1===arguments.length)Ht(e),delete e[Ut];else if(t&&"object"==typeof t)for(var i in t)Wt(e,i,t[i],n);else if(t=h(t),2===arguments.length)Ht(e,(function(e){return-1!==y(t,e)}));else for(var o=0,s=t.length;o<s;o++)Wt(e,t[o],n,r);return this}function Ht(e,t){for(var n in e[Ut]){var r=n.split(/\d/)[0];t&&!t(r)||Wt(e,r,null,null,n)}}var Gt={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Vt(e,t,n,r){var i=t+s(n)+(r?"_"+s(r):"");if(e[Ut]&&e[Ut][i])return this;var o=function(t){return n.call(r||e,t||window.event)},a=o;!ze.touchNative&&ze.pointer&&0===t.indexOf("touch")?o=Ke(e,t,o):ze.touch&&"dblclick"===t?o=rt(e,o):"addEventListener"in e?"touchstart"===t||"touchmove"===t||"wheel"===t||"mousewheel"===t?e.addEventListener(Gt[t]||t,o,!!ze.passiveEvents&&{passive:!1}):"mouseenter"===t||"mouseleave"===t?(o=function(t){t=t||window.event,tn(e,t)&&a(t)},e.addEventListener(Gt[t],o,!1)):e.addEventListener(t,a,!1):e.attachEvent("on"+t,o),e[Ut]=e[Ut]||{},e[Ut][i]=o}function Wt(e,t,n,r,i){i=i||t+s(n)+(r?"_"+s(r):"");var o=e[Ut]&&e[Ut][i];if(!o)return this;!ze.touchNative&&ze.pointer&&0===t.indexOf("touch")?Je(e,t,o):ze.touch&&"dblclick"===t?it(e,o):"removeEventListener"in e?e.removeEventListener(Gt[t]||t,o,!1):e.detachEvent("on"+t,o),e[Ut][i]=null}function qt(e){return e.stopPropagation?e.stopPropagation():e.originalEvent?e.originalEvent._stopped=!0:e.cancelBubble=!0,this}function Kt(e){return Vt(e,"wheel",qt),this}function Jt(e){return Ft(e,"mousedown touchstart dblclick contextmenu",qt),e._leaflet_disable_click=!0,this}function Qt(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this}function Yt(e){return Qt(e),qt(e),this}function Zt(e){if(e.composedPath)return e.composedPath();for(var t=[],n=e.target;n;)t.push(n),n=n.parentNode;return t}function Xt(e,t){if(!t)return new k(e.clientX,e.clientY);var n=Bt(t),r=n.boundingClientRect;return new k((e.clientX-r.left)/n.x-t.clientLeft,(e.clientY-r.top)/n.y-t.clientTop)}var $t=ze.linux&&ze.chrome?window.devicePixelRatio:ze.mac?3*window.devicePixelRatio:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function en(e){return ze.edge?e.wheelDeltaY/2:e.deltaY&&0===e.deltaMode?-e.deltaY/$t:e.deltaY&&1===e.deltaMode?20*-e.deltaY:e.deltaY&&2===e.deltaMode?60*-e.deltaY:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?20*-e.detail:e.detail?e.detail/-32765*60:0}function tn(e,t){var n=t.relatedTarget;if(!n)return!0;try{for(;n&&n!==e;)n=n.parentNode}catch(e){return!1}return n!==e}var nn={__proto__:null,on:Ft,off:jt,stopPropagation:qt,disableScrollPropagation:Kt,disableClickPropagation:Jt,preventDefault:Qt,stop:Yt,getPropagationPath:Zt,getMousePosition:Xt,getWheelDelta:en,isExternalTarget:tn,addListener:Ft,removeListener:jt},rn=P.extend({run:function(e,t,n,r){this.stop(),this._el=e,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=Rt(e),this._offset=t.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=A(this._animate,this),this._step()},_step:function(e){var t=+new Date-this._startTime,n=1e3*this._duration;t<n?this._runFrame(this._easeOut(t/n),e):(this._runFrame(1),this._complete())},_runFrame:function(e,t){var n=this._startPos.add(this._offset.multiplyBy(e));t&&n._round(),It(this._el,n),this.fire("step")},_complete:function(){E(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(e){return 1-Math.pow(1-e,this._easeOutPower)}}),on=P.extend({options:{crs:Q,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(e,t){t=p(this,t),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(e),this._initLayout(),this._onResize=i(this._onResize,this),this._initEvents(),t.maxBounds&&this.setMaxBounds(t.maxBounds),void 0!==t.zoom&&(this._zoom=this._limitZoom(t.zoom)),t.center&&void 0!==t.zoom&&this.setView(j(t.center),t.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=dt&&ze.any3d&&!ze.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ft(this._proxy,ht,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(e,t,r){return t=void 0===t?this._zoom:this._limitZoom(t),e=this._limitCenter(j(e),t,this.options.maxBounds),r=r||{},this._stop(),this._loaded&&!r.reset&&!0!==r&&(void 0!==r.animate&&(r.zoom=n({animate:r.animate},r.zoom),r.pan=n({animate:r.animate,duration:r.duration},r.pan)),this._zoom!==t?this._tryAnimatedZoom&&this._tryAnimatedZoom(e,t,r.zoom):this._tryAnimatedPan(e,r.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(e,t,r.pan&&r.pan.noMoveStart),this)},setZoom:function(e,t){return this._loaded?this.setView(this.getCenter(),e,{zoom:t}):(this._zoom=e,this)},zoomIn:function(e,t){return e=e||(ze.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+e,t)},zoomOut:function(e,t){return e=e||(ze.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-e,t)},setZoomAround:function(e,t,n){var r=this.getZoomScale(t),i=this.getSize().divideBy(2),o=(e instanceof k?e:this.latLngToContainerPoint(e)).subtract(i).multiplyBy(1-1/r),s=this.containerPointToLatLng(i.add(o));return this.setView(s,t,{zoom:n})},_getBoundsCenterZoom:function(e,t){t=t||{},e=e.getBounds?e.getBounds():F(e);var n=N(t.paddingTopLeft||t.padding||[0,0]),r=N(t.paddingBottomRight||t.padding||[0,0]),i=this.getBoundsZoom(e,!1,n.add(r));if((i="number"==typeof t.maxZoom?Math.min(t.maxZoom,i):i)===1/0)return{center:e.getCenter(),zoom:i};var o=r.subtract(n).divideBy(2),s=this.project(e.getSouthWest(),i),a=this.project(e.getNorthEast(),i);return{center:this.unproject(s.add(a).divideBy(2).add(o),i),zoom:i}},fitBounds:function(e,t){if(!(e=F(e)).isValid())throw new Error("Bounds are not valid.");var n=this._getBoundsCenterZoom(e,t);return this.setView(n.center,n.zoom,t)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,t){return this.setView(e,this._zoom,{pan:t})},panBy:function(e,t){if(t=t||{},!(e=N(e).round()).x&&!e.y)return this.fire("moveend");if(!0!==t.animate&&!this.getSize().contains(e))return this._resetView(this.unproject(this.project(this.getCenter()).add(e)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new rn,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),t.noMoveStart||this.fire("movestart"),!1!==t.animate){xt(this._mapPane,"leaflet-pan-anim");var n=this._getMapPanePos().subtract(e).round();this._panAnim.run(this._mapPane,n,t.duration||.25,t.easeLinearity)}else this._rawPanBy(e),this.fire("move").fire("moveend");return this},flyTo:function(e,t,n){if(!1===(n=n||{}).animate||!ze.any3d)return this.setView(e,t,n);this._stop();var r=this.project(this.getCenter()),i=this.project(e),o=this.getSize(),s=this._zoom;e=j(e),t=void 0===t?s:t;var a=Math.max(o.x,o.y),l=a*this.getZoomScale(s,t),c=i.distanceTo(r)||1,u=1.42,d=u*u;function h(e){var t=(l*l-a*a+(e?-1:1)*d*d*c*c)/(2*(e?l:a)*d*c),n=Math.sqrt(t*t+1)-t;return n<1e-9?-18:Math.log(n)}function p(e){return(Math.exp(e)-Math.exp(-e))/2}function f(e){return(Math.exp(e)+Math.exp(-e))/2}function m(e){return p(e)/f(e)}var g=h(0);function v(e){return a*(f(g)/f(g+u*e))}function y(e){return a*(f(g)*m(g+u*e)-p(g))/d}function b(e){return 1-Math.pow(1-e,1.5)}var S=Date.now(),x=(h(1)-g)/u,_=n.duration?1e3*n.duration:1e3*x*.8;function w(){var n=(Date.now()-S)/_,o=b(n)*x;n<=1?(this._flyToFrame=A(w,this),this._move(this.unproject(r.add(i.subtract(r).multiplyBy(y(o)/c)),s),this.getScaleZoom(a/v(o),s),{flyTo:!0})):this._move(e,t)._moveEnd(!0)}return this._moveStart(!0,n.noMoveStart),w.call(this),this},flyToBounds:function(e,t){var n=this._getBoundsCenterZoom(e,t);return this.flyTo(n.center,n.zoom,t)},setMaxBounds:function(e){return e=F(e),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),e.isValid()?(this.options.maxBounds=e,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(e){var t=this.options.minZoom;return this.options.minZoom=e,this._loaded&&t!==e&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(e):this},setMaxZoom:function(e){var t=this.options.maxZoom;return this.options.maxZoom=e,this._loaded&&t!==e&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,t){this._enforcingBounds=!0;var n=this.getCenter(),r=this._limitCenter(n,this._zoom,F(e));return n.equals(r)||this.panTo(r,t),this._enforcingBounds=!1,this},panInside:function(e,t){var n=N((t=t||{}).paddingTopLeft||t.padding||[0,0]),r=N(t.paddingBottomRight||t.padding||[0,0]),i=this.project(this.getCenter()),o=this.project(e),s=this.getPixelBounds(),a=B([s.min.add(n),s.max.subtract(r)]),l=a.getSize();if(!a.contains(o)){this._enforcingBounds=!0;var c=o.subtract(a.getCenter()),u=a.extend(o).getSize().subtract(l);i.x+=c.x<0?-u.x:u.x,i.y+=c.y<0?-u.y:u.y,this.panTo(this.unproject(i),t),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=n({animate:!1,pan:!0},!0===e?{animate:!0}:e);var t=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var r=this.getSize(),o=t.divideBy(2).round(),s=r.divideBy(2).round(),a=o.subtract(s);return a.x||a.y?(e.animate&&e.pan?this.panBy(a):(e.pan&&this._rawPanBy(a),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(i(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:t,newSize:r})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=n({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var t=i(this._handleGeolocationResponse,this),r=i(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,r,e):navigator.geolocation.getCurrentPosition(t,r,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var t=e.code,n=e.message||(1===t?"permission denied":2===t?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:t,message:"Geolocation error: "+n+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var t=new U(e.coords.latitude,e.coords.longitude),n=t.toBounds(2*e.coords.accuracy),r=this._locateOptions;if(r.setView){var i=this.getBoundsZoom(n);this.setView(t,r.maxZoom?Math.min(i,r.maxZoom):i)}var o={latlng:t,bounds:n,timestamp:e.timestamp};for(var s in e.coords)"number"==typeof e.coords[s]&&(o[s]=e.coords[s]);this.fire("locationfound",o)}},addHandler:function(e,t){if(!t)return this;var n=this[e]=new t(this);return this._handlers.push(n),this.options[e]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}var e;for(e in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),gt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(E(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[e].remove();for(e in this._panes)gt(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,t){var n=mt("div","leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),t||this._mapPane);return e&&(this._panes[e]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds();return new z(this.unproject(e.getBottomLeft()),this.unproject(e.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,t,n){e=F(e),n=N(n||[0,0]);var r=this.getZoom()||0,i=this.getMinZoom(),o=this.getMaxZoom(),s=e.getNorthWest(),a=e.getSouthEast(),l=this.getSize().subtract(n),c=B(this.project(a,r),this.project(s,r)).getSize(),u=ze.any3d?this.options.zoomSnap:1,d=l.x/c.x,h=l.y/c.y,p=t?Math.max(d,h):Math.min(d,h);return r=this.getScaleZoom(p,r),u&&(r=Math.round(r/(u/100))*(u/100),r=t?Math.ceil(r/u)*u:Math.floor(r/u)*u),Math.max(i,Math.min(o,r))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new k(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,t){var n=this._getTopLeftPoint(e,t);return new D(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(void 0===e?this.getZoom():e)},getPane:function(e){return"string"==typeof e?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,t){var n=this.options.crs;return t=void 0===t?this._zoom:t,n.scale(e)/n.scale(t)},getScaleZoom:function(e,t){var n=this.options.crs;t=void 0===t?this._zoom:t;var r=n.zoom(e*n.scale(t));return isNaN(r)?1/0:r},project:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.latLngToPoint(j(e),t)},unproject:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.pointToLatLng(N(e),t)},layerPointToLatLng:function(e){var t=N(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){return this.project(j(e))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(j(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(F(e))},distance:function(e,t){return this.options.crs.distance(j(e),j(t))},containerPointToLayerPoint:function(e){return N(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return N(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(N(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(j(e)))},mouseEventToContainerPoint:function(e){return Xt(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=pt(e);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");Ft(t,"scroll",this._onScroll,this),this._containerId=s(t)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&ze.any3d,xt(e,"leaflet-container"+(ze.touch?" leaflet-touch":"")+(ze.retina?" leaflet-retina":"")+(ze.ielt9?" leaflet-oldie":"")+(ze.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var t=ft(e,"position");"absolute"!==t&&"relative"!==t&&"fixed"!==t&&"sticky"!==t&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),It(this._mapPane,new k(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(xt(e.markerPane,"leaflet-zoom-hide"),xt(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,t,n){It(this._mapPane,new k(0,0));var r=!this._loaded;this._loaded=!0,t=this._limitZoom(t),this.fire("viewprereset");var i=this._zoom!==t;this._moveStart(i,n)._move(e,t)._moveEnd(i),this.fire("viewreset"),r&&this.fire("load")},_moveStart:function(e,t){return e&&this.fire("zoomstart"),t||this.fire("movestart"),this},_move:function(e,t,n,r){void 0===t&&(t=this._zoom);var i=this._zoom!==t;return this._zoom=t,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),r?n&&n.pinch&&this.fire("zoom",n):((i||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return E(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){It(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){this._targets={},this._targets[s(this._container)]=this;var t=e?jt:Ft;t(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&t(window,"resize",this._onResize,this),ze.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){E(this._resizeRequest),this._resizeRequest=A((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,t){for(var n,r=[],i="mouseout"===t||"mouseover"===t,o=e.target||e.srcElement,a=!1;o;){if((n=this._targets[s(o)])&&("click"===t||"preclick"===t)&&this._draggableMoved(n)){a=!0;break}if(n&&n.listens(t,!0)){if(i&&!tn(o,e))break;if(r.push(n),i)break}if(o===this._container)break;o=o.parentNode}return r.length||a||i||!this.listens(t,!0)||(r=[this]),r},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var t=e.target||e.srcElement;if(!(!this._loaded||t._leaflet_disable_events||"click"===e.type&&this._isClickDisabled(t))){var n=e.type;"mousedown"===n&&Nt(t),this._fireDOMEvent(e,n)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,t,r){if("click"===e.type){var i=n({},e);i.type="preclick",this._fireDOMEvent(i,i.type,r)}var o=this._findEventTargets(e,t);if(r){for(var s=[],a=0;a<r.length;a++)r[a].listens(t,!0)&&s.push(r[a]);o=s.concat(o)}if(o.length){"contextmenu"===t&&Qt(e);var l=o[0],c={originalEvent:e};if("keypress"!==e.type&&"keydown"!==e.type&&"keyup"!==e.type){var u=l.getLatLng&&(!l._radius||l._radius<=10);c.containerPoint=u?this.latLngToContainerPoint(l.getLatLng()):this.mouseEventToContainerPoint(e),c.layerPoint=this.containerPointToLayerPoint(c.containerPoint),c.latlng=u?l.getLatLng():this.layerPointToLatLng(c.layerPoint)}for(a=0;a<o.length;a++)if(o[a].fire(t,c,!0),c.originalEvent._stopped||!1===o[a].options.bubblingMouseEvents&&-1!==y(this._mouseEvents,t))return}},_draggableMoved:function(e){return(e=e.dragging&&e.dragging.enabled()?e:this).dragging&&e.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var e=0,t=this._handlers.length;e<t;e++)this._handlers[e].disable()},whenReady:function(e,t){return this._loaded?e.call(t||this,{target:this}):this.on("load",e,t),this},_getMapPanePos:function(){return Rt(this._mapPane)||new k(0,0)},_moved:function(){var e=this._getMapPanePos();return e&&!e.equals([0,0])},_getTopLeftPoint:function(e,t){return(e&&void 0!==t?this._getNewPixelOrigin(e,t):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(e,t){var n=this.getSize()._divideBy(2);return this.project(e,t)._subtract(n)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(e,t,n){var r=this._getNewPixelOrigin(n,t);return this.project(e,t)._subtract(r)},_latLngBoundsToNewLayerBounds:function(e,t,n){var r=this._getNewPixelOrigin(n,t);return B([this.project(e.getSouthWest(),t)._subtract(r),this.project(e.getNorthWest(),t)._subtract(r),this.project(e.getSouthEast(),t)._subtract(r),this.project(e.getNorthEast(),t)._subtract(r)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(e){return this.latLngToLayerPoint(e).subtract(this._getCenterLayerPoint())},_limitCenter:function(e,t,n){if(!n)return e;var r=this.project(e,t),i=this.getSize().divideBy(2),o=new D(r.subtract(i),r.add(i)),s=this._getBoundsOffset(o,n,t);return Math.abs(s.x)<=1&&Math.abs(s.y)<=1?e:this.unproject(r.add(s),t)},_limitOffset:function(e,t){if(!t)return e;var n=this.getPixelBounds(),r=new D(n.min.add(e),n.max.add(e));return e.add(this._getBoundsOffset(r,t))},_getBoundsOffset:function(e,t,n){var r=B(this.project(t.getNorthEast(),n),this.project(t.getSouthWest(),n)),i=r.min.subtract(e.min),o=r.max.subtract(e.max);return new k(this._rebound(i.x,-o.x),this._rebound(i.y,-o.y))},_rebound:function(e,t){return e+t>0?Math.round(e-t)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(t))},_limitZoom:function(e){var t=this.getMinZoom(),n=this.getMaxZoom(),r=ze.any3d?this.options.zoomSnap:1;return r&&(e=Math.round(e/r)*r),Math.max(t,Math.min(n,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){_t(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,t){var n=this._getCenterOffset(e)._trunc();return!(!0!==(t&&t.animate)&&!this.getSize().contains(n)||(this.panBy(n,t),0))},_createAnimProxy:function(){var e=this._proxy=mt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",(function(e){var t=ut,n=this._proxy.style[t];Mt(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[t]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){gt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),t=this.getZoom();Mt(this._proxy,this.project(e,t),this.getZoomScale(t,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,t,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),i=this._getCenterOffset(e)._divideBy(1-1/r);return!(!0!==n.animate&&!this.getSize().contains(i)||(A((function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(e,t,!0)}),this),0))},_animateZoom:function(e,t,n,r){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=t,xt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:t,noUpdate:r}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(i(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&_t(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function sn(e,t){return new on(e,t)}var an=M.extend({options:{position:"topright"},initialize:function(e){p(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var t=this._container=this.onAdd(e),n=this.getPosition(),r=e._controlCorners[n];return xt(t,"leaflet-control"),-1!==n.indexOf("bottom")?r.insertBefore(t,r.firstChild):r.appendChild(t),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(gt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),ln=function(e){return new an(e)};on.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},t="leaflet-",n=this._controlContainer=mt("div",t+"control-container",this._container);function r(r,i){var o=t+r+" "+t+i;e[r+i]=mt("div",o,n)}r("top","left"),r("top","right"),r("bottom","left"),r("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)gt(this._controlCorners[e]);gt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var cn=an.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,t,n,r){return n<r?-1:r<n?1:0}},initialize:function(e,t,n){for(var r in p(this,n),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,e)this._addLayer(e[r],r);for(r in t)this._addLayer(t[r],r,!0)},onAdd:function(e){this._initLayout(),this._update(),this._map=e,e.on("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(e){return an.prototype.addTo.call(this,e),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(e,t){return this._addLayer(e,t),this._map?this._update():this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._map?this._update():this},removeLayer:function(e){e.off("add remove",this._onLayerChange,this);var t=this._getLayer(s(e));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){xt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var e=this._map.getSize().y-(this._container.offsetTop+50);return e<this._section.clientHeight?(xt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=e+"px"):_t(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return _t(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var e="leaflet-control-layers",t=this._container=mt("div",e),n=this.options.collapsed;t.setAttribute("aria-haspopup",!0),Jt(t),Kt(t);var r=this._section=mt("section",e+"-list");n&&(this._map.on("click",this.collapse,this),Ft(t,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var i=this._layersLink=mt("a",e+"-toggle",t);i.href="#",i.title="Layers",i.setAttribute("role","button"),Ft(i,{keydown:function(e){13===e.keyCode&&this._expandSafely()},click:function(e){Qt(e),this._expandSafely()}},this),n||this.expand(),this._baseLayersList=mt("div",e+"-base",r),this._separator=mt("div",e+"-separator",r),this._overlaysList=mt("div",e+"-overlays",r),t.appendChild(r)},_getLayer:function(e){for(var t=0;t<this._layers.length;t++)if(this._layers[t]&&s(this._layers[t].layer)===e)return this._layers[t]},_addLayer:function(e,t,n){this._map&&e.on("add remove",this._onLayerChange,this),this._layers.push({layer:e,name:t,overlay:n}),this.options.sortLayers&&this._layers.sort(i((function(e,t){return this.options.sortFunction(e.layer,t.layer,e.name,t.name)}),this)),this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;vt(this._baseLayersList),vt(this._overlaysList),this._layerControlInputs=[];var e,t,n,r,i=0;for(n=0;n<this._layers.length;n++)r=this._layers[n],this._addItem(r),t=t||r.overlay,e=e||!r.overlay,i+=r.overlay?0:1;return this.options.hideSingleBase&&(e=e&&i>1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=t&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var t=this._getLayer(s(e.target)),n=t.overlay?"add"===e.type?"overlayadd":"overlayremove":"add"===e.type?"baselayerchange":null;n&&this._map.fire(n,t)},_createRadioElement:function(e,t){var n='<input type="radio" class="leaflet-control-layers-selector" name="'+e+'"'+(t?' checked="checked"':"")+"/>",r=document.createElement("div");return r.innerHTML=n,r.firstChild},_addItem:function(e){var t,n=document.createElement("label"),r=this._map.hasLayer(e.layer);e.overlay?((t=document.createElement("input")).type="checkbox",t.className="leaflet-control-layers-selector",t.defaultChecked=r):t=this._createRadioElement("leaflet-base-layers_"+s(this),r),this._layerControlInputs.push(t),t.layerId=s(e.layer),Ft(t,"click",this._onInputClick,this);var i=document.createElement("span");i.innerHTML=" "+e.name;var o=document.createElement("span");return n.appendChild(o),o.appendChild(t),o.appendChild(i),(e.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var e,t,n=this._layerControlInputs,r=[],i=[];this._handlingClick=!0;for(var o=n.length-1;o>=0;o--)e=n[o],t=this._getLayer(e.layerId).layer,e.checked?r.push(t):e.checked||i.push(t);for(o=0;o<i.length;o++)this._map.hasLayer(i[o])&&this._map.removeLayer(i[o]);for(o=0;o<r.length;o++)this._map.hasLayer(r[o])||this._map.addLayer(r[o]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var e,t,n=this._layerControlInputs,r=this._map.getZoom(),i=n.length-1;i>=0;i--)e=n[i],t=this._getLayer(e.layerId).layer,e.disabled=void 0!==t.options.minZoom&&r<t.options.minZoom||void 0!==t.options.maxZoom&&r>t.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,Ft(e,"click",Qt),this.expand();var t=this;setTimeout((function(){jt(e,"click",Qt),t._preventClick=!1}))}}),un=function(e,t,n){return new cn(e,t,n)},dn=an.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(e){var t="leaflet-control-zoom",n=mt("div",t+" leaflet-bar"),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,t+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,t+"-out",n,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(e.shiftKey?3:1))},_zoomOut:function(e){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,t,n,r,i){var o=mt("a",n,r);return o.innerHTML=e,o.href="#",o.title=t,o.setAttribute("role","button"),o.setAttribute("aria-label",t),Jt(o),Ft(o,"click",Yt),Ft(o,"click",i,this),Ft(o,"click",this._refocusOnMap,this),o},_updateDisabled:function(){var e=this._map,t="leaflet-disabled";_t(this._zoomInButton,t),_t(this._zoomOutButton,t),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(xt(this._zoomOutButton,t),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(xt(this._zoomInButton,t),this._zoomInButton.setAttribute("aria-disabled","true"))}});on.mergeOptions({zoomControl:!0}),on.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new dn,this.addControl(this.zoomControl))}));var hn=function(e){return new dn(e)},pn=an.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var t="leaflet-control-scale",n=mt("div",t),r=this.options;return this._addScales(r,t+"-line",n),e.on(r.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),n},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=mt("div",t,n)),e.imperial&&(this._iScale=mt("div",t,n))},_update:function(){var e=this._map,t=e.getSize().y/2,n=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(n)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var t=this._getRoundNum(e),n=t<1e3?t+" m":t/1e3+" km";this._updateScale(this._mScale,n,t/e)},_updateImperial:function(e){var t,n,r,i=3.2808399*e;i>5280?(t=i/5280,n=this._getRoundNum(t),this._updateScale(this._iScale,n+" mi",n/t)):(r=this._getRoundNum(i),this._updateScale(this._iScale,r+" ft",r/i))},_updateScale:function(e,t,n){e.style.width=Math.round(this.options.maxWidth*n)+"px",e.innerHTML=t},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return t*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),fn=function(e){return new pn(e)},mn='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',gn=an.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(ze.inlineSvg?mn+" ":"")+"Leaflet</a>"},initialize:function(e){p(this,e),this._attributions={}},onAdd:function(e){for(var t in e.attributionControl=this,this._container=mt("div","leaflet-control-attribution"),Jt(this._container),e._layers)e._layers[t].getAttribution&&this.addAttribution(e._layers[t].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",(function(){this.removeAttribution(e.layer.getAttribution())}),this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(' <span aria-hidden="true">|</span> ')}}});on.mergeOptions({attributionControl:!0}),on.addInitHook((function(){this.options.attributionControl&&(new gn).addTo(this)}));var vn=function(e){return new gn(e)};an.Layers=cn,an.Zoom=dn,an.Scale=pn,an.Attribution=gn,ln.layers=un,ln.zoom=hn,ln.scale=fn,ln.attribution=vn;var yn=M.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});yn.addTo=function(e,t){return e.addHandler(t,this),this};var bn={Events:R},Sn=ze.touch?"touchstart mousedown":"mousedown",xn=P.extend({options:{clickTolerance:3},initialize:function(e,t,n,r){p(this,r),this._element=e,this._dragStartTarget=t||e,this._preventOutline=n},enable:function(){this._enabled||(Ft(this._dragStartTarget,Sn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(xn._dragging===this&&this.finishDrag(!0),jt(this._dragStartTarget,Sn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!St(this._element,"leaflet-zoom-anim")))if(e.touches&&1!==e.touches.length)xn._dragging===this&&this.finishDrag();else if(!(xn._dragging||e.shiftKey||1!==e.which&&1!==e.button&&!e.touches||(xn._dragging=this,this._preventOutline&&Nt(this._element),kt(),ot(),this._moving))){this.fire("down");var t=e.touches?e.touches[0]:e,n=Dt(this._element);this._startPoint=new k(t.clientX,t.clientY),this._startPos=Rt(this._element),this._parentScale=Bt(n);var r="mousedown"===e.type;Ft(document,r?"mousemove":"touchmove",this._onMove,this),Ft(document,r?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(e){if(this._enabled)if(e.touches&&e.touches.length>1)this._moved=!0;else{var t=e.touches&&1===e.touches.length?e.touches[0]:e,n=new k(t.clientX,t.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)<this.options.clickTolerance||(n.x/=this._parentScale.x,n.y/=this._parentScale.y,Qt(e),this._moved||(this.fire("dragstart"),this._moved=!0,xt(document.body,"leaflet-dragging"),this._lastTarget=e.target||e.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),xt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(n),this._moving=!0,this._lastEvent=e,this._updatePosition()))}},_updatePosition:function(){var e={originalEvent:this._lastEvent};this.fire("predrag",e),It(this._element,this._newPos),this.fire("drag",e)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(e){_t(document.body,"leaflet-dragging"),this._lastTarget&&(_t(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),jt(document,"mousemove touchmove",this._onMove,this),jt(document,"mouseup touchend touchcancel",this._onUp,this),Ot(),st();var t=this._moved&&this._moving;this._moving=!1,xn._dragging=!1,t&&this.fire("dragend",{noInertia:e,distance:this._newPos.distanceTo(this._startPos)})}});function _n(e,t,n){var r,i,o,s,a,l,c,u,d,h=[1,4,2,8];for(i=0,c=e.length;i<c;i++)e[i]._code=Ln(e[i],t);for(s=0;s<4;s++){for(u=h[s],r=[],i=0,o=(c=e.length)-1;i<c;o=i++)a=e[i],l=e[o],a._code&u?l._code&u||((d=Nn(l,a,u,t,n))._code=Ln(d,t),r.push(d)):(l._code&u&&((d=Nn(l,a,u,t,n))._code=Ln(d,t),r.push(d)),r.push(a));e=r}return e}function wn(e,t){var n,r,i,o,s,a,l,c,u;if(!e||0===e.length)throw new Error("latlngs not passed");zn(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var d=j([0,0]),h=F(e);h.getNorthWest().distanceTo(h.getSouthWest())*h.getNorthEast().distanceTo(h.getNorthWest())<1700&&(d=Cn(e));var p=e.length,f=[];for(n=0;n<p;n++){var m=j(e[n]);f.push(t.project(j([m.lat-d.lat,m.lng-d.lng])))}for(a=l=c=0,n=0,r=p-1;n<p;r=n++)i=f[n],o=f[r],s=i.y*o.x-o.y*i.x,l+=(i.x+o.x)*s,c+=(i.y+o.y)*s,a+=3*s;u=0===a?f[0]:[l/a,c/a];var g=t.unproject(N(u));return j([g.lat+d.lat,g.lng+d.lng])}function Cn(e){for(var t=0,n=0,r=0,i=0;i<e.length;i++){var o=j(e[i]);t+=o.lat,n+=o.lng,r++}return j([t/r,n/r])}var An,En={__proto__:null,clipPolygon:_n,polygonCenter:wn,centroid:Cn};function Tn(e,t){if(!t||!e.length)return e.slice();var n=t*t;return e=Rn(e=kn(e,n),n)}function Mn(e,t,n){return Math.sqrt(Bn(e,t,n,!0))}function In(e,t,n){return Bn(e,t,n)}function Rn(e,t){var n=e.length,r=new("undefined"!=typeof Uint8Array?Uint8Array:Array)(n);r[0]=r[n-1]=1,Pn(e,r,t,0,n-1);var i,o=[];for(i=0;i<n;i++)r[i]&&o.push(e[i]);return o}function Pn(e,t,n,r,i){var o,s,a,l=0;for(s=r+1;s<=i-1;s++)(a=Bn(e[s],e[r],e[i],!0))>l&&(o=s,l=a);l>n&&(t[o]=1,Pn(e,t,n,r,o),Pn(e,t,n,o,i))}function kn(e,t){for(var n=[e[0]],r=1,i=0,o=e.length;r<o;r++)Dn(e[r],e[i])>t&&(n.push(e[r]),i=r);return i<o-1&&n.push(e[o-1]),n}function On(e,t,n,r,i){var o,s,a,l=r?An:Ln(e,n),c=Ln(t,n);for(An=c;;){if(!(l|c))return[e,t];if(l&c)return!1;a=Ln(s=Nn(e,t,o=l||c,n,i),n),o===l?(e=s,l=a):(t=s,c=a)}}function Nn(e,t,n,r,i){var o,s,a=t.x-e.x,l=t.y-e.y,c=r.min,u=r.max;return 8&n?(o=e.x+a*(u.y-e.y)/l,s=u.y):4&n?(o=e.x+a*(c.y-e.y)/l,s=c.y):2&n?(o=u.x,s=e.y+l*(u.x-e.x)/a):1&n&&(o=c.x,s=e.y+l*(c.x-e.x)/a),new k(o,s,i)}function Ln(e,t){var n=0;return e.x<t.min.x?n|=1:e.x>t.max.x&&(n|=2),e.y<t.min.y?n|=4:e.y>t.max.y&&(n|=8),n}function Dn(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r}function Bn(e,t,n,r){var i,o=t.x,s=t.y,a=n.x-o,l=n.y-s,c=a*a+l*l;return c>0&&((i=((e.x-o)*a+(e.y-s)*l)/c)>1?(o=n.x,s=n.y):i>0&&(o+=a*i,s+=l*i)),a=e.x-o,l=e.y-s,r?a*a+l*l:new k(o,s)}function zn(e){return!v(e[0])||"object"!=typeof e[0][0]&&void 0!==e[0][0]}function Fn(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),zn(e)}function Un(e,t){var n,r,i,o,s,a,l,c;if(!e||0===e.length)throw new Error("latlngs not passed");zn(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var u=j([0,0]),d=F(e);d.getNorthWest().distanceTo(d.getSouthWest())*d.getNorthEast().distanceTo(d.getNorthWest())<1700&&(u=Cn(e));var h=e.length,p=[];for(n=0;n<h;n++){var f=j(e[n]);p.push(t.project(j([f.lat-u.lat,f.lng-u.lng])))}for(n=0,r=0;n<h-1;n++)r+=p[n].distanceTo(p[n+1])/2;if(0===r)c=p[0];else for(n=0,o=0;n<h-1;n++)if(s=p[n],a=p[n+1],(o+=i=s.distanceTo(a))>r){l=(o-r)/i,c=[a.x-l*(a.x-s.x),a.y-l*(a.y-s.y)];break}var m=t.unproject(N(c));return j([m.lat+u.lat,m.lng+u.lng])}var jn={__proto__:null,simplify:Tn,pointToSegmentDistance:Mn,closestPointOnSegment:In,clipSegment:On,_getEdgeIntersection:Nn,_getBitCode:Ln,_sqClosestPointOnSegment:Bn,isFlat:zn,_flat:Fn,polylineCenter:Un},Hn={project:function(e){return new k(e.lng,e.lat)},unproject:function(e){return new U(e.y,e.x)},bounds:new D([-180,-90],[180,90])},Gn={R:6378137,R_MINOR:6356752.314245179,bounds:new D([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(e){var t=Math.PI/180,n=this.R,r=e.lat*t,i=this.R_MINOR/n,o=Math.sqrt(1-i*i),s=o*Math.sin(r),a=Math.tan(Math.PI/4-r/2)/Math.pow((1-s)/(1+s),o/2);return r=-n*Math.log(Math.max(a,1e-10)),new k(e.lng*t*n,r)},unproject:function(e){for(var t,n=180/Math.PI,r=this.R,i=this.R_MINOR/r,o=Math.sqrt(1-i*i),s=Math.exp(-e.y/r),a=Math.PI/2-2*Math.atan(s),l=0,c=.1;l<15&&Math.abs(c)>1e-7;l++)t=o*Math.sin(a),t=Math.pow((1-t)/(1+t),o/2),a+=c=Math.PI/2-2*Math.atan(s*t)-a;return new U(a*n,e.x*n/r)}},Vn={__proto__:null,LonLat:Hn,Mercator:Gn,SphericalMercator:q},Wn=n({},V,{code:"EPSG:3395",projection:Gn,transformation:function(){var e=.5/(Math.PI*Gn.R);return J(e,.5,-e,.5)}()}),qn=n({},V,{code:"EPSG:4326",projection:Hn,transformation:J(1/180,1,-1/180,.5)}),Kn=n({},G,{projection:Hn,transformation:J(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lng-e.lng,r=t.lat-e.lat;return Math.sqrt(n*n+r*r)},infinite:!0});G.Earth=V,G.EPSG3395=Wn,G.EPSG3857=Q,G.EPSG900913=Y,G.EPSG4326=qn,G.Simple=Kn;var Jn=P.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[s(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[s(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var t=e.target;if(t.hasLayer(this)){if(this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents){var n=this.getEvents();t.on(n,this),this.once("remove",(function(){t.off(n,this)}),this)}this.onAdd(t),this.fire("add"),t.fire("layeradd",{layer:this})}}});on.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var t=s(e);return this._layers[t]||(this._layers[t]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e)),this},removeLayer:function(e){var t=s(e);return this._layers[t]?(this._loaded&&e.onRemove(this),delete this._layers[t],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return s(e)in this._layers},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},_addLayers:function(e){for(var t=0,n=(e=e?v(e)?e:[e]:[]).length;t<n;t++)this.addLayer(e[t])},_addZoomLimit:function(e){isNaN(e.options.maxZoom)&&isNaN(e.options.minZoom)||(this._zoomBoundLayers[s(e)]=e,this._updateZoomLevels())},_removeZoomLimit:function(e){var t=s(e);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var e=1/0,t=-1/0,n=this._getZoomSpan();for(var r in this._zoomBoundLayers){var i=this._zoomBoundLayers[r].options;e=void 0===i.minZoom?e:Math.min(e,i.minZoom),t=void 0===i.maxZoom?t:Math.max(t,i.maxZoom)}this._layersMaxZoom=t===-1/0?void 0:t,this._layersMinZoom=e===1/0?void 0:e,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Qn=Jn.extend({initialize:function(e,t){var n,r;if(p(this,t),this._layers={},e)for(n=0,r=e.length;n<r;n++)this.addLayer(e[n])},addLayer:function(e){var t=this.getLayerId(e);return this._layers[t]=e,this._map&&this._map.addLayer(e),this},removeLayer:function(e){var t=e in this._layers?e:this.getLayerId(e);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(e){return("number"==typeof e?e:this.getLayerId(e))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(e){var t,n,r=Array.prototype.slice.call(arguments,1);for(t in this._layers)(n=this._layers[t])[e]&&n[e].apply(n,r);return this},onAdd:function(e){this.eachLayer(e.addLayer,e)},onRemove:function(e){this.eachLayer(e.removeLayer,e)},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},getLayer:function(e){return this._layers[e]},getLayers:function(){var e=[];return this.eachLayer(e.push,e),e},setZIndex:function(e){return this.invoke("setZIndex",e)},getLayerId:function(e){return s(e)}}),Yn=function(e,t){return new Qn(e,t)},Zn=Qn.extend({addLayer:function(e){return this.hasLayer(e)?this:(e.addEventParent(this),Qn.prototype.addLayer.call(this,e),this.fire("layeradd",{layer:e}))},removeLayer:function(e){return this.hasLayer(e)?(e in this._layers&&(e=this._layers[e]),e.removeEventParent(this),Qn.prototype.removeLayer.call(this,e),this.fire("layerremove",{layer:e})):this},setStyle:function(e){return this.invoke("setStyle",e)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var e=new z;for(var t in this._layers){var n=this._layers[t];e.extend(n.getBounds?n.getBounds():n.getLatLng())}return e}}),Xn=function(e,t){return new Zn(e,t)},$n=M.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(e){p(this,e)},createIcon:function(e){return this._createIcon("icon",e)},createShadow:function(e){return this._createIcon("shadow",e)},_createIcon:function(e,t){var n=this._getIconUrl(e);if(!n){if("icon"===e)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var r=this._createImg(n,t&&"IMG"===t.tagName?t:null);return this._setIconStyles(r,e),(this.options.crossOrigin||""===this.options.crossOrigin)&&(r.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),r},_setIconStyles:function(e,t){var n=this.options,r=n[t+"Size"];"number"==typeof r&&(r=[r,r]);var i=N(r),o=N("shadow"===t&&n.shadowAnchor||n.iconAnchor||i&&i.divideBy(2,!0));e.className="leaflet-marker-"+t+" "+(n.className||""),o&&(e.style.marginLeft=-o.x+"px",e.style.marginTop=-o.y+"px"),i&&(e.style.width=i.x+"px",e.style.height=i.y+"px")},_createImg:function(e,t){return(t=t||document.createElement("img")).src=e,t},_getIconUrl:function(e){return ze.retina&&this.options[e+"RetinaUrl"]||this.options[e+"Url"]}});function er(e){return new $n(e)}var tr=$n.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(e){return"string"!=typeof tr.imagePath&&(tr.imagePath=this._detectIconPath()),(this.options.imagePath||tr.imagePath)+$n.prototype._getIconUrl.call(this,e)},_stripUrl:function(e){var t=function(e,t,n){var r=t.exec(e);return r&&r[n]};return(e=t(e,/^url\((['"])?(.+)\1\)$/,2))&&t(e,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var e=mt("div","leaflet-default-icon-path",document.body),t=ft(e,"background-image")||ft(e,"backgroundImage");if(document.body.removeChild(e),t=this._stripUrl(t))return t;var n=document.querySelector('link[href$="leaflet.css"]');return n?n.href.substring(0,n.href.length-11-1):""}}),nr=yn.extend({initialize:function(e){this._marker=e},addHooks:function(){var e=this._marker._icon;this._draggable||(this._draggable=new xn(e,e,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),xt(e,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&_t(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(e){var t=this._marker,n=t._map,r=this._marker.options.autoPanSpeed,i=this._marker.options.autoPanPadding,o=Rt(t._icon),s=n.getPixelBounds(),a=n.getPixelOrigin(),l=B(s.min._subtract(a).add(i),s.max._subtract(a).subtract(i));if(!l.contains(o)){var c=N((Math.max(l.max.x,o.x)-l.max.x)/(s.max.x-l.max.x)-(Math.min(l.min.x,o.x)-l.min.x)/(s.min.x-l.min.x),(Math.max(l.max.y,o.y)-l.max.y)/(s.max.y-l.max.y)-(Math.min(l.min.y,o.y)-l.min.y)/(s.min.y-l.min.y)).multiplyBy(r);n.panBy(c,{animate:!1}),this._draggable._newPos._add(c),this._draggable._startPos._add(c),It(t._icon,this._draggable._newPos),this._onDrag(e),this._panRequest=A(this._adjustPan.bind(this,e))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(e){this._marker.options.autoPan&&(E(this._panRequest),this._panRequest=A(this._adjustPan.bind(this,e)))},_onDrag:function(e){var t=this._marker,n=t._shadow,r=Rt(t._icon),i=t._map.layerPointToLatLng(r);n&&It(n,r),t._latlng=i,e.latlng=i,e.oldLatLng=this._oldLatLng,t.fire("move",e).fire("drag",e)},_onDragEnd:function(e){E(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",e)}}),rr=Jn.extend({options:{icon:new tr,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(e,t){p(this,t),this._latlng=j(e)},onAdd:function(e){this._zoomAnimated=this._zoomAnimated&&e.options.markerZoomAnimation,this._zoomAnimated&&e.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(e){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&e.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(e){var t=this._latlng;return this._latlng=j(e),this.update(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},setZIndexOffset:function(e){return this.options.zIndexOffset=e,this.update()},getIcon:function(){return this.options.icon},setIcon:function(e){return this.options.icon=e,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var e=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(e)}return this},_initIcon:function(){var e=this.options,t="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),n=e.icon.createIcon(this._icon),r=!1;n!==this._icon&&(this._icon&&this._removeIcon(),r=!0,e.title&&(n.title=e.title),"IMG"===n.tagName&&(n.alt=e.alt||"")),xt(n,t),e.keyboard&&(n.tabIndex="0",n.setAttribute("role","button")),this._icon=n,e.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ft(n,"focus",this._panOnFocus,this);var i=e.icon.createShadow(this._shadow),o=!1;i!==this._shadow&&(this._removeShadow(),o=!0),i&&(xt(i,t),i.alt=""),this._shadow=i,e.opacity<1&&this._updateOpacity(),r&&this.getPane().appendChild(this._icon),this._initInteraction(),i&&o&&this.getPane(e.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&jt(this._icon,"focus",this._panOnFocus,this),gt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&gt(this._shadow),this._shadow=null},_setPos:function(e){this._icon&&It(this._icon,e),this._shadow&&It(this._shadow,e),this._zIndex=e.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(e){this._icon&&(this._icon.style.zIndex=this._zIndex+e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center).round();this._setPos(t)},_initInteraction:function(){if(this.options.interactive&&(xt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),nr)){var e=this.options.draggable;this.dragging&&(e=this.dragging.enabled(),this.dragging.disable()),this.dragging=new nr(this),e&&this.dragging.enable()}},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var e=this.options.opacity;this._icon&&At(this._icon,e),this._shadow&&At(this._shadow,e)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var e=this._map;if(e){var t=this.options.icon.options,n=t.iconSize?N(t.iconSize):N(0,0),r=t.iconAnchor?N(t.iconAnchor):N(0,0);e.panInside(this._latlng,{paddingTopLeft:r,paddingBottomRight:n.subtract(r)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function ir(e,t){return new rr(e,t)}var or=Jn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(e){this._renderer=e.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(e){return p(this,e),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&e&&Object.prototype.hasOwnProperty.call(e,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),sr=or.extend({options:{fill:!0,radius:10},initialize:function(e,t){p(this,t),this._latlng=j(e),this._radius=this.options.radius},setLatLng:function(e){var t=this._latlng;return this._latlng=j(e),this.redraw(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(e){return this.options.radius=this._radius=e,this.redraw()},getRadius:function(){return this._radius},setStyle:function(e){var t=e&&e.radius||this._radius;return or.prototype.setStyle.call(this,e),this.setRadius(t),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var e=this._radius,t=this._radiusY||e,n=this._clickTolerance(),r=[e+n,t+n];this._pxBounds=new D(this._point.subtract(r),this._point.add(r))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(e){return e.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function ar(e,t){return new sr(e,t)}var lr=sr.extend({initialize:function(e,t,r){if("number"==typeof t&&(t=n({},r,{radius:t})),p(this,t),this._latlng=j(e),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(e){return this._mRadius=e,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var e=[this._radius,this._radiusY||this._radius];return new z(this._map.layerPointToLatLng(this._point.subtract(e)),this._map.layerPointToLatLng(this._point.add(e)))},setStyle:or.prototype.setStyle,_project:function(){var e=this._latlng.lng,t=this._latlng.lat,n=this._map,r=n.options.crs;if(r.distance===V.distance){var i=Math.PI/180,o=this._mRadius/V.R/i,s=n.project([t+o,e]),a=n.project([t-o,e]),l=s.add(a).divideBy(2),c=n.unproject(l).lat,u=Math.acos((Math.cos(o*i)-Math.sin(t*i)*Math.sin(c*i))/(Math.cos(t*i)*Math.cos(c*i)))/i;(isNaN(u)||0===u)&&(u=o/Math.cos(Math.PI/180*t)),this._point=l.subtract(n.getPixelOrigin()),this._radius=isNaN(u)?0:l.x-n.project([c,e-u]).x,this._radiusY=l.y-s.y}else{var d=r.unproject(r.project(this._latlng).subtract([this._mRadius,0]));this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(d).x}this._updateBounds()}});function cr(e,t,n){return new lr(e,t,n)}var ur=or.extend({options:{smoothFactor:1,noClip:!1},initialize:function(e,t){p(this,t),this._setLatLngs(e)},getLatLngs:function(){return this._latlngs},setLatLngs:function(e){return this._setLatLngs(e),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(e){for(var t,n,r=1/0,i=null,o=Bn,s=0,a=this._parts.length;s<a;s++)for(var l=this._parts[s],c=1,u=l.length;c<u;c++){var d=o(e,t=l[c-1],n=l[c],!0);d<r&&(r=d,i=o(e,t,n))}return i&&(i.distance=Math.sqrt(r)),i},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Un(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(e,t){return t=t||this._defaultShape(),e=j(e),t.push(e),this._bounds.extend(e),this.redraw()},_setLatLngs:function(e){this._bounds=new z,this._latlngs=this._convertLatLngs(e)},_defaultShape:function(){return zn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(e){for(var t=[],n=zn(e),r=0,i=e.length;r<i;r++)n?(t[r]=j(e[r]),this._bounds.extend(t[r])):t[r]=this._convertLatLngs(e[r]);return t},_project:function(){var e=new D;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,e),this._bounds.isValid()&&e.isValid()&&(this._rawPxBounds=e,this._updateBounds())},_updateBounds:function(){var e=this._clickTolerance(),t=new k(e,e);this._rawPxBounds&&(this._pxBounds=new D([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(e,t,n){var r,i,o=e[0]instanceof U,s=e.length;if(o){for(i=[],r=0;r<s;r++)i[r]=this._map.latLngToLayerPoint(e[r]),n.extend(i[r]);t.push(i)}else for(r=0;r<s;r++)this._projectLatlngs(e[r],t,n)},_clipPoints:function(){var e=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(e))if(this.options.noClip)this._parts=this._rings;else{var t,n,r,i,o,s,a,l=this._parts;for(t=0,r=0,i=this._rings.length;t<i;t++)for(n=0,o=(a=this._rings[t]).length;n<o-1;n++)(s=On(a[n],a[n+1],e,n,!0))&&(l[r]=l[r]||[],l[r].push(s[0]),s[1]===a[n+1]&&n!==o-2||(l[r].push(s[1]),r++))}},_simplifyPoints:function(){for(var e=this._parts,t=this.options.smoothFactor,n=0,r=e.length;n<r;n++)e[n]=Tn(e[n],t)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(e,t){var n,r,i,o,s,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(n=0,o=this._parts.length;n<o;n++)for(r=0,i=(s=(a=this._parts[n]).length)-1;r<s;i=r++)if((t||0!==r)&&Mn(e,a[i],a[r])<=l)return!0;return!1}});function dr(e,t){return new ur(e,t)}ur._flat=Fn;var hr=ur.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return wn(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(e){var t=ur.prototype._convertLatLngs.call(this,e),n=t.length;return n>=2&&t[0]instanceof U&&t[0].equals(t[n-1])&&t.pop(),t},_setLatLngs:function(e){ur.prototype._setLatLngs.call(this,e),zn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return zn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,t=this.options.weight,n=new k(t,t);if(e=new D(e.min.subtract(n),e.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(e))if(this.options.noClip)this._parts=this._rings;else for(var r,i=0,o=this._rings.length;i<o;i++)(r=_n(this._rings[i],e,!0)).length&&this._parts.push(r)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(e){var t,n,r,i,o,s,a,l,c=!1;if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(i=0,a=this._parts.length;i<a;i++)for(o=0,s=(l=(t=this._parts[i]).length)-1;o<l;s=o++)n=t[o],r=t[s],n.y>e.y!=r.y>e.y&&e.x<(r.x-n.x)*(e.y-n.y)/(r.y-n.y)+n.x&&(c=!c);return c||ur.prototype._containsPoint.call(this,e,!0)}});function pr(e,t){return new hr(e,t)}var fr=Zn.extend({initialize:function(e,t){p(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t,n,r,i=v(e)?e:e.features;if(i){for(t=0,n=i.length;t<n;t++)((r=i[t]).geometries||r.geometry||r.features||r.coordinates)&&this.addData(r);return this}var o=this.options;if(o.filter&&!o.filter(e))return this;var s=mr(e,o);return s?(s.feature=_r(e),s.defaultOptions=s.options,this.resetStyle(s),o.onEachFeature&&o.onEachFeature(e,s),this.addLayer(s)):this},resetStyle:function(e){return void 0===e?this.eachLayer(this.resetStyle,this):(e.options=n({},e.defaultOptions),this._setLayerStyle(e,this.options.style),this)},setStyle:function(e){return this.eachLayer((function(t){this._setLayerStyle(t,e)}),this)},_setLayerStyle:function(e,t){e.setStyle&&("function"==typeof t&&(t=t(e.feature)),e.setStyle(t))}});function mr(e,t){var n,r,i,o,s="Feature"===e.type?e.geometry:e,a=s?s.coordinates:null,l=[],c=t&&t.pointToLayer,u=t&&t.coordsToLatLng||vr;if(!a&&!s)return null;switch(s.type){case"Point":return gr(c,e,n=u(a),t);case"MultiPoint":for(i=0,o=a.length;i<o;i++)n=u(a[i]),l.push(gr(c,e,n,t));return new Zn(l);case"LineString":case"MultiLineString":return r=yr(a,"LineString"===s.type?0:1,u),new ur(r,t);case"Polygon":case"MultiPolygon":return r=yr(a,"Polygon"===s.type?1:2,u),new hr(r,t);case"GeometryCollection":for(i=0,o=s.geometries.length;i<o;i++){var d=mr({geometry:s.geometries[i],type:"Feature",properties:e.properties},t);d&&l.push(d)}return new Zn(l);case"FeatureCollection":for(i=0,o=s.features.length;i<o;i++){var h=mr(s.features[i],t);h&&l.push(h)}return new Zn(l);default:throw new Error("Invalid GeoJSON object.")}}function gr(e,t,n,r){return e?e(t,n):new rr(n,r&&r.markersInheritOptions&&r)}function vr(e){return new U(e[1],e[0],e[2])}function yr(e,t,n){for(var r,i=[],o=0,s=e.length;o<s;o++)r=t?yr(e[o],t-1,n):(n||vr)(e[o]),i.push(r);return i}function br(e,t){return void 0!==(e=j(e)).alt?[u(e.lng,t),u(e.lat,t),u(e.alt,t)]:[u(e.lng,t),u(e.lat,t)]}function Sr(e,t,n,r){for(var i=[],o=0,s=e.length;o<s;o++)i.push(t?Sr(e[o],zn(e[o])?0:t-1,n,r):br(e[o],r));return!t&&n&&i.length>0&&i.push(i[0].slice()),i}function xr(e,t){return e.feature?n({},e.feature,{geometry:t}):_r(t)}function _r(e){return"Feature"===e.type||"FeatureCollection"===e.type?e:{type:"Feature",properties:{},geometry:e}}var wr={toGeoJSON:function(e){return xr(this,{type:"Point",coordinates:br(this.getLatLng(),e)})}};function Cr(e,t){return new fr(e,t)}rr.include(wr),lr.include(wr),sr.include(wr),ur.include({toGeoJSON:function(e){var t=!zn(this._latlngs);return xr(this,{type:(t?"Multi":"")+"LineString",coordinates:Sr(this._latlngs,t?1:0,!1,e)})}}),hr.include({toGeoJSON:function(e){var t=!zn(this._latlngs),n=t&&!zn(this._latlngs[0]),r=Sr(this._latlngs,n?2:t?1:0,!0,e);return t||(r=[r]),xr(this,{type:(n?"Multi":"")+"Polygon",coordinates:r})}}),Qn.include({toMultiPoint:function(e){var t=[];return this.eachLayer((function(n){t.push(n.toGeoJSON(e).geometry.coordinates)})),xr(this,{type:"MultiPoint",coordinates:t})},toGeoJSON:function(e){var t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===t)return this.toMultiPoint(e);var n="GeometryCollection"===t,r=[];return this.eachLayer((function(t){if(t.toGeoJSON){var i=t.toGeoJSON(e);if(n)r.push(i.geometry);else{var o=_r(i);"FeatureCollection"===o.type?r.push.apply(r,o.features):r.push(o)}}})),n?xr(this,{geometries:r,type:"GeometryCollection"}):{type:"FeatureCollection",features:r}}});var Ar=Cr,Er=Jn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,t,n){this._url=e,this._bounds=F(t),p(this,n)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(xt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){gt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&yt(this._image),this},bringToBack:function(){return this._map&&bt(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=F(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e="IMG"===this._url.tagName,t=this._image=e?this._url:mt("img");xt(t,"leaflet-image-layer"),this._zoomAnimated&&xt(t,"leaflet-zoom-animated"),this.options.className&&xt(t,this.options.className),t.onselectstart=c,t.onmousemove=c,t.onload=i(this.fire,this,"load"),t.onerror=i(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(t.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e?this._url=t.src:(t.src=this._url,t.alt=this.options.alt)},_animateZoom:function(e){var t=this._map.getZoomScale(e.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;Mt(this._image,n,t)},_reset:function(){var e=this._image,t=new D(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=t.getSize();It(e,t.min),e.style.width=n.x+"px",e.style.height=n.y+"px"},_updateOpacity:function(){At(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),Tr=function(e,t,n){return new Er(e,t,n)},Mr=Er.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e="VIDEO"===this._url.tagName,t=this._image=e?this._url:mt("video");if(xt(t,"leaflet-image-layer"),this._zoomAnimated&&xt(t,"leaflet-zoom-animated"),this.options.className&&xt(t,this.options.className),t.onselectstart=c,t.onmousemove=c,t.onloadeddata=i(this.fire,this,"load"),e){for(var n=t.getElementsByTagName("source"),r=[],o=0;o<n.length;o++)r.push(n[o].src);this._url=n.length>0?r:[t.src]}else{v(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(t.style,"objectFit")&&(t.style.objectFit="fill"),t.autoplay=!!this.options.autoplay,t.loop=!!this.options.loop,t.muted=!!this.options.muted,t.playsInline=!!this.options.playsInline;for(var s=0;s<this._url.length;s++){var a=mt("source");a.src=this._url[s],t.appendChild(a)}}}});function Ir(e,t,n){return new Mr(e,t,n)}var Rr=Er.extend({_initImage:function(){var e=this._image=this._url;xt(e,"leaflet-image-layer"),this._zoomAnimated&&xt(e,"leaflet-zoom-animated"),this.options.className&&xt(e,this.options.className),e.onselectstart=c,e.onmousemove=c}});function Pr(e,t,n){return new Rr(e,t,n)}var kr=Jn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(e,t){e&&(e instanceof U||v(e))?(this._latlng=j(e),p(this,t)):(p(this,e),this._source=t),this.options.content&&(this._content=this.options.content)},openOn:function(e){return(e=arguments.length?e:this._source._map).hasLayer(this)||e.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(e){return this._map?this.close():(arguments.length?this._source=e:e=this._source,this._prepareOpen(),this.openOn(e._map)),this},onAdd:function(e){this._zoomAnimated=e._zoomAnimated,this._container||this._initLayout(),e._fadeAnimated&&At(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),e._fadeAnimated&&At(this._container,1),this.bringToFront(),this.options.interactive&&(xt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(e){e._fadeAnimated?(At(this._container,0),this._removeTimeout=setTimeout(i(gt,void 0,this._container),200)):gt(this._container),this.options.interactive&&(_t(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(e){return this._latlng=j(e),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(e){return this._content=e,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var e={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&yt(this._container),this},bringToBack:function(){return this._map&&bt(this._container),this},_prepareOpen:function(e){var t=this._source;if(!t._map)return!1;if(t instanceof Zn){t=null;var n=this._source._layers;for(var r in n)if(n[r]._map){t=n[r];break}if(!t)return!1;this._source=t}if(!e)if(t.getCenter)e=t.getCenter();else if(t.getLatLng)e=t.getLatLng();else{if(!t.getBounds)throw new Error("Unable to get source layer LatLng.");e=t.getBounds().getCenter()}return this.setLatLng(e),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var e=this._contentNode,t="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof t)e.innerHTML=t;else{for(;e.hasChildNodes();)e.removeChild(e.firstChild);e.appendChild(t)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var e=this._map.latLngToLayerPoint(this._latlng),t=N(this.options.offset),n=this._getAnchor();this._zoomAnimated?It(this._container,e.add(n)):t=t.add(e).add(n);var r=this._containerBottom=-t.y,i=this._containerLeft=-Math.round(this._containerWidth/2)+t.x;this._container.style.bottom=r+"px",this._container.style.left=i+"px"}},_getAnchor:function(){return[0,0]}});on.include({_initOverlay:function(e,t,n,r){var i=t;return i instanceof e||(i=new e(r).setContent(t)),n&&i.setLatLng(n),i}}),Jn.include({_initOverlay:function(e,t,n,r){var i=n;return i instanceof e?(p(i,r),i._source=this):(i=t&&!r?t:new e(r,this)).setContent(n),i}});var Or=kr.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(e){return!(e=arguments.length?e:this._source._map).hasLayer(this)&&e._popup&&e._popup.options.autoClose&&e.removeLayer(e._popup),e._popup=this,kr.prototype.openOn.call(this,e)},onAdd:function(e){kr.prototype.onAdd.call(this,e),e.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof or||this._source.on("preclick",qt))},onRemove:function(e){kr.prototype.onRemove.call(this,e),e.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof or||this._source.off("preclick",qt))},getEvents:function(){var e=kr.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(e.preclick=this.close),this.options.keepInView&&(e.moveend=this._adjustPan),e},_initLayout:function(){var e="leaflet-popup",t=this._container=mt("div",e+" "+(this.options.className||"")+" leaflet-zoom-animated"),n=this._wrapper=mt("div",e+"-content-wrapper",t);if(this._contentNode=mt("div",e+"-content",n),Jt(t),Kt(this._contentNode),Ft(t,"contextmenu",qt),this._tipContainer=mt("div",e+"-tip-container",t),this._tip=mt("div",e+"-tip",this._tipContainer),this.options.closeButton){var r=this._closeButton=mt("a",e+"-close-button",t);r.setAttribute("role","button"),r.setAttribute("aria-label","Close popup"),r.href="#close",r.innerHTML='<span aria-hidden="true">&#215;</span>',Ft(r,"click",(function(e){Qt(e),this.close()}),this)}},_updateLayout:function(){var e=this._contentNode,t=e.style;t.width="",t.whiteSpace="nowrap";var n=e.offsetWidth;n=Math.min(n,this.options.maxWidth),n=Math.max(n,this.options.minWidth),t.width=n+1+"px",t.whiteSpace="",t.height="";var r=e.offsetHeight,i=this.options.maxHeight,o="leaflet-popup-scrolled";i&&r>i?(t.height=i+"px",xt(e,o)):_t(e,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),n=this._getAnchor();It(this._container,t.add(n))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var e=this._map,t=parseInt(ft(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+t,r=this._containerWidth,i=new k(this._containerLeft,-n-this._containerBottom);i._add(Rt(this._container));var o=e.layerPointToContainerPoint(i),s=N(this.options.autoPanPadding),a=N(this.options.autoPanPaddingTopLeft||s),l=N(this.options.autoPanPaddingBottomRight||s),c=e.getSize(),u=0,d=0;o.x+r+l.x>c.x&&(u=o.x+r-c.x+l.x),o.x-u-a.x<0&&(u=o.x-a.x),o.y+n+l.y>c.y&&(d=o.y+n-c.y+l.y),o.y-d-a.y<0&&(d=o.y-a.y),(u||d)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([u,d]))}},_getAnchor:function(){return N(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Nr=function(e,t){return new Or(e,t)};on.mergeOptions({closePopupOnClick:!0}),on.include({openPopup:function(e,t,n){return this._initOverlay(Or,e,t,n).openOn(this),this},closePopup:function(e){return(e=arguments.length?e:this._popup)&&e.close(),this}}),Jn.include({bindPopup:function(e,t){return this._popup=this._initOverlay(Or,this._popup,e,t),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(e){return this._popup&&(this instanceof Zn||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(this._popup&&this._map){Yt(e);var t=e.layer||e.target;this._popup._source!==t||t instanceof or?(this._popup._source=t,this.openPopup(e.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){13===e.originalEvent.keyCode&&this._openPopup(e)}});var Lr=kr.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){kr.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){kr.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=kr.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=mt("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+s(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var t,n,r=this._map,i=this._container,o=r.latLngToContainerPoint(r.getCenter()),s=r.layerPointToContainerPoint(e),a=this.options.direction,l=i.offsetWidth,c=i.offsetHeight,u=N(this.options.offset),d=this._getAnchor();"top"===a?(t=l/2,n=c):"bottom"===a?(t=l/2,n=0):"center"===a?(t=l/2,n=c/2):"right"===a?(t=0,n=c/2):"left"===a?(t=l,n=c/2):s.x<o.x?(a="right",t=0,n=c/2):(a="left",t=l+2*(u.x+d.x),n=c/2),e=e.subtract(N(t,n,!0)).add(u).add(d),_t(i,"leaflet-tooltip-right"),_t(i,"leaflet-tooltip-left"),_t(i,"leaflet-tooltip-top"),_t(i,"leaflet-tooltip-bottom"),xt(i,"leaflet-tooltip-"+a),It(i,e)},_updatePosition:function(){var e=this._map.latLngToLayerPoint(this._latlng);this._setPosition(e)},setOpacity:function(e){this.options.opacity=e,this._container&&At(this._container,e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);this._setPosition(t)},_getAnchor:function(){return N(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Dr=function(e,t){return new Lr(e,t)};on.include({openTooltip:function(e,t,n){return this._initOverlay(Lr,e,t,n).openOn(this),this},closeTooltip:function(e){return e.close(),this}}),Jn.include({bindTooltip:function(e,t){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Lr,this._tooltip,e,t),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(e){if(e||!this._tooltipHandlersAdded){var t=e?"off":"on",n={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?n.add=this._openTooltip:(n.mouseover=this._openTooltip,n.mouseout=this.closeTooltip,n.click=this._openTooltip,this._map?this._addFocusListeners():n.add=this._addFocusListeners),this._tooltip.options.sticky&&(n.mousemove=this._moveTooltip),this[t](n),this._tooltipHandlersAdded=!e}},openTooltip:function(e){return this._tooltip&&(this instanceof Zn||(this._tooltip._source=this),this._tooltip._prepareOpen(e)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(e){return this._tooltip&&this._tooltip.setContent(e),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(e){var t="function"==typeof e.getElement&&e.getElement();t&&(Ft(t,"focus",(function(){this._tooltip._source=e,this.openTooltip()}),this),Ft(t,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(e){var t="function"==typeof e.getElement&&e.getElement();t&&t.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(e){if(this._tooltip&&this._map)if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var t=this;this._map.once("moveend",(function(){t._openOnceFlag=!1,t._openTooltip(e)}))}else this._tooltip._source=e.layer||e.target,this.openTooltip(this._tooltip.options.sticky?e.latlng:void 0)},_moveTooltip:function(e){var t,n,r=e.latlng;this._tooltip.options.sticky&&e.originalEvent&&(t=this._map.mouseEventToContainerPoint(e.originalEvent),n=this._map.containerPointToLayerPoint(t),r=this._map.layerPointToLatLng(n)),this._tooltip.setLatLng(r)}});var Br=$n.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(e){var t=e&&"DIV"===e.tagName?e:document.createElement("div"),n=this.options;if(n.html instanceof Element?(vt(t),t.appendChild(n.html)):t.innerHTML=!1!==n.html?n.html:"",n.bgPos){var r=N(n.bgPos);t.style.backgroundPosition=-r.x+"px "+-r.y+"px"}return this._setIconStyles(t,"icon"),t},createShadow:function(){return null}});function zr(e){return new Br(e)}$n.Default=tr;var Fr=Jn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:ze.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(e){p(this,e)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(e){e._addZoomLimit(this)},onRemove:function(e){this._removeAllTiles(),gt(this._container),e._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(yt(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(bt(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var e=this._clampZoom(this._map.getZoom());e!==this._tileZoom&&(this._tileZoom=e,this._updateLevels()),this._update()}return this},getEvents:function(){var e={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),e.move=this._onMove),this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},createTile:function(){return document.createElement("div")},getTileSize:function(){var e=this.options.tileSize;return e instanceof k?e:new k(e,e)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e){for(var t,n=this.getPane().children,r=-e(-1/0,1/0),i=0,o=n.length;i<o;i++)t=n[i].style.zIndex,n[i]!==this._container&&t&&(r=e(r,+t));isFinite(r)&&(this.options.zIndex=r+e(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!ze.ielt9){At(this._container,this.options.opacity);var e=+new Date,t=!1,n=!1;for(var r in this._tiles){var i=this._tiles[r];if(i.current&&i.loaded){var o=Math.min(1,(e-i.loaded)/200);At(i.el,o),o<1?t=!0:(i.active?n=!0:this._onOpaqueTile(i),i.active=!0)}}n&&!this._noPrune&&this._pruneTiles(),t&&(E(this._fadeFrame),this._fadeFrame=A(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=mt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var e=this._tileZoom,t=this.options.maxZoom;if(void 0!==e){for(var n in this._levels)n=Number(n),this._levels[n].el.children.length||n===e?(this._levels[n].el.style.zIndex=t-Math.abs(e-n),this._onUpdateLevel(n)):(gt(this._levels[n].el),this._removeTilesAtZoom(n),this._onRemoveLevel(n),delete this._levels[n]);var r=this._levels[e],i=this._map;return r||((r=this._levels[e]={}).el=mt("div","leaflet-tile-container leaflet-zoom-animated",this._container),r.el.style.zIndex=t,r.origin=i.project(i.unproject(i.getPixelOrigin()),e).round(),r.zoom=e,this._setZoomTransform(r,i.getCenter(),i.getZoom()),c(r.el.offsetWidth),this._onCreateLevel(r)),this._level=r,r}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var e,t,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)this._removeAllTiles();else{for(e in this._tiles)(t=this._tiles[e]).retain=t.current;for(e in this._tiles)if((t=this._tiles[e]).current&&!t.active){var r=t.coords;this._retainParent(r.x,r.y,r.z,r.z-5)||this._retainChildren(r.x,r.y,r.z,r.z+2)}for(e in this._tiles)this._tiles[e].retain||this._removeTile(e)}}},_removeTilesAtZoom:function(e){for(var t in this._tiles)this._tiles[t].coords.z===e&&this._removeTile(t)},_removeAllTiles:function(){for(var e in this._tiles)this._removeTile(e)},_invalidateAll:function(){for(var e in this._levels)gt(this._levels[e].el),this._onRemoveLevel(Number(e)),delete this._levels[e];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(e,t,n,r){var i=Math.floor(e/2),o=Math.floor(t/2),s=n-1,a=new k(+i,+o);a.z=+s;var l=this._tileCoordsToKey(a),c=this._tiles[l];return c&&c.active?(c.retain=!0,!0):(c&&c.loaded&&(c.retain=!0),s>r&&this._retainParent(i,o,s,r))},_retainChildren:function(e,t,n,r){for(var i=2*e;i<2*e+2;i++)for(var o=2*t;o<2*t+2;o++){var s=new k(i,o);s.z=n+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n+1<r&&this._retainChildren(i,o,n+1,r))}},_resetView:function(e){var t=e&&(e.pinch||e.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(e){this._setView(e.center,e.zoom,!0,e.noUpdate)},_clampZoom:function(e){var t=this.options;return void 0!==t.minNativeZoom&&e<t.minNativeZoom?t.minNativeZoom:void 0!==t.maxNativeZoom&&t.maxNativeZoom<e?t.maxNativeZoom:e},_setView:function(e,t,n,r){var i=Math.round(t);i=void 0!==this.options.maxZoom&&i>this.options.maxZoom||void 0!==this.options.minZoom&&i<this.options.minZoom?void 0:this._clampZoom(i);var o=this.options.updateWhenZooming&&i!==this._tileZoom;r&&!o||(this._tileZoom=i,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==i&&this._update(e),n||this._pruneTiles(),this._noPrune=!!n),this._setZoomTransforms(e,t)},_setZoomTransforms:function(e,t){for(var n in this._levels)this._setZoomTransform(this._levels[n],e,t)},_setZoomTransform:function(e,t,n){var r=this._map.getZoomScale(n,e.zoom),i=e.origin.multiplyBy(r).subtract(this._map._getNewPixelOrigin(t,n)).round();ze.any3d?Mt(e.el,i,r):It(e.el,i)},_resetGrid:function(){var e=this._map,t=e.options.crs,n=this._tileSize=this.getTileSize(),r=this._tileZoom,i=this._map.getPixelWorldBounds(this._tileZoom);i&&(this._globalTileRange=this._pxBoundsToTileRange(i)),this._wrapX=t.wrapLng&&!this.options.noWrap&&[Math.floor(e.project([0,t.wrapLng[0]],r).x/n.x),Math.ceil(e.project([0,t.wrapLng[1]],r).x/n.y)],this._wrapY=t.wrapLat&&!this.options.noWrap&&[Math.floor(e.project([t.wrapLat[0],0],r).y/n.x),Math.ceil(e.project([t.wrapLat[1],0],r).y/n.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(e){var t=this._map,n=t._animatingZoom?Math.max(t._animateToZoom,t.getZoom()):t.getZoom(),r=t.getZoomScale(n,this._tileZoom),i=t.project(e,this._tileZoom).floor(),o=t.getSize().divideBy(2*r);return new D(i.subtract(o),i.add(o))},_update:function(e){var t=this._map;if(t){var n=this._clampZoom(t.getZoom());if(void 0===e&&(e=t.getCenter()),void 0!==this._tileZoom){var r=this._getTiledPixelBounds(e),i=this._pxBoundsToTileRange(r),o=i.getCenter(),s=[],a=this.options.keepBuffer,l=new D(i.getBottomLeft().subtract([a,-a]),i.getTopRight().add([a,-a]));if(!(isFinite(i.min.x)&&isFinite(i.min.y)&&isFinite(i.max.x)&&isFinite(i.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var c in this._tiles){var u=this._tiles[c].coords;u.z===this._tileZoom&&l.contains(new k(u.x,u.y))||(this._tiles[c].current=!1)}if(Math.abs(n-this._tileZoom)>1)this._setView(e,n);else{for(var d=i.min.y;d<=i.max.y;d++)for(var h=i.min.x;h<=i.max.x;h++){var p=new k(h,d);if(p.z=this._tileZoom,this._isValidTile(p)){var f=this._tiles[this._tileCoordsToKey(p)];f?f.current=!0:s.push(p)}}if(s.sort((function(e,t){return e.distanceTo(o)-t.distanceTo(o)})),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(h=0;h<s.length;h++)this._addTile(s[h],m);this._level.el.appendChild(m)}}}}},_isValidTile:function(e){var t=this._map.options.crs;if(!t.infinite){var n=this._globalTileRange;if(!t.wrapLng&&(e.x<n.min.x||e.x>n.max.x)||!t.wrapLat&&(e.y<n.min.y||e.y>n.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(e);return F(this.options.bounds).overlaps(r)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var t=this._map,n=this.getTileSize(),r=e.scaleBy(n),i=r.add(n);return[t.unproject(r,e.z),t.unproject(i,e.z)]},_tileCoordsToBounds:function(e){var t=this._tileCoordsToNwSe(e),n=new z(t[0],t[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var t=e.split(":"),n=new k(+t[0],+t[1]);return n.z=+t[2],n},_removeTile:function(e){var t=this._tiles[e];t&&(gt(t.el),delete this._tiles[e],this.fire("tileunload",{tile:t.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){xt(e,"leaflet-tile");var t=this.getTileSize();e.style.width=t.x+"px",e.style.height=t.y+"px",e.onselectstart=c,e.onmousemove=c,ze.ielt9&&this.options.opacity<1&&At(e,this.options.opacity)},_addTile:function(e,t){var n=this._getTilePos(e),r=this._tileCoordsToKey(e),o=this.createTile(this._wrapCoords(e),i(this._tileReady,this,e));this._initTile(o),this.createTile.length<2&&A(i(this._tileReady,this,e,null,o)),It(o,n),this._tiles[r]={el:o,coords:e,current:!0},t.appendChild(o),this.fire("tileloadstart",{tile:o,coords:e})},_tileReady:function(e,t,n){t&&this.fire("tileerror",{error:t,tile:n,coords:e});var r=this._tileCoordsToKey(e);(n=this._tiles[r])&&(n.loaded=+new Date,this._map._fadeAnimated?(At(n.el,0),E(this._fadeFrame),this._fadeFrame=A(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),t||(xt(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ze.ielt9||!this._map._fadeAnimated?A(this._pruneTiles,this):setTimeout(i(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var t=new k(this._wrapX?l(e.x,this._wrapX):e.x,this._wrapY?l(e.y,this._wrapY):e.y);return t.z=e.z,t},_pxBoundsToTileRange:function(e){var t=this.getTileSize();return new D(e.min.unscaleBy(t).floor(),e.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function Ur(e){return new Fr(e)}var jr=Fr.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,t){this._url=e,(t=p(this,t)).detectRetina&&ze.retina&&t.maxZoom>0?(t.tileSize=Math.floor(t.tileSize/2),t.zoomReverse?(t.zoomOffset--,t.minZoom=Math.min(t.maxZoom,t.minZoom+1)):(t.zoomOffset++,t.maxZoom=Math.max(t.minZoom,t.maxZoom-1)),t.minZoom=Math.max(0,t.minZoom)):t.zoomReverse?t.minZoom=Math.min(t.maxZoom,t.minZoom):t.maxZoom=Math.max(t.minZoom,t.maxZoom),"string"==typeof t.subdomains&&(t.subdomains=t.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(e,t){return this._url===e&&void 0===t&&(t=!0),this._url=e,t||this.redraw(),this},createTile:function(e,t){var n=document.createElement("img");return Ft(n,"load",i(this._tileOnLoad,this,t,n)),Ft(n,"error",i(this._tileOnError,this,t,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(n.referrerPolicy=this.options.referrerPolicy),n.alt="",n.src=this.getTileUrl(e),n},getTileUrl:function(e){var t={r:ze.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var r=this._globalTileRange.max.y-e.y;this.options.tms&&(t.y=r),t["-y"]=r}return g(this._url,n(t,this.options))},_tileOnLoad:function(e,t){ze.ielt9?setTimeout(i(e,this,null,t),0):e(null,t)},_tileOnError:function(e,t,n){var r=this.options.errorTileUrl;r&&t.getAttribute("src")!==r&&(t.src=r),e(n,t)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,t=this.options.maxZoom;return this.options.zoomReverse&&(e=t-e),e+this.options.zoomOffset},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var e,t;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&((t=this._tiles[e].el).onload=c,t.onerror=c,!t.complete)){t.src=b;var n=this._tiles[e].coords;gt(t),delete this._tiles[e],this.fire("tileabort",{tile:t,coords:n})}},_removeTile:function(e){var t=this._tiles[e];if(t)return t.el.setAttribute("src",b),Fr.prototype._removeTile.call(this,e)},_tileReady:function(e,t,n){if(this._map&&(!n||n.getAttribute("src")!==b))return Fr.prototype._tileReady.call(this,e,t,n)}});function Hr(e,t){return new jr(e,t)}var Gr=jr.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,t){this._url=e;var r=n({},this.defaultWmsParams);for(var i in t)i in this.options||(r[i]=t[i]);var o=(t=p(this,t)).detectRetina&&ze.retina?2:1,s=this.getTileSize();r.width=s.x*o,r.height=s.y*o,this.wmsParams=r},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[t]=this._crs.code,jr.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._tileCoordsToNwSe(e),n=this._crs,r=B(n.project(t[0]),n.project(t[1])),i=r.min,o=r.max,s=(this._wmsVersion>=1.3&&this._crs===qn?[i.y,i.x,o.y,o.x]:[i.x,i.y,o.x,o.y]).join(","),a=jr.prototype.getTileUrl.call(this,e);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(e,t){return n(this.wmsParams,e),t||this.redraw(),this}});function Vr(e,t){return new Gr(e,t)}jr.WMS=Gr,Hr.wms=Vr;var Wr=Jn.extend({options:{padding:.1},initialize:function(e){p(this,e),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),xt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,t){var n=this._map.getZoomScale(t,this._zoom),r=this._map.getSize().multiplyBy(.5+this.options.padding),i=this._map.project(this._center,t),o=r.multiplyBy(-n).add(i).subtract(this._map._getNewPixelOrigin(e,t));ze.any3d?Mt(this._container,o,n):It(this._container,o)},_reset:function(){for(var e in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,t=this._map.getSize(),n=this._map.containerPointToLayerPoint(t.multiplyBy(-e)).round();this._bounds=new D(n,n.add(t.multiplyBy(1+2*e)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),qr=Wr.extend({options:{tolerance:0},getEvents:function(){var e=Wr.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Wr.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");Ft(e,"mousemove",this._onMouseMove,this),Ft(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ft(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){E(this._redrawRequest),delete this._ctx,gt(this._container),jt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var e in this._redrawBounds=null,this._layers)this._layers[e]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Wr.prototype._update.call(this);var e=this._bounds,t=this._container,n=e.getSize(),r=ze.retina?2:1;It(t,e.min),t.width=r*n.x,t.height=r*n.y,t.style.width=n.x+"px",t.style.height=n.y+"px",ze.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){Wr.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[s(e)]=e;var t=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var t=e._order,n=t.next,r=t.prev;n?n.prev=r:this._drawLast=r,r?r.next=n:this._drawFirst=n,delete e._order,delete this._layers[s(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if("string"==typeof e.options.dashArray){var t,n,r=e.options.dashArray.split(/[, ]+/),i=[];for(n=0;n<r.length;n++){if(t=Number(r[n]),isNaN(t))return;i.push(t)}e.options._dashArray=i}else e.options._dashArray=e.options.dashArray},_requestRedraw:function(e){this._map&&(this._extendRedrawBounds(e),this._redrawRequest=this._redrawRequest||A(this._redraw,this))},_extendRedrawBounds:function(e){if(e._pxBounds){var t=(e.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new D,this._redrawBounds.extend(e._pxBounds.min.subtract([t,t])),this._redrawBounds.extend(e._pxBounds.max.add([t,t]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var e=this._redrawBounds;if(e){var t=e.getSize();this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var e,t=this._redrawBounds;if(this._ctx.save(),t){var n=t.getSize();this._ctx.beginPath(),this._ctx.rect(t.min.x,t.min.y,n.x,n.y),this._ctx.clip()}this._drawing=!0;for(var r=this._drawFirst;r;r=r.next)e=r.layer,(!t||e._pxBounds&&e._pxBounds.intersects(t))&&e._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(e,t){if(this._drawing){var n,r,i,o,s=e._parts,a=s.length,l=this._ctx;if(a){for(l.beginPath(),n=0;n<a;n++){for(r=0,i=s[n].length;r<i;r++)o=s[n][r],l[r?"lineTo":"moveTo"](o.x,o.y);t&&l.closePath()}this._fillStroke(l,e)}}},_updateCircle:function(e){if(this._drawing&&!e._empty()){var t=e._point,n=this._ctx,r=Math.max(Math.round(e._radius),1),i=(Math.max(Math.round(e._radiusY),1)||r)/r;1!==i&&(n.save(),n.scale(1,i)),n.beginPath(),n.arc(t.x,t.y/i,r,0,2*Math.PI,!1),1!==i&&n.restore(),this._fillStroke(n,e)}},_fillStroke:function(e,t){var n=t.options;n.fill&&(e.globalAlpha=n.fillOpacity,e.fillStyle=n.fillColor||n.color,e.fill(n.fillRule||"evenodd")),n.stroke&&0!==n.weight&&(e.setLineDash&&e.setLineDash(t.options&&t.options._dashArray||[]),e.globalAlpha=n.opacity,e.lineWidth=n.weight,e.strokeStyle=n.color,e.lineCap=n.lineCap,e.lineJoin=n.lineJoin,e.stroke())},_onClick:function(e){for(var t,n,r=this._map.mouseEventToLayerPoint(e),i=this._drawFirst;i;i=i.next)(t=i.layer).options.interactive&&t._containsPoint(r)&&("click"!==e.type&&"preclick"!==e.type||!this._map._draggableMoved(t))&&(n=t);this._fireEvent(!!n&&[n],e)},_onMouseMove:function(e){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var t=this._map.mouseEventToLayerPoint(e);this._handleMouseHover(e,t)}},_handleMouseOut:function(e){var t=this._hoveredLayer;t&&(_t(this._container,"leaflet-interactive"),this._fireEvent([t],e,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(e,t){if(!this._mouseHoverThrottled){for(var n,r,o=this._drawFirst;o;o=o.next)(n=o.layer).options.interactive&&n._containsPoint(t)&&(r=n);r!==this._hoveredLayer&&(this._handleMouseOut(e),r&&(xt(this._container,"leaflet-interactive"),this._fireEvent([r],e,"mouseover"),this._hoveredLayer=r)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],e),this._mouseHoverThrottled=!0,setTimeout(i((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(e,t,n){this._map._fireDOMEvent(t,n||t.type,e)},_bringToFront:function(e){var t=e._order;if(t){var n=t.next,r=t.prev;n&&(n.prev=r,r?r.next=n:n&&(this._drawFirst=n),t.prev=this._drawLast,this._drawLast.next=t,t.next=null,this._drawLast=t,this._requestRedraw(e))}},_bringToBack:function(e){var t=e._order;if(t){var n=t.next,r=t.prev;r&&(r.next=n,n?n.prev=r:r&&(this._drawLast=r),t.prev=null,t.next=this._drawFirst,this._drawFirst.prev=t,this._drawFirst=t,this._requestRedraw(e))}}});function Kr(e){return ze.canvas?new qr(e):null}var Jr=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(e){return document.createElement("<lvml:"+e+' class="lvml">')}}catch(e){}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Qr={_initContainer:function(){this._container=mt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Wr.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var t=e._container=Jr("shape");xt(t,"leaflet-vml-shape "+(this.options.className||"")),t.coordsize="1 1",e._path=Jr("path"),t.appendChild(e._path),this._updateStyle(e),this._layers[s(e)]=e},_addPath:function(e){var t=e._container;this._container.appendChild(t),e.options.interactive&&e.addInteractiveTarget(t)},_removePath:function(e){var t=e._container;gt(t),e.removeInteractiveTarget(t),delete this._layers[s(e)]},_updateStyle:function(e){var t=e._stroke,n=e._fill,r=e.options,i=e._container;i.stroked=!!r.stroke,i.filled=!!r.fill,r.stroke?(t||(t=e._stroke=Jr("stroke")),i.appendChild(t),t.weight=r.weight+"px",t.color=r.color,t.opacity=r.opacity,r.dashArray?t.dashStyle=v(r.dashArray)?r.dashArray.join(" "):r.dashArray.replace(/( *, *)/g," "):t.dashStyle="",t.endcap=r.lineCap.replace("butt","flat"),t.joinstyle=r.lineJoin):t&&(i.removeChild(t),e._stroke=null),r.fill?(n||(n=e._fill=Jr("fill")),i.appendChild(n),n.color=r.fillColor||r.color,n.opacity=r.fillOpacity):n&&(i.removeChild(n),e._fill=null)},_updateCircle:function(e){var t=e._point.round(),n=Math.round(e._radius),r=Math.round(e._radiusY||n);this._setPath(e,e._empty()?"M0 0":"AL "+t.x+","+t.y+" "+n+","+r+" 0,23592600")},_setPath:function(e,t){e._path.v=t},_bringToFront:function(e){yt(e._container)},_bringToBack:function(e){bt(e._container)}},Yr=ze.vml?Jr:Z,Zr=Wr.extend({_initContainer:function(){this._container=Yr("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Yr("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){gt(this._container),jt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){Wr.prototype._update.call(this);var e=this._bounds,t=e.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(t)||(this._svgSize=t,n.setAttribute("width",t.x),n.setAttribute("height",t.y)),It(n,e.min),n.setAttribute("viewBox",[e.min.x,e.min.y,t.x,t.y].join(" ")),this.fire("update")}},_initPath:function(e){var t=e._path=Yr("path");e.options.className&&xt(t,e.options.className),e.options.interactive&&xt(t,"leaflet-interactive"),this._updateStyle(e),this._layers[s(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){gt(e._path),e.removeInteractiveTarget(e._path),delete this._layers[s(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var t=e._path,n=e.options;t&&(n.stroke?(t.setAttribute("stroke",n.color),t.setAttribute("stroke-opacity",n.opacity),t.setAttribute("stroke-width",n.weight),t.setAttribute("stroke-linecap",n.lineCap),t.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?t.setAttribute("stroke-dasharray",n.dashArray):t.removeAttribute("stroke-dasharray"),n.dashOffset?t.setAttribute("stroke-dashoffset",n.dashOffset):t.removeAttribute("stroke-dashoffset")):t.setAttribute("stroke","none"),n.fill?(t.setAttribute("fill",n.fillColor||n.color),t.setAttribute("fill-opacity",n.fillOpacity),t.setAttribute("fill-rule",n.fillRule||"evenodd")):t.setAttribute("fill","none"))},_updatePoly:function(e,t){this._setPath(e,X(e._parts,t))},_updateCircle:function(e){var t=e._point,n=Math.max(Math.round(e._radius),1),r="a"+n+","+(Math.max(Math.round(e._radiusY),1)||n)+" 0 1,0 ",i=e._empty()?"M0 0":"M"+(t.x-n)+","+t.y+r+2*n+",0 "+r+2*-n+",0 ";this._setPath(e,i)},_setPath:function(e,t){e._path.setAttribute("d",t)},_bringToFront:function(e){yt(e._path)},_bringToBack:function(e){bt(e._path)}});function Xr(e){return ze.svg||ze.vml?new Zr(e):null}ze.vml&&Zr.include(Qr),on.include({getRenderer:function(e){var t=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return t||(t=this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(e){if("overlayPane"===e||void 0===e)return!1;var t=this._paneRenderers[e];return void 0===t&&(t=this._createRenderer({pane:e}),this._paneRenderers[e]=t),t},_createRenderer:function(e){return this.options.preferCanvas&&Kr(e)||Xr(e)}});var $r=hr.extend({initialize:function(e,t){hr.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return[(e=F(e)).getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function ei(e,t){return new $r(e,t)}Zr.create=Yr,Zr.pointsToPath=X,fr.geometryToLayer=mr,fr.coordsToLatLng=vr,fr.coordsToLatLngs=yr,fr.latLngToCoords=br,fr.latLngsToCoords=Sr,fr.getFeature=xr,fr.asFeature=_r,on.mergeOptions({boxZoom:!0});var ti=yn.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){Ft(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){jt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){gt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||1!==e.which&&1!==e.button)return!1;this._clearDeferredResetState(),this._resetState(),ot(),kt(),this._startPoint=this._map.mouseEventToContainerPoint(e),Ft(document,{contextmenu:Yt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=mt("div","leaflet-zoom-box",this._container),xt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var t=new D(this._point,this._startPoint),n=t.getSize();It(this._box,t.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(gt(this._box),_t(this._container,"leaflet-crosshair")),st(),Ot(),jt(document,{contextmenu:Yt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if((1===e.which||1===e.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(i(this._resetState,this),0);var t=new z(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})}},_onKeyDown:function(e){27===e.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});on.addInitHook("addHandler","boxZoom",ti),on.mergeOptions({doubleClickZoom:!0});var ni=yn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var t=this._map,n=t.getZoom(),r=t.options.zoomDelta,i=e.originalEvent.shiftKey?n-r:n+r;"center"===t.options.doubleClickZoom?t.setZoom(i):t.setZoomAround(e.containerPoint,i)}});on.addInitHook("addHandler","doubleClickZoom",ni),on.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ri=yn.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new xn(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}xt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){_t(this._map._container,"leaflet-grab"),_t(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var t=F(this._map.options.maxBounds);this._offsetLimit=B(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var t=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(t),this._prunePositions(t)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,t){return e-(e-t)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var e=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;e.x<t.min.x&&(e.x=this._viscousLimit(e.x,t.min.x)),e.y<t.min.y&&(e.y=this._viscousLimit(e.y,t.min.y)),e.x>t.max.x&&(e.x=this._viscousLimit(e.x,t.max.x)),e.y>t.max.y&&(e.y=this._viscousLimit(e.y,t.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,i=(r-t+n)%e+t-n,o=(r+t+n)%e-t-n,s=Math.abs(i+n)<Math.abs(o+n)?i:o;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=s},_onDragEnd:function(e){var t=this._map,n=t.options,r=!n.inertia||e.noInertia||this._times.length<2;if(t.fire("dragend",e),r)t.fire("moveend");else{this._prunePositions(+new Date);var i=this._lastPos.subtract(this._positions[0]),o=(this._lastTime-this._times[0])/1e3,s=n.easeLinearity,a=i.multiplyBy(s/o),l=a.distanceTo([0,0]),c=Math.min(n.inertiaMaxSpeed,l),u=a.multiplyBy(c/l),d=c/(n.inertiaDeceleration*s),h=u.multiplyBy(-d/2).round();h.x||h.y?(h=t._limitOffset(h,t.options.maxBounds),A((function(){t.panBy(h,{duration:d,easeLinearity:s,noMoveStart:!0,animate:!0})}))):t.fire("moveend")}}});on.addInitHook("addHandler","dragging",ri),on.mergeOptions({keyboard:!0,keyboardPanDelta:80});var ii=yn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(e){this._map=e,this._setPanDelta(e.options.keyboardPanDelta),this._setZoomDelta(e.options.zoomDelta)},addHooks:function(){var e=this._map._container;e.tabIndex<=0&&(e.tabIndex="0"),Ft(e,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),jt(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var e=document.body,t=document.documentElement,n=e.scrollTop||t.scrollTop,r=e.scrollLeft||t.scrollLeft;this._map._container.focus(),window.scrollTo(r,n)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(e){var t,n,r=this._panKeys={},i=this.keyCodes;for(t=0,n=i.left.length;t<n;t++)r[i.left[t]]=[-1*e,0];for(t=0,n=i.right.length;t<n;t++)r[i.right[t]]=[e,0];for(t=0,n=i.down.length;t<n;t++)r[i.down[t]]=[0,e];for(t=0,n=i.up.length;t<n;t++)r[i.up[t]]=[0,-1*e]},_setZoomDelta:function(e){var t,n,r=this._zoomKeys={},i=this.keyCodes;for(t=0,n=i.zoomIn.length;t<n;t++)r[i.zoomIn[t]]=e;for(t=0,n=i.zoomOut.length;t<n;t++)r[i.zoomOut[t]]=-e},_addHooks:function(){Ft(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){jt(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(e){if(!(e.altKey||e.ctrlKey||e.metaKey)){var t,n=e.keyCode,r=this._map;if(n in this._panKeys){if(!r._panAnim||!r._panAnim._inProgress)if(t=this._panKeys[n],e.shiftKey&&(t=N(t).multiplyBy(3)),r.options.maxBounds&&(t=r._limitOffset(N(t),r.options.maxBounds)),r.options.worldCopyJump){var i=r.wrapLatLng(r.unproject(r.project(r.getCenter()).add(t)));r.panTo(i)}else r.panBy(t)}else if(n in this._zoomKeys)r.setZoom(r.getZoom()+(e.shiftKey?3:1)*this._zoomKeys[n]);else{if(27!==n||!r._popup||!r._popup.options.closeOnEscapeKey)return;r.closePopup()}Yt(e)}}});on.addInitHook("addHandler","keyboard",ii),on.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var oi=yn.extend({addHooks:function(){Ft(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){jt(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(e){var t=en(e),n=this._map.options.wheelDebounceTime;this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),this._startTime||(this._startTime=+new Date);var r=Math.max(n-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(i(this._performZoom,this),r),Yt(e)},_performZoom:function(){var e=this._map,t=e.getZoom(),n=this._map.options.zoomSnap||0;e._stop();var r=this._delta/(4*this._map.options.wheelPxPerZoomLevel),i=4*Math.log(2/(1+Math.exp(-Math.abs(r))))/Math.LN2,o=n?Math.ceil(i/n)*n:i,s=e._limitZoom(t+(this._delta>0?o:-o))-t;this._delta=0,this._startTime=null,s&&("center"===e.options.scrollWheelZoom?e.setZoom(t+s):e.setZoomAround(this._lastMousePos,t+s))}});on.addInitHook("addHandler","scrollWheelZoom",oi);var si=600;on.mergeOptions({tapHold:ze.touchNative&&ze.safari&&ze.mobile,tapTolerance:15});var ai=yn.extend({addHooks:function(){Ft(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){jt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),1===e.touches.length){var t=e.touches[0];this._startPos=this._newPos=new k(t.clientX,t.clientY),this._holdTimeout=setTimeout(i((function(){this._cancel(),this._isTapValid()&&(Ft(document,"touchend",Qt),Ft(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",t))}),this),si),Ft(document,"touchend touchcancel contextmenu",this._cancel,this),Ft(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){jt(document,"touchend",Qt),jt(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),jt(document,"touchend touchcancel contextmenu",this._cancel,this),jt(document,"touchmove",this._onMove,this)},_onMove:function(e){var t=e.touches[0];this._newPos=new k(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,t){var n=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY});n._simulated=!0,t.target.dispatchEvent(n)}});on.addInitHook("addHandler","tapHold",ai),on.mergeOptions({touchZoom:ze.touch,bounceAtZoomLimits:!0});var li=yn.extend({addHooks:function(){xt(this._map._container,"leaflet-touch-zoom"),Ft(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){_t(this._map._container,"leaflet-touch-zoom"),jt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(e.touches&&2===e.touches.length&&!t._animatingZoom&&!this._zooming){var n=t.mouseEventToContainerPoint(e.touches[0]),r=t.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=t.getSize()._divideBy(2),this._startLatLng=t.containerPointToLatLng(this._centerPoint),"center"!==t.options.touchZoom&&(this._pinchStartLatLng=t.containerPointToLatLng(n.add(r)._divideBy(2))),this._startDist=n.distanceTo(r),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),Ft(document,"touchmove",this._onTouchMove,this),Ft(document,"touchend touchcancel",this._onTouchEnd,this),Qt(e)}},_onTouchMove:function(e){if(e.touches&&2===e.touches.length&&this._zooming){var t=this._map,n=t.mouseEventToContainerPoint(e.touches[0]),r=t.mouseEventToContainerPoint(e.touches[1]),o=n.distanceTo(r)/this._startDist;if(this._zoom=t.getScaleZoom(o,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoom<t.getMinZoom()&&o<1||this._zoom>t.getMaxZoom()&&o>1)&&(this._zoom=t._limitZoom(this._zoom)),"center"===t.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var s=n._add(r)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===s.x&&0===s.y)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(t._moveStart(!0,!1),this._moved=!0),E(this._animRequest);var a=i(t._move,t,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=A(a,this,!0),Qt(e)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,E(this._animRequest),jt(document,"touchmove",this._onTouchMove,this),jt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});on.addInitHook("addHandler","touchZoom",li),on.BoxZoom=ti,on.DoubleClickZoom=ni,on.Drag=ri,on.Keyboard=ii,on.ScrollWheelZoom=oi,on.TapHold=ai,on.TouchZoom=li,e.Bounds=D,e.Browser=ze,e.CRS=G,e.Canvas=qr,e.Circle=lr,e.CircleMarker=sr,e.Class=M,e.Control=an,e.DivIcon=Br,e.DivOverlay=kr,e.DomEvent=nn,e.DomUtil=zt,e.Draggable=xn,e.Evented=P,e.FeatureGroup=Zn,e.GeoJSON=fr,e.GridLayer=Fr,e.Handler=yn,e.Icon=$n,e.ImageOverlay=Er,e.LatLng=U,e.LatLngBounds=z,e.Layer=Jn,e.LayerGroup=Qn,e.LineUtil=jn,e.Map=on,e.Marker=rr,e.Mixin=bn,e.Path=or,e.Point=k,e.PolyUtil=En,e.Polygon=hr,e.Polyline=ur,e.Popup=Or,e.PosAnimation=rn,e.Projection=Vn,e.Rectangle=$r,e.Renderer=Wr,e.SVG=Zr,e.SVGOverlay=Rr,e.TileLayer=jr,e.Tooltip=Lr,e.Transformation=K,e.Util=T,e.VideoOverlay=Mr,e.bind=i,e.bounds=B,e.canvas=Kr,e.circle=cr,e.circleMarker=ar,e.control=ln,e.divIcon=zr,e.extend=n,e.featureGroup=Xn,e.geoJSON=Cr,e.geoJson=Ar,e.gridLayer=Ur,e.icon=er,e.imageOverlay=Tr,e.latLng=j,e.latLngBounds=F,e.layerGroup=Yn,e.map=sn,e.marker=ir,e.point=N,e.polygon=pr,e.polyline=dr,e.popup=Nr,e.rectangle=ei,e.setOptions=p,e.stamp=s,e.svg=Xr,e.svgOverlay=Pr,e.tileLayer=Hr,e.tooltip=Dr,e.transformation=J,e.version=t,e.videoOverlay=Ir;var ci=window.L;e.noConflict=function(){return window.L=ci,this},window.L=e}(If);const kf=(0,(c=o("85Hg2")).forwardRef)(Pf);c=o("85Hg2");function Of(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function Nf(e,t){return null==t?function(t,n){const r=(0,c.useRef)();return r.current||(r.current=e(t,n)),r}:function(n,r){const i=(0,c.useRef)();i.current||(i.current=e(n,r));const o=(0,c.useRef)(n),{instance:s}=i.current;return(0,c.useEffect)((function(){o.current!==n&&(t(s,n,o.current),o.current=n)}),[s,n,r]),i}}c=o("85Hg2");function Lf(e){function n(n,r){const{instance:i,context:o}=e(n).current;return(0,c.useImperativeHandle)(r,(()=>i)),null==n.children?null:t(c).createElement(Tf,{value:o},n.children)}return(0,c.forwardRef)(n)}function Df(e){function t(t,n){const[r,i]=(0,c.useState)(!1),{instance:o}=e(t,i).current;(0,c.useImperativeHandle)(n,(()=>o)),(0,c.useEffect)((function(){r&&o.update()}),[o,r,t.children]);const s=o._contentNode;return s?(0,a.createPortal)(t.children,s):null}return(0,c.forwardRef)(t)}function Bf(e){function t(t,n){const{instance:r}=e(t).current;return(0,c.useImperativeHandle)(n,(()=>r)),null}return(0,c.forwardRef)(t)}c=o("85Hg2");c=o("85Hg2"),c=o("85Hg2");function zf(e,t){const n=(0,c.useRef)(t);(0,c.useEffect)((function(){t!==n.current&&null!=e.attributionControl&&(null!=n.current&&e.attributionControl.removeAttribution(n.current),null!=t&&e.attributionControl.addAttribution(t)),n.current=t}),[e,t])}c=o("85Hg2");function Ff(e,t){const n=(0,c.useRef)();(0,c.useEffect)((function(){return null!=t&&e.instance.on(t),n.current=t,function(){null!=n.current&&e.instance.off(n.current),n.current=null}}),[e,t])}function Uf(e,t){const n=e.pane??t.pane;return n?{...e,pane:n}:e}function jf(e,t){(0,c.useEffect)((function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){t.layerContainer?.removeLayer(e.instance),t.map.removeLayer(e.instance)}}),[t,e])}function Hf(e){return function(t){const n=Mf(),r=e(Uf(t,n),n);return zf(n.map,t.attribution),Ff(r.current,t.eventHandlers),jf(r.current,n),r}}function Gf(e,t){return function(n,r){const i=Mf(),o=e(Uf(n,i),i);return zf(i.map,n.attribution),Ff(o.current,n.eventHandlers),t(o.current,i,n,r),o}}c=o("85Hg2");const Vf=(Wf=function({position:e,...t},n){const r=new(0,If.Marker)(e,t);return Of(r,(i=n,o={overlayContainer:r},Object.freeze({...i,...o})));var i,o},Lf(Hf(Nf(Wf,(function(e,t,n){t.position!==n.position&&e.setLatLng(t.position),null!=t.icon&&t.icon!==n.icon&&e.setIcon(t.icon),null!=t.zIndexOffset&&t.zIndexOffset!==n.zIndexOffset&&e.setZIndexOffset(t.zIndexOffset),null!=t.opacity&&t.opacity!==n.opacity&&e.setOpacity(t.opacity),null!=e.dragging&&t.draggable!==n.draggable&&(!0===t.draggable?e.dragging.enable():e.dragging.disable())})))));var Wf;c=o("85Hg2");const qf=function(e,t){return Df(Gf(Nf(e),t))}((function(e,t){return Of(new(0,If.Popup)(e,t.overlayContainer),t)}),(function(e,t,{position:n},r){(0,c.useEffect)((function(){const{instance:i}=e;function o(e){e.popup===i&&(i.update(),r(!0))}function s(e){e.popup===i&&r(!1)}return t.map.on({popupopen:o,popupclose:s}),null==t.overlayContainer?(null!=n&&i.setLatLng(n),i.openOn(t.map)):t.overlayContainer.bindPopup(i),function(){t.map.off({popupopen:o,popupclose:s}),t.overlayContainer?.unbindPopup(),t.map.removeLayer(i)}}),[e,t,r,n])}));function Kf(e,t,n){const{opacity:r,zIndex:i}=t;null!=r&&r!==n.opacity&&e.setOpacity(r),null!=i&&i!==n.zIndex&&e.setZIndex(i)}const Jf=function(e,t){return Bf(Hf(Nf(e,t)))}((function({url:e,...t},n){return Of(new(0,If.TileLayer)(e,Uf(t,n)),n)}),(function(e,t,n){Kf(e,t,n);const{url:r}=t;null!=r&&r!==n.url&&e.setUrl(r)}));c=o("85Hg2");function Qf(){return Mf().map}c=o("85Hg2");const Yf=()=>{let e=!1;if("maxTouchPoints"in navigator)e=navigator.maxTouchPoints>0;else if("msMaxTouchPoints"in navigator)e=navigator.msMaxTouchPoints>0;else{const n=window&&"matchMedia"in window&&matchMedia("(pointer:coarse)");if(n&&"(pointer:coarse)"===n.media)e=!!n.matches;else if("orientation"in window)e=!0;else{var t=null===navigator||void 0===navigator?void 0:navigator.userAgent;e=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(t)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(t)}}return e},Zf=()=>{var e;let t=(null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgentData)||void 0===e?void 0:e.platform)||(null===navigator||void 0===navigator?void 0:navigator.platform)||"unknown",n=(null===navigator||void 0===navigator?void 0:navigator.userAgent)||"unknown";return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(t)||n.includes("Mac")&&"ontouchend"in document};function Xf(e,t){const n=(0,c.useRef)(),r=(0,c.useRef)(null);return(0,c.useEffect)((()=>(r.current=e,()=>{r.current=null})),[e]),(0,c.useEffect)((()=>()=>{clearTimeout(n.current)}),[]),(0,c.useMemo)((()=>(...e)=>{clearTimeout(n.current),n.current=window.setTimeout((()=>{r.current&&r.current(...e)}),t)}),[t])}const $f=e=>e.slice(0,e.length/2).trim().toLowerCase()===e.slice(e.length/2+1).trim().toLowerCase()?e.slice(0,e.length/2):e,em=e=>e.replaceAll(/[^\p{L}\p{N}\p{P}\p{Z}^$\n]/gu,"").trim();function tm(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}c=o("85Hg2"),c=o("85Hg2");function nm(e,t){let[n,r]=(0,c.useState)(e),i=Ch(e);return _h((()=>r(i.current)),[i,r,...t]),n}c=o("85Hg2");function rm(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function im(e,t){let[n,r]=(0,c.useState)((()=>rm(e)));return _h((()=>{r(rm(e))}),[e.type,e.as]),_h((()=>{n||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")}),[n,t]),n}c=o("85Hg2");function om({container:e,accept:t,walk:n,enabled:r=!0}){let i=(0,c.useRef)(t),o=(0,c.useRef)(n);(0,c.useEffect)((()=>{i.current=t,o.current=n}),[t,n]),_h((()=>{if(!e||!r)return;let t=dp(e);if(!t)return;let n=i.current,s=o.current,a=Object.assign((e=>n(e)),{acceptNode:n}),l=t.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,a,!1);for(;l.nextNode();)s(l.currentNode)}),[e,r,i,o])}var sm=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(sm||{});function am(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=null!=r?r:-1,o=(()=>{switch(e.focus){case 0:return n.findIndex((e=>!t.resolveDisabled(e)));case 1:{let e=n.slice().reverse().findIndex(((e,n,r)=>!(-1!==i&&r.length-n-1>=i)&&!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 2:return n.findIndex(((e,n)=>!(n<=i)&&!t.resolveDisabled(e)));case 3:{let e=n.slice().reverse().findIndex((e=>!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 4:return n.findIndex((n=>t.resolveId(n)===e.id));case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}})();return-1===o?r:o}function lm(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))um(n,cm(t,r),i);return n}function cm(e,t){return e?e+"["+t+"]":t}function um(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())um(e,cm(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):"boolean"==typeof n?e.push([t,n?"1":"0"]):"string"==typeof n?e.push([t,n]):"number"==typeof n?e.push([t,`${n}`]):null==n?e.push([t,""]):lm(n,t,e)}function dm(e){var t;let n=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(n)for(let e of n.elements)if("INPUT"===e.tagName&&"submit"===e.type||"BUTTON"===e.tagName&&"submit"===e.type||"INPUT"===e.nodeName&&"image"===e.type)return void e.click()}c=o("85Hg2");function hm(e,t,n){let[r,i]=(0,c.useState)(n),o=void 0!==e,s=(0,c.useRef)(o),a=(0,c.useRef)(!1),l=(0,c.useRef)(!1);return!o||s.current||a.current?!o&&s.current&&!l.current&&(l.current=!0,s.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(a.current=!0,s.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[o?e:r,Th((e=>(o||i(e),null==t?void 0:t(e))))]}var pm=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(pm||{}),fm=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(fm||{}),mm=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(mm||{}),gm=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e))(gm||{});function vm(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=wp(t(e.options.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{options:r,activeOptionIndex:i}}let ym={1:e=>e.dataRef.current.disabled||1===e.comboboxState?e:{...e,activeOptionIndex:null,comboboxState:1},0(e){if(e.dataRef.current.disabled||0===e.comboboxState)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,r=e.options.findIndex((e=>n(e.dataRef.current.value)));return-1!==r&&(t=r),{...e,comboboxState:0,activeOptionIndex:t}},2(e,t){var n;if(e.dataRef.current.disabled||e.dataRef.current.optionsRef.current&&!e.dataRef.current.optionsPropsRef.current.static&&1===e.comboboxState)return e;let r=vm(e);if(null===r.activeOptionIndex){let e=r.options.findIndex((e=>!e.dataRef.current.disabled));-1!==e&&(r.activeOptionIndex=e)}let i=am(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,activeOptionIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=vm(e,(e=>[...e,n]));null===e.activeOptionIndex&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(n));let i={...e,...r,activationTrigger:1};return e.dataRef.current.__demoMode&&void 0===e.dataRef.current.value&&(i.activeOptionIndex=0),i},4:(e,t)=>{let n=vm(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}},5:(e,t)=>({...e,labelId:t.id})},bm=(0,c.createContext)(null);function Sm(e){let t=(0,c.useContext)(bm);if(null===t){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Sm),t}return t}bm.displayName="ComboboxActionsContext";let xm=(0,c.createContext)(null);function _m(e){let t=(0,c.useContext)(xm);if(null===t){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,_m),t}return t}function wm(e,t){return ah(t.type,ym,e,t)}xm.displayName="ComboboxDataContext";let Cm=c.Fragment;let Am=fh((function(e,n){let{value:r,defaultValue:i,onChange:o,name:s,by:a=((e,t)=>e===t),disabled:l=!1,__demoMode:u=!1,nullable:d=!1,multiple:h=!1,...p}=e,[f,m]=hm(r,o,i),[g,v]=(0,c.useReducer)(wm,{dataRef:(0,c.createRef)(),comboboxState:u?0:1,options:[],activeOptionIndex:null,activationTrigger:1,labelId:null}),y=(0,c.useRef)(!1),b=(0,c.useRef)({static:!1,hold:!1}),S=(0,c.useRef)(null),x=(0,c.useRef)(null),_=(0,c.useRef)(null),w=(0,c.useRef)(null),C=Th("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a),A=(0,c.useCallback)((e=>ah(E.mode,{1:()=>f.some((t=>C(t,e))),0:()=>C(f,e)})),[f]),E=(0,c.useMemo)((()=>({...g,optionsPropsRef:b,labelRef:S,inputRef:x,buttonRef:_,optionsRef:w,value:f,disabled:l,mode:h?1:0,get activeOptionIndex(){if(y.current&&null===g.activeOptionIndex&&g.options.length>0){let e=g.options.findIndex((e=>!e.dataRef.current.disabled));if(-1!==e)return e}return g.activeOptionIndex},compare:C,isSelected:A,nullable:d,__demoMode:u})),[f,l,h,d,u,g]);_h((()=>{g.dataRef.current=E}),[E]),nf([E.buttonRef,E.inputRef,E.optionsRef],(()=>v({type:1})),0===E.comboboxState);let T=(0,c.useMemo)((()=>({open:0===E.comboboxState,disabled:l,activeIndex:E.activeOptionIndex,activeOption:null===E.activeOptionIndex?null:E.options[E.activeOptionIndex].dataRef.current.value,value:f})),[E,l,f]),M=Th((e=>{let t=E.options.find((t=>t.id===e));!t||L(t.dataRef.current.value)})),I=Th((()=>{if(null!==E.activeOptionIndex){let{dataRef:e,id:t}=E.options[E.activeOptionIndex];L(e.current.value),v({type:2,focus:sm.Specific,id:t})}})),R=Th((()=>{v({type:0}),y.current=!0})),P=Th((()=>{v({type:1}),y.current=!1})),k=Th(((e,t,n)=>(y.current=!1,e===sm.Specific?v({type:2,focus:sm.Specific,id:t,trigger:n}):v({type:2,focus:e,trigger:n})))),O=Th(((e,t)=>(v({type:3,id:e,dataRef:t}),()=>v({type:4,id:e})))),N=Th((e=>(v({type:5,id:e}),()=>v({type:5,id:null})))),L=Th((e=>ah(E.mode,{0:()=>null==m?void 0:m(e),1(){let t=E.value.slice(),n=t.findIndex((t=>C(t,e)));return-1===n?t.push(e):t.splice(n,1),null==m?void 0:m(t)}}))),D=(0,c.useMemo)((()=>({onChange:L,registerOption:O,registerLabel:N,goToOption:k,closeCombobox:P,openCombobox:R,selectActiveOption:I,selectOption:M})),[]),B=null===n?{}:{ref:n};return t(c).createElement(bm.Provider,{value:D},t(c).createElement(xm.Provider,{value:E},t(c).createElement(Sh,{value:ah(E.comboboxState,{0:yh.Open,1:yh.Closed})},null!=s&&null!=f&&lm({[s]:f}).map((([e,n])=>t(c).createElement(up,{features:cp.Hidden,...mh({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:n})}))),dh({ourProps:B,theirProps:p,slot:T,defaultTag:Cm,name:"Combobox"}))))})),Em=fh((function(e,t){var n,r;let{value:i,onChange:o,displayValue:s,type:a="text",...l}=e,u=_m("Combobox.Input"),d=Sm("Combobox.Input"),h=Rh(u.inputRef,t),p=`headlessui-combobox-input-${lp()}`,f=Fh(),m=!1;Pp((([e,t],[n,r])=>{!u.inputRef.current||(0===r&&1===t?function(e){var t;let n=u.inputRef.current;if(!n||n.value===e)return;let r=Object.getOwnPropertyDescriptor(n.constructor.prototype,"value");null==(t=null==r?void 0:r.set)||t.call(n,e),m=!0,n.dispatchEvent(new Event("input",{bubbles:!0})),n.value=e,m=!1}(e):e!==n&&(u.inputRef.current.value=e))}),[(0,c.useMemo)((()=>{var e;return"function"==typeof s?null!=(e=s(u.value))?e:"":"string"==typeof u.value?u.value:""}),[u.value]),u.comboboxState]);let g=(0,c.useRef)(!1),v=Th((()=>{g.current=!0})),y=Th((()=>{setTimeout((()=>{g.current=!1}))})),b=Th((e=>{switch(e.key){case rp.Backspace:case rp.Delete:if(0!==u.mode||!u.nullable)return;let t=e.currentTarget;f.requestAnimationFrame((()=>{""===t.value&&(d.onChange(null),u.optionsRef.current&&(u.optionsRef.current.scrollTop=0),d.goToOption(sm.Nothing))}));break;case rp.Enter:if(0!==u.comboboxState||g.current)return;if(e.preventDefault(),e.stopPropagation(),null===u.activeOptionIndex)return void d.closeCombobox();d.selectActiveOption(),0===u.mode&&d.closeCombobox();break;case rp.ArrowDown:return e.preventDefault(),e.stopPropagation(),ah(u.comboboxState,{0:()=>{d.goToOption(sm.Next)},1:()=>{d.openCombobox()}});case rp.ArrowUp:return e.preventDefault(),e.stopPropagation(),ah(u.comboboxState,{0:()=>{d.goToOption(sm.Previous)},1:()=>{d.openCombobox(),f.nextFrame((()=>{u.value||d.goToOption(sm.Last)}))}});case rp.Home:case rp.PageUp:return e.preventDefault(),e.stopPropagation(),d.goToOption(sm.First);case rp.End:case rp.PageDown:return e.preventDefault(),e.stopPropagation(),d.goToOption(sm.Last);case rp.Escape:return 0!==u.comboboxState?void 0:(e.preventDefault(),u.optionsRef.current&&!u.optionsPropsRef.current.static&&e.stopPropagation(),d.closeCombobox());case rp.Tab:if(0!==u.comboboxState)return;0===u.mode&&d.selectActiveOption(),d.closeCombobox()}})),S=Th((e=>{m||d.openCombobox(),null==o||o(e)})),x=nm((()=>{if(u.labelId)return[u.labelId].join(" ")}),[u.labelId]),_=(0,c.useMemo)((()=>({open:0===u.comboboxState,disabled:u.disabled})),[u]);return dh({ourProps:{ref:h,id:p,role:"combobox",type:a,"aria-controls":null==(n=u.optionsRef.current)?void 0:n.id,"aria-expanded":u.disabled?void 0:0===u.comboboxState,"aria-activedescendant":null===u.activeOptionIndex||null==(r=u.options[u.activeOptionIndex])?void 0:r.id,"aria-multiselectable":1===u.mode||void 0,"aria-labelledby":x,disabled:u.disabled,onCompositionStart:v,onCompositionEnd:y,onKeyDown:b,onChange:S},theirProps:l,slot:_,defaultTag:"input",name:"Combobox.Input"})})),Tm=fh((function(e,t){var n;let r=_m("Combobox.Button"),i=Sm("Combobox.Button"),o=Rh(r.buttonRef,t),s=`headlessui-combobox-button-${lp()}`,a=Fh(),l=Th((e=>{switch(e.key){case rp.ArrowDown:return e.preventDefault(),e.stopPropagation(),1===r.comboboxState&&i.openCombobox(),a.nextFrame((()=>{var e;return null==(e=r.inputRef.current)?void 0:e.focus({preventScroll:!0})}));case rp.ArrowUp:return e.preventDefault(),e.stopPropagation(),1===r.comboboxState&&(i.openCombobox(),a.nextFrame((()=>{r.value||i.goToOption(sm.Last)}))),a.nextFrame((()=>{var e;return null==(e=r.inputRef.current)?void 0:e.focus({preventScroll:!0})}));case rp.Escape:return 0!==r.comboboxState?void 0:(e.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&e.stopPropagation(),i.closeCombobox(),a.nextFrame((()=>{var e;return null==(e=r.inputRef.current)?void 0:e.focus({preventScroll:!0})})));default:return}})),u=Th((e=>{if(ip(e.currentTarget))return e.preventDefault();0===r.comboboxState?i.closeCombobox():(e.preventDefault(),i.openCombobox()),a.nextFrame((()=>{var e;return null==(e=r.inputRef.current)?void 0:e.focus({preventScroll:!0})}))})),d=nm((()=>{if(r.labelId)return[r.labelId,s].join(" ")}),[r.labelId,s]),h=(0,c.useMemo)((()=>({open:0===r.comboboxState,disabled:r.disabled,value:r.value})),[r]),p=e;return dh({ourProps:{ref:o,id:s,type:im(e,r.buttonRef),tabIndex:-1,"aria-haspopup":!0,"aria-controls":null==(n=r.optionsRef.current)?void 0:n.id,"aria-expanded":r.disabled?void 0:0===r.comboboxState,"aria-labelledby":d,disabled:r.disabled,onClick:u,onKeyDown:l},theirProps:p,slot:h,defaultTag:"button",name:"Combobox.Button"})})),Mm=fh((function(e,t){let n=_m("Combobox.Label"),r=`headlessui-combobox-label-${lp()}`,i=Sm("Combobox.Label"),o=Rh(n.labelRef,t);_h((()=>i.registerLabel(r)),[r]);let s=Th((()=>{var e;return null==(e=n.inputRef.current)?void 0:e.focus({preventScroll:!0})})),a=(0,c.useMemo)((()=>({open:0===n.comboboxState,disabled:n.disabled})),[n]);return dh({ourProps:{ref:o,id:r,onClick:s},theirProps:e,slot:a,defaultTag:"label",name:"Combobox.Label"})})),Im=ch.RenderStrategy|ch.Static,Rm=fh((function(e,t){var n;let{hold:r=!1,...i}=e,o=_m("Combobox.Options"),s=Rh(o.optionsRef,t),a=`headlessui-combobox-options-${lp()}`,l=bh(),u=null!==l?l===yh.Open:0===o.comboboxState;_h((()=>{var t;o.optionsPropsRef.current.static=null!=(t=e.static)&&t}),[o.optionsPropsRef,e.static]),_h((()=>{o.optionsPropsRef.current.hold=r}),[o.optionsPropsRef,r]),om({container:o.optionsRef.current,enabled:0===o.comboboxState,accept:e=>"option"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let d=nm((()=>{var e,t;return null!=(t=o.labelId)?t:null==(e=o.buttonRef.current)?void 0:e.id}),[o.labelId,o.buttonRef.current]),h=(0,c.useMemo)((()=>({open:0===o.comboboxState})),[o]);return dh({ourProps:{"aria-activedescendant":null===o.activeOptionIndex||null==(n=o.options[o.activeOptionIndex])?void 0:n.id,"aria-labelledby":d,role:"listbox",id:a,ref:s},theirProps:i,slot:h,defaultTag:"ul",features:Im,visible:u,name:"Combobox.Options"})})),Pm=fh((function(e,t){var n,r;let{disabled:i=!1,value:o,...s}=e,a=_m("Combobox.Option"),l=Sm("Combobox.Option"),u=`headlessui-combobox-option-${lp()}`,d=null!==a.activeOptionIndex&&a.options[a.activeOptionIndex].id===u,h=a.isSelected(o),p=(0,c.useRef)(null),f=Ch({disabled:i,value:o,domRef:p,textValue:null==(r=null==(n=p.current)?void 0:n.textContent)?void 0:r.toLowerCase()}),m=Rh(t,p),g=Th((()=>l.selectOption(u)));_h((()=>l.registerOption(u,f)),[f,u]);let v=(0,c.useRef)(!a.__demoMode);_h((()=>{if(!a.__demoMode)return;let e=Oh();return e.requestAnimationFrame((()=>{v.current=!0})),e.dispose}),[]),_h((()=>{if(0!==a.comboboxState||!d||!v.current||0===a.activationTrigger)return;let e=Oh();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=p.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[p,d,a.comboboxState,a.activationTrigger,a.activeOptionIndex]);let y=Th((e=>{if(i)return e.preventDefault();g(),0===a.mode&&l.closeCombobox()})),b=Th((()=>{if(i)return l.goToOption(sm.Nothing);l.goToOption(sm.Specific,u)})),S=Th((()=>{i||d||l.goToOption(sm.Specific,u,0)})),x=Th((()=>{i||!d||a.optionsPropsRef.current.hold||l.goToOption(sm.Nothing)})),_=(0,c.useMemo)((()=>({active:d,selected:h,disabled:i})),[d,h,i]);return dh({ourProps:{id:u,ref:m,role:"option",tabIndex:!0===i?void 0:-1,"aria-disabled":!0===i||void 0,"aria-selected":h,disabled:void 0,onClick:y,onFocus:b,onPointerMove:S,onMouseMove:S,onPointerLeave:x,onMouseLeave:x},theirProps:s,slot:_,defaultTag:"li",name:"Combobox.Option"})})),km=Object.assign(Am,{Input:Em,Button:Tm,Label:Mm,Options:Rm,Option:Pm});const Om=({center:e,size:n})=>{const r=Mf();return(0,c.useEffect)((()=>{const i=new(t(If).Circle)(e,n),o=r.layerContainer||r.map;return o.addLayer(i),()=>{o.removeLayer(i)}})),null},Nm=({center:e,uncertainty:t})=>{const[n,r]=(0,c.useState)(!1),i=Qf(),o=(0,c.useCallback)((()=>{let n=void 0!==t?Math.round(Math.log2(1e7/t)):i.getZoom();i.setView(e,n)}),[e,t,i]);return(0,c.useEffect)((()=>{n||(o(),r(!0))}),[]),(0,c.useEffect)((()=>{o()}),[e,t,o]),null};let Lm=t(If).icon({iconUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12.5,20.5],shadowAnchor:[12.5,20.5]});t(If).Marker.prototype.options.icon=Lm;const Dm=e=>{let t="Position";return(null==e?void 0:e.address)?t=[e.address.village||e.address.suburb,e.address.town||e.address.city||e.address.county||e.address.state,e.address.country].filter(Boolean).filter(((e,t,n)=>n.indexOf(e)===t)).join(", "):(null==e?void 0:e.display_name)&&(t=e.display_name),t};var Bm=({venue:e,setVenue:n,showUncertainty:r=!1,showGpsButton:i=!0,saveAndClose:o})=>{var a,l,u;const{t:d}=Se(),[h,p]=(0,c.useState)(!1),[f,m]=(0,c.useState)(!1),[g,v]=(0,c.useState)(!1),[y,b]=(0,c.useState)(""),[S,x]=(0,c.useState)([]),_=Xf((async e=>{v(!0);try{let t=await fetch(`https://nominatim.openstreetmap.org/search?q=${e}&format=jsonv2&limit=5&addressdetails=1`),n=await t.json();x(n)}catch(e){console.error(e)}finally{v(!1)}}),1e3);return(0,c.useEffect)((()=>{p(!0)}),[]),(0,c.useEffect)((()=>{const e=document.createElement("link");return e.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",e.rel="stylesheet",e.integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=",e.crossOrigin="",document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]),(0,s.jsxs)("fieldset",{className:"memori--venue-widget",children:[(0,s.jsx)("legend",{className:"sr-only",children:"Venue"}),(0,s.jsxs)("div",{className:"memori--venue-widget__form-item",children:[(0,s.jsx)("div",{className:"memori--venue-widget__geosuggest",children:f?(0,s.jsx)("p",{children:d("write_and_speak.updatingPosition")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"memori--venue-widget-search",children:(0,s.jsxs)(km,{value:(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)?{place_id:0,lat:null==e?void 0:e.latitude,lon:null==e?void 0:e.longitude,display_name:null==e?void 0:e.placeName}:void 0,onChange:e=>{console.log(e);const t=Dm(e);n({latitude:e.lat,longitude:e.lon,placeName:t,uncertainty:(null==e?void 0:e.boundingbox)?Cf(e.boundingbox):2})},children:[(0,s.jsx)(km.Input,{className:"memori--venue-widget-search--input",displayValue:e=>e?Dm(e):"",placeholder:d("searchVenue"),onChange:e=>{return t=e.target.value,b(t),void _(t);var t}}),(g||S.length>0||0===S.length&&""!==y)&&(0,s.jsx)(tp,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(km.Options,{className:"memori--venue-widget-search--options",children:g?(0,s.jsx)(bf,{spinning:!0,children:(0,s.jsxs)("center",{className:"memori--venue-widget-search--option",children:[d("loading"),"..."]})}):0===S.length&&""!==y?(0,s.jsx)("center",{className:"memori--venue-widget-search--option",children:d("nothingFound")}):null==S?void 0:S.map((e=>(0,s.jsx)(km.Option,{as:c.Fragment,value:e,children:({active:n,selected:r})=>(0,s.jsx)("li",{className:t(xs)("memori--venue-widget-search--option",{"memori--venue-widget-search--option-active":n,"memori--venue-widget-search--option-selected":r}),children:e.display_name})},e.place_id)))})})]})}),i&&(0,s.jsx)(Sf,{className:"memori--venue-widget__gps-button",primary:!0,loading:f,onClick:()=>{m(!0),(async()=>{m(!0),navigator.geolocation.getCurrentPosition((async e=>{let r={latitude:e.coords.latitude,longitude:e.coords.longitude,placeName:"Position",uncertainty:e.coords.accuracy/1e3};try{const t=await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${e.coords.latitude}&lon=${e.coords.longitude}&format=jsonv2&addressdetails=1`),i=await t.json(),s=Dm(i);r={latitude:e.coords.latitude,longitude:e.coords.longitude,placeName:s,uncertainty:e.coords.accuracy/1e3},n(r)}catch(e){let i=e;console.error("[POSITION ERROR]",i),(null==i?void 0:i.message)&&t(Ku).error(i.message),n(r)}finally{o&&o(r)}m(!1)}),(e=>{console.error("[POSITION ERROR]",e),t(Ku).error(e.message),m(!1)}))})()},children:d("write_and_speak.useMyPosition")})]})}),(0,s.jsx)("div",{children:(0,s.jsx)(Sf,{outlined:!0,className:"memori--venue-widget__no-location-button",onClick:()=>{let e={latitude:0,longitude:0,placeName:"Position",uncertainty:0};n(e),o&&o(e)},children:d("write_and_speak.dontWantToProvidePosition")})}),r&&(0,s.jsxs)("label",{className:"memori--venue-widget__select-label",children:[(0,s.jsxs)("span",{children:[d("uncertain"),": "]}),(0,s.jsxs)("select",{className:"memori-select--button memori--venue-widget__uncertainty",value:parseFloat((null!==(a=null==e?void 0:e.uncertainty)&&void 0!==a?a:0).toFixed(2)),disabled:!(e&&e.placeName&&e.latitude&&e.longitude),onChange:t=>{n({...e,uncertainty:parseFloat(t.target.value)})},children:[(null==e?void 0:e.uncertainty)&&![0,1,2,5,10,20,50,100].includes(e.uncertainty)&&(0,s.jsxs)("option",{value:e.uncertainty,children:[e.uncertainty," Km"]}),(0,s.jsx)("option",{value:0,children:d("exactPosition")}),(0,s.jsx)("option",{value:1,children:"1 km"}),(0,s.jsx)("option",{value:2,children:"2 km"}),(0,s.jsx)("option",{value:5,children:"5 km"}),(0,s.jsx)("option",{value:10,children:"10 km"}),(0,s.jsx)("option",{value:20,children:"20 km"}),(0,s.jsx)("option",{value:50,children:"50 km"}),(0,s.jsx)("option",{value:100,children:"100 km"})]})]})]}),(0,s.jsxs)("div",{className:"memori--venue-widget__form-item",children:[(null==e?void 0:e.placeName)&&"Position"!==e.placeName&&(0,s.jsxs)("p",{className:"memori--venue--widget__place-name",children:[(0,s.jsx)("strong",{children:d("venue")}),": ",e.placeName]}),(0,s.jsx)("div",{className:"memori--venue-widget__map",children:h&&(0,s.jsxs)(kf,{className:"memori--venue-widget__map",center:(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)?[e.latitude,e.longitude]:[44.66579,11.48823],zoom:13,scrollWheelZoom:!0,children:[(0,s.jsx)(Jf,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),(0,s.jsx)(Nm,{center:(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)?[e.latitude,e.longitude]:[44.66579,11.48823],uncertainty:1e3*(null!==(l=null==e?void 0:e.uncertainty)&&void 0!==l?l:0)}),(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)&&(0,s.jsx)(Vf,{position:[e.latitude,e.longitude],icon:Lm,children:(0,s.jsx)(qf,{children:null!==(u=e.placeName)&&void 0!==u?u:""})}),(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)&&void 0!==(null==e?void 0:e.uncertainty)&&(0,s.jsx)(Om,{center:[e.latitude,e.longitude],size:1e3*e.uncertainty})]})})]})]})};var zm=({memori:e,open:t,onClose:n,venue:r,setVenue:i})=>{const{t:o}=Se();return(0,s.jsxs)(_f,{className:"memori-position-drawer",open:t,onClose:()=>n(r),title:o("widget.position")||"Position",animated:!1,children:[(0,s.jsx)("p",{children:o("write_and_speak.requirePositionHelp",{name:e.name})}),(0,s.jsx)(Bm,{venue:r,setVenue:i,showUncertainty:!1,saveAndClose:e=>{i(e),n(e)}})]})};c=o("85Hg2"),c=o("85Hg2");var Fm=({open:e=!1,onClose:n,className:r,title:i,description:o,children:a,footer:l,loading:u=!1,closable:d=!0,width:h="100%",widthMd:p="100%"})=>{const{t:f}=Se();return(0,s.jsx)(tp,{appear:!0,show:e,as:t(c).Fragment,children:(0,s.jsxs)(vf,{open:e,onClose:n,className:t(xs)("memori-modal",r),children:[(0,s.jsx)(tp.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)("div",{className:"memori-modal--backdrop"})}),(0,s.jsx)("div",{className:"memori-modal--container",children:(0,s.jsx)("div",{className:"memori-modal--container-scrollable",children:(0,s.jsx)(tp.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsxs)(vf.Panel,{className:"memori-modal--panel",children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n .memori-modal--panel {\n --memori-modal--width: ${h};\n --memori-modal--width-md: ${p};\n }\n `}}),d&&(0,s.jsx)("div",{className:"memori-modal--close",children:(0,s.jsx)(Sf,{ghost:!0,padded:!0,shape:"circle",icon:(0,s.jsx)(xf,{}),title:f("close")||"Close",onClick:()=>n(!1)})}),(0,s.jsxs)(bf,{spinning:u,children:[i&&(0,s.jsx)(vf.Title,{className:"memori-modal--title",children:i}),o&&(0,s.jsx)(vf.Description,{className:"memori-modal--description",children:o}),a,l&&(0,s.jsx)("div",{className:"memori-modal--footer",children:l})]})]})})})})]})})},Um=(c=o("85Hg2"),e=>"checkbox"===e.type),jm=e=>e instanceof Date,Hm=e=>null==e;const Gm=e=>"object"==typeof e;var Vm=e=>!Hm(e)&&!Array.isArray(e)&&Gm(e)&&!jm(e),Wm=e=>Vm(e)&&e.target?Um(e.target)?e.target.checked:e.target.value:e,qm=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),Km=e=>Array.isArray(e)?e.filter(Boolean):[],Jm=e=>void 0===e,Qm=(e,t,n)=>{if(!t||!Vm(e))return n;const r=Km(t.split(/[,[\].]+?/)).reduce(((e,t)=>Hm(e)?e:e[t]),e);return Jm(r)||r===e?Jm(e[t])?n:e[t]:r};const Ym="blur",Zm="focusout",Xm="onBlur",$m="onChange",eg="onSubmit",tg="onTouched",ng="all",rg="max",ig="min",og="maxLength",sg="minLength",ag="pattern",lg="required",cg="validate";t(c).createContext(null);var ug=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const i=o;return t._proxyFormState[i]!==ng&&(t._proxyFormState[i]=!r||ng),n&&(n[i]=!0),e[i]}});return i},dg=e=>Vm(e)&&!Object.keys(e).length,hg=(e,t,n)=>{const{name:r,...i}=e;return dg(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find((e=>t[e]===(!n||ng)))},pg=e=>Array.isArray(e)?e:[e];function fg(e){const n=t(c).useRef(e);n.current=e,t(c).useEffect((()=>{const t=!e.disabled&&n.current.subject.subscribe({next:n.current.callback});return()=>{t&&t.unsubscribe()}}),[e.disabled])}var mg=e=>"string"==typeof e,gg=(e,t,n,r)=>mg(e)?(r&&t.watch.add(e),Qm(n,e)):Array.isArray(e)?e.map((e=>(r&&t.watch.add(e),Qm(n,e)))):(t.watchAll=!!r,n),vg="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function yg(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(vg&&(e instanceof Blob||e instanceof FileList)||!n&&!Vm(e))return e;if(t=n?[]:{},Array.isArray(e)||(e=>{const t=e.constructor&&e.constructor.prototype;return Vm(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)t[n]=yg(e[n]);else t=e}return t}var bg=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Sg=e=>/^\w*$/.test(e),xg=e=>Km(e.replace(/["|']|\]/g,"").split(/\.|\[/));function _g(e,t,n){let r=-1;const i=Sg(t)?[t]:xg(t),o=i.length,s=o-1;for(;++r<o;){const t=i[r];let o=n;if(r!==s){const n=e[t];o=Vm(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}e[t]=o,e=e[t]}return e}const wg=(e,t,n)=>{for(const r of n||Object.keys(e)){const n=Qm(e,r);if(n){const{_f:e,...r}=n;if(e&&t(e.name)){if(e.ref.focus){e.ref.focus();break}if(e.refs&&e.refs[0].focus){e.refs[0].focus();break}}else Vm(r)&&wg(r,t)}}};var Cg=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))))),Ag=(e,t,n)=>{const r=Km(Qm(e,n));return _g(r,"root",t[n]),_g(e,n,r),e},Eg=e=>"boolean"==typeof e,Tg=e=>"file"===e.type,Mg=e=>"function"==typeof e,Ig=e=>mg(e)||t(c).isValidElement(e),Rg=e=>"radio"===e.type,Pg=e=>e instanceof RegExp;const kg={value:!1,isValid:!1},Og={value:!0,isValid:!0};var Ng=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Jm(e[0].attributes.value)?Jm(e[0].value)||""===e[0].value?Og:{value:e[0].value,isValid:!0}:Og:kg}return kg};const Lg={isValid:!1,value:null};var Dg=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),Lg):Lg;function Bg(e,t,n="validate"){if(Ig(e)||Array.isArray(e)&&e.every(Ig)||Eg(e)&&!e)return{type:n,message:Ig(e)?e:"",ref:t}}var zg=e=>Vm(e)&&!Pg(e)?e:{value:e,message:""},Fg=async(e,t,n,r,i)=>{const{ref:o,refs:s,required:a,maxLength:l,minLength:c,min:u,max:d,pattern:h,validate:p,name:f,valueAsNumber:m,mount:g,disabled:v}=e._f;if(!g||v)return{};const y=s?s[0]:o,b=e=>{r&&y.reportValidity&&(y.setCustomValidity(Eg(e)?"":e||""),y.reportValidity())},S={},x=Rg(o),_=Um(o),w=x||_,C=(m||Tg(o))&&!o.value||""===t||Array.isArray(t)&&!t.length,A=bg.bind(null,f,n,S),E=(e,t,n,r=og,i=sg)=>{const s=e?t:n;S[f]={type:e?r:i,message:s,ref:o,...A(e?r:i,s)}};if(i?!Array.isArray(t)||!t.length:a&&(!w&&(C||Hm(t))||Eg(t)&&!t||_&&!Ng(s).isValid||x&&!Dg(s).isValid)){const{value:e,message:t}=Ig(a)?{value:!!a,message:a}:zg(a);if(e&&(S[f]={type:lg,message:t,ref:y,...A(lg,t)},!n))return b(t),S}if(!(C||Hm(u)&&Hm(d))){let e,r;const i=zg(d),s=zg(u);if(Hm(t)||isNaN(t)){const n=o.valueAsDate||new Date(t),a=e=>new Date((new Date).toDateString()+" "+e),l="time"==o.type,c="week"==o.type;mg(i.value)&&t&&(e=l?a(t)>a(i.value):c?t>i.value:n>new Date(i.value)),mg(s.value)&&t&&(r=l?a(t)<a(s.value):c?t<s.value:n<new Date(s.value))}else{const n=o.valueAsNumber||(t?+t:t);Hm(i.value)||(e=n>i.value),Hm(s.value)||(r=n<s.value)}if((e||r)&&(E(!!e,i.message,s.message,rg,ig),!n))return b(S[f].message),S}if((l||c)&&!C&&(mg(t)||i&&Array.isArray(t))){const e=zg(l),r=zg(c),i=!Hm(e.value)&&t.length>e.value,o=!Hm(r.value)&&t.length<r.value;if((i||o)&&(E(i,e.message,r.message),!n))return b(S[f].message),S}if(h&&!C&&mg(t)){const{value:e,message:r}=zg(h);if(Pg(e)&&!t.match(e)&&(S[f]={type:ag,message:r,ref:o,...A(ag,r)},!n))return b(r),S}if(p)if(Mg(p)){const e=Bg(await p(t),y);if(e&&(S[f]={...e,...A(cg,e.message)},!n))return b(e.message),S}else if(Vm(p)){let e={};for(const r in p){if(!dg(e)&&!n)break;const i=Bg(await p[r](t),y,r);i&&(e={...i,...A(r,i.message)},b(i.message),n&&(S[f]=e))}if(!dg(e)&&(S[f]={ref:y,...e},!n))return S}return b(!0),S};var Ug=e=>({isOnSubmit:!e||e===eg,isOnBlur:e===Xm,isOnChange:e===$m,isOnAll:e===ng,isOnTouch:e===tg});function jg(e){for(const t in e)if(!Jm(e[t]))return!1;return!0}function Hg(e,t){const n=Sg(t)?[t]:xg(t),r=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Jm(e)?r++:e[t[r++]];return e}(e,n),i=n[n.length-1];let o;r&&delete r[i];for(let t=0;t<n.slice(0,-1).length;t++){let r,i=-1;const s=n.slice(0,-(t+1)),a=s.length-1;for(t>0&&(o=e);++i<s.length;){const t=s[i];r=r?r[t]:e[t],a===i&&(Vm(r)&&dg(r)||Array.isArray(r)&&jg(r))&&(o?delete o[t]:delete e[t]),o=r}}return e}function Gg(){let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}}var Vg=e=>Hm(e)||!Gm(e);function Wg(e,t){if(Vg(e)||Vg(t))return e===t;if(jm(e)&&jm(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const n=e[i];if(!r.includes(i))return!1;if("ref"!==i){const e=t[i];if(jm(n)&&jm(e)||Vm(n)&&Vm(e)||Array.isArray(n)&&Array.isArray(e)?!Wg(n,e):n!==e)return!1}}return!0}var qg=e=>{const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Kg=e=>"select-multiple"===e.type,Jg=e=>qg(e)&&e.isConnected,Qg=e=>{for(const t in e)if(Mg(e[t]))return!0;return!1};function Yg(e,t={}){const n=Array.isArray(e);if(Vm(e)||n)for(const n in e)Array.isArray(e[n])||Vm(e[n])&&!Qg(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Yg(e[n],t[n])):Hm(e[n])||(t[n]=!0);return t}function Zg(e,t,n){const r=Array.isArray(e);if(Vm(e)||r)for(const r in e)Array.isArray(e[r])||Vm(e[r])&&!Qg(e[r])?Jm(t)||Vg(n[r])?n[r]=Array.isArray(e[r])?Yg(e[r],[]):{...Yg(e[r])}:Zg(e[r],Hm(t)?{}:t[r],n[r]):Wg(e[r],t[r])?delete n[r]:n[r]=!0;return n}var Xg=(e,t)=>Zg(e,t,Yg(t)),$g=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Jm(e)?e:t?""===e?NaN:e?+e:e:n&&mg(e)?new Date(e):r?r(e):e;function ev(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return Tg(t)?t.files:Rg(t)?Dg(e.refs).value:Kg(t)?[...t.selectedOptions].map((({value:e})=>e)):Um(t)?Ng(e.refs).value:$g(Jm(t.value)?e.ref.value:t.value,e)}var tv=e=>Jm(e)?e:Pg(e)?e.source:Vm(e)?Pg(e.value)?e.value.source:e.value:e;function nv(e,t,n){const r=Qm(e,n);if(r||Sg(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const r=i.join("."),o=Qm(t,r),s=Qm(e,r);if(o&&!Array.isArray(o)&&n!==r)return{name:n};if(s&&s.type)return{name:r,error:s};i.pop()}return{name:n}}const rv={mode:eg,reValidateMode:$m,shouldFocusError:!0};function iv(e={}){let t,n={...rv,...e},r={submitCount:0,isDirty:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},i={},o=yg(n.defaultValues)||{},s=n.shouldUnregister?{}:yg(o),a={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c=0,u={};const d={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={watch:Gg(),array:Gg(),state:Gg()},p=Ug(n.mode),f=Ug(n.reValidateMode),m=n.criteriaMode===ng,g=async()=>{let e=!1;return d.isValid&&(e=n.resolver?dg((await S()).errors):await x(i,!0),e!==r.isValid&&(r.isValid=e,h.state.next({isValid:e}))),e},v=(e,t,n,r)=>{const l=Qm(i,e);if(l){const i=Qm(s,e,Jm(n)?Qm(o,e):n);Jm(i)||r&&r.defaultChecked||t?_g(s,e,t?i:ev(l._f)):C(e,i),a.mount&&g()}},y=(e,t,n,i,s)=>{let a=!1,l=!1;const c={name:e};if(d.isDirty&&(l=r.isDirty,r.isDirty=c.isDirty=_(),a=l!==c.isDirty),d.dirtyFields&&(!n||i)){l=Qm(r.dirtyFields,e);const n=Wg(Qm(o,e),t);n?Hg(r.dirtyFields,e):_g(r.dirtyFields,e,!0),c.dirtyFields=r.dirtyFields,a=a||l!==!n}if(n){const t=Qm(r.touchedFields,e);t||(_g(r.touchedFields,e,n),c.touchedFields=r.touchedFields,a=a||d.touchedFields&&t!==n)}return a&&s&&h.state.next(c),a?c:{}},b=(n,i,o,s)=>{const a=Qm(r.errors,n),l=d.isValid&&Eg(i)&&r.isValid!==i;var p;if(e.delayError&&o?(p=()=>((e,t)=>{_g(r.errors,e,t),h.state.next({errors:r.errors})})(n,o),t=e=>{clearTimeout(c),c=window.setTimeout(p,e)},t(e.delayError)):(clearTimeout(c),t=null,o?_g(r.errors,n,o):Hg(r.errors,n)),(o?!Wg(a,o):a)||!dg(s)||l){const e={...s,...l&&Eg(i)?{isValid:i}:{},errors:r.errors,name:n};r={...r,...e},h.state.next(e)}u[n]--,d.isValidating&&!Object.values(u).some((e=>e))&&(h.state.next({isValidating:!1}),u={})},S=async e=>n.resolver?await n.resolver({...s},n.context,((e,t,n,r)=>{const i={};for(const n of e){const e=Qm(t,n);e&&_g(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}})(e||l.mount,i,n.criteriaMode,n.shouldUseNativeValidation)):{},x=async(e,t,i={valid:!0})=>{for(const o in e){const a=e[o];if(a){const{_f:e,...o}=a;if(e){const o=l.array.has(e.name),c=await Fg(a,Qm(s,e.name),m,n.shouldUseNativeValidation,o);if(c[e.name]&&(i.valid=!1,t))break;!t&&(Qm(c,e.name)?o?Ag(r.errors,c,e.name):_g(r.errors,e.name,c[e.name]):Hg(r.errors,e.name))}o&&await x(o,t,i)}}return i.valid},_=(e,t)=>(e&&t&&_g(s,e,t),!Wg(I(),o)),w=(e,t,n)=>gg(e,l,{...a.mount?s:Jm(t)?o:mg(e)?{[e]:t}:t},n),C=(e,t,n={})=>{const r=Qm(i,e);let o=t;if(r){const n=r._f;n&&(!n.disabled&&_g(s,e,$g(t,n)),o=vg&&qg(n.ref)&&Hm(t)?"":t,Kg(n.ref)?[...n.ref.options].forEach((e=>e.selected=o.includes(e.value))):n.refs?Um(n.ref)?n.refs.length>1?n.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(o)?!!o.find((t=>t===e.value)):o===e.value))):n.refs[0]&&(n.refs[0].checked=!!o):n.refs.forEach((e=>e.checked=e.value===o)):Tg(n.ref)?n.ref.value="":(n.ref.value=o,n.ref.type||h.watch.next({name:e})))}(n.shouldDirty||n.shouldTouch)&&y(e,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&M(e)},A=(e,t,n)=>{for(const r in t){const o=t[r],s=`${e}.${r}`,a=Qm(i,s);!l.array.has(e)&&Vg(o)&&(!a||a._f)||jm(o)?C(s,o,n):A(s,o,n)}},E=(e,t,n={})=>{const a=Qm(i,e),c=l.array.has(e),u=yg(t);_g(s,e,u),c?(h.array.next({name:e,values:s}),(d.isDirty||d.dirtyFields)&&n.shouldDirty&&(r.dirtyFields=Xg(o,s),h.state.next({name:e,dirtyFields:r.dirtyFields,isDirty:_(e,u)}))):!a||a._f||Hm(u)?C(e,u,n):A(e,u,n),Cg(e,l)&&h.state.next({}),h.watch.next({name:e})},T=async e=>{const o=e.target;let a=o.name;const c=Qm(i,a);if(c){let x,_;const w=o.type?ev(c._f):Wm(e),C=e.type===Ym||e.type===Zm,A=!((v=c._f).mount&&(v.required||v.min||v.max||v.maxLength||v.minLength||v.pattern||v.validate)||n.resolver||Qm(r.errors,a)||c._f.deps)||((e,t,n,r,i)=>!i.isOnAll&&(!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e))(C,Qm(r.touchedFields,a),r.isSubmitted,f,p),E=Cg(a,l,C);_g(s,a,w),C?(c._f.onBlur&&c._f.onBlur(e),t&&t(0)):c._f.onChange&&c._f.onChange(e);const T=y(a,w,C,!1),I=!dg(T)||E;if(!C&&h.watch.next({name:a,type:e.type}),A)return d.isValid&&g(),I&&h.state.next({name:a,...E?{}:T});if(!C&&E&&h.state.next({}),u[a]=u[a]?u[a]+1:1,h.state.next({isValidating:!0}),n.resolver){const{errors:e}=await S([a]),t=nv(r.errors,i,a),n=nv(e,i,t.name||a);x=n.error,a=n.name,_=dg(e)}else x=(await Fg(c,Qm(s,a),m,n.shouldUseNativeValidation))[a],g();c._f.deps&&M(c._f.deps),b(a,_,x,T)}var v},M=async(e,t={})=>{let o,s;const a=pg(e);if(h.state.next({isValidating:!0}),n.resolver){const t=await(async e=>{const{errors:t}=await S();if(e)for(const n of e){const e=Qm(t,n);e?_g(r.errors,n,e):Hg(r.errors,n)}else r.errors=t;return t})(Jm(e)?e:a);o=dg(t),s=e?!a.some((e=>Qm(t,e))):o}else e?(s=(await Promise.all(a.map((async e=>{const t=Qm(i,e);return await x(t&&t._f?{[e]:t}:t)})))).every(Boolean),(s||r.isValid)&&g()):s=o=await x(i);return h.state.next({...!mg(e)||d.isValid&&o!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:o}:{},errors:r.errors,isValidating:!1}),t.shouldFocus&&!s&&wg(i,(e=>e&&Qm(r.errors,e)),e?a:l.mount),s},I=e=>{const t={...o,...a.mount?s:{}};return Jm(e)?t:mg(e)?Qm(t,e):e.map((e=>Qm(t,e)))},R=(e,t)=>({invalid:!!Qm((t||r).errors,e),isDirty:!!Qm((t||r).dirtyFields,e),isTouched:!!Qm((t||r).touchedFields,e),error:Qm((t||r).errors,e)}),P=(e,t={})=>{for(const a of e?pg(e):l.mount)l.mount.delete(a),l.array.delete(a),Qm(i,a)&&(t.keepValue||(Hg(i,a),Hg(s,a)),!t.keepError&&Hg(r.errors,a),!t.keepDirty&&Hg(r.dirtyFields,a),!t.keepTouched&&Hg(r.touchedFields,a),!n.shouldUnregister&&!t.keepDefaultValue&&Hg(o,a));h.watch.next({}),h.state.next({...r,...t.keepDirty?{isDirty:_()}:{}}),!t.keepIsValid&&g()},k=(e,t={})=>{let r=Qm(i,e);const c=Eg(t.disabled);return _g(i,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),r?c&&_g(s,e,t.disabled?void 0:Qm(s,e,ev(r._f))):v(e,!0,t.value),{...c?{disabled:t.disabled}:{},...n.shouldUseNativeValidation?{required:!!t.required,min:tv(t.min),max:tv(t.max),minLength:tv(t.minLength),maxLength:tv(t.maxLength),pattern:tv(t.pattern)}:{},name:e,onChange:T,onBlur:T,ref:s=>{if(s){k(e,t),r=Qm(i,e);const n=Jm(s.value)&&s.querySelectorAll&&s.querySelectorAll("input,select,textarea")[0]||s,a=(e=>Rg(e)||Um(e))(n),l=r._f.refs||[];if(a?l.find((e=>e===n)):n===r._f.ref)return;_g(i,e,{_f:{...r._f,...a?{refs:[...l.filter(Jg),n,...Array.isArray(Qm(o,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),v(e,!1,void 0,n)}else r=Qm(i,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!qm(l.array,e)||!a.action)&&l.unMount.add(e)}}},O=()=>n.shouldFocusError&&wg(i,(e=>e&&Qm(r.errors,e)),l.mount);return{control:{register:k,unregister:P,getFieldState:R,_executeSchema:S,_focusError:O,_getWatch:w,_getDirty:_,_updateValid:g,_removeUnmounted:()=>{for(const e of l.unMount){const t=Qm(i,e);t&&(t._f.refs?t._f.refs.every((e=>!Jg(e))):!Jg(t._f.ref))&&P(e)}l.unMount=new Set},_updateFieldArray:(e,t=[],n,l,c=!0,u=!0)=>{if(l&&n){if(a.action=!0,u&&Array.isArray(Qm(i,e))){const t=n(Qm(i,e),l.argA,l.argB);c&&_g(i,e,t)}if(u&&Array.isArray(Qm(r.errors,e))){const t=n(Qm(r.errors,e),l.argA,l.argB);c&&_g(r.errors,e,t),((e,t)=>{!Km(Qm(e,t)).length&&Hg(e,t)})(r.errors,e)}if(d.touchedFields&&u&&Array.isArray(Qm(r.touchedFields,e))){const t=n(Qm(r.touchedFields,e),l.argA,l.argB);c&&_g(r.touchedFields,e,t)}d.dirtyFields&&(r.dirtyFields=Xg(o,s)),h.state.next({isDirty:_(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else _g(s,e,t)},_getFieldArray:t=>Km(Qm(a.mount?s:o,t,e.shouldUnregister?Qm(o,t,[]):[])),_subjects:h,_proxyFormState:d,get _fields(){return i},get _formValues(){return s},get _stateFlags(){return a},set _stateFlags(e){a=e},get _defaultValues(){return o},get _names(){return l},set _names(e){l=e},get _formState(){return r},set _formState(e){r=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:M,register:k,handleSubmit:(e,t)=>async o=>{o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let a=!0,l=yg(s);h.state.next({isSubmitting:!0});try{if(n.resolver){const{errors:e,values:t}=await S();r.errors=e,l=t}else await x(i);dg(r.errors)?(h.state.next({errors:{},isSubmitting:!0}),await e(l,o)):(t&&await t({...r.errors},o),O())}catch(e){throw a=!1,e}finally{r.isSubmitted=!0,h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:dg(r.errors)&&a,submitCount:r.submitCount+1,errors:r.errors})}},watch:(e,t)=>Mg(e)?h.watch.subscribe({next:n=>e(w(void 0,t),n)}):w(e,t,!0),setValue:E,getValues:I,reset:(t,n)=>((t,n={})=>{const c=t||o,u=yg(c),p=t&&!dg(t)?u:o;if(n.keepDefaultValues||(o=c),!n.keepValues){if(n.keepDirtyValues)for(const e of l.mount)Qm(r.dirtyFields,e)?_g(p,e,Qm(s,e)):E(e,Qm(p,e));else{if(vg&&Jm(t))for(const e of l.mount){const t=Qm(i,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(qg(e)){const t=e.closest("form");if(t){t.reset();break}}}}i={}}s=e.shouldUnregister?n.keepDefaultValues?yg(o):{}:u,h.array.next({values:p}),h.watch.next({values:p})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!n.keepIsValid,a.watch=!!e.shouldUnregister,h.state.next({submitCount:n.keepSubmitCount?r.submitCount:0,isDirty:n.keepDirty||n.keepDirtyValues?r.isDirty:!(!n.keepDefaultValues||Wg(t,o)),isSubmitted:!!n.keepIsSubmitted&&r.isSubmitted,dirtyFields:n.keepDirty||n.keepDirtyValues?r.dirtyFields:n.keepDefaultValues&&t?Xg(o,t):{},touchedFields:n.keepTouched?r.touchedFields:{},errors:n.keepErrors?r.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(Mg(t)?t(s):t,n),resetField:(e,t={})=>{Qm(i,e)&&(Jm(t.defaultValue)?E(e,Qm(o,e)):(E(e,t.defaultValue),_g(o,e,t.defaultValue)),t.keepTouched||Hg(r.touchedFields,e),t.keepDirty||(Hg(r.dirtyFields,e),r.isDirty=t.defaultValue?_(e,Qm(o,e)):_()),t.keepError||(Hg(r.errors,e),d.isValid&&g()),h.state.next({...r}))},clearErrors:e=>{e?pg(e).forEach((e=>Hg(r.errors,e))):r.errors={},h.state.next({errors:r.errors})},unregister:P,setError:(e,t,n)=>{const o=(Qm(i,e,{_f:{}})._f||{}).ref;_g(r.errors,e,{...t,ref:o}),h.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&o&&o.focus&&o.focus()},setFocus:(e,t={})=>{const n=Qm(i,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:R}}function ov(e={}){const n=t(c).useRef(),[r,i]=t(c).useState({isDirty:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:e.defaultValues});n.current||(n.current={...iv(e),formState:r});const o=n.current.control;return o._options=e,fg({subject:o._subjects.state,callback:t(c).useCallback((e=>{hg(e,o._proxyFormState,!0)&&(o._formState={...o._formState,...e},i({...o._formState}))}),[o])}),t(c).useEffect((()=>{o._stateFlags.mount||(o._proxyFormState.isValid&&o._updateValid(),o._stateFlags.mount=!0),o._stateFlags.watch&&(o._stateFlags.watch=!1,o._subjects.state.next({})),o._removeUnmounted()})),t(c).useEffect((()=>{r.submitCount&&o._focusError()}),[o,r.submitCount]),n.current.formState=ug(r,o),n.current}var sv=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}),(0,s.jsx)("path",{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"})]});var av=({pwdOrTokens:e,setPwdOrTokens:t,onFinish:n,minimumNumberOfRecoveryTokens:r=1,showTokens:i=!0,openModal:o=!1,withModal:a=!1})=>{var l;const{t:u}=Se(),{register:d,handleSubmit:h,formState:{errors:p},setError:f}=ov(),[m,g]=(0,c.useState)(1),[v,y]=(0,c.useState)(!!e),b=(0,s.jsxs)("form",{name:"memoriAuth",onSubmit:h((t=>{var i,o,s;"password"===e&&!(null===(i=t.password)||void 0===i?void 0:i.length)||"tokens"===e&&(((null===(o=null==t?void 0:t.tokens)||void 0===o?void 0:o.length)||0)<r||!(null===(s=null==t?void 0:t.tokens)||void 0===s?void 0:s.every((e=>e.length))))?f("tokens",{type:"minLength",message:"Tokens"}):n&&n(t).then((()=>{y(!1)}))})),className:"memori-auth-widget--form",children:[("password"===e||!i)&&(0,s.jsxs)("fieldset",{className:"memori-auth-widget--password-fieldset",children:[(0,s.jsxs)("label",{children:["Password:"," ",(0,s.jsx)("input",{className:"memori-auth-widget--input",required:!0,type:"password",placeholder:"Password",...d("password",{required:!0})})]}),i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("hr",{}),(0,s.jsx)(Sf,{outlined:!0,onClick:()=>t("tokens"),children:u("auth.useRecoveryTokens")||"Recovery tokens"})]})]}),"tokens"===e&&i&&(0,s.jsxs)("fieldset",{className:"memori-auth-widget--tokens-fieldset",name:"tokens",children:[(0,s.jsxs)("legend",{children:[u("auth.tokens"),": "]}),(S=m,Array.from({length:S},((e,t)=>t))).map((e=>(0,s.jsx)("label",{className:"memori-auth-widget--token",children:(0,s.jsx)("input",{type:"password",className:"memori-auth-widget--input",placeholder:"Recovery token",required:!0,autoComplete:"off",...d(`tokens.${e}`,{required:!0})})},e))),(0,s.jsx)(Sf,{onClick:()=>g((e=>e+1)),className:"memori-auth-widget--token-add",icon:(0,s.jsx)(sv,{}),children:u("auth.addToken")||"Add token"}),(0,s.jsx)("hr",{}),(0,s.jsx)(Sf,{outlined:!0,onClick:()=>t("password"),children:u("auth.usePassword")||"Password"})]}),"minLength"===(null===(l=p.tokens)||void 0===l?void 0:l.type)&&(0,s.jsxs)("div",{className:"memori-auth-widget--error",children:[u("auth.atLeast")||"At least"," ",r]}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,className:"memori-auth-widget--submit",children:u("confirm")||"Submit"})]});var S;return a?(0,s.jsx)(Fm,{open:o||v,title:u("auth.title")||"Authentication",onClose:()=>t(null),closable:!1,children:b}):b};c=o("85Hg2");const lv=({type:e,resourceURI:t,sessionID:n,baseURL:r="",apiURL:i=""})=>{let o="cover"===e?`${r}/images/memoriCover.png`:`${r}/images/memoriAvatar.png?v=20231208`;try{return t&&0!==t.length?t.includes("memoriai/memory")&&!t.includes("memori-ai-session-id")&&n?`${t}?memori-ai-session-id=${n}`:(t.startsWith("https://")||t.startsWith("http://"))&&(new URL(t).hostname.includes("memori.ai")||new URL(t).hostname.includes("aclambda.online"))?`${t}${t.endsWith("/")||!n?"":"/"}${n||""}`:t.startsWith("cloud://")?`${(null==i?void 0:i.replace(/v2/,"v1"))||""}/CloudAsset/${t.replace("cloud://","")}`:t.startsWith("guid://")?`${(null==i?void 0:i.replace(/v2/,"v1"))||""}/GuidAsset/${t.replace("guid://","")}`:t||o:o}catch(e){return t||o}};c=o("85Hg2");var cv=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M858.5 763.6a374 374 0 0 0-80.6-119.5 375.63 375.63 0 0 0-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 0 0-80.6 119.5A371.7 371.7 0 0 0 136 901.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 0 0 8-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"})});var uv=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",className:e,"aria-label":t,children:(0,s.jsxs)("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",children:[(0,s.jsx)("path",{fillRule:"evenodd",d:"M0 4a4 4 0 014-4h16a4 4 0 014 4v16a4 4 0 01-4 4H4a4 4 0 01-4-4zm4-2.4A2.4 2.4 0 001.6 4v16A2.4 2.4 0 004 22.4h16a2.4 2.4 0 002.4-2.4V4A2.4 2.4 0 0020 1.6z",clipRule:"evenodd"}),(0,s.jsx)("path",{fillRule:"evenodd",d:"M9.715 8.442a.798.798 0 00-1.43 0l-3.2 6.4a.799.799 0 101.431.716l.579-1.158h3.811l.578 1.158a.8.8 0 001.431-.716zm.391 4.358L9 10.589 7.894 12.8z",clipRule:"evenodd"}),(0,s.jsx)("path",{fillRule:"evenodd",d:"M17 8c.552 0 1 .358 1 .8v6.4c0 .442-.448.8-1 .8s-1-.358-1-.8V8.8c0-.442.448-.8 1-.8z",clipRule:"evenodd"})]})});var dv=({content:e,className:n,align:r="right",disabled:i=!1,visible:o=!1,children:a})=>(0,s.jsxs)("div",{className:t(xs)("memori-tooltip",`memori-tooltip--align-${r}`,n,{"memori-tooltip--disabled":i,"memori-tooltip--visible":o}),children:[(0,s.jsx)("div",{className:"memori-tooltip--content",children:e}),(0,s.jsx)("div",{className:"memori-tooltip--trigger",children:a})]}),hv=(c=o("85Hg2"),c=o("85Hg2"),(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(hv||{})),pv=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(pv||{}),fv=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(fv||{});function mv(e,t=(e=>e)){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=wp(t(e.items.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{items:r,activeItemIndex:i}}let gv={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,menuState:0},2:(e,t)=>{var n;let r=mv(e),i=am(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find((e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled})),o=i?e.items.indexOf(i):-1;return-1===o||o===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:o,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=mv(e,(e=>[...e,{id:t.id,dataRef:t.dataRef}]));return{...e,...n}},6:(e,t)=>{let n=mv(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},vv=(0,c.createContext)(null);function yv(e){let t=(0,c.useContext)(vv);if(null===t){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,yv),t}return t}function bv(e,t){return ah(t.type,gv,e,t)}vv.displayName="MenuContext";let Sv=c.Fragment,xv=fh((function(e,n){let r=(0,c.useReducer)(bv,{menuState:1,buttonRef:(0,c.createRef)(),itemsRef:(0,c.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:i,itemsRef:o,buttonRef:s},a]=r,l=Rh(n);nf([s,o],((e,t)=>{var n;a({type:1}),bp(t,yp.Loose)||(e.preventDefault(),null==(n=s.current)||n.focus())}),0===i);let u=Th((()=>{a({type:1})})),d=(0,c.useMemo)((()=>({open:0===i,close:u})),[i,u]),h=e,p={ref:l};return t(c).createElement(vv.Provider,{value:r},t(c).createElement(Sh,{value:ah(i,{0:yh.Open,1:yh.Closed})},dh({ourProps:p,theirProps:h,slot:d,defaultTag:Sv,name:"Menu"})))})),_v=fh((function(e,t){var n;let[r,i]=yv("Menu.Button"),o=Rh(r.buttonRef,t),s=`headlessui-menu-button-${lp()}`,a=Fh(),l=Th((e=>{switch(e.key){case rp.Space:case rp.Enter:case rp.ArrowDown:e.preventDefault(),e.stopPropagation(),i({type:0}),a.nextFrame((()=>i({type:2,focus:sm.First})));break;case rp.ArrowUp:e.preventDefault(),e.stopPropagation(),i({type:0}),a.nextFrame((()=>i({type:2,focus:sm.Last})))}})),u=Th((e=>{if(e.key===rp.Space)e.preventDefault()})),d=Th((t=>{if(ip(t.currentTarget))return t.preventDefault();e.disabled||(0===r.menuState?(i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(t.preventDefault(),i({type:0})))})),h=(0,c.useMemo)((()=>({open:0===r.menuState})),[r]),p=e;return dh({ourProps:{ref:o,id:s,type:im(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.itemsRef.current)?void 0:n.id,"aria-expanded":e.disabled?void 0:0===r.menuState,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:p,slot:h,defaultTag:"button",name:"Menu.Button"})})),wv=ch.RenderStrategy|ch.Static,Cv=fh((function(e,t){var n,r;let[i,o]=yv("Menu.Items"),s=Rh(i.itemsRef,t),a=Ip(i.itemsRef),l=`headlessui-menu-items-${lp()}`,u=Fh(),d=bh(),h=null!==d?d===yh.Open:0===i.menuState;(0,c.useEffect)((()=>{let e=i.itemsRef.current;!e||0===i.menuState&&e!==(null==a?void 0:a.activeElement)&&e.focus({preventScroll:!0})}),[i.menuState,i.itemsRef,a]),om({container:i.itemsRef.current,enabled:0===i.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let p=Th((e=>{var t,n;switch(u.dispose(),e.key){case rp.Space:if(""!==i.searchQuery)return e.preventDefault(),e.stopPropagation(),o({type:3,value:e.key});case rp.Enter:if(e.preventDefault(),e.stopPropagation(),o({type:1}),null!==i.activeItemIndex){let{dataRef:e}=i.items[i.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}Sp(i.buttonRef.current);break;case rp.ArrowDown:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:sm.Next});case rp.ArrowUp:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:sm.Previous});case rp.Home:case rp.PageUp:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:sm.First});case rp.End:case rp.PageDown:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:sm.Last});case rp.Escape:e.preventDefault(),e.stopPropagation(),o({type:1}),Oh().nextFrame((()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case rp.Tab:e.preventDefault(),e.stopPropagation(),o({type:1}),Oh().nextFrame((()=>{Cp(i.buttonRef.current,e.shiftKey?fp.Previous:fp.Next)}));break;default:1===e.key.length&&(o({type:3,value:e.key}),u.setTimeout((()=>o({type:4})),350))}})),f=Th((e=>{if(e.key===rp.Space)e.preventDefault()})),m=(0,c.useMemo)((()=>({open:0===i.menuState})),[i]),g=e;return dh({ourProps:{"aria-activedescendant":null===i.activeItemIndex||null==(n=i.items[i.activeItemIndex])?void 0:n.id,"aria-labelledby":null==(r=i.buttonRef.current)?void 0:r.id,id:l,onKeyDown:p,onKeyUp:f,role:"menu",tabIndex:0,ref:s},theirProps:g,slot:m,defaultTag:"div",features:wv,visible:h,name:"Menu.Items"})})),Av=c.Fragment,Ev=fh((function(e,t){let{disabled:n=!1,...r}=e,[i,o]=yv("Menu.Item"),s=`headlessui-menu-item-${lp()}`,a=null!==i.activeItemIndex&&i.items[i.activeItemIndex].id===s,l=(0,c.useRef)(null),u=Rh(t,l);_h((()=>{if(0!==i.menuState||!a||0===i.activationTrigger)return;let e=Oh();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=l.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[l,a,i.menuState,i.activationTrigger,i.activeItemIndex]);let d=(0,c.useRef)({disabled:n,domRef:l});_h((()=>{d.current.disabled=n}),[d,n]),_h((()=>{var e,t;d.current.textValue=null==(t=null==(e=l.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[d,l]),_h((()=>(o({type:5,id:s,dataRef:d}),()=>o({type:6,id:s}))),[d,s]);let h=Th((()=>{o({type:1})})),p=Th((e=>{if(n)return e.preventDefault();o({type:1}),Sp(i.buttonRef.current)})),f=Th((()=>{if(n)return o({type:2,focus:sm.Nothing});o({type:2,focus:sm.Specific,id:s})})),m=Th((()=>{n||a||o({type:2,focus:sm.Specific,id:s,trigger:0})})),g=Th((()=>{n||!a||o({type:2,focus:sm.Nothing})})),v=(0,c.useMemo)((()=>({active:a,disabled:n,close:h})),[a,n,h]);return dh({ourProps:{id:s,ref:u,role:"menuitem",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,disabled:void 0,onClick:p,onFocus:f,onPointerMove:m,onMouseMove:m,onPointerLeave:g,onMouseLeave:g},theirProps:r,slot:v,defaultTag:Av,name:"Menu.Item"})})),Tv=Object.assign(xv,{Button:_v,Items:Cv,Item:Ev});var Mv=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,"aria-label":t,children:[(0,s.jsx)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),(0,s.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17l-.59.59-.58.58V4h16v12zm-9-4h2v2h-2zm0-6h2v4h-2z"})]});const Iv={"it-IT":"Non è quello che ti ho chiesto","fr-FR":"Ce n'est pas ce que je t'ai demandé","en-GB":"It's not what I asked"},Rv={"it-IT":"La risposta non era corretta","fr-FR":"La réponse n'était pas correcte","en-GB":"The answer was not correct"},Pv={"it-IT":"Non mi è piaciuta la risposta","fr-FR":"Je n'ai pas aimé la réponse","en-GB":"I didn't like the answer"};var kv=({memori:e,className:n,onNegativeClick:r,toggle:i=!1,dropdown:o=!1})=>{const[a,l]=(0,c.useState)(),u="it-IT"===e.culture?"it-IT":"fr-FR"===e.culture?"fr-FR":"en-GB",d=Iv[u],h=Rv[u],p=Pv[u];return(0,s.jsx)("div",{className:"memori-chat--feedback"+(n?` ${n}`:""),children:o?(0,s.jsxs)(Tv,{as:"div",className:"memori-chat--feedback-menu",children:[(0,s.jsx)(Tv.Button,{as:t(c).Fragment,children:(0,s.jsx)(Sf,{ghost:!0,shape:"circle",title:"Feedback",className:"memori-chat--feedback-menu-button",disabled:!!a,icon:(0,s.jsx)(Mv,{className:a?"memori-chat--feedback-clicked":void 0})})}),(0,s.jsx)(tp,{as:t(c).Fragment,enter:"transition ease-out duration-200",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,s.jsx)(Tv.Items,{className:"memori-chat--feedback-menu-items",children:(0,s.jsxs)("div",{className:"memori-chat--feedback-menu-items-container",children:[(0,s.jsx)(Tv.Item,{children:({active:e})=>(0,s.jsx)("button",{className:"memori-chat--feedback-menu-item"+(e?" memori-chat--feedback-menu-item-active":""),onClick:()=>{l("up"===a&&i?void 0:"up")},children:p})},"ok"),(0,s.jsx)(Tv.Item,{children:({active:e})=>(0,s.jsx)("button",{className:"memori-chat--feedback-menu-item"+(e?" memori-chat--feedback-menu-item-active":""),onClick:()=>{l("down"===a&&i?void 0:"down"),r(d)},children:h})},"no")]})})})]}):(0,s.jsx)(dv,{align:"left",content:"Feedback",children:(0,s.jsx)(Sf,{title:"Feedback",onClick:()=>{l("down"===a&&i?void 0:"down"),r(d)},ghost:!0,shape:"circle",icon:(0,s.jsx)(Mv,{className:a?"memori-chat--feedback-clicked":void 0})})})})},Ov={};!function(e){"use strict";function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function n(t){e.defaults=t}e.defaults=t();const r=/[&<>"']/,i=new RegExp(r.source,"g"),o=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,s=new RegExp(o.source,"g"),a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},l=e=>a[e];function c(e,t){if(t){if(r.test(e))return e.replace(i,l)}else if(o.test(e))return e.replace(s,l);return e}const u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(e){return e.replace(u,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const h=/(^|[^\[])\^/g;function p(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(h,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function f(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const m={exec:()=>null};function g(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function v(e,t,n){const r=e.length;if(0===r)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o!==t||n){if(o===t||!n)break;i++}else i++}return e.slice(0,r-i)}function y(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function b(e,t,n,r){const i=t.href,o=t.title?c(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:i,title:o,text:c(s)}}function S(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}class x{options;rules;lexer;constructor(t){this.options=t||e.defaults}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:v(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=S(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=v(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=v(t[0].replace(/^ *>[ \t]?/gm,""),"\n"),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const o=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let s="",a="",l=!1;for(;e;){let n=!1;if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;s=t[0],e=e.substring(s.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,a=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,a=r.slice(u),u+=t[1].length);let d=!1;if(!r&&/^ *$/.test(c)&&(s+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const l=e.split("\n",1)[0];if(c=l,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),i.test(c))break;if(o.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=u||!c.trim())a+="\n"+c.slice(u);else{if(d)break;if(r.search(/[^ ]/)>=4)break;if(i.test(r))break;if(o.test(r))break;if(n.test(r))break;a+="\n"+c}d||c.trim()||(d=!0),s+=l+"\n",e=e.substring(l.length+1),r=c.slice(u)}}i.loose||(l?i.loose=!0:/\n *\n *$/.test(s)&&(l=!0));let h,p=null;this.options.gfm&&(p=/^\[[ xX]\] /.exec(a),p&&(h="[ ] "!==p[0],a=a.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:s,task:!!p,checked:h,loose:!1,text:a,tokens:[]}),i.raw+=s}i.items[i.items.length-1].raw=s.trimEnd(),i.items[i.items.length-1].text=a.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){const t=i.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));i.loose=n}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=g(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?o.align.push("right"):/^ *:-+: *$/.test(e)?o.align.push("center"):/^ *:-+ *$/.test(e)?o.align.push("left"):o.align.push(null);for(const e of n)o.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of i)o.rows.push(g(e,o.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:c(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=v(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=y(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),b(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return b(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(!r[3]||!n.match(/[\p{L}\p{N}]/u))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){const n=[...r[0]].length-1;let i,o,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=[...i].length,r[3]||r[4]){s+=o;continue}if((r[5]||r[6])&&n%3&&!((n+o)%3)){a+=o;continue}if(s-=o,s>0)continue;o=Math.min(o,o+s+a);const t=[...r[0]][0].length,l=e.slice(0,n+r.index+t+o);if(Math.min(n,o)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=c(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=c(t[1]),n="mailto:"+e):(e=c(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=c(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=c(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:c(t[0]),{type:"text",raw:t[0],text:e}}}}const _=/^(?: *(?:\n|$))+/,w=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,C=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,A=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,E=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,T=/(?:[*+-]|\d{1,9}[.)])/,M=p(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,T).getRegex(),I=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,R=/^[^\n]+/,P=/(?!\s*\])(?:\\.|[^\[\]\\])+/,k=p(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",P).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),O=p(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,T).getRegex(),N="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",L=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,D=p("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",L).replace("tag",N).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),B=p(I).replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",N).getRegex(),z={blockquote:p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",B).getRegex(),code:w,def:k,fences:C,heading:E,hr:A,html:D,lheading:M,list:O,newline:_,paragraph:B,table:m,text:R},F=p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",N).getRegex(),U={...z,table:F,paragraph:p(I).replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",F).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",N).getRegex()},j={...z,html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",L).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:m,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:p(I).replace("hr",A).replace("heading"," *#{1,6} *[^\n]").replace("lheading",M).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},H=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,G=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,V=/^( {2,}|\\)\n(?!\s*$)/,W=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,q="\\p{P}$+<=>`^|~",K=p(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,q).getRegex(),J=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Q=p(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,q).getRegex(),Y=p("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,q).getRegex(),Z=p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,q).getRegex(),X=p(/\\([punct])/,"gu").replace(/punct/g,q).getRegex(),$=p(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[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])?)+(?![-_])/).getRegex(),ee=p(L).replace("(?:--\x3e|$)","--\x3e").getRegex(),te=p("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ee).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ne=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,re=p(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",ne).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ie=p(/^!?\[(label)\]\[(ref)\]/).replace("label",ne).replace("ref",P).getRegex(),oe=p(/^!?\[(ref)\](?:\[\])?/).replace("ref",P).getRegex(),se=p("reflink|nolink(?!\\()","g").replace("reflink",ie).replace("nolink",oe).getRegex(),ae={_backpedal:m,anyPunctuation:X,autolink:$,blockSkip:J,br:V,code:G,del:m,emStrongLDelim:Q,emStrongRDelimAst:Y,emStrongRDelimUnd:Z,escape:H,link:re,nolink:oe,punctuation:K,reflink:ie,reflinkSearch:se,tag:te,text:W,url:m},le={...ae,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",ne).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ne).getRegex()},ce={...ae,escape:p(H).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},ue={...ce,br:p(V).replace("{2,}","*").getRegex(),text:p(ce.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},de={normal:z,gfm:U,pedantic:j},he={normal:ae,gfm:ce,breaks:ue,pedantic:le};class pe{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||e.defaults,this.options.tokenizer=this.options.tokenizer||new x,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:de.normal,inline:he.normal};this.options.pedantic?(n.block=de.pedantic,n.inline=he.pedantic):this.options.gfm&&(n.block=de.gfm,this.options.breaks?n.inline=he.breaks:n.inline=he.gfm),this.tokenizer.rules=n}static get rules(){return{block:de,inline:he}}static lex(e,t){return new pe(t).lex(e)}static lexInline(e,t){return new pe(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,i,o;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i)))r=t[t.length-1],o&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),o=i.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,i,o,s,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,o.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class fe{options;constructor(t){this.options=t||e.defaults}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+c(r)+'">'+(n?e:c(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:c(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e,t,n){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const r=f(e);if(null===r)return n;let i='<a href="'+(e=r)+'"';return t&&(i+=' title="'+t+'"'),i+=">"+n+"</a>",i}image(e,t,n){const r=f(e);if(null===r)return n;let i=`<img src="${e=r}" alt="${n}"`;return t&&(i+=` title="${t}"`),i+=">",i}text(e){return e}}class me{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class ge{options;renderer;textRenderer;constructor(t){this.options=t||e.defaults,this.options.renderer=this.options.renderer||new fe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new me}static parse(e,t){return new ge(t).parse(e)}static parseInline(e,t){return new ge(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(i.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=i;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,d(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=i;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=i;let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(r);let o="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];r="";for(let t=0;t<n.length;t++)r+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});o+=this.renderer.tablerow(r)}n+=this.renderer.table(t,o);continue}case"blockquote":{const e=i,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=i,t=e.ordered,r=e.start,o=e.loose;let s="";for(let t=0;t<e.items.length;t++){const n=e.items[t],r=n.checked,i=n.task;let a="";if(n.task){const e=this.renderer.checkbox(!!r);o?n.tokens.length>0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):a+=e+" "}a+=this.parse(n.tokens,o),s+=this.renderer.listitem(a,i,!!r)}n+=this.renderer.list(s,t,r);continue}case"html":{const e=i;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=i;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let o=i,s=o.tokens?this.parseInline(o.tokens):o.text;for(;r+1<e.length&&"text"===e[r+1].type;)o=e[++r],s+="\n"+(o.tokens?this.parseInline(o.tokens):o.text);n+=t?this.renderer.paragraph(s):s;continue}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=e||"";continue}}switch(i.type){case"escape":{const e=i;n+=t.text(e.text);break}case"html":{const e=i;n+=t.html(e.text);break}case"link":{const e=i;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=i;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=i;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=i;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=i;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=i;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=i;n+=t.text(e.text);break}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class ve{options;constructor(t){this.options=t||e.defaults}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}class ye{defaults=t();options=this.setOptions;parse=this.#e(pe.lex,ge.parse);parseInline=this.#e(pe.lexInline,ge.parseInline);Parser=ge;Renderer=fe;TextRenderer=me;Lexer=pe;Tokenizer=x;Hooks=ve;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{n=n.concat(this.walkTokens(e[r],t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new fe(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const r=n,i=e.renderer[r],o=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new x(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,i=e.tokenizer[r],o=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new ve;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,i=e.hooks[r],o=t[r];ve.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then((e=>o.call(t,e)));const n=i.call(t,e);return o.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return pe.lex(e,t??this.defaults)}parser(e,t){return ge.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const i={...r},o={...this.defaults,...i};!0===this.defaults.async&&!1===i.async&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const s=this.#t(!!o.silent,!!o.async);if(null==n)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then((t=>e(t,o))).then((e=>o.hooks?o.hooks.processAllTokens(e):e)).then((e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then((()=>e)):e)).then((e=>t(e,o))).then((e=>o.hooks?o.hooks.postprocess(e):e)).catch(s);try{o.hooks&&(n=o.hooks.preprocess(n));let r=e(n,o);o.hooks&&(r=o.hooks.processAllTokens(r)),o.walkTokens&&this.walkTokens(r,o.walkTokens);let i=t(r,o);return o.hooks&&(i=o.hooks.postprocess(i)),i}catch(e){return s(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+c(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}}const be=new ye;function Se(e,t){return be.parse(e,t)}Se.options=Se.setOptions=function(e){return be.setOptions(e),Se.defaults=be.defaults,n(Se.defaults),Se},Se.getDefaults=t,Se.defaults=e.defaults,Se.use=function(...e){return be.use(...e),Se.defaults=be.defaults,n(Se.defaults),Se},Se.walkTokens=function(e,t){return be.walkTokens(e,t)},Se.parseInline=be.parseInline,Se.Parser=ge,Se.parser=ge.parse,Se.Renderer=fe,Se.TextRenderer=me,Se.Lexer=pe,Se.lexer=pe.lex,Se.Tokenizer=x,Se.Hooks=ve,Se.parse=Se;const xe=Se.options,_e=Se.setOptions,we=Se.use,Ce=Se.walkTokens,Ae=Se.parseInline,Ee=Se,Te=ge.parse,Me=pe.lex;e.Hooks=ve,e.Lexer=pe,e.Marked=ye,e.Parser=ge,e.Renderer=fe,e.TextRenderer=me,e.Tokenizer=x,e.getDefaults=t,e.lexer=Me,e.marked=Se,e.options=xe,e.parse=Ee,e.parseInline=Ae,e.parser=Te,e.setOptions=_e,e.use=we,e.walkTokens=Ce}(Ov);var Nv={};
239
- /*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */Nv=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:i}=Object;let{freeze:o,seal:s,create:a}=Object,{apply:l,construct:c}="undefined"!=typeof Reflect&&Reflect;o||(o=function(e){return e}),s||(s=function(e){return e}),l||(l=function(e,t,n){return e.apply(t,n)}),c||(c=function(e,t){return new e(...t)});const u=x(Array.prototype.forEach),d=x(Array.prototype.pop),h=x(Array.prototype.push),p=x(String.prototype.toLowerCase),f=x(String.prototype.toString),m=x(String.prototype.match),g=x(String.prototype.replace),v=x(String.prototype.indexOf),y=x(String.prototype.trim),b=x(RegExp.prototype.test),S=_(TypeError);function x(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return l(e,t,r)}}function _(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return c(e,n)}}function w(e,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p;t&&t(e,null);let o=r.length;for(;o--;){let t=r[o];if("string"==typeof t){const e=i(t);e!==t&&(n(r)||(r[o]=e),t=e)}e[t]=!0}return e}function C(t){const n=a(null);for(const[r,o]of e(t))void 0!==i(t,r)&&(n[r]=o);return n}function A(e,t){for(;null!==e;){const n=i(e,t);if(n){if(n.get)return x(n.get);if("function"==typeof n.value)return x(n.value)}e=r(e)}function n(e){return console.warn("fallback value for",e),null}return n}const E=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),T=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),M=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=o(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),R=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),P=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),k=o(["#text"]),O=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),N=o(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),L=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),D=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z=s(/<%[\w\W]*|[\w\W]*%>/gm),F=s(/\${[\w\W]*}/gm),U=s(/^data-[\-\w.\u00B7-\uFFFF]/),j=s(/^aria-[\-\w]+$/),H=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),G=s(/^(?:\w+script|data):/i),V=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W=s(/^html$/i);var q=Object.freeze({__proto__:null,MUSTACHE_EXPR:B,ERB_EXPR:z,TMPLIT_EXPR:F,DATA_ATTR:U,ARIA_ATTR:j,IS_ALLOWED_URI:H,IS_SCRIPT_OR_DATA:G,ATTR_WHITESPACE:V,DOCTYPE_NAME:W});const K=function(){return"undefined"==typeof window?null:window},J=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function Q(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K();const n=e=>Q(e);if(n.version="3.0.6",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const i=r,s=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:c,Node:x,Element:_,NodeFilter:B,NamedNodeMap:z=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:F,DOMParser:U,trustedTypes:j}=t,G=_.prototype,V=A(G,"cloneNode"),Y=A(G,"nextSibling"),Z=A(G,"childNodes"),X=A(G,"parentNode");if("function"==typeof c){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let $,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:re,getElementsByTagName:ie}=r,{importNode:oe}=i;let se={};n.isSupported="function"==typeof e&&"function"==typeof X&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:ae,ERB_EXPR:le,TMPLIT_EXPR:ce,DATA_ATTR:ue,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:he,ATTR_WHITESPACE:pe}=q;let{IS_ALLOWED_URI:fe}=q,me=null;const ge=w({},[...E,...T,...M,...R,...k]);let ve=null;const ye=w({},[...O,...N,...L,...D]);let be=Object.seal(a(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,xe=null,_e=!0,we=!0,Ce=!1,Ae=!0,Ee=!1,Te=!1,Me=!1,Ie=!1,Re=!1,Pe=!1,ke=!1,Oe=!0,Ne=!1;const Le="user-content-";let De=!0,Be=!1,ze={},Fe=null;const Ue=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let je=null;const He=w({},["audio","video","img","source","image","track"]);let Ge=null;const Ve=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",Ke="http://www.w3.org/1999/xhtml";let Je=Ke,Qe=!1,Ye=null;const Ze=w({},[We,qe,Ke],f);let Xe=null;const $e=["application/xhtml+xml","text/html"],et="text/html";let tt=null,nt=null;const rt=r.createElement("form"),it=function(e){return e instanceof RegExp||e instanceof Function},ot=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!nt||nt!==e){if(e&&"object"==typeof e||(e={}),e=C(e),Xe=Xe=-1===$e.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===Xe?f:p,me="ALLOWED_TAGS"in e?w({},e.ALLOWED_TAGS,tt):ge,ve="ALLOWED_ATTR"in e?w({},e.ALLOWED_ATTR,tt):ye,Ye="ALLOWED_NAMESPACES"in e?w({},e.ALLOWED_NAMESPACES,f):Ze,Ge="ADD_URI_SAFE_ATTR"in e?w(C(Ve),e.ADD_URI_SAFE_ATTR,tt):Ve,je="ADD_DATA_URI_TAGS"in e?w(C(He),e.ADD_DATA_URI_TAGS,tt):He,Fe="FORBID_CONTENTS"in e?w({},e.FORBID_CONTENTS,tt):Ue,Se="FORBID_TAGS"in e?w({},e.FORBID_TAGS,tt):{},xe="FORBID_ATTR"in e?w({},e.FORBID_ATTR,tt):{},ze="USE_PROFILES"in e&&e.USE_PROFILES,_e=!1!==e.ALLOW_ARIA_ATTR,we=!1!==e.ALLOW_DATA_ATTR,Ce=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ee=e.SAFE_FOR_TEMPLATES||!1,Te=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,ke=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,Oe=!1!==e.SANITIZE_DOM,Ne=e.SANITIZE_NAMED_PROPS||!1,De=!1!==e.KEEP_CONTENT,Be=e.IN_PLACE||!1,fe=e.ALLOWED_URI_REGEXP||H,Je=e.NAMESPACE||Ke,be=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(be.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ee&&(we=!1),Pe&&(Re=!0),ze&&(me=w({},[...k]),ve=[],!0===ze.html&&(w(me,E),w(ve,O)),!0===ze.svg&&(w(me,T),w(ve,N),w(ve,D)),!0===ze.svgFilters&&(w(me,M),w(ve,N),w(ve,D)),!0===ze.mathMl&&(w(me,R),w(ve,L),w(ve,D))),e.ADD_TAGS&&(me===ge&&(me=C(me)),w(me,e.ADD_TAGS,tt)),e.ADD_ATTR&&(ve===ye&&(ve=C(ve)),w(ve,e.ADD_ATTR,tt)),e.ADD_URI_SAFE_ATTR&&w(Ge,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(Fe===Ue&&(Fe=C(Fe)),w(Fe,e.FORBID_CONTENTS,tt)),De&&(me["#text"]=!0),Te&&w(me,["html","head","body"]),me.table&&(w(me,["tbody"]),delete Se.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');$=e.TRUSTED_TYPES_POLICY,ee=$.createHTML("")}else void 0===$&&($=J(j,s)),null!==$&&"string"==typeof ee&&(ee=$.createHTML(""));o&&o(e),nt=e}},st=w({},["mi","mo","mn","ms","mtext"]),at=w({},["foreignobject","desc","title","annotation-xml"]),lt=w({},["title","style","font","a","script"]),ct=w({},T);w(ct,M),w(ct,I);const ut=w({},R);w(ut,P);const dt=function(e){let t=X(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});const n=p(e.tagName),r=p(t.tagName);return!!Ye[e.namespaceURI]&&(e.namespaceURI===qe?t.namespaceURI===Ke?"svg"===n:t.namespaceURI===We?"svg"===n&&("annotation-xml"===r||st[r]):Boolean(ct[n]):e.namespaceURI===We?t.namespaceURI===Ke?"math"===n:t.namespaceURI===qe?"math"===n&&at[r]:Boolean(ut[n]):e.namespaceURI===Ke?!(t.namespaceURI===qe&&!at[r])&&!(t.namespaceURI===We&&!st[r])&&!ut[n]&&(lt[n]||!ct[n]):!("application/xhtml+xml"!==Xe||!Ye[e.namespaceURI]))},ht=function(e){h(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},pt=function(e,t){try{h(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){h(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ve[e])if(Re||Pe)try{ht(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ft=function(e){let t=null,n=null;if(Ie)e="<remove></remove>"+e;else{const t=m(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Xe&&Je===Ke&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=$?$.createHTML(e):e;if(Je===Ke)try{t=(new U).parseFromString(i,Xe)}catch(e){}if(!t||!t.documentElement){t=te.createDocument(Je,"template",null);try{t.documentElement.innerHTML=Qe?ee:i}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),Je===Ke?ie.call(t,Te?"html":"body")[0]:Te?t.documentElement:o},mt=function(e){return ne.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT,null)},gt=function(e){return e instanceof F&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof z)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},vt=function(e){return"function"==typeof x&&e instanceof x},yt=function(e,t,r){se[e]&&u(se[e],(e=>{e.call(n,t,r,nt)}))},bt=function(e){let t=null;if(yt("beforeSanitizeElements",e,null),gt(e))return ht(e),!0;const r=tt(e.nodeName);if(yt("uponSanitizeElement",e,{tagName:r,allowedTags:me}),e.hasChildNodes()&&!vt(e.firstElementChild)&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return ht(e),!0;if(!me[r]||Se[r]){if(!Se[r]&&xt(r)){if(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,r))return!1;if(be.tagNameCheck instanceof Function&&be.tagNameCheck(r))return!1}if(De&&!Fe[r]){const t=X(e)||e.parentNode,n=Z(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(V(n[r],!0),Y(e))}return ht(e),!0}return e instanceof _&&!dt(e)?(ht(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ee&&3===e.nodeType&&(t=e.textContent,u([ae,le,ce],(e=>{t=g(t,e," ")})),e.textContent!==t&&(h(n.removed,{element:e.cloneNode()}),e.textContent=t)),yt("afterSanitizeElements",e,null),!1):(ht(e),!0)},St=function(e,t,n){if(Oe&&("id"===t||"name"===t)&&(n in r||n in rt))return!1;if(we&&!xe[t]&&b(ue,t));else if(_e&&b(de,t));else if(!ve[t]||xe[t]){if(!(xt(e)&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,e)||be.tagNameCheck instanceof Function&&be.tagNameCheck(e))&&(be.attributeNameCheck instanceof RegExp&&b(be.attributeNameCheck,t)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(t))||"is"===t&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,n)||be.tagNameCheck instanceof Function&&be.tagNameCheck(n))))return!1}else if(Ge[t]);else if(b(fe,g(n,pe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!je[e])if(Ce&&!b(he,g(n,pe,"")));else if(n)return!1;return!0},xt=function(e){return e.indexOf("-")>0},_t=function(e){yt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ve};let i=t.length;for(;i--;){const o=t[i],{name:s,namespaceURI:a,value:l}=o,c=tt(s);let h="value"===s?l:y(l);if(r.attrName=c,r.attrValue=h,r.keepAttr=!0,r.forceKeepAttr=void 0,yt("uponSanitizeAttribute",e,r),h=r.attrValue,r.forceKeepAttr)continue;if(pt(s,e),!r.keepAttr)continue;if(!Ae&&b(/\/>/i,h)){pt(s,e);continue}Ee&&u([ae,le,ce],(e=>{h=g(h,e," ")}));const p=tt(e.nodeName);if(St(p,c,h)){if(!Ne||"id"!==c&&"name"!==c||(pt(s,e),h=Le+h),$&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(a);else switch(j.getAttributeType(p,c)){case"TrustedHTML":h=$.createHTML(h);break;case"TrustedScriptURL":h=$.createScriptURL(h)}try{a?e.setAttributeNS(a,s,h):e.setAttribute(s,h),d(n.removed)}catch(e){}}}yt("afterSanitizeAttributes",e,null)},wt=function e(t){let n=null;const r=mt(t);for(yt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)yt("uponSanitizeShadowNode",n,null),bt(n)||(n.content instanceof l&&e(n.content),_t(n));yt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,s=null,a=null;if(Qe=!e,Qe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!vt(e)){if("function"!=typeof e.toString)throw S("toString is not a function");if("string"!=typeof(e=e.toString()))throw S("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Me||ot(t),n.removed=[],"string"==typeof e&&(Be=!1),Be){if(e.nodeName){const t=tt(e.nodeName);if(!me[t]||Se[t])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof x)r=ft("\x3c!----\x3e"),o=r.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!Re&&!Ee&&!Te&&-1===e.indexOf("<"))return $&&ke?$.createHTML(e):e;if(r=ft(e),!r)return Re?null:ke?ee:""}r&&Ie&&ht(r.firstChild);const c=mt(Be?e:r);for(;s=c.nextNode();)bt(s)||(s.content instanceof l&&wt(s.content),_t(s));if(Be)return e;if(Re){if(Pe)for(a=re.call(r.ownerDocument);r.firstChild;)a.appendChild(r.firstChild);else a=r;return(ve.shadowroot||ve.shadowrootmode)&&(a=oe.call(i,a,!0)),a}let d=Te?r.outerHTML:r.innerHTML;return Te&&me["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&b(W,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Ee&&u([ae,le,ce],(e=>{d=g(d,e," ")})),$&&ke?$.createHTML(d):d},n.setConfig=function(){ot(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Me=!0},n.clearConfig=function(){nt=null,Me=!1},n.isValidAttribute=function(e,t,n){nt||ot({});const r=tt(e),i=tt(t);return St(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&(se[e]=se[e]||[],h(se[e],t))},n.removeHook=function(e){if(se[e])return d(se[e])},n.removeHooks=function(e){se[e]&&(se[e]=[])},n.removeAllHooks=function(){se={}},n}return Q()}();var Lv=({className:e,title:t})=>(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 24 24",className:e,"aria-label":t,children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("path",{d:"M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3"}),(0,s.jsx)("path",{d:"M12 17L12.01 17"})]});c=o("85Hg2"),c=o("85Hg2");var Dv=({rows:e,className:n,innerClassName:r,btnClassName:i,lineHeightMultiplier:o=1.2,defaultExpanded:a=!1,expandSymbol:l=(()=>"..."),collapseSymbol:u=(e=>"it"===e?"Mostra meno":"Show less"),children:d})=>{const{i18n:h}=Se(),p=h.language,f=u(p),m=l(p),[g,v]=(0,c.useState)(a),[y,b]=(0,c.useState)(!1),[S,x]=(0,c.useState)(16),_=(0,c.useRef)(null);return(0,c.useEffect)((()=>{if(_.current){let t=_.current.getBoundingClientRect().height,n=getComputedStyle(_.current),r=n.lineHeight,i="normal"!==r&&(null==r?void 0:r.length)?parseInt(r,10):o*parseInt(n.fontSize,10);console.table({rows:e,lineHeight:i,height:t,maxHeight:e*i,needsExpanding:t>e*i}),x(i),t&&t>e*i&&b(!0)}}),[e,_.current]),(0,s.jsxs)("div",{className:t(xs)("memori-expandable",n),children:[(0,s.jsx)("div",{ref:_,className:t(xs)("memori-expandable--inner",r),style:{maxHeight:g||!y?"9999px":S*e+"px"},children:d}),y&&!g&&(0,s.jsx)(Sf,{ghost:!0,padded:!1,className:i,onClick:()=>v(!0),children:m}),y&&g&&(0,s.jsx)(Sf,{ghost:!0,padded:!1,className:i,onClick:()=>v(!1),children:f})]})};const Bv=new Map(Object.entries({TENANT_NOT_FOUND:-1,TENANT_REGISTRATION_DISABLED:-2,TENANT_MISSING_NAME:-3,TENANT_MAX_USERS_REACHED:-4,TENANT_MAX_ADMINS_REACHED:-5,TENANT_ALREADY_EXISTS:-6,TENANT_MISSING_DESCRIPTION:-7,TENANT_CANT_SET_COMPLETION_PROVIDER:-8,USER_NOT_CONFIRMED:-11,USER_NOT_FOUND:-12,USER_OR_PASSWORD_INVALID:-13,USER_MUST_CHANGE_PASSWORD:-14,USER_MUST_ENTER_VERIFICATION_CODE:-15,USER_MISSING_TENANT:-21,USER_MISSING_NAME:-22,USER_MISSING_PASSWORD:-23,USER_MISSING_EMAIL:-24,USER_MISSING_VERIFICATION_CODE:-25,USER_NAME_ALREADY_USED:-26,USER_PASSWORD_NOT_CONFORMING_TO_POLICY:-27,USER_EMAIL_ALREADY_USED:-28,USER_EMAIL_INVALID:-29,USER_VERIFICATION_CODE_INVALID:-30,USER_MISSING_NAME_OR_EMAIL:-31,USER_NAME_INVALID:-32,USER_HAS_ONE_OR_MORE_MEMORI:-33,USER_MISSING_NEW_PASSWORD:-34,USER_CANT_CREATE_MEMORI:-35,USER_MAX_MEMORI_REACHED:-36,USER_TOO_MANY_ATTEMPTS:-38,USER_MUST_ACCEPT_TNC_AND_PP:-39,USER_BIRTH_DATE_CANT_BE_CHANGED:-40,USER_CANT_SET_COMPLETION_PROVIDER:-41,USER_CANT_ENABLE_DEEP_THOUGHT:-42,USER_CANT_ENABLE_DCM_INTEGRATION:-43,USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS:-44,MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS:-45,MEMORI_NOT_FOUND:-51,MEMORI_NOT_ACCESSIBLE:-52,MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN:-53,SESSION_NOT_FOUND:-101,SESSION_IS_NOT_ADMINISTRATIVE:-102,SESSION_EXPIRED:-103,MEMORI_MISSING_CONFIGURATION:-201,MEMORI_CONFIGURATION_NOT_FOUND:-202,MEMORI_INVALID_PRIVACY_TYPE:-203,MEMORI_MISSING_PASSWORD:-204,MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS:-205,MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS:-206,MEMORI_INVALID_VOICE_TYPE:-207,MEMORI_MISSING_NAME:-208,MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS:-209,MEMORI_INVALID_ID:-210,MEMORI_NAME_ALREADY_USED:-211,MEMORI_INVALID_PIN:-212,MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION:-213,MEMORI_NO_PASSWORD_WHEN_PUBLIC:-214,MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS:-215,MEMORI_TRANSFER_MISSING_DESTINATION_USER:-231,MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID:-232,MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT:-233,MEMORI_TRANSFER_NOTHING_TO_DO:-234,MEMORI_CONFIGURATION_CANT_BE_CHANGED:-251,MEMORI_MISSING_NEW_PASSWORD:-252,MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT:-261,MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT:-262,MEMORI_FEATURE_REQUIRES_SUBSCRIPTION:-271,INTEGRATION_NOT_FOUND:-301,INTEGRATION_INVALID_TYPE:-401,INTEGRATION_ALREADY_EXISTS:-402,INTEGRATION_MEMORI_IS_NOT_PUBLIC:-403,INTEGRATION_MISSING_INVOCATION_TEXT:-404,INTEGRATION_MISSING_DEVICE_EMAILS:-405,INTEGRATION_MEMORI_IS_EMPTY:-406,INTEGRATION_MISSING_PRIVACY_POLICY:-407,INTEGRATION_MISSING_CATEGORY:-408,INTEGRATION_MISSING_DESCRIPTION:-409,INTEGRATION_INVALID_INVOCATION_TEXT:-410,INTEGRATION_GOOGLE_NO_MORE_AVAILABLE:-411,UPLOAD_REQUIRES_MULTIPART_ENCODING:-501,UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY:-502,UPLOAD_MAX_LENGTH_EXCEEDED:-503,UPLOAD_FILE_IS_EMPTY:-504,UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE:-505,UPLOAD_MISSING_FILE_NAME:-506,UPLOAD_INVALID_MEMORY_ID:-507,UPLOAD_MISSING_FILE_CONTENT:-508,ASSET_NOT_FOUND:-601,ASSET_NOT_ACCESSIBLE:-602,ASSET_MISSING_SESSION_ID:-603,ASSET_INVALID_FILE_NAME:-604,INVITATION_NOT_FOUND:-701,INVITATION_NOT_ACCESSIBLE:-702,INVITATION_ALREADY_ACCEPTED:-703,INVITATION_ALREADY_REJECTED:-704,INVITATION_MISSING_DESTINATION_EMAIL:-705,INVITATION_DESTINATION_EMAIL_INVALID:-706,INVITATION_MISSING_TAG:-707,INVITATION_MISSING_PIN:-708,INVITATION_INVALID_PIN:-709,INVITATION_INVALID_TYPE:-710,INVITATION_MISSING_DESTINATION_NAME:-711,INVITATION_TAG_PIN_CANT_BE_CHANGED:-712,INVITATION_CANT_BE_CHANGED:-713,ACTIONLOG_INVALID_USER_ID:-801,ACTIONLOG_INVALID_DATE_FROM_FORMAT:-802,ACTIONLOG_INVALID_DATE_TO_FORMAT:-803,ACTIONLOG_INVALID_MEMORI_ID:-804,CONSUMPTIONLOG_INVALID_TYPE:-901,CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT:-902,CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT:-903,CONSUMPTIONLOG_INVALID_USER_ID:-904,CONSUMPTIONLOG_INVALID_MEMORI_ID:-905,NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD:-1001,PROCESS_INVALID_TYPE:-1401,PROCESS_ALREADY_RUNNING:-1401,PROCESS_NOT_FOUND:-1402,IMPORTCSV_MISSING_ROWS:-1501,IMPORTCSV_MISSING_CSV:-1502,IMPORTCSV_MISSING_SEPARATOR:-1503,IMPORTCSV_INVALID_SEPARATOR:-1504,IMPORTCSV_MISSING_HEADERS:-1505,IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR:-1506,IMPORTCSV_UNDETECTABLE_CHAR_ENCODING:-1521,IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI:-1531,IMPORTTXT_MISSING_ROWS:-1601,IMPORTTXT_INVALID_GRANULARITY:-1602,IMPORTTXT_UNDETECTABLE_CHAR_ENCODING:-1621,IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI:-1631,IMPORTTXT_IMPORT_LIMIT_EXCEEDED:-1632,IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY:-1633,IMPORTTXT_IMPORT_REQUIRES_PAYING:-1634,EXPORTCSV_MISSING_CSV_SPECS:-1801,EXPORTCSV_MISSING_SEPARATOR:-1802,EXPORTCSV_INVALID_SEPARATOR:-1803,EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR:-1804,EXPORTCSV_MISSING_NEW_LINE_CHAR:-1805,EXPORTCSV_INVALID_NEW_LINE_CHAR:-1806,EXPORTCSV_MISSING_PASSWORD:-1811,EXPORTJSONL_MISSING_JSONL_SPECS:-1821,EXPORTJSONL_MISSING_PLATFORM:-1822,EXPORTJSONL_INVALID_PLATFORM:-1823,EXPORTJSONL_MISSING_PASSWORD:-1831,EXPORTJSONL_EXPORT_REQUIRES_PAYING:-1832,ANALYSIS_MISSING_QUERY:-1901,ANALYSIS_CANT_ANALYZE_SECRET_MEMORI:-1902,ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT:-1903,BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS:-2001,BADGE_ASSIGNMENT_MISSING_REF_ID:-2002,BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND:-2003,BADGE_ASSIGNMENT_MISSING_ASSERTION_URL:-2004,BADGE_ASSIGNMENT_MISSING_BADGE_URL:-2005,BADGE_ASSIGNMENT_MISSING_ISSUER_URL:-2006,BADGE_ASSIGNMENT_INVALID_URL:-2007,BADGE_ASSIGNMENT_MISSING_RECIPIENT:-2021,BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE:-2022,BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY:-2023,BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE:-2024,BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE:-2025,BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY:-2026,BADGE_NOT_FOUND:-2051,OUTCOME_NO_DCM_CONFIGURED:-2071,OUTCOME_USER_BADGES_DISABLED:-2072}).map((([e,t])=>[t,e]))),zv=e=>{if(!e)return"error.generic";if(401===e||403===e)return"error.unauthorized";if(404===e)return"error.notFound";if(422===e)return"error.unprocessableEntity";if(500===e)return"internal server error";let t=Bv.get(e);return t?`errors.${t}`:"error.generic"};var Fv=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"})});const Uv=[{value:"IT",label:"Italiano"},{value:"EN",label:"English"},{value:"DE",label:"Deutsch"},{value:"ES",label:"Español"},{value:"FR",label:"Français"},{value:"PT",label:"Português"},{value:"UK",label:"Українська"},{value:"RU",label:"Русский"},{value:"PL",label:"Polski"},{value:"FI",label:"Suomi"}],jv="👤",Hv=[{name:"text",lang:"text",mimeType:"text/plain",monacoLang:"plaintext",executable:!0},{name:"javascript/jsx",lang:"jsx",mimeType:"text/javascript",monacoLang:"javascript",executable:!0},{name:"typescript/tsx",lang:"tsx",mimeType:"text/ecmascript",monacoLang:"typescript",executable:!0},{name:"json",lang:"json",mimeType:"application/json",monacoLang:"json",executable:!0},{name:"css",lang:"scss",mimeType:"text/css",monacoLang:"css",executable:!0},{name:"html/xml",lang:"tsx",mimeType:"application/xml",monacoLang:"xml"},{name:"bash",lang:"bash",mimeType:"application/x-sh",monacoLang:"shell"},{name:"python",lang:"python",mimeType:"text/x-python",monacoLang:"python"},{name:"cpp/csharp",lang:"cpp",mimeType:"text/x-c++src",monacoLang:"cpp"},{name:"php",lang:"php",mimeType:"application/x-php",monacoLang:"php"},{name:"ruby",lang:"ruby",mimeType:"text/x-ruby",monacoLang:"ruby"},{name:"sql",lang:"sql",mimeType:"text/x-sql",monacoLang:"sql"}],Gv={it:[{text:"",delayAfter:10},{text:"Cerco l'esperto più adatto",delayAfter:5},{text:"Contatto l'esperto",delayAfter:3},{text:"Spiego all'esperto la domanda",delayAfter:2},{text:"L'esperto sta preparando una risposta",delayAfter:6},{text:"Genero una risposta adatta",delayAfter:3}],en:[{text:"",delayAfter:10},{text:"I'm looking for the most suitable expert",delayAfter:5},{text:"I'm contacting the expert",delayAfter:3},{text:"I'm explaining the question to the expert",delayAfter:2},{text:"The expert is preparing an answer",delayAfter:6},{text:"I am generating a suitable answer",delayAfter:3}]};var Vv={};function Wv(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}(Vv=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){Wv(o,r,i,s,a,"next",e)}function a(e){Wv(o,r,i,s,a,"throw",e)}s(void 0)}))}}).__esModule=!0,Vv.default=Vv;var qv={};function Kv(){return qv=Kv=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},qv.__esModule=!0,qv.default=qv,Kv.apply(this,arguments)}(qv=Kv).__esModule=!0,qv.default=qv;$=o("ffgrs"),ee=o("22y1y");var Jv={},Qv={};function Yv(e,t){return Qv=Yv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Qv.__esModule=!0,Qv.default=Qv,Yv(e,t)}(Qv=Yv).__esModule=!0,Qv.default=Qv,(Jv=function(e,t){if("function"!=typeof t&&null!==t)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&&Qv(e,t)}).__esModule=!0,Jv.default=Jv;var Zv={},Xv=o("lEJSL").default,$v={};($v=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}).__esModule=!0,$v.default=$v,(Zv=function(e,t){if(t&&("object"===Xv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $v(e)}).__esModule=!0,Zv.default=Zv;var ey={};function ty(e){return ey=ty=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ey.__esModule=!0,ey.default=ey,ty(e)}(ey=ty).__esModule=!0,ey.default=ey;var ny,ry=o("7qcgS")();ny=ry;try{regeneratorRuntime=ry}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=ry:Function("r","regeneratorRuntime = r")(ry)}c=o("85Hg2");var iy={},oy={};(oy=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}).__esModule=!0,oy.default=oy,(iy=function(e,t){if(null==e)return{};var n,r,i=oy(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}).__esModule=!0,iy.default=iy;var sy={},ay={},ly=o("e3mvX");(ay=function(e){if(Array.isArray(e))return ly(e)}).__esModule=!0,ay.default=ay;var cy={};(cy=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}).__esModule=!0,cy.default=cy;var uy=o("8xD61"),dy={};(dy=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,dy.default=dy,(sy=function(e){return ay(e)||cy(e)||uy(e)||dy()}).__esModule=!0,sy.default=sy;c=o("85Hg2"),c=o("85Hg2");function hy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function py(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?hy(Object(r),!0).forEach((function(n){t(Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hy(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var fy={};function my(e){if(0===e.length||1===e.length)return e;var t,n,r=e.join(".");return fy[r]||(fy[r]=0===(n=(t=e).length)||1===n?t:2===n?[t[0],t[1],"".concat(t[0],".").concat(t[1]),"".concat(t[1],".").concat(t[0])]:3===n?[t[0],t[1],t[2],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0])]:n>=4?[t[0],t[1],t[2],t[3],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[2],".").concat(t[3]),"".concat(t[3],".").concat(t[0]),"".concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[0]),"".concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[3],".").concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[2],".").concat(t[1],".").concat(t[0])]:void 0),fy[r]}function gy(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter((function(e){return"token"!==e})),i=my(r);return i.reduce((function(e,t){return py(py({},e),n[t])}),t)}function vy(e){return e.join(" ")}function yy(e){var n=e.node,r=e.stylesheet,i=e.style,o=void 0===i?{}:i,s=e.useInlineStyles,a=e.key,l=n.properties,u=n.type,d=n.tagName,h=n.value;if("text"===u)return h;if(d){var p,f=function(e,t){var n=0;return function(r){return n+=1,r.map((function(r,i){return yy({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(i)})}))}}(r,s);if(s){var m=Object.keys(r).reduce((function(e,t){return t.split(".").forEach((function(t){e.includes(t)||e.push(t)})),e}),[]),g=l.className&&l.className.includes("token")?["token"]:[],v=l.className&&g.concat(l.className.filter((function(e){return!m.includes(e)})));p=py(py({},l),{},{className:vy(v)||void 0,style:gy(l.className,Object.assign({},l.style,o),r)})}else p=py(py({},l),{},{className:vy(l.className)});var y=f(n.children);return t(c).createElement(d,t(qv)({key:a},p),y)}}var by=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function Sy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xy(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Sy(Object(r),!0).forEach((function(n){t(Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sy(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _y=/\n/g;function wy(e){var n=e.codeString,r=e.codeStyle,i=e.containerStyle,o=void 0===i?{float:"left",paddingRight:"10px"}:i,s=e.numberStyle,a=void 0===s?{}:s,l=e.startingLineNumber;return t(c).createElement("code",{style:Object.assign({},r,o)},function(e){var n=e.lines,r=e.startingLineNumber,i=e.style;return n.map((function(e,n){var o=n+r;return t(c).createElement("span",{key:"line-".concat(n),className:"react-syntax-highlighter-line-number",style:"function"==typeof i?i(o):i},"".concat(o,"\n"))}))}({lines:n.replace(/\n$/,"").split("\n"),style:a,startingLineNumber:l}))}function Cy(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 Ay(e,t,n){var r,i={display:"inline-block",minWidth:(r=n,"".concat(r.toString().length,".25em")),paddingRight:"1em",textAlign:"right",userSelect:"none"},o="function"==typeof e?e(t):e;return xy(xy({},i),o)}function Ey(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,o=e.showInlineLineNumbers,s=e.lineProps,a=void 0===s?{}:s,l=e.className,c=void 0===l?[]:l,u=e.showLineNumbers,d=e.wrapLongLines,h="function"==typeof a?a(n):a;if(h.className=c,n&&o){var p=Ay(r,n,i);t.unshift(Cy(n,p))}return d&u&&(h.style=xy(xy({},h.style),{},{display:"flex"})),{type:"element",tagName:"span",properties:h,children:t}}function Ty(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=0;i<e.length;i++){var o=e[i];if("text"===o.type)r.push(Ey({children:[o],className:t(sy)(new Set(n))}));else if(o.children){var s=n.concat(o.properties.className);Ty(o.children,s).forEach((function(e){return r.push(e)}))}}return r}function My(e,t,n,r,i,o,s,a,l){var c,u=Ty(e.value),d=[],h=-1,p=0;function f(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Ey({children:e,lineNumber:t,lineNumberStyle:a,largestLineNumber:s,showInlineLineNumbers:i,lineProps:n,className:o,showLineNumbers:r,wrapLongLines:l})}function m(e,t){if(r&&t&&i){var n=Ay(a,t,s);e.unshift(Cy(t,n))}return e}function g(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?f(e,n,r):m(e,n)}for(var v=function(){var e=u[p],t=e.children[0].value;if(t.match(_y)){var n=t.split("\n");n.forEach((function(t,i){var s=r&&d.length+o,a={type:"text",value:"".concat(t,"\n")};if(0===i){var l=g(u.slice(h+1,p).concat(Ey({children:[a],className:e.properties.className})),s);d.push(l)}else if(i===n.length-1){var c=u[p+1]&&u[p+1].children&&u[p+1].children[0],f={type:"text",value:"".concat(t)};if(c){var m=Ey({children:[f],className:e.properties.className});u.splice(p+1,0,m)}else{var v=g([f],s,e.properties.className);d.push(v)}}else{var y=g([a],s,e.properties.className);d.push(y)}})),h=p}p++};p<u.length;)v();if(h!==u.length-1){var y=u.slice(h+1,u.length);if(y&&y.length){var b=g(y,r&&d.length+o);d.push(b)}}return t?d:(c=[]).concat.apply(c,d)}function Iy(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map((function(e,t){return yy({node:e,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(t)})}))}function Ry(e){return e&&void 0!==e.highlightAuto}function Py(e,n){return function(r){var i=r.language,o=r.children,s=r.style,a=void 0===s?n:s,l=r.customStyle,u=void 0===l?{}:l,d=r.codeTagProps,h=void 0===d?{className:i?"language-".concat(i):void 0,style:xy(xy({},a['code[class*="language-"]']),a['code[class*="language-'.concat(i,'"]')])}:d,p=r.useInlineStyles,f=void 0===p||p,m=r.showLineNumbers,g=void 0!==m&&m,v=r.showInlineLineNumbers,y=void 0===v||v,b=r.startingLineNumber,S=void 0===b?1:b,x=r.lineNumberContainerStyle,_=r.lineNumberStyle,w=void 0===_?{}:_,C=r.wrapLines,A=r.wrapLongLines,E=void 0!==A&&A,T=r.lineProps,M=void 0===T?{}:T,I=r.renderer,R=r.PreTag,P=void 0===R?"pre":R,k=r.CodeTag,O=void 0===k?"code":k,N=r.code,L=void 0===N?(Array.isArray(o)?o[0]:o)||"":N,D=r.astGenerator,B=t(iy)(r,by);D=D||e;var z=g?t(c).createElement(wy,{containerStyle:x,codeStyle:h.style||{},numberStyle:w,startingLineNumber:S,codeString:L}):null,F=a.hljs||a['pre[class*="language-"]']||{backgroundColor:"#fff"},U=Ry(D)?"hljs":"prismjs",j=f?Object.assign({},B,{style:Object.assign({},F,u)}):Object.assign({},B,{className:B.className?"".concat(U," ").concat(B.className):U,style:Object.assign({},u)});if(h.style=xy(xy({},h.style),{},E?{whiteSpace:"pre-wrap"}:{whiteSpace:"pre"}),!D)return t(c).createElement(P,j,z,t(c).createElement(O,h,L));(void 0===C&&I||E)&&(C=!0),I=I||Iy;var H=[{type:"text",value:L}],G=function(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(Ry(t)){var o=function(e,t){return-1!==e.listLanguages().indexOf(t)}(t,n);return"text"===n?{value:i,language:"text"}:o?t.highlight(n,r):t.highlightAuto(r)}try{return n&&"text"!==n?{value:t.highlight(r,n)}:{value:i}}catch(e){return{value:i}}}({astGenerator:D,language:i,code:L,defaultCodeValue:H});null===G.language&&(G.value=H);var V=My(G,C,M,g,y,S,G.value.length+S,w,E);return t(c).createElement(P,j,t(c).createElement(O,h,!y&&z,I({rows:V,stylesheet:a,useInlineStyles:f})))}}function ky(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=t(ey)(e);if(n){var o=t(ey)(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return t(Zv)(this,r)}}var Oy,Ny,Ly,Dy,By,zy,Fy,Uy=function(e,n){return function(){var r=t(Vv)(t(ny).mark((function r(i){var o;return t(ny).wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:o=t.sent,i(e,o.default||o);case 4:case"end":return t.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()},jy={abap:Uy("abap",(function(){return o("bwHpE")})),abnf:Uy("abnf",(function(){return o("daD87")})),actionscript:Uy("actionscript",(function(){return o("lpEgO")})),ada:Uy("ada",(function(){return o("1sGW9")})),agda:Uy("agda",(function(){return o("e9VyR")})),al:Uy("al",(function(){return o("kMFSe")})),antlr4:Uy("antlr4",(function(){return o("8HlsP")})),apacheconf:Uy("apacheconf",(function(){return o("isFCh")})),apex:Uy("apex",(function(){return o("gUXVM")})),apl:Uy("apl",(function(){return o("2L15v")})),applescript:Uy("applescript",(function(){return o("8XyFT")})),aql:Uy("aql",(function(){return o("gFWTI")})),arduino:Uy("arduino",(function(){return o("jI3VB")})),arff:Uy("arff",(function(){return o("6uYTH")})),asciidoc:Uy("asciidoc",(function(){return o("gdYKH")})),asm6502:Uy("asm6502",(function(){return o("ahFLg")})),asmatmel:Uy("asmatmel",(function(){return o("4irIu")})),aspnet:Uy("aspnet",(function(){return o("yDC6n")})),autohotkey:Uy("autohotkey",(function(){return o("a4xpy")})),autoit:Uy("autoit",(function(){return o("iNSix")})),avisynth:Uy("avisynth",(function(){return o("kEBnk")})),avroIdl:Uy("avroIdl",(function(){return o("lzthi")})),bash:Uy("bash",(function(){return Promise.resolve(o("3aDLI"))})),basic:Uy("basic",(function(){return o("cxDu6")})),batch:Uy("batch",(function(){return o("6zDll")})),bbcode:Uy("bbcode",(function(){return o("bPS87")})),bicep:Uy("bicep",(function(){return o("8dy5f")})),birb:Uy("birb",(function(){return o("3vHrY")})),bison:Uy("bison",(function(){return o("bCjBS")})),bnf:Uy("bnf",(function(){return o("4NqDW")})),brainfuck:Uy("brainfuck",(function(){return o("4s0KX")})),brightscript:Uy("brightscript",(function(){return o("jTsQ4")})),bro:Uy("bro",(function(){return o("5lMc2")})),bsl:Uy("bsl",(function(){return o("jBYxC")})),c:Uy("c",(function(){return Promise.resolve(o("lyZgY"))})),cfscript:Uy("cfscript",(function(){return o("coZDy")})),chaiscript:Uy("chaiscript",(function(){return o("e1zEN")})),cil:Uy("cil",(function(){return o("crKoM")})),clike:Uy("clike",(function(){return o("4kO9t")})),clojure:Uy("clojure",(function(){return o("01SpB")})),cmake:Uy("cmake",(function(){return o("9yG4p")})),cobol:Uy("cobol",(function(){return o("967Hn")})),coffeescript:Uy("coffeescript",(function(){return o("7Yi6H")})),concurnas:Uy("concurnas",(function(){return o("5tXmX")})),coq:Uy("coq",(function(){return o("ektdr")})),cpp:Uy("cpp",(function(){return Promise.resolve(o("lR39A"))})),crystal:Uy("crystal",(function(){return o("8gt4L")})),csharp:Uy("csharp",(function(){return o("7K6eJ")})),cshtml:Uy("cshtml",(function(){return o("cVu4i")})),csp:Uy("csp",(function(){return o("ecKo1")})),cssExtras:Uy("cssExtras",(function(){return o("gnpv8")})),css:Uy("css",(function(){return o("jx0H8")})),csv:Uy("csv",(function(){return o("f9kmW")})),cypher:Uy("cypher",(function(){return o("lojor")})),d:Uy("d",(function(){return o("6Qa0U")})),dart:Uy("dart",(function(){return o("74K1B")})),dataweave:Uy("dataweave",(function(){return o("93H6c")})),dax:Uy("dax",(function(){return o("cf9Y9")})),dhall:Uy("dhall",(function(){return o("f6UWv")})),diff:Uy("diff",(function(){return o("klPVo")})),django:Uy("django",(function(){return o("jfxe9")})),dnsZoneFile:Uy("dnsZoneFile",(function(){return o("5aMz5")})),docker:Uy("docker",(function(){return o("kOauC")})),dot:Uy("dot",(function(){return o("btE6k")})),ebnf:Uy("ebnf",(function(){return o("aT88c")})),editorconfig:Uy("editorconfig",(function(){return o("jWOl8")})),eiffel:Uy("eiffel",(function(){return o("kHJaX")})),ejs:Uy("ejs",(function(){return o("frfnA")})),elixir:Uy("elixir",(function(){return o("hcrJ2")})),elm:Uy("elm",(function(){return o("jd271")})),erb:Uy("erb",(function(){return o("gczXL")})),erlang:Uy("erlang",(function(){return o("FsabW")})),etlua:Uy("etlua",(function(){return o("9DI9l")})),excelFormula:Uy("excelFormula",(function(){return o("3QVue")})),factor:Uy("factor",(function(){return o("ltNCT")})),falselang:Uy("falselang",(function(){return o("g0Q6p")})),firestoreSecurityRules:Uy("firestoreSecurityRules",(function(){return o("ukA2V")})),flow:Uy("flow",(function(){return o("e5prn")})),fortran:Uy("fortran",(function(){return o("gIEL6")})),fsharp:Uy("fsharp",(function(){return o("3wQkt")})),ftl:Uy("ftl",(function(){return o("7ZVWs")})),gap:Uy("gap",(function(){return o("hOFj6")})),gcode:Uy("gcode",(function(){return o("95BzQ")})),gdscript:Uy("gdscript",(function(){return o("iul6t")})),gedcom:Uy("gedcom",(function(){return o("e0qJM")})),gherkin:Uy("gherkin",(function(){return o("2SHak")})),git:Uy("git",(function(){return o("l6VFH")})),glsl:Uy("glsl",(function(){return o("cEMfJ")})),gml:Uy("gml",(function(){return o("8UVTr")})),gn:Uy("gn",(function(){return o("kvibD")})),goModule:Uy("goModule",(function(){return o("icqjF")})),go:Uy("go",(function(){return o("jLkg8")})),graphql:Uy("graphql",(function(){return o("aYGNi")})),groovy:Uy("groovy",(function(){return o("4bTmH")})),haml:Uy("haml",(function(){return o("h2A6V")})),handlebars:Uy("handlebars",(function(){return o("79YVJ")})),haskell:Uy("haskell",(function(){return o("bsiLW")})),haxe:Uy("haxe",(function(){return o("94Kdj")})),hcl:Uy("hcl",(function(){return o("9CheR")})),hlsl:Uy("hlsl",(function(){return o("h3dqW")})),hoon:Uy("hoon",(function(){return o("9WbsW")})),hpkp:Uy("hpkp",(function(){return o("GiPN3")})),hsts:Uy("hsts",(function(){return o("eaSn9")})),http:Uy("http",(function(){return o("1uj7b")})),ichigojam:Uy("ichigojam",(function(){return o("ge562")})),icon:Uy("icon",(function(){return o("lVHUf")})),icuMessageFormat:Uy("icuMessageFormat",(function(){return o("aYoUL")})),idris:Uy("idris",(function(){return o("1RVAE")})),iecst:Uy("iecst",(function(){return o("bi7Dr")})),ignore:Uy("ignore",(function(){return o("cq0Pi")})),inform7:Uy("inform7",(function(){return o("31K4E")})),ini:Uy("ini",(function(){return o("l05OZ")})),io:Uy("io",(function(){return o("6bY1b")})),j:Uy("j",(function(){return o("1ebDS")})),java:Uy("java",(function(){return o("iEZZI")})),javadoc:Uy("javadoc",(function(){return o("aHy5a")})),javadoclike:Uy("javadoclike",(function(){return o("5f3rE")})),javascript:Uy("javascript",(function(){return o("7JDFI")})),javastacktrace:Uy("javastacktrace",(function(){return o("gdCGE")})),jexl:Uy("jexl",(function(){return o("cqMb9")})),jolie:Uy("jolie",(function(){return o("cEDX4")})),jq:Uy("jq",(function(){return o("kEWsh")})),jsExtras:Uy("jsExtras",(function(){return o("74PI8")})),jsTemplates:Uy("jsTemplates",(function(){return o("30TPr")})),jsdoc:Uy("jsdoc",(function(){return o("9DH5c")})),json:Uy("json",(function(){return Promise.resolve(o("l1Rj1"))})),json5:Uy("json5",(function(){return o("920rv")})),jsonp:Uy("jsonp",(function(){return o("9AwS1")})),jsstacktrace:Uy("jsstacktrace",(function(){return o("bYXMr")})),jsx:Uy("jsx",(function(){return Promise.resolve(o("6ho3O"))})),julia:Uy("julia",(function(){return o("g0ibH")})),keepalived:Uy("keepalived",(function(){return o("2hdnH")})),keyman:Uy("keyman",(function(){return o("cIufI")})),kotlin:Uy("kotlin",(function(){return o("c26dU")})),kumir:Uy("kumir",(function(){return o("iYAha")})),kusto:Uy("kusto",(function(){return o("9z1oX")})),latex:Uy("latex",(function(){return o("lCPLU")})),latte:Uy("latte",(function(){return o("c9oN0")})),less:Uy("less",(function(){return o("hA3V9")})),lilypond:Uy("lilypond",(function(){return o("hpHTA")})),liquid:Uy("liquid",(function(){return o("kpZTm")})),lisp:Uy("lisp",(function(){return o("chgK5")})),livescript:Uy("livescript",(function(){return o("2gdiv")})),llvm:Uy("llvm",(function(){return o("jUeFO")})),log:Uy("log",(function(){return o("3BFSQ")})),lolcode:Uy("lolcode",(function(){return o("lG9br")})),lua:Uy("lua",(function(){return o("cVGpd")})),magma:Uy("magma",(function(){return o("4LVzY")})),makefile:Uy("makefile",(function(){return o("2NviD")})),markdown:Uy("markdown",(function(){return o("jUFCF")})),markupTemplating:Uy("markupTemplating",(function(){return Promise.resolve(o("t3W0d"))})),markup:Uy("markup",(function(){return o("5hIXu")})),matlab:Uy("matlab",(function(){return o("kPAC0")})),maxscript:Uy("maxscript",(function(){return o("gHOJy")})),mel:Uy("mel",(function(){return o("9mj6e")})),mermaid:Uy("mermaid",(function(){return o("kozw5")})),mizar:Uy("mizar",(function(){return o("2bN6W")})),mongodb:Uy("mongodb",(function(){return o("eHKWX")})),monkey:Uy("monkey",(function(){return o("7Fh0C")})),moonscript:Uy("moonscript",(function(){return o("hDXwC")})),n1ql:Uy("n1ql",(function(){return o("j9bkC")})),n4js:Uy("n4js",(function(){return o("eTmBF")})),nand2tetrisHdl:Uy("nand2tetrisHdl",(function(){return o("ezjCf")})),naniscript:Uy("naniscript",(function(){return o("VxHk1")})),nasm:Uy("nasm",(function(){return o("ly95T")})),neon:Uy("neon",(function(){return o("7Fk34")})),nevod:Uy("nevod",(function(){return o("3U8Qv")})),nginx:Uy("nginx",(function(){return o("c6qVk")})),nim:Uy("nim",(function(){return o("1JdCk")})),nix:Uy("nix",(function(){return o("jcstS")})),nsis:Uy("nsis",(function(){return o("kEJqW")})),objectivec:Uy("objectivec",(function(){return o("lUP8A")})),ocaml:Uy("ocaml",(function(){return o("lhTAD")})),opencl:Uy("opencl",(function(){return o("8rxKO")})),openqasm:Uy("openqasm",(function(){return o("ib0uL")})),oz:Uy("oz",(function(){return o("csCUS")})),parigp:Uy("parigp",(function(){return o("2DkHE")})),parser:Uy("parser",(function(){return o("2cp75")})),pascal:Uy("pascal",(function(){return o("fViVl")})),pascaligo:Uy("pascaligo",(function(){return o("9Uuxa")})),pcaxis:Uy("pcaxis",(function(){return o("jUdnN")})),peoplecode:Uy("peoplecode",(function(){return o("l8w4e")})),perl:Uy("perl",(function(){return o("aX7dM")})),phpExtras:Uy("phpExtras",(function(){return o("3cMZl")})),php:Uy("php",(function(){return Promise.resolve(o("5li5P"))})),phpdoc:Uy("phpdoc",(function(){return o("bDyJN")})),plsql:Uy("plsql",(function(){return o("cPuMN")})),powerquery:Uy("powerquery",(function(){return o("jE1gU")})),powershell:Uy("powershell",(function(){return o("k7t0j")})),processing:Uy("processing",(function(){return o("jr8hV")})),prolog:Uy("prolog",(function(){return o("hpuat")})),promql:Uy("promql",(function(){return o("ckXC5")})),properties:Uy("properties",(function(){return o("fAh6P")})),protobuf:Uy("protobuf",(function(){return o("R6WqB")})),psl:Uy("psl",(function(){return o("Al65w")})),pug:Uy("pug",(function(){return o("dxbNS")})),puppet:Uy("puppet",(function(){return o("lrSuh")})),pure:Uy("pure",(function(){return o("6DKQK")})),purebasic:Uy("purebasic",(function(){return o("7ZkSb")})),purescript:Uy("purescript",(function(){return o("dBTYx")})),python:Uy("python",(function(){return Promise.resolve(o("kiy5M"))})),q:Uy("q",(function(){return o("4FXyy")})),qml:Uy("qml",(function(){return o("2zZFj")})),qore:Uy("qore",(function(){return o("iCK1Y")})),qsharp:Uy("qsharp",(function(){return o("dvH9H")})),r:Uy("r",(function(){return o("lQqRt")})),racket:Uy("racket",(function(){return o("eHKmq")})),reason:Uy("reason",(function(){return o("kkeLT")})),regex:Uy("regex",(function(){return o("llX50")})),rego:Uy("rego",(function(){return o("9hKdZ")})),renpy:Uy("renpy",(function(){return o("cJgw5")})),rest:Uy("rest",(function(){return o("867DK")})),rip:Uy("rip",(function(){return o("3Odjx")})),roboconf:Uy("roboconf",(function(){return o("gQ0Us")})),robotframework:Uy("robotframework",(function(){return o("bLCgx")})),ruby:Uy("ruby",(function(){return Promise.resolve(o("ch1PX"))})),rust:Uy("rust",(function(){return o("cInT8")})),sas:Uy("sas",(function(){return o("iz7eP")})),sass:Uy("sass",(function(){return o("hrDC3")})),scala:Uy("scala",(function(){return o("ub8Bf")})),scheme:Uy("scheme",(function(){return o("7NAAt")})),scss:Uy("scss",(function(){return Promise.resolve(o("fU6a0"))})),shellSession:Uy("shellSession",(function(){return o("7kKCv")})),smali:Uy("smali",(function(){return o("2lkCb")})),smalltalk:Uy("smalltalk",(function(){return o("4280y")})),smarty:Uy("smarty",(function(){return o("4hXYK")})),sml:Uy("sml",(function(){return o("jh2E8")})),solidity:Uy("solidity",(function(){return o("dTdF2")})),solutionFile:Uy("solutionFile",(function(){return o("iI5tm")})),soy:Uy("soy",(function(){return o("aoU5C")})),sparql:Uy("sparql",(function(){return o("ggrvb")})),splunkSpl:Uy("splunkSpl",(function(){return o("8LhCX")})),sqf:Uy("sqf",(function(){return o("3tDsu")})),sql:Uy("sql",(function(){return Promise.resolve(o("bnDV9"))})),squirrel:Uy("squirrel",(function(){return o("bxaUV")})),stan:Uy("stan",(function(){return o("dBqrq")})),stylus:Uy("stylus",(function(){return o("JlHVK")})),swift:Uy("swift",(function(){return o("c7NBs")})),systemd:Uy("systemd",(function(){return o("jprZl")})),t4Cs:Uy("t4Cs",(function(){return o("edsMI")})),t4Templating:Uy("t4Templating",(function(){return o("bS9Wa")})),t4Vb:Uy("t4Vb",(function(){return o("gYk20")})),tap:Uy("tap",(function(){return o("byv7d")})),tcl:Uy("tcl",(function(){return o("lUAIZ")})),textile:Uy("textile",(function(){return o("7J2LO")})),toml:Uy("toml",(function(){return o("eXtdM")})),tremor:Uy("tremor",(function(){return o("vyajH")})),tsx:Uy("tsx",(function(){return Promise.resolve(o("7cTnl"))})),tt2:Uy("tt2",(function(){return o("8XOOm")})),turtle:Uy("turtle",(function(){return o("1XvLQ")})),twig:Uy("twig",(function(){return o("i9Fpp")})),typescript:Uy("typescript",(function(){return Promise.resolve(o("fzL8k"))})),typoscript:Uy("typoscript",(function(){return o("kKk69")})),unrealscript:Uy("unrealscript",(function(){return o("jgq8Y")})),uorazor:Uy("uorazor",(function(){return o("dsZ00")})),uri:Uy("uri",(function(){return o("fqJRp")})),v:Uy("v",(function(){return o("bgfyB")})),vala:Uy("vala",(function(){return o("68x4q")})),vbnet:Uy("vbnet",(function(){return o("eUhQs")})),velocity:Uy("velocity",(function(){return o("fPNdV")})),verilog:Uy("verilog",(function(){return o("2fM1V")})),vhdl:Uy("vhdl",(function(){return o("hNF6q")})),vim:Uy("vim",(function(){return o("75TCr")})),visualBasic:Uy("visualBasic",(function(){return o("fc93z")})),warpscript:Uy("warpscript",(function(){return o("jgHlG")})),wasm:Uy("wasm",(function(){return o("dVZkI")})),webIdl:Uy("webIdl",(function(){return o("9Jnxv")})),wiki:Uy("wiki",(function(){return o("1Gimo")})),wolfram:Uy("wolfram",(function(){return o("4SyRT")})),wren:Uy("wren",(function(){return o("gaIVs")})),xeora:Uy("xeora",(function(){return o("lagad")})),xmlDoc:Uy("xmlDoc",(function(){return o("9DNYE")})),xojo:Uy("xojo",(function(){return o("ksF4f")})),xquery:Uy("xquery",(function(){return o("gXxHJ")})),yaml:Uy("yaml",(function(){return o("6rk3j")})),yang:Uy("yang",(function(){return o("kTyrQ")})),zig:Uy("zig",(function(){return o("d3mFC")}))},Hy=(Ny=(Oy={loader:function(){return o("bB2YF").then((function(e){return e.default||e}))},isLanguageRegistered:function(e,t){return e.registered(t)},languageLoaders:jy,registerLanguage:function(e,t,n){return e.register(n)}}).loader,Ly=Oy.isLanguageRegistered,Dy=Oy.registerLanguage,By=Oy.languageLoaders,zy=Oy.noAsyncLoadingLanguages,Fy=function(e){t(Jv)(i,e);var n,r=ky(i);function i(){return t($)(this,i),r.apply(this,arguments)}return t(ee)(i,[{key:"componentDidUpdate",value:function(){!i.isRegistered(this.props.language)&&By&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var e=this;i.astGeneratorPromise||i.loadAstGenerator(),i.astGenerator||i.astGeneratorPromise.then((function(){e.forceUpdate()})),!i.isRegistered(this.props.language)&&By&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var e=this,t=this.props.language;"text"!==t&&i.loadLanguage(t).then((function(){return e.forceUpdate()})).catch((function(){}))}},{key:"normalizeLanguage",value:function(e){return i.isSupportedLanguage(e)?e:"text"}},{key:"render",value:function(){return t(c).createElement(i.highlightInstance,t(qv)({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:i.astGenerator}))}}],[{key:"preload",value:function(){return i.loadAstGenerator()}},{key:"loadLanguage",value:(n=t(Vv)(t(ny).mark((function e(n){var r;return t(ny).wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(r=By[n])){e.next=5;break}return e.abrupt("return",r(i.registerLanguage));case 5:throw new Error("Language ".concat(n," not supported"));case 6:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"isSupportedLanguage",value:function(e){return i.isRegistered(e)||"function"==typeof By[e]}},{key:"loadAstGenerator",value:function(){return i.astGeneratorPromise=Ny().then((function(e){i.astGenerator=e,Dy&&i.languages.forEach((function(t,n){return Dy(e,n,t)}))})),i.astGeneratorPromise}}]),i}(t(c).PureComponent),t(Z)(Fy,"astGenerator",null),t(Z)(Fy,"highlightInstance",Py(null,{})),t(Z)(Fy,"astGeneratorPromise",null),t(Z)(Fy,"languages",new Map),t(Z)(Fy,"supportedLanguages",Oy.supportedLanguages||Object.keys(By||{})),t(Z)(Fy,"isRegistered",(function(e){if(zy)return!0;if(!Dy)throw new Error("Current syntax highlighter doesn't support registration of languages");return Fy.astGenerator?Ly(Fy.astGenerator,e):Fy.languages.has(e)})),t(Z)(Fy,"registerLanguage",(function(e,t){if(!Dy)throw new Error("Current syntax highlighter doesn't support registration of languages");if(Fy.astGenerator)return Dy(Fy.astGenerator,e,t);Fy.languages.set(e,t)})),Fy),Gy={},Vy={};(Vy=function(e){return e&&e.__esModule?e:{default:e}}).__esModule=!0,Vy.default=Vy,Object.defineProperty(Gy,"__esModule",{value:!0}),Object.defineProperty(Gy,"a11yDark",{enumerable:!0,get:function(){return $y.default}}),Object.defineProperty(Gy,"atomDark",{enumerable:!0,get:function(){return eb.default}}),Object.defineProperty(Gy,"base16AteliersulphurpoolLight",{enumerable:!0,get:function(){return tb.default}}),Object.defineProperty(Gy,"cb",{enumerable:!0,get:function(){return nb.default}}),Object.defineProperty(Gy,"coldarkCold",{enumerable:!0,get:function(){return rb.default}}),Object.defineProperty(Gy,"coldarkDark",{enumerable:!0,get:function(){return ib.default}}),Object.defineProperty(Gy,"coy",{enumerable:!0,get:function(){return Wy.default}}),Object.defineProperty(Gy,"coyWithoutShadows",{enumerable:!0,get:function(){return ob.default}}),Object.defineProperty(Gy,"darcula",{enumerable:!0,get:function(){return sb.default}}),Object.defineProperty(Gy,"dark",{enumerable:!0,get:function(){return qy.default}}),Object.defineProperty(Gy,"dracula",{enumerable:!0,get:function(){return ab.default}}),Object.defineProperty(Gy,"duotoneDark",{enumerable:!0,get:function(){return lb.default}}),Object.defineProperty(Gy,"duotoneEarth",{enumerable:!0,get:function(){return cb.default}}),Object.defineProperty(Gy,"duotoneForest",{enumerable:!0,get:function(){return ub.default}}),Object.defineProperty(Gy,"duotoneLight",{enumerable:!0,get:function(){return db.default}}),Object.defineProperty(Gy,"duotoneSea",{enumerable:!0,get:function(){return hb.default}}),Object.defineProperty(Gy,"duotoneSpace",{enumerable:!0,get:function(){return pb.default}}),Object.defineProperty(Gy,"funky",{enumerable:!0,get:function(){return Ky.default}}),Object.defineProperty(Gy,"ghcolors",{enumerable:!0,get:function(){return fb.default}}),Object.defineProperty(Gy,"gruvboxDark",{enumerable:!0,get:function(){return mb.default}}),Object.defineProperty(Gy,"gruvboxLight",{enumerable:!0,get:function(){return gb.default}}),Object.defineProperty(Gy,"holiTheme",{enumerable:!0,get:function(){return vb.default}}),Object.defineProperty(Gy,"hopscotch",{enumerable:!0,get:function(){return yb.default}}),Object.defineProperty(Gy,"lucario",{enumerable:!0,get:function(){return bb.default}}),Object.defineProperty(Gy,"materialDark",{enumerable:!0,get:function(){return Sb.default}}),Object.defineProperty(Gy,"materialLight",{enumerable:!0,get:function(){return xb.default}}),Object.defineProperty(Gy,"materialOceanic",{enumerable:!0,get:function(){return _b.default}}),Object.defineProperty(Gy,"nightOwl",{enumerable:!0,get:function(){return wb.default}}),Object.defineProperty(Gy,"nord",{enumerable:!0,get:function(){return Cb.default}}),Object.defineProperty(Gy,"okaidia",{enumerable:!0,get:function(){return Jy.default}}),Object.defineProperty(Gy,"oneDark",{enumerable:!0,get:function(){return Ab.default}}),Object.defineProperty(Gy,"oneLight",{enumerable:!0,get:function(){return Eb.default}}),Object.defineProperty(Gy,"pojoaque",{enumerable:!0,get:function(){return Tb.default}}),Object.defineProperty(Gy,"prism",{enumerable:!0,get:function(){return Xy.default}}),Object.defineProperty(Gy,"shadesOfPurple",{enumerable:!0,get:function(){return Mb.default}}),Object.defineProperty(Gy,"solarizedDarkAtom",{enumerable:!0,get:function(){return Ib.default}}),Object.defineProperty(Gy,"solarizedlight",{enumerable:!0,get:function(){return Qy.default}}),Object.defineProperty(Gy,"synthwave84",{enumerable:!0,get:function(){return Rb.default}}),Object.defineProperty(Gy,"tomorrow",{enumerable:!0,get:function(){return Yy.default}}),Object.defineProperty(Gy,"twilight",{enumerable:!0,get:function(){return Zy.default}}),Object.defineProperty(Gy,"vs",{enumerable:!0,get:function(){return Pb.default}}),Object.defineProperty(Gy,"vscDarkPlus",{enumerable:!0,get:function(){return kb.default}}),Object.defineProperty(Gy,"xonokai",{enumerable:!0,get:function(){return Ob.default}}),Object.defineProperty(Gy,"zTouch",{enumerable:!0,get:function(){return Nb.default}});var Wy=Vy(o("jcF8U")),qy=Vy(o("3Tppx")),Ky=Vy(o("dBuK7")),Jy=Vy(o("eEjWK")),Qy=Vy(o("awG2g")),Yy=Vy(o("2oFzQ")),Zy=Vy(o("4Au6Q")),Xy=Vy(o("dAPqs")),$y=Vy(o("8eAql")),eb=Vy(o("cv2QE")),tb=Vy(o("h5I9g")),nb=Vy(o("i4C5w")),rb=Vy(o("3kFKo")),ib=Vy(o("17zK0")),ob=Vy(o("5Avqr")),sb=Vy(o("1jHMv")),ab=Vy(o("7Q8CE")),lb=Vy(o("jKUos")),cb=Vy(o("Uzm4J")),ub=Vy(o("7yfkN")),db=Vy(o("lT2l1")),hb=Vy(o("fZ9um")),pb=Vy(o("1MoQL")),fb=Vy(o("4uys7")),mb=Vy(o("kaYsk")),gb=Vy(o("kN6Vu")),vb=Vy(o("2Z6pG")),yb=Vy(o("4jQJK")),bb=Vy(o("bpXw0")),Sb=Vy(o("i4S8s")),xb=Vy(o("5bNr4")),_b=Vy(o("5ZYWT")),wb=Vy(o("ihJCU")),Cb=Vy(o("8iIbg")),Ab=Vy(o("424u7")),Eb=Vy(o("jPiNI")),Tb=Vy(o("OHVOA")),Mb=Vy(o("2OKTL")),Ib=Vy(o("2Mg8H")),Rb=Vy(o("9Kud0")),Pb=Vy(o("eCrmR")),kb=Vy(o("8UhcQ")),Ob=Vy(o("dtU9z")),Nb=Vy(o("4xtLO")),Lb={};Object.defineProperty(Lb,"__esModule",{value:!0}),Lb.default=void 0;var Db=Vy(o("7cTnl")).default;Lb.default=Db;var Bb={};Object.defineProperty(Bb,"__esModule",{value:!0}),Bb.default=void 0;var zb=Vy(o("l1Rj1")).default;Bb.default=zb;var Fb={};Object.defineProperty(Fb,"__esModule",{value:!0}),Fb.default=void 0;var Ub=Vy(o("fU6a0")).default;Fb.default=Ub;var jb={};Object.defineProperty(jb,"__esModule",{value:!0}),jb.default=void 0;var Hb=Vy(o("3aDLI")).default;jb.default=Hb;var Gb={};Object.defineProperty(Gb,"__esModule",{value:!0}),Gb.default=void 0;var Vb=Vy(o("kiy5M")).default;Gb.default=Vb;var Wb={};Object.defineProperty(Wb,"__esModule",{value:!0}),Wb.default=void 0;var qb=Vy(o("lR39A")).default;Wb.default=qb;var Kb={};Object.defineProperty(Kb,"__esModule",{value:!0}),Kb.default=void 0;var Jb=Vy(o("5li5P")).default;Kb.default=Jb;var Qb={};Object.defineProperty(Qb,"__esModule",{value:!0}),Qb.default=void 0;var Yb=Vy(o("ch1PX")).default;Qb.default=Yb;var Zb={};Object.defineProperty(Zb,"__esModule",{value:!0}),Zb.default=void 0;var Xb=Vy(o("bnDV9")).default;Zb.default=Xb,Hy.registerLanguage("tsx",t(Lb)),Hy.registerLanguage("json",t(Bb)),Hy.registerLanguage("scss",t(Fb)),Hy.registerLanguage("bash",t(jb)),Hy.registerLanguage("python",t(Gb)),Hy.registerLanguage("cpp",t(Wb)),Hy.registerLanguage("php",t(Kb)),Hy.registerLanguage("ruby",t(Qb)),Hy.registerLanguage("sql",t(Zb));var $b=({medium:e,className:t,preview:n=!1,showLineNumbers:r=!0,showCopyButton:i=!0})=>{var o,a,l,c;const{t:u}=Se();return(0,s.jsxs)("div",{className:"memori-snippet",children:[(0,s.jsxs)("div",{className:"memori-snippet--content",children:[(0,s.jsx)(Hy,{"aria-labelledby":`#snippet-${e.mediumID}`,className:t,style:Gy.atomDark,showLineNumbers:r,language:null!==(a=null===(o=Hv.find((t=>e.mimeType===t.mimeType)))||void 0===o?void 0:o.lang)&&void 0!==a?a:"text",children:(null===(l=e.content)||void 0===l?void 0:l.length)&&e.content.length>200&&n?`${e.content.slice(0,200)}\n...`:`${e.content}`}),i&&(0,s.jsx)(Sf,{padded:!1,ghost:!0,className:"memori-snippet--copy-button",title:u("copy")||"Copy",icon:(0,s.jsx)(Fv,{}),onClick:()=>{var t;return navigator.clipboard.writeText(null!==(t=e.content)&&void 0!==t?t:"")}})]}),!!(null===(c=e.title)||void 0===c?void 0:c.length)&&(0,s.jsx)("p",{id:`snippet-${e.mediumID}`,className:"memori-snippet--caption",children:e.title})]})};c=o("85Hg2"),c=o("85Hg2");var eS,tS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})}),nS={};eS=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=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};function n(e,n){var r=e.el,i=e.elStyle,o=e.elHeight,s=e.rowsLimit,a=e.rowsWrapped,l=e.options,c=e.buffer,u=c;if(a===s+1)return t({},e);var d=c,h=a,p=o;return r.innerHTML=u=c.length?""+c+l.delimiter+n+l.replaceStr:""+n+l.replaceStr,parseFloat(i.height)>parseFloat(o)&&(h++,p=i.height,h===s+1)?(r.innerHTML=u="."===d[d.length-1]&&"..."===l.replaceStr?d+"..":""+d+l.replaceStr,t({},e,{elHeight:p,rowsWrapped:h})):(r.innerHTML=u=d.length?""+d+l.delimiter+n:""+n,t({},e,{buffer:u,elHeight:p,rowsWrapped:h}))}e.disableResponsive=function(e){window.removeEventListener("resize",e)},e.ellipsis=function e(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s={replaceStr:"...",responsive:!1,debounceDelay:250,delimiter:" "},a=t({},s,o),l=r&&(r instanceof NodeList?r:1===r.nodeType?[r]:document.querySelectorAll(r)),c=[],u=0;u<l.length;u++){var d=l[u];c[u]=d.innerHTML;var h=d.innerHTML.split(a.delimiter);d.innerHTML="";var p=window.getComputedStyle(d);h.reduce(n,{el:d,buffer:d.innerHTML,elStyle:p,elHeight:0,rowsLimit:i,rowsWrapped:0,options:a})}if(a.responsive){var f=!1,m=window.innerWidth,g=function(){if(window.innerWidth!==m){m=window.innerWidth;for(var n=0;n<l.length;n++)l[n].innerHTML=c[n];e(r,i,t({},o,{responsive:!1}))}},v=function(){clearTimeout(f),f=setTimeout(g,a.debounceDelay)};return window.addEventListener("resize",v),v}}},"function"==typeof define&&define.amd?define(["exports"],eS):eS(nS);var rS=({loading:e=!1,className:n,title:r,description:i,cover:o,hoverable:a=!1,children:l})=>(0,s.jsx)("div",{className:t(xs)("memori-card",n,{"memori-card--loading":e,"memori-card--with-cover":o,"memori-card--hoverable":a}),children:(0,s.jsxs)(bf,{spinning:e,children:[o&&(0,s.jsx)("div",{className:"memori-card--cover",children:o}),(0,s.jsxs)("div",{className:"memori-card--content",children:[r&&(0,s.jsx)("h3",{className:"memori-card--title",children:r}),i&&(0,s.jsx)("p",{className:"memori-card--description",children:i}),(0,s.jsx)("div",{className:"memori-card--children",children:l})]})]})});const iS=({isChild:e=!1,item:n,baseUrl:r,onLinkPreviewInfo:i,descriptionOneLine:o=!1})=>{var a,l,u,d;const[h,p]=(0,c.useState)(null),f=(null===(a=n.url)||void 0===a?void 0:a.startsWith("http"))||!n.url||0===(null===(l=n.url)||void 0===l?void 0:l.length)?n.url:`https://${n.url}`;(0,c.useEffect)((()=>{var e,t;let o=(null===(e=n.url)||void 0===e?void 0:e.startsWith("http"))||!n.url||0===(null===(t=n.url)||void 0===t?void 0:t.length)?n.url:`https://${n.url}`;o&&o!==(null==h?void 0:h.urlKey)&&(async(e,t)=>{try{const n=await fetch(`${t||"https://aisuru.com"}/api/linkpreview/${encodeURIComponent(e)}`);return await n.json()}catch(e){return console.error("getSiteInfo",e),null}})(o,r).then((e=>{p(e?{...e,urlKey:o}:null),i&&e&&i(e)}))}),[null==n?void 0:n.url,r,i]);const m=n.title&&n.title.length>0?n.title:null==h?void 0:h.title,g=null==h?void 0:h.description,v=null==h?void 0:h.video,y=null!==(u=null==h?void 0:h.image)&&void 0!==u?u:null===(d=null==h?void 0:h.images)||void 0===d?void 0:d[0];return(0,c.useEffect)((()=>{setTimeout((()=>{(0,nS.ellipsis)(".memori-link-item--card .memori-card--description",3,{responsive:!0})}),300)}),[g,n.mediumID]),(0,s.jsx)("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:t(xs)("memori-link-item--link",{"memori-link-item--link--child":e}),onClick:t=>{e||(t.preventDefault(),t.stopPropagation(),window.open(f,"_blank",`toolbar=yes,top=${.1*window.innerHeight},left=${.1*window.innerWidth},width=${.8*window.innerWidth},height=${.8*window.innerHeight}`))},children:(0,s.jsx)(rS,{hoverable:!0,className:t(xs)("memori-link-item--card",{"memori-link-item--card-description-oneline":o,"memori-link-item--card-has-image":y,"memori-link-item--card-has-video":v}),cover:v?(0,s.jsx)("iframe",{width:"100%",height:"100%",src:v,title:"Video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):y?(0,s.jsx)("img",{className:"memori-link-item--card-cover-img",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==",srcSet:y.includes("data:image")?void 0:y,alt:n.title}):(0,s.jsx)("div",{className:"memori-link-item--card-cover-icon",children:(0,s.jsx)(tS,{className:"memori-link-item--icon"})}),title:m,description:g})})};var oS=({items:e,baseUrl:t,descriptionOneLine:n=!1,onLinkPreviewInfo:r})=>(0,s.jsx)(tp,{appear:!0,show:!0,as:"div",className:"memori-link-items",children:(0,s.jsx)("div",{className:"memori-link-items--grid",children:e.map(((e,i)=>(0,s.jsx)(tp.Child,{as:"div",className:"memori-link-item",enter:"ease-out duration-500 delay-"+100*i,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsx)(iS,{item:e,baseUrl:t,descriptionOneLine:n,onLinkPreviewInfo:r})},e.mediumID)))})});c=o("85Hg2");const sS=["va bene","no grazie","si","no","sì","arrivederci","non c'entrava","non mi è piaciuto"],aS=async(e,t,n,r)=>{var i;const o=sS.indexOf(e.toLowerCase())>-1?"IT":null==n?void 0:n.toUpperCase(),s=await fetch(`${r||"https://aisuru.com"}/api/translate?text=${encodeURIComponent(e)}&target_lang=${t.toUpperCase()}${o?`&source_lang=${o}`:""}`,{method:"GET",headers:{Accept:"*/*"}}),a=await s.json();return null===(i=null==a?void 0:a.translations)||void 0===i?void 0:i[0]};c=o("85Hg2");var lS=({src:e,poster:t,alt:n=""})=>((0,c.useEffect)((()=>{const e=document.createElement("script");return e.src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js",e.type="module",document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]),(0,s.jsx)("div",{className:"model-viewer",children:(0,s.jsx)("model-viewer",{src:e,"ios-src":"",poster:t,alt:n,"shadow-intensity":"1","disable-zoom":!0,"camera-controls":!0,autoplay:!0})}));var cS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});var uS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7-3.8-21.3-19.5-29.6-32.9-30.2-15.8-.7-29.9 8.3-33.4 21.4-6.6 24-.7 56.8 10.1 98.6-13.6 32.4-35.3 79.5-51.2 107.5-29.6 15.3-69.3 38.9-75.2 68.7-1.2 5.5.2 12.5 3.5 18.8 3.7 7 9.6 12.4 16.5 15 3 1.1 6.6 2 10.8 2 17.6 0 46.1-14.2 84.1-79.4 5.8-1.9 11.8-3.9 17.6-5.9 27.2-9.2 55.4-18.8 80.9-23.1 28.2 15.1 60.3 24.8 82.1 24.8 21.6 0 30.1-12.8 33.3-20.5 5.6-13.5 2.9-30.5-6.2-39.6-13.2-13-45.3-16.4-95.3-10.2-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7 6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4-4.9-19.9-5.6-48.1-2.7-51.4.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2-21.6 4.9-41.3 13-58.9 20.2-4.2 1.7-8.3 3.4-12.3 5 13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6 40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});var dS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0 0 10.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 0 0-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"})});var hS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 0 0-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 0 0-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"})});const pS=({isChild:e=!1,item:t,sessionID:n,tenantID:r,preview:i=!1,baseURL:o,apiURL:a,onClick:l,customMediaRenderer:c})=>{var u,d;const h=lv({resourceURI:t.url,sessionID:n,tenantID:r,baseURL:o,apiURL:a}),p=null==c?void 0:c(t.mimeType);if(p)return p;const f=(null===(u=t.url)||void 0===u?void 0:u.startsWith("rgb("))||(null===(d=t.url)||void 0===d?void 0:d.startsWith("rgba("));switch(t.mimeType){case"image/jpeg":case"image/png":case"image/jpg":case"image/gif":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,onClick:n=>{e&&n.preventDefault(),l&&(n.preventDefault(),l(t.mediumID))},target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rS,{hoverable:!0,className:"memori-media-item--card memori-media-item--image",cover:(0,s.jsxs)("picture",{className:"memori-media-item--figure",children:[!i&&!f&&(0,s.jsx)("source",{srcSet:[h,t.url,t.content].join(", "),type:t.mimeType}),f?(0,s.jsx)("div",{style:{minHeight:"150px",width:"100%",backgroundColor:t.url}}):(0,s.jsx)("img",{alt:t.title,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}),t.title&&(0,s.jsx)("figcaption",{className:"memori-media-item--figure-caption",children:t.title})]})})});case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rS,{hoverable:!0,cover:(0,s.jsx)(hS,{className:"memori-media-item--icon"}),title:t.title})});case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rS,{hoverable:!0,cover:(0,s.jsx)(dS,{className:"memori-media-item--icon"}),title:t.title})});case"application/pdf":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rS,{hoverable:!0,cover:(0,s.jsx)(uS,{className:"memori-media-item--icon"}),title:t.title})});case"video/mp4":case"video/avi":case"video/mpeg":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,onClick:n=>{e&&n.preventDefault(),l&&(n.preventDefault(),l(t.mediumID))},target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rS,{hoverable:!0,cover:(0,s.jsx)("video",{style:{width:"100%",height:"100%"},controls:!0,src:h,title:t.title}),title:t.title})});case"audio/mpeg3":case"audio/wav":case"audio/mpeg":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rS,{hoverable:!0,cover:(0,s.jsx)("audio",{style:{width:"100%",height:"100%"},controls:!0,src:h}),title:t.title})});case"model/gltf-binary":return(0,s.jsx)(lS,{src:h,alt:"",poster:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="});default:return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rS,{hoverable:!0,cover:(0,s.jsx)(cS,{className:"memori-media-item--icon"}),title:t.title})})}};var fS=(0,c.memo)((({items:e,sessionID:t,tenantID:n,translateTo:r,baseURL:i,apiURL:o,customMediaRenderer:a})=>{const[l,u]=(0,c.useState)(e),[d,h]=(0,c.useState)(),p=(0,c.useCallback)((async()=>{if(!r)return;const t=await Promise.all((null!=e?e:[]).map((async e=>{var t;if(!e.title)return e;try{const n=await aS(e.title,r);return{...e,title:null!==(t=n.text)&&void 0!==t?t:e.title}}catch(t){return console.error(t),e}})));u(t)}),[r,e]);return(0,c.useEffect)((()=>{r&&p()}),[r,p]),(0,s.jsxs)(tp,{appear:!0,show:!0,as:"div",className:"memori-media-items",children:[(0,s.jsx)("div",{className:"memori-media-items--grid",children:l.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&!Hv.map((e=>e.mimeType)).includes(e.mimeType)})).sort(((e,t)=>e.creationTimestamp>t.creationTimestamp?1:e.creationTimestamp<t.creationTimestamp?-1:0)).map(((e,r)=>(0,s.jsx)(tp.Child,{as:"div",className:"memori-media-item",enter:"ease-out duration-500 delay-"+100*r,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsx)(pS,{isChild:!0,sessionID:t,tenantID:n,baseURL:i,apiURL:o,onClick:e=>{h(l.find((t=>t.mediumID===e)))},item:{...e,title:e.title,url:e.url,content:e.content},customMediaRenderer:a})},e.url+"&index="+r)))}),l.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&Hv.map((e=>e.mimeType)).includes(e.mimeType)})).map((e=>(0,s.jsx)(tp.Child,{as:"div",className:"memori-media-item--snippet",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,s.jsx)($b,{medium:e},e.mediumID)},e.mediumID))),l.filter((e=>{var t;return"text/css"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)})).map((e=>(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:e.content||""}},e.mediumID))),(null==d?void 0:d.mediumID)&&(0,s.jsx)(Fm,{width:"100%",widthMd:"100%",className:"memori-media-item--modal",open:!!d,onClose:()=>h(void 0),footer:null,children:(0,s.jsx)(pS,{isChild:!0,sessionID:t,tenantID:n,baseURL:i,apiURL:o,item:{...d,title:d.title,url:d.url,content:d.content},customMediaRenderer:a})})]})}));var mS=(0,c.memo)((({hints:e=[],links:n=[],media:r=[],simulateUserPrompt:i=(()=>{}),sessionID:o,baseUrl:a,apiUrl:l,translateTo:u,customMediaRenderer:d})=>{const{t:h}=Se(),[p,f]=(0,c.useState)(!0),[m,g]=(0,c.useState)(6);return(0,c.useEffect)((()=>{f(!0)}),[e]),(0,s.jsxs)("div",{className:"memori-media-widget",children:[(null==r?void 0:r.length)>0&&(0,s.jsx)(fS,{items:r,sessionID:o,translateTo:u,baseURL:a,apiURL:l,customMediaRenderer:d}),(null==n?void 0:n.length)>0&&(0,s.jsx)(oS,{items:n,baseUrl:a}),(null==e?void 0:e.length)>0&&p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tp,{appear:!0,show:!0,as:"ul",className:"memori-media--hints",children:e.slice(0,m).map(((e,n)=>(0,s.jsx)(tp.Child,{as:"li",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,s.jsx)(Sf,{className:t(xs)("memori-media--hint"),primary:!0,onClick:()=>{i(e.originalText,e.text),f(!1)},onTouchEnd:()=>{i(e.originalText,e.text),f(!1)},children:e.text},e.text+n)},e.text+n)))}),e.length>m&&(0,s.jsx)("div",{className:"memori-hints--show-more",children:(0,s.jsx)(Sf,{className:"memori-hints--show-more-button",id:"showMoreHints",onClick:()=>g(m+6),children:h("expand")||"Expand"})})]})]})}));const gS=e=>e.endsWith("?")?e:`${e}?`;var vS=({message:e,apiURL:n,sessionID:r,visible:i=!0,initialMatches:o=[],closeDrawer:a,_TEST_loading:l=!1})=>{const{t:u}=Se(),d=Q(n).search.searchMemory,[h,p]=(0,c.useState)(o),[f,m]=(0,c.useState)(l),g=(0,c.useCallback)((async()=>{if(m(!0),!l){try{const{matches:n,...i}=await d(r,{searchType:"Semantic",numberOfResults:3,text:e.questionAnswered,date:e.date,placeName:e.placeName,placeLatitude:e.placeLatitude,placeLongitude:e.placeLongitude,placeUncertaintyKm:e.placeUncertaintyKm,contextVars:e.contextVars,tag:e.tag});0!==i.resultCode?(console.error(i),t(Ku).error(u(zv(i.resultCode)))):p(null!=n?n:[])}catch(e){console.error("WHYTHISANSWER/FETCH",e),p(null!=o?o:[])}m(!1)}}),[e,r]);return(0,c.useEffect)((()=>{g()}),[g,e,r]),(0,s.jsxs)(_f,{open:i,width:"80%",animated:!1,className:"memori-whythisanswer-drawer",onClose:()=>a(),title:u("whyThisAnswer"),children:[(0,s.jsx)("p",{children:u("whyThisAnswerHelper")}),e.questionAnswered&&(0,s.jsxs)("p",{className:"memori--whythisanswer-question-answered",children:[(0,s.jsxs)("strong",{children:[u("question")||"Question",":"]})," ",e.questionAnswered]}),(0,s.jsxs)(bf,{primary:!0,spinning:f,children:[!f&&0===h.length&&(0,s.jsx)("p",{role:"info",className:"memori--whythisanswer-no-results",children:u("nothingFound")}),f&&0===h.length&&(0,s.jsxs)("ul",{className:"memori--whythisanswer-list memori--whythisanswer-skeleton",children:[(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{className:"memori--whythisanswer-title",children:[(0,s.jsx)("span",{className:"memori--whythisanswer-confidence",children:(0,s.jsx)("span",{className:"memori--whythisanswer-skeleton-text"})}),(0,s.jsx)("div",{className:"memori--whythisanswer-title-text",children:(0,s.jsx)("p",{className:"memori--whythisanswer-skeleton-text"})})]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"})]}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-block"})]}),(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{className:"memori--whythisanswer-title",children:[(0,s.jsx)("span",{className:"memori--whythisanswer-confidence",children:(0,s.jsx)("span",{className:"memori--whythisanswer-skeleton-text"})}),(0,s.jsxs)("div",{className:"memori--whythisanswer-title-text",children:[(0,s.jsx)("p",{className:"memori--whythisanswer-skeleton-text"}),(0,s.jsx)("p",{className:"memori--whythisanswer-skeleton-text"})]})]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"})]}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-block"})]})]}),h.length>0&&(0,s.jsx)("ul",{className:"memori--whythisanswer-list",children:h.map((e=>{var t,n,r,i,o,a,l;return(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{className:"memori--whythisanswer-title",children:[(0,s.jsx)("span",{className:"memori--whythisanswer-confidence",children:e.confidenceLevel}),(0,s.jsxs)("div",{className:"memori--whythisanswer-title-text",children:[(0,s.jsx)("p",{children:(0,s.jsx)("strong",{children:gS(null!==(t=e.memory.title)&&void 0!==t?t:"")})}),(0,s.jsx)("p",{children:null===(r=null===(n=e.memory.titleVariants)||void 0===n?void 0:n.map((e=>gS(e))))||void 0===r?void 0:r.join(" | ")})]})]}),null===(i=e.memory.answers)||void 0===i?void 0:i.map(((e,t)=>(0,s.jsx)("p",{className:"memori--whythisanswer-answer",children:(0,s.jsx)(Dv,{rows:3,children:e.text})},t))),(0,s.jsx)(mS,{links:null===(o=e.memory.media)||void 0===o?void 0:o.filter((e=>"text/html"===e.mimeType))}),null===(l=null===(a=e.memory.media)||void 0===a?void 0:a.filter((e=>"text/plain"===e.mimeType)))||void 0===l?void 0:l.map((e=>(0,s.jsx)(Dv,{rows:2,lineHeightMultiplier:2,innerClassName:"memori--whythisanswer-snippet-expandable",children:(0,s.jsx)($b,{medium:e,showCopyButton:!1,showLineNumbers:!1},e.mediumID)},e.mediumID)))]},e.memory.memoryID)}))})]})]})};Ov.marked.use({async:!1,gfm:!0,pedantic:!0,renderer:{link(e,t,n){const r=tm(e);if(null===r)return n;let i='<a href="'+(e=r)+'"';return t&&(i+=' title="'+t+'"'),i+=' target="_blank" rel="noopener noreferrer">'+n+"</a>",i}}});var yS=({message:e,memori:n,tenant:r,baseUrl:i,apiUrl:o,sessionID:a,showFeedback:l,showWhyThisAnswer:u=!0,simulateUserPrompt:d,showAIicon:h=!0,isFirst:p=!1,user:f,userAvatar:m,experts:g})=>{var v,y,b,S,x,_;const{t:w}=Se(),[C,A]=(0,c.useState)(!1),E=(0,Nv.sanitize)(Ov.marked.parse(e.translatedText||e.text).trim().replace(/\n/g,"<br>"),{ADD_ATTR:["target"]});return(0,s.jsxs)(s.Fragment,{children:[(e.initial||p)&&(0,s.jsx)("div",{className:"memori-chat--bubble-initial"}),(0,s.jsxs)(tp,{show:!0,appear:!0,as:"div",className:t(xs)("memori-chat--bubble-container",{"memori-chat--bubble-from-user":!!e.fromUser,"memori-chat--with-addon":e.generatedByAI&&h||l&&d}),children:[!e.fromUser&&(0,s.jsx)(tp.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),title:(null===(v=e.emitter)||void 0===v?void 0:v.length)&&n.enableBoardOfExperts?e.emitter:n.name,children:(0,s.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:(null===(y=e.emitter)||void 0===y?void 0:y.length)&&n.enableBoardOfExperts?e.emitter:n.name,src:(null===(b=e.emitter)||void 0===b?void 0:b.length)&&n.enableBoardOfExperts&&(null==g?void 0:g.find((t=>t.name===e.emitter)))?`${o}/api/v1/memoriai/memori/avatar/${null===(S=g.find((t=>t.name===e.emitter)))||void 0===S?void 0:S.expertMemoriID}`:n.avatarURL&&n.avatarURL.length>0?lv({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:n.avatarURL,baseURL:i,apiURL:o}):lv({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i||"https://www.aisuru.com",apiURL:o}),onError:e=>{e.currentTarget.src=n.avatarURL&&n.avatarURL.length>0?lv({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:n.avatarURL,baseURL:i}):lv({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i}),e.currentTarget.onerror=null}})}),(0,s.jsxs)(tp.Child,{as:"div",className:t(xs)("memori-chat--bubble",{"memori-chat--user-bubble":!!e.fromUser,"memori-chat--with-addon":e.generatedByAI&&h||l&&d,"memori-chat--ai-generated":e.generatedByAI&&h,"memori-chat--with-feedback":l}),enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),children:[(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:E}}),(e.generatedByAI&&h||l&&d)&&(0,s.jsxs)("div",{className:"memori-chat--bubble-addon",children:[l&&!!d&&(0,s.jsx)(kv,{memori:n,className:"memori-chat--bubble-feedback",dropdown:!0,onNegativeClick:e=>{e&&d(e)}}),e.generatedByAI&&h&&(0,s.jsx)(dv,{align:"left",content:w("generatedByAI"),className:"memori-chat--bubble-action-icon memori-chat--bubble-action-icon--ai",children:(0,s.jsx)("span",{children:(0,s.jsx)(uv,{title:w("generatedByAI")||void 0})})}),!e.fromUser&&e.questionAnswered&&o&&u&&(0,s.jsx)(Sf,{ghost:!0,shape:"circle",title:w("whyThisAnswer")||void 0,className:"memori-chat--bubble-action-icon",onClick:()=>A(!0),disabled:C,icon:(0,s.jsx)(Lv,{title:w("whyThisAnswer")||void 0})})]})]}),e.fromUser&&(0,s.jsx)(s.Fragment,{children:m&&"string"==typeof m||!m&&(null===(x=null==f?void 0:f.avatarURL)||void 0===x?void 0:x.length)?(0,s.jsx)(tp.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:(0,s.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:null!==(_=null==f?void 0:f.userName)&&void 0!==_?_:"User",src:null!=m?m:null==f?void 0:f.avatarURL})}):m?(0,s.jsx)(tp.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:m}):(0,s.jsx)(tp.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:(0,s.jsx)(cv,{})})})]}),C&&o&&(0,s.jsx)(vS,{visible:C,message:e,closeDrawer:()=>A(!1),apiURL:o,sessionID:a})]})};c=o("85Hg2"),c=o("85Hg2");function bS(e=0){let[t,n]=(0,c.useState)(e),r=(0,c.useCallback)((e=>n((t=>t|e))),[t]),i=(0,c.useCallback)((e=>Boolean(t&e)),[t]),o=(0,c.useCallback)((e=>n((t=>t&~e))),[n]),s=(0,c.useCallback)((e=>n((t=>t^e))),[n]);return{addFlag:r,hasFlag:i,removeFlag:o,toggleFlag:s}}let SS=(0,(c=o("85Hg2")).createContext)(null);function xS(){let e=(0,c.useContext)(SS);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,xS),e}return e}function _S(){let[e,n]=(0,c.useState)([]);return[e.length>0?e.join(" "):void 0,(0,c.useMemo)((()=>function(e){let r=Th((e=>(n((t=>[...t,e])),()=>n((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=(0,c.useMemo)((()=>({register:r,slot:e.slot,name:e.name,props:e.props})),[r,e.slot,e.name,e.props]);return t(c).createElement(SS.Provider,{value:i},e.children)}),[n])]}let wS=fh((function(e,t){let{passive:n=!1,...r}=e,i=xS(),o=`headlessui-label-${lp()}`,s=Rh(t);_h((()=>i.register(o)),[o,i.register]);let a={ref:s,...i.props,id:o};return n&&("onClick"in a&&delete a.onClick,"onClick"in r&&delete r.onClick),dh({ourProps:a,theirProps:r,slot:i.slot||{},defaultTag:"label",name:i.name||"Label"})}));var CS,AS=((CS=AS||{})[CS.RegisterOption=0]="RegisterOption",CS[CS.UnregisterOption=1]="UnregisterOption",CS);let ES={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:wp(n,(e=>e.element.current))}},1(e,t){let n=e.options.slice(),r=e.options.findIndex((e=>e.id===t.id));return-1===r?e:(n.splice(r,1),{...e,options:n})}},TS=(0,c.createContext)(null);function MS(e){let t=(0,c.useContext)(TS);if(null===t){let t=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,MS),t}return t}function IS(e,t){return ah(t.type,ES,e,t)}TS.displayName="RadioGroupContext";let RS=fh((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,...u}=e,d=Th("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a),[h,p]=(0,c.useReducer)(IS,{options:[]}),f=h.options,[m,g]=_S(),[v,y]=Yp(),b=`headlessui-radiogroup-${lp()}`,S=(0,c.useRef)(null),x=Rh(S,n),[_,w]=hm(r,s,i),C=(0,c.useMemo)((()=>f.find((e=>!e.propsRef.current.disabled))),[f]),A=(0,c.useMemo)((()=>f.some((e=>d(e.propsRef.current.value,_)))),[f,_]),E=Th((e=>{var t;if(l||d(e,_))return!1;let n=null==(t=f.find((t=>d(t.propsRef.current.value,e))))?void 0:t.propsRef.current;return(null==n||!n.disabled)&&(null==w||w(e),!0)}));om({container:S.current,accept:e=>"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let T=Th((e=>{let t=S.current;if(!t)return;let n=dp(t),r=f.filter((e=>!1===e.propsRef.current.disabled)).map((e=>e.element.current));switch(e.key){case rp.Enter:dm(e.currentTarget);break;case rp.ArrowLeft:case rp.ArrowUp:if(e.preventDefault(),e.stopPropagation(),Ap(r,fp.Previous|fp.WrapAround)===mp.Success){let e=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&E(e.propsRef.current.value)}break;case rp.ArrowRight:case rp.ArrowDown:if(e.preventDefault(),e.stopPropagation(),Ap(r,fp.Next|fp.WrapAround)===mp.Success){let e=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&E(e.propsRef.current.value)}break;case rp.Space:{e.preventDefault(),e.stopPropagation();let t=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));t&&E(t.propsRef.current.value)}}})),M=Th((e=>(p({type:0,...e}),()=>p({type:1,id:e.id})))),I=(0,c.useMemo)((()=>({registerOption:M,firstOption:C,containsCheckedOption:A,change:E,disabled:l,value:_,compare:d})),[M,C,A,E,l,_,d]),R={ref:x,id:b,role:"radiogroup","aria-labelledby":m,"aria-describedby":v,onKeyDown:T},P=(0,c.useMemo)((()=>({value:_})),[_]);return t(c).createElement(y,{name:"RadioGroup.Description"},t(c).createElement(g,{name:"RadioGroup.Label"},t(c).createElement(TS.Provider,{value:I},null!=o&&null!=_&&lm({[o]:_}).map((([e,n])=>t(c).createElement(up,{features:cp.Hidden,...mh({key:e,as:"input",type:"radio",checked:null!=n,hidden:!0,readOnly:!0,name:e,value:n})}))),dh({ourProps:R,theirProps:u,slot:P,defaultTag:"div",name:"RadioGroup"}))))}));var PS=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(PS||{});let kS=fh((function(e,n){let r=(0,c.useRef)(null),i=Rh(r,n),o=`headlessui-radiogroup-option-${lp()}`,[s,a]=_S(),[l,u]=Yp(),{addFlag:d,removeFlag:h,hasFlag:p}=bS(1),{value:f,disabled:m=!1,...g}=e,v=(0,c.useRef)({value:f,disabled:m});_h((()=>{v.current.value=f}),[f,v]),_h((()=>{v.current.disabled=m}),[m,v]);let{registerOption:y,disabled:b,change:S,firstOption:x,containsCheckedOption:_,value:w,compare:C}=MS("RadioGroup.Option");_h((()=>y({id:o,element:r,propsRef:v})),[o,y,r,e]);let A=Th((e=>{var t;if(ip(e.currentTarget))return e.preventDefault();!S(f)||(d(2),null==(t=r.current)||t.focus())})),E=Th((e=>{if(ip(e.currentTarget))return e.preventDefault();d(2)})),T=Th((()=>h(2))),M=(null==x?void 0:x.id)===o,I=b||m,R=C(w,f),P={ref:i,id:o,role:"radio","aria-checked":R?"true":"false","aria-labelledby":s,"aria-describedby":l,"aria-disabled":!!I||void 0,tabIndex:I?-1:R||!_&&M?0:-1,onClick:I?void 0:A,onFocus:I?void 0:E,onBlur:I?void 0:T},k=(0,c.useMemo)((()=>({checked:R,disabled:I,active:p(2)})),[R,I,p]);return t(c).createElement(u,{name:"RadioGroup.Description"},t(c).createElement(a,{name:"RadioGroup.Label"},dh({ourProps:P,theirProps:g,slot:k,defaultTag:"div",name:"RadioGroup.Option"})))})),OS=Object.assign(RS,{Option:kS,Label:wS,Description:Zp});var NS=({sendOnEnter:e,setSendOnEnter:n})=>{const{t:r}=Se();return(0,s.jsxs)(Tv,{as:"div",className:"memori-send-on-enter-menu",children:[(0,s.jsx)(Tv.Button,{className:t(xs)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button"),children:(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)("span",{style:{display:"block",width:"1rem",height:"1rem"},children:"…"})})}),(0,s.jsx)(Tv.Items,{className:"memori-menu--overlay",children:(0,s.jsxs)(OS,{value:e,onChange:n,children:[(0,s.jsx)(OS.Option,{value:"keypress",className:"memori-menu--option",children:({checked:e})=>(0,s.jsx)(Tv.Item,{children:(0,s.jsx)(Sf,{className:"memori-menu--button",ghost:!0,outlined:e,icon:(0,s.jsx)("span",{className:"memori-menu--icon",children:e?"✓":""}),children:r("widget.sendOnKeypress")})})}),(0,s.jsx)(OS.Option,{value:"click",className:"memori-menu--option",children:({checked:e})=>(0,s.jsx)(Tv.Item,{children:(0,s.jsx)(Sf,{className:"memori-menu--button",ghost:!0,outlined:e,icon:(0,s.jsx)("span",{className:"memori-menu--icon",children:e?"✓":""}),children:r("widget.sendOnClick")})})})]})})]})};c=o("85Hg2");var LS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 0 0 0 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0 0 13.5-4.7L863.9 169a7.9 7.9 0 0 0-8.9-8.9zM416.6 562.3a8.03 8.03 0 0 0-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 0 0-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"})});var DS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 0 0 0 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 0 0 391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 0 0-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"})});var BS=({disabled:e=!1,value:n,onChange:r,onPressEnter:i,onFocus:o,onBlur:a})=>{const{t:l}=Se(),[u,d]=(0,c.useState)(!1);return(0,s.jsx)("div",{"data-testid":"chat-textarea",className:t(xs)("memori-chat-textarea",{"memori-chat-textarea--expanded":u,"memori-chat-textarea--disabled":e}),children:(0,s.jsxs)("div",{className:"memori-chat-textarea--inner",children:[(0,s.jsx)("textarea",{className:"memori-chat-textarea--input",disabled:e,value:n,onChange:e=>{r(e.target.value)},onKeyDownCapture:e=>{"Enter"===e.key&&!e.shiftKey&&i&&i(e)},onFocus:o,onBlur:a}),(0,s.jsx)("div",{className:"memori-chat-textarea--expand",children:(0,s.jsx)(Sf,{className:t(xs)("memori-chat-textarea--expand-button"),onClick:()=>d(!u),padded:!1,ghost:!0,title:u?l("collapse")||"Collapse":l("expand")||"Expand",icon:u?(0,s.jsx)(DS,{}):(0,s.jsx)(LS,{})})})]})})};var zS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})});c=o("85Hg2");var FS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})});var US=({listening:e,stopAudio:n,startListening:r,stopListening:i})=>{const{t:o}=Se(),[a,l]=(0,c.useState)(),u=(0,c.useRef)(null),d=e=>{e.preventDefault(),l(o("write_and_speak.holdToSpeak")||"Hold to record"),u.current||(u.current=setTimeout((()=>{n(),l(o("write_and_speak.releaseToEndListening")||"Release to end listening"),r()}),300))},h=()=>{u.current&&(clearTimeout(u.current),u.current=null),i(),l(void 0)};return(0,c.useEffect)((()=>()=>h()),[]),(0,s.jsx)(dv,{visible:!!a,content:(0,s.jsx)("span",{children:a||o("write_and_speak.pressAndHoldToSpeak")||"Press and hold to speak"}),align:"topLeft",className:"memori-mic-btn-tooltip",children:(0,s.jsx)(Sf,{primary:!0,className:t(xs)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":e}),title:e?o("write_and_speak.micButtonPopoverListening")||"Listening":o("write_and_speak.micButtonPopover")||"Start listening",onMouseDown:d,onTouchStart:d,onMouseUp:h,onMouseLeave:h,onTouchEnd:h,shape:"circle",icon:(0,s.jsx)(FS,{})})})};var jS=({dialogState:e,sendOnEnter:n="click",setSendOnEnter:r,userMessage:i="",onChangeUserMessage:o,sendMessage:a,onTextareaFocus:l,onTextareaBlur:c,onTextareaPressEnter:u,showMicrophone:d=!1,microphoneMode:h="HOLD_TO_TALK",listening:p=!1,stopAudio:f,startListening:m,stopListening:g})=>{const{t:v}=Se();return(0,s.jsxs)("fieldset",{id:"chat-fieldset",className:"memori-chat-inputs",disabled:"X2a"===(null==e?void 0:e.state)||"X3"===(null==e?void 0:e.state),children:[(0,s.jsx)(NS,{sendOnEnter:n,setSendOnEnter:r}),(0,s.jsx)(BS,{value:i,onChange:o,onPressEnter:u,onFocus:l,onBlur:c,disabled:["R2","R3","R4","R5","G3","X3"].includes((null==e?void 0:e.state)||"")}),(0,s.jsx)(Sf,{shape:"circle",primary:!!(null==i?void 0:i.length),disabled:!i||0===i.length,className:"memori-chat-inputs--send",onClick:()=>{a(i),f(),speechSynthesis.speak(new SpeechSynthesisUtterance(""))},title:v("send")||"Send",icon:(0,s.jsx)(zS,{})}),d&&"HOLD_TO_TALK"===h&&(0,s.jsx)(US,{listening:p,startListening:m,stopListening:()=>{g(),(null==i?void 0:i.length)&&a(i)},stopAudio:f}),d&&"CONTINUOUS"===h&&(0,s.jsx)(Sf,{primary:!0,className:t(xs)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":p}),title:p?v("write_and_speak.micButtonPopoverListening")||"Listening":v("write_and_speak.micButtonPopover")||"Start listening",onClick:()=>{p?g():(f(),m())},shape:"circle",icon:(0,s.jsx)(FS,{})})]})};c=o("85Hg2");const HS={en:[{delayAfter:3,text:"Generating an accurate and fancy response..."},{delayAfter:3,text:"Generating a response that will blow your mind..."},{delayAfter:3,text:"Generating a response that will make you smile..."},{delayAfter:3,text:"Thinking of a response..."},{delayAfter:3,text:"Thinking of a response that will make you smile..."},{delayAfter:3,text:"Gathering my thoughts..."},{delayAfter:3,text:"Gathering my thoughts to give you a response..."}],it:[{delayAfter:3,text:"Sto generando una risposta accurata e fantasiosa..."},{delayAfter:3,text:"Sto generando una risposta che ti farà impazzire..."},{delayAfter:3,text:"Sto generando una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto pensando ad una risposta..."},{delayAfter:3,text:"Sto pensando ad una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri per darti una risposta..."}]},GS=(e=3)=>new Array(20*e).fill(" ").join("");var VS=({useDefaultSentences:e=!1,lang:t="en",sentence:n,sentences:r})=>{var i;const[o,a]=(0,c.useState)(0),[l,u]=(0,c.useState)((null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.length)?`${r[t][0].text.endsWith("...")||!r[t][0].text.length?r[t][0].text:`${r[t][0].text}...`}${GS(r[t][0].delayAfter)}`:n?`${n.endsWith("...")||!n.length?n:`${n}...`}${GS()}`:""),[d,h]=(0,c.useState)("");return(0,c.useEffect)((()=>{const i=setInterval((()=>{var i;const s=l[d.length];if(void 0!==s&&l.length>0)h((e=>e+s));else if((null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.length)&&o<r[t].length-1){const e=o+1,n=r[t][e];u(`${n.text.endsWith("...")||!n.text.length?n.text:`${n.text}...`}${GS(n.delayAfter)}`),h(""),a(e)}else if(!r&&!n&&e){const e=HS[t][Math.floor(Math.random()*HS[t].length)];u(`${e.text}${GS(e.delayAfter)}`),h("")}}),50);return()=>clearInterval(i)})),(0,s.jsx)("div",{className:"memori-chat--bubble",children:(0,s.jsxs)("div",{className:"memori-chat--bubble-typing",children:[(0,s.jsxs)("div",{id:"wave",children:[(0,s.jsx)("span",{className:"dot"}),(0,s.jsx)("span",{className:"dot"}),(0,s.jsx)("span",{className:"dot"})]}),l.length>0&&(0,s.jsx)("p",{children:d})]})})};var WS=(0,c.memo)((({memori:e,tenant:n,sessionID:r,baseUrl:i,apiUrl:o,translateTo:a,memoriTyping:l,typingText:u,showTypingText:d=!1,history:h=[],authToken:p,dialogState:f,simulateUserPrompt:m,showDates:g=!1,showContextPerLine:v=!1,showAIicon:y=!0,selectReceiverTag:b,preview:S=!1,instruct:x=!1,showInputs:_=!0,showMicrophone:w=!1,microphoneMode:C="HOLD_TO_TALK",sendOnEnter:A,setSendOnEnter:E,attachmentsMenuOpen:T,setAttachmentsMenuOpen:M,userMessage:I="",onChangeUserMessage:R,sendMessage:P,listening:k,isPlayingAudio:O,stopAudio:N,startListening:L,stopListening:D,resetTranscript:B,customMediaRenderer:z,user:F,userAvatar:U,experts:j})=>{var H,G,V,W,q,K,J,Q;const Y=()=>{setTimeout((()=>{var e,t,n;null===(e=document.querySelector(".memori-chat--content"))||void 0===e||e.scrollTo(0,null!==(n=null===(t=document.querySelector(".memori-chat--content"))||void 0===t?void 0:t.scrollHeight)&&void 0!==n?n:0)}),200)};(0,c.useEffect)((()=>{!S&&Y()}),[h,S]);return(0,s.jsxs)("div",{className:t(xs)("memori-chat--wrapper",{"memori-chat-wrapper--translate":a}),id:"chat-wrapper",lang:null==a?void 0:a.toUpperCase(),"data-memori-lang":null!==(W=null===(V=null===(G=null===(H=e.culture)||void 0===H?void 0:H.split("-"))||void 0===G?void 0:G[0])||void 0===V?void 0:V.toUpperCase())&&void 0!==W?W:"EN",children:[(0,s.jsx)("div",{className:t(xs)("memori-chat--history",{"memori-chat--history-touch":Yf()}),children:(0,s.jsxs)("div",{className:t(xs)("memori-chat--content",{"memori-chat--content-touch":Yf()}),children:[(0,s.jsx)("div",{className:t(xs)("memori-chat--cover"),style:{backgroundImage:`url("${lv({type:"cover",tenantID:null==n?void 0:n.id,resourceURI:e.coverURL,baseURL:i,apiURL:o})}"), url("${lv({type:"cover",tenantID:null==n?void 0:n.id,baseURL:i||"https://www.aisuru.com",apiURL:o})}")`}}),h.map(((l,u)=>{var d,p,b,S;return(0,s.jsxs)(t(c).Fragment,{children:[(0,s.jsx)(yS,{isFirst:0===u,message:l,memori:e,tenant:n,baseUrl:i,apiUrl:o,sessionID:r,simulateUserPrompt:m,showAIicon:y,showFeedback:u===h.length-1&&!l.fromUser&&(null==f?void 0:f.acceptsFeedback),user:F,userAvatar:U,experts:j}),g&&!!l.timestamp&&(0,s.jsx)("small",{className:"memori-chat--timestamp "+(l.fromUser?"text-right":"text-left"),children:new Intl.DateTimeFormat("it",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(l.timestamp.endsWith("Z")?l.timestamp:`${l.timestamp}Z`))}),v&&!!Object.keys(null!==(d=l.contextVars)&&void 0!==d?d:{}).length&&(0,s.jsx)("div",{className:"memori-chat--context-vars",children:Object.keys(null!==(p=l.contextVars)&&void 0!==p?p:{}).map((e=>{var t,n,r;return"-"===(null===(t=l.contextVars)||void 0===t?void 0:t[e])?(0,s.jsx)("div",{className:"memori-chat--context-tag memori-chat--context-tag-canceled",children:(0,s.jsx)("span",{className:"memori-chat--context-tag-text",children:e})},e):"✔️"===(null===(n=l.contextVars)||void 0===n?void 0:n[e])?(0,s.jsx)("div",{className:"memori-chat--context-tag",children:(0,s.jsx)("span",{className:"memori-chat--context-tag-text",children:e})},e):(0,s.jsx)("div",{className:"memori-chat--context-tag",children:(0,s.jsxs)("span",{className:"memori-chat--context-tag-text",children:[e,": ",null===(r=l.contextVars)||void 0===r?void 0:r[e]]})},e)}))}),(0,s.jsx)(mS,{simulateUserPrompt:m,media:null===(b=null==l?void 0:l.media)||void 0===b?void 0:b.filter((e=>"text/html"!==e.mimeType&&"text/plain"!==e.mimeType)),links:null===(S=null==l?void 0:l.media)||void 0===S?void 0:S.filter((e=>"text/html"===e.mimeType)),sessionID:r,baseUrl:i,apiUrl:o,translateTo:a,customMediaRenderer:z})]},u)})),(null==f?void 0:f.hints)&&f.hints.length>0&&(0,s.jsx)(mS,{simulateUserPrompt:m,hints:f.translatedHints?f.translatedHints:f.hints.map((e=>({text:e,originalText:e})))}),!!l&&(0,s.jsx)(VS,{useDefaultSentences:d,lang:a?"it"===a.toLowerCase()?"it":"en":"it"===(null===(J=null===(K=null===(q=e.culture)||void 0===q?void 0:q.split("-"))||void 0===K?void 0:K[0])||void 0===J?void 0:J.toLowerCase())?"it":"en",sentence:u,sentences:e.enableBoardOfExperts?Gv:void 0},u),(0,s.jsx)("div",{id:"end-messages-ref"})]})}),"X3"===(null==f?void 0:f.state)&&r&&(0,s.jsx)("div",{className:"memori-chat--known-tags",children:Object.keys(null!==(Q=f.knownTags)&&void 0!==Q?Q:{}).filter((t=>t!==e.giverTag)).map((e=>{var t;return(0,s.jsx)(Sf,{icon:(0,s.jsx)("span",{className:"memori-chat--known-tag-icon",children:e}),className:"memori-chat--known-tag",onClick:()=>b(e),children:null===(t=f.knownTags)||void 0===t?void 0:t[e]},e)}))}),_&&(0,s.jsx)(jS,{userMessage:I,onChangeUserMessage:R,dialogState:f,instruct:x,authToken:p,sendMessage:P,microphoneMode:C,sendOnEnter:A,setSendOnEnter:E,attachmentsMenuOpen:T,setAttachmentsMenuOpen:M,onTextareaPressEnter:()=>{"keypress"===A&&(null==I?void 0:I.length)>0&&(D(),P(I),R(""),B())},onTextareaFocus:()=>{var e,t,n,r;D(),Yf()&&window.innerWidth<=768&&(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t||t.add("chat-focused"),null===(r=null===(n=document.querySelector(".memori.memori-widget"))||void 0===n?void 0:n.classList)||void 0===r||r.add("chat-focused"),setTimeout((()=>{Y()}),300))},onTextareaBlur:()=>{var e,t,n,r,i;(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t?void 0:t.contains("chat-focused"))&&(null===(n=document.getElementById("chat-wrapper"))||void 0===n||n.classList.remove("chat-focused"),null===(i=null===(r=document.querySelector(".memori.memori-widget"))||void 0===r?void 0:r.classList)||void 0===i||i.remove("chat-focused"),Y())},startListening:L,stopListening:D,stopAudio:N,listening:k,isPlayingAudio:O,showMicrophone:w})]})}));c=o("85Hg2");var qS=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}),(0,s.jsx)("path",{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4c-1.3-3.2-4.3-5.4-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"})]});var KS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"})});var JS=({memoriName:e,blockedUntil:t,showGiverInfo:n=!1,showTitle:r=!1,marginLeft:i=!1})=>{const{t:o}=Se(),a=new Date(t);return a>new Date?(0,s.jsx)(dv,{className:"blocked-memori-badge--tooltip",content:(0,s.jsxs)(s.Fragment,{children:[!n&&o("memoriBlockedAnon",{name:e,date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(a)}),n&&o("memoriBlockedUntil",{date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(a)}),n&&` ${o("memoriBlockedReasonExceedChats")}`,n&&(0,s.jsx)("br",{}),n&&`\n${o("memoriBlockedGiverHelper")}`]}),children:(0,s.jsxs)("div",{className:"blocked-memori-badge--wrapper",children:[(0,s.jsx)("div",{className:"blocked-memori-badge "+(i?" margin-left":""),children:(0,s.jsx)(KS,{className:"blocked-memori-badge--icon"})}),r&&(0,s.jsx)("span",{className:"blocked-memori-badge--title",children:o("memoriBlockedTitle")})]})}):null};var QS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",width:"20",height:"16",viewBox:"0 0 640 512",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M211.2 96a64 64 0 10-128 0 64 64 0 10128 0zM32 256c0 17.7 14.3 32 32 32h85.6c10.1-39.4 38.6-71.5 75.8-86.6-9.7-6-21.2-9.4-33.4-9.4H96c-35.3 0-64 28.7-64 64zm461.6 32H576c17.7 0 32-14.3 32-32 0-35.3-28.7-64-64-64h-96c-11.7 0-22.7 3.1-32.1 8.6 38.1 14.8 67.4 47.3 77.7 87.4zm-102.4-61.6c-6.9-1.6-14.2-2.4-21.6-2.4h-96c-8.5 0-16.7 1.1-24.5 3.1-30.8 8.1-55.6 31.1-66.1 60.9-3.5 10-5.5 20.8-5.5 32 0 17.7 14.3 32 32 32h224c17.7 0 32-14.3 32-32 0-11.2-1.9-22-5.5-32-10.8-30.7-36.8-54.2-68.9-61.6zM563.2 96a64 64 0 10-128 0 64 64 0 10128 0zm-241.6 96a80 80 0 100-160 80 80 0 100 160zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32h576c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"})});var YS=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",width:"20",height:"20",viewBox:"0 0 48 48",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M30.106 48v-2.745a2.213 2.213 0 012.213-2.212h6.11a2.392 2.392 0 002.326-2.466v-3.223a1.834 1.834 0 01.459-1.145 2.912 2.912 0 00.712-1.926l-.007-.667a1.016 1.016 0 01.651-.952h1.067a1.363 1.363 0 001.051-.456 1.304 1.304 0 00.19-1.395 67.032 67.032 0 01-3.037-7.51 4.767 4.767 0 01-.217-1.507l-.002-4.994a14.513 14.513 0 00-.552-3.963l-.006-.022a13.959 13.959 0 00-3.137-5.702q-.479-.516-1.006-1.003a17.67 17.67 0 00-.677-.623A18.303 18.303 0 0024.194 1a19.617 19.617 0 00-12.539 4.489 17.555 17.555 0 00-3.945 21.69C9.945 31.507 11.694 38.622 12.14 46v2",strokeMiterlimit:10}),(0,s.jsx)("path",{d:"M27.917 12L31.417 12"}),(0,s.jsx)("path",{d:"M27.917 26L31.417 26"}),(0,s.jsx)("path",{d:"M29.667 12L29.667 26"}),(0,s.jsx)("path",{d:"M23.992 26L19.904 12 19.226 12 15.159 26"}),(0,s.jsx)("path",{d:"M16.854 21.133L22.276 21.133"})]});c=o("85Hg2");var ZS=({forceStatus:e,provider:t})=>{var n;const{t:r}=Se(),[i,o]=(0,c.useState)(null!=e?e:"none"),a=(e=>{switch(e){case"DEFAULT":case"OpenAI":return{getStatus:async()=>{var e;const t=await fetch("https://status.openai.com/api/v2/summary.json");return null!==(e=(await t.json()).status.indicator)&&void 0!==e?e:"none"},statusPage:"https://status.openai.com/"};default:return{getStatus:async()=>"none",statusPage:""}}})(t);return(0,c.useEffect)((()=>{e||a.getStatus().then((e=>o(e)))}),[e,t]),"none"!==i?(0,s.jsx)(dv,{className:"memori--completion-provider-status--tooltip",align:"topLeft",content:(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:r("completionProviderDown",{provider:null!=t?t:r("completionProviderFallbackName")})}),!!(null===(n=a.statusPage)||void 0===n?void 0:n.length)&&(0,s.jsx)("p",{children:(0,s.jsx)("a",{href:a.statusPage,rel:"noopener noreferrer",target:"_blank",children:r("completionProviderCheckStatusPage")})})]}),children:(0,s.jsx)(KS,{className:"memori--completion-provider-status--icon"})}):null};var XS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",className:e,"aria-label":t,children:(0,s.jsx)("path",{fill:"currentColor",d:"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z"})});var $S=({memori:e,tenant:t,gamificationLevel:n,language:r,userLang:i,setUserLang:o,baseUrl:a,apiUrl:l,position:u,openPositionDrawer:d,integrationConfig:h,instruct:p=!1,clickedStart:f,onClickStart:m,initializeTTS:g,_TEST_forceProviderStatus:v,isUserLoggedIn:y=!1,user:b,showLogin:S=!1,setShowLoginDrawer:x})=>{var _,w;const{t:C,i18n:A}=Se(),[E,T]=(0,c.useState)(e.description),[M,I]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{var t,n,i,o,s,l;(null!==(n=null===(t=A.language)||void 0===t?void 0:t.toUpperCase())&&void 0!==n?n:"IT")!==(null!==(i=null==r?void 0:r.toUpperCase())&&void 0!==i?i:"IT")&&(null===(o=e.description)||void 0===o?void 0:o.length)&&aS(e.description,null!==(l=null===(s=A.language)||void 0===s?void 0:s.toUpperCase())&&void 0!==l?l:"IT",r,a).then((e=>{T(e.text)})).catch(console.error)}),[A.language,r,e.description,a]),(0,s.jsxs)("div",{className:"memori--start-panel",children:[(0,s.jsxs)("div",{className:"memori--cover",style:{backgroundImage:`url("${lv({type:"cover",tenantID:null==t?void 0:t.id,resourceURI:e.coverURL,baseURL:a,apiURL:l})}"), url("${lv({type:"cover",tenantID:null==t?void 0:t.id,baseURL:a,apiURL:l})}")`},children:[!!(null===(_=null==n?void 0:n.badge)||void 0===_?void 0:_.length)&&!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--gamification-badge",children:(0,s.jsx)(dv,{align:"left",content:`${C("gamification.level")} ${n.badge}, ${n.points} ${C("gamification.points")}`,children:(0,s.jsx)("span",{"aria-label":`${C("gamification.level")} ${n.badge}, ${n.points} ${C("gamification.points")}`,children:n.badge})})}),!!e.enableCompletions&&!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--completions-enabled",children:(0,s.jsx)(dv,{align:"left",content:C("completionsEnabled"),children:(0,s.jsx)("span",{"aria-label":C("completionsEnabled")||"Completions",children:(0,s.jsx)(uv,{})})})}),!!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--board-of-experts",children:(0,s.jsx)(dv,{align:"left",content:C("boardOfExperts"),children:(0,s.jsx)("span",{"aria-label":C("boardOfExperts")||"Board of Experts",children:(0,s.jsx)(QS,{})})})}),!!e.nsfw&&(0,s.jsx)("div",{className:"memori--nsfw",children:(0,s.jsx)(dv,{align:"left",content:C("nsfw"),children:(0,s.jsx)("span",{title:C("nsfw")||"NSFW",children:"🔞"})})})]}),(0,s.jsxs)("picture",{className:"memori--avatar",children:[(0,s.jsx)("source",{src:null!==(w=e.avatarURL)&&void 0!==w?w:lv({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:a,apiURL:l})}),(0,s.jsx)("img",{alt:e.name,src:e.avatarURL&&e.avatarURL.length>0?lv({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:a,apiURL:l}):lv({type:"avatar",tenantID:null==t?void 0:t.id,baseURL:a,apiURL:l})})]}),(0,s.jsx)("h2",{className:"memori--title",children:e.name}),e.needsPosition&&!u&&(0,s.jsxs)("div",{className:"memori--needsPosition",children:[(0,s.jsx)("p",{children:C("write_and_speak.requirePositionHelp",{name:e.name})}),(0,s.jsx)(Sf,{primary:!0,onClick:()=>d(),className:"memori--start-button",icon:(0,s.jsx)(XS,{}),children:C("widget.position")})]}),(e.needsPosition&&u||!e.needsPosition)&&(0,s.jsxs)("div",{className:"memori--description",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"memori--description-text",children:E&&M?E:e.description}),E!==e.description&&(0,s.jsx)(Sf,{ghost:!0,className:"memori--translation-toggle",icon:(0,s.jsx)(qS,{}),onClick:()=>{I((e=>!e))},children:C(M?"showOriginalText":"showTranslatedText")})]}),(null==h?void 0:h.multilanguage)&&!p&&(0,s.jsxs)("div",{className:"memori--language-chooser",children:[(0,s.jsx)("label",{id:"user-lang-pref-label",htmlFor:"user-lang-pref",children:C("write_and_speak.iWantToTalkToIn",{name:e.name})}),(0,s.jsx)("select",{id:"user-lang-pref",className:"memori-select--button",value:(null!=i?i:A.language).toUpperCase(),"aria-labelledby":"user-lang-pref-label",onChange:e=>{o(e.target.value)},children:Uv.map((e=>(0,s.jsx)("option",{value:e.value,"aria-label":e.label,children:e.label},e.value)))})]}),(0,s.jsx)(Sf,{primary:!0,disabled:!!e.blockedUntil&&!e.isGiver,loading:f,onClick:e=>{try{window.speechSynthesis.speak(new SpeechSynthesisUtterance(""))}catch(e){console.error(e)}g&&g(),m&&m()},className:"memori--start-button",children:C("write_and_speak."+(p?"instructButton":"tryMeButton"))}),(0,s.jsx)(ZS,{provider:e.completionProvider,forceStatus:v}),(0,s.jsx)("p",{className:"memori--start-description",children:C(p?"write_and_speak.pageInstructExplanation":"write_and_speak.pageTryMeExplanation")}),!!e.blockedUntil&&(0,s.jsx)(JS,{memoriName:e.name,blockedUntil:e.blockedUntil,showGiverInfo:e.isGiver,showTitle:!0,marginLeft:!0}),!!e.enableDeepThought&&!p&&(0,s.jsxs)("div",{className:"memori--deep-thought-disclaimer",children:[(0,s.jsx)(dv,{align:"left",content:C("deepThoughtHelper"),children:(0,s.jsx)(YS,{})}),(0,s.jsx)("h2",{children:y&&(null==b?void 0:b.pAndCUAccepted)?C("deepThoughtDisclaimerTitle"):C("deepThought")}),y&&!(null==b?void 0:b.pAndCUAccepted)&&(0,s.jsx)("p",{children:C("deepThoughtPreDisclaimerNotAllowed")}),!y&&(0,s.jsx)("p",{children:C("deepThoughtPreDisclaimerUnlogged")}),!y&&S&&(0,s.jsx)("p",{children:(0,s.jsx)(Sf,{outlined:!0,padded:!1,onClick:()=>x(!0),children:"Login"})}),(0,s.jsx)("p",{className:"memori--deep-thought-disclaimer-text",children:C("deepThoughtDisclaimer")})]})]})]})},ex=(c=o("85Hg2"),c=o("85Hg2"),Y=o("hcaHr"),c=o("85Hg2"),["forwardedRef"]);function tx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nx(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?tx(Object(r),!0).forEach((function(n){t(Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tx(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}class rx extends c.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,s.jsxs)("div",{style:{background:"rgba(255, 255, 255, 0.4)",color:"#000",padding:"2rem",borderRadius:"10px"},children:[(0,s.jsx)("h2",{children:this.props.t("error.generic")}),(0,s.jsx)(Sf,{primary:!0,onClick:()=>this.setState({hasError:!1}),children:this.props.t("error.tryAgain")||"Try again"})]}):this.props.children}}var ix=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r){function i(i){var o=i.forwardedRef,s=t(iy)(i,ex),a=Se(e,nx(nx({},s),{},{keyPrefix:n.keyPrefix})),l=t(Y)(a,3),u=l[0],d=l[1],h=l[2],p=nx(nx({},s),{},{t:u,i18n:d,tReady:h});return n.withRef&&o?p.ref=o:!n.withRef&&o&&(p.forwardedRef=o),(0,c.createElement)(r,p)}i.displayName="withI18nextTranslation(".concat(ge(r),")"),i.WrappedComponent=r;return n.withRef?(0,c.forwardRef)((function(e,t){return(0,c.createElement)(i,Object.assign({},e,{forwardedRef:t}))})):i}}(["common"])(rx),ox=(c=o("85Hg2"),c=o("85Hg2"),{});e(ox,"REVISION",(()=>sx)),e(ox,"MOUSE",(()=>ax)),e(ox,"TOUCH",(()=>lx)),e(ox,"CullFaceNone",(()=>cx)),e(ox,"CullFaceBack",(()=>ux)),e(ox,"CullFaceFront",(()=>dx)),e(ox,"CullFaceFrontBack",(()=>hx)),e(ox,"BasicShadowMap",(()=>px)),e(ox,"PCFShadowMap",(()=>fx)),e(ox,"PCFSoftShadowMap",(()=>mx)),e(ox,"VSMShadowMap",(()=>gx)),e(ox,"FrontSide",(()=>vx)),e(ox,"BackSide",(()=>yx)),e(ox,"DoubleSide",(()=>bx)),e(ox,"NoBlending",(()=>Sx)),e(ox,"NormalBlending",(()=>xx)),e(ox,"AdditiveBlending",(()=>_x)),e(ox,"SubtractiveBlending",(()=>wx)),e(ox,"MultiplyBlending",(()=>Cx)),e(ox,"CustomBlending",(()=>Ax)),e(ox,"AddEquation",(()=>Ex)),e(ox,"SubtractEquation",(()=>Tx)),e(ox,"ReverseSubtractEquation",(()=>Mx)),e(ox,"MinEquation",(()=>Ix)),e(ox,"MaxEquation",(()=>Rx)),e(ox,"ZeroFactor",(()=>Px)),e(ox,"OneFactor",(()=>kx)),e(ox,"SrcColorFactor",(()=>Ox)),e(ox,"OneMinusSrcColorFactor",(()=>Nx)),e(ox,"SrcAlphaFactor",(()=>Lx)),e(ox,"OneMinusSrcAlphaFactor",(()=>Dx)),e(ox,"DstAlphaFactor",(()=>Bx)),e(ox,"OneMinusDstAlphaFactor",(()=>zx)),e(ox,"DstColorFactor",(()=>Fx)),e(ox,"OneMinusDstColorFactor",(()=>Ux)),e(ox,"SrcAlphaSaturateFactor",(()=>jx)),e(ox,"NeverDepth",(()=>Hx)),e(ox,"AlwaysDepth",(()=>Gx)),e(ox,"LessDepth",(()=>Vx)),e(ox,"LessEqualDepth",(()=>Wx)),e(ox,"EqualDepth",(()=>qx)),e(ox,"GreaterEqualDepth",(()=>Kx)),e(ox,"GreaterDepth",(()=>Jx)),e(ox,"NotEqualDepth",(()=>Qx)),e(ox,"MultiplyOperation",(()=>Yx)),e(ox,"MixOperation",(()=>Zx)),e(ox,"AddOperation",(()=>Xx)),e(ox,"NoToneMapping",(()=>$x)),e(ox,"LinearToneMapping",(()=>e_)),e(ox,"ReinhardToneMapping",(()=>t_)),e(ox,"CineonToneMapping",(()=>n_)),e(ox,"ACESFilmicToneMapping",(()=>r_)),e(ox,"CustomToneMapping",(()=>i_)),e(ox,"UVMapping",(()=>o_)),e(ox,"CubeReflectionMapping",(()=>s_)),e(ox,"CubeRefractionMapping",(()=>a_)),e(ox,"EquirectangularReflectionMapping",(()=>l_)),e(ox,"EquirectangularRefractionMapping",(()=>c_)),e(ox,"CubeUVReflectionMapping",(()=>u_)),e(ox,"RepeatWrapping",(()=>d_)),e(ox,"ClampToEdgeWrapping",(()=>h_)),e(ox,"MirroredRepeatWrapping",(()=>p_)),e(ox,"NearestFilter",(()=>f_)),e(ox,"NearestMipmapNearestFilter",(()=>m_)),e(ox,"NearestMipMapNearestFilter",(()=>g_)),e(ox,"NearestMipmapLinearFilter",(()=>v_)),e(ox,"NearestMipMapLinearFilter",(()=>y_)),e(ox,"LinearFilter",(()=>b_)),e(ox,"LinearMipmapNearestFilter",(()=>S_)),e(ox,"LinearMipMapNearestFilter",(()=>x_)),e(ox,"LinearMipmapLinearFilter",(()=>__)),e(ox,"LinearMipMapLinearFilter",(()=>w_)),e(ox,"UnsignedByteType",(()=>C_)),e(ox,"ByteType",(()=>A_)),e(ox,"ShortType",(()=>E_)),e(ox,"UnsignedShortType",(()=>T_)),e(ox,"IntType",(()=>M_)),e(ox,"UnsignedIntType",(()=>I_)),e(ox,"FloatType",(()=>R_)),e(ox,"HalfFloatType",(()=>P_)),e(ox,"UnsignedShort4444Type",(()=>k_)),e(ox,"UnsignedShort5551Type",(()=>O_)),e(ox,"UnsignedInt248Type",(()=>N_)),e(ox,"AlphaFormat",(()=>L_)),e(ox,"RGBFormat",(()=>D_)),e(ox,"RGBAFormat",(()=>B_)),e(ox,"LuminanceFormat",(()=>z_)),e(ox,"LuminanceAlphaFormat",(()=>F_)),e(ox,"DepthFormat",(()=>U_)),e(ox,"DepthStencilFormat",(()=>j_)),e(ox,"RedFormat",(()=>H_)),e(ox,"RedIntegerFormat",(()=>G_)),e(ox,"RGFormat",(()=>V_)),e(ox,"RGIntegerFormat",(()=>W_)),e(ox,"RGBAIntegerFormat",(()=>q_)),e(ox,"RGB_S3TC_DXT1_Format",(()=>K_)),e(ox,"RGBA_S3TC_DXT1_Format",(()=>J_)),e(ox,"RGBA_S3TC_DXT3_Format",(()=>Q_)),e(ox,"RGBA_S3TC_DXT5_Format",(()=>Y_)),e(ox,"RGB_PVRTC_4BPPV1_Format",(()=>Z_)),e(ox,"RGB_PVRTC_2BPPV1_Format",(()=>X_)),e(ox,"RGBA_PVRTC_4BPPV1_Format",(()=>$_)),e(ox,"RGBA_PVRTC_2BPPV1_Format",(()=>ew)),e(ox,"RGB_ETC1_Format",(()=>tw)),e(ox,"RGB_ETC2_Format",(()=>nw)),e(ox,"RGBA_ETC2_EAC_Format",(()=>rw)),e(ox,"RGBA_ASTC_4x4_Format",(()=>iw)),e(ox,"RGBA_ASTC_5x4_Format",(()=>ow)),e(ox,"RGBA_ASTC_5x5_Format",(()=>sw)),e(ox,"RGBA_ASTC_6x5_Format",(()=>aw)),e(ox,"RGBA_ASTC_6x6_Format",(()=>lw)),e(ox,"RGBA_ASTC_8x5_Format",(()=>cw)),e(ox,"RGBA_ASTC_8x6_Format",(()=>uw)),e(ox,"RGBA_ASTC_8x8_Format",(()=>dw)),e(ox,"RGBA_ASTC_10x5_Format",(()=>hw)),e(ox,"RGBA_ASTC_10x6_Format",(()=>pw)),e(ox,"RGBA_ASTC_10x8_Format",(()=>fw)),e(ox,"RGBA_ASTC_10x10_Format",(()=>mw)),e(ox,"RGBA_ASTC_12x10_Format",(()=>gw)),e(ox,"RGBA_ASTC_12x12_Format",(()=>vw)),e(ox,"RGBA_BPTC_Format",(()=>yw)),e(ox,"LoopOnce",(()=>bw)),e(ox,"LoopRepeat",(()=>Sw)),e(ox,"LoopPingPong",(()=>xw)),e(ox,"InterpolateDiscrete",(()=>_w)),e(ox,"InterpolateLinear",(()=>ww)),e(ox,"InterpolateSmooth",(()=>Cw)),e(ox,"ZeroCurvatureEnding",(()=>Aw)),e(ox,"ZeroSlopeEnding",(()=>Ew)),e(ox,"WrapAroundEnding",(()=>Tw)),e(ox,"NormalAnimationBlendMode",(()=>Mw)),e(ox,"AdditiveAnimationBlendMode",(()=>Iw)),e(ox,"TrianglesDrawMode",(()=>Rw)),e(ox,"TriangleStripDrawMode",(()=>Pw)),e(ox,"TriangleFanDrawMode",(()=>kw)),e(ox,"LinearEncoding",(()=>Ow)),e(ox,"sRGBEncoding",(()=>Nw)),e(ox,"BasicDepthPacking",(()=>Lw)),e(ox,"RGBADepthPacking",(()=>Dw)),e(ox,"TangentSpaceNormalMap",(()=>Bw)),e(ox,"ObjectSpaceNormalMap",(()=>zw)),e(ox,"NoColorSpace",(()=>Fw)),e(ox,"SRGBColorSpace",(()=>Uw)),e(ox,"LinearSRGBColorSpace",(()=>jw)),e(ox,"ZeroStencilOp",(()=>Hw)),e(ox,"KeepStencilOp",(()=>Gw)),e(ox,"ReplaceStencilOp",(()=>Vw)),e(ox,"IncrementStencilOp",(()=>Ww)),e(ox,"DecrementStencilOp",(()=>qw)),e(ox,"IncrementWrapStencilOp",(()=>Kw)),e(ox,"DecrementWrapStencilOp",(()=>Jw)),e(ox,"InvertStencilOp",(()=>Qw)),e(ox,"NeverStencilFunc",(()=>Yw)),e(ox,"LessStencilFunc",(()=>Zw)),e(ox,"EqualStencilFunc",(()=>Xw)),e(ox,"LessEqualStencilFunc",(()=>$w)),e(ox,"GreaterStencilFunc",(()=>eC)),e(ox,"NotEqualStencilFunc",(()=>tC)),e(ox,"GreaterEqualStencilFunc",(()=>nC)),e(ox,"AlwaysStencilFunc",(()=>rC)),e(ox,"StaticDrawUsage",(()=>iC)),e(ox,"DynamicDrawUsage",(()=>oC)),e(ox,"StreamDrawUsage",(()=>sC)),e(ox,"StaticReadUsage",(()=>aC)),e(ox,"DynamicReadUsage",(()=>lC)),e(ox,"StreamReadUsage",(()=>cC)),e(ox,"StaticCopyUsage",(()=>uC)),e(ox,"DynamicCopyUsage",(()=>dC)),e(ox,"StreamCopyUsage",(()=>hC)),e(ox,"GLSL1",(()=>pC)),e(ox,"GLSL3",(()=>fC)),e(ox,"_SRGBAFormat",(()=>mC)),e(ox,"EventDispatcher",(()=>gC)),e(ox,"MathUtils",(()=>RC)),e(ox,"Vector2",(()=>PC)),e(ox,"Matrix3",(()=>kC)),e(ox,"ColorManagement",(()=>UC)),e(ox,"Color",(()=>KC)),e(ox,"ImageUtils",(()=>QC)),e(ox,"Source",(()=>YC)),e(ox,"Texture",(()=>$C)),e(ox,"Vector4",(()=>eA)),e(ox,"WebGLRenderTarget",(()=>tA)),e(ox,"DataArrayTexture",(()=>nA)),e(ox,"WebGLArrayRenderTarget",(()=>rA)),e(ox,"Data3DTexture",(()=>iA)),e(ox,"WebGL3DRenderTarget",(()=>oA)),e(ox,"WebGLMultipleRenderTargets",(()=>sA)),e(ox,"Quaternion",(()=>aA)),e(ox,"Vector3",(()=>lA)),e(ox,"Box3",(()=>dA)),e(ox,"Sphere",(()=>RA)),e(ox,"Ray",(()=>zA)),e(ox,"Matrix4",(()=>FA)),e(ox,"Euler",(()=>QA)),e(ox,"Layers",(()=>YA)),e(ox,"Object3D",(()=>uE)),e(ox,"Triangle",(()=>xE)),e(ox,"Material",(()=>wE)),e(ox,"MeshBasicMaterial",(()=>CE)),e(ox,"BufferAttribute",(()=>TE)),e(ox,"Int8BufferAttribute",(()=>ME)),e(ox,"Uint8BufferAttribute",(()=>IE)),e(ox,"Uint8ClampedBufferAttribute",(()=>RE)),e(ox,"Int16BufferAttribute",(()=>PE)),e(ox,"Uint16BufferAttribute",(()=>kE)),e(ox,"Int32BufferAttribute",(()=>OE)),e(ox,"Uint32BufferAttribute",(()=>NE)),e(ox,"Float16BufferAttribute",(()=>LE)),e(ox,"Float32BufferAttribute",(()=>DE)),e(ox,"Float64BufferAttribute",(()=>BE)),e(ox,"BufferGeometry",(()=>WE)),e(ox,"Mesh",(()=>cT)),e(ox,"BoxGeometry",(()=>dT)),e(ox,"UniformsUtils",(()=>fT)),e(ox,"ShaderMaterial",(()=>mT)),e(ox,"Camera",(()=>gT)),e(ox,"PerspectiveCamera",(()=>vT)),e(ox,"CubeCamera",(()=>bT)),e(ox,"CubeTexture",(()=>ST)),e(ox,"WebGLCubeRenderTarget",(()=>xT)),e(ox,"Plane",(()=>AT)),e(ox,"Frustum",(()=>MT)),e(ox,"PlaneGeometry",(()=>PT)),e(ox,"ShaderChunk",(()=>kT)),e(ox,"UniformsLib",(()=>OT)),e(ox,"ShaderLib",(()=>NT)),e(ox,"OrthographicCamera",(()=>jT)),e(ox,"PMREMGenerator",(()=>YT)),e(ox,"MeshDepthMaterial",(()=>qI)),e(ox,"MeshDistanceMaterial",(()=>KI)),e(ox,"WebGLUtils",(()=>ZI)),e(ox,"ArrayCamera",(()=>XI)),e(ox,"Group",(()=>$I)),e(ox,"DepthTexture",(()=>nR)),e(ox,"WebGLRenderer",(()=>sR)),e(ox,"WebGL1Renderer",(()=>aR)),e(ox,"FogExp2",(()=>lR)),e(ox,"Fog",(()=>cR)),e(ox,"Scene",(()=>uR)),e(ox,"InterleavedBuffer",(()=>dR)),e(ox,"InterleavedBufferAttribute",(()=>pR)),e(ox,"SpriteMaterial",(()=>fR)),e(ox,"Sprite",(()=>MR)),e(ox,"LOD",(()=>kR)),e(ox,"SkinnedMesh",(()=>zR)),e(ox,"Bone",(()=>FR)),e(ox,"DataTexture",(()=>UR)),e(ox,"Skeleton",(()=>GR)),e(ox,"InstancedBufferAttribute",(()=>VR)),e(ox,"InstancedMesh",(()=>QR)),e(ox,"LineBasicMaterial",(()=>YR)),e(ox,"Line",(()=>nP)),e(ox,"LineSegments",(()=>oP)),e(ox,"LineLoop",(()=>sP)),e(ox,"PointsMaterial",(()=>aP)),e(ox,"Points",(()=>hP)),e(ox,"VideoTexture",(()=>fP)),e(ox,"FramebufferTexture",(()=>mP)),e(ox,"CompressedTexture",(()=>gP)),e(ox,"CanvasTexture",(()=>vP)),e(ox,"Curve",(()=>yP)),e(ox,"EllipseCurve",(()=>bP)),e(ox,"ArcCurve",(()=>SP)),e(ox,"CatmullRomCurve3",(()=>EP)),e(ox,"CubicBezierCurve",(()=>RP)),e(ox,"CubicBezierCurve3",(()=>PP)),e(ox,"LineCurve",(()=>kP)),e(ox,"LineCurve3",(()=>OP)),e(ox,"QuadraticBezierCurve",(()=>NP)),e(ox,"QuadraticBezierCurve3",(()=>LP)),e(ox,"SplineCurve",(()=>DP)),e(ox,"CurvePath",(()=>zP)),e(ox,"Path",(()=>FP)),e(ox,"LatheGeometry",(()=>UP)),e(ox,"CapsuleGeometry",(()=>jP)),e(ox,"CircleGeometry",(()=>HP)),e(ox,"CylinderGeometry",(()=>GP)),e(ox,"ConeGeometry",(()=>VP)),e(ox,"PolyhedronGeometry",(()=>WP)),e(ox,"DodecahedronGeometry",(()=>qP)),e(ox,"EdgesGeometry",(()=>ZP)),e(ox,"Shape",(()=>XP)),e(ox,"ShapeUtils",(()=>Ck)),e(ox,"ExtrudeGeometry",(()=>Tk)),e(ox,"IcosahedronGeometry",(()=>Ik)),e(ox,"OctahedronGeometry",(()=>Rk)),e(ox,"RingGeometry",(()=>Pk)),e(ox,"ShapeGeometry",(()=>kk)),e(ox,"SphereGeometry",(()=>Ok)),e(ox,"TetrahedronGeometry",(()=>Nk)),e(ox,"TorusGeometry",(()=>Lk)),e(ox,"TorusKnotGeometry",(()=>Dk)),e(ox,"TubeGeometry",(()=>Bk)),e(ox,"WireframeGeometry",(()=>zk)),e(ox,"ShadowMaterial",(()=>jk)),e(ox,"RawShaderMaterial",(()=>Hk)),e(ox,"MeshStandardMaterial",(()=>Gk)),e(ox,"MeshPhysicalMaterial",(()=>Vk)),e(ox,"MeshPhongMaterial",(()=>Wk)),e(ox,"MeshToonMaterial",(()=>qk)),e(ox,"MeshNormalMaterial",(()=>Kk)),e(ox,"MeshLambertMaterial",(()=>Jk)),e(ox,"MeshMatcapMaterial",(()=>Qk)),e(ox,"LineDashedMaterial",(()=>Yk)),e(ox,"AnimationUtils",(()=>rO)),e(ox,"Interpolant",(()=>iO)),e(ox,"CubicInterpolant",(()=>oO)),e(ox,"LinearInterpolant",(()=>sO)),e(ox,"DiscreteInterpolant",(()=>aO)),e(ox,"KeyframeTrack",(()=>lO)),e(ox,"BooleanKeyframeTrack",(()=>cO)),e(ox,"ColorKeyframeTrack",(()=>uO)),e(ox,"NumberKeyframeTrack",(()=>dO)),e(ox,"QuaternionLinearInterpolant",(()=>hO)),e(ox,"QuaternionKeyframeTrack",(()=>pO)),e(ox,"StringKeyframeTrack",(()=>fO)),e(ox,"VectorKeyframeTrack",(()=>mO)),e(ox,"AnimationClip",(()=>gO)),e(ox,"Cache",(()=>yO)),e(ox,"LoadingManager",(()=>bO)),e(ox,"DefaultLoadingManager",(()=>SO)),e(ox,"Loader",(()=>xO)),e(ox,"FileLoader",(()=>CO)),e(ox,"AnimationLoader",(()=>AO)),e(ox,"CompressedTextureLoader",(()=>EO)),e(ox,"ImageLoader",(()=>TO)),e(ox,"CubeTextureLoader",(()=>MO)),e(ox,"DataTextureLoader",(()=>IO)),e(ox,"TextureLoader",(()=>RO)),e(ox,"Light",(()=>PO)),e(ox,"HemisphereLight",(()=>kO)),e(ox,"SpotLight",(()=>zO)),e(ox,"PointLight",(()=>GO)),e(ox,"DirectionalLight",(()=>WO)),e(ox,"AmbientLight",(()=>qO)),e(ox,"RectAreaLight",(()=>KO)),e(ox,"SphericalHarmonics3",(()=>JO)),e(ox,"LightProbe",(()=>QO)),e(ox,"MaterialLoader",(()=>YO)),e(ox,"LoaderUtils",(()=>ZO)),e(ox,"InstancedBufferGeometry",(()=>XO)),e(ox,"BufferGeometryLoader",(()=>$O)),e(ox,"ObjectLoader",(()=>eN)),e(ox,"ImageBitmapLoader",(()=>iN)),e(ox,"AudioContext",(()=>sN)),e(ox,"AudioLoader",(()=>aN)),e(ox,"HemisphereLightProbe",(()=>lN)),e(ox,"AmbientLightProbe",(()=>cN)),e(ox,"StereoCamera",(()=>pN)),e(ox,"Clock",(()=>fN)),e(ox,"AudioListener",(()=>SN)),e(ox,"Audio",(()=>xN)),e(ox,"PositionalAudio",(()=>EN)),e(ox,"AudioAnalyser",(()=>TN)),e(ox,"PropertyMixer",(()=>MN)),e(ox,"PropertyBinding",(()=>LN)),e(ox,"AnimationObjectGroup",(()=>DN)),e(ox,"AnimationMixer",(()=>FN)),e(ox,"Uniform",(()=>UN)),e(ox,"UniformsGroup",(()=>HN)),e(ox,"InstancedInterleavedBuffer",(()=>GN)),e(ox,"GLBufferAttribute",(()=>VN)),e(ox,"Raycaster",(()=>WN)),e(ox,"Spherical",(()=>JN)),e(ox,"Cylindrical",(()=>QN)),e(ox,"Box2",(()=>ZN)),e(ox,"Line3",(()=>eL)),e(ox,"SpotLightHelper",(()=>nL)),e(ox,"SkeletonHelper",(()=>sL)),e(ox,"PointLightHelper",(()=>lL)),e(ox,"HemisphereLightHelper",(()=>hL)),e(ox,"GridHelper",(()=>pL)),e(ox,"PolarGridHelper",(()=>fL)),e(ox,"DirectionalLightHelper",(()=>yL)),e(ox,"CameraHelper",(()=>xL)),e(ox,"BoxHelper",(()=>CL)),e(ox,"Box3Helper",(()=>AL)),e(ox,"PlaneHelper",(()=>EL)),e(ox,"ArrowHelper",(()=>RL)),e(ox,"AxesHelper",(()=>PL)),e(ox,"ShapePath",(()=>kL)),e(ox,"DataUtils",(()=>LL)),e(ox,"ImmediateRenderObject",(()=>DL)),e(ox,"WebGLMultisampleRenderTarget",(()=>BL)),e(ox,"DataTexture2DArray",(()=>zL)),e(ox,"DataTexture3D",(()=>FL)),e(ox,"BoxBufferGeometry",(()=>UL)),e(ox,"CapsuleBufferGeometry",(()=>jL)),e(ox,"CircleBufferGeometry",(()=>HL)),e(ox,"ConeBufferGeometry",(()=>GL)),e(ox,"CylinderBufferGeometry",(()=>VL)),e(ox,"DodecahedronBufferGeometry",(()=>WL)),e(ox,"ExtrudeBufferGeometry",(()=>qL)),e(ox,"IcosahedronBufferGeometry",(()=>KL)),e(ox,"LatheBufferGeometry",(()=>JL)),e(ox,"OctahedronBufferGeometry",(()=>QL)),e(ox,"PlaneBufferGeometry",(()=>YL)),e(ox,"PolyhedronBufferGeometry",(()=>ZL)),e(ox,"RingBufferGeometry",(()=>XL)),e(ox,"ShapeBufferGeometry",(()=>$L)),e(ox,"SphereBufferGeometry",(()=>eD)),e(ox,"TetrahedronBufferGeometry",(()=>tD)),e(ox,"TorusBufferGeometry",(()=>nD)),e(ox,"TorusKnotBufferGeometry",(()=>rD)),e(ox,"TubeBufferGeometry",(()=>iD));
239
+ /*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */Nv=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:i}=Object;let{freeze:o,seal:s,create:a}=Object,{apply:l,construct:c}="undefined"!=typeof Reflect&&Reflect;o||(o=function(e){return e}),s||(s=function(e){return e}),l||(l=function(e,t,n){return e.apply(t,n)}),c||(c=function(e,t){return new e(...t)});const u=x(Array.prototype.forEach),d=x(Array.prototype.pop),h=x(Array.prototype.push),p=x(String.prototype.toLowerCase),f=x(String.prototype.toString),m=x(String.prototype.match),g=x(String.prototype.replace),v=x(String.prototype.indexOf),y=x(String.prototype.trim),b=x(RegExp.prototype.test),S=_(TypeError);function x(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return l(e,t,r)}}function _(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return c(e,n)}}function w(e,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p;t&&t(e,null);let o=r.length;for(;o--;){let t=r[o];if("string"==typeof t){const e=i(t);e!==t&&(n(r)||(r[o]=e),t=e)}e[t]=!0}return e}function C(t){const n=a(null);for(const[r,o]of e(t))void 0!==i(t,r)&&(n[r]=o);return n}function A(e,t){for(;null!==e;){const n=i(e,t);if(n){if(n.get)return x(n.get);if("function"==typeof n.value)return x(n.value)}e=r(e)}function n(e){return console.warn("fallback value for",e),null}return n}const E=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),T=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),M=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=o(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),R=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),P=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),k=o(["#text"]),O=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),N=o(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),L=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),D=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z=s(/<%[\w\W]*|[\w\W]*%>/gm),F=s(/\${[\w\W]*}/gm),U=s(/^data-[\-\w.\u00B7-\uFFFF]/),j=s(/^aria-[\-\w]+$/),H=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),G=s(/^(?:\w+script|data):/i),V=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W=s(/^html$/i);var q=Object.freeze({__proto__:null,MUSTACHE_EXPR:B,ERB_EXPR:z,TMPLIT_EXPR:F,DATA_ATTR:U,ARIA_ATTR:j,IS_ALLOWED_URI:H,IS_SCRIPT_OR_DATA:G,ATTR_WHITESPACE:V,DOCTYPE_NAME:W});const K=function(){return"undefined"==typeof window?null:window},J=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function Q(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K();const n=e=>Q(e);if(n.version="3.0.6",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const i=r,s=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:c,Node:x,Element:_,NodeFilter:B,NamedNodeMap:z=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:F,DOMParser:U,trustedTypes:j}=t,G=_.prototype,V=A(G,"cloneNode"),Y=A(G,"nextSibling"),Z=A(G,"childNodes"),X=A(G,"parentNode");if("function"==typeof c){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let $,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:re,getElementsByTagName:ie}=r,{importNode:oe}=i;let se={};n.isSupported="function"==typeof e&&"function"==typeof X&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:ae,ERB_EXPR:le,TMPLIT_EXPR:ce,DATA_ATTR:ue,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:he,ATTR_WHITESPACE:pe}=q;let{IS_ALLOWED_URI:fe}=q,me=null;const ge=w({},[...E,...T,...M,...R,...k]);let ve=null;const ye=w({},[...O,...N,...L,...D]);let be=Object.seal(a(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,xe=null,_e=!0,we=!0,Ce=!1,Ae=!0,Ee=!1,Te=!1,Me=!1,Ie=!1,Re=!1,Pe=!1,ke=!1,Oe=!0,Ne=!1;const Le="user-content-";let De=!0,Be=!1,ze={},Fe=null;const Ue=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let je=null;const He=w({},["audio","video","img","source","image","track"]);let Ge=null;const Ve=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",Ke="http://www.w3.org/1999/xhtml";let Je=Ke,Qe=!1,Ye=null;const Ze=w({},[We,qe,Ke],f);let Xe=null;const $e=["application/xhtml+xml","text/html"],et="text/html";let tt=null,nt=null;const rt=r.createElement("form"),it=function(e){return e instanceof RegExp||e instanceof Function},ot=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!nt||nt!==e){if(e&&"object"==typeof e||(e={}),e=C(e),Xe=Xe=-1===$e.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===Xe?f:p,me="ALLOWED_TAGS"in e?w({},e.ALLOWED_TAGS,tt):ge,ve="ALLOWED_ATTR"in e?w({},e.ALLOWED_ATTR,tt):ye,Ye="ALLOWED_NAMESPACES"in e?w({},e.ALLOWED_NAMESPACES,f):Ze,Ge="ADD_URI_SAFE_ATTR"in e?w(C(Ve),e.ADD_URI_SAFE_ATTR,tt):Ve,je="ADD_DATA_URI_TAGS"in e?w(C(He),e.ADD_DATA_URI_TAGS,tt):He,Fe="FORBID_CONTENTS"in e?w({},e.FORBID_CONTENTS,tt):Ue,Se="FORBID_TAGS"in e?w({},e.FORBID_TAGS,tt):{},xe="FORBID_ATTR"in e?w({},e.FORBID_ATTR,tt):{},ze="USE_PROFILES"in e&&e.USE_PROFILES,_e=!1!==e.ALLOW_ARIA_ATTR,we=!1!==e.ALLOW_DATA_ATTR,Ce=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ee=e.SAFE_FOR_TEMPLATES||!1,Te=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,ke=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,Oe=!1!==e.SANITIZE_DOM,Ne=e.SANITIZE_NAMED_PROPS||!1,De=!1!==e.KEEP_CONTENT,Be=e.IN_PLACE||!1,fe=e.ALLOWED_URI_REGEXP||H,Je=e.NAMESPACE||Ke,be=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(be.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ee&&(we=!1),Pe&&(Re=!0),ze&&(me=w({},[...k]),ve=[],!0===ze.html&&(w(me,E),w(ve,O)),!0===ze.svg&&(w(me,T),w(ve,N),w(ve,D)),!0===ze.svgFilters&&(w(me,M),w(ve,N),w(ve,D)),!0===ze.mathMl&&(w(me,R),w(ve,L),w(ve,D))),e.ADD_TAGS&&(me===ge&&(me=C(me)),w(me,e.ADD_TAGS,tt)),e.ADD_ATTR&&(ve===ye&&(ve=C(ve)),w(ve,e.ADD_ATTR,tt)),e.ADD_URI_SAFE_ATTR&&w(Ge,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(Fe===Ue&&(Fe=C(Fe)),w(Fe,e.FORBID_CONTENTS,tt)),De&&(me["#text"]=!0),Te&&w(me,["html","head","body"]),me.table&&(w(me,["tbody"]),delete Se.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');$=e.TRUSTED_TYPES_POLICY,ee=$.createHTML("")}else void 0===$&&($=J(j,s)),null!==$&&"string"==typeof ee&&(ee=$.createHTML(""));o&&o(e),nt=e}},st=w({},["mi","mo","mn","ms","mtext"]),at=w({},["foreignobject","desc","title","annotation-xml"]),lt=w({},["title","style","font","a","script"]),ct=w({},T);w(ct,M),w(ct,I);const ut=w({},R);w(ut,P);const dt=function(e){let t=X(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});const n=p(e.tagName),r=p(t.tagName);return!!Ye[e.namespaceURI]&&(e.namespaceURI===qe?t.namespaceURI===Ke?"svg"===n:t.namespaceURI===We?"svg"===n&&("annotation-xml"===r||st[r]):Boolean(ct[n]):e.namespaceURI===We?t.namespaceURI===Ke?"math"===n:t.namespaceURI===qe?"math"===n&&at[r]:Boolean(ut[n]):e.namespaceURI===Ke?!(t.namespaceURI===qe&&!at[r])&&!(t.namespaceURI===We&&!st[r])&&!ut[n]&&(lt[n]||!ct[n]):!("application/xhtml+xml"!==Xe||!Ye[e.namespaceURI]))},ht=function(e){h(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},pt=function(e,t){try{h(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){h(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ve[e])if(Re||Pe)try{ht(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ft=function(e){let t=null,n=null;if(Ie)e="<remove></remove>"+e;else{const t=m(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Xe&&Je===Ke&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=$?$.createHTML(e):e;if(Je===Ke)try{t=(new U).parseFromString(i,Xe)}catch(e){}if(!t||!t.documentElement){t=te.createDocument(Je,"template",null);try{t.documentElement.innerHTML=Qe?ee:i}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),Je===Ke?ie.call(t,Te?"html":"body")[0]:Te?t.documentElement:o},mt=function(e){return ne.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT,null)},gt=function(e){return e instanceof F&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof z)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},vt=function(e){return"function"==typeof x&&e instanceof x},yt=function(e,t,r){se[e]&&u(se[e],(e=>{e.call(n,t,r,nt)}))},bt=function(e){let t=null;if(yt("beforeSanitizeElements",e,null),gt(e))return ht(e),!0;const r=tt(e.nodeName);if(yt("uponSanitizeElement",e,{tagName:r,allowedTags:me}),e.hasChildNodes()&&!vt(e.firstElementChild)&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return ht(e),!0;if(!me[r]||Se[r]){if(!Se[r]&&xt(r)){if(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,r))return!1;if(be.tagNameCheck instanceof Function&&be.tagNameCheck(r))return!1}if(De&&!Fe[r]){const t=X(e)||e.parentNode,n=Z(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(V(n[r],!0),Y(e))}return ht(e),!0}return e instanceof _&&!dt(e)?(ht(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ee&&3===e.nodeType&&(t=e.textContent,u([ae,le,ce],(e=>{t=g(t,e," ")})),e.textContent!==t&&(h(n.removed,{element:e.cloneNode()}),e.textContent=t)),yt("afterSanitizeElements",e,null),!1):(ht(e),!0)},St=function(e,t,n){if(Oe&&("id"===t||"name"===t)&&(n in r||n in rt))return!1;if(we&&!xe[t]&&b(ue,t));else if(_e&&b(de,t));else if(!ve[t]||xe[t]){if(!(xt(e)&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,e)||be.tagNameCheck instanceof Function&&be.tagNameCheck(e))&&(be.attributeNameCheck instanceof RegExp&&b(be.attributeNameCheck,t)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(t))||"is"===t&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,n)||be.tagNameCheck instanceof Function&&be.tagNameCheck(n))))return!1}else if(Ge[t]);else if(b(fe,g(n,pe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!je[e])if(Ce&&!b(he,g(n,pe,"")));else if(n)return!1;return!0},xt=function(e){return e.indexOf("-")>0},_t=function(e){yt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ve};let i=t.length;for(;i--;){const o=t[i],{name:s,namespaceURI:a,value:l}=o,c=tt(s);let h="value"===s?l:y(l);if(r.attrName=c,r.attrValue=h,r.keepAttr=!0,r.forceKeepAttr=void 0,yt("uponSanitizeAttribute",e,r),h=r.attrValue,r.forceKeepAttr)continue;if(pt(s,e),!r.keepAttr)continue;if(!Ae&&b(/\/>/i,h)){pt(s,e);continue}Ee&&u([ae,le,ce],(e=>{h=g(h,e," ")}));const p=tt(e.nodeName);if(St(p,c,h)){if(!Ne||"id"!==c&&"name"!==c||(pt(s,e),h=Le+h),$&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(a);else switch(j.getAttributeType(p,c)){case"TrustedHTML":h=$.createHTML(h);break;case"TrustedScriptURL":h=$.createScriptURL(h)}try{a?e.setAttributeNS(a,s,h):e.setAttribute(s,h),d(n.removed)}catch(e){}}}yt("afterSanitizeAttributes",e,null)},wt=function e(t){let n=null;const r=mt(t);for(yt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)yt("uponSanitizeShadowNode",n,null),bt(n)||(n.content instanceof l&&e(n.content),_t(n));yt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,s=null,a=null;if(Qe=!e,Qe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!vt(e)){if("function"!=typeof e.toString)throw S("toString is not a function");if("string"!=typeof(e=e.toString()))throw S("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Me||ot(t),n.removed=[],"string"==typeof e&&(Be=!1),Be){if(e.nodeName){const t=tt(e.nodeName);if(!me[t]||Se[t])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof x)r=ft("\x3c!----\x3e"),o=r.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!Re&&!Ee&&!Te&&-1===e.indexOf("<"))return $&&ke?$.createHTML(e):e;if(r=ft(e),!r)return Re?null:ke?ee:""}r&&Ie&&ht(r.firstChild);const c=mt(Be?e:r);for(;s=c.nextNode();)bt(s)||(s.content instanceof l&&wt(s.content),_t(s));if(Be)return e;if(Re){if(Pe)for(a=re.call(r.ownerDocument);r.firstChild;)a.appendChild(r.firstChild);else a=r;return(ve.shadowroot||ve.shadowrootmode)&&(a=oe.call(i,a,!0)),a}let d=Te?r.outerHTML:r.innerHTML;return Te&&me["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&b(W,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Ee&&u([ae,le,ce],(e=>{d=g(d,e," ")})),$&&ke?$.createHTML(d):d},n.setConfig=function(){ot(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Me=!0},n.clearConfig=function(){nt=null,Me=!1},n.isValidAttribute=function(e,t,n){nt||ot({});const r=tt(e),i=tt(t);return St(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&(se[e]=se[e]||[],h(se[e],t))},n.removeHook=function(e){if(se[e])return d(se[e])},n.removeHooks=function(e){se[e]&&(se[e]=[])},n.removeAllHooks=function(){se={}},n}return Q()}();var Lv=({className:e,title:t})=>(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 24 24",className:e,"aria-label":t,children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("path",{d:"M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3"}),(0,s.jsx)("path",{d:"M12 17L12.01 17"})]});c=o("85Hg2"),c=o("85Hg2");var Dv=({rows:e,className:n,innerClassName:r,btnClassName:i,lineHeightMultiplier:o=1.2,defaultExpanded:a=!1,expandSymbol:l=(()=>"..."),collapseSymbol:u=(e=>"it"===e?"Mostra meno":"Show less"),children:d})=>{const{i18n:h}=Se(),p=h.language,f=u(p),m=l(p),[g,v]=(0,c.useState)(a),[y,b]=(0,c.useState)(!1),[S,x]=(0,c.useState)(16),_=(0,c.useRef)(null);return(0,c.useEffect)((()=>{if(_.current){let t=_.current.getBoundingClientRect().height,n=getComputedStyle(_.current),r=n.lineHeight,i="normal"!==r&&(null==r?void 0:r.length)?parseInt(r,10):o*parseInt(n.fontSize,10);console.table({rows:e,lineHeight:i,height:t,maxHeight:e*i,needsExpanding:t>e*i}),x(i),t&&t>e*i&&b(!0)}}),[e,_.current]),(0,s.jsxs)("div",{className:t(xs)("memori-expandable",n),children:[(0,s.jsx)("div",{ref:_,className:t(xs)("memori-expandable--inner",r),style:{maxHeight:g||!y?"9999px":S*e+"px"},children:d}),y&&!g&&(0,s.jsx)(Sf,{ghost:!0,padded:!1,className:i,onClick:()=>v(!0),children:m}),y&&g&&(0,s.jsx)(Sf,{ghost:!0,padded:!1,className:i,onClick:()=>v(!1),children:f})]})};const Bv=new Map(Object.entries({TENANT_NOT_FOUND:-1,TENANT_REGISTRATION_DISABLED:-2,TENANT_MISSING_NAME:-3,TENANT_MAX_USERS_REACHED:-4,TENANT_MAX_ADMINS_REACHED:-5,TENANT_ALREADY_EXISTS:-6,TENANT_MISSING_DESCRIPTION:-7,TENANT_CANT_SET_COMPLETION_PROVIDER:-8,USER_NOT_CONFIRMED:-11,USER_NOT_FOUND:-12,USER_OR_PASSWORD_INVALID:-13,USER_MUST_CHANGE_PASSWORD:-14,USER_MUST_ENTER_VERIFICATION_CODE:-15,USER_MISSING_TENANT:-21,USER_MISSING_NAME:-22,USER_MISSING_PASSWORD:-23,USER_MISSING_EMAIL:-24,USER_MISSING_VERIFICATION_CODE:-25,USER_NAME_ALREADY_USED:-26,USER_PASSWORD_NOT_CONFORMING_TO_POLICY:-27,USER_EMAIL_ALREADY_USED:-28,USER_EMAIL_INVALID:-29,USER_VERIFICATION_CODE_INVALID:-30,USER_MISSING_NAME_OR_EMAIL:-31,USER_NAME_INVALID:-32,USER_HAS_ONE_OR_MORE_MEMORI:-33,USER_MISSING_NEW_PASSWORD:-34,USER_CANT_CREATE_MEMORI:-35,USER_MAX_MEMORI_REACHED:-36,USER_TOO_MANY_ATTEMPTS:-38,USER_MUST_ACCEPT_TNC_AND_PP:-39,USER_BIRTH_DATE_CANT_BE_CHANGED:-40,USER_CANT_SET_COMPLETION_PROVIDER:-41,USER_CANT_ENABLE_DEEP_THOUGHT:-42,USER_CANT_ENABLE_DCM_INTEGRATION:-43,USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS:-44,MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS:-45,MEMORI_NOT_FOUND:-51,MEMORI_NOT_ACCESSIBLE:-52,MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN:-53,SESSION_NOT_FOUND:-101,SESSION_IS_NOT_ADMINISTRATIVE:-102,SESSION_EXPIRED:-103,MEMORI_MISSING_CONFIGURATION:-201,MEMORI_CONFIGURATION_NOT_FOUND:-202,MEMORI_INVALID_PRIVACY_TYPE:-203,MEMORI_MISSING_PASSWORD:-204,MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS:-205,MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS:-206,MEMORI_INVALID_VOICE_TYPE:-207,MEMORI_MISSING_NAME:-208,MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS:-209,MEMORI_INVALID_ID:-210,MEMORI_NAME_ALREADY_USED:-211,MEMORI_INVALID_PIN:-212,MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION:-213,MEMORI_NO_PASSWORD_WHEN_PUBLIC:-214,MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS:-215,MEMORI_TRANSFER_MISSING_DESTINATION_USER:-231,MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID:-232,MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT:-233,MEMORI_TRANSFER_NOTHING_TO_DO:-234,MEMORI_CONFIGURATION_CANT_BE_CHANGED:-251,MEMORI_MISSING_NEW_PASSWORD:-252,MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT:-261,MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT:-262,MEMORI_FEATURE_REQUIRES_SUBSCRIPTION:-271,INTEGRATION_NOT_FOUND:-301,INTEGRATION_INVALID_TYPE:-401,INTEGRATION_ALREADY_EXISTS:-402,INTEGRATION_MEMORI_IS_NOT_PUBLIC:-403,INTEGRATION_MISSING_INVOCATION_TEXT:-404,INTEGRATION_MISSING_DEVICE_EMAILS:-405,INTEGRATION_MEMORI_IS_EMPTY:-406,INTEGRATION_MISSING_PRIVACY_POLICY:-407,INTEGRATION_MISSING_CATEGORY:-408,INTEGRATION_MISSING_DESCRIPTION:-409,INTEGRATION_INVALID_INVOCATION_TEXT:-410,INTEGRATION_GOOGLE_NO_MORE_AVAILABLE:-411,UPLOAD_REQUIRES_MULTIPART_ENCODING:-501,UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY:-502,UPLOAD_MAX_LENGTH_EXCEEDED:-503,UPLOAD_FILE_IS_EMPTY:-504,UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE:-505,UPLOAD_MISSING_FILE_NAME:-506,UPLOAD_INVALID_MEMORY_ID:-507,UPLOAD_MISSING_FILE_CONTENT:-508,ASSET_NOT_FOUND:-601,ASSET_NOT_ACCESSIBLE:-602,ASSET_MISSING_SESSION_ID:-603,ASSET_INVALID_FILE_NAME:-604,INVITATION_NOT_FOUND:-701,INVITATION_NOT_ACCESSIBLE:-702,INVITATION_ALREADY_ACCEPTED:-703,INVITATION_ALREADY_REJECTED:-704,INVITATION_MISSING_DESTINATION_EMAIL:-705,INVITATION_DESTINATION_EMAIL_INVALID:-706,INVITATION_MISSING_TAG:-707,INVITATION_MISSING_PIN:-708,INVITATION_INVALID_PIN:-709,INVITATION_INVALID_TYPE:-710,INVITATION_MISSING_DESTINATION_NAME:-711,INVITATION_TAG_PIN_CANT_BE_CHANGED:-712,INVITATION_CANT_BE_CHANGED:-713,ACTIONLOG_INVALID_USER_ID:-801,ACTIONLOG_INVALID_DATE_FROM_FORMAT:-802,ACTIONLOG_INVALID_DATE_TO_FORMAT:-803,ACTIONLOG_INVALID_MEMORI_ID:-804,CONSUMPTIONLOG_INVALID_TYPE:-901,CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT:-902,CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT:-903,CONSUMPTIONLOG_INVALID_USER_ID:-904,CONSUMPTIONLOG_INVALID_MEMORI_ID:-905,NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD:-1001,PROCESS_INVALID_TYPE:-1401,PROCESS_ALREADY_RUNNING:-1401,PROCESS_NOT_FOUND:-1402,IMPORTCSV_MISSING_ROWS:-1501,IMPORTCSV_MISSING_CSV:-1502,IMPORTCSV_MISSING_SEPARATOR:-1503,IMPORTCSV_INVALID_SEPARATOR:-1504,IMPORTCSV_MISSING_HEADERS:-1505,IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR:-1506,IMPORTCSV_UNDETECTABLE_CHAR_ENCODING:-1521,IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI:-1531,IMPORTTXT_MISSING_ROWS:-1601,IMPORTTXT_INVALID_GRANULARITY:-1602,IMPORTTXT_UNDETECTABLE_CHAR_ENCODING:-1621,IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI:-1631,IMPORTTXT_IMPORT_LIMIT_EXCEEDED:-1632,IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY:-1633,IMPORTTXT_IMPORT_REQUIRES_PAYING:-1634,EXPORTCSV_MISSING_CSV_SPECS:-1801,EXPORTCSV_MISSING_SEPARATOR:-1802,EXPORTCSV_INVALID_SEPARATOR:-1803,EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR:-1804,EXPORTCSV_MISSING_NEW_LINE_CHAR:-1805,EXPORTCSV_INVALID_NEW_LINE_CHAR:-1806,EXPORTCSV_MISSING_PASSWORD:-1811,EXPORTJSONL_MISSING_JSONL_SPECS:-1821,EXPORTJSONL_MISSING_PLATFORM:-1822,EXPORTJSONL_INVALID_PLATFORM:-1823,EXPORTJSONL_MISSING_PASSWORD:-1831,EXPORTJSONL_EXPORT_REQUIRES_PAYING:-1832,ANALYSIS_MISSING_QUERY:-1901,ANALYSIS_CANT_ANALYZE_SECRET_MEMORI:-1902,ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT:-1903,BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS:-2001,BADGE_ASSIGNMENT_MISSING_REF_ID:-2002,BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND:-2003,BADGE_ASSIGNMENT_MISSING_ASSERTION_URL:-2004,BADGE_ASSIGNMENT_MISSING_BADGE_URL:-2005,BADGE_ASSIGNMENT_MISSING_ISSUER_URL:-2006,BADGE_ASSIGNMENT_INVALID_URL:-2007,BADGE_ASSIGNMENT_MISSING_RECIPIENT:-2021,BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE:-2022,BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY:-2023,BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE:-2024,BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE:-2025,BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY:-2026,BADGE_NOT_FOUND:-2051,OUTCOME_NO_DCM_CONFIGURED:-2071,OUTCOME_USER_BADGES_DISABLED:-2072}).map((([e,t])=>[t,e]))),zv=e=>{if(!e)return"error.generic";if(401===e||403===e)return"error.unauthorized";if(404===e)return"error.notFound";if(422===e)return"error.unprocessableEntity";if(500===e)return"internal server error";let t=Bv.get(e);return t?`errors.${t}`:"error.generic"};var Fv=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"})});const Uv=[{value:"IT",label:"Italiano"},{value:"EN",label:"English"},{value:"DE",label:"Deutsch"},{value:"ES",label:"Español"},{value:"FR",label:"Français"},{value:"PT",label:"Português"},{value:"UK",label:"Українська"},{value:"RU",label:"Русский"},{value:"PL",label:"Polski"},{value:"FI",label:"Suomi"}],jv="👤",Hv=[{name:"text",lang:"text",mimeType:"text/plain",monacoLang:"plaintext",executable:!0},{name:"javascript/jsx",lang:"jsx",mimeType:"text/javascript",monacoLang:"javascript",executable:!0},{name:"typescript/tsx",lang:"tsx",mimeType:"text/ecmascript",monacoLang:"typescript",executable:!0},{name:"json",lang:"json",mimeType:"application/json",monacoLang:"json",executable:!0},{name:"css",lang:"scss",mimeType:"text/css",monacoLang:"css",executable:!0},{name:"html/xml",lang:"tsx",mimeType:"application/xml",monacoLang:"xml"},{name:"bash",lang:"bash",mimeType:"application/x-sh",monacoLang:"shell"},{name:"python",lang:"python",mimeType:"text/x-python",monacoLang:"python"},{name:"cpp/csharp",lang:"cpp",mimeType:"text/x-c++src",monacoLang:"cpp"},{name:"php",lang:"php",mimeType:"application/x-php",monacoLang:"php"},{name:"ruby",lang:"ruby",mimeType:"text/x-ruby",monacoLang:"ruby"},{name:"sql",lang:"sql",mimeType:"text/x-sql",monacoLang:"sql"}],Gv={it:[{text:"",delayAfter:10},{text:"Cerco l'esperto più adatto",delayAfter:5},{text:"Contatto l'esperto",delayAfter:3},{text:"Spiego all'esperto la domanda",delayAfter:2},{text:"L'esperto sta preparando una risposta",delayAfter:6},{text:"Genero una risposta adatta",delayAfter:3}],en:[{text:"",delayAfter:10},{text:"I'm looking for the most suitable expert",delayAfter:5},{text:"I'm contacting the expert",delayAfter:3},{text:"I'm explaining the question to the expert",delayAfter:2},{text:"The expert is preparing an answer",delayAfter:6},{text:"I am generating a suitable answer",delayAfter:3}]};var Vv={};function Wv(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}(Vv=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){Wv(o,r,i,s,a,"next",e)}function a(e){Wv(o,r,i,s,a,"throw",e)}s(void 0)}))}}).__esModule=!0,Vv.default=Vv;var qv={};function Kv(){return qv=Kv=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},qv.__esModule=!0,qv.default=qv,Kv.apply(this,arguments)}(qv=Kv).__esModule=!0,qv.default=qv;$=o("ffgrs"),ee=o("22y1y");var Jv={},Qv={};function Yv(e,t){return Qv=Yv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Qv.__esModule=!0,Qv.default=Qv,Yv(e,t)}(Qv=Yv).__esModule=!0,Qv.default=Qv,(Jv=function(e,t){if("function"!=typeof t&&null!==t)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&&Qv(e,t)}).__esModule=!0,Jv.default=Jv;var Zv={},Xv=o("lEJSL").default,$v={};($v=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}).__esModule=!0,$v.default=$v,(Zv=function(e,t){if(t&&("object"===Xv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $v(e)}).__esModule=!0,Zv.default=Zv;var ey={};function ty(e){return ey=ty=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ey.__esModule=!0,ey.default=ey,ty(e)}(ey=ty).__esModule=!0,ey.default=ey;var ny,ry=o("7qcgS")();ny=ry;try{regeneratorRuntime=ry}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=ry:Function("r","regeneratorRuntime = r")(ry)}c=o("85Hg2");var iy={},oy={};(oy=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}).__esModule=!0,oy.default=oy,(iy=function(e,t){if(null==e)return{};var n,r,i=oy(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}).__esModule=!0,iy.default=iy;var sy={},ay={},ly=o("e3mvX");(ay=function(e){if(Array.isArray(e))return ly(e)}).__esModule=!0,ay.default=ay;var cy={};(cy=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}).__esModule=!0,cy.default=cy;var uy=o("8xD61"),dy={};(dy=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,dy.default=dy,(sy=function(e){return ay(e)||cy(e)||uy(e)||dy()}).__esModule=!0,sy.default=sy;c=o("85Hg2"),c=o("85Hg2");function hy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function py(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?hy(Object(r),!0).forEach((function(n){t(Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hy(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var fy={};function my(e){if(0===e.length||1===e.length)return e;var t,n,r=e.join(".");return fy[r]||(fy[r]=0===(n=(t=e).length)||1===n?t:2===n?[t[0],t[1],"".concat(t[0],".").concat(t[1]),"".concat(t[1],".").concat(t[0])]:3===n?[t[0],t[1],t[2],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0])]:n>=4?[t[0],t[1],t[2],t[3],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[2],".").concat(t[3]),"".concat(t[3],".").concat(t[0]),"".concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[0]),"".concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[3],".").concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[2],".").concat(t[1],".").concat(t[0])]:void 0),fy[r]}function gy(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter((function(e){return"token"!==e})),i=my(r);return i.reduce((function(e,t){return py(py({},e),n[t])}),t)}function vy(e){return e.join(" ")}function yy(e){var n=e.node,r=e.stylesheet,i=e.style,o=void 0===i?{}:i,s=e.useInlineStyles,a=e.key,l=n.properties,u=n.type,d=n.tagName,h=n.value;if("text"===u)return h;if(d){var p,f=function(e,t){var n=0;return function(r){return n+=1,r.map((function(r,i){return yy({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(i)})}))}}(r,s);if(s){var m=Object.keys(r).reduce((function(e,t){return t.split(".").forEach((function(t){e.includes(t)||e.push(t)})),e}),[]),g=l.className&&l.className.includes("token")?["token"]:[],v=l.className&&g.concat(l.className.filter((function(e){return!m.includes(e)})));p=py(py({},l),{},{className:vy(v)||void 0,style:gy(l.className,Object.assign({},l.style,o),r)})}else p=py(py({},l),{},{className:vy(l.className)});var y=f(n.children);return t(c).createElement(d,t(qv)({key:a},p),y)}}var by=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function Sy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xy(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Sy(Object(r),!0).forEach((function(n){t(Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sy(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _y=/\n/g;function wy(e){var n=e.codeString,r=e.codeStyle,i=e.containerStyle,o=void 0===i?{float:"left",paddingRight:"10px"}:i,s=e.numberStyle,a=void 0===s?{}:s,l=e.startingLineNumber;return t(c).createElement("code",{style:Object.assign({},r,o)},function(e){var n=e.lines,r=e.startingLineNumber,i=e.style;return n.map((function(e,n){var o=n+r;return t(c).createElement("span",{key:"line-".concat(n),className:"react-syntax-highlighter-line-number",style:"function"==typeof i?i(o):i},"".concat(o,"\n"))}))}({lines:n.replace(/\n$/,"").split("\n"),style:a,startingLineNumber:l}))}function Cy(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 Ay(e,t,n){var r,i={display:"inline-block",minWidth:(r=n,"".concat(r.toString().length,".25em")),paddingRight:"1em",textAlign:"right",userSelect:"none"},o="function"==typeof e?e(t):e;return xy(xy({},i),o)}function Ey(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,o=e.showInlineLineNumbers,s=e.lineProps,a=void 0===s?{}:s,l=e.className,c=void 0===l?[]:l,u=e.showLineNumbers,d=e.wrapLongLines,h="function"==typeof a?a(n):a;if(h.className=c,n&&o){var p=Ay(r,n,i);t.unshift(Cy(n,p))}return d&u&&(h.style=xy(xy({},h.style),{},{display:"flex"})),{type:"element",tagName:"span",properties:h,children:t}}function Ty(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=0;i<e.length;i++){var o=e[i];if("text"===o.type)r.push(Ey({children:[o],className:t(sy)(new Set(n))}));else if(o.children){var s=n.concat(o.properties.className);Ty(o.children,s).forEach((function(e){return r.push(e)}))}}return r}function My(e,t,n,r,i,o,s,a,l){var c,u=Ty(e.value),d=[],h=-1,p=0;function f(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Ey({children:e,lineNumber:t,lineNumberStyle:a,largestLineNumber:s,showInlineLineNumbers:i,lineProps:n,className:o,showLineNumbers:r,wrapLongLines:l})}function m(e,t){if(r&&t&&i){var n=Ay(a,t,s);e.unshift(Cy(t,n))}return e}function g(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?f(e,n,r):m(e,n)}for(var v=function(){var e=u[p],t=e.children[0].value;if(t.match(_y)){var n=t.split("\n");n.forEach((function(t,i){var s=r&&d.length+o,a={type:"text",value:"".concat(t,"\n")};if(0===i){var l=g(u.slice(h+1,p).concat(Ey({children:[a],className:e.properties.className})),s);d.push(l)}else if(i===n.length-1){var c=u[p+1]&&u[p+1].children&&u[p+1].children[0],f={type:"text",value:"".concat(t)};if(c){var m=Ey({children:[f],className:e.properties.className});u.splice(p+1,0,m)}else{var v=g([f],s,e.properties.className);d.push(v)}}else{var y=g([a],s,e.properties.className);d.push(y)}})),h=p}p++};p<u.length;)v();if(h!==u.length-1){var y=u.slice(h+1,u.length);if(y&&y.length){var b=g(y,r&&d.length+o);d.push(b)}}return t?d:(c=[]).concat.apply(c,d)}function Iy(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map((function(e,t){return yy({node:e,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(t)})}))}function Ry(e){return e&&void 0!==e.highlightAuto}function Py(e,n){return function(r){var i=r.language,o=r.children,s=r.style,a=void 0===s?n:s,l=r.customStyle,u=void 0===l?{}:l,d=r.codeTagProps,h=void 0===d?{className:i?"language-".concat(i):void 0,style:xy(xy({},a['code[class*="language-"]']),a['code[class*="language-'.concat(i,'"]')])}:d,p=r.useInlineStyles,f=void 0===p||p,m=r.showLineNumbers,g=void 0!==m&&m,v=r.showInlineLineNumbers,y=void 0===v||v,b=r.startingLineNumber,S=void 0===b?1:b,x=r.lineNumberContainerStyle,_=r.lineNumberStyle,w=void 0===_?{}:_,C=r.wrapLines,A=r.wrapLongLines,E=void 0!==A&&A,T=r.lineProps,M=void 0===T?{}:T,I=r.renderer,R=r.PreTag,P=void 0===R?"pre":R,k=r.CodeTag,O=void 0===k?"code":k,N=r.code,L=void 0===N?(Array.isArray(o)?o[0]:o)||"":N,D=r.astGenerator,B=t(iy)(r,by);D=D||e;var z=g?t(c).createElement(wy,{containerStyle:x,codeStyle:h.style||{},numberStyle:w,startingLineNumber:S,codeString:L}):null,F=a.hljs||a['pre[class*="language-"]']||{backgroundColor:"#fff"},U=Ry(D)?"hljs":"prismjs",j=f?Object.assign({},B,{style:Object.assign({},F,u)}):Object.assign({},B,{className:B.className?"".concat(U," ").concat(B.className):U,style:Object.assign({},u)});if(h.style=xy(xy({},h.style),{},E?{whiteSpace:"pre-wrap"}:{whiteSpace:"pre"}),!D)return t(c).createElement(P,j,z,t(c).createElement(O,h,L));(void 0===C&&I||E)&&(C=!0),I=I||Iy;var H=[{type:"text",value:L}],G=function(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(Ry(t)){var o=function(e,t){return-1!==e.listLanguages().indexOf(t)}(t,n);return"text"===n?{value:i,language:"text"}:o?t.highlight(n,r):t.highlightAuto(r)}try{return n&&"text"!==n?{value:t.highlight(r,n)}:{value:i}}catch(e){return{value:i}}}({astGenerator:D,language:i,code:L,defaultCodeValue:H});null===G.language&&(G.value=H);var V=My(G,C,M,g,y,S,G.value.length+S,w,E);return t(c).createElement(P,j,t(c).createElement(O,h,!y&&z,I({rows:V,stylesheet:a,useInlineStyles:f})))}}function ky(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=t(ey)(e);if(n){var o=t(ey)(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return t(Zv)(this,r)}}var Oy,Ny,Ly,Dy,By,zy,Fy,Uy=function(e,n){return function(){var r=t(Vv)(t(ny).mark((function r(i){var o;return t(ny).wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:o=t.sent,i(e,o.default||o);case 4:case"end":return t.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()},jy={abap:Uy("abap",(function(){return o("bwHpE")})),abnf:Uy("abnf",(function(){return o("daD87")})),actionscript:Uy("actionscript",(function(){return o("lpEgO")})),ada:Uy("ada",(function(){return o("1sGW9")})),agda:Uy("agda",(function(){return o("e9VyR")})),al:Uy("al",(function(){return o("kMFSe")})),antlr4:Uy("antlr4",(function(){return o("8HlsP")})),apacheconf:Uy("apacheconf",(function(){return o("isFCh")})),apex:Uy("apex",(function(){return o("gUXVM")})),apl:Uy("apl",(function(){return o("2L15v")})),applescript:Uy("applescript",(function(){return o("8XyFT")})),aql:Uy("aql",(function(){return o("gFWTI")})),arduino:Uy("arduino",(function(){return o("jI3VB")})),arff:Uy("arff",(function(){return o("6uYTH")})),asciidoc:Uy("asciidoc",(function(){return o("gdYKH")})),asm6502:Uy("asm6502",(function(){return o("ahFLg")})),asmatmel:Uy("asmatmel",(function(){return o("4irIu")})),aspnet:Uy("aspnet",(function(){return o("yDC6n")})),autohotkey:Uy("autohotkey",(function(){return o("a4xpy")})),autoit:Uy("autoit",(function(){return o("iNSix")})),avisynth:Uy("avisynth",(function(){return o("kEBnk")})),avroIdl:Uy("avroIdl",(function(){return o("lzthi")})),bash:Uy("bash",(function(){return Promise.resolve(o("3aDLI"))})),basic:Uy("basic",(function(){return o("cxDu6")})),batch:Uy("batch",(function(){return o("6zDll")})),bbcode:Uy("bbcode",(function(){return o("bPS87")})),bicep:Uy("bicep",(function(){return o("8dy5f")})),birb:Uy("birb",(function(){return o("3vHrY")})),bison:Uy("bison",(function(){return o("bCjBS")})),bnf:Uy("bnf",(function(){return o("4NqDW")})),brainfuck:Uy("brainfuck",(function(){return o("4s0KX")})),brightscript:Uy("brightscript",(function(){return o("jTsQ4")})),bro:Uy("bro",(function(){return o("5lMc2")})),bsl:Uy("bsl",(function(){return o("jBYxC")})),c:Uy("c",(function(){return Promise.resolve(o("lyZgY"))})),cfscript:Uy("cfscript",(function(){return o("coZDy")})),chaiscript:Uy("chaiscript",(function(){return o("e1zEN")})),cil:Uy("cil",(function(){return o("crKoM")})),clike:Uy("clike",(function(){return o("4kO9t")})),clojure:Uy("clojure",(function(){return o("01SpB")})),cmake:Uy("cmake",(function(){return o("9yG4p")})),cobol:Uy("cobol",(function(){return o("967Hn")})),coffeescript:Uy("coffeescript",(function(){return o("7Yi6H")})),concurnas:Uy("concurnas",(function(){return o("5tXmX")})),coq:Uy("coq",(function(){return o("ektdr")})),cpp:Uy("cpp",(function(){return Promise.resolve(o("lR39A"))})),crystal:Uy("crystal",(function(){return o("8gt4L")})),csharp:Uy("csharp",(function(){return o("7K6eJ")})),cshtml:Uy("cshtml",(function(){return o("cVu4i")})),csp:Uy("csp",(function(){return o("ecKo1")})),cssExtras:Uy("cssExtras",(function(){return o("gnpv8")})),css:Uy("css",(function(){return o("jx0H8")})),csv:Uy("csv",(function(){return o("f9kmW")})),cypher:Uy("cypher",(function(){return o("lojor")})),d:Uy("d",(function(){return o("6Qa0U")})),dart:Uy("dart",(function(){return o("74K1B")})),dataweave:Uy("dataweave",(function(){return o("93H6c")})),dax:Uy("dax",(function(){return o("cf9Y9")})),dhall:Uy("dhall",(function(){return o("f6UWv")})),diff:Uy("diff",(function(){return o("klPVo")})),django:Uy("django",(function(){return o("jfxe9")})),dnsZoneFile:Uy("dnsZoneFile",(function(){return o("5aMz5")})),docker:Uy("docker",(function(){return o("kOauC")})),dot:Uy("dot",(function(){return o("btE6k")})),ebnf:Uy("ebnf",(function(){return o("aT88c")})),editorconfig:Uy("editorconfig",(function(){return o("jWOl8")})),eiffel:Uy("eiffel",(function(){return o("kHJaX")})),ejs:Uy("ejs",(function(){return o("frfnA")})),elixir:Uy("elixir",(function(){return o("hcrJ2")})),elm:Uy("elm",(function(){return o("jd271")})),erb:Uy("erb",(function(){return o("gczXL")})),erlang:Uy("erlang",(function(){return o("FsabW")})),etlua:Uy("etlua",(function(){return o("9DI9l")})),excelFormula:Uy("excelFormula",(function(){return o("3QVue")})),factor:Uy("factor",(function(){return o("ltNCT")})),falselang:Uy("falselang",(function(){return o("g0Q6p")})),firestoreSecurityRules:Uy("firestoreSecurityRules",(function(){return o("ukA2V")})),flow:Uy("flow",(function(){return o("e5prn")})),fortran:Uy("fortran",(function(){return o("gIEL6")})),fsharp:Uy("fsharp",(function(){return o("3wQkt")})),ftl:Uy("ftl",(function(){return o("7ZVWs")})),gap:Uy("gap",(function(){return o("hOFj6")})),gcode:Uy("gcode",(function(){return o("95BzQ")})),gdscript:Uy("gdscript",(function(){return o("iul6t")})),gedcom:Uy("gedcom",(function(){return o("e0qJM")})),gherkin:Uy("gherkin",(function(){return o("2SHak")})),git:Uy("git",(function(){return o("l6VFH")})),glsl:Uy("glsl",(function(){return o("cEMfJ")})),gml:Uy("gml",(function(){return o("8UVTr")})),gn:Uy("gn",(function(){return o("kvibD")})),goModule:Uy("goModule",(function(){return o("icqjF")})),go:Uy("go",(function(){return o("jLkg8")})),graphql:Uy("graphql",(function(){return o("aYGNi")})),groovy:Uy("groovy",(function(){return o("4bTmH")})),haml:Uy("haml",(function(){return o("h2A6V")})),handlebars:Uy("handlebars",(function(){return o("79YVJ")})),haskell:Uy("haskell",(function(){return o("bsiLW")})),haxe:Uy("haxe",(function(){return o("94Kdj")})),hcl:Uy("hcl",(function(){return o("9CheR")})),hlsl:Uy("hlsl",(function(){return o("h3dqW")})),hoon:Uy("hoon",(function(){return o("9WbsW")})),hpkp:Uy("hpkp",(function(){return o("GiPN3")})),hsts:Uy("hsts",(function(){return o("eaSn9")})),http:Uy("http",(function(){return o("1uj7b")})),ichigojam:Uy("ichigojam",(function(){return o("ge562")})),icon:Uy("icon",(function(){return o("lVHUf")})),icuMessageFormat:Uy("icuMessageFormat",(function(){return o("aYoUL")})),idris:Uy("idris",(function(){return o("1RVAE")})),iecst:Uy("iecst",(function(){return o("bi7Dr")})),ignore:Uy("ignore",(function(){return o("cq0Pi")})),inform7:Uy("inform7",(function(){return o("31K4E")})),ini:Uy("ini",(function(){return o("l05OZ")})),io:Uy("io",(function(){return o("6bY1b")})),j:Uy("j",(function(){return o("1ebDS")})),java:Uy("java",(function(){return o("iEZZI")})),javadoc:Uy("javadoc",(function(){return o("aHy5a")})),javadoclike:Uy("javadoclike",(function(){return o("5f3rE")})),javascript:Uy("javascript",(function(){return o("7JDFI")})),javastacktrace:Uy("javastacktrace",(function(){return o("gdCGE")})),jexl:Uy("jexl",(function(){return o("cqMb9")})),jolie:Uy("jolie",(function(){return o("cEDX4")})),jq:Uy("jq",(function(){return o("kEWsh")})),jsExtras:Uy("jsExtras",(function(){return o("74PI8")})),jsTemplates:Uy("jsTemplates",(function(){return o("30TPr")})),jsdoc:Uy("jsdoc",(function(){return o("9DH5c")})),json:Uy("json",(function(){return Promise.resolve(o("l1Rj1"))})),json5:Uy("json5",(function(){return o("920rv")})),jsonp:Uy("jsonp",(function(){return o("9AwS1")})),jsstacktrace:Uy("jsstacktrace",(function(){return o("bYXMr")})),jsx:Uy("jsx",(function(){return Promise.resolve(o("6ho3O"))})),julia:Uy("julia",(function(){return o("g0ibH")})),keepalived:Uy("keepalived",(function(){return o("2hdnH")})),keyman:Uy("keyman",(function(){return o("cIufI")})),kotlin:Uy("kotlin",(function(){return o("c26dU")})),kumir:Uy("kumir",(function(){return o("iYAha")})),kusto:Uy("kusto",(function(){return o("9z1oX")})),latex:Uy("latex",(function(){return o("lCPLU")})),latte:Uy("latte",(function(){return o("c9oN0")})),less:Uy("less",(function(){return o("hA3V9")})),lilypond:Uy("lilypond",(function(){return o("hpHTA")})),liquid:Uy("liquid",(function(){return o("kpZTm")})),lisp:Uy("lisp",(function(){return o("chgK5")})),livescript:Uy("livescript",(function(){return o("2gdiv")})),llvm:Uy("llvm",(function(){return o("jUeFO")})),log:Uy("log",(function(){return o("3BFSQ")})),lolcode:Uy("lolcode",(function(){return o("lG9br")})),lua:Uy("lua",(function(){return o("cVGpd")})),magma:Uy("magma",(function(){return o("4LVzY")})),makefile:Uy("makefile",(function(){return o("2NviD")})),markdown:Uy("markdown",(function(){return o("jUFCF")})),markupTemplating:Uy("markupTemplating",(function(){return Promise.resolve(o("t3W0d"))})),markup:Uy("markup",(function(){return o("5hIXu")})),matlab:Uy("matlab",(function(){return o("kPAC0")})),maxscript:Uy("maxscript",(function(){return o("gHOJy")})),mel:Uy("mel",(function(){return o("9mj6e")})),mermaid:Uy("mermaid",(function(){return o("kozw5")})),mizar:Uy("mizar",(function(){return o("2bN6W")})),mongodb:Uy("mongodb",(function(){return o("eHKWX")})),monkey:Uy("monkey",(function(){return o("7Fh0C")})),moonscript:Uy("moonscript",(function(){return o("hDXwC")})),n1ql:Uy("n1ql",(function(){return o("j9bkC")})),n4js:Uy("n4js",(function(){return o("eTmBF")})),nand2tetrisHdl:Uy("nand2tetrisHdl",(function(){return o("ezjCf")})),naniscript:Uy("naniscript",(function(){return o("VxHk1")})),nasm:Uy("nasm",(function(){return o("ly95T")})),neon:Uy("neon",(function(){return o("7Fk34")})),nevod:Uy("nevod",(function(){return o("3U8Qv")})),nginx:Uy("nginx",(function(){return o("c6qVk")})),nim:Uy("nim",(function(){return o("1JdCk")})),nix:Uy("nix",(function(){return o("jcstS")})),nsis:Uy("nsis",(function(){return o("kEJqW")})),objectivec:Uy("objectivec",(function(){return o("lUP8A")})),ocaml:Uy("ocaml",(function(){return o("lhTAD")})),opencl:Uy("opencl",(function(){return o("8rxKO")})),openqasm:Uy("openqasm",(function(){return o("ib0uL")})),oz:Uy("oz",(function(){return o("csCUS")})),parigp:Uy("parigp",(function(){return o("2DkHE")})),parser:Uy("parser",(function(){return o("2cp75")})),pascal:Uy("pascal",(function(){return o("fViVl")})),pascaligo:Uy("pascaligo",(function(){return o("9Uuxa")})),pcaxis:Uy("pcaxis",(function(){return o("jUdnN")})),peoplecode:Uy("peoplecode",(function(){return o("l8w4e")})),perl:Uy("perl",(function(){return o("aX7dM")})),phpExtras:Uy("phpExtras",(function(){return o("3cMZl")})),php:Uy("php",(function(){return Promise.resolve(o("5li5P"))})),phpdoc:Uy("phpdoc",(function(){return o("bDyJN")})),plsql:Uy("plsql",(function(){return o("cPuMN")})),powerquery:Uy("powerquery",(function(){return o("jE1gU")})),powershell:Uy("powershell",(function(){return o("k7t0j")})),processing:Uy("processing",(function(){return o("jr8hV")})),prolog:Uy("prolog",(function(){return o("hpuat")})),promql:Uy("promql",(function(){return o("ckXC5")})),properties:Uy("properties",(function(){return o("fAh6P")})),protobuf:Uy("protobuf",(function(){return o("R6WqB")})),psl:Uy("psl",(function(){return o("Al65w")})),pug:Uy("pug",(function(){return o("dxbNS")})),puppet:Uy("puppet",(function(){return o("lrSuh")})),pure:Uy("pure",(function(){return o("6DKQK")})),purebasic:Uy("purebasic",(function(){return o("7ZkSb")})),purescript:Uy("purescript",(function(){return o("dBTYx")})),python:Uy("python",(function(){return Promise.resolve(o("kiy5M"))})),q:Uy("q",(function(){return o("4FXyy")})),qml:Uy("qml",(function(){return o("2zZFj")})),qore:Uy("qore",(function(){return o("iCK1Y")})),qsharp:Uy("qsharp",(function(){return o("dvH9H")})),r:Uy("r",(function(){return o("lQqRt")})),racket:Uy("racket",(function(){return o("eHKmq")})),reason:Uy("reason",(function(){return o("kkeLT")})),regex:Uy("regex",(function(){return o("llX50")})),rego:Uy("rego",(function(){return o("9hKdZ")})),renpy:Uy("renpy",(function(){return o("cJgw5")})),rest:Uy("rest",(function(){return o("867DK")})),rip:Uy("rip",(function(){return o("3Odjx")})),roboconf:Uy("roboconf",(function(){return o("gQ0Us")})),robotframework:Uy("robotframework",(function(){return o("bLCgx")})),ruby:Uy("ruby",(function(){return Promise.resolve(o("ch1PX"))})),rust:Uy("rust",(function(){return o("cInT8")})),sas:Uy("sas",(function(){return o("iz7eP")})),sass:Uy("sass",(function(){return o("hrDC3")})),scala:Uy("scala",(function(){return o("ub8Bf")})),scheme:Uy("scheme",(function(){return o("7NAAt")})),scss:Uy("scss",(function(){return Promise.resolve(o("fU6a0"))})),shellSession:Uy("shellSession",(function(){return o("7kKCv")})),smali:Uy("smali",(function(){return o("2lkCb")})),smalltalk:Uy("smalltalk",(function(){return o("4280y")})),smarty:Uy("smarty",(function(){return o("4hXYK")})),sml:Uy("sml",(function(){return o("jh2E8")})),solidity:Uy("solidity",(function(){return o("dTdF2")})),solutionFile:Uy("solutionFile",(function(){return o("iI5tm")})),soy:Uy("soy",(function(){return o("aoU5C")})),sparql:Uy("sparql",(function(){return o("ggrvb")})),splunkSpl:Uy("splunkSpl",(function(){return o("8LhCX")})),sqf:Uy("sqf",(function(){return o("3tDsu")})),sql:Uy("sql",(function(){return Promise.resolve(o("bnDV9"))})),squirrel:Uy("squirrel",(function(){return o("bxaUV")})),stan:Uy("stan",(function(){return o("dBqrq")})),stylus:Uy("stylus",(function(){return o("JlHVK")})),swift:Uy("swift",(function(){return o("c7NBs")})),systemd:Uy("systemd",(function(){return o("jprZl")})),t4Cs:Uy("t4Cs",(function(){return o("edsMI")})),t4Templating:Uy("t4Templating",(function(){return o("bS9Wa")})),t4Vb:Uy("t4Vb",(function(){return o("gYk20")})),tap:Uy("tap",(function(){return o("byv7d")})),tcl:Uy("tcl",(function(){return o("lUAIZ")})),textile:Uy("textile",(function(){return o("7J2LO")})),toml:Uy("toml",(function(){return o("eXtdM")})),tremor:Uy("tremor",(function(){return o("vyajH")})),tsx:Uy("tsx",(function(){return Promise.resolve(o("7cTnl"))})),tt2:Uy("tt2",(function(){return o("8XOOm")})),turtle:Uy("turtle",(function(){return o("1XvLQ")})),twig:Uy("twig",(function(){return o("i9Fpp")})),typescript:Uy("typescript",(function(){return Promise.resolve(o("fzL8k"))})),typoscript:Uy("typoscript",(function(){return o("kKk69")})),unrealscript:Uy("unrealscript",(function(){return o("jgq8Y")})),uorazor:Uy("uorazor",(function(){return o("dsZ00")})),uri:Uy("uri",(function(){return o("fqJRp")})),v:Uy("v",(function(){return o("bgfyB")})),vala:Uy("vala",(function(){return o("68x4q")})),vbnet:Uy("vbnet",(function(){return o("eUhQs")})),velocity:Uy("velocity",(function(){return o("fPNdV")})),verilog:Uy("verilog",(function(){return o("2fM1V")})),vhdl:Uy("vhdl",(function(){return o("hNF6q")})),vim:Uy("vim",(function(){return o("75TCr")})),visualBasic:Uy("visualBasic",(function(){return o("fc93z")})),warpscript:Uy("warpscript",(function(){return o("jgHlG")})),wasm:Uy("wasm",(function(){return o("dVZkI")})),webIdl:Uy("webIdl",(function(){return o("9Jnxv")})),wiki:Uy("wiki",(function(){return o("1Gimo")})),wolfram:Uy("wolfram",(function(){return o("4SyRT")})),wren:Uy("wren",(function(){return o("gaIVs")})),xeora:Uy("xeora",(function(){return o("lagad")})),xmlDoc:Uy("xmlDoc",(function(){return o("9DNYE")})),xojo:Uy("xojo",(function(){return o("ksF4f")})),xquery:Uy("xquery",(function(){return o("gXxHJ")})),yaml:Uy("yaml",(function(){return o("6rk3j")})),yang:Uy("yang",(function(){return o("kTyrQ")})),zig:Uy("zig",(function(){return o("d3mFC")}))},Hy=(Ny=(Oy={loader:function(){return o("bB2YF").then((function(e){return e.default||e}))},isLanguageRegistered:function(e,t){return e.registered(t)},languageLoaders:jy,registerLanguage:function(e,t,n){return e.register(n)}}).loader,Ly=Oy.isLanguageRegistered,Dy=Oy.registerLanguage,By=Oy.languageLoaders,zy=Oy.noAsyncLoadingLanguages,Fy=function(e){t(Jv)(i,e);var n,r=ky(i);function i(){return t($)(this,i),r.apply(this,arguments)}return t(ee)(i,[{key:"componentDidUpdate",value:function(){!i.isRegistered(this.props.language)&&By&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var e=this;i.astGeneratorPromise||i.loadAstGenerator(),i.astGenerator||i.astGeneratorPromise.then((function(){e.forceUpdate()})),!i.isRegistered(this.props.language)&&By&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var e=this,t=this.props.language;"text"!==t&&i.loadLanguage(t).then((function(){return e.forceUpdate()})).catch((function(){}))}},{key:"normalizeLanguage",value:function(e){return i.isSupportedLanguage(e)?e:"text"}},{key:"render",value:function(){return t(c).createElement(i.highlightInstance,t(qv)({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:i.astGenerator}))}}],[{key:"preload",value:function(){return i.loadAstGenerator()}},{key:"loadLanguage",value:(n=t(Vv)(t(ny).mark((function e(n){var r;return t(ny).wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(r=By[n])){e.next=5;break}return e.abrupt("return",r(i.registerLanguage));case 5:throw new Error("Language ".concat(n," not supported"));case 6:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"isSupportedLanguage",value:function(e){return i.isRegistered(e)||"function"==typeof By[e]}},{key:"loadAstGenerator",value:function(){return i.astGeneratorPromise=Ny().then((function(e){i.astGenerator=e,Dy&&i.languages.forEach((function(t,n){return Dy(e,n,t)}))})),i.astGeneratorPromise}}]),i}(t(c).PureComponent),t(Z)(Fy,"astGenerator",null),t(Z)(Fy,"highlightInstance",Py(null,{})),t(Z)(Fy,"astGeneratorPromise",null),t(Z)(Fy,"languages",new Map),t(Z)(Fy,"supportedLanguages",Oy.supportedLanguages||Object.keys(By||{})),t(Z)(Fy,"isRegistered",(function(e){if(zy)return!0;if(!Dy)throw new Error("Current syntax highlighter doesn't support registration of languages");return Fy.astGenerator?Ly(Fy.astGenerator,e):Fy.languages.has(e)})),t(Z)(Fy,"registerLanguage",(function(e,t){if(!Dy)throw new Error("Current syntax highlighter doesn't support registration of languages");if(Fy.astGenerator)return Dy(Fy.astGenerator,e,t);Fy.languages.set(e,t)})),Fy),Gy={},Vy={};(Vy=function(e){return e&&e.__esModule?e:{default:e}}).__esModule=!0,Vy.default=Vy,Object.defineProperty(Gy,"__esModule",{value:!0}),Object.defineProperty(Gy,"a11yDark",{enumerable:!0,get:function(){return $y.default}}),Object.defineProperty(Gy,"atomDark",{enumerable:!0,get:function(){return eb.default}}),Object.defineProperty(Gy,"base16AteliersulphurpoolLight",{enumerable:!0,get:function(){return tb.default}}),Object.defineProperty(Gy,"cb",{enumerable:!0,get:function(){return nb.default}}),Object.defineProperty(Gy,"coldarkCold",{enumerable:!0,get:function(){return rb.default}}),Object.defineProperty(Gy,"coldarkDark",{enumerable:!0,get:function(){return ib.default}}),Object.defineProperty(Gy,"coy",{enumerable:!0,get:function(){return Wy.default}}),Object.defineProperty(Gy,"coyWithoutShadows",{enumerable:!0,get:function(){return ob.default}}),Object.defineProperty(Gy,"darcula",{enumerable:!0,get:function(){return sb.default}}),Object.defineProperty(Gy,"dark",{enumerable:!0,get:function(){return qy.default}}),Object.defineProperty(Gy,"dracula",{enumerable:!0,get:function(){return ab.default}}),Object.defineProperty(Gy,"duotoneDark",{enumerable:!0,get:function(){return lb.default}}),Object.defineProperty(Gy,"duotoneEarth",{enumerable:!0,get:function(){return cb.default}}),Object.defineProperty(Gy,"duotoneForest",{enumerable:!0,get:function(){return ub.default}}),Object.defineProperty(Gy,"duotoneLight",{enumerable:!0,get:function(){return db.default}}),Object.defineProperty(Gy,"duotoneSea",{enumerable:!0,get:function(){return hb.default}}),Object.defineProperty(Gy,"duotoneSpace",{enumerable:!0,get:function(){return pb.default}}),Object.defineProperty(Gy,"funky",{enumerable:!0,get:function(){return Ky.default}}),Object.defineProperty(Gy,"ghcolors",{enumerable:!0,get:function(){return fb.default}}),Object.defineProperty(Gy,"gruvboxDark",{enumerable:!0,get:function(){return mb.default}}),Object.defineProperty(Gy,"gruvboxLight",{enumerable:!0,get:function(){return gb.default}}),Object.defineProperty(Gy,"holiTheme",{enumerable:!0,get:function(){return vb.default}}),Object.defineProperty(Gy,"hopscotch",{enumerable:!0,get:function(){return yb.default}}),Object.defineProperty(Gy,"lucario",{enumerable:!0,get:function(){return bb.default}}),Object.defineProperty(Gy,"materialDark",{enumerable:!0,get:function(){return Sb.default}}),Object.defineProperty(Gy,"materialLight",{enumerable:!0,get:function(){return xb.default}}),Object.defineProperty(Gy,"materialOceanic",{enumerable:!0,get:function(){return _b.default}}),Object.defineProperty(Gy,"nightOwl",{enumerable:!0,get:function(){return wb.default}}),Object.defineProperty(Gy,"nord",{enumerable:!0,get:function(){return Cb.default}}),Object.defineProperty(Gy,"okaidia",{enumerable:!0,get:function(){return Jy.default}}),Object.defineProperty(Gy,"oneDark",{enumerable:!0,get:function(){return Ab.default}}),Object.defineProperty(Gy,"oneLight",{enumerable:!0,get:function(){return Eb.default}}),Object.defineProperty(Gy,"pojoaque",{enumerable:!0,get:function(){return Tb.default}}),Object.defineProperty(Gy,"prism",{enumerable:!0,get:function(){return Xy.default}}),Object.defineProperty(Gy,"shadesOfPurple",{enumerable:!0,get:function(){return Mb.default}}),Object.defineProperty(Gy,"solarizedDarkAtom",{enumerable:!0,get:function(){return Ib.default}}),Object.defineProperty(Gy,"solarizedlight",{enumerable:!0,get:function(){return Qy.default}}),Object.defineProperty(Gy,"synthwave84",{enumerable:!0,get:function(){return Rb.default}}),Object.defineProperty(Gy,"tomorrow",{enumerable:!0,get:function(){return Yy.default}}),Object.defineProperty(Gy,"twilight",{enumerable:!0,get:function(){return Zy.default}}),Object.defineProperty(Gy,"vs",{enumerable:!0,get:function(){return Pb.default}}),Object.defineProperty(Gy,"vscDarkPlus",{enumerable:!0,get:function(){return kb.default}}),Object.defineProperty(Gy,"xonokai",{enumerable:!0,get:function(){return Ob.default}}),Object.defineProperty(Gy,"zTouch",{enumerable:!0,get:function(){return Nb.default}});var Wy=Vy(o("jcF8U")),qy=Vy(o("3Tppx")),Ky=Vy(o("dBuK7")),Jy=Vy(o("eEjWK")),Qy=Vy(o("awG2g")),Yy=Vy(o("2oFzQ")),Zy=Vy(o("4Au6Q")),Xy=Vy(o("dAPqs")),$y=Vy(o("8eAql")),eb=Vy(o("cv2QE")),tb=Vy(o("h5I9g")),nb=Vy(o("i4C5w")),rb=Vy(o("3kFKo")),ib=Vy(o("17zK0")),ob=Vy(o("5Avqr")),sb=Vy(o("1jHMv")),ab=Vy(o("7Q8CE")),lb=Vy(o("jKUos")),cb=Vy(o("Uzm4J")),ub=Vy(o("7yfkN")),db=Vy(o("lT2l1")),hb=Vy(o("fZ9um")),pb=Vy(o("1MoQL")),fb=Vy(o("4uys7")),mb=Vy(o("kaYsk")),gb=Vy(o("kN6Vu")),vb=Vy(o("2Z6pG")),yb=Vy(o("4jQJK")),bb=Vy(o("bpXw0")),Sb=Vy(o("i4S8s")),xb=Vy(o("5bNr4")),_b=Vy(o("5ZYWT")),wb=Vy(o("ihJCU")),Cb=Vy(o("8iIbg")),Ab=Vy(o("424u7")),Eb=Vy(o("jPiNI")),Tb=Vy(o("OHVOA")),Mb=Vy(o("2OKTL")),Ib=Vy(o("2Mg8H")),Rb=Vy(o("9Kud0")),Pb=Vy(o("eCrmR")),kb=Vy(o("8UhcQ")),Ob=Vy(o("dtU9z")),Nb=Vy(o("4xtLO")),Lb={};Object.defineProperty(Lb,"__esModule",{value:!0}),Lb.default=void 0;var Db=Vy(o("7cTnl")).default;Lb.default=Db;var Bb={};Object.defineProperty(Bb,"__esModule",{value:!0}),Bb.default=void 0;var zb=Vy(o("l1Rj1")).default;Bb.default=zb;var Fb={};Object.defineProperty(Fb,"__esModule",{value:!0}),Fb.default=void 0;var Ub=Vy(o("fU6a0")).default;Fb.default=Ub;var jb={};Object.defineProperty(jb,"__esModule",{value:!0}),jb.default=void 0;var Hb=Vy(o("3aDLI")).default;jb.default=Hb;var Gb={};Object.defineProperty(Gb,"__esModule",{value:!0}),Gb.default=void 0;var Vb=Vy(o("kiy5M")).default;Gb.default=Vb;var Wb={};Object.defineProperty(Wb,"__esModule",{value:!0}),Wb.default=void 0;var qb=Vy(o("lR39A")).default;Wb.default=qb;var Kb={};Object.defineProperty(Kb,"__esModule",{value:!0}),Kb.default=void 0;var Jb=Vy(o("5li5P")).default;Kb.default=Jb;var Qb={};Object.defineProperty(Qb,"__esModule",{value:!0}),Qb.default=void 0;var Yb=Vy(o("ch1PX")).default;Qb.default=Yb;var Zb={};Object.defineProperty(Zb,"__esModule",{value:!0}),Zb.default=void 0;var Xb=Vy(o("bnDV9")).default;Zb.default=Xb,Hy.registerLanguage("tsx",t(Lb)),Hy.registerLanguage("json",t(Bb)),Hy.registerLanguage("scss",t(Fb)),Hy.registerLanguage("bash",t(jb)),Hy.registerLanguage("python",t(Gb)),Hy.registerLanguage("cpp",t(Wb)),Hy.registerLanguage("php",t(Kb)),Hy.registerLanguage("ruby",t(Qb)),Hy.registerLanguage("sql",t(Zb));var $b=({medium:e,className:t,preview:n=!1,showLineNumbers:r=!0,showCopyButton:i=!0})=>{var o,a,l,c;const{t:u}=Se();return(0,s.jsxs)("div",{className:"memori-snippet",children:[(0,s.jsxs)("div",{className:"memori-snippet--content",children:[(0,s.jsx)(Hy,{"aria-labelledby":`#snippet-${e.mediumID}`,className:t,style:Gy.atomDark,showLineNumbers:r,language:null!==(a=null===(o=Hv.find((t=>e.mimeType===t.mimeType)))||void 0===o?void 0:o.lang)&&void 0!==a?a:"text",children:(null===(l=e.content)||void 0===l?void 0:l.length)&&e.content.length>200&&n?`${e.content.slice(0,200)}\n...`:`${e.content}`}),i&&(0,s.jsx)(Sf,{padded:!1,ghost:!0,className:"memori-snippet--copy-button",title:u("copy")||"Copy",icon:(0,s.jsx)(Fv,{}),onClick:()=>{var t;return navigator.clipboard.writeText(null!==(t=e.content)&&void 0!==t?t:"")}})]}),!!(null===(c=e.title)||void 0===c?void 0:c.length)&&(0,s.jsx)("p",{id:`snippet-${e.mediumID}`,className:"memori-snippet--caption",children:e.title})]})};c=o("85Hg2"),c=o("85Hg2");var eS,tS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})}),nS={};eS=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=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};function n(e,n){var r=e.el,i=e.elStyle,o=e.elHeight,s=e.rowsLimit,a=e.rowsWrapped,l=e.options,c=e.buffer,u=c;if(a===s+1)return t({},e);var d=c,h=a,p=o;return r.innerHTML=u=c.length?""+c+l.delimiter+n+l.replaceStr:""+n+l.replaceStr,parseFloat(i.height)>parseFloat(o)&&(h++,p=i.height,h===s+1)?(r.innerHTML=u="."===d[d.length-1]&&"..."===l.replaceStr?d+"..":""+d+l.replaceStr,t({},e,{elHeight:p,rowsWrapped:h})):(r.innerHTML=u=d.length?""+d+l.delimiter+n:""+n,t({},e,{buffer:u,elHeight:p,rowsWrapped:h}))}e.disableResponsive=function(e){window.removeEventListener("resize",e)},e.ellipsis=function e(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s={replaceStr:"...",responsive:!1,debounceDelay:250,delimiter:" "},a=t({},s,o),l=r&&(r instanceof NodeList?r:1===r.nodeType?[r]:document.querySelectorAll(r)),c=[],u=0;u<l.length;u++){var d=l[u];c[u]=d.innerHTML;var h=d.innerHTML.split(a.delimiter);d.innerHTML="";var p=window.getComputedStyle(d);h.reduce(n,{el:d,buffer:d.innerHTML,elStyle:p,elHeight:0,rowsLimit:i,rowsWrapped:0,options:a})}if(a.responsive){var f=!1,m=window.innerWidth,g=function(){if(window.innerWidth!==m){m=window.innerWidth;for(var n=0;n<l.length;n++)l[n].innerHTML=c[n];e(r,i,t({},o,{responsive:!1}))}},v=function(){clearTimeout(f),f=setTimeout(g,a.debounceDelay)};return window.addEventListener("resize",v),v}}},"function"==typeof define&&define.amd?define(["exports"],eS):eS(nS);var rS=({loading:e=!1,className:n,title:r,description:i,cover:o,hoverable:a=!1,children:l})=>(0,s.jsx)("div",{className:t(xs)("memori-card",n,{"memori-card--loading":e,"memori-card--with-cover":o,"memori-card--hoverable":a}),children:(0,s.jsxs)(bf,{spinning:e,children:[o&&(0,s.jsx)("div",{className:"memori-card--cover",children:o}),(0,s.jsxs)("div",{className:"memori-card--content",children:[r&&(0,s.jsx)("h3",{className:"memori-card--title",children:r}),i&&(0,s.jsx)("p",{className:"memori-card--description",children:i}),(0,s.jsx)("div",{className:"memori-card--children",children:l})]})]})});const iS=({isChild:e=!1,item:n,baseUrl:r,onLinkPreviewInfo:i,descriptionOneLine:o=!1})=>{var a,l,u,d;const[h,p]=(0,c.useState)(null),f=(null===(a=n.url)||void 0===a?void 0:a.startsWith("http"))||!n.url||0===(null===(l=n.url)||void 0===l?void 0:l.length)?n.url:`https://${n.url}`;(0,c.useEffect)((()=>{var e,t;let o=(null===(e=n.url)||void 0===e?void 0:e.startsWith("http"))||!n.url||0===(null===(t=n.url)||void 0===t?void 0:t.length)?n.url:`https://${n.url}`;o&&o!==(null==h?void 0:h.urlKey)&&(async(e,t)=>{try{const n=await fetch(`${t||"https://aisuru.com"}/api/linkpreview/${encodeURIComponent(e)}`);return await n.json()}catch(e){return console.error("getSiteInfo",e),null}})(o,r).then((e=>{p(e?{...e,urlKey:o}:null),i&&e&&i(e)}))}),[null==n?void 0:n.url,r,i]);const m=n.title&&n.title.length>0?n.title:null==h?void 0:h.title,g=null==h?void 0:h.description,v=null==h?void 0:h.video,y=null!==(u=null==h?void 0:h.image)&&void 0!==u?u:null===(d=null==h?void 0:h.images)||void 0===d?void 0:d[0];return(0,c.useEffect)((()=>{setTimeout((()=>{(0,nS.ellipsis)(".memori-link-item--card .memori-card--description",3,{responsive:!0})}),300)}),[g,n.mediumID]),(0,s.jsx)("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:t(xs)("memori-link-item--link",{"memori-link-item--link--child":e}),onClick:t=>{e||(t.preventDefault(),t.stopPropagation(),window.open(f,"_blank",`toolbar=yes,top=${.1*window.innerHeight},left=${.1*window.innerWidth},width=${.8*window.innerWidth},height=${.8*window.innerHeight}`))},children:(0,s.jsx)(rS,{hoverable:!0,className:t(xs)("memori-link-item--card",{"memori-link-item--card-description-oneline":o,"memori-link-item--card-has-image":y,"memori-link-item--card-has-video":v}),cover:v?(0,s.jsx)("iframe",{width:"100%",height:"100%",src:v,title:"Video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):y?(0,s.jsx)("img",{className:"memori-link-item--card-cover-img",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==",srcSet:y.includes("data:image")?void 0:y.startsWith("https")?y:`https://${y.replace("http://","")}`,alt:n.title}):(0,s.jsx)("div",{className:"memori-link-item--card-cover-icon",children:(0,s.jsx)(tS,{className:"memori-link-item--icon"})}),title:m,description:g})})};var oS=({items:e,baseUrl:t,descriptionOneLine:n=!1,onLinkPreviewInfo:r})=>(0,s.jsx)(tp,{appear:!0,show:!0,as:"div",className:"memori-link-items",children:(0,s.jsx)("div",{className:"memori-link-items--grid",children:e.map(((e,i)=>(0,s.jsx)(tp.Child,{as:"div",className:"memori-link-item",enter:"ease-out duration-500 delay-"+100*i,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsx)(iS,{item:e,baseUrl:t,descriptionOneLine:n,onLinkPreviewInfo:r})},e.mediumID)))})});c=o("85Hg2");const sS=["va bene","no grazie","si","no","sì","arrivederci","non c'entrava","non mi è piaciuto"],aS=async(e,t,n,r)=>{var i;const o=sS.indexOf(e.toLowerCase())>-1?"IT":null==n?void 0:n.toUpperCase(),s=await fetch(`${r||"https://aisuru.com"}/api/translate?text=${encodeURIComponent(e)}&target_lang=${t.toUpperCase()}${o?`&source_lang=${o}`:""}`,{method:"GET",headers:{Accept:"*/*"}}),a=await s.json();return null===(i=null==a?void 0:a.translations)||void 0===i?void 0:i[0]};c=o("85Hg2");var lS=({src:e,poster:t,alt:n=""})=>((0,c.useEffect)((()=>{const e=document.createElement("script");return e.src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js",e.type="module",document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]),(0,s.jsx)("div",{className:"model-viewer",children:(0,s.jsx)("model-viewer",{src:e,"ios-src":"",poster:t,alt:n,"shadow-intensity":"1","disable-zoom":!0,"camera-controls":!0,autoplay:!0})}));var cS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});var uS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7-3.8-21.3-19.5-29.6-32.9-30.2-15.8-.7-29.9 8.3-33.4 21.4-6.6 24-.7 56.8 10.1 98.6-13.6 32.4-35.3 79.5-51.2 107.5-29.6 15.3-69.3 38.9-75.2 68.7-1.2 5.5.2 12.5 3.5 18.8 3.7 7 9.6 12.4 16.5 15 3 1.1 6.6 2 10.8 2 17.6 0 46.1-14.2 84.1-79.4 5.8-1.9 11.8-3.9 17.6-5.9 27.2-9.2 55.4-18.8 80.9-23.1 28.2 15.1 60.3 24.8 82.1 24.8 21.6 0 30.1-12.8 33.3-20.5 5.6-13.5 2.9-30.5-6.2-39.6-13.2-13-45.3-16.4-95.3-10.2-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7 6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4-4.9-19.9-5.6-48.1-2.7-51.4.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2-21.6 4.9-41.3 13-58.9 20.2-4.2 1.7-8.3 3.4-12.3 5 13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6 40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});var dS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0 0 10.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 0 0-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"})});var hS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 0 0-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 0 0-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"})});const pS=({isChild:e=!1,item:t,sessionID:n,tenantID:r,preview:i=!1,baseURL:o,apiURL:a,onClick:l,customMediaRenderer:c})=>{var u,d;const h=lv({resourceURI:t.url,sessionID:n,tenantID:r,baseURL:o,apiURL:a}),p=null==c?void 0:c(t.mimeType);if(p)return p;const f=(null===(u=t.url)||void 0===u?void 0:u.startsWith("rgb("))||(null===(d=t.url)||void 0===d?void 0:d.startsWith("rgba("));switch(t.mimeType){case"image/jpeg":case"image/png":case"image/jpg":case"image/gif":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,onClick:n=>{e&&n.preventDefault(),l&&(n.preventDefault(),l(t.mediumID))},target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rS,{hoverable:!0,className:"memori-media-item--card memori-media-item--image",cover:(0,s.jsxs)("picture",{className:"memori-media-item--figure",children:[!i&&!f&&(0,s.jsx)("source",{srcSet:[h,t.url,t.content].join(", "),type:t.mimeType}),f?(0,s.jsx)("div",{style:{minHeight:"150px",width:"100%",backgroundColor:t.url}}):(0,s.jsx)("img",{alt:t.title,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}),t.title&&(0,s.jsx)("figcaption",{className:"memori-media-item--figure-caption",children:t.title})]})})});case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rS,{hoverable:!0,cover:(0,s.jsx)(hS,{className:"memori-media-item--icon"}),title:t.title})});case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rS,{hoverable:!0,cover:(0,s.jsx)(dS,{className:"memori-media-item--icon"}),title:t.title})});case"application/pdf":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rS,{hoverable:!0,cover:(0,s.jsx)(uS,{className:"memori-media-item--icon"}),title:t.title})});case"video/mp4":case"video/avi":case"video/mpeg":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,onClick:n=>{e&&n.preventDefault(),l&&(n.preventDefault(),l(t.mediumID))},target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rS,{hoverable:!0,cover:(0,s.jsx)("video",{style:{width:"100%",height:"100%"},controls:!0,src:h,title:t.title}),title:t.title})});case"audio/mpeg3":case"audio/wav":case"audio/mpeg":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rS,{hoverable:!0,cover:(0,s.jsx)("audio",{style:{width:"100%",height:"100%"},controls:!0,src:h}),title:t.title})});case"model/gltf-binary":return(0,s.jsx)(lS,{src:h,alt:"",poster:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="});default:return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rS,{hoverable:!0,cover:(0,s.jsx)(cS,{className:"memori-media-item--icon"}),title:t.title})})}};var fS=(0,c.memo)((({items:e,sessionID:t,tenantID:n,translateTo:r,baseURL:i,apiURL:o,customMediaRenderer:a})=>{const[l,u]=(0,c.useState)(e),[d,h]=(0,c.useState)(),p=(0,c.useCallback)((async()=>{if(!r)return;const t=await Promise.all((null!=e?e:[]).map((async e=>{var t;if(!e.title)return e;try{const n=await aS(e.title,r);return{...e,title:null!==(t=n.text)&&void 0!==t?t:e.title}}catch(t){return console.error(t),e}})));u(t)}),[r,e]);return(0,c.useEffect)((()=>{r&&p()}),[r,p]),(0,s.jsxs)(tp,{appear:!0,show:!0,as:"div",className:"memori-media-items",children:[(0,s.jsx)("div",{className:"memori-media-items--grid",children:l.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&!Hv.map((e=>e.mimeType)).includes(e.mimeType)})).sort(((e,t)=>e.creationTimestamp>t.creationTimestamp?1:e.creationTimestamp<t.creationTimestamp?-1:0)).map(((e,r)=>(0,s.jsx)(tp.Child,{as:"div",className:"memori-media-item",enter:"ease-out duration-500 delay-"+100*r,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsx)(pS,{isChild:!0,sessionID:t,tenantID:n,baseURL:i,apiURL:o,onClick:e=>{h(l.find((t=>t.mediumID===e)))},item:{...e,title:e.title,url:e.url,content:e.content},customMediaRenderer:a})},e.url+"&index="+r)))}),l.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&Hv.map((e=>e.mimeType)).includes(e.mimeType)})).map((e=>(0,s.jsx)(tp.Child,{as:"div",className:"memori-media-item--snippet",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,s.jsx)($b,{medium:e},e.mediumID)},e.mediumID))),l.filter((e=>{var t;return"text/css"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)})).map((e=>(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:e.content||""}},e.mediumID))),(null==d?void 0:d.mediumID)&&(0,s.jsx)(Fm,{width:"100%",widthMd:"100%",className:"memori-media-item--modal",open:!!d,onClose:()=>h(void 0),footer:null,children:(0,s.jsx)(pS,{isChild:!0,sessionID:t,tenantID:n,baseURL:i,apiURL:o,item:{...d,title:d.title,url:d.url,content:d.content},customMediaRenderer:a})})]})}));var mS=(0,c.memo)((({hints:e=[],links:n=[],media:r=[],simulateUserPrompt:i=(()=>{}),sessionID:o,baseUrl:a,apiUrl:l,translateTo:u,customMediaRenderer:d})=>{const{t:h}=Se(),[p,f]=(0,c.useState)(!0),[m,g]=(0,c.useState)(6);return(0,c.useEffect)((()=>{f(!0)}),[e]),(0,s.jsxs)("div",{className:"memori-media-widget",children:[(null==r?void 0:r.length)>0&&(0,s.jsx)(fS,{items:r,sessionID:o,translateTo:u,baseURL:a,apiURL:l,customMediaRenderer:d}),(null==n?void 0:n.length)>0&&(0,s.jsx)(oS,{items:n,baseUrl:a}),(null==e?void 0:e.length)>0&&p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tp,{appear:!0,show:!0,as:"ul",className:"memori-media--hints",children:e.slice(0,m).map(((e,n)=>(0,s.jsx)(tp.Child,{as:"li",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,s.jsx)(Sf,{className:t(xs)("memori-media--hint"),primary:!0,onClick:()=>{i(e.originalText,e.text),f(!1)},onTouchEnd:()=>{i(e.originalText,e.text),f(!1)},children:e.text},e.text+n)},e.text+n)))}),e.length>m&&(0,s.jsx)("div",{className:"memori-hints--show-more",children:(0,s.jsx)(Sf,{className:"memori-hints--show-more-button",id:"showMoreHints",onClick:()=>g(m+6),children:h("expand")||"Expand"})})]})]})}));const gS=e=>e.endsWith("?")?e:`${e}?`;var vS=({message:e,apiURL:n,sessionID:r,visible:i=!0,initialMatches:o=[],closeDrawer:a,_TEST_loading:l=!1})=>{const{t:u}=Se(),d=Q(n).search.searchMemory,[h,p]=(0,c.useState)(o),[f,m]=(0,c.useState)(l),g=(0,c.useCallback)((async()=>{if(m(!0),!l){try{const{matches:n,...i}=await d(r,{searchType:"Semantic",numberOfResults:3,text:e.questionAnswered,date:e.date,placeName:e.placeName,placeLatitude:e.placeLatitude,placeLongitude:e.placeLongitude,placeUncertaintyKm:e.placeUncertaintyKm,contextVars:e.contextVars,tag:e.tag});0!==i.resultCode?(console.error(i),t(Ku).error(u(zv(i.resultCode)))):p(null!=n?n:[])}catch(e){console.error("WHYTHISANSWER/FETCH",e),p(null!=o?o:[])}m(!1)}}),[e,r]);return(0,c.useEffect)((()=>{g()}),[g,e,r]),(0,s.jsxs)(_f,{open:i,width:"80%",animated:!1,className:"memori-whythisanswer-drawer",onClose:()=>a(),title:u("whyThisAnswer"),children:[(0,s.jsx)("p",{children:u("whyThisAnswerHelper")}),e.questionAnswered&&(0,s.jsxs)("p",{className:"memori--whythisanswer-question-answered",children:[(0,s.jsxs)("strong",{children:[u("question")||"Question",":"]})," ",e.questionAnswered]}),(0,s.jsxs)(bf,{primary:!0,spinning:f,children:[!f&&0===h.length&&(0,s.jsx)("p",{role:"info",className:"memori--whythisanswer-no-results",children:u("nothingFound")}),f&&0===h.length&&(0,s.jsxs)("ul",{className:"memori--whythisanswer-list memori--whythisanswer-skeleton",children:[(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{className:"memori--whythisanswer-title",children:[(0,s.jsx)("span",{className:"memori--whythisanswer-confidence",children:(0,s.jsx)("span",{className:"memori--whythisanswer-skeleton-text"})}),(0,s.jsx)("div",{className:"memori--whythisanswer-title-text",children:(0,s.jsx)("p",{className:"memori--whythisanswer-skeleton-text"})})]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"})]}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-block"})]}),(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{className:"memori--whythisanswer-title",children:[(0,s.jsx)("span",{className:"memori--whythisanswer-confidence",children:(0,s.jsx)("span",{className:"memori--whythisanswer-skeleton-text"})}),(0,s.jsxs)("div",{className:"memori--whythisanswer-title-text",children:[(0,s.jsx)("p",{className:"memori--whythisanswer-skeleton-text"}),(0,s.jsx)("p",{className:"memori--whythisanswer-skeleton-text"})]})]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"})]}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-block"})]})]}),h.length>0&&(0,s.jsx)("ul",{className:"memori--whythisanswer-list",children:h.map((e=>{var t,n,r,i,o,a,l;return(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{className:"memori--whythisanswer-title",children:[(0,s.jsx)("span",{className:"memori--whythisanswer-confidence",children:e.confidenceLevel}),(0,s.jsxs)("div",{className:"memori--whythisanswer-title-text",children:[(0,s.jsx)("p",{children:(0,s.jsx)("strong",{children:gS(null!==(t=e.memory.title)&&void 0!==t?t:"")})}),(0,s.jsx)("p",{children:null===(r=null===(n=e.memory.titleVariants)||void 0===n?void 0:n.map((e=>gS(e))))||void 0===r?void 0:r.join(" | ")})]})]}),null===(i=e.memory.answers)||void 0===i?void 0:i.map(((e,t)=>(0,s.jsx)("p",{className:"memori--whythisanswer-answer",children:(0,s.jsx)(Dv,{rows:3,children:e.text})},t))),(0,s.jsx)(mS,{links:null===(o=e.memory.media)||void 0===o?void 0:o.filter((e=>"text/html"===e.mimeType))}),null===(l=null===(a=e.memory.media)||void 0===a?void 0:a.filter((e=>"text/plain"===e.mimeType)))||void 0===l?void 0:l.map((e=>(0,s.jsx)(Dv,{rows:2,lineHeightMultiplier:2,innerClassName:"memori--whythisanswer-snippet-expandable",children:(0,s.jsx)($b,{medium:e,showCopyButton:!1,showLineNumbers:!1},e.mediumID)},e.mediumID)))]},e.memory.memoryID)}))})]})]})};Ov.marked.use({async:!1,gfm:!0,pedantic:!0,renderer:{link(e,t,n){const r=tm(e);if(null===r)return n;let i='<a href="'+(e=r)+'"';return t&&(i+=' title="'+t+'"'),i+=' target="_blank" rel="noopener noreferrer">'+n+"</a>",i}}});var yS=({message:e,memori:n,tenant:r,baseUrl:i,apiUrl:o,sessionID:a,showFeedback:l,showWhyThisAnswer:u=!0,simulateUserPrompt:d,showAIicon:h=!0,isFirst:p=!1,user:f,userAvatar:m,experts:g})=>{var v,y,b,S,x,_;const{t:w}=Se(),[C,A]=(0,c.useState)(!1),E=(0,Nv.sanitize)(Ov.marked.parse(e.translatedText||e.text).trim().replace(/\n/g,"<br>"),{ADD_ATTR:["target"]});return(0,s.jsxs)(s.Fragment,{children:[(e.initial||p)&&(0,s.jsx)("div",{className:"memori-chat--bubble-initial"}),(0,s.jsxs)(tp,{show:!0,appear:!0,as:"div",className:t(xs)("memori-chat--bubble-container",{"memori-chat--bubble-from-user":!!e.fromUser,"memori-chat--with-addon":e.generatedByAI&&h||l&&d}),children:[!e.fromUser&&(0,s.jsx)(tp.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),title:(null===(v=e.emitter)||void 0===v?void 0:v.length)&&n.enableBoardOfExperts?e.emitter:n.name,children:(0,s.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:(null===(y=e.emitter)||void 0===y?void 0:y.length)&&n.enableBoardOfExperts?e.emitter:n.name,src:(null===(b=e.emitter)||void 0===b?void 0:b.length)&&n.enableBoardOfExperts&&(null==g?void 0:g.find((t=>t.name===e.emitter)))?`${o}/api/v1/memoriai/memori/avatar/${null===(S=g.find((t=>t.name===e.emitter)))||void 0===S?void 0:S.expertMemoriID}`:n.avatarURL&&n.avatarURL.length>0?lv({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:n.avatarURL,baseURL:i,apiURL:o}):lv({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i||"https://www.aisuru.com",apiURL:o}),onError:e=>{e.currentTarget.src=n.avatarURL&&n.avatarURL.length>0?lv({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:n.avatarURL,baseURL:i}):lv({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i}),e.currentTarget.onerror=null}})}),(0,s.jsxs)(tp.Child,{as:"div",className:t(xs)("memori-chat--bubble",{"memori-chat--user-bubble":!!e.fromUser,"memori-chat--with-addon":e.generatedByAI&&h||l&&d,"memori-chat--ai-generated":e.generatedByAI&&h,"memori-chat--with-feedback":l}),enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),children:[(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:E}}),(e.generatedByAI&&h||l&&d)&&(0,s.jsxs)("div",{className:"memori-chat--bubble-addon",children:[l&&!!d&&(0,s.jsx)(kv,{memori:n,className:"memori-chat--bubble-feedback",dropdown:!0,onNegativeClick:e=>{e&&d(e)}}),e.generatedByAI&&h&&(0,s.jsx)(dv,{align:"left",content:w("generatedByAI"),className:"memori-chat--bubble-action-icon memori-chat--bubble-action-icon--ai",children:(0,s.jsx)("span",{children:(0,s.jsx)(uv,{title:w("generatedByAI")||void 0})})}),!e.fromUser&&e.questionAnswered&&o&&u&&(0,s.jsx)(Sf,{ghost:!0,shape:"circle",title:w("whyThisAnswer")||void 0,className:"memori-chat--bubble-action-icon",onClick:()=>A(!0),disabled:C,icon:(0,s.jsx)(Lv,{title:w("whyThisAnswer")||void 0})})]})]}),e.fromUser&&(0,s.jsx)(s.Fragment,{children:m&&"string"==typeof m||!m&&(null===(x=null==f?void 0:f.avatarURL)||void 0===x?void 0:x.length)?(0,s.jsx)(tp.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:(0,s.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:null!==(_=null==f?void 0:f.userName)&&void 0!==_?_:"User",src:null!=m?m:null==f?void 0:f.avatarURL})}):m?(0,s.jsx)(tp.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:m}):(0,s.jsx)(tp.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:(0,s.jsx)(cv,{})})})]}),C&&o&&(0,s.jsx)(vS,{visible:C,message:e,closeDrawer:()=>A(!1),apiURL:o,sessionID:a})]})};c=o("85Hg2"),c=o("85Hg2");function bS(e=0){let[t,n]=(0,c.useState)(e),r=(0,c.useCallback)((e=>n((t=>t|e))),[t]),i=(0,c.useCallback)((e=>Boolean(t&e)),[t]),o=(0,c.useCallback)((e=>n((t=>t&~e))),[n]),s=(0,c.useCallback)((e=>n((t=>t^e))),[n]);return{addFlag:r,hasFlag:i,removeFlag:o,toggleFlag:s}}let SS=(0,(c=o("85Hg2")).createContext)(null);function xS(){let e=(0,c.useContext)(SS);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,xS),e}return e}function _S(){let[e,n]=(0,c.useState)([]);return[e.length>0?e.join(" "):void 0,(0,c.useMemo)((()=>function(e){let r=Th((e=>(n((t=>[...t,e])),()=>n((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=(0,c.useMemo)((()=>({register:r,slot:e.slot,name:e.name,props:e.props})),[r,e.slot,e.name,e.props]);return t(c).createElement(SS.Provider,{value:i},e.children)}),[n])]}let wS=fh((function(e,t){let{passive:n=!1,...r}=e,i=xS(),o=`headlessui-label-${lp()}`,s=Rh(t);_h((()=>i.register(o)),[o,i.register]);let a={ref:s,...i.props,id:o};return n&&("onClick"in a&&delete a.onClick,"onClick"in r&&delete r.onClick),dh({ourProps:a,theirProps:r,slot:i.slot||{},defaultTag:"label",name:i.name||"Label"})}));var CS,AS=((CS=AS||{})[CS.RegisterOption=0]="RegisterOption",CS[CS.UnregisterOption=1]="UnregisterOption",CS);let ES={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:wp(n,(e=>e.element.current))}},1(e,t){let n=e.options.slice(),r=e.options.findIndex((e=>e.id===t.id));return-1===r?e:(n.splice(r,1),{...e,options:n})}},TS=(0,c.createContext)(null);function MS(e){let t=(0,c.useContext)(TS);if(null===t){let t=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,MS),t}return t}function IS(e,t){return ah(t.type,ES,e,t)}TS.displayName="RadioGroupContext";let RS=fh((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,...u}=e,d=Th("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a),[h,p]=(0,c.useReducer)(IS,{options:[]}),f=h.options,[m,g]=_S(),[v,y]=Yp(),b=`headlessui-radiogroup-${lp()}`,S=(0,c.useRef)(null),x=Rh(S,n),[_,w]=hm(r,s,i),C=(0,c.useMemo)((()=>f.find((e=>!e.propsRef.current.disabled))),[f]),A=(0,c.useMemo)((()=>f.some((e=>d(e.propsRef.current.value,_)))),[f,_]),E=Th((e=>{var t;if(l||d(e,_))return!1;let n=null==(t=f.find((t=>d(t.propsRef.current.value,e))))?void 0:t.propsRef.current;return(null==n||!n.disabled)&&(null==w||w(e),!0)}));om({container:S.current,accept:e=>"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let T=Th((e=>{let t=S.current;if(!t)return;let n=dp(t),r=f.filter((e=>!1===e.propsRef.current.disabled)).map((e=>e.element.current));switch(e.key){case rp.Enter:dm(e.currentTarget);break;case rp.ArrowLeft:case rp.ArrowUp:if(e.preventDefault(),e.stopPropagation(),Ap(r,fp.Previous|fp.WrapAround)===mp.Success){let e=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&E(e.propsRef.current.value)}break;case rp.ArrowRight:case rp.ArrowDown:if(e.preventDefault(),e.stopPropagation(),Ap(r,fp.Next|fp.WrapAround)===mp.Success){let e=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&E(e.propsRef.current.value)}break;case rp.Space:{e.preventDefault(),e.stopPropagation();let t=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));t&&E(t.propsRef.current.value)}}})),M=Th((e=>(p({type:0,...e}),()=>p({type:1,id:e.id})))),I=(0,c.useMemo)((()=>({registerOption:M,firstOption:C,containsCheckedOption:A,change:E,disabled:l,value:_,compare:d})),[M,C,A,E,l,_,d]),R={ref:x,id:b,role:"radiogroup","aria-labelledby":m,"aria-describedby":v,onKeyDown:T},P=(0,c.useMemo)((()=>({value:_})),[_]);return t(c).createElement(y,{name:"RadioGroup.Description"},t(c).createElement(g,{name:"RadioGroup.Label"},t(c).createElement(TS.Provider,{value:I},null!=o&&null!=_&&lm({[o]:_}).map((([e,n])=>t(c).createElement(up,{features:cp.Hidden,...mh({key:e,as:"input",type:"radio",checked:null!=n,hidden:!0,readOnly:!0,name:e,value:n})}))),dh({ourProps:R,theirProps:u,slot:P,defaultTag:"div",name:"RadioGroup"}))))}));var PS=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(PS||{});let kS=fh((function(e,n){let r=(0,c.useRef)(null),i=Rh(r,n),o=`headlessui-radiogroup-option-${lp()}`,[s,a]=_S(),[l,u]=Yp(),{addFlag:d,removeFlag:h,hasFlag:p}=bS(1),{value:f,disabled:m=!1,...g}=e,v=(0,c.useRef)({value:f,disabled:m});_h((()=>{v.current.value=f}),[f,v]),_h((()=>{v.current.disabled=m}),[m,v]);let{registerOption:y,disabled:b,change:S,firstOption:x,containsCheckedOption:_,value:w,compare:C}=MS("RadioGroup.Option");_h((()=>y({id:o,element:r,propsRef:v})),[o,y,r,e]);let A=Th((e=>{var t;if(ip(e.currentTarget))return e.preventDefault();!S(f)||(d(2),null==(t=r.current)||t.focus())})),E=Th((e=>{if(ip(e.currentTarget))return e.preventDefault();d(2)})),T=Th((()=>h(2))),M=(null==x?void 0:x.id)===o,I=b||m,R=C(w,f),P={ref:i,id:o,role:"radio","aria-checked":R?"true":"false","aria-labelledby":s,"aria-describedby":l,"aria-disabled":!!I||void 0,tabIndex:I?-1:R||!_&&M?0:-1,onClick:I?void 0:A,onFocus:I?void 0:E,onBlur:I?void 0:T},k=(0,c.useMemo)((()=>({checked:R,disabled:I,active:p(2)})),[R,I,p]);return t(c).createElement(u,{name:"RadioGroup.Description"},t(c).createElement(a,{name:"RadioGroup.Label"},dh({ourProps:P,theirProps:g,slot:k,defaultTag:"div",name:"RadioGroup.Option"})))})),OS=Object.assign(RS,{Option:kS,Label:wS,Description:Zp});var NS=({sendOnEnter:e,setSendOnEnter:n})=>{const{t:r}=Se();return(0,s.jsxs)(Tv,{as:"div",className:"memori-send-on-enter-menu",children:[(0,s.jsx)(Tv.Button,{className:t(xs)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button"),children:(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)("span",{style:{display:"block",width:"1rem",height:"1rem"},children:"…"})})}),(0,s.jsx)(Tv.Items,{className:"memori-menu--overlay",children:(0,s.jsxs)(OS,{value:e,onChange:n,children:[(0,s.jsx)(OS.Option,{value:"keypress",className:"memori-menu--option",children:({checked:e})=>(0,s.jsx)(Tv.Item,{children:(0,s.jsx)(Sf,{className:"memori-menu--button",ghost:!0,outlined:e,icon:(0,s.jsx)("span",{className:"memori-menu--icon",children:e?"✓":""}),children:r("widget.sendOnKeypress")})})}),(0,s.jsx)(OS.Option,{value:"click",className:"memori-menu--option",children:({checked:e})=>(0,s.jsx)(Tv.Item,{children:(0,s.jsx)(Sf,{className:"memori-menu--button",ghost:!0,outlined:e,icon:(0,s.jsx)("span",{className:"memori-menu--icon",children:e?"✓":""}),children:r("widget.sendOnClick")})})})]})})]})};c=o("85Hg2");var LS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 0 0 0 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0 0 13.5-4.7L863.9 169a7.9 7.9 0 0 0-8.9-8.9zM416.6 562.3a8.03 8.03 0 0 0-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 0 0-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"})});var DS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 0 0 0 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 0 0 391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 0 0-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"})});var BS=({disabled:e=!1,value:n,onChange:r,onPressEnter:i,onFocus:o,onBlur:a})=>{const{t:l}=Se(),[u,d]=(0,c.useState)(!1);return(0,s.jsx)("div",{"data-testid":"chat-textarea",className:t(xs)("memori-chat-textarea",{"memori-chat-textarea--expanded":u,"memori-chat-textarea--disabled":e}),children:(0,s.jsxs)("div",{className:"memori-chat-textarea--inner",children:[(0,s.jsx)("textarea",{className:"memori-chat-textarea--input",disabled:e,value:n,onChange:e=>{r(e.target.value)},onKeyDownCapture:e=>{"Enter"===e.key&&!e.shiftKey&&i&&i(e)},onFocus:o,onBlur:a}),(0,s.jsx)("div",{className:"memori-chat-textarea--expand",children:(0,s.jsx)(Sf,{className:t(xs)("memori-chat-textarea--expand-button"),onClick:()=>d(!u),padded:!1,ghost:!0,title:u?l("collapse")||"Collapse":l("expand")||"Expand",icon:u?(0,s.jsx)(DS,{}):(0,s.jsx)(LS,{})})})]})})};var zS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})});c=o("85Hg2");var FS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})});var US=({listening:e,stopAudio:n,startListening:r,stopListening:i})=>{const{t:o}=Se(),[a,l]=(0,c.useState)(),u=(0,c.useRef)(null),d=e=>{e.preventDefault(),l(o("write_and_speak.holdToSpeak")||"Hold to record"),u.current||(u.current=setTimeout((()=>{n(),l(o("write_and_speak.releaseToEndListening")||"Release to end listening"),r()}),300))},h=()=>{u.current&&(clearTimeout(u.current),u.current=null),i(),l(void 0)};return(0,c.useEffect)((()=>()=>h()),[]),(0,s.jsx)(dv,{visible:!!a,content:(0,s.jsx)("span",{children:a||o("write_and_speak.pressAndHoldToSpeak")||"Press and hold to speak"}),align:"topLeft",className:"memori-mic-btn-tooltip",children:(0,s.jsx)(Sf,{primary:!0,className:t(xs)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":e}),title:e?o("write_and_speak.micButtonPopoverListening")||"Listening":o("write_and_speak.micButtonPopover")||"Start listening",onMouseDown:d,onTouchStart:d,onMouseUp:h,onMouseLeave:h,onTouchEnd:h,shape:"circle",icon:(0,s.jsx)(FS,{})})})};var jS=({dialogState:e,sendOnEnter:n="click",setSendOnEnter:r,userMessage:i="",onChangeUserMessage:o,sendMessage:a,onTextareaFocus:l,onTextareaBlur:c,onTextareaPressEnter:u,showMicrophone:d=!1,microphoneMode:h="HOLD_TO_TALK",listening:p=!1,stopAudio:f,startListening:m,stopListening:g})=>{const{t:v}=Se();return(0,s.jsxs)("fieldset",{id:"chat-fieldset",className:"memori-chat-inputs",disabled:"X2a"===(null==e?void 0:e.state)||"X3"===(null==e?void 0:e.state),children:[(0,s.jsx)(NS,{sendOnEnter:n,setSendOnEnter:r}),(0,s.jsx)(BS,{value:i,onChange:o,onPressEnter:u,onFocus:l,onBlur:c,disabled:["R2","R3","R4","R5","G3","X3"].includes((null==e?void 0:e.state)||"")}),(0,s.jsx)(Sf,{shape:"circle",primary:!!(null==i?void 0:i.length),disabled:!i||0===i.length,className:"memori-chat-inputs--send",onClick:()=>{a(i),f(),speechSynthesis.speak(new SpeechSynthesisUtterance(""))},title:v("send")||"Send",icon:(0,s.jsx)(zS,{})}),d&&"HOLD_TO_TALK"===h&&(0,s.jsx)(US,{listening:p,startListening:m,stopListening:()=>{g(),(null==i?void 0:i.length)&&a(i)},stopAudio:f}),d&&"CONTINUOUS"===h&&(0,s.jsx)(Sf,{primary:!0,className:t(xs)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":p}),title:p?v("write_and_speak.micButtonPopoverListening")||"Listening":v("write_and_speak.micButtonPopover")||"Start listening",onClick:()=>{p?g():(f(),m())},shape:"circle",icon:(0,s.jsx)(FS,{})})]})};c=o("85Hg2");const HS={en:[{delayAfter:3,text:"Generating an accurate and fancy response..."},{delayAfter:3,text:"Generating a response that will blow your mind..."},{delayAfter:3,text:"Generating a response that will make you smile..."},{delayAfter:3,text:"Thinking of a response..."},{delayAfter:3,text:"Thinking of a response that will make you smile..."},{delayAfter:3,text:"Gathering my thoughts..."},{delayAfter:3,text:"Gathering my thoughts to give you a response..."}],it:[{delayAfter:3,text:"Sto generando una risposta accurata e fantasiosa..."},{delayAfter:3,text:"Sto generando una risposta che ti farà impazzire..."},{delayAfter:3,text:"Sto generando una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto pensando ad una risposta..."},{delayAfter:3,text:"Sto pensando ad una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri per darti una risposta..."}]},GS=(e=3)=>new Array(20*e).fill(" ").join("");var VS=({useDefaultSentences:e=!1,lang:t="en",sentence:n,sentences:r})=>{var i;const[o,a]=(0,c.useState)(0),[l,u]=(0,c.useState)((null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.length)?`${r[t][0].text.endsWith("...")||!r[t][0].text.length?r[t][0].text:`${r[t][0].text}...`}${GS(r[t][0].delayAfter)}`:n?`${n.endsWith("...")||!n.length?n:`${n}...`}${GS()}`:""),[d,h]=(0,c.useState)("");return(0,c.useEffect)((()=>{const i=setInterval((()=>{var i;const s=l[d.length];if(void 0!==s&&l.length>0)h((e=>e+s));else if((null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.length)&&o<r[t].length-1){const e=o+1,n=r[t][e];u(`${n.text.endsWith("...")||!n.text.length?n.text:`${n.text}...`}${GS(n.delayAfter)}`),h(""),a(e)}else if(!r&&!n&&e){const e=HS[t][Math.floor(Math.random()*HS[t].length)];u(`${e.text}${GS(e.delayAfter)}`),h("")}}),50);return()=>clearInterval(i)})),(0,s.jsx)("div",{className:"memori-chat--bubble",children:(0,s.jsxs)("div",{className:"memori-chat--bubble-typing",children:[(0,s.jsxs)("div",{id:"wave",children:[(0,s.jsx)("span",{className:"dot"}),(0,s.jsx)("span",{className:"dot"}),(0,s.jsx)("span",{className:"dot"})]}),l.length>0&&(0,s.jsx)("p",{children:d})]})})};var WS=(0,c.memo)((({memori:e,tenant:n,sessionID:r,baseUrl:i,apiUrl:o,translateTo:a,memoriTyping:l,typingText:u,showTypingText:d=!1,history:h=[],authToken:p,dialogState:f,simulateUserPrompt:m,showDates:g=!1,showContextPerLine:v=!1,showAIicon:y=!0,selectReceiverTag:b,preview:S=!1,instruct:x=!1,showInputs:_=!0,showMicrophone:w=!1,microphoneMode:C="HOLD_TO_TALK",sendOnEnter:A,setSendOnEnter:E,attachmentsMenuOpen:T,setAttachmentsMenuOpen:M,userMessage:I="",onChangeUserMessage:R,sendMessage:P,listening:k,isPlayingAudio:O,stopAudio:N,startListening:L,stopListening:D,resetTranscript:B,customMediaRenderer:z,user:F,userAvatar:U,experts:j})=>{var H,G,V,W,q,K,J,Q;const Y=()=>{setTimeout((()=>{var e,t,n;null===(e=document.querySelector(".memori-chat--content"))||void 0===e||e.scrollTo(0,null!==(n=null===(t=document.querySelector(".memori-chat--content"))||void 0===t?void 0:t.scrollHeight)&&void 0!==n?n:0)}),200)};(0,c.useEffect)((()=>{!S&&Y()}),[h,S]);return(0,s.jsxs)("div",{className:t(xs)("memori-chat--wrapper",{"memori-chat-wrapper--translate":a}),id:"chat-wrapper",lang:null==a?void 0:a.toUpperCase(),"data-memori-lang":null!==(W=null===(V=null===(G=null===(H=e.culture)||void 0===H?void 0:H.split("-"))||void 0===G?void 0:G[0])||void 0===V?void 0:V.toUpperCase())&&void 0!==W?W:"EN",children:[(0,s.jsx)("div",{className:t(xs)("memori-chat--history",{"memori-chat--history-touch":Yf()}),children:(0,s.jsxs)("div",{className:t(xs)("memori-chat--content",{"memori-chat--content-touch":Yf()}),children:[(0,s.jsx)("div",{className:t(xs)("memori-chat--cover"),style:{backgroundImage:`url("${lv({type:"cover",tenantID:null==n?void 0:n.id,resourceURI:e.coverURL,baseURL:i,apiURL:o})}"), url("${lv({type:"cover",tenantID:null==n?void 0:n.id,baseURL:i||"https://www.aisuru.com",apiURL:o})}")`}}),h.map(((l,u)=>{var d,p,b,S;return(0,s.jsxs)(t(c).Fragment,{children:[(0,s.jsx)(yS,{isFirst:0===u,message:l,memori:e,tenant:n,baseUrl:i,apiUrl:o,sessionID:r,simulateUserPrompt:m,showAIicon:y,showFeedback:u===h.length-1&&!l.fromUser&&(null==f?void 0:f.acceptsFeedback),user:F,userAvatar:U,experts:j}),g&&!!l.timestamp&&(0,s.jsx)("small",{className:"memori-chat--timestamp "+(l.fromUser?"text-right":"text-left"),children:new Intl.DateTimeFormat("it",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(l.timestamp.endsWith("Z")?l.timestamp:`${l.timestamp}Z`))}),v&&!!Object.keys(null!==(d=l.contextVars)&&void 0!==d?d:{}).length&&(0,s.jsx)("div",{className:"memori-chat--context-vars",children:Object.keys(null!==(p=l.contextVars)&&void 0!==p?p:{}).map((e=>{var t,n,r;return"-"===(null===(t=l.contextVars)||void 0===t?void 0:t[e])?(0,s.jsx)("div",{className:"memori-chat--context-tag memori-chat--context-tag-canceled",children:(0,s.jsx)("span",{className:"memori-chat--context-tag-text",children:e})},e):"✔️"===(null===(n=l.contextVars)||void 0===n?void 0:n[e])?(0,s.jsx)("div",{className:"memori-chat--context-tag",children:(0,s.jsx)("span",{className:"memori-chat--context-tag-text",children:e})},e):(0,s.jsx)("div",{className:"memori-chat--context-tag",children:(0,s.jsxs)("span",{className:"memori-chat--context-tag-text",children:[e,": ",null===(r=l.contextVars)||void 0===r?void 0:r[e]]})},e)}))}),(0,s.jsx)(mS,{simulateUserPrompt:m,media:null===(b=null==l?void 0:l.media)||void 0===b?void 0:b.filter((e=>"text/html"!==e.mimeType&&"text/plain"!==e.mimeType)),links:null===(S=null==l?void 0:l.media)||void 0===S?void 0:S.filter((e=>"text/html"===e.mimeType)),sessionID:r,baseUrl:i,apiUrl:o,translateTo:a,customMediaRenderer:z})]},u)})),(null==f?void 0:f.hints)&&f.hints.length>0&&(0,s.jsx)(mS,{simulateUserPrompt:m,hints:f.translatedHints?f.translatedHints:f.hints.map((e=>({text:e,originalText:e})))}),!!l&&(0,s.jsx)(VS,{useDefaultSentences:d,lang:a?"it"===a.toLowerCase()?"it":"en":"it"===(null===(J=null===(K=null===(q=e.culture)||void 0===q?void 0:q.split("-"))||void 0===K?void 0:K[0])||void 0===J?void 0:J.toLowerCase())?"it":"en",sentence:u,sentences:e.enableBoardOfExperts?Gv:void 0},u),(0,s.jsx)("div",{id:"end-messages-ref"})]})}),"X3"===(null==f?void 0:f.state)&&r&&(0,s.jsx)("div",{className:"memori-chat--known-tags",children:Object.keys(null!==(Q=f.knownTags)&&void 0!==Q?Q:{}).filter((t=>t!==e.giverTag)).map((e=>{var t;return(0,s.jsx)(Sf,{icon:(0,s.jsx)("span",{className:"memori-chat--known-tag-icon",children:e}),className:"memori-chat--known-tag",onClick:()=>b(e),children:null===(t=f.knownTags)||void 0===t?void 0:t[e]},e)}))}),_&&(0,s.jsx)(jS,{userMessage:I,onChangeUserMessage:R,dialogState:f,instruct:x,authToken:p,sendMessage:P,microphoneMode:C,sendOnEnter:A,setSendOnEnter:E,attachmentsMenuOpen:T,setAttachmentsMenuOpen:M,onTextareaPressEnter:()=>{"keypress"===A&&(null==I?void 0:I.length)>0&&(D(),P(I),R(""),B())},onTextareaFocus:()=>{var e,t,n,r;D(),Yf()&&window.innerWidth<=768&&(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t||t.add("chat-focused"),null===(r=null===(n=document.querySelector(".memori.memori-widget"))||void 0===n?void 0:n.classList)||void 0===r||r.add("chat-focused"),setTimeout((()=>{Y()}),300))},onTextareaBlur:()=>{var e,t,n,r,i;(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t?void 0:t.contains("chat-focused"))&&(null===(n=document.getElementById("chat-wrapper"))||void 0===n||n.classList.remove("chat-focused"),null===(i=null===(r=document.querySelector(".memori.memori-widget"))||void 0===r?void 0:r.classList)||void 0===i||i.remove("chat-focused"),Y())},startListening:L,stopListening:D,stopAudio:N,listening:k,isPlayingAudio:O,showMicrophone:w})]})}));c=o("85Hg2");var qS=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}),(0,s.jsx)("path",{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4c-1.3-3.2-4.3-5.4-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"})]});var KS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"})});var JS=({memoriName:e,blockedUntil:t,showGiverInfo:n=!1,showTitle:r=!1,marginLeft:i=!1})=>{const{t:o}=Se(),a=new Date(t);return a>new Date?(0,s.jsx)(dv,{className:"blocked-memori-badge--tooltip",content:(0,s.jsxs)(s.Fragment,{children:[!n&&o("memoriBlockedAnon",{name:e,date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(a)}),n&&o("memoriBlockedUntil",{date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(a)}),n&&` ${o("memoriBlockedReasonExceedChats")}`,n&&(0,s.jsx)("br",{}),n&&`\n${o("memoriBlockedGiverHelper")}`]}),children:(0,s.jsxs)("div",{className:"blocked-memori-badge--wrapper",children:[(0,s.jsx)("div",{className:"blocked-memori-badge "+(i?" margin-left":""),children:(0,s.jsx)(KS,{className:"blocked-memori-badge--icon"})}),r&&(0,s.jsx)("span",{className:"blocked-memori-badge--title",children:o("memoriBlockedTitle")})]})}):null};var QS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",width:"20",height:"16",viewBox:"0 0 640 512",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M211.2 96a64 64 0 10-128 0 64 64 0 10128 0zM32 256c0 17.7 14.3 32 32 32h85.6c10.1-39.4 38.6-71.5 75.8-86.6-9.7-6-21.2-9.4-33.4-9.4H96c-35.3 0-64 28.7-64 64zm461.6 32H576c17.7 0 32-14.3 32-32 0-35.3-28.7-64-64-64h-96c-11.7 0-22.7 3.1-32.1 8.6 38.1 14.8 67.4 47.3 77.7 87.4zm-102.4-61.6c-6.9-1.6-14.2-2.4-21.6-2.4h-96c-8.5 0-16.7 1.1-24.5 3.1-30.8 8.1-55.6 31.1-66.1 60.9-3.5 10-5.5 20.8-5.5 32 0 17.7 14.3 32 32 32h224c17.7 0 32-14.3 32-32 0-11.2-1.9-22-5.5-32-10.8-30.7-36.8-54.2-68.9-61.6zM563.2 96a64 64 0 10-128 0 64 64 0 10128 0zm-241.6 96a80 80 0 100-160 80 80 0 100 160zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32h576c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"})});var YS=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",width:"20",height:"20",viewBox:"0 0 48 48",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M30.106 48v-2.745a2.213 2.213 0 012.213-2.212h6.11a2.392 2.392 0 002.326-2.466v-3.223a1.834 1.834 0 01.459-1.145 2.912 2.912 0 00.712-1.926l-.007-.667a1.016 1.016 0 01.651-.952h1.067a1.363 1.363 0 001.051-.456 1.304 1.304 0 00.19-1.395 67.032 67.032 0 01-3.037-7.51 4.767 4.767 0 01-.217-1.507l-.002-4.994a14.513 14.513 0 00-.552-3.963l-.006-.022a13.959 13.959 0 00-3.137-5.702q-.479-.516-1.006-1.003a17.67 17.67 0 00-.677-.623A18.303 18.303 0 0024.194 1a19.617 19.617 0 00-12.539 4.489 17.555 17.555 0 00-3.945 21.69C9.945 31.507 11.694 38.622 12.14 46v2",strokeMiterlimit:10}),(0,s.jsx)("path",{d:"M27.917 12L31.417 12"}),(0,s.jsx)("path",{d:"M27.917 26L31.417 26"}),(0,s.jsx)("path",{d:"M29.667 12L29.667 26"}),(0,s.jsx)("path",{d:"M23.992 26L19.904 12 19.226 12 15.159 26"}),(0,s.jsx)("path",{d:"M16.854 21.133L22.276 21.133"})]});c=o("85Hg2");var ZS=({forceStatus:e,provider:t})=>{var n;const{t:r}=Se(),[i,o]=(0,c.useState)(null!=e?e:"none"),a=(e=>{switch(e){case"DEFAULT":case"OpenAI":return{getStatus:async()=>{var e;const t=await fetch("https://status.openai.com/api/v2/summary.json");return null!==(e=(await t.json()).status.indicator)&&void 0!==e?e:"none"},statusPage:"https://status.openai.com/"};default:return{getStatus:async()=>"none",statusPage:""}}})(t);return(0,c.useEffect)((()=>{e||a.getStatus().then((e=>o(e)))}),[e,t]),"none"!==i?(0,s.jsx)(dv,{className:"memori--completion-provider-status--tooltip",align:"topLeft",content:(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:r("completionProviderDown",{provider:null!=t?t:r("completionProviderFallbackName")})}),!!(null===(n=a.statusPage)||void 0===n?void 0:n.length)&&(0,s.jsx)("p",{children:(0,s.jsx)("a",{href:a.statusPage,rel:"noopener noreferrer",target:"_blank",children:r("completionProviderCheckStatusPage")})})]}),children:(0,s.jsx)(KS,{className:"memori--completion-provider-status--icon"})}):null};var XS=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",className:e,"aria-label":t,children:(0,s.jsx)("path",{fill:"currentColor",d:"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z"})});var $S=({memori:e,tenant:t,gamificationLevel:n,language:r,userLang:i,setUserLang:o,baseUrl:a,apiUrl:l,position:u,openPositionDrawer:d,integrationConfig:h,instruct:p=!1,clickedStart:f,onClickStart:m,initializeTTS:g,_TEST_forceProviderStatus:v,isUserLoggedIn:y=!1,user:b,showLogin:S=!1,setShowLoginDrawer:x})=>{var _,w;const{t:C,i18n:A}=Se(),[E,T]=(0,c.useState)(e.description),[M,I]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{var t,n,i,o,s,l;(null!==(n=null===(t=A.language)||void 0===t?void 0:t.toUpperCase())&&void 0!==n?n:"IT")!==(null!==(i=null==r?void 0:r.toUpperCase())&&void 0!==i?i:"IT")&&(null===(o=e.description)||void 0===o?void 0:o.length)&&aS(e.description,null!==(l=null===(s=A.language)||void 0===s?void 0:s.toUpperCase())&&void 0!==l?l:"IT",r,a).then((e=>{T(e.text)})).catch(console.error)}),[A.language,r,e.description,a]),(0,s.jsxs)("div",{className:"memori--start-panel",children:[(0,s.jsxs)("div",{className:"memori--cover",style:{backgroundImage:`url("${lv({type:"cover",tenantID:null==t?void 0:t.id,resourceURI:e.coverURL,baseURL:a,apiURL:l})}"), url("${lv({type:"cover",tenantID:null==t?void 0:t.id,baseURL:a,apiURL:l})}")`},children:[!!(null===(_=null==n?void 0:n.badge)||void 0===_?void 0:_.length)&&!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--gamification-badge",children:(0,s.jsx)(dv,{align:"left",content:`${C("gamification.level")} ${n.badge}, ${n.points} ${C("gamification.points")}`,children:(0,s.jsx)("span",{"aria-label":`${C("gamification.level")} ${n.badge}, ${n.points} ${C("gamification.points")}`,children:n.badge})})}),!!e.enableCompletions&&!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--completions-enabled",children:(0,s.jsx)(dv,{align:"left",content:C("completionsEnabled"),children:(0,s.jsx)("span",{"aria-label":C("completionsEnabled")||"Completions",children:(0,s.jsx)(uv,{})})})}),!!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--board-of-experts",children:(0,s.jsx)(dv,{align:"left",content:C("boardOfExperts"),children:(0,s.jsx)("span",{"aria-label":C("boardOfExperts")||"Board of Experts",children:(0,s.jsx)(QS,{})})})}),!!e.nsfw&&(0,s.jsx)("div",{className:"memori--nsfw",children:(0,s.jsx)(dv,{align:"left",content:C("nsfw"),children:(0,s.jsx)("span",{title:C("nsfw")||"NSFW",children:"🔞"})})})]}),(0,s.jsxs)("picture",{className:"memori--avatar",children:[(0,s.jsx)("source",{src:null!==(w=e.avatarURL)&&void 0!==w?w:lv({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:a,apiURL:l})}),(0,s.jsx)("img",{alt:e.name,src:e.avatarURL&&e.avatarURL.length>0?lv({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:a,apiURL:l}):lv({type:"avatar",tenantID:null==t?void 0:t.id,baseURL:a,apiURL:l})})]}),(0,s.jsx)("h2",{className:"memori--title",children:e.name}),e.needsPosition&&!u&&(0,s.jsxs)("div",{className:"memori--needsPosition",children:[(0,s.jsx)("p",{children:C("write_and_speak.requirePositionHelp",{name:e.name})}),(0,s.jsx)(Sf,{primary:!0,onClick:()=>d(),className:"memori--start-button",icon:(0,s.jsx)(XS,{}),children:C("widget.position")})]}),(e.needsPosition&&u||!e.needsPosition)&&(0,s.jsxs)("div",{className:"memori--description",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"memori--description-text",children:E&&M?E:e.description}),E!==e.description&&(0,s.jsx)(Sf,{ghost:!0,className:"memori--translation-toggle",icon:(0,s.jsx)(qS,{}),onClick:()=>{I((e=>!e))},children:C(M?"showOriginalText":"showTranslatedText")})]}),(null==h?void 0:h.multilanguage)&&!p&&(0,s.jsxs)("div",{className:"memori--language-chooser",children:[(0,s.jsx)("label",{id:"user-lang-pref-label",htmlFor:"user-lang-pref",children:C("write_and_speak.iWantToTalkToIn",{name:e.name})}),(0,s.jsx)("select",{id:"user-lang-pref",className:"memori-select--button",value:(null!=i?i:A.language).toUpperCase(),"aria-labelledby":"user-lang-pref-label",onChange:e=>{o(e.target.value)},children:Uv.map((e=>(0,s.jsx)("option",{value:e.value,"aria-label":e.label,children:e.label},e.value)))})]}),(0,s.jsx)(Sf,{primary:!0,disabled:!!e.blockedUntil&&!e.isGiver,loading:f,onClick:e=>{try{window.speechSynthesis.speak(new SpeechSynthesisUtterance(""))}catch(e){console.error(e)}g&&g(),m&&m()},className:"memori--start-button",children:C("write_and_speak."+(p?"instructButton":"tryMeButton"))}),(0,s.jsx)(ZS,{provider:e.completionProvider,forceStatus:v}),(0,s.jsx)("p",{className:"memori--start-description",children:C(p?"write_and_speak.pageInstructExplanation":"write_and_speak.pageTryMeExplanation")}),!!e.blockedUntil&&(0,s.jsx)(JS,{memoriName:e.name,blockedUntil:e.blockedUntil,showGiverInfo:e.isGiver,showTitle:!0,marginLeft:!0}),!!e.enableDeepThought&&!p&&(0,s.jsxs)("div",{className:"memori--deep-thought-disclaimer",children:[(0,s.jsx)(dv,{align:"left",content:C("deepThoughtHelper"),children:(0,s.jsx)(YS,{})}),(0,s.jsx)("h2",{children:y&&(null==b?void 0:b.pAndCUAccepted)?C("deepThoughtDisclaimerTitle"):C("deepThought")}),y&&!(null==b?void 0:b.pAndCUAccepted)&&(0,s.jsx)("p",{children:C("deepThoughtPreDisclaimerNotAllowed")}),!y&&(0,s.jsx)("p",{children:C("deepThoughtPreDisclaimerUnlogged")}),!y&&S&&(0,s.jsx)("p",{children:(0,s.jsx)(Sf,{outlined:!0,padded:!1,onClick:()=>x(!0),children:"Login"})}),(0,s.jsx)("p",{className:"memori--deep-thought-disclaimer-text",children:C("deepThoughtDisclaimer")})]})]})]})},ex=(c=o("85Hg2"),c=o("85Hg2"),Y=o("hcaHr"),c=o("85Hg2"),["forwardedRef"]);function tx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nx(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?tx(Object(r),!0).forEach((function(n){t(Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tx(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}class rx extends c.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,s.jsxs)("div",{style:{background:"rgba(255, 255, 255, 0.4)",color:"#000",padding:"2rem",borderRadius:"10px"},children:[(0,s.jsx)("h2",{children:this.props.t("error.generic")}),(0,s.jsx)(Sf,{primary:!0,onClick:()=>this.setState({hasError:!1}),children:this.props.t("error.tryAgain")||"Try again"})]}):this.props.children}}var ix=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r){function i(i){var o=i.forwardedRef,s=t(iy)(i,ex),a=Se(e,nx(nx({},s),{},{keyPrefix:n.keyPrefix})),l=t(Y)(a,3),u=l[0],d=l[1],h=l[2],p=nx(nx({},s),{},{t:u,i18n:d,tReady:h});return n.withRef&&o?p.ref=o:!n.withRef&&o&&(p.forwardedRef=o),(0,c.createElement)(r,p)}i.displayName="withI18nextTranslation(".concat(ge(r),")"),i.WrappedComponent=r;return n.withRef?(0,c.forwardRef)((function(e,t){return(0,c.createElement)(i,Object.assign({},e,{forwardedRef:t}))})):i}}(["common"])(rx),ox=(c=o("85Hg2"),c=o("85Hg2"),{});e(ox,"REVISION",(()=>sx)),e(ox,"MOUSE",(()=>ax)),e(ox,"TOUCH",(()=>lx)),e(ox,"CullFaceNone",(()=>cx)),e(ox,"CullFaceBack",(()=>ux)),e(ox,"CullFaceFront",(()=>dx)),e(ox,"CullFaceFrontBack",(()=>hx)),e(ox,"BasicShadowMap",(()=>px)),e(ox,"PCFShadowMap",(()=>fx)),e(ox,"PCFSoftShadowMap",(()=>mx)),e(ox,"VSMShadowMap",(()=>gx)),e(ox,"FrontSide",(()=>vx)),e(ox,"BackSide",(()=>yx)),e(ox,"DoubleSide",(()=>bx)),e(ox,"NoBlending",(()=>Sx)),e(ox,"NormalBlending",(()=>xx)),e(ox,"AdditiveBlending",(()=>_x)),e(ox,"SubtractiveBlending",(()=>wx)),e(ox,"MultiplyBlending",(()=>Cx)),e(ox,"CustomBlending",(()=>Ax)),e(ox,"AddEquation",(()=>Ex)),e(ox,"SubtractEquation",(()=>Tx)),e(ox,"ReverseSubtractEquation",(()=>Mx)),e(ox,"MinEquation",(()=>Ix)),e(ox,"MaxEquation",(()=>Rx)),e(ox,"ZeroFactor",(()=>Px)),e(ox,"OneFactor",(()=>kx)),e(ox,"SrcColorFactor",(()=>Ox)),e(ox,"OneMinusSrcColorFactor",(()=>Nx)),e(ox,"SrcAlphaFactor",(()=>Lx)),e(ox,"OneMinusSrcAlphaFactor",(()=>Dx)),e(ox,"DstAlphaFactor",(()=>Bx)),e(ox,"OneMinusDstAlphaFactor",(()=>zx)),e(ox,"DstColorFactor",(()=>Fx)),e(ox,"OneMinusDstColorFactor",(()=>Ux)),e(ox,"SrcAlphaSaturateFactor",(()=>jx)),e(ox,"NeverDepth",(()=>Hx)),e(ox,"AlwaysDepth",(()=>Gx)),e(ox,"LessDepth",(()=>Vx)),e(ox,"LessEqualDepth",(()=>Wx)),e(ox,"EqualDepth",(()=>qx)),e(ox,"GreaterEqualDepth",(()=>Kx)),e(ox,"GreaterDepth",(()=>Jx)),e(ox,"NotEqualDepth",(()=>Qx)),e(ox,"MultiplyOperation",(()=>Yx)),e(ox,"MixOperation",(()=>Zx)),e(ox,"AddOperation",(()=>Xx)),e(ox,"NoToneMapping",(()=>$x)),e(ox,"LinearToneMapping",(()=>e_)),e(ox,"ReinhardToneMapping",(()=>t_)),e(ox,"CineonToneMapping",(()=>n_)),e(ox,"ACESFilmicToneMapping",(()=>r_)),e(ox,"CustomToneMapping",(()=>i_)),e(ox,"UVMapping",(()=>o_)),e(ox,"CubeReflectionMapping",(()=>s_)),e(ox,"CubeRefractionMapping",(()=>a_)),e(ox,"EquirectangularReflectionMapping",(()=>l_)),e(ox,"EquirectangularRefractionMapping",(()=>c_)),e(ox,"CubeUVReflectionMapping",(()=>u_)),e(ox,"RepeatWrapping",(()=>d_)),e(ox,"ClampToEdgeWrapping",(()=>h_)),e(ox,"MirroredRepeatWrapping",(()=>p_)),e(ox,"NearestFilter",(()=>f_)),e(ox,"NearestMipmapNearestFilter",(()=>m_)),e(ox,"NearestMipMapNearestFilter",(()=>g_)),e(ox,"NearestMipmapLinearFilter",(()=>v_)),e(ox,"NearestMipMapLinearFilter",(()=>y_)),e(ox,"LinearFilter",(()=>b_)),e(ox,"LinearMipmapNearestFilter",(()=>S_)),e(ox,"LinearMipMapNearestFilter",(()=>x_)),e(ox,"LinearMipmapLinearFilter",(()=>__)),e(ox,"LinearMipMapLinearFilter",(()=>w_)),e(ox,"UnsignedByteType",(()=>C_)),e(ox,"ByteType",(()=>A_)),e(ox,"ShortType",(()=>E_)),e(ox,"UnsignedShortType",(()=>T_)),e(ox,"IntType",(()=>M_)),e(ox,"UnsignedIntType",(()=>I_)),e(ox,"FloatType",(()=>R_)),e(ox,"HalfFloatType",(()=>P_)),e(ox,"UnsignedShort4444Type",(()=>k_)),e(ox,"UnsignedShort5551Type",(()=>O_)),e(ox,"UnsignedInt248Type",(()=>N_)),e(ox,"AlphaFormat",(()=>L_)),e(ox,"RGBFormat",(()=>D_)),e(ox,"RGBAFormat",(()=>B_)),e(ox,"LuminanceFormat",(()=>z_)),e(ox,"LuminanceAlphaFormat",(()=>F_)),e(ox,"DepthFormat",(()=>U_)),e(ox,"DepthStencilFormat",(()=>j_)),e(ox,"RedFormat",(()=>H_)),e(ox,"RedIntegerFormat",(()=>G_)),e(ox,"RGFormat",(()=>V_)),e(ox,"RGIntegerFormat",(()=>W_)),e(ox,"RGBAIntegerFormat",(()=>q_)),e(ox,"RGB_S3TC_DXT1_Format",(()=>K_)),e(ox,"RGBA_S3TC_DXT1_Format",(()=>J_)),e(ox,"RGBA_S3TC_DXT3_Format",(()=>Q_)),e(ox,"RGBA_S3TC_DXT5_Format",(()=>Y_)),e(ox,"RGB_PVRTC_4BPPV1_Format",(()=>Z_)),e(ox,"RGB_PVRTC_2BPPV1_Format",(()=>X_)),e(ox,"RGBA_PVRTC_4BPPV1_Format",(()=>$_)),e(ox,"RGBA_PVRTC_2BPPV1_Format",(()=>ew)),e(ox,"RGB_ETC1_Format",(()=>tw)),e(ox,"RGB_ETC2_Format",(()=>nw)),e(ox,"RGBA_ETC2_EAC_Format",(()=>rw)),e(ox,"RGBA_ASTC_4x4_Format",(()=>iw)),e(ox,"RGBA_ASTC_5x4_Format",(()=>ow)),e(ox,"RGBA_ASTC_5x5_Format",(()=>sw)),e(ox,"RGBA_ASTC_6x5_Format",(()=>aw)),e(ox,"RGBA_ASTC_6x6_Format",(()=>lw)),e(ox,"RGBA_ASTC_8x5_Format",(()=>cw)),e(ox,"RGBA_ASTC_8x6_Format",(()=>uw)),e(ox,"RGBA_ASTC_8x8_Format",(()=>dw)),e(ox,"RGBA_ASTC_10x5_Format",(()=>hw)),e(ox,"RGBA_ASTC_10x6_Format",(()=>pw)),e(ox,"RGBA_ASTC_10x8_Format",(()=>fw)),e(ox,"RGBA_ASTC_10x10_Format",(()=>mw)),e(ox,"RGBA_ASTC_12x10_Format",(()=>gw)),e(ox,"RGBA_ASTC_12x12_Format",(()=>vw)),e(ox,"RGBA_BPTC_Format",(()=>yw)),e(ox,"LoopOnce",(()=>bw)),e(ox,"LoopRepeat",(()=>Sw)),e(ox,"LoopPingPong",(()=>xw)),e(ox,"InterpolateDiscrete",(()=>_w)),e(ox,"InterpolateLinear",(()=>ww)),e(ox,"InterpolateSmooth",(()=>Cw)),e(ox,"ZeroCurvatureEnding",(()=>Aw)),e(ox,"ZeroSlopeEnding",(()=>Ew)),e(ox,"WrapAroundEnding",(()=>Tw)),e(ox,"NormalAnimationBlendMode",(()=>Mw)),e(ox,"AdditiveAnimationBlendMode",(()=>Iw)),e(ox,"TrianglesDrawMode",(()=>Rw)),e(ox,"TriangleStripDrawMode",(()=>Pw)),e(ox,"TriangleFanDrawMode",(()=>kw)),e(ox,"LinearEncoding",(()=>Ow)),e(ox,"sRGBEncoding",(()=>Nw)),e(ox,"BasicDepthPacking",(()=>Lw)),e(ox,"RGBADepthPacking",(()=>Dw)),e(ox,"TangentSpaceNormalMap",(()=>Bw)),e(ox,"ObjectSpaceNormalMap",(()=>zw)),e(ox,"NoColorSpace",(()=>Fw)),e(ox,"SRGBColorSpace",(()=>Uw)),e(ox,"LinearSRGBColorSpace",(()=>jw)),e(ox,"ZeroStencilOp",(()=>Hw)),e(ox,"KeepStencilOp",(()=>Gw)),e(ox,"ReplaceStencilOp",(()=>Vw)),e(ox,"IncrementStencilOp",(()=>Ww)),e(ox,"DecrementStencilOp",(()=>qw)),e(ox,"IncrementWrapStencilOp",(()=>Kw)),e(ox,"DecrementWrapStencilOp",(()=>Jw)),e(ox,"InvertStencilOp",(()=>Qw)),e(ox,"NeverStencilFunc",(()=>Yw)),e(ox,"LessStencilFunc",(()=>Zw)),e(ox,"EqualStencilFunc",(()=>Xw)),e(ox,"LessEqualStencilFunc",(()=>$w)),e(ox,"GreaterStencilFunc",(()=>eC)),e(ox,"NotEqualStencilFunc",(()=>tC)),e(ox,"GreaterEqualStencilFunc",(()=>nC)),e(ox,"AlwaysStencilFunc",(()=>rC)),e(ox,"StaticDrawUsage",(()=>iC)),e(ox,"DynamicDrawUsage",(()=>oC)),e(ox,"StreamDrawUsage",(()=>sC)),e(ox,"StaticReadUsage",(()=>aC)),e(ox,"DynamicReadUsage",(()=>lC)),e(ox,"StreamReadUsage",(()=>cC)),e(ox,"StaticCopyUsage",(()=>uC)),e(ox,"DynamicCopyUsage",(()=>dC)),e(ox,"StreamCopyUsage",(()=>hC)),e(ox,"GLSL1",(()=>pC)),e(ox,"GLSL3",(()=>fC)),e(ox,"_SRGBAFormat",(()=>mC)),e(ox,"EventDispatcher",(()=>gC)),e(ox,"MathUtils",(()=>RC)),e(ox,"Vector2",(()=>PC)),e(ox,"Matrix3",(()=>kC)),e(ox,"ColorManagement",(()=>UC)),e(ox,"Color",(()=>KC)),e(ox,"ImageUtils",(()=>QC)),e(ox,"Source",(()=>YC)),e(ox,"Texture",(()=>$C)),e(ox,"Vector4",(()=>eA)),e(ox,"WebGLRenderTarget",(()=>tA)),e(ox,"DataArrayTexture",(()=>nA)),e(ox,"WebGLArrayRenderTarget",(()=>rA)),e(ox,"Data3DTexture",(()=>iA)),e(ox,"WebGL3DRenderTarget",(()=>oA)),e(ox,"WebGLMultipleRenderTargets",(()=>sA)),e(ox,"Quaternion",(()=>aA)),e(ox,"Vector3",(()=>lA)),e(ox,"Box3",(()=>dA)),e(ox,"Sphere",(()=>RA)),e(ox,"Ray",(()=>zA)),e(ox,"Matrix4",(()=>FA)),e(ox,"Euler",(()=>QA)),e(ox,"Layers",(()=>YA)),e(ox,"Object3D",(()=>uE)),e(ox,"Triangle",(()=>xE)),e(ox,"Material",(()=>wE)),e(ox,"MeshBasicMaterial",(()=>CE)),e(ox,"BufferAttribute",(()=>TE)),e(ox,"Int8BufferAttribute",(()=>ME)),e(ox,"Uint8BufferAttribute",(()=>IE)),e(ox,"Uint8ClampedBufferAttribute",(()=>RE)),e(ox,"Int16BufferAttribute",(()=>PE)),e(ox,"Uint16BufferAttribute",(()=>kE)),e(ox,"Int32BufferAttribute",(()=>OE)),e(ox,"Uint32BufferAttribute",(()=>NE)),e(ox,"Float16BufferAttribute",(()=>LE)),e(ox,"Float32BufferAttribute",(()=>DE)),e(ox,"Float64BufferAttribute",(()=>BE)),e(ox,"BufferGeometry",(()=>WE)),e(ox,"Mesh",(()=>cT)),e(ox,"BoxGeometry",(()=>dT)),e(ox,"UniformsUtils",(()=>fT)),e(ox,"ShaderMaterial",(()=>mT)),e(ox,"Camera",(()=>gT)),e(ox,"PerspectiveCamera",(()=>vT)),e(ox,"CubeCamera",(()=>bT)),e(ox,"CubeTexture",(()=>ST)),e(ox,"WebGLCubeRenderTarget",(()=>xT)),e(ox,"Plane",(()=>AT)),e(ox,"Frustum",(()=>MT)),e(ox,"PlaneGeometry",(()=>PT)),e(ox,"ShaderChunk",(()=>kT)),e(ox,"UniformsLib",(()=>OT)),e(ox,"ShaderLib",(()=>NT)),e(ox,"OrthographicCamera",(()=>jT)),e(ox,"PMREMGenerator",(()=>YT)),e(ox,"MeshDepthMaterial",(()=>qI)),e(ox,"MeshDistanceMaterial",(()=>KI)),e(ox,"WebGLUtils",(()=>ZI)),e(ox,"ArrayCamera",(()=>XI)),e(ox,"Group",(()=>$I)),e(ox,"DepthTexture",(()=>nR)),e(ox,"WebGLRenderer",(()=>sR)),e(ox,"WebGL1Renderer",(()=>aR)),e(ox,"FogExp2",(()=>lR)),e(ox,"Fog",(()=>cR)),e(ox,"Scene",(()=>uR)),e(ox,"InterleavedBuffer",(()=>dR)),e(ox,"InterleavedBufferAttribute",(()=>pR)),e(ox,"SpriteMaterial",(()=>fR)),e(ox,"Sprite",(()=>MR)),e(ox,"LOD",(()=>kR)),e(ox,"SkinnedMesh",(()=>zR)),e(ox,"Bone",(()=>FR)),e(ox,"DataTexture",(()=>UR)),e(ox,"Skeleton",(()=>GR)),e(ox,"InstancedBufferAttribute",(()=>VR)),e(ox,"InstancedMesh",(()=>QR)),e(ox,"LineBasicMaterial",(()=>YR)),e(ox,"Line",(()=>nP)),e(ox,"LineSegments",(()=>oP)),e(ox,"LineLoop",(()=>sP)),e(ox,"PointsMaterial",(()=>aP)),e(ox,"Points",(()=>hP)),e(ox,"VideoTexture",(()=>fP)),e(ox,"FramebufferTexture",(()=>mP)),e(ox,"CompressedTexture",(()=>gP)),e(ox,"CanvasTexture",(()=>vP)),e(ox,"Curve",(()=>yP)),e(ox,"EllipseCurve",(()=>bP)),e(ox,"ArcCurve",(()=>SP)),e(ox,"CatmullRomCurve3",(()=>EP)),e(ox,"CubicBezierCurve",(()=>RP)),e(ox,"CubicBezierCurve3",(()=>PP)),e(ox,"LineCurve",(()=>kP)),e(ox,"LineCurve3",(()=>OP)),e(ox,"QuadraticBezierCurve",(()=>NP)),e(ox,"QuadraticBezierCurve3",(()=>LP)),e(ox,"SplineCurve",(()=>DP)),e(ox,"CurvePath",(()=>zP)),e(ox,"Path",(()=>FP)),e(ox,"LatheGeometry",(()=>UP)),e(ox,"CapsuleGeometry",(()=>jP)),e(ox,"CircleGeometry",(()=>HP)),e(ox,"CylinderGeometry",(()=>GP)),e(ox,"ConeGeometry",(()=>VP)),e(ox,"PolyhedronGeometry",(()=>WP)),e(ox,"DodecahedronGeometry",(()=>qP)),e(ox,"EdgesGeometry",(()=>ZP)),e(ox,"Shape",(()=>XP)),e(ox,"ShapeUtils",(()=>Ck)),e(ox,"ExtrudeGeometry",(()=>Tk)),e(ox,"IcosahedronGeometry",(()=>Ik)),e(ox,"OctahedronGeometry",(()=>Rk)),e(ox,"RingGeometry",(()=>Pk)),e(ox,"ShapeGeometry",(()=>kk)),e(ox,"SphereGeometry",(()=>Ok)),e(ox,"TetrahedronGeometry",(()=>Nk)),e(ox,"TorusGeometry",(()=>Lk)),e(ox,"TorusKnotGeometry",(()=>Dk)),e(ox,"TubeGeometry",(()=>Bk)),e(ox,"WireframeGeometry",(()=>zk)),e(ox,"ShadowMaterial",(()=>jk)),e(ox,"RawShaderMaterial",(()=>Hk)),e(ox,"MeshStandardMaterial",(()=>Gk)),e(ox,"MeshPhysicalMaterial",(()=>Vk)),e(ox,"MeshPhongMaterial",(()=>Wk)),e(ox,"MeshToonMaterial",(()=>qk)),e(ox,"MeshNormalMaterial",(()=>Kk)),e(ox,"MeshLambertMaterial",(()=>Jk)),e(ox,"MeshMatcapMaterial",(()=>Qk)),e(ox,"LineDashedMaterial",(()=>Yk)),e(ox,"AnimationUtils",(()=>rO)),e(ox,"Interpolant",(()=>iO)),e(ox,"CubicInterpolant",(()=>oO)),e(ox,"LinearInterpolant",(()=>sO)),e(ox,"DiscreteInterpolant",(()=>aO)),e(ox,"KeyframeTrack",(()=>lO)),e(ox,"BooleanKeyframeTrack",(()=>cO)),e(ox,"ColorKeyframeTrack",(()=>uO)),e(ox,"NumberKeyframeTrack",(()=>dO)),e(ox,"QuaternionLinearInterpolant",(()=>hO)),e(ox,"QuaternionKeyframeTrack",(()=>pO)),e(ox,"StringKeyframeTrack",(()=>fO)),e(ox,"VectorKeyframeTrack",(()=>mO)),e(ox,"AnimationClip",(()=>gO)),e(ox,"Cache",(()=>yO)),e(ox,"LoadingManager",(()=>bO)),e(ox,"DefaultLoadingManager",(()=>SO)),e(ox,"Loader",(()=>xO)),e(ox,"FileLoader",(()=>CO)),e(ox,"AnimationLoader",(()=>AO)),e(ox,"CompressedTextureLoader",(()=>EO)),e(ox,"ImageLoader",(()=>TO)),e(ox,"CubeTextureLoader",(()=>MO)),e(ox,"DataTextureLoader",(()=>IO)),e(ox,"TextureLoader",(()=>RO)),e(ox,"Light",(()=>PO)),e(ox,"HemisphereLight",(()=>kO)),e(ox,"SpotLight",(()=>zO)),e(ox,"PointLight",(()=>GO)),e(ox,"DirectionalLight",(()=>WO)),e(ox,"AmbientLight",(()=>qO)),e(ox,"RectAreaLight",(()=>KO)),e(ox,"SphericalHarmonics3",(()=>JO)),e(ox,"LightProbe",(()=>QO)),e(ox,"MaterialLoader",(()=>YO)),e(ox,"LoaderUtils",(()=>ZO)),e(ox,"InstancedBufferGeometry",(()=>XO)),e(ox,"BufferGeometryLoader",(()=>$O)),e(ox,"ObjectLoader",(()=>eN)),e(ox,"ImageBitmapLoader",(()=>iN)),e(ox,"AudioContext",(()=>sN)),e(ox,"AudioLoader",(()=>aN)),e(ox,"HemisphereLightProbe",(()=>lN)),e(ox,"AmbientLightProbe",(()=>cN)),e(ox,"StereoCamera",(()=>pN)),e(ox,"Clock",(()=>fN)),e(ox,"AudioListener",(()=>SN)),e(ox,"Audio",(()=>xN)),e(ox,"PositionalAudio",(()=>EN)),e(ox,"AudioAnalyser",(()=>TN)),e(ox,"PropertyMixer",(()=>MN)),e(ox,"PropertyBinding",(()=>LN)),e(ox,"AnimationObjectGroup",(()=>DN)),e(ox,"AnimationMixer",(()=>FN)),e(ox,"Uniform",(()=>UN)),e(ox,"UniformsGroup",(()=>HN)),e(ox,"InstancedInterleavedBuffer",(()=>GN)),e(ox,"GLBufferAttribute",(()=>VN)),e(ox,"Raycaster",(()=>WN)),e(ox,"Spherical",(()=>JN)),e(ox,"Cylindrical",(()=>QN)),e(ox,"Box2",(()=>ZN)),e(ox,"Line3",(()=>eL)),e(ox,"SpotLightHelper",(()=>nL)),e(ox,"SkeletonHelper",(()=>sL)),e(ox,"PointLightHelper",(()=>lL)),e(ox,"HemisphereLightHelper",(()=>hL)),e(ox,"GridHelper",(()=>pL)),e(ox,"PolarGridHelper",(()=>fL)),e(ox,"DirectionalLightHelper",(()=>yL)),e(ox,"CameraHelper",(()=>xL)),e(ox,"BoxHelper",(()=>CL)),e(ox,"Box3Helper",(()=>AL)),e(ox,"PlaneHelper",(()=>EL)),e(ox,"ArrowHelper",(()=>RL)),e(ox,"AxesHelper",(()=>PL)),e(ox,"ShapePath",(()=>kL)),e(ox,"DataUtils",(()=>LL)),e(ox,"ImmediateRenderObject",(()=>DL)),e(ox,"WebGLMultisampleRenderTarget",(()=>BL)),e(ox,"DataTexture2DArray",(()=>zL)),e(ox,"DataTexture3D",(()=>FL)),e(ox,"BoxBufferGeometry",(()=>UL)),e(ox,"CapsuleBufferGeometry",(()=>jL)),e(ox,"CircleBufferGeometry",(()=>HL)),e(ox,"ConeBufferGeometry",(()=>GL)),e(ox,"CylinderBufferGeometry",(()=>VL)),e(ox,"DodecahedronBufferGeometry",(()=>WL)),e(ox,"ExtrudeBufferGeometry",(()=>qL)),e(ox,"IcosahedronBufferGeometry",(()=>KL)),e(ox,"LatheBufferGeometry",(()=>JL)),e(ox,"OctahedronBufferGeometry",(()=>QL)),e(ox,"PlaneBufferGeometry",(()=>YL)),e(ox,"PolyhedronBufferGeometry",(()=>ZL)),e(ox,"RingBufferGeometry",(()=>XL)),e(ox,"ShapeBufferGeometry",(()=>$L)),e(ox,"SphereBufferGeometry",(()=>eD)),e(ox,"TetrahedronBufferGeometry",(()=>tD)),e(ox,"TorusBufferGeometry",(()=>nD)),e(ox,"TorusKnotBufferGeometry",(()=>rD)),e(ox,"TubeBufferGeometry",(()=>iD));
240
240
  /**
241
241
  * @license
242
242
  * Copyright 2010-2022 Three.js Authors
@@ -247,4 +247,4 @@ const sx="144",ax={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},lx={ROTATE:0,
247
247
  * @license qrcode.react
248
248
  * Copyright (c) Paul O'Shannessy
249
249
  * SPDX-License-Identifier: ISC
250
- */function zU(e,t=0){const n=[];return e.forEach((function(e,r){let i=null;e.forEach((function(o,s){if(!o&&null!==i)return n.push(`M${i+t} ${r+t}h${s-i}v1H${i+t}z`),void(i=null);if(s!==e.length-1)o&&null===i&&(i=s);else{if(!o)return;null===i?n.push(`M${s+t},${r+t} h1v1H${s+t}z`):n.push(`M${i+t},${r+t} h${s+1-i}v1H${i+t}z`)}}))})),n.join("")}function FU(e,t){return e.slice().map(((e,n)=>n<t.y||n>=t.y+t.h?e:e.map(((e,n)=>(n<t.x||n>=t.x+t.w)&&e))))}function UU(e,t,n,r){if(null==r)return null;const i=n?4:0,o=e.length+2*i,s=Math.floor(.1*t),a=o/t,l=(r.width||s)*a,c=(r.height||s)*a,u=null==r.x?e.length/2-l/2:r.x*a,d=null==r.y?e.length/2-c/2:r.y*a;let h=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);h={x:e,y:t,w:Math.ceil(l+u-e),h:Math.ceil(c+d-t)}}return{x:u,y:d,h:c,w:l,excavation:h}}var jU=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function HU(e){const n=e,{value:r,size:i=OU,level:o=NU,bgColor:s=LU,fgColor:a=DU,includeMargin:l=BU,style:u,imageSettings:d}=n,h=RU(n,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),p=null==d?void 0:d.src,f=(0,c.useRef)(null),m=(0,c.useRef)(null),[g,v]=(0,c.useState)(!1);(0,c.useEffect)((()=>{if(null!=f.current){const e=f.current,t=e.getContext("2d");if(!t)return;let n=PU.QrCode.encodeText(r,kU[o]).getModules();const c=l?4:0,u=n.length+2*c,h=UU(n,i,l,d),p=m.current,g=null!=h&&null!==p&&p.complete&&0!==p.naturalHeight&&0!==p.naturalWidth;g&&null!=h.excavation&&(n=FU(n,h.excavation));const v=window.devicePixelRatio||1;e.height=e.width=i*v;const y=i/u*v;t.scale(y,y),t.fillStyle=s,t.fillRect(0,0,u,u),t.fillStyle=a,jU?t.fill(new Path2D(zU(n,c))):n.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+c,n+c,1,1)}))})),g&&t.drawImage(p,h.x+c,h.y+c,h.w,h.h)}})),(0,c.useEffect)((()=>{v(!1)}),[p]);const y=IU({height:i,width:i},u);let b=null;return null!=p&&(b=t(c).createElement("img",{src:p,key:p,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),t(c).createElement(t(c).Fragment,null,t(c).createElement("canvas",IU({style:y,height:i,width:i,ref:f},h)),b)}var GU=({tenant:e,url:n,title:r="",className:i,baseUrl:o,primary:a=!0,showQrCode:l=!0,align:u="right"})=>{const{t:d}=Se(),[h,p]=(0,c.useState)(n),f=(0,c.useMemo)((()=>(null==e?void 0:e.theme)?`${null!=o?o:"https://aisuru.com"}/images/${e.theme}/square_logo.png`:`${null!=o?o:"https://aisuru.com"}/images/memori_logo.png`),[e,o]);(0,c.useEffect)((()=>{n||p(window.location.href)}),[n]);const m=[{id:"facebook",title:"Facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${h}`,icon:mU},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${h}`,icon:gU},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${r}&url=${h}`,icon:vU},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${h}`,icon:yU},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${r}&url=${h}`,icon:wU},{id:"email",title:"Email",url:`mailto:?subject=${(null==r?void 0:r.length)>0?r:n}&body=${h}`,icon:bU}];return(0,s.jsxs)(Tv,{as:"div",className:t(xs)("memori-share-button",{"memori-share-button--align-left":"left"===u}),children:[(0,s.jsx)(Tv.Button,{className:t(xs)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button",i,{"memori-button--primary":a}),title:d("widget.share")||void 0,children:(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(SU,{})})}),(0,s.jsxs)(Tv.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,s.jsx)(Tv.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsx)(Sf,{className:"memori-share-button--link",ghost:!0,icon:(0,s.jsx)(tS,{}),onClick:()=>{h&&navigator.clipboard.writeText(h)},children:d("copyToClipboard")||void 0})},"copy"),m.map((e=>{var n;return(0,s.jsx)(Tv.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsxs)("a",{className:t(xs)("memori-button","memori-button--with-icon","memori-button--ghost","memori-button--padded","memori-share-button--link"),href:null!==(n=e.url)&&void 0!==n?n:"",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(e.icon,{})}),e.title]})},e.id)})),l&&(0,s.jsxs)(Tv.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,s.jsx)(HU,{id:"qr-canvas",value:null!=h?h:"",size:128,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:f,x:void 0,y:void 0,height:32,width:32,excavate:!0}}),(0,s.jsx)("div",{children:(0,s.jsx)(Sf,{onClick:()=>{const e=document.getElementById("qr-canvas");if(!e)return;const t=document.createElement("a");t.href=e.toDataURL(),t.download=`memori-${r}-share.png`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},icon:(0,s.jsx)(xU,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};var VU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M290 236.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0 0 13.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 0 0 0 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 0 0-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"})});var WU=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",focusable:"false",role:"img",className:e,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","aria-label":t,children:[(0,s.jsx)("path",{d:"M23 4L23 10 17 10"}),(0,s.jsx)("path",{d:"M1 20L1 14 7 14"}),(0,s.jsx)("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})]});var qU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6c-.3 1.5-.4 3-.4 4.4 0 14.4 11.6 26 26 26h723c1.5 0 3-.1 4.4-.4 14.2-2.4 23.7-15.9 21.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"})});var KU=({className:e,memori:n,tenant:r,history:i,position:o,setShowPositionDrawer:a,setShowSettingsDrawer:l,setShowKnownFactsDrawer:u,setShowExpertsDrawer:d,speakerMuted:h,setSpeakerMuted:p,hasUserActivatedSpeak:f=!1,showShare:m=!0,showSettings:g=!0,showSpeaker:v=!0,showReload:y=!1,showClear:b=!1,showLogin:S=!0,setShowLoginDrawer:x,clearHistory:_,loginToken:w,user:C,sessionID:A})=>{const{t:E}=Se(),[T,M]=(0,c.useState)(!1),[I,R]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{document.fullscreenEnabled&&M(!0)}),[]),(0,s.jsxs)("div",{className:t(xs)("memori-header",e),children:[y&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--reload",title:E("reload")||"Reload",icon:(0,s.jsx)(WU,{}),onClick:()=>{window.location.reload()}}),b&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--clear",title:E("clearHistory")||"Clear chat",icon:(0,s.jsx)(qU,{}),onClick:_}),n.needsPosition&&o&&(0,s.jsxs)("div",{className:"memori-header--position",children:[0!==o.latitude&&0!==o.longitude&&(0,s.jsx)("span",{className:"memori-header--position-placeName",children:o.placeName}),(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--position",title:E("widget.position")||"Position",icon:(0,s.jsx)(XS,{}),onClick:()=>a(!0)})]}),T&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--fullscreen",title:I?E("fullscreenExit")||"Exit fullscreen":E("fullscreenEnter")||"Enter fullscreen",icon:I?(0,s.jsx)(DS,{}):(0,s.jsx)(VU,{}),onClick:()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),R(!1)):(document.documentElement.requestFullscreen(),R(!0))}}),n.enableDeepThought&&!!w&&(null==C?void 0:C.pAndCUAccepted)&&(0,s.jsx)(Sf,{primary:!!A&&!!f,shape:"circle",icon:(0,s.jsx)(YS,{}),className:"memori-header--button memori-header--button--knownfacts",disabled:!f||!A,onClick:()=>u(!0),title:E("knownFacts.title")||"Known facts"}),n.enableBoardOfExperts&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",icon:(0,s.jsx)(QS,{}),className:"memori-header--button memori-header--button--experts",disabled:!f||!A,onClick:()=>d(!0),title:E("widget.showExpertsInTheBoard")||"Experts in this board"}),v&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--speaker",icon:h?(0,s.jsx)(VF,{}):(0,s.jsx)(qF,{}),onClick:()=>p(!h),title:E("widget.sound")||"Sound"}),(0,s.jsx)(pU,{history:i,memori:n,className:"memori-header--button memori-header--button--export",disabled:!f||0===i.length}),g&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-settings",icon:(0,s.jsx)(fU,{}),onClick:()=>l(!0),title:E("widget.settings")||"Settings"}),m&&(0,s.jsx)(GU,{className:"memori-header--button memori-header--button-share",title:n.name,tenant:r,showQrCode:!0,align:"left"}),S&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-login",icon:(0,s.jsx)(cv,{}),onClick:()=>x(!0),title:w?E("login.user")||"User":E("login.login")||"Login"})]})};var JU=({tenant:e,userLang:t="en",integrationID:n,memoriHash:r})=>{const i="memorytwin"===(null==e?void 0:e.theme)?"memorytwin":"twincreator"===(null==e?void 0:e.theme)?"twincreator":"aisuru";return(0,s.jsxs)("div",{className:"memori--powered-by",children:[(0,s.jsx)("img",{src:`https://aisuru.com/images/${i}/logo.png`,alt:""}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"sr-only",children:"Powered by"}),(0,s.jsx)("a",{href:`https://memori.ai/${"it"===(null==t?void 0:t.toLowerCase())?"it":"en"}${n?`?integrationID=${n}`:""}${r?`${n?"&":"?"}memori=${r}`:""}`,target:"_blank",rel:"noopener noreferrer",children:"Memori.AI"})]})]})},QU=(c=o("85Hg2"),c=o("85Hg2"),(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(QU||{})),YU=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(YU||{}),ZU=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(ZU||{}),XU=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.SetOrientation=3]="SetOrientation",e[e.GoToOption=4]="GoToOption",e[e.Search=5]="Search",e[e.ClearSearch=6]="ClearSearch",e[e.RegisterOption=7]="RegisterOption",e[e.UnregisterOption=8]="UnregisterOption",e))(XU||{});function $U(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=wp(t(e.options.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{options:r,activeOptionIndex:i}}let ej={1:e=>e.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1},0(e){if(e.disabled||0===e.listboxState)return e;let t=e.activeOptionIndex,{value:n,mode:r,compare:i}=e.propsRef.current,o=e.options.findIndex((e=>{let t=e.dataRef.current.value;return ah(r,{1:()=>n.some((e=>i(e,t))),0:()=>i(n,t)})}));return-1!==o&&(t=o),{...e,listboxState:0,activeOptionIndex:t}},2:(e,t)=>e.disabled===t.disabled?e:{...e,disabled:t.disabled},3:(e,t)=>e.orientation===t.orientation?e:{...e,orientation:t.orientation},4(e,t){var n;if(e.disabled||1===e.listboxState)return e;let r=$U(e),i=am(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},5:(e,t)=>{if(e.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find((e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))})),o=i?e.options.indexOf(i):-1;return-1===o||o===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:o,activationTrigger:1}},6:e=>e.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},7:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=$U(e,(e=>[...e,n]));if(null===e.activeOptionIndex){let{value:i,mode:o,compare:s}=e.propsRef.current,a=t.dataRef.current.value;ah(o,{1:()=>i.some((e=>s(e,a))),0:()=>s(i,a)})&&(r.activeOptionIndex=r.options.indexOf(n))}return{...e,...r}},8:(e,t)=>{let n=$U(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},tj=(0,c.createContext)(null);function nj(e){let t=(0,c.useContext)(tj);if(null===t){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,nj),t}return t}function rj(e,t){return ah(t.type,ej,e,t)}tj.displayName="ListboxContext";let ij=c.Fragment,oj=fh((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,horizontal:u=!1,multiple:d=!1,...h}=e;const p=u?"horizontal":"vertical";let f=Rh(n),[m,g]=hm(r,s,i),v=(0,c.useReducer)(rj,{listboxState:1,propsRef:{current:{value:m,onChange:g,mode:d?1:0,compare:Th("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a)}},labelRef:(0,c.createRef)(),buttonRef:(0,c.createRef)(),optionsRef:(0,c.createRef)(),disabled:l,orientation:p,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1}),[{listboxState:y,propsRef:b,optionsRef:S,buttonRef:x},_]=v;b.current.value=m,b.current.mode=d?1:0,_h((()=>{b.current.onChange=e=>ah(b.current.mode,{0:()=>g(e),1(){let t=b.current.value.slice(),{compare:n}=b.current,r=t.findIndex((t=>n(t,e)));return-1===r?t.push(e):t.splice(r,1),g(t)}})}),[g,b]),_h((()=>_({type:2,disabled:l})),[l]),_h((()=>_({type:3,orientation:p})),[p]),nf([x,S],((e,t)=>{var n;_({type:1}),bp(t,yp.Loose)||(e.preventDefault(),null==(n=x.current)||n.focus())}),0===y);let w=(0,c.useMemo)((()=>({open:0===y,disabled:l,value:m})),[y,l,m]),C={ref:f};return t(c).createElement(tj.Provider,{value:v},t(c).createElement(Sh,{value:ah(y,{0:yh.Open,1:yh.Closed})},null!=o&&null!=m&&lm({[o]:m}).map((([e,n])=>t(c).createElement(up,{features:cp.Hidden,...mh({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:n})}))),dh({ourProps:C,theirProps:h,slot:w,defaultTag:ij,name:"Listbox"})))})),sj=fh((function(e,t){var n;let[r,i]=nj("Listbox.Button"),o=Rh(r.buttonRef,t),s=`headlessui-listbox-button-${lp()}`,a=Fh(),l=Th((e=>{switch(e.key){case rp.Space:case rp.Enter:case rp.ArrowDown:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:sm.First})}));break;case rp.ArrowUp:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:sm.Last})}))}})),u=Th((e=>{if(e.key===rp.Space)e.preventDefault()})),d=Th((e=>{if(ip(e.currentTarget))return e.preventDefault();0===r.listboxState?(i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),i({type:0}))})),h=nm((()=>{if(r.labelRef.current)return[r.labelRef.current.id,s].join(" ")}),[r.labelRef.current,s]),p=(0,c.useMemo)((()=>({open:0===r.listboxState,disabled:r.disabled,value:r.propsRef.current.value})),[r]),f=e;return dh({ourProps:{ref:o,id:s,type:im(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.optionsRef.current)?void 0:n.id,"aria-expanded":r.disabled?void 0:0===r.listboxState,"aria-labelledby":h,disabled:r.disabled,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:f,slot:p,defaultTag:"button",name:"Listbox.Button"})})),aj=fh((function(e,t){let[n]=nj("Listbox.Label"),r=`headlessui-listbox-label-${lp()}`;return dh({ourProps:{ref:Rh(n.labelRef,t),id:r,onClick:Th((()=>{var e;return null==(e=n.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))},theirProps:e,slot:(0,c.useMemo)((()=>({open:0===n.listboxState,disabled:n.disabled})),[n]),defaultTag:"label",name:"Listbox.Label"})})),lj=ch.RenderStrategy|ch.Static,cj=fh((function(e,t){var n;let[r,i]=nj("Listbox.Options"),o=Rh(r.optionsRef,t),s=`headlessui-listbox-options-${lp()}`,a=Fh(),l=Fh(),u=bh(),d=null!==u?u===yh.Open:0===r.listboxState;(0,c.useEffect)((()=>{var e;let t=r.optionsRef.current;!t||0===r.listboxState&&t!==(null==(e=dp(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})}),[r.listboxState,r.optionsRef]);let h=Th((e=>{switch(l.dispose(),e.key){case rp.Space:if(""!==r.searchQuery)return e.preventDefault(),e.stopPropagation(),i({type:5,value:e.key});case rp.Enter:if(e.preventDefault(),e.stopPropagation(),null!==r.activeOptionIndex){let{dataRef:e}=r.options[r.activeOptionIndex];r.propsRef.current.onChange(e.current.value)}0===r.propsRef.current.mode&&(i({type:1}),Oh().nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})})));break;case ah(r.orientation,{vertical:rp.ArrowDown,horizontal:rp.ArrowRight}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:sm.Next});case ah(r.orientation,{vertical:rp.ArrowUp,horizontal:rp.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:sm.Previous});case rp.Home:case rp.PageUp:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:sm.First});case rp.End:case rp.PageDown:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:sm.Last});case rp.Escape:return e.preventDefault(),e.stopPropagation(),i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case rp.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(i({type:5,value:e.key}),l.setTimeout((()=>i({type:6})),350))}})),p=nm((()=>{var e,t,n;return null!=(n=null==(e=r.labelRef.current)?void 0:e.id)?n:null==(t=r.buttonRef.current)?void 0:t.id}),[r.labelRef.current,r.buttonRef.current]),f=(0,c.useMemo)((()=>({open:0===r.listboxState})),[r]),m=e;return dh({ourProps:{"aria-activedescendant":null===r.activeOptionIndex||null==(n=r.options[r.activeOptionIndex])?void 0:n.id,"aria-multiselectable":1===r.propsRef.current.mode||void 0,"aria-labelledby":p,"aria-orientation":r.orientation,id:s,onKeyDown:h,role:"listbox",tabIndex:0,ref:o},theirProps:m,slot:f,defaultTag:"ul",features:lj,visible:d,name:"Listbox.Options"})})),uj=fh((function(e,t){let{disabled:n=!1,value:r,...i}=e,[o,s]=nj("Listbox.Option"),a=`headlessui-listbox-option-${lp()}`,l=null!==o.activeOptionIndex&&o.options[o.activeOptionIndex].id===a,{value:u,compare:d}=o.propsRef.current,h=ah(o.propsRef.current.mode,{1:()=>u.some((e=>d(e,r))),0:()=>d(u,r)}),p=(0,c.useRef)(null),f=Rh(t,p);_h((()=>{if(0!==o.listboxState||!l||0===o.activationTrigger)return;let e=Oh();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=p.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[p,l,o.listboxState,o.activationTrigger,o.activeOptionIndex]);let m=(0,c.useRef)({disabled:n,value:r,domRef:p});_h((()=>{m.current.disabled=n}),[m,n]),_h((()=>{m.current.value=r}),[m,r]),_h((()=>{var e,t;m.current.textValue=null==(t=null==(e=p.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[m,p]);let g=Th((()=>o.propsRef.current.onChange(r)));_h((()=>(s({type:7,id:a,dataRef:m}),()=>s({type:8,id:a}))),[m,a]);let v=Th((e=>{if(n)return e.preventDefault();g(),0===o.propsRef.current.mode&&(s({type:1}),Oh().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})})))})),y=Th((()=>{if(n)return s({type:4,focus:sm.Nothing});s({type:4,focus:sm.Specific,id:a})})),b=Th((()=>{n||l||s({type:4,focus:sm.Specific,id:a,trigger:0})})),S=Th((()=>{n||!l||s({type:4,focus:sm.Nothing})})),x=(0,c.useMemo)((()=>({active:l,selected:h,disabled:n})),[l,h,n]);return dh({ourProps:{id:a,ref:f,role:"option",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,"aria-selected":h,disabled:void 0,onClick:v,onFocus:y,onPointerMove:b,onMouseMove:b,onPointerLeave:S,onMouseLeave:S},theirProps:i,slot:x,defaultTag:"li",name:"Listbox.Option"})})),dj=Object.assign(oj,{Button:sj,Label:aj,Options:cj,Option:uj});var hj=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",focusable:"false",role:"img",className:e,fill:"currentColor","aria-label":t,children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z",clipRule:"evenodd"})});const pj={en:["January","February","March","April","May","June","July","August","September","October","November","December"],it:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"]},fj=(0,c.memo)((({defaultDate:e,onChange:t,disabled:n=!1})=>{const{t:r,i18n:i}=Se(),[o,a]=(0,c.useState)(e?"string"==typeof e?_s.DateTime.fromISO(e):_s.DateTime.fromJSDate(e):_s.DateTime.now());return(0,c.useEffect)((()=>{t(o)}),[o,t]),(0,s.jsxs)("div",{className:"memori--date-selector",children:[(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(dj,{value:o,onChange:e=>{a(e)},disabled:n,name:"day",children:[(0,s.jsxs)(dj.Label,{className:"memori--date-selector__select-label",children:[r("day"),":"]}),(0,s.jsxs)(dj.Button,{"aria-label":r("day"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.day}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(hj,{})})]}),(0,s.jsx)(tp,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(dj.Options,{className:"memori--date-selector__select-options",children:[...Array(31).keys()].map((e=>(0,s.jsx)(dj.Option,{value:o.set({day:e+1}),className:"memori--date-selector__select-option",children:e+1},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(dj,{value:o,onChange:e=>{a(e)},disabled:n,name:"month",children:[(0,s.jsxs)(dj.Label,{className:"memori--date-selector__select-label",children:[r("month"),":"]}),(0,s.jsxs)(dj.Button,{"aria-label":r("month"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:pj["it"===i.language?"it":"en"][o.month-1]}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(hj,{})})]}),(0,s.jsx)(tp,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(dj.Options,{className:"memori--date-selector__select-options",children:pj["it"===i.language?"it":"en"].map((e=>(0,s.jsx)(dj.Option,{className:"memori--date-selector__select-option",value:o.set({month:pj["it"===i.language?"it":"en"].findIndex((t=>t===e))+1}),children:e},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(dj,{value:o,onChange:e=>{a(e)},disabled:n,name:"year",children:[(0,s.jsxs)(dj.Label,{className:"memori--date-selector__select-label",children:[r("year"),":"]}),(0,s.jsxs)(dj.Button,{"aria-label":r("year"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.year}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(hj,{})})]}),(0,s.jsx)(tp,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(dj.Options,{className:"memori--date-selector__select-options",children:[...Array(_s.DateTime.now().year-1899).keys()].sort(((e,t)=>t-e)).map((e=>(0,s.jsx)(dj.Option,{value:o.set({year:e+1900}),className:"memori--date-selector__select-option",children:e+1900},e)))})})]})})]})}));fj.displayName="DateSelector";var mj=fj;c=o("85Hg2");var gj=({visible:e=!1,onClose:n,minAge:r})=>{const{t:i}=Se(),[o,a]=(0,c.useState)(),[l,u]=(0,c.useState)(),[d,h]=(0,c.useState)(!1),p=(0,c.useCallback)((()=>{if(h(!0),!o)return t(Ku).error(i("requiredField")),u(i("requiredField")||"Required field"),void h(!1);if(_s.DateTime.now().diff(o,"years").years<r)return t(Ku).error(i("underageTwinSession",{age:r})),u(i("underageTwinSession",{age:r})||`You must be at least ${r} years old to interact with this Twin`),void h(!1);n(o.toJSDate().toISOString())}),[o,r,n,i]);return(0,s.jsxs)(Fm,{open:e,title:i("ageVerification"),className:"age-verification-modal",closable:!0,onClose:()=>n(),children:[(0,s.jsx)("p",{children:i("ageVerificationText",{minAge:r})}),(0,s.jsxs)("form",{className:"age-verification-form",onSubmit:e=>{e.preventDefault(),p()},children:[(0,s.jsx)("div",{className:"form-item",children:(0,s.jsxs)("fieldset",{name:"birthDate",children:[(0,s.jsx)("legend",{className:"sr-only",children:i("birthDate")}),(0,s.jsx)(mj,{defaultDate:new Date(Date.now()),onChange:e=>{a(e)}}),(0,s.jsx)("p",{className:"form-item-help",children:i("birthDateHelper")}),l&&(0,s.jsx)("p",{className:"form-item-error",children:l})]})}),(0,s.jsx)("div",{className:"form-item form-submit",children:(0,s.jsx)(Sf,{primary:!0,htmlType:"submit",className:"age-verification-submit",loading:d,disabled:!o,children:i("confirm")})})]})]})};c=o("85Hg2");var vj=({label:e,className:n,disabled:r=!1,indeterminate:i=!1,checked:o,children:a,onChange:l,name:u,...d})=>{const h=(0,c.useRef)(null);return(0,c.useEffect)((()=>{h.current&&(h.current.indeterminate=i)}),[h,i]),(0,s.jsxs)("label",{className:t(xs)("memori-checkbox",n,{"memori-checkbox--disabled":r,"memori-checkbox--indeterminate":i}),children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{ref:h,type:"checkbox",...d,name:u,disabled:r,checked:o||i,className:"memori-checkbox--input",onChange:l}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),!!(null==e?void 0:e.length)&&(0,s.jsx)("span",{className:"memori-checkbox--text",children:e})]})};c=o("85Hg2");var yj=({className:e,value:n,name:r,displayValue:i,options:o,onChange:a,disabled:l=!1,label:u,placeholder:d})=>(0,s.jsx)("div",{className:t(xs)("memori-select",e),children:(0,s.jsxs)(dj,{value:n,onChange:e=>{a(e)},disabled:l,name:r,children:[u&&(0,s.jsxs)(dj.Label,{className:"memori-select--label",children:[u,":"]}),(0,s.jsxs)(dj.Button,{"aria-label":u,className:"memori-select--button",children:[(0,s.jsx)("span",{className:t(xs)("memori-select--value",{"memori-select--value-placeholder":!n}),children:n?i||n:d}),(0,s.jsx)("span",{className:"memori-select--icon",children:(0,s.jsx)(hj,{})})]}),(0,s.jsx)(tp,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(dj.Options,{className:"memori-select--options",children:o.map((e=>(0,s.jsx)(dj.Option,{value:e.value,className:"memori-select--option",children:e.label},e.value)))})})]})});const bj={muteSpeaker:"@memori:muteSpeaker",microphoneMode:"@memori:microphoneMode",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",sendOnEnter:"@memori:sendOnEnter",birthDate:"@memori:birthDate",controlsPosition:"@memori:controlsPosition",hideEmissions:"@memori:hideEmissions",loginToken:"@memori:loginToken",location:"@memori:location"},Sj=(e,t)=>{var n;try{const r=window.localStorage.getItem(null!==(n=bj[e])&&void 0!==n?n:e);if(!r)return t;try{return JSON.parse(r)}catch(e){return r}}catch(e){return console.error("error",e),t}},xj=(e,t)=>{var n;try{window.localStorage.setItem(null!==(n=bj[e])&&void 0!==n?n:e,t.toString())}catch(e){console.error("error",e)}},_j=e=>{var t;try{window.localStorage.removeItem(null!==(t=bj[e])&&void 0!==t?t:e)}catch(e){console.error("error",e)}},wj=[2,3,5,10,15,20,30,60];var Cj=({open:e,layout:t="DEFAULT",onClose:n,microphoneMode:r="HOLD_TO_TALK",continuousSpeechTimeout:i,setMicrophoneMode:o,setContinuousSpeechTimeout:a,controlsPosition:l,setControlsPosition:c,hideEmissions:u,setHideEmissions:d,additionalSettings:h})=>{const{t:p}=Se();return(0,s.jsxs)(_f,{className:"memori-settings-drawer",open:e,onClose:n,title:p("widget.settings")||"Settings",description:p("write_and_speak.settingsHeaderLabel"),children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#microphoneMode",children:[p("write_and_speak.microphoneMode")||"Microphone mode",":"]}),(0,s.jsxs)(OS,{id:"microphoneMode",name:"microphoneMode",value:r,defaultValue:r,className:"memori-settings-drawer--microphoneMode-radio",onChange:e=>{let t="CONTINUOUS"===e?"CONTINUOUS":"HOLD_TO_TALK";o(t),xj("microphoneMode",t)},children:[(0,s.jsx)(OS.Option,{value:"HOLD_TO_TALK",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Sf,{primary:e,outlined:!e,children:p("write_and_speak.holdToSpeak")||"Hold to speak"})}),(0,s.jsx)(OS.Option,{value:"CONTINUOUS",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Sf,{primary:e,outlined:!e,children:p("write_and_speak.continuousSpeechLabel")||"Continuous speech"})})]})]}),"CONTINUOUS"===r&&(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(yj,{label:p("write_and_speak.secondsLabel")||"Seconds",placeholder:p("write_and_speak.secondsLabel")||"Seconds",options:wj.map((e=>({value:e,label:e}))),value:i,onChange:e=>{a(e),xj("continuousSpeechTimeout",e)}})}),"TOTEM"===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#controlsPosition",children:[p("write_and_speak.controlsPosition")||"Controls",":"]}),(0,s.jsxs)(OS,{id:"controlsPosition",name:"controlsPosition",value:l,defaultValue:l,className:"memori-settings-drawer--controlsposition-radio",onChange:e=>{c(e),xj("controlsPosition",e)},children:[(0,s.jsx)(OS.Option,{value:"center",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Sf,{primary:e,outlined:!e,children:p("center")||"Center"})}),(0,s.jsx)(OS.Option,{value:"bottom",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Sf,{primary:e,outlined:!e,children:p("bottom")||"Bottom"})})]})]}),(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(vj,{label:p("write_and_speak.hideEmissionsLabel")||"Hide emissions",name:"hideControls",checked:u,onChange:e=>{d(e.target.checked),xj("hideEmissions",e.target.checked)}})})]}),h&&(0,s.jsx)("div",{className:"memori-settings-drawer--field controls",children:h})]})};c=o("85Hg2");var Aj=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"})});var Ej=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M15 18L9 12 15 6"})});var Tj=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M9 18L15 12 9 6"})});var Mj=({apiURL:e,sessionID:n,memori:r,visible:i=!0,initialKnownFacts:o=[],closeDrawer:a})=>{var l;const{t:u}=Se(),d=Q(e),{getKnownFactsPaginated:h,deleteKnownFact:p}=d.knownFacts,[f,m]=(0,c.useState)(o),[g,v]=(0,c.useState)(25),[y,b]=(0,c.useState)(0),[S,x]=(0,c.useState)(null!==(l=null==o?void 0:o.length)&&void 0!==l?l:0),[_,w]=(0,c.useState)(!1),C=async(e,r,i)=>{if(n||e){w(!0);try{const{knownFacts:o,count:s,...a}=await h(null!=e?e:n,null!=r?r:y,null!=i?i:g);m(null!=o?o:[]),x(null!=s?s:0),0!==a.resultCode&&(console.error(a),t(Ku).error(u(zv(a.resultCode))))}catch(e){console.error("KNOWN_FACTS/FETCH",e),m(null!=o?o:[])}w(!1)}};(0,c.useEffect)((()=>{C()}),[]);const[A,E]=(0,c.useState)(!1),[T,M]=(0,c.useState)(),[I,R]=(0,c.useState)([]);return(0,s.jsxs)(_f,{open:i,width:"80%",className:"memori-known-facts-drawer",onClose:()=>a(),title:u("knownFacts.title"),children:[(0,s.jsx)("p",{children:u("knownFacts.description",{memoriName:r.name})}),(0,s.jsxs)(bf,{spinning:_,children:[(0,s.jsxs)("div",{className:"memori-known-facts-actions",children:[(0,s.jsxs)(Sf,{primary:!0,danger:!0,onClick:()=>{E(!0)},className:"memori-known-facts-delete-selected",disabled:0===(null==I?void 0:I.length),icon:(0,s.jsx)(Aj,{}),loading:_,children:[u("selected")," (",null==I?void 0:I.length,")"]}),(0,s.jsx)(Fm,{className:"memori-known-facts-modal",open:A,closable:!0,title:I.length>1?u("knownFacts.deleteSelectedConfirmTitle"):u("knownFacts.deleteConfirmTitle"),description:I.length>1?u("knownFacts.deleteSelectedConfirmMessage",{number:I.length}):u("knownFacts.deleteConfirmMessage"),onClose:()=>{E(!1)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Sf,{ghost:!0,onClick:()=>{E(!1)},children:u("cancel")}),(0,s.jsx)(Sf,{primary:!0,danger:!0,onClick:async()=>{try{const e=I.map((e=>p(n,e)));Promise.all(e).then((e=>{if(e.every((e=>0===e.resultCode)))t(Ku).success(u("knownFacts.deleteSuccess")),R([]),C(),E(!1);else{let n=e.find((e=>0!==e.resultCode));console.error(n),void 0!==(null==n?void 0:n.resultCode)&&t(Ku).error(u(zv(null==n?void 0:n.resultCode)))}}))}catch(e){let n=e;t(Ku).error(u("Error")+n.message)}},children:u("confirm")})]})})]}),S>25&&(0,s.jsxs)("nav",{className:"memori--table--pagination",children:[S>g&&(0,s.jsxs)("div",{className:"memori--table--pagination--pages",children:[(0,s.jsx)(Sf,{shape:"circle",disabled:0===y||y<g,padded:!1,title:u("previous")||"Previous",icon:(0,s.jsx)(Ej,{}),onClick:()=>{let e=(y/g-1)*g;b(e),C(void 0,e,g)}}),(0,s.jsxs)("span",{className:"memori--table--pagination--pages--current",children:[Math.ceil(y/g)+1," /"," ",Math.ceil(S/g)]}),(0,s.jsx)(Sf,{shape:"circle",padded:!1,title:u("next")||"Next",icon:(0,s.jsx)(Tj,{}),disabled:(y/g+1)*g>=S,onClick:()=>{let e=(y/g+1)*g;b(e),C(void 0,e,g)}})]}),(0,s.jsx)(yj,{options:[{label:`25 / ${u("page")||"page"}`,value:25},{label:`50 / ${u("page")||"page"}`,value:50},{label:`100 / ${u("page")||"page"}`,value:100}],value:g,displayValue:`${g} / ${u("page")||"page"}`,onChange:e=>{v(e),b(0),C(void 0,0,e)}})]}),(0,s.jsxs)("table",{className:"memori--table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(vj,{checked:!!(null==f?void 0:f.length)&&(null==I?void 0:I.length)===f.length,indeterminate:!!(null==f?void 0:f.length)&&!!(null==I?void 0:I.length)&&(null==I?void 0:I.length)!==(null==f?void 0:f.length),onChange:e=>{e.target.checked?R(f.map((e=>e.knownFactID))):R([])}})}),(0,s.jsx)("th",{children:u("knownFacts.text")}),(0,s.jsx)("th",{className:"mobile-hidden",children:u("createdAt")}),(0,s.jsx)("th",{className:"memori--table--column-right",children:u("actions")})]})}),(0,s.jsx)("tbody",{children:f.map((e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(vj,{checked:null==I?void 0:I.includes(e.knownFactID),onChange:t=>{t.target.checked?R((t=>[...new Set([...t,e.knownFactID])])):R((t=>t.filter((t=>t!==e.knownFactID))))}})}),(0,s.jsx)("td",{children:e.text}),(0,s.jsx)("td",{className:"mobile-hidden",children:(0,s.jsx)("span",{className:"memori--table--date",children:e.creationTimestamp?new Intl.DateTimeFormat("it",{dateStyle:"short",timeStyle:"short"}).format(new Date(e.creationTimestamp)):"-"})}),(0,s.jsx)("td",{className:"memori--table--column-right",children:(0,s.jsxs)("div",{className:"memori--table--action-column",children:[(0,s.jsx)(Sf,{danger:!0,ghost:!0,shape:"circle",icon:(0,s.jsx)(Aj,{}),disabled:(null==I?void 0:I.length)>0,title:u("delete")||"Delete",onClick:()=>M(e.knownFactID)}),(0,s.jsx)(Fm,{className:"memori-known-facts-modal",open:T===e.knownFactID,closable:!0,title:u("knownFacts.deleteConfirmTitle"),description:u("knownFacts.deleteConfirmMessage"),onClose:()=>{M(void 0)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Sf,{ghost:!0,onClick:()=>{M(void 0)},children:u("cancel")}),(0,s.jsx)(Sf,{primary:!0,danger:!0,onClick:async()=>{try{const r=await p(n,e.knownFactID);0===r.resultCode?(t(Ku).success(u("knownFacts.deleteSuccess")),R([]),C(),M(void 0)):(console.error(r),t(Ku).error(u(zv(r.resultCode),{ns:"common"})))}catch(e){let n=e;t(Ku).error(u("Error")+n.message)}},children:u("confirm")})]})})]})})]},e.knownFactID)))})]})]})]})};var Ij=({open:e=!1,baseUrl:t,apiUrl:n,tenant:r,experts:i,onClose:o})=>{const{t:a}=Se();return(0,s.jsx)(_f,{open:e,onClose:o,className:"memori--experts-drawer",title:(0,s.jsx)("h2",{className:"memori--experts-drawer--title",children:a("widget.expertsInTheBoard")}),children:(0,s.jsx)("ul",{className:"memori--experts-drawer--list",children:i.map((e=>(0,s.jsxs)("li",{className:"memori--experts-drawer--item",children:[(0,s.jsx)("figure",{className:"memori--experts-drawer--avatar",children:(0,s.jsx)("img",{src:`${n}/api/v1/memoriai/memori/avatar/${e.expertMemoriID}`,alt:e.name,onError:e=>{e.currentTarget.src=lv({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:t}),e.currentTarget.onerror=null}})}),(0,s.jsxs)("div",{className:"memori--experts-drawer--content",children:[(0,s.jsx)("h3",{className:"memori--experts-drawer--name",children:e.name}),(0,s.jsx)("p",{className:"memori--experts-drawer--description",children:e.description})]})]},e.expertID)))})})};c=o("85Hg2");const Rj=/^\w+([.-]?[+]?\w+)*@\w+([.-]?\w+)*(\.\w{2,})+$/;var Pj=({open:e=!1,onClose:n,onLogin:r,onLogout:i,user:o,loginToken:a,tenant:l,apiUrl:u,__TEST__needMissingData:d=!1})=>{var h;const{t:p,i18n:f}=Se(),m="it"===f.language?"it":"en",g=Q(u),{userLogin:v,updateUser:y}=g.backend,[b,S]=(0,c.useState)(!1),[x,_]=(0,c.useState)(d?{token:"token",birthDate:!0,tnCAndPPAccepted:!0}:{}),[w,C]=(0,c.useState)(null),[A,E]=(0,c.useState)(null);(0,c.useEffect)((()=>{E(window.location.href)}),[]);const T=(null==o?void 0:o.userID)&&a;return(0,s.jsx)(_f,{open:e,onClose:n,className:t(xs)("memori--login-drawer",{"memori--login-drawer--logged":T}),title:(0,s.jsx)("h2",{className:"memori--login-drawer--title",children:T?p("login.loggedDrawerTitle",{name:o.userName}):p("login.loginDrawerTitle")}),children:T?(0,s.jsx)("div",{className:"memori--login-drawer--logged",children:(0,s.jsx)(Sf,{primary:!0,onClick:()=>{i()},children:p("login.logout")})}):(null===(h=null==x?void 0:x.token)||void 0===h?void 0:h.length)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{children:p("login.missingData")}),(0,s.jsx)("p",{children:p("login.missingDataHelper")}),(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:async e=>{var n,i,s;e.preventDefault();const a=e.currentTarget,l=null===(n=a.birthDate)||void 0===n?void 0:n.value,c=null===(i=a.tnCAndPPAccepted)||void 0===i?void 0:i.checked,u=null===(s=a.pAndCUAccepted)||void 0===s?void 0:s.checked;if(!(null==o?void 0:o.userID)||!(null==x?void 0:x.token))return;if(!l||!c)return void C(p("missingData"));let d={userID:o.userID,birthDate:(null==o?void 0:o.birthDate)||!x.birthDate?void 0:l,tnCAndPPAccepted:c||(null==o?void 0:o.tnCAndPPAccepted),tnCAndPPAcceptanceDate:c?(new Date).toISOString():void 0,pAndCUAccepted:u||(null==o?void 0:o.pAndCUAccepted),pAndCUAcceptanceDate:u?(new Date).toISOString():void 0};const{user:h,...f}=await y(x.token,o.userID,d);0!==f.resultCode?(console.error(f),t(Ku).error(p(zv(f.resultCode),{ns:"common"})),C(f.resultMessage)):(t(Ku).success(p("success")),r(h||d,x.token))},children:[x.birthDate&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{htmlFor:"#birthDate",children:[p("login.birthDate"),(0,s.jsx)("input",{id:"birthDate",name:"birthDate",type:"date",required:!0,autoComplete:"bday"})]}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:p("login.birthDateHelper")})})]}),(null==x?void 0:x.tnCAndPPAccepted)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"tnCAndPPAccepted",className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[p("login.privacyLabel")," ",(0,s.jsx)("a",{href:`https://memori.ai/${m}/privacy_and_cookie`,target:"_blank",rel:"noopener noreferrer",children:p("login.privacyAndCookiePolicy")})," ",p("login.and")," ",(0,s.jsx)("a",{href:`https://memori.ai/${m}/tos`,target:"_blank",rel:"noopener noreferrer",children:p("login.termsOfService")})]})]}),(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"pAndCUAccepted",defaultChecked:null==o?void 0:o.pAndCUAccepted,className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[p("login.pAndCUAccepted")," ",(0,s.jsx)("small",{children:(0,s.jsxs)("em",{children:["(",p("login.optional"),")"]})})]})]}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:p("login.goToAccountToChangeYourPreferences")})}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:p("login.deepThoughtExplaination")})})]}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,loading:b,children:p("login.save")})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:e=>{e.preventDefault();const n=e.currentTarget,i=n.userNameOrEmail.value,o=n.password.value,s=Rj.test(i)?{tenant:null==l?void 0:l.id,eMail:i,password:o}:{tenant:null==l?void 0:l.id,userName:i,password:o};S(!0),C(null),v(s).then((e=>{var n,i,o,s;0!==e.resultCode?(console.error(e),t(Ku).error(p(zv(e.resultCode),{ns:"common"})),C(e.resultMessage)):e.user&&e.token&&(r(e.user,e.token),(null===(n=e.user)||void 0===n?void 0:n.tnCAndPPAccepted)&&(null===(i=e.user)||void 0===i?void 0:i.birthDate)||_({token:e.token,birthDate:!(null===(o=e.user)||void 0===o?void 0:o.birthDate),tnCAndPPAccepted:!(null===(s=e.user)||void 0===s?void 0:s.tnCAndPPAccepted)}))})).catch((e=>{console.error("[LOGIN]",e),t(Ku).error(e),e.message&&C(e.message)})).finally((()=>{S(!1)}))},children:[(0,s.jsxs)("label",{htmlFor:"#userNameOrEmail",children:[p("login.userNameOrEmail"),(0,s.jsx)("input",{id:"userNameOrEmail",name:"userNameOrEmail",required:!0,autoComplete:"email",placeholder:"Username/email"})]}),(0,s.jsxs)("label",{htmlFor:"#password",children:["Password",(0,s.jsx)("input",{id:"password",name:"password",type:"password",required:!0,autoComplete:"password",placeholder:"Password"})]}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,loading:b,children:p("login.login")}),(null==l?void 0:l.disableRegistration)?l.adminEmail?(0,s.jsxs)("div",{className:"memori--login-drawer--signup",children:[(0,s.jsx)("p",{children:p("login.registrationDisabled")}),(0,s.jsxs)("p",{children:[p("login.contactAdmin"),":"," ",(0,s.jsx)("a",{href:`mailto:${l.adminEmail}`,children:l.adminEmail})]})]}):null:(0,s.jsxs)("p",{className:"memori--login-drawer--signup",children:[p("login.newUserSignUp")," ",(0,s.jsx)("a",{href:`https://${l.name||"www.aisuru.com"}/${m}/auth?signup=1&redirectTo=${A}`,children:p("login.signUp")})]})]}),w&&(0,s.jsx)("p",{role:"alert",className:"memori--login-drawer--error",children:w})]})})};var kj=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:h,sessionId:p,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(bf,{spinning:g,children:[m&&d&&h&&(0,s.jsx)(d,{...h}),e&&t&&(0,s.jsx)(e,{...t}),(0,s.jsxs)("div",{className:"memori--grid",children:[(0,s.jsxs)("div",{className:"memori--grid-column memori--grid-column-left",children:[n&&r&&(0,s.jsx)(n,{...r}),(0,s.jsx)("div",{id:"extension"})]}),(0,s.jsx)("div",{className:"memori--grid-column memori--grid-column-right",children:p&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null}),v]})]})]});var Oj=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:h,sessionId:p,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(bf,{spinning:g,className:"memori-totem-layout",children:[v,m&&d&&h&&(0,s.jsx)(d,{...h}),(0,s.jsx)("div",{className:"memori-totem-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{className:"memori-totem-layout--avatar",children:n&&r&&(0,s.jsx)(n,{...r})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-totem-layout--controls",children:p&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]});var Nj=({Header:e,headerProps:t,Chat:n,chatProps:r,StartPanel:i,startPanelProps:o,integrationStyle:a,integrationBackground:l,ChangeMode:c,changeModeProps:u,sessionId:d,hasUserActivatedSpeak:h,showInstruct:p=!1,loading:f=!1,poweredBy:m})=>(0,s.jsxs)(s.Fragment,{children:[a,l,(0,s.jsxs)(bf,{spinning:f,className:"memori-chat-layout",children:[m,p&&c&&u&&(0,s.jsx)(c,{...u}),(0,s.jsx)("div",{className:"memori-chat-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-chat-layout--controls",children:d&&h&&n&&r?(0,s.jsx)(n,{...r}):o?(0,s.jsx)(i,{...o}):null})]})]});c=o("85Hg2"),c=o("85Hg2");var Lj=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:u,ChangeMode:d,changeModeProps:h,sessionId:p,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>{var y,b;const{t:S}=Se(),[x,_]=(0,c.useState)(!0),[w,C]=(0,c.useState)(),A=(0,c.useMemo)((()=>null==o?void 0:o.stopAudio),[null==o?void 0:o.stopAudio]),E=e=>{_(e),C(e?void 0:(new Date).toISOString());try{null==A||A()}catch(e){console.log(e)}};return(0,s.jsx)("div",{className:"memori-website_assistant--"+(x?"collapsed":"expanded"),children:x?(0,s.jsx)("div",{className:"memori-website_assistant--trigger",children:(0,s.jsx)(Sf,{className:"memori-website_assistant--trigger-button",ghost:!0,shape:"circle",onClick:()=>E(!1),title:S("expand")||"Expand",children:(0,s.jsx)(zF,{avatar:null==r?void 0:r.memori.avatarURL})})}):(0,s.jsxs)(s.Fragment,{children:[u,(0,s.jsxs)(bf,{spinning:g,className:"memori-website_assistant-layout",children:[v,(0,s.jsx)("div",{className:"memori-website_assistant--close-button-wrapper",children:(0,s.jsx)(Sf,{className:"memori-website_assistant--close-button",primary:!0,shape:"circle",onClick:()=>E(!0),icon:(0,s.jsx)(xf,{}),title:S("close")||"Close"})}),m&&d&&h&&(0,s.jsx)(d,{...h}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--header",children:e&&t&&(0,s.jsx)(e,{...t,showSettings:!1,showReload:!1})}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--avatar",children:n&&r&&(0,c.createElement)(n,{...r,integrationConfig:r.integrationConfig?{...r.integrationConfig,avatarURL:(null===(y=r.integrationConfig)||void 0===y?void 0:y.avatarURL)?`${null===(b=r.integrationConfig)||void 0===b?void 0:b.avatarURL.split("#")[0]}#${w}`:void 0}:{},key:w})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--controls",children:p&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]})})};const{deleteSession:Dj,getStatistics:Bj,initSession:zj}=Q(),Fj=new Map([[0,"🆕"],[10,"🐹"],[20,"🐇"],[30,"🐰"],[40,"💡"],[50,"🏆"],[60,"🏅"],[70,"🥉"],[80,"🥈"],[90,"🥇"],[100,"🔥"],[110,"🎓"],[120,"🤖"],[130,"👾"],[150,"🌍"],[180,"💜"],[200,"💙"],[250,"🧡"],[300,"💚"],[350,"💛"],[400,"💖"],[450,"💝"],[500,"🖤"],[550,"❤️"],[600,"🧠"]]),Uj=e=>{const t=Array.from(Fj.keys()).filter((t=>t<=e));if(t.length>0){const e=t[t.length-1];return Fj.get(e)}return""},jj=e=>{if("🆕"===e)return{points:10,badge:"🐹"};let t,n,r=!1;for(const[i,o]of Fj){if(r){t=i,n=o;break}o===e&&(r=!0)}return n&&t?{points:t,badge:n}:void 0},Hj=e=>{let t=0;for(const[n,r]of Fj)if(r===e){t=n;break}return t},Gj=e=>{const t=Math.round(e),n=Uj(t);return{points:t,badge:n,pointsForCurrentBadge:Hj(n),nextBadge:jj(n)}},Vj=(e,t=!0,n=!1,r,i=!1,o=!1)=>{const s=new CustomEvent("MemoriTextEntered",{detail:{text:e,waitForPrevious:t,hidden:n,typingText:r,useLoaderTextAsMsg:i,hasBatchQueued:o}});document.dispatchEvent(s);window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak"))}),300)};let Wj,qj,Kj,Jj,Qj,Yj;window.getMemoriState=e=>{var t,n,r,i,o;let s=e?document.querySelector(`.memori-widget[data-memori-integration="${e}"]`)||(null===(n=null===(t=document.querySelector("memori-client"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector(".memori-widget[data-memori-integration]")):document.querySelector(".memori-widget")||(null===(i=null===(r=document.querySelector("memori-client"))||void 0===r?void 0:r.shadowRoot)||void 0===i?void 0:i.querySelector(".memori-widget"));if(!s)return null;let a=null===(o=s.dataset)||void 0===o?void 0:o.memoriEngineState;return a?JSON.parse(a):null},window.typeMessage=Vj,window.typeMessageHidden=(e,t=!0,n,r=!1,i=!1)=>Vj(e,t,!0,n,r,i),window.typeBatchMessages=e=>{function t(){var e,t,n,r;null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e||e.setAttribute("disabled","");const i="opacity: 0.5; touch-action: none; pointer-events: none;";null===(t=document.querySelector("textarea.memori-chat-textarea--input"))||void 0===t||t.setAttribute("style",i),null===(n=document.querySelector("button.memori-chat-inputs--send"))||void 0===n||n.setAttribute("style",i),null===(r=document.querySelector("button.memori-chat-inputs--mic"))||void 0===r||r.setAttribute("style",i)}function n(){var e,t,n,r;null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e||e.removeAttribute("disabled"),null===(t=document.querySelector("textarea.memori-chat-textarea--input"))||void 0===t||t.removeAttribute("style"),null===(n=document.querySelector("button.memori-chat-inputs--send"))||void 0===n||n.removeAttribute("style"),null===(r=document.querySelector("button.memori-chat-inputs--mic"))||void 0===r||r.removeAttribute("style")}function r(){var e;return!!(null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e?void 0:e.hasAttribute("disabled"))}const i=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent),o=function*(){yield*e}();t();const s=()=>{const e=o.next(),a=e.value;if(a){r()||t();let o=a.waitForPrevious;i&&(o=!1),Vj(a.message,o,a.hidden,a.typingText,a.useLoaderTextAsMsg,!e.done),i&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak")),n()}),3e3)}else r()&&n();if(e.done)return document.removeEventListener("MemoriEndSpeak",s),void(r()&&n())};document.addEventListener("MemoriEndSpeak",s),s()};let Zj,Xj=!1,$j=!1;var eH=({memori:e,memoriConfigs:n,memoriLang:r,multilingual:i,integration:o,layout:a="DEFAULT",customLayout:l,showInstruct:u=!1,showShare:d,preview:h=!1,embed:p=!1,showInputs:f=!0,showDates:m=!1,showContextPerLine:g=!1,showSettings:v=!0,showTypingText:y=!1,showClear:b=!1,showLogin:S=!1,showOnlyLastMessages:x,height:_="100vh",secret:w,baseUrl:C="https://aisuru.com",apiUrl:A="https://backend.memori.ai",initialContextVars:E,initialQuestion:T,ogImage:M,sessionID:I,tenant:R,personification:P,authToken:k,AZURE_COGNITIVE_SERVICES_TTS_KEY:O,defaultSpeakerActive:N=!0,onStateChange:L,additionalInfo:D,additionalSettings:B,customMediaRenderer:z,userAvatar:F})=>{var U,j,H,G,V,W,q,K,J,Y,Z,X,$,ee,te,ne,re,ie,oe,se,ae,le,ce,ue;const{t:de,i18n:he}=Se(),[pe,fe]=(0,c.useState)(!1);(0,c.useEffect)((()=>{fe(!0)}),[]);const me=Q(A),{initSession:ge,postTextEnteredEvent:ve,postPlaceChangedEvent:ye,postDateChangedEvent:be,postTimeoutEvent:xe,postTagChangedEvent:_e,getSession:we,getContentQualityIndexes:Ce,getExpertReferences:Ae}=me,[Ee,Te]=(0,c.useState)(!1),[Me,Ie]=(0,c.useState)(null!==(U=null==D?void 0:D.loginToken)&&void 0!==U?U:k),[Re,Pe]=(0,c.useState)({avatarURL:"string"==typeof F?F:void 0});(0,c.useEffect)((()=>{Me&&!(null==Re?void 0:Re.userID)&&S&&me.backend.getCurrentUser(Me).then((({user:e,resultCode:t})=>{e&&0===t?(Pe(e),xj("loginToken",Me)):_j("loginToken")}))}),[Me,null==Re?void 0:Re.userID]);const[ke,Oe]=(0,c.useState)(!1),[Ne,Le]=(0,c.useState)(!1),[De,Be]=(0,c.useState)(!1),ze=(null===(G=null===(H=null===(j=e.culture)||void 0===j?void 0:j.split("-"))||void 0===H?void 0:H[0])||void 0===G?void 0:G.toUpperCase())||(null===(K=null===(q=null===(W=null===(V=null==n?void 0:n.find((t=>t.memoriConfigID===e.memoriConfigurationID)))||void 0===V?void 0:V.culture)||void 0===W?void 0:W.split("-"))||void 0===q?void 0:q[0])||void 0===K?void 0:K.toUpperCase()),Fe=(null==o?void 0:o.customData)?JSON.parse(o.customData):null,Ue=void 0!==i?i:!!(null==Fe?void 0:Fe.multilanguage),[je,He]=(0,c.useState)(null!==(X=null!==(Z=null!==(Y=null!==(J=null!=r?r:null==Fe?void 0:Fe.lang)&&void 0!==J?J:ze)&&void 0!==Y?Y:null==Fe?void 0:Fe.uiLang)&&void 0!==Z?Z:he.language)&&void 0!==X?X:"IT"),[Ge,Ve]=(0,c.useState)(!1),[We,qe]=(0,c.useState)(!1),[Ke,Je]=(0,c.useState)(),Qe=a||(null==Fe?void 0:Fe.layout)||"DEFAULT",[Ye,Ze]=(0,c.useState)(!1),[Xe,$e]=(0,c.useState)(!1),[et,tt]=(0,c.useState)(!1),[nt,rt]=(0,c.useState)(!1),[it,ot]=(0,c.useState)(!1),[st,at]=(0,c.useState)(!1),[lt,ct]=(0,c.useState)(!N),[ut,dt]=(0,c.useState)(!1),[ht,pt]=(0,c.useState)(2),[ft,mt]=(0,c.useState)(!1),[gt,vt]=(0,c.useState)("center"),[yt,bt]=(0,c.useState)(!1);(0,c.useEffect)((()=>{mt(!!Kj),$j=!!Kj}),[Kj]),(0,c.useEffect)((()=>{let e="bottom",t=Sj("microphoneMode","HOLD_TO_TALK");window.innerWidth<=768?(e="bottom",t="HOLD_TO_TALK"):e=window.matchMedia("(orientation: portrait)").matches||window.innerHeight>window.innerWidth?"center":"bottom",ct(Sj("muteSpeaker",!N)),Xj=Sj("muteSpeaker",!N),dt("CONTINUOUS"===t),pt(Sj("continuousSpeechTimeout",2)),vt(Sj("controlsPosition",e)),bt(Sj("hideEmissions",!1)),(null==D?void 0:D.loginToken)||k||(Ie(Sj("loginToken",void 0)),Zj=Sj("loginToken",void 0))}),[]);const[St,xt]=(0,c.useState)(w),[_t,wt]=(0,c.useState)(),[Ct,At]=(0,c.useState)(null),[Et,Tt]=(0,c.useState)(),Mt=async(e,t)=>{var n;const r=null!=t?t:Gt;if(e&&r){const{currentState:t,...i}=await ye({sessionId:r,placeName:e.placeName,latitude:e.latitude,longitude:e.longitude,uncertaintyKm:null!==(n=e.uncertainty)&&void 0!==n?n:0});t&&0===i.resultCode&&qt((e=>{var n;return{...e,...t,hints:(null===(n=t.hints)||void 0===n?void 0:n.length)?t.hints:null==e?void 0:e.hints}}))}};(0,c.useEffect)((()=>{const e=Sj("position",void 0);e&&Tt(e)}),[]);const[It,Rt]=(0,c.useState)(""),[Pt,kt]=(0,c.useState)(!1),[Ot,Nt]=(0,c.useState)([]),Lt=e=>{Nt((t=>{var n,r;return[...t,{...e,media:null!==(r=null===(n=e.media)||void 0===n?void 0:n.filter((e=>{var t;return!("text/javascript"===e.mimeType&&(null===(t=e.properties)||void 0===t?void 0:t.executable))})))&&void 0!==r?r:[]}]}))},Dt=async(n,r,i,o=!0,s,a=!1,l,c=!1,u=!1)=>{var d,h,p,f;const m=i||Gt||(null===(d=window.getMemoriState())||void 0===d?void 0:d.sessionID);if(!m||!(null==n?void 0:n.length))return;a||Lt({text:n,translatedText:s,fromUser:!0,media:null!=r?r:[],initial:Gt?!!i&&i!==Gt:!!i}),qe(!0),Je(l);let g=n,v=!1;if(o&&!Ee&&Ue&&je.toUpperCase()!==ze.toUpperCase()){g=(await aS(n,ze,je,C)).text}const{currentState:y,...b}=await ve({sessionId:m,text:g});if(0===b.resultCode&&y){const n=c&&l?l:null!==(h=y.emission)&&void 0!==h?h:null==Wt?void 0:Wt.emission;if("X4"===y.state&&e.giverTag){const{currentState:r,...i}=await _e(m,e.giverTag);0===i.resultCode?(Kt(r),n&&(Lt({text:n,emitter:r.emitter,media:r.media,fromUser:!1,questionAnswered:g,contextVars:r.contextVars,date:r.currentDate,placeName:r.currentPlaceName,placeLatitude:r.currentLatitude,placeLongitude:r.currentLongitude,placeUncertaintyKm:r.currentUncertaintyKm,tag:r.currentTag}),dn(n))):(console.error(b,i),t(Ku).error(de(zv(i.resultCode))),v=!0)}else if("X2d"===y.state&&e.giverTag){const{currentState:r,...i}=await ve({sessionId:m,text:Math.random().toString().substring(2,8)});if(0===i.resultCode){const{currentState:r,...i}=await _e(m,e.giverTag);0===i.resultCode?(Kt(r),n&&(Lt({text:n,emitter:r.emitter,media:r.media,fromUser:!1,questionAnswered:g,contextVars:r.contextVars,date:r.currentDate,placeName:r.currentPlaceName,placeLatitude:r.currentLatitude,placeLongitude:r.currentLongitude,placeUncertaintyKm:r.currentUncertaintyKm,tag:r.currentTag}),dn(n))):(console.error(b,i),t(Ku).error(de(zv(i.resultCode))),v=!0)}else console.error(b,i),t(Ku).error(de(zv(i.resultCode))),v=!0}else je.toLowerCase()!==ze.toLowerCase()&&n&&!Ee&&Ue?Bt(y,je,g).then((e=>{e.emission&&dn(e.emission)})):(Kt({...y,emission:n}),n&&(Lt({text:n,emitter:y.emitter,media:y.media,fromUser:!1,questionAnswered:g,generatedByAI:!!y.completion,contextVars:y.contextVars,date:y.currentDate,placeName:y.currentPlaceName,placeLatitude:y.currentLatitude,placeLongitude:y.currentLongitude,placeUncertaintyKm:y.currentUncertaintyKm,tag:y.currentTag}),dn(n)))}else 404===b.resultCode&&(Nt((e=>[...e.slice(0,e.length-1)])),Qt(!1,St||e.secretToken,_t,Ee&&e.giverTag?e.giverTag:void 0,Ee&&e.giverPIN?e.giverPIN:void 0,{PATHNAME:window.location.pathname,ROUTE:(null===(f=null===(p=window.location.pathname)||void 0===p?void 0:p.split("/"))||void 0===f?void 0:f.pop())||"",...E||{}},T).then((e=>{console.info("session timeout"),(null==e?void 0:e.sessionID)&&setTimeout((()=>{Dt(n,r,null==e?void 0:e.sessionID)}),500)})));u||(Je(void 0),qe(!1))},Bt=async(e,t,n)=>{var r,i,o;const s=null!==(r=e.emission)&&void 0!==r?r:null==Wt?void 0:Wt.emission;let a={...e},l=null;if(s&&!Ee&&ze.toUpperCase()!==t.toUpperCase()&&Ue){const r=await aS(s,t,ze,C);if(e.hints&&e.hints.length>0){const n=await Promise.all((null!==(i=e.hints)&&void 0!==i?i:[]).map((async e=>{var n;const r=await aS(e,t,ze,C);return{text:null!==(n=null==r?void 0:r.text)&&void 0!==n?n:e,originalText:e}})));a={...e,emission:r.text,translatedHints:n}}else a={...e,emission:r.text,hints:null!==(o=e.hints)&&void 0!==o?o:"G1"===e.state?null==Wt?void 0:Wt.hints:[]};r.text.length>0&&(l={text:r.text,emitter:e.emitter,media:e.media,fromUser:!1,questionAnswered:n,generatedByAI:!!e.completion,contextVars:e.contextVars,date:e.currentDate,placeName:e.currentPlaceName,placeLatitude:e.currentLatitude,placeLongitude:e.currentLongitude,placeUncertaintyKm:e.currentUncertaintyKm,tag:e.currentTag})}else a={...e,emission:s},s&&(l={text:s,emitter:e.emitter,media:e.media,fromUser:!1,questionAnswered:n,contextVars:e.contextVars,date:e.currentDate,placeName:e.currentPlaceName,placeLatitude:e.currentLatitude,placeLongitude:e.currentLongitude,placeUncertaintyKm:e.currentUncertaintyKm,tag:e.currentTag});return Kt(a),l&&Lt(l),a},zt=void 0!==e.ageRestriction?e.ageRestriction:e.nsfw?18:e.enableCompletions?14:0,[Ft,Ut]=(0,c.useState)(),[jt,Ht]=(0,c.useState)(!1),[Gt,Vt]=(0,c.useState)(I),[Wt,qt]=(0,c.useState)(),Kt=e=>{var t;qt(e),L&&L(e);const n=null===(t=null==e?void 0:e.media)||void 0===t?void 0:t.filter((e=>{var t;return"text/javascript"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)}));null==n||n.forEach((e=>{try{setTimeout((()=>{var t;console.log("snippet",e),new Function(null!==(t=e.content)&&void 0!==t?t:"")(),setTimeout((()=>{var e,t,n;null===(e=document.querySelector(".memori-chat--content"))||void 0===e||e.scrollTo(0,null!==(n=null===(t=document.querySelector(".memori-chat--content"))||void 0===t?void 0:t.scrollHeight)&&void 0!==n?n:0)}),400)}),1e3)}catch(e){console.error(e)}}))},Jt=async n=>{var r,i,o,s,a;let l=Sj("birthDate",void 0);if(Ft||l||!zt)if("PUBLIC"===e.privacyType||e.secretToken||St||_t){Ve(!0);try{if(!e.giverTag&&(null===(r=e.receivedInvitations)||void 0===r?void 0:r.length)){let t=e.receivedInvitations.find((e=>"GIVER"===e.type&&"ACCEPTED"===e.state));t&&(e.giverTag=t.tag,e.giverPIN=t.pin)}let l;try{l=window.location.href}catch(e){console.error(e)}const c=await ge({...n,tag:null!==(i=n.tag)&&void 0!==i?i:null==P?void 0:P.tag,pin:null!==(o=n.pin)&&void 0!==o?o:null==P?void 0:P.pin,additionalInfo:{...D||{},loginToken:null!==(a=null!==(s=null!=Zj?Zj:Me)&&void 0!==s?s:null==D?void 0:D.loginToken)&&void 0!==a?a:k,language:an(je),referral:l}});if((null==c?void 0:c.sessionID)&&(null==c?void 0:c.currentState)&&0===c.resultCode)return Vt(c.sessionID),Et&&Mt(Et,c.sessionID),Ve(!1),{dialogState:c.currentState,sessionID:c.sessionID};(null==c?void 0:c.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(c),t(Ku).error(de("underageTwinSession",{age:zt})),Be(!0)):403===(null==c?void 0:c.resultCode)?(xt(void 0),At("password")):(console.error(c),t(Ku).error(de(zv(null==c?void 0:c.resultCode))),Be(!0))}catch(e){console.error(e),new Error("Error fetching session")}}else At("password");else Ht(!0)},Qt=async(n=!1,r,i,o,s,a,l,c)=>{var u,d,h,p,f;Ve(!0);try{let m,g=Sj("birthDate",void 0);if(!c&&!g&&zt)return void Ht(!0);if(!("PUBLIC"===e.privacyType||r||e.secretToken||St||i||_t))return void At("password");try{m=window.location.href}catch(e){console.error(e)}const{sessionID:v,currentState:y,...b}=await ge({memoriID:null!==(u=e.engineMemoriID)&&void 0!==u?u:"",password:r||St||e.secretToken,recoveryTokens:i||_t,tag:o,pin:s,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(h=null===(d=window.location.pathname)||void 0===d?void 0:d.split("/"))||void 0===h?void 0:h.pop())||"",...a||{}},initialQuestion:l,birthDate:c||g||void 0,additionalInfo:{...D||{},loginToken:null!==(f=null!==(p=null!=Zj?Zj:Me)&&void 0!==p?p:null==D?void 0:D.loginToken)&&void 0!==f?f:k,language:an(je),referral:m}});if(v&&y&&0===b.resultCode)return Vt(v),n&&(Kt(y),y.emission&&(Ot.length<=1?Nt([{text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0,contextVars:y.contextVars,date:y.currentDate,placeName:y.currentPlaceName,placeLatitude:y.currentLatitude,placeLongitude:y.currentLongitude,placeUncertaintyKm:y.currentUncertaintyKm,tag:y.currentTag}]):Lt({text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0,contextVars:y.contextVars,date:y.currentDate,placeName:y.currentPlaceName,placeLatitude:y.currentLatitude,placeLongitude:y.currentLongitude,placeUncertaintyKm:y.currentUncertaintyKm,tag:y.currentTag}))),Et&&Mt(Et,v),e.needsDateTime&&Zt({sessionID:v,state:y}),Ve(!1),{dialogState:y,sessionID:v};(null==b?void 0:b.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(b),t(Ku).error(de("underageTwinSession",{age:zt})),Be(!0)):403===(null==b?void 0:b.resultCode)?(xt(void 0),At("password")):(console.error(b),t(Ku).error(de(zv(b.resultCode))),Be(!0))}catch(e){console.error(e)}return Ve(!1),null},Yt=async(t,n,r,i)=>{var o,s,a,l,c;if(!t||!n)return console.error("CHANGETAG/Session not found"),Promise.reject("Session not found");try{const{currentState:t,resultCode:u}=await _e(n,null!=r?r:jv);if(0===u){let d=0;if(r!==jv&&i&&("X1a"===t.state||"X1b"===t.state)){const{resultCode:e}=await ve({sessionId:n,text:null!=i?i:""});d=e}if(0===d){const{currentState:e,...t}=await we(n);if(0===t.resultCode&&e)return{currentState:e,sessionId:n,...t}}else if([400,401,403,404,500].includes(u)){console.warn("[APPCONTEXT/CHANGETAG]",u);let t,n=Sj("birthDate",void 0);try{t=window.location.href}catch(e){console.error(e)}Jt({memoriID:null!==(o=e.engineMemoriID)&&void 0!==o?o:"",password:w||St||e.secretToken,tag:e.giverTag,pin:e.giverPIN,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(a=null===(s=window.location.pathname)||void 0===s?void 0:s.split("/"))||void 0===a?void 0:a.pop())||"",...E||{}},initialQuestion:T,birthDate:Ft||n||void 0,additionalInfo:{...D||{},loginToken:null!==(c=null!==(l=null!=Zj?Zj:Me)&&void 0!==l?l:null==D?void 0:D.loginToken)&&void 0!==c?c:k,language:an(je),referral:t}})}else if(t)return{currentState:t,sessionId:n,resultCode:u}}}catch(e){let t=e;return console.error("[APPCONTEXT/CHANGETAG]",t),Promise.reject(t)}return null};(0,c.useEffect)((()=>()=>{Wt&&(null==Wt?void 0:Wt.currentTag)===e.giverTag||(async()=>{Gt&&e.giverTag&&e.giverPIN&&(Nt([]),await Yt(e.engineMemoriID,Gt,e.giverTag,e.giverPIN))})()}),[]);const Zt=(0,c.useCallback)((async({sessionID:t,date:n,state:r})=>{var i;const o=null!=t?t:Gt,s=null!=r?r:Wt;if(!o||!e.needsDateTime||(null===(i=null==s?void 0:s.hints)||void 0===i?void 0:i.length))return;const a=(n?_s.DateTime.fromISO(n):_s.DateTime.now()).toUTC().toFormat("yyyy/MM/dd HH:mm:ss ZZ").split(":").slice(0,-1).join(":"),{currentState:l,...c}=await be(o,a);0===c.resultCode&&l&&qt((e=>{var t;return{...e,...l,hints:(null===(t=l.hints)||void 0===t?void 0:t.length)?l.hints:null==e?void 0:e.hints}}))}),[Wt,e.needsDateTime,Gt]);(0,c.useEffect)((()=>{if(Gt&&e.needsDateTime){Zt({sessionID:Gt,state:Wt});let e=setInterval((()=>{Zt({sessionID:Gt})}),6e4);return()=>{clearInterval(e)}}}),[e.needsDateTime,Gt]);const[Xt,$t]=(0,c.useState)(),en=(0,c.useRef)(),tn=()=>{Xt&&(clearTimeout(Xt),$t(void 0)),(null==en?void 0:en.current)&&(clearTimeout(en.current),en.current=void 0)},nn=()=>{tn(),!(null==Wt?void 0:Wt.acceptsTimeout)||Kj||ft||It.length||We||Pt||on()},rn=async()=>{var e;if(Kj||ft||It.length||We||Pt)nn();else if(Gt&&Ye&&(null==Wt?void 0:Wt.acceptsTimeout)){const{currentState:t,...n}=await xe(Gt);if(0===n.resultCode&&t){const n=t.emission;!Ee&&Ue&&je!==(null==he?void 0:he.language)&&n&&n.length>0?Bt({...t,emission:n},je).then((e=>{e.emission&&dn(e.emission)})):n&&n.length>0&&(Lt({text:n,emitter:t.emitter,media:t.media,fromUser:!1,generatedByAI:!!t.completion,contextVars:t.contextVars,date:t.currentDate,placeName:t.currentPlaceName,placeLatitude:t.currentLatitude,placeLongitude:t.currentLongitude,placeUncertaintyKm:t.currentUncertaintyKm,tag:t.currentTag}),dn(n),Kt({...t,hints:null!==(e=t.hints)&&void 0!==e?e:"G1"===t.state?null==Wt?void 0:Wt.hints:[]}))}}},on=()=>{let e=null==Wt?void 0:Wt.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==Wt?void 0:Wt.emission){e+=Wt.emission.length/26.5}}let t=setTimeout(rn,1e3*e);$t(t),en.current=t};(0,c.useEffect)((()=>{(It.length||ft||We)&&tn(),Gt&&!It.length&&nn()}),[null==Wt?void 0:Wt.acceptsTimeout,null==Wt?void 0:Wt.timeout,null==Wt?void 0:Wt.state,ft,Gt,Ot,It,We]),(0,c.useEffect)((()=>()=>{Ze(!1),Le(!1),tn(),en.current=void 0}),[]);const sn=(0,c.useCallback)((t=>{var n,r,i,o;let s="",a=(null!==(o=null!==(i=null!=t?t:null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])&&void 0!==i?i:he.language)&&void 0!==o?o:"IT").toUpperCase(),l=e.voiceType;if(e.enableBoardOfExperts&&(null==Wt?void 0:Wt.emitter)){null==Hn||Hn.find((e=>e.name===(null==Wt?void 0:Wt.emitter)))}switch(a){case"IT":s=""+("MALE"===l?"it-IT-DiegoNeural":"it-IT-ElsaNeural");break;case"DE":s=""+("MALE"===l?"de-DE-ConradNeural":"de-DE-KatjaNeural");break;case"EN":s=""+("MALE"===l?"en-GB-RyanNeural":"en-GB-SoniaNeural");break;case"ES":s=""+("MALE"===l?"es-ES-AlvaroNeural":"es-ES-ElviraNeural");break;case"FR":s=""+("MALE"===l?"fr-FR-HenriNeural":"fr-FR-DeniseNeural");break;case"PT":s=""+("MALE"===l?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural");break;case"UK":s=""+("MALE"===l?"uk-UA-OstapNeural":"uk-UA-PolinaNeural");break;case"RU":s=""+("MALE"===l?"ru-RU-DmitryNeural":"ru-RU-SvetlanaNeural");break;case"PL":s=""+("MALE"===l?"pl-PL-MarekNeural":"pl-PL-AgnieszkaNeural");break;case"FI":s=""+("MALE"===l?"fi-FI-HarriNeural":"fi-FI-SelmaNeural");break;default:s=""+("MALE"===l?"it-IT-DiegoNeural":"it-IT-IsabellaNeural")}return s}),[e.voiceType,e.enableBoardOfExperts,null==Wt?void 0:Wt.emitter,he.language,e.culture]),an=t=>{var n,r;let i="";switch((t||(null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])||he.language||"IT").toUpperCase()){case"IT":default:i="it-IT";break;case"DE":i="de-DE";break;case"EN":i="en-GB";break;case"ES":i="es-ES";break;case"FR":i="fr-FR";break;case"PT":i="pt-PT";break;case"UK":i="uk-UK";break;case"RU":i="ru-RU";break;case"PL":i="pl-PL";break;case"FI":i="fi-FI"}return i},[ln,cn]=(0,c.useState)();(0,c.useEffect)((()=>{(async()=>{try{const e=await fetch(`${C||"https://aisuru.com"}/api/lexiconmap`);return await e.json()}catch(e){console.error(e)}})().then((e=>{cn(e)}))}),[]);const un=()=>{const e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e)},dn=e=>{if(!O||h)return void un();if(xn(),h)return;if(lt||Xj)return $j=!1,qe(!1),un(),void(ut&&yn());Jj&&Jj.pause();let t=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),n=/iPad|iPhone|iPod/.test(navigator.userAgent);if("interrupted"===Qj.state)return void Qj.resume().then((()=>dn(e)));if("closed"===Qj.state){Qj=new Jo;let e=Qj.createBuffer(1,1e4,22050),t=Qj.createBufferSource();t.buffer=e,t.connect(Qj.destination)}else if("suspended"===Qj.state){hn(),Qj=new Jo;let e=Qj.createBuffer(1,1e4,22050),t=Qj.createBufferSource();t.buffer=e,t.connect(Qj.destination)}if(!Kj){n||(Jj=new ys.SpeakerAudioDestination);let e=ys.AudioConfig.fromSpeakerOutput(Jj);Kj=new ys.SpeechSynthesizer(qj,e)}const r=Qj.createBufferSource();r.addEventListener("ended",(()=>{mt(!1),$j=!1})),Jj.onAudioEnd=()=>{mt(!1),$j=!1,r.disconnect(),un(),En()},Kj.speakSsmlAsync(`<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" xml:lang="${an(je)}"><voice name="${sn(je)}"><s>${((e,t)=>{var n;if(!ln)return e;const r={...null!==(n=ln.common)&&void 0!==n?n:{},...(null==R?void 0:R.id)&&ln[R.id]?ln[R.id]:{}},i=Object.keys(r).map((e=>{var n;return{word:e,phoneme:null!==(n=r[e][t.toLowerCase()])&&void 0!==n?n:r[e].default,caseSensitive:r[e].caseSensitive}}));return i.reduce(((e,{word:t,phoneme:n,caseSensitive:r})=>e.replace(new RegExp(`\\b${t}\\b`,r?"g":"gi"),`<phoneme alphabet="ipa" ph="${n}">${t}</phoneme>`)),e)})((e=>{const t=document.createElement("textarea");return t.textContent=e,t.innerHTML})(em(e)),je.toLowerCase())}</s></voice></speak>`,(i=>{if(i){mt(!0),$j=!0;try{Qj.decodeAudioData(i.audioData,(function(e){r.buffer=e,r.connect(Qj.destination),(Ot.length<1||t&&n)&&r.start(0)})),Qj.onstatechange=()=>{"suspended"===Qj.state||"closed"===Qj.state?(r.disconnect(),mt(!1),$j=!1):"interrupted"===Qj.state&&Qj.resume()},Qj.resume(),Kj&&(Kj.close(),Kj=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),mt(!1),$j=!1,Kj&&(Kj.close(),Kj=null),un()}}else Qj.resume(),mt(!1),$j=!1,un()}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),mt(!1),$j=!1,un()})),qe(!1)},hn=()=>{mt(!1),$j=!1;try{Kj&&(Kj.close(),Kj=null),"closed"!==Qj.state&&Qj.close(),Jj&&(Jj.pause(),Jj.close())}catch(e){console.error("stopAudio error: ",e)}};(0,c.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==Wt?void 0:Wt.emission]);const[pn,fn]=(0,c.useState)(""),mn=()=>fn(""),[gn,vn]=(0,c.useState)(null),yn=()=>{let e=setTimeout((async()=>{_n();const e=$f(pn);e.length>0&&Pt?(Dt(e),mn(),Rt("")):Pt&&nn()}),1e3*ht);vn(e)},bn=()=>{gn&&(clearTimeout(gn),vn(null))};(0,c.useEffect)((()=>{bn(),ut&&yn(),nn()}),[pn]);const Sn=()=>{if(O){_n(),fn(""),mn();try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){$e(!0),qj||(qj=ys.SpeechConfig.fromSubscription(O,"eastus"),qj.speechRecognitionLanguage=an(je),qj.speechSynthesisLanguage=an(je),qj.speechSynthesisVoiceName=sn(je));const t=ys.AudioConfig.fromDefaultMicrophoneInput();Wj=new ys.SpeechRecognizer(qj,t),kt(!0),Wj.recognized=(e,t)=>{if(t.result.text)if(t.result.reason===ys.ResultReason.RecognizedSpeech){let e=t.result.text;if(fn(e||""),(null==e?void 0:e.length)>0){const t=$f(e);t.length>0&&Rt((e=>`${e} ${t}`))}}else t.result.reason===ys.ResultReason.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},Wj.canceled=(e,t)=>{t.reason===ys.CancellationReason.Error&&(console.debug(`"CANCELED: ErrorCode=${t.errorCode}`),console.debug(`"CANCELED: ErrorDetails=${t.errorDetails}`),console.debug("CANCELED: Did you set the speech resource key and region values?")),xn()},Wj.sessionStopped=(e,t)=>{xn()},mn(),Wj.startContinuousRecognitionAsync()})).catch(console.error)}catch(e){console.error(e)}}},xn=()=>{Wj&&(Wj.stopContinuousRecognitionAsync(),Wj.close(),Wj=null),kt(!1)},_n=()=>{$e(!1),xn(),bn()},wn=()=>{try{_n(),tn(),Le(!1),en.current=void 0,hn()}catch(e){console.log("Error: resetUIEffects",e)}};(0,c.useEffect)((()=>()=>{wn()}),[]),(0,c.useEffect)((()=>(document.addEventListener("MemoriResetUIEffects",wn),()=>{document.removeEventListener("MemoriResetUIEffects",wn)})),[]),(0,c.useEffect)((()=>{"Z0"===(null==Wt?void 0:Wt.state)&&_n()}),[null==Wt?void 0:Wt.state]);const[Cn,An]=(0,c.useState)(!1),En=(0,c.useCallback)((e=>{ft&&Kj&&(Kj.close(),Kj=null),!ut||!Xe&&Cn||(An(!0),Sn())}),[ut,Xe]);(0,c.useEffect)((()=>{Ot.length>1&&!ft&&ut&&(Xe||!Cn)?Sn():ft&&Pt&&xn()}),[ft]),(0,c.useEffect)((()=>{Pt&&(_n(),mn(),Rt(""),Sn())}),[ze]);const[Tn,Mn]=(0,c.useState)("keypress");(0,c.useEffect)((()=>{const e=Sj("sendOnEnter","keypress");window.innerWidth<=768?Mn("click"):Mn(e)}),[]),(0,c.useEffect)((()=>{xj("sendOnEnter",Tn)}),[Tn]);const[In,Rn]=(0,c.useState)(),Pn=null==Fe?void 0:Fe.globalBackground,kn=Pn?`url(${Pn})`:null,On=o?{"--memori-chat-bubble-bg":"#fff",...Fe&&!u?{"--memori-text-color":null!==($=Fe.textColor)&&void 0!==$?$:"#000"}:{},...(null==Fe?void 0:Fe.buttonBgColor)?{"--memori-button-bg":Fe.buttonBgColor,"--memori-primary":Fe.buttonBgColor}:{},...(null==Fe?void 0:Fe.buttonTextColor)?{"--memori-button-text":Fe.buttonTextColor}:{},...(null==Fe?void 0:Fe.blurBackground)?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...(null==Fe?void 0:Fe.innerBgColor)?{"--memori-inner-bg":`rgba(${"dark"===Fe.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(ee=Fe.innerBgAlpha)&&void 0!==ee?ee:.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===Fe.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(te=null==Fe?void 0:Fe.innerBgAlpha)&&void 0!==te?te:.4})`}:{"--memori-inner-content-pad":"0px"}}:{},Nn=`\n ${h?"#preview,":"WEBSITE_ASSISTANT"===Qe?"":":root,"} .memori-widget, .memori-drawer, .memori-modal {\n ${Object.entries(On).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,Ln=void 0===(null==Fe?void 0:Fe.showAIicon)||(null==Fe?void 0:Fe.showAIicon),[Dn,Bn]=(0,c.useState)(!1);(0,c.useEffect)((()=>{(window.innerWidth>=768&&"FULLPAGE"===Qe||"FULLPAGE"!==Qe)&&Bn(!0)}),[]);const[zn,Fn]=(0,c.useState)();(0,c.useEffect)((()=>{e.engineMemoriID&&(async e=>{let t,n;try{const{contentQualityIndex:r,answerQualityIndex:i,unansweredQuestions:o,...s}=await Ce(e);0===s.resultCode&&(t=r,n=o)}catch(e){let t=e;console.error("[APPCONTEXT/QUERYGAMIFICATIONPOINTS]",t)}return{points:null!=t?t:0,unansweredQuestions:null!=n?n:0}})(e.engineMemoriID).then((e=>{Fn(Gj(e.points))})).catch(console.error)}),[e.engineMemoriID]),(0,c.useEffect)((()=>{if(null==Fe?void 0:Fe.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",Fe.seoTitle),document.head.append(e)}if(null==Fe?void 0:Fe.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",Fe.seoDescription),document.head.append(e)}if(null==Fe?void 0:Fe.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",Fe.seoUrl),document.head.append(e)}let t=M||e.avatarURL;if((null==Fe?void 0:Fe.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}}),[Fe,e.avatarURL,M]);const Un=(0,c.useCallback)((e=>{const{text:t,waitForPrevious:n,hidden:r,typingText:i,useLoaderTextAsMsg:o,hasBatchQueued:s}=e.detail;t&&(n&&!Xj&&($j||We)?setTimeout((()=>{Un(e)}),1e3):(xn(),hn(),Dt(t,void 0,void 0,void 0,void 0,r,i,o,s)))}),[Gt,ft,We,je]);(0,c.useEffect)((()=>(document.addEventListener("MemoriTextEntered",Un),()=>{document.removeEventListener("MemoriTextEntered",Un)})),[Gt,je]);const jn=(0,c.useCallback)((async t=>{var n,r,i,o,s,a,l,c,u,d,h,p,f,m,g,v,y,b;const S=(null==t?void 0:t.sessionID)||Gt,x=(null==t?void 0:t.dialogState)||Wt;Le(!0);let _=document.getElementById("memori-audio"),C=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome");_&&C&&(_.muted=!1,_.play().catch((e=>{console.error("error playing intro audio",e)})));let A=Sj("birthDate",void 0),M=Ft||A||void 0;if(S||!zt||M){if(!S&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!St&&!_t||!S&&De)return At("password"),void Le(!1);if(!S){Le(!1),Be(!1);const t=await Jt({memoriID:e.engineMemoriID,password:w||St||e.secretToken,tag:null==P?void 0:P.tag,pin:null==P?void 0:P.pin,initialContextVars:{PATHNAME:null===(n=window.location.pathname)||void 0===n?void 0:n.toUpperCase(),ROUTE:(null===(o=null===(i=null===(r=window.location.pathname)||void 0===r?void 0:r.split("/"))||void 0===i?void 0:i.pop())||void 0===o?void 0:o.toUpperCase())||"",...E||{}},initialQuestion:T,birthDate:M,additionalInfo:{...D||{},loginToken:null!==(a=null!==(s=null!=Zj?Zj:Me)&&void 0!==s?s:null==D?void 0:D.loginToken)&&void 0!==a?a:k,language:an(je)}});return void((null==t?void 0:t.dialogState)?(Nt([]),Bt(t.dialogState,je).then((e=>{e.emission&&dn(e.emission)})).finally((()=>{Ze(!0)}))):await jn(t||void 0))}if(I){const{currentState:t,...n}=await we(S);if(0!==n.resultCode||!t)return console.debug("session expired, opening new session"),Be(!0),Vt(void 0),Le(!1),void await jn();if(Nt([]),Et&&Mt(Et,S),e.needsDateTime&&Zt({sessionID:S,state:t}),Ee&&e.giverTag&&(null==Wt?void 0:Wt.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await Yt(e.engineMemoriID,S,"-");const t=await Yt(e.engineMemoriID,S,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");Bt(t.currentState,je).then((e=>{e.emission&&dn(e.emission)})).finally((()=>{Ze(!0)}))}catch(t){console.error("session #2",t),Qt(!0,null==e?void 0:e.secretToken,void 0,null==e?void 0:e.giverTag,null==e?void 0:e.giverPIN,{PATHNAME:null===(l=window.location.pathname)||void 0===l?void 0:l.toUpperCase(),ROUTE:(null===(d=null===(u=null===(c=window.location.pathname)||void 0===c?void 0:c.split("/"))||void 0===u?void 0:u.pop())||void 0===d?void 0:d.toUpperCase())||"",...E||{}},T,M).then((()=>{Ze(!0)}))}else if(!Ee&&P&&(null==Wt?void 0:Wt.currentTag)!==P.tag)try{console.debug("change tag #3"),await Yt(e.engineMemoriID,S,"-");const t=await Yt(e.engineMemoriID,S,P.tag,P.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");Bt(t.currentState,je).then((e=>{e.emission&&dn(e.emission)})).finally((()=>{Ze(!0)}))}catch(t){console.error("session #5",t),Qt(!0,null==e?void 0:e.secretToken,void 0,P.tag,P.pin,{PATHNAME:null===(h=window.location.pathname)||void 0===h?void 0:h.toUpperCase(),ROUTE:(null===(m=null===(f=null===(p=window.location.pathname)||void 0===p?void 0:p.split("/"))||void 0===f?void 0:f.pop())||void 0===m?void 0:m.toUpperCase())||"",...E||{}},T,M).then((()=>{Ze(!0)}))}else if(Ee||P||(null==Wt?void 0:Wt.currentTag)===jv)Bt(t,je).then((e=>{e.emission&&dn(e.emission)})).finally((()=>{Ze(!0)}));else try{console.debug("change tag #6"),await Yt(e.engineMemoriID,S,"-");const t=await Yt(e.engineMemoriID,S,jv);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");Bt(t.currentState,je).then((e=>{e.emission&&dn(e.emission)})).finally((()=>{Ze(!0)}))}catch(t){console.error("session #8",t),Qt(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,{PATHNAME:null===(g=window.location.pathname)||void 0===g?void 0:g.toUpperCase(),ROUTE:(null===(b=null===(y=null===(v=window.location.pathname)||void 0===v?void 0:v.split("/"))||void 0===y?void 0:y.pop())||void 0===b?void 0:b.toUpperCase())||"",...E||{}},T,M).then((()=>{Ze(!0)}))}Et&&Mt(Et,S),e.needsDateTime&&Zt({sessionID:S,state:t})}else Nt([]),Bt(x,je).then((e=>{e.emission&&dn(e.emission)})).finally((()=>{Ze(!0)}))}else Ht(!0),Le(!1)}),[St,e,_t,Ft,Gt,je,Et]);(0,c.useEffect)((()=>{const t=document.querySelector(`memori-client[memoriname="${e.name}"]`)||document.querySelector(`memori-client[memoriid="${e.memoriID}"]`)||document.querySelector("memori-client");if(!t)return;const n=new MutationObserver(((e,t)=>{var n,r,i;for(const t of e)"attributes"===t.type&&"authtoken"===(null===(n=t.attributeName)||void 0===n?void 0:n.toLowerCase())&&("MEMORI-CLIENT"===t.target.nodeName?(Ie(t.target.getAttribute("authtoken")||void 0),Zj=t.target.getAttribute("authtoken")||void 0):(Ie((null===(i=null===(r=t.target)||void 0===r?void 0:r.parentElement)||void 0===i?void 0:i.getAttribute("authtoken"))||void 0),Zj=t.target.getAttribute("authtoken")||void 0))}));return n.observe(t,{attributes:!0,childList:!1,subtree:!1}),()=>{n.disconnect()}}),[]);const[Hn,Gn]=(0,c.useState)(),Vn=(0,c.useCallback)((async()=>{if(Gt&&(null==e?void 0:e.enableBoardOfExperts))try{const{experts:e,count:t,...n}=await Ae(Gt);0===n.resultCode?Gn(e):console.warn("Error fetching experts",n)}catch(e){console.warn(e)}}),[Gt,null==e?void 0:e.enableBoardOfExperts]);(0,c.useEffect)((()=>{Vn()}),[Gt,Vn]);const Wn=void 0===x?"TOTEM"!==a&&"WEBSITE_ASSISTANT"!==a:!x,qn={memori:e,tenant:R,history:Ot,showShare:null===(ne=null!=d?d:null==Fe?void 0:Fe.showShare)||void 0===ne||ne,position:Et,setShowPositionDrawer:tt,setShowSettingsDrawer:rt,setShowKnownFactsDrawer:ot,setShowExpertsDrawer:at,showSpeaker:!!O,speakerMuted:lt||Xj,setSpeakerMuted:e=>{if(Xj=!!e,ct(e),xj("muteSpeaker",!!e),e)hn();else{Qj=new Jo;let e=Qj.createBuffer(1,1e4,22050),t=Qj.createBufferSource();t.buffer=e,t.connect(Qj.destination)}},showSettings:v,hasUserActivatedSpeak:Ye,showReload:"TOTEM"===Qe,showClear:b,clearHistory:()=>Nt((e=>e.slice(-1))),showLogin:S,setShowLoginDrawer:Oe,loginToken:Me,user:Re,sessionID:Gt},Kn={memori:e,integration:o,integrationConfig:Fe,tenant:R,instruct:Ee,avatar3dVisible:Dn,setAvatar3dVisible:Bn,hasUserActivatedSpeak:Ye,isPlayingAudio:ft&&!lt,loading:!!We,baseUrl:C,apiUrl:A},Jn={memori:e,tenant:R,gamificationLevel:zn,language:ze,userLang:je,setUserLang:He,baseUrl:C,apiUrl:A,position:Et,openPositionDrawer:()=>tt(!0),integrationConfig:Fe,instruct:Ee,sessionId:Gt,clickedStart:Ne,onClickStart:jn,initializeTTS:()=>{if(!O)return;qj=ys.SpeechConfig.fromSubscription(O,"eastus"),qj.speechSynthesisLanguage=an(je),qj.speechSynthesisVoiceName=sn(je),qj.speechRecognitionLanguage=an(je),Yf()&&(qj.speechSynthesisOutputFormat=ys.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3),Qj=new Jo;let e=Qj.createBuffer(1,1e4,22050),t=Qj.createBufferSource();t.buffer=e,t.connect(Qj.destination),Jj=new ys.SpeakerAudioDestination;let n=ys.AudioConfig.fromSpeakerOutput(Jj);Kj=new ys.SpeechSynthesizer(qj,n)},isUserLoggedIn:!!Me&&!!(null==Re?void 0:Re.userID),showLogin:S,setShowLoginDrawer:Oe,user:Re},Qn={memori:e,sessionID:Gt||"",tenant:R,translateTo:Ue&&je.toUpperCase()!==(null===(ae=null!==(se=null!==(oe=null===(ie=null===(re=e.culture)||void 0===re?void 0:re.split("-"))||void 0===ie?void 0:ie[0])&&void 0!==oe?oe:he.language)&&void 0!==se?se:"IT")||void 0===ae?void 0:ae.toUpperCase())?je:void 0,baseUrl:C,apiUrl:A,layout:a,memoriTyping:We,typingText:Ke,showTypingText:y,history:Wn?Ot:Ot.slice(-2),authToken:null!==(ce=null!==(le=null!=Me?Me:Zj)&&void 0!==le?le:null==D?void 0:D.loginToken)&&void 0!==ce?ce:k,dialogState:Wt,setDialogState:Kt,pushMessage:Lt,simulateUserPrompt:(e,t)=>{xn(),hn(),Dt(e,void 0,void 0,!1,t)},showDates:m,showContextPerLine:g,showAIicon:Ln,client:me,selectReceiverTag:async n=>{var r;if(Gt)try{const{currentState:i,...o}=await _e(Gt,n);if(0===o.resultCode)if(Lt({text:n,fromUser:!0}),"X4"===i.state&&e.giverTag){const{currentState:n,...r}=await me.postTagChangedEvent(Gt,e.giverTag);0===r.resultCode?(Kt(n),n.emission&&Lt({text:n.emission,emitter:n.emitter,media:n.media,fromUser:!1,contextVars:n.contextVars,date:n.currentDate,placeName:n.currentPlaceName,placeLatitude:n.currentLatitude,placeLongitude:n.currentLongitude,placeUncertaintyKm:n.currentUncertaintyKm,tag:n.currentTag})):(console.error(r),t(Ku).error(de(zv(r.resultCode))))}else Kt(i),i.emission&&Lt({text:i.emission,emitter:i.emitter,media:i.media,fromUser:!1,contextVars:i.contextVars,date:i.currentDate,placeName:i.currentPlaceName,placeLatitude:i.currentLatitude,placeLongitude:i.currentLongitude,placeUncertaintyKm:i.currentUncertaintyKm,tag:i.currentTag});else console.error(o,n,null===(r=null==Wt?void 0:Wt.knownTags)||void 0===r?void 0:r[n]),t(Ku).error(de(zv(o.resultCode)))}catch(e){let n=e;console.error(n),t(Ku).error(n.message)}},preview:h,sendOnEnter:Tn,setSendOnEnter:Mn,microphoneMode:ut?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen:In,setAttachmentsMenuOpen:Rn,instruct:Ee,showInputs:f,showMicrophone:!!O,userMessage:It,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return Rt(""),void nn();Rt(e),tn()},sendMessage:e=>{hn(),xn(),Dt(e),Rt(""),mn()},stopListening:_n,startListening:Sn,stopAudio:hn,resetTranscript:mn,listening:Pt,isPlayingAudio:ft,customMediaRenderer:z,user:Re,userAvatar:F,experts:Hn},Yn=o&&kn?(0,s.jsx)("div",{className:"memori--global-background",children:(0,s.jsx)("div",{className:"memori--global-background-image",style:{backgroundImage:kn}})}):(0,s.jsx)("div",{className:"memori--global-background no-background-image"}),Zn=o?(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:Nn}}):null,Xn={canInstruct:!!e.giverTag,instruct:!!Ee,onChangeMode:e=>{Te("instruct"===e),Ze(!1),Le(!1)}},$n=(0,s.jsx)(JU,{tenant:R,userLang:je,integrationID:null==o?void 0:o.integrationID,memoriHash:`${e.ownerTenantName}-${e.ownerUserName}-${e.name}`}),er=l||("TOTEM"===Qe?Oj:"CHAT"===Qe?Nj:"FULLPAGE"===Qe?kj:"WEBSITE_ASSISTANT"===Qe?Lj:kj);return(0,s.jsxs)("div",{className:t(xs)("memori","memori-widget",`memori-layout-${a.toLowerCase()}`,`memori-controls-${gt.toLowerCase()}`,`memori--avatar-${(null==Fe?void 0:Fe.avatar)||"default"}`,{"memori--preview":h,"memori--embed":p,"memori--with-integration":o,"memori--with-speechkey":!!O,"memori--active":Ye,"memori--hide-emissions":yt,"memori--has-active-session":!!Gt}),"data-memori-name":null==e?void 0:e.name,"data-memori-id":null==e?void 0:e.engineMemoriID,"data-memori-secondary-id":null==e?void 0:e.memoriID,"data-memori-session-id":Gt,"data-memori-integration":null==o?void 0:o.integrationID,"data-memori-engine-state":JSON.stringify({...Wt,sessionID:Gt}),style:{height:_},children:[(0,s.jsx)(er,{Header:KU,headerProps:qn,Avatar:HF,avatarProps:Kn,Chat:WS,chatProps:Qn,StartPanel:$S,startPanelProps:Jn,integrationStyle:Zn,integrationBackground:Yn,ChangeMode:GF,changeModeProps:Xn,poweredBy:$n,sessionId:Gt,hasUserActivatedSpeak:Ye,showInstruct:u,loading:Ge}),(0,s.jsx)("audio",{id:"memori-audio",style:{display:"none"},src:"https://aisuru.com/intro.mp3"}),pe&&(0,s.jsx)(av,{withModal:!0,pwdOrTokens:Ct,openModal:!!Ct,setPwdOrTokens:At,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{var n,r,i,o;t.password&&xt(t.password),t.password&&(Yj=t.password),t.tokens&&wt(t.tokens),Qt(!Gt,t.password,t.tokens,Ee?e.giverTag:null==P?void 0:P.tag,Ee?e.giverPIN:null==P?void 0:P.pin,{PATHNAME:null===(n=window.location.pathname)||void 0===n?void 0:n.toUpperCase(),ROUTE:(null===(o=null===(i=null===(r=window.location.pathname)||void 0===r?void 0:r.split("/"))||void 0===i?void 0:i.pop())||void 0===o?void 0:o.toUpperCase())||"",...E||{}},T,Ft).then((e=>{At(null),jn(e||void 0)})).catch((()=>{At(null),Be(!0)}))},minimumNumberOfRecoveryTokens:null!==(ue=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==ue?ue:1}),pe&&(0,s.jsx)(gj,{visible:jt,minAge:zt,onClose:t=>{var n,r,i,o;t?(Ut(t),xj("birthDate",t),Qt(!Gt,Yj||St||(null==e?void 0:e.secretToken),_t,Ee?e.giverTag:null==P?void 0:P.tag,Ee?e.giverPIN:null==P?void 0:P.pin,{PATHNAME:null===(n=window.location.pathname)||void 0===n?void 0:n.toUpperCase(),ROUTE:(null===(o=null===(i=null===(r=window.location.pathname)||void 0===r?void 0:r.split("/"))||void 0===i?void 0:i.pop())||void 0===o?void 0:o.toUpperCase())||"",...E||{}},T,t).then((e=>{Ht(!1),At(null),jn(e||void 0)})).catch((()=>{Ht(!1),Be(!0)}))):(Ht(!1),Le(!1))}}),nt&&(0,s.jsx)(Cj,{layout:Qe,open:!!nt,onClose:()=>rt(!1),microphoneMode:ut?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout:ht,setMicrophoneMode:e=>dt("CONTINUOUS"===e),setContinuousSpeechTimeout:pt,controlsPosition:gt,setControlsPosition:vt,hideEmissions:yt,setHideEmissions:bt,additionalSettings:B}),et&&(0,s.jsx)(zm,{memori:e,open:!!et,venue:Et,setVenue:e=>{Tt(e),Mt(e),e?xj("position",JSON.stringify(e)):_j("position")},onClose:e=>{e&&Mt(e),tt(!1)}}),it&&Gt&&(0,s.jsx)(Mj,{apiURL:A,memori:e,sessionID:Gt,visible:it,closeDrawer:()=>ot(!1)}),st&&!!Hn&&(0,s.jsx)(Ij,{apiUrl:A,baseUrl:C,tenant:R,experts:Hn,open:st,onClose:()=>at(!1)}),ke&&(null==R?void 0:R.id)&&(0,s.jsx)(Pj,{tenant:R,apiUrl:A,open:!!ke,user:Re,loginToken:Me,onClose:()=>Oe(!1),onLogin:(e,t)=>{Pe(e),Ie(t),Zj=t,Oe(!1),xj("loginToken",t)},onLogout:()=>{Me&&me.backend.userLogout(Me).then((()=>{Oe(!1),Pe(void 0),Ie(void 0),Zj=void 0,_j("loginToken")}))}})]})};const tH={id:"aisuru.com",theme:"aisuru",config:{name:"Memori",showNewUser:!1,requirePosition:!1}},nH=async(e,t)=>{const n=t?new URL(`${t.startsWith("http")?"":t.includes("localhost")?"http://":"https://"}${t}`).origin:"https://aisuru.com";try{const t=await fetch(`${n}/api/tenant/${e}`),{tenant:r}=await t.json();return r||{...tH,tenantID:e}}catch(t){return{...tH,tenantID:e}}};function rH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iH(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,TF(r.key),r)}}function oH(e,t,n){return t&&iH(e.prototype,t),n&&iH(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sH(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aH(e,t){return aH=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},aH(e,t)}function lH(e,t){if("function"!=typeof t&&null!==t)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&&aH(e,t)}function cH(e,t){if(t&&("object"===AF(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return sH(e)}function uH(e){return uH=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},uH(e)}function dH(e){if(Array.isArray(e))return e}function hH(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function pH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fH(e,t){if(e){if("string"==typeof e)return pH(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pH(e,t):void 0}}function mH(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function gH(e){return dH(e)||hH(e)||fH(e)||mH()}function vH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vH(Object(n),!0).forEach((function(t){MF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var bH={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},SH=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};rH(this,e),this.init(t,n)}return oH(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||bH,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,yH(yH({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}(),xH=new SH,_H=function(){function e(){rH(this,e),this.observers={}}return oH(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function wH(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function CH(e){return null==e?"":""+e}function AH(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function EH(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function TH(e,t,n){var r=EH(e,t,Object);r.obj[r.k]=n}function MH(e,t){var n=EH(e,t),r=n.obj,i=n.k;if(r)return r[i]}function IH(e,t,n){var r=MH(e,n);return void 0!==r?r:MH(t,n)}function RH(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):RH(e[r],t[r],n):e[r]=t[r]);return e}function PH(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var kH={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function OH(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return kH[e]})):e}var NH="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,LH=[" ",",","?","!",";"];function DH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function BH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DH(Object(n),!0).forEach((function(t){MF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zH(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=uH(e);if(t){var i=uH(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return cH(this,n)}}function FH(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;o<r.length;++o){if(!i)return;if("string"==typeof i[r[o]]&&o+1<r.length)return;if(void 0===i[r[o]]){for(var s=2,a=r.slice(o,o+s).join(n),l=i[a];void 0===l&&r.length>o+s;)s++,l=i[a=r.slice(o,o+s).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(a)){if("string"==typeof l)return l;if(a&&"string"==typeof l[a])return l[a]}var c=r.slice(o+s).join(n);return c?FH(l,c,n):void 0}i=i[r[o]]}return i}}var UH=function(e){lH(n,e);var t=zH(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return rH(this,n),r=t.call(this),NH&&_H.call(sH(r)),r.data=e||{},r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return oH(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[e,t];n&&"string"!=typeof n&&(s=s.concat(n)),n&&"string"==typeof n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."));var a=MH(this.data,s);return a||!o||"string"!=typeof n?a:FH(this.data&&this.data[e]&&this.data[e][t],n,i)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var s=[e,t];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(s=e.split("."))[1]),this.addNamespaces(t),TH(this.data,s,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var a=MH(this.data,s)||{};r?RH(a,n,i):a=BH(BH({},a),n),TH(this.data,s,a),o.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?BH(BH({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(_H),jH={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}};function HH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function GH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?HH(Object(n),!0).forEach((function(t){MF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function VH(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=uH(e);if(t){var i=uH(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return cH(this,n)}}var WH={},qH=function(e){lH(n,e);var t=VH(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rH(this,n),r=t.call(this),NH&&_H.call(sH(r)),AH(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,sH(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=xH.create("translator"),r}return oH(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=n&&e.indexOf(n)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=LH.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var i=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),o=!i.test(e);if(!o){var s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o}(e,n,r));if(o&&!s){var a=e.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:e,namespaces:i};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(i=l.shift()),e=l.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,r){var i=this;if("object"!==AF(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],t),l=a.key,c=a.namespaces,u=c[c.length-1],d=t.lng||this.language,h=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(h){var p=t.nsSeparator||this.options.nsSeparator;return o?(f.res="".concat(u).concat(p).concat(l),f):"".concat(u).concat(p).concat(l)}return o?(f.res=l,f):l}var f=this.resolve(e,t),m=f&&f.res,g=f&&f.usedKey||l,v=f&&f.exactUsedKey||l,y=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],S=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,_="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(x&&m&&_&&b.indexOf(y)<0&&("string"!=typeof S||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var w=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,GH(GH({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return o?(f.res=w,f):w}if(s){var C="[object Array]"===y,A=C?[]:{},E=C?v:g;for(var T in m)if(Object.prototype.hasOwnProperty.call(m,T)){var M="".concat(E).concat(s).concat(T);A[T]=this.translate(M,GH(GH({},t),{joinArrays:!1,ns:c})),A[T]===M&&(A[T]=m[T])}m=A}}else if(x&&"string"==typeof S&&"[object Array]"===y)(m=m.join(S))&&(m=this.extendTranslation(m,e,t,r));else{var I=!1,R=!1,P=void 0!==t.count&&"string"!=typeof t.count,k=n.hasDefaultValue(t),O=P?this.pluralResolver.getSuffix(d,t.count,t):"",N=t["defaultValue".concat(O)]||t.defaultValue;!this.isValidLookup(m)&&k&&(I=!0,m=N),this.isValidLookup(m)||(R=!0,m=l);var L=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,D=L&&R?void 0:m,B=k&&N!==m&&this.options.updateMissing;if(R||I||B){if(this.logger.log(B?"updateKey":"missingKey",d,u,l,B?N:m),s){var z=this.resolve(l,GH(GH({},t),{},{keySeparator:!1}));z&&z.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var F=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&U&&U[0])for(var j=0;j<U.length;j++)F.push(U[j]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var H=function(e,n,r){var o=k&&r!==m?r:D;i.options.missingKeyHandler?i.options.missingKeyHandler(e,u,n,o,B,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,u,n,o,B,t),i.emit("missingKey",e,u,n,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&P?F.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],l+n,t["defaultValue".concat(n)]||N)}))})):H(F,l,N))}m=this.extendTranslation(m,e,t,f,r),R&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(u,":").concat(l)),(R||I)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(l):l,I?m:void 0):this.options.parseMissingKeyHandler(m))}return o?(f.res=m,f):m}},{key:"extendTranslation",value:function(e,t,n,r,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,GH(GH({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(GH(GH({},n),{interpolation:GH(GH({},this.options.interpolation),n.interpolation)}));var s,a="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){var l=e.match(this.interpolator.nestingRegexp);s=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=GH(GH({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),a){var u=e.match(this.interpolator.nestingRegexp);s<(u&&u.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return i&&i[0]===r[0]&&!n.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):o.translate.apply(o,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,h="string"==typeof d?[d]:d;return null!=e&&h&&h.length&&!1!==n.applyPostProcessor&&(e=jH.handle(h,e,t,this.options&&this.options.postProcessPassResolved?GH({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,o,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var l=s.extractFromKey(e,a),c=l.key;n=c;var u=l.namespaces;s.options.fallbackNS&&(u=u.concat(s.options.fallbackNS));var d=void 0!==a.count&&"string"!=typeof a.count,h=d&&!a.ordinal&&0===a.count&&s.pluralResolver.shouldUseIntlApi(),p=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,f=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);u.forEach((function(e){s.isValidLookup(t)||(o=e,!WH["".concat(f[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(WH["".concat(f[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(n,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((function(n){if(!s.isValidLookup(t)){i=n;var o,l=[c];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(l,c,n,e,a);else{var u;d&&(u=s.pluralResolver.getSuffix(n,a.count,a));var f="".concat(s.options.pluralSeparator,"zero");if(d&&(l.push(c+u),h&&l.push(c+f)),p){var m="".concat(c).concat(s.options.contextSeparator).concat(a.context);l.push(m),d&&(l.push(m+u),h&&l.push(m+f))}}for(;o=l.pop();)s.isValidLookup(t)||(r=o,t=s.getResource(n,e,o,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(_H);function KH(e){return e.charAt(0).toUpperCase()+e.slice(1)}var JH=function(){function e(t){rH(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=xH.create("languageUtils")}return oH(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=KH(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=KH(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=KH(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),QH=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],YH={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},ZH=["v1","v2","v3"],XH={zero:0,one:1,two:2,few:3,many:4,other:5};function $H(){var e={};return QH.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:YH[t.fc]}}))})),e}var eG=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};rH(this,e),this.languageUtils=t,this.options=n,this.logger=xH.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=$H()}return oH(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return XH[e]-XH[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var o=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!ZH.includes(this.options.compatibilityJSON)}}]),e}();function tG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tG(Object(n),!0).forEach((function(t){MF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tG(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var rG=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};rH(this,e),this.logger=xH.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return oH(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:OH,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?PH(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?PH(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?PH(t.nestingPrefix):t.nestingPrefixEscaped||PH("$t("),this.nestingSuffix=t.nestingSuffix?PH(t.nestingSuffix):t.nestingSuffixEscaped||PH(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,s,a=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(a.formatSeparator)<0){var i=IH(t,l,e);return a.alwaysFormat?a.format(i,void 0,n,nG(nG(nG({},r),t),{},{interpolationkey:e})):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(IH(t,l,s),c,n,nG(nG(nG({},r),t),{},{interpolationkey:s}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?c(a.escape(e)):c(e)}}].forEach((function(t){for(s=0;i=t.regex.exec(e);){var n=i[1].trim();if(void 0===(o=u(n)))if("function"==typeof d){var l=d(e,i,r);o="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))o="";else{if(h){o=i[0];continue}a.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),o=""}else"string"==typeof o||a.useRawValueToEscape||(o=CH(o));var c=t.safeValue(o);if(e=e.replace(i[0],c),h?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=nG({},o);function a(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var o=(i=this.interpolate(i,s)).match(/'/g),a=i.match(/"/g);(o&&o.length%2==0&&!a||a.length%2!=0)&&(i=i.replace(/'/g,'"'));try{s=JSON.parse(i),t&&(s=nG(nG({},t),s))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete s.defaultValue,e}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(e);){var l=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),l=u,c=!0}if((r=t(a.call(this,n[1].trim(),s),s))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=CH(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return i.format(e,t,o.lng,nG(nG({},o),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function iG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?iG(Object(n),!0).forEach((function(t){MF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iG(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function sG(e){var t={};return function(n,r,i){var o=r+JSON.stringify(i),s=t[o];return s||(s=e(r,i),t[o]=s),s(n)}}var aG=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};rH(this,e),this.logger=xH.create("formatter"),this.options=t,this.formats={number:sG((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:sG((function(e,t){var n=new Intl.NumberFormat(e,oG(oG({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:sG((function(e,t){var n=new Intl.DateTimeFormat(e,oG({},t));return function(e){return n.format(e)}})),relativetime:sG((function(e,t){var n=new Intl.RelativeTimeFormat(e,oG({},t));return function(e){return n.format(e,t.range||"day")}})),list:sG((function(e,t){var n=new Intl.ListFormat(e,oG({},t));return function(e){return n.format(e)}}))},this.init(t)}return oH(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=sG(t)}},{key:"format",value:function(e,t,n,r){var i=this,o=t.split(this.formatSeparator).reduce((function(e,t){var o=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=gH(e.split(":")),r=t[0],i=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=i),"false"===i&&(n[r.trim()]=!1),"true"===i&&(n[r.trim()]=!0),isNaN(i)||(n[r.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}}(t),s=o.formatName,a=o.formatOptions;if(i.formats[s]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=i.formats[s](e,u,oG(oG(oG({},a),r),c))}catch(e){i.logger.warn(e)}return l}return i.logger.warn("there was no format function for ".concat(s)),e}),e);return o}}]),e}();function lG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lG(Object(n),!0).forEach((function(t){MF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lG(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function uG(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=uH(e);if(t){var i=uH(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return cH(this,n)}}var dG=function(e){lH(n,e);var t=uG(n);function n(e,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return rH(this,n),o=t.call(this),NH&&_H.call(sH(o)),o.backend=e,o.store=r,o.services=i,o.languageUtils=i.languageUtils,o.options=s,o.logger=xH.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=s.maxParallelReads||10,o.readingCalls=0,o.maxRetries=s.maxRetries>=0?s.maxRetries:5,o.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(i,s.backend,s),o}return oH(n,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o={},s={},a={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?void 0===s[a]&&(s[a]=!0):(i.state[a]=1,r=!1,void 0===s[a]&&(s[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(a[e]=!0)})),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){var r,a,l,c,u,d;r=n.loaded,a=o,c=EH(r,[i],Object),u=c.obj,d=c.k,u[d]=u[d]||[],l&&(u[d]=u[d].concat(a)),l||u[d].push(a),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===s[e][t]&&(s[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:o,callback:s}):(this.readingCalls++,this.backend[n](e,t,(function(a,l){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}a&&l&&i<r.maxRetries?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,s)}),o):s(a,l)}))):s(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,s){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&s&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),s),t.loaded(e,r,s)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,cG(cG({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(_H);function hG(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===AF(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===AF(e[2])||"object"===AF(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function pG(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function fG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fG(Object(n),!0).forEach((function(t){MF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fG(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gG(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=uH(e);if(t){var i=uH(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return cH(this,n)}}function vG(){}function yG(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var bG=function(e){lH(n,e);var t=gG(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(rH(this,n),e=t.call(this),NH&&_H.call(sH(e)),e.options=pG(r),e.services={},e.logger=xH,e.modules={external:[]},yG(sH(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),cH(e,sH(e));setTimeout((function(){e.init(r,i)}),0)}return e}return oH(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=hG();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=mG(mG(mG({},r),this.options),pG(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=mG(mG({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var o;this.modules.logger?xH.init(i(this.modules.logger),this.options):xH.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=aG);var s=new JH(this.options);this.store=new UH(this.options.resources,this.options);var a=this.services;a.logger=xH,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new eG(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!o||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(a.formatter=i(o),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new rG(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new dG(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new qH(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=vG),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=wH(),h=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vG,r=n,i="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return r();var o=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(i)s(i);else{var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.forEach((function(e){return s(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=wH();return e||(e=this.languages),t||(t=this.options.ns),n||(n=vG),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&jH.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=wH();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},o=function(o){e||o||!n.services.languageDetector||(o=[]);var s="string"==typeof o?o:n.services.languageUtils.getBestMatchFromCodes(o);s&&(n.language||i(s),n.translator.language||n.translator.changeLanguage(s),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(s)),n.loadResources(s,(function(e){!function(e,o){o?(i(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,s)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,i=function e(t,i){var o;if("object"!==AF(i)){for(var s=arguments.length,a=new Array(s>2?s-2:0),l=2;l<s;l++)a[l-2]=arguments[l];o=r.options.overloadTranslationOptionHandler([t,i].concat(a))}else o=mG({},i);o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,o.keyPrefix=o.keyPrefix||n||e.keyPrefix;var c=r.options.keySeparator||".",u=o.keyPrefix?"".concat(o.keyPrefix).concat(c).concat(t):t;return r.t(u,o)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var a=n.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!s(r,e)||i&&!s(o,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=wH();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=wH();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vG,i=mG(mG(mG({},this.options),t),{isClone:!0}),o=new n(i);void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t));var s=["store","services","language"];return s.forEach((function(t){o[t]=e[t]})),o.services=mG({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new qH(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit.apply(o,[e].concat(n))})),o.init(i,r),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(_H);MF(bG,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new bG(e,t)}));var SG=bG.createInstance();SG.createInstance=bG.createInstance;var xG,_G=SG.createInstance;SG.init,SG.loadResources,SG.reloadResources,SG.use,SG.changeLanguage,SG.getFixedT,SG.t,SG.exists,SG.setDefaultNamespace,SG.hasLoadedNamespace,SG.loadNamespaces,SG.loadLanguages;xG=JSON.parse('{"yes":"Si","no":"No","confirm":"Conferma","apply":"Applica","cancel":"Annulla","show":"Mostra","hide":"Nascondi","send":"Invia","close":"Chiudi","edit":"Modifica","delete":"Elimina","loading":"Caricamento","expand":"Espandi","collapse":"Riduci","fullscreenEnter":"Passa a schermo intero","fullscreenExit":"Esci da schermo intero","center":"Centro","bottom":"In basso","hidden":"Nascosto","day":"Giorno","month":"Mese","year":"Anno","createdAt":"Data creazione","selected":"Selezionati","page":"pagina","actions":"Azioni","next":"Successivo","previous":"Precedente","copy":"Copia","copyToClipboard":"Copia negli appunti","showOriginalText":"Mostra originale","showTranslatedText":"Mostra traduzione","exactPosition":"Posizione esatta","uncertain":"Incertezza","question":"Domanda","nothingFound":"Nessun risultato","venue":"Luogo","searchVenue":"Cerca luogo...","memoriBlockedTitle":"Bloccato","memoriBlockedUntil":"Memori bloccato fino al {{date}}","memoriBlockedAnon":"Attualmente \\"{{name}}\\" non può rispondere, torna qui il {{date}}","memoriBlockedReasonExceedChats":"perchè ha superato la soglia mensile di chat ammesse.","memoriBlockedGiverHelper":"Puoi sempre gestirlo in qualità di amministratore, ma altri utenti non potranno interrogarlo.","generatedByAI":"Risposta generata da IA, può talvolta generare informazioni non corrette","whyThisAnswer":"Perché questa risposta?","whyThisAnswerHelper":"Questa risposta è stata generata automaticamente da un\'intelligenza artificiale sulla base di questi contenuti verificati.","completionsEnabled":"IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette","completionProviderDown":"Questo Twin è integrato con una IA generativa di {{provider}}, ma al momento non è disponibile. Riprova più tardi.","completionProviderFallbackName":"un provider esterno","completionProviderCheckStatusPage":"Vedi pagina di stato","boardOfExperts":"Gruppo di esperti","birthDate":"Data di nascita","birthDateHelper":"Ti chiediamo la data di nascita esclusivamente per abilitare o disabilitare le funzionalità che hanno restrizioni in base all\'età","underage":"Devi avere almeno {{age}} anni per registrarti.","underageTwinSession":"Devi avere almeno {{age}} anni per interagire con questo Twin.","ageVerification":"Verifica dell\'età","ageVerificationText":"Per interagire con questo Twin, devi aver almeno {{minAge}} anni.","nsfw":"NSFW: Questo Twin contiene contenuti per adulti","deepThought":"Pensiero profondo","deepThoughtHelper":"Pensiero Profondo è una funzionalità avanzata delle AI che ti consentirà di poter sfruttare a pieno le tue conversazioni mantenendo memoria delle stesse. Le AI con Pensiero Profondo possono darti informazioni adattandosi a te e alle cose che condividerete insieme.","deepThoughtDisclaimerTitle":"Pensiero profondo abilitato","deepThoughtDisclaimer":"Pensiero Profondo è una funzionalità avanzata delle AI che ti consentirà di poter sfruttare a pieno le tue conversazioni mantenendo memoria delle stesse. Le AI con Pensiero Profondo possono darti informazioni adattandosi a te e alle cose che condividerete insieme.","deepThoughtPreDisclaimerUnlogged":"Accedi per abilitare Pensiero Profondo.","deepThoughtPreDisclaimerNotAllowed":"Pensiero Profondo è disabilitato poiché non hai acconsentito al suo utilizzo, puoi cambiare la tua scelta in qualsiasi momento nelle impostazioni del tuo account.","knownFacts":{"title":"Fatti noti","description":"Dettagli delle informazioni condivise tra te e {{memoriName}}","type":"Tipo","typeShortTerm":"Breve termine","typeLongTerm":"Lungo termine","typeHelper":"Tipi:\\n- Breve termine: questo fatto noto è sempre utilizzato durante le conversazioni\\n- Lungo termine: questo fatto noto è utilizzato durante le conversazioni solo se rilevante per la domanda corrente","text":"Testo","deleteSuccess":"Fatto noto eliminato","deleteConfirmTitle":"Elimina il fatto noto","deleteConfirmMessage":"Confermi di voler eliminare questo fatto noto?","deleteSelectedConfirmTitle":"Elimina i fatti noti selezionati","deleteSelectedConfirmMessage":"Confermi di voler eliminare i fatti noti selezionati?"},"auth":{"title":"Autenticazione","useRecoveryTokens":"Utilizza i token di recupero","tokens":"Token","addToken":"Aggiungi token","usePassword":"Utilizza la password","atLeast":"Almeno"},"widget":{"instruct":"Istruisci","test":"Prova","sound":"Audio","position":"Preferenze posizione","settings":"Impostazioni","share":"Condividi","sendOnKeypress":"Premi Invio per inviare","sendOnClick":"Clicca sul bottone di invio","boardOfExperts":"Gruppo di esperti","showExpertsInTheBoard":"Mostra gli esperti di questo gruppo","expertsInTheBoard":"Esperti di questo gruppo","goToIntegrationsToCustomizeAvatar":"Per personalizzare l\'avatar, vai a Condividimi e configura la pagina pubblica"},"write_and_speak":{"micButtonPopover":"Premi il pulsante per parlare","micButtonPopoverListening":"Premi il pulsante per smettere di parlare","pageInstructExplanation":"Per insegnarmi nuove cose clicca sul pulsante ISTRUISCIMI per cominciare","pageTryMeExplanation":"Per parlare con me clicca sul pulsante INIZIAMO per cominciare","instructButton":"ISTRUISCIMI","tryMeButton":"INIZIAMO","chatHistory":"Cronologia chat","exportChatHistory":"Esporta la cronologia chat","exportChatHistoryMessage":"Vuoi esportare la cronologia chat?","chatBotButtonText":"CLICCA QUI PER APRIRE LA CHAT","conversationStartedLabel":"Conversazione avvenuta il","settingsHeaderLabel":"Configura qui il memori se vuoi impostare una conversazione continua. Setta i secondi di silenzio prima dell\'invio.","continuousSpeechLabel":"Conversazione continua","holdToSpeak":"Tieni premuto per parlare","releaseToEndListening":"Rilascia per smettere di parlare","pressAndHoldToSpeak":"Premi e tieni premuto per parlare","microphoneMode":"Modalità microfono","hideEmissionsLabel":"Nascondi testo emesso dal Twin","secondsLabel":"Secondi","controlsPosition":"Posizione dei controlli","tryMeHeaderLabel":"PROVA","unknownPosition":"Posizione sconosciuta","fieldPlace":"Indica la posizione (es \'Milano\')","showMapLinkFor":"Visualizza sulla mappa la posizione","useMyPosition":"Usa la mia posizione","myPosition":"Posizione corrente","updatingPosition":"Aggiorno la posizione...","placeNotFound":"Luogo sconosciuto!","requirePositionHelp":"Per parlare con {{name}} devi decidere se fornire o meno la tua posizione. Questo perchè diverse risposte che potrà fornirti potrebbero dipendere da dove ti trovi.","dontWantToProvidePosition":"Non voglio fornire la mia posizione","attachmentsLabel":"Arricchisci il tuo messaggio","iWantToTalkToIn":"Voglio parlare con {{name}} in"},"media":{"title":"Titolo","editAttributes":"Modifica attributi media","uploadMimeTypeNotAllowed":"Il tipo di file non è permesso","uploadSizeLimitMessage":"Il file caricato è troppo grande (max {{size}}MB)","uploadWrongResolutionMessage":"La risoluzione deve essere {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"Hai già un Twin con questo nome","uploadHelperImages":"Caricare un file con estensione png, jpg, jpeg o gif e con dimensione massima di {{size}}MB","uploadHelper":"Caricare un file di dimensione massima di {{size}}MB","uploadError":"Errore nel caricamento","square":"quadrato","scaleRatio":"Proporzioni","addMediaLabel":"Aggiungi media","insertThisMediaMsg":"Inserisci questi media","mediaUploadMessage":"Clicca per caricare un nuovo media","addLinkLabel":"Aggiungi un link","linkKey":"URL","linkValue":"Titolo link","insertThisLink":"Inserisci un link a {{url}} con titolo {{title}}"},"gamification":{"level":"Livello","points":"punti","memoriReachedLevel":"è diventato più evoluto ed ha raggiunto il livello","levelGoToStatistics":"{{memori}} è al livello {{level}} con {{points}} punti. Clicca per andare alle statistiche.","congratulationsNewLevel":"Congratulazioni, hai raggiunto un nuovo livello!","congratulationsNewLevelDescription":"Il tuo Memori è diventato più evoluto con {{points}} punti, guarda le","statistics":"statistiche"},"login":{"login":"Accedi","logout":"Esci","user":"Utente","loggedDrawerTitle":"Ciao, {{name}}!","loginDrawerTitle":"Accedi","newUserSignUp":"Sei un nuovo utente?","signUp":"Registrati!","registrationDisabled":"La registrazione è disabilitata.","contactAdmin":"Contatta l\'amministratore per richiedere l\'accesso","userNameOrEmail":"Nome utente o email","underage":"Devi avere almeno {{age}} anni per registrarti.","optional":"opzionale","birthDate":"Data di nascita","birthDateHelper":"Ti chiediamo la data di nascita esclusivamente per abilitare o disabilitare le funzionalità che hanno restrizioni in base all\'età","missingData":"Informazioni mancanti","missingDataHelper":"Sappiamo che questo è un po\' fastidioso, ma abbiamo bisogno di alcune informazioni in più per completare la tua registrazione.","goToAccountToChangeYourPreferences":"Puoi cambiare la tua scelta in qualsiasi momento dalla tua pagina Account.","deepThoughtExplaination":"Pensiero Profondo è una funzionalità avanzata delle AI che ti consentirà di poter sfruttare a pieno le tue conversazioni mantenendo memoria delle stesse. Le AI con Pensiero Profondo possono darti informazioni adattandosi a te e alle cose che condividerete insieme. Consenti all\'autore del twin di contattarti per offerte commerciali riguardanti prodotti su cui hai espresso interesse.","tnCAndPPAcceptedHelper":"Dall\'ultimo accesso, i T&C e l\'Informativa sulla privacy sono stati modificati. Si prega di accettarle, altrimenti non sarà possibile apportare modifiche ai propri gemelli. Puoi sempre cancellare il tuo account nella pagina del tuo profilo utente.","privacyLabel":"Ho letto e accettato l\'","privacyAndCookiePolicy":"informativa sui cookie e sulla privacy","and":"e","termsOfService":"i termini del servizio","pAndCUAccepted":"Accetto le condizioni di utilizzo relative a Pensiero Profondo","save":"Salva"},"success":"Operazione andata a buon fine","Error":"Errore","internal server error":"Ops, scusa... qualcosa è andato storto nel server","error":"Errore","error.loading":"Errore durante il caricamento dei contenuti.","error.notFound":"Ops, non abbiamo trovato ciò che cercavi.","error.generic":"Ops, qualcosa è andato storto.","error.serverNotResponding":"Stiamo facendo manutenzione o rilasciando aggiornamenti. Riprova più tardi.","error.unprocessableEntity":"Errore durante il salvataggio dei dati. Ricontrolla i dati inseriti.","error.goBackTo":"Prova a tornare alla","error.reloadPage":"Ricarica la pagina","error.tryAgain":"Riprova","error.unauthorized":"Non sei autorizzato a visualizzare questo contenuto.","errors":{"TENANT_NOT_FOUND":"Tenant non trovato","TENANT_REGISTRATION_DISABLED":"La registrazione su questa piattaforma è disabilitata","TENANT_MISSING_NAME":"Tenant: nome mancante","TENANT_MAX_USERS_REACHED":"Numero massimo di utenti raggiunto","TENANT_MAX_ADMINS_REACHED":"Numero massimo di utenti amministratori raggiunto","TENANT_ALREADY_EXISTS":"Tenant già esistente","TENANT_MISSING_DESCRIPTION":"Tenant: descrizione mancante","TENANT_CANT_SET_COMPLETION_PROVIDER":"Tenant: non abilitato a gestire il provider di completamento","USER_NOT_CONFIRMED":"Utente ancora non confermato","USER_NOT_FOUND":"Utente non trovato","USER_OR_PASSWORD_INVALID":"Utente o password non validi","USER_MUST_CHANGE_PASSWORD":"Devi cambiare la password","USER_MUST_ENTER_VERIFICATION_CODE":"Devi inserire il codice di verifica","USER_MISSING_TENANT":"Utente: tenant mancante","USER_MISSING_NAME":"Utente: nome mancante","USER_MISSING_PASSWORD":"Utente: password mancante","USER_MISSING_EMAIL":"Utente: email mancante","USER_MISSING_VERIFICATION_CODE":"Utente: codice di verifica mancante","USER_NAME_ALREADY_USED":"Nome utente già in uso","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"La password non rispetta le regole di sicurezza","USER_EMAIL_ALREADY_USED":"Email già in uso","USER_EMAIL_INVALID":"Email non valida","USER_VERIFICATION_CODE_INVALID":"Codice di verifica non valido","USER_MISSING_NAME_OR_EMAIL":"Nome utente o email mancante","USER_NAME_INVALID":"Nome utente non valido","USER_HAS_ONE_OR_MORE_MEMORI":"L\'utente ha uno o più memori","USER_MISSING_NEW_PASSWORD":"Utente: nuova password mancante","USER_NOTHING_TO_DO":"Niente da fare","USER_CANT_CREATE_MEMORI":"Utente non abilitato a creare Memori","USER_MAX_MEMORI_REACHED":"Massimo numero di Memori raggiunto","USER_TOO_MANY_ATTEMPTS":"Troppi tentativi","USER_MUST_ACCEPT_TNC_AND_PP":"Devi accettare i termini e le condizioni","USER_BIRTH_DATE_CANT_BE_CHANGED":"Data di nascita non può essere cambiata","USER_CANT_SET_COMPLETION_PROVIDER":"Utente: non abilitato a gestire il provider di completamento","USER_CANT_ENABLE_DEEP_THOUGHT":"Utente: non abilitato a gestire Pensiero Profondo","USER_CANT_ENABLE_DCM_INTEGRATION":"Utente: non abilitato a gestire l\'integrazione con DCM","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"Utente: non abilitato a gestire la concatenazione o il gruppo di esperti","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"Il gruppo di esperti richiede l\'abilitazione delle completions","MEMORI_NOT_FOUND":"Memori non trovato","MEMORI_NOT_ACCESSIBLE":"Memori non accessibile","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Solo il proprietario può cambiare il tag e il pin","SESSION_NOT_FOUND":"Sessione non trovata","SESSION_IS_NOT_ADMINISTRATIVE":"Sessione non amministrativa","SESSION_EXPIRED":"Sessione scaduta","MEMORI_MISSING_CONFIGURATION":"Memori: configurazione mancante","MEMORI_CONFIGURATION_NOT_FOUND":"Memori: configurazione non trovata","MEMORI_INVALID_PRIVACY_TYPE":"Memori: tipo di privacy non valido","MEMORI_MISSING_PASSWORD":"Memori: password mancante","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero totale di token di recupero non valido","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero minimo di token di recupero non valido","MEMORI_INVALID_VOICE_TYPE":"Memori: tipo di voce non valido","MEMORI_MISSING_NAME":"Memori: nome mancante","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memori: password o token di recupero mancanti","MEMORI_INVALID_ID":"Memori: ID non valido","MEMORI_NAME_ALREADY_USED":"Nome memori già in uso","MEMORI_INVALID_PIN":"Memori: PIN non valido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memori: cambio TAG e PIN richiedono operazioni separate","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memori: password non richiesta su Memori pubblico","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Pensiero Profondo richiede l\'abilitazione delle completions","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Trasferimento: utente di destinazione mancante","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Trasferimento: ID utente di destinazione non valido","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Trasferimento: dati utente di destinazione non validi","MEMORI_TRANSFER_NOTHING_TO_DO":"Trasferimento: alcuna operazione da fare","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memori: la configurazione non può essere modificata","MEMORI_MISSING_NEW_PASSWORD":"Memori: nuova password mancante","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Memori: funzionalità richiede un abbonamento","INTEGRATION_NOT_FOUND":"Integrazione non trovata","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Formato non valido data a partire da","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Formato non valido data fino a","INTEGRATION_INVALID_TYPE":"Tipo integrazione non valido","INTEGRATION_ALREADY_EXISTS":"Integrazione già esistente","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Memori non pubblici non possono essere integrati","INTEGRATION_MISSING_INVOCATION_TEXT":"Integrazione: testo di invocazione mancante","INTEGRATION_MISSING_DEVICE_EMAILS":"Integrazione: email del dispositivo mancante","INTEGRATION_MEMORI_IS_EMPTY":"Memori vuoti non possono essere integrati","INTEGRATION_MISSING_PRIVACY_POLICY":"Integrazione: privacy policy mancante","INTEGRATION_MISSING_CATEGORY":"Categoria integrazione mancante","INTEGRATION_MISSING_DESCRIPTION":"Descrizione integrazione mancante","INTEGRATION_INVALID_INVOCATION_TEXT":"Testo di invocazione non valido","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home non più disponibile","UPLOAD_REQUIRES_MULTIPART_ENCODING":"L\'upload richiede l\'encoding multipart","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: manca il content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: dimensione massima superata","UPLOAD_FILE_IS_EMPTY":"Upload: file vuoto","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: tipo di file o firma non validi","UPLOAD_MISSING_FILE_NAME":"Upload: nome file mancante","UPLOAD_INVALID_MEMORY_ID":"Upload: ID contenuto non valido","UPLOAD_MISSING_FILE_CONTENT":"Upload: contenuto file mancante","ASSET_NOT_FOUND":"Asset non trovato","ASSET_NOT_ACCESSIBLE":"Asset non accessibile","ASSET_MISSING_SESSION_ID":"Asset: ID sessione mancante","ASSET_INVALID_FILE_NAME":"Asset: nome file non valido","INVITATION_NOT_FOUND":"Invito non trovato","INVITATION_NOT_ACCESSIBLE":"Invito non accessibile","INVITATION_ALREADY_ACCEPTED":"Invito già accettato","INVITATION_ALREADY_REJECTED":"Invito già rifiutato","INVITATION_MISSING_DESTINATION_EMAIL":"Invito: email di destinazione mancante","INVITATION_DESTINATION_EMAIL_INVALID":"Invito: email di destinazione non valida","INVITATION_MISSING_TAG":"Invito: tag mancante","INVITATION_MISSING_PIN":"Invito: PIN mancante","INVITATION_INVALID_PIN":"Invito: PIN non valido","INVITATION_INVALID_TYPE":"Invito: tipo non valido","INVITATION_MISSING_DESTINATION_NAME":"Invito: nome destinatario mancante","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invito: tag e pin non possono essere cambiati","INVITATION_CANT_BE_CHANGED":"Invito: non può essere modificato","ACTIONLOG_INVALID_USER_ID":"ID utente non valido","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","ACTIONLOG_INVALID_MEMORI_ID":"ID Memori non valido","CONSUMPTIONLOG_INVALID_TYPE":"Tipo di log non valido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","CONSUMPTIONLOG_INVALID_USER_ID":"ID utente non valido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Memori ID non valido","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifiche: Periodo di estrazione chatlog non valido","PROCESS_INVALID_TYPE":"Tipo di processo non valido","PROCESS_ALREADY_RUNNING":"Processo già in esecuzione","PROCESS_NOT_FOUND":"Processo non trovato","IMPORTCSV_MISSING_ROWS":"Importazione CSV: righe mancanti","IMPORTCSV_MISSING_CSV":"Importazione CSV: CSV mancante","IMPORTCSV_MISSING_SEPARATOR":"Importazione CSV: separatore mancante","IMPORTCSV_INVALID_SEPARATOR":"Importazione CSV: separatore non valido","IMPORTCSV_MISSING_HEADERS":"Importazione CSV: intestazioni mancanti","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Importazione CSV: separatore varianti titolo mancante","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"Importazione CSV: encoding caratteri non rilevabile","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione CSV: impossibile importare in Memori segreti","IMPORTTXT_MISSING_ROWS":"Importazione TXT: righe mancanti","IMPORTTXT_INVALID_GRANULARITY":"Importazione TXT: granularità non valida","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"Importazione TXT: encoding caratteri non rilevabile","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione TXT: impossibile importare in Memori segreti","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Importazione TXT: limite importazione superato","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Importazione TXT: importazione su GPT-4 richiede API key","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Importazione TXT: importazione richiede un piano a pagamento","EXPORTCSV_MISSING_CSV_SPECS":"Esportazione CSV: specifiche CSV mancanti","EXPORTCSV_MISSING_SEPARATOR":"Esportazione CSV: separatore mancante","EXPORTCSV_INVALID_SEPARATOR":"Esportazione CSV: separatore non valido","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Esportazione CSV: separatore varianti titolo mancante","EXPORTCSV_MISSING_NEW_LINE_CHAR":"Esportazione CSV: carattere di nuova riga mancante","EXPORTCSV_INVALID_NEW_LINE_CHAR":"Esportazione CSV: carattere di nuova riga non valido","EXPORTCSV_MISSING_PASSWORD":"Esportazione CSV: password mancante","EXPORTJSONL_MISSING_JSONL_SPECS":"Esportazione JSONL: specifiche JSONL mancanti","EXPORTJSONL_MISSING_PLATFORM":"Esportazione JSONL: piattaforma mancante","EXPORTJSONL_INVALID_PLATFORM":"Esportazione JSONL: piattaforma non valida","EXPORTJSONL_MISSING_PASSWORD":"Esportazione JSONL: password mancante","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"Esportazione JSONL: esportazione richiede un piano a pagamento","ANALYSIS_MISSING_QUERY":"Analisi: query mancante","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analisi: impossibile analizzare Memori segreti","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analisi: corrispondenza query utente richiede Pensiero Profondo","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Assegnazione badge: credenziali errate o mancanti","BADGE_ASSIGNMENT_MISSING_REF_ID":"Assegnazione badge: ID ref mancante","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Assegnazione badge: esito non trovato","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Assegnazione badge: URL di asserzione mancante","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Assegnazione badge: URL badge mancante","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Assegnazione badge: URL issuer mancante","BADGE_ASSIGNMENT_INVALID_URL":"Assegnazione badge: URL non valido","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Assegnazione badge: destinatario mancante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Assegnazione badge: tipo destinatario sconosciuto","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Assegnazione badge: identità destinatario mancante","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Assegnazione badge: tipo hash destinatario mancante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Assegnazione badge: tipo hash destinatario sconosciuto","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Assegnazione badge: identità destinatario errata","BADGE_NOT_FOUND":"Badge non trovato","OUTCOME_NO_DCM_CONFIGURED":"Esito: nessun DCM configurato","OUTCOME_USER_BADGES_DISABLED":"Esito: badge utente disabilitati"}}');const wG=_G({resources:{en:{translation:t(JSON.parse('{"yes":"Yes","no":"No","confirm":"Confirm","apply":"Apply","cancel":"Cancel","show":"Show","hide":"Hide","send":"Send","close":"Close","edit":"Edit","delete":"Delete","loading":"Loading","expand":"Expand","collapse":"Collapse","fullscreenEnter":"Enter fullscreen","fullscreenExit":"Exit fullscreen","center":"Center","bottom":"Bottom","hidden":"Hidden","day":"Day","month":"Month","year":"Year","createdAt":"Creation date","selected":"Selected","page":"page","actions":"Actions","next":"Next","previous":"Previous","copy":"Copy","copyToClipboard":"Copy to clipboard","showOriginalText":"Show original","showTranslatedText":"Show translation","exactPosition":"Exact position","uncertain":"Uncertain","question":"Question","nothingFound":"Nothing found","venue":"Venue","searchVenue":"Search venue...","memoriBlockedTitle":"Blocked","memoriBlockedUntil":"Memori blocked until {{date}}","memoriBlockedAnon":"Currently \\"{{name}}\\" can\'t answer, come back here on {{date}}","memoriBlockedReasonExceedChats":"because it has exceeded the monthly threshold of allowed chats.","memoriBlockedGiverHelper":"You can still manage it as administrator, but other users will not be able to interact with it.","generatedByAI":"Answer generated by AI, may occasionally generate incorrect informations","whyThisAnswer":"Why this answer?","whyThisAnswerHelper":"This answer was generated automatically by an artificial intelligence based on these verified contents.","completionsEnabled":"Advanced AI, can respond with automatically generated answers that may sometimes contain incorrect information","completionProviderDown":"This Twin is integrated with a generative AI from {{provider}}, but it is currently unavailable. Try again later.","completionProviderFallbackName":"an external provider","completionProviderCheckStatusPage":"Check status page","boardOfExperts":"Board of experts","birthDate":"Birth date","birthDateHelper":"We ask for your birth date only to enable or disable functionalities that have age restrictions","underage":"You must be at least {{age}} years old to sign up.","underageTwinSession":"You must be at least {{age}} years old to interact with this Twin.","ageVerification":"Age verification","ageVerificationText":"To interact with this Twin, you must be at least {{minAge}} years old.","nsfw":"NSFW: This Twin contains adult contents","deepThought":"Deep Thought","deepThoughtHelper":"Deep Thought is an advanced feature of the AI that will allow you to fully exploit your conversations by keeping track of them. The AI with Deep Thought can give you information tailored to you and the things you will share together. Allow the twin\'s author to contact you for commercial offers regarding products you have shown interest in.","deepThoughtDisclaimerTitle":"Deep Thought enabled","deepThoughtDisclaimer":"Deep Thought is an advanced feature of the AI that will allow you to fully exploit your conversations by keeping track of them. The AI with Deep Thought can give you information tailored to you and the things you will share together.","deepThoughtPreDisclaimerUnlogged":"Log in to enable Deep Thought.","deepThoughtPreDisclaimerNotAllowed":"Deep Thought is disabled since you didn\'t consent its usage, you can change this any time in your account settings.","knownFacts":{"title":"Known facts","description":"Details of the information shared between you and {{memoriName}}","type":"Type","typeShortTerm":"Short term","typeLongTerm":"Long term","typeHelper":"Types:\\n- Short Term: this Known Fact is always used during conversations\\n- Long Term: this Known Fact is used during conversations only if relevant to the current question","text":"Text","deleteSuccess":"Known fact deleted","deleteConfirmTitle":"Delete known fact","deleteConfirmMessage":"Are you sure you want to delete this known fact?","deleteSelectedConfirmTitle":"Delete selected known facts","deleteSelectedConfirmMessage":"Are you sure you want to delete the selected known facts?"},"auth":{"title":"Authentication","useRecoveryTokens":"Use recovery tokens","tokens":"Tokens","addToken":"Add token","usePassword":"Use password","atLeast":"At least"},"widget":{"instruct":"Instruct","test":"Test","sound":"Sound","position":"Position preferences","settings":"Settings","share":"Share","sendOnKeypress":"Hit Enter to send","sendOnClick":"Click on Submit","boardOfExperts":"Board of experts","showExpertsInTheBoard":"Show experts in this board","expertsInTheBoard":"Experts in this board","goToIntegrationsToCustomizeAvatar":"To customize the avatar, go to Share and customize the public page"},"write_and_speak":{"micButtonPopover":"Click the button to speak","micButtonPopoverListening":"Click the button to stop speak","pageInstructExplanation":"To teach me new things click on the INSTRUCT ME button to get started","pageTryMeExplanation":"To talk to me click on the START button to get started","instructButton":"INSTRUCT ME","tryMeButton":"START","chatHistory":"Chat history","exportChatHistory":"Export chat history","exportChatHistoryMessage":"Do you want to export chat history?","chatBotButtonText":"CLICK HERE TO OPEN CHATBOT","conversationStartedLabel":"Conversation started on","settingsHeaderLabel":"Setup here if you want to set the memori as continuous speech, and change the silence seconds if you want to customize them.","continuousSpeechLabel":"Continuous speech","holdToSpeak":"Hold to speak","releaseToEndListening":"Release to end listening","pressAndHoldToSpeak":"Press and hold to speak","microphoneMode":"Microphone mode","hideEmissionsLabel":"Hide text emitted by the Twin","secondsLabel":"Set seconds","controlsPosition":"Controls position","tryMeHeaderLabel":"TRY","unknownPosition":"Unknown position","fieldPlace":"Write the place (eg \'Milano\')","showMapLinkFor":"Show the position on the map","useMyPosition":"Use my position","myPosition":"Your position","updatingPosition":"Updating position...","placeNotFound":"Place not found!","requirePosition":"Insert your position before start","requirePositionHelp":"To talk to {{name}} you have to decide whether to provide your position or not. This is because different answers that it can provide you may depend on where you are.","dontWantToProvidePosition":"I don\'t want to provide my position","attachmentsLabel":"Enrich your message","iWantToTalkToIn":"I want to talk to {{name}} in"},"media":{"title":"Title","editAttributes":"Edit media attributes","uploadMimeTypeNotAllowed":"The file type is not allowed","uploadSizeLimitMessage":"The uploaded size is too big (max {{size}}MB)","uploadWrongResolutionMessage":"The resolution must be {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"You already have a Twin with this name","uploadHelperImages":"Upload a file with extension png, jpg, jpeg or gif, and having at maximum a size of {{size}}MB","uploadHelper":"Upload a file having at maximum a size of {{size}}MB","uploadError":"Upload failed","square":"square","scaleRatio":"Scale ratio","addMediaLabel":"Add a media","insertThisMediaMsg":"Insert these media","mediaUploadMessage":"Click to load a new media","addLinkLabel":"Add a link","linkKey":"URL","linkValue":"Link title","insertThisLink":"Insert a link to {{url}} with title {{title}}"},"gamification":{"level":"Level","points":"points","memoriReachedLevel":"became more evolved and reached level","levelGoToStatistics":"{{memori}} is at level {{level}} with {{points}} points. Click to go to statistics.","congratulationsNewLevel":"Congratulations, you have reached a new level!","congratulationsNewLevelDescription":"Your Memori became more evolved with {{points}} points, look at the","statistics":"statistics"},"login":{"login":"Login","logout":"Logout","user":"User","loggedDrawerTitle":"Hi, {{name}}!","loginDrawerTitle":"Login","newUserSignUp":"New user?","signUp":"Sign up!","registrationDisabled":"Registration is disabled","contactAdmin":"Contact the administrator to request access","userNameOrEmail":"Username or email","underage":"You must be at least {{age}} years old to sign up.","optional":"Optional","birthDate":"Birth date","birthDateHelper":"We ask for your birth date only to enable or disable functionalities that have age restrictions","missingData":"Missing informations","missingDataHelper":"We know that this is a bit annoying, but we need some more informations to complete your registration.","goToAccountToChangeYourPreferences":"You can change your choice at any time from your Account page.","deepThoughtExplaination":"Deep Thought is an advanced feature of the AI that will allow you to fully exploit your conversations by keeping track of them. The AI with Deep Thought can give you information tailored to you and the things you will share together. Allow the twin\'s author to contact you for commercial offers regarding products you have shown interest in.","tnCAndPPAcceptedHelper":"Since your last login, T&C and Privacy Policy have changed. Please accept them, otherwise you won\'t be able to make changes to your Twins. You can always delete your account in your user profile page.","privacyLabel":"I have read and accepted the","privacyAndCookiePolicy":"Privacy e Cookie Policy","and":"and","termsOfService":"Terms of Service","pAndCUAccepted":"I accept the terms of service about Deep Thought","save":"Save"},"success":"Success","Error":"Error","internal server error":"Oupsie, sorry... Something went wrong on the server","error":"Error","error.loading":"Error while loading content.","error.generic":"Oupsie, sorry... something went wrong.","error.serverNotResponding":"We are doing maintenance or releasing updates. Please try again later.","error.notFound":"Oupsie, we didn\'t find the page you were looking for.","error.goBackTo":"You can try to go back to the","error.reloadPage":"Reload the page","error.tryAgain":"Try again","error.unauthorized":"You are unauthorized to view this content.","error.unprocessableEntity":"Error while processing the request. Check the data you entered.","errors":{"TENANT_NOT_FOUND":"Tenant not found","TENANT_REGISTRATION_DISABLED":"Registration on this platform is disabled","TENANT_MISSING_NAME":"Tenant: name missing","TENANT_MAX_USERS_REACHED":"Maximum number of users reached","TENANT_MAX_ADMINS_REACHED":"Maximum number of admin users reached","TENANT_ALREADY_EXISTS":"Tenant already exists","TENANT_MISSING_DESCRIPTION":"Tenant: description missing","TENANT_CANT_SET_COMPLETION_PROVIDER":"Tenant: can\'t set completion provider","USER_NOT_CONFIRMED":"User still not confirmed","USER_NOT_FOUND":"User not found","USER_OR_PASSWORD_INVALID":"Invalid user or password","USER_MUST_CHANGE_PASSWORD":"You must change your password","USER_MUST_ENTER_VERIFICATION_CODE":"You must enter the verification code","USER_MISSING_TENANT":"User: missing tenant","USER_MISSING_NAME":"User: name is missing","USER_MISSING_PASSWORD":"User: password missing","USER_MISSING_EMAIL":"User: Missing email","USER_MISSING_VERIFICATION_CODE":"User: Missing verification code","USER_NAME_ALREADY_USED":"User name already in use","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"The password does not meet the security rules","USER_EMAIL_ALREADY_USED":"Email already in use","USER_EMAIL_INVALID":"Invalid email","USER_VERIFICATION_CODE_INVALID":"Invalid verification code","USER_MISSING_NAME_OR_EMAIL":"Missing username or email","USER_NAME_INVALID":"Invalid user name","USER_HAS_ONE_OR_MORE_MEMORI":"The user has one or more memories","USER_MISSING_NEW_PASSWORD":"User: new password missing","USER_NOTHING_TO_DO":"Nothing to do","USER_CANT_CREATE_MEMORI":"User not allowed to create Memori","USER_MAX_MEMORI_REACHED":"Maximum number of Memori reached","USER_TOO_MANY_ATTEMPTS":"Too many attempts","USER_MUST_ACCEPT_TNC_AND_PP":"You must accept the terms and conditions","USER_BIRTH_DATE_CANT_BE_CHANGED":"Date of birth cannot be changed","USER_CANT_SET_COMPLETION_PROVIDER":"User: not allowed to manage completion provider","USER_CANT_ENABLE_DEEP_THOUGHT":"User: not enabled to manage Deep Thought","USER_CANT_ENABLE_DCM_INTEGRATION":"User: not enabled to manage DCM integration","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"User: not allowed to manage chaining or expert group","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"The expert group requires completions to be enabled","MEMORI_NOT_FOUND":"Memori not found","MEMORI_NOT_ACCESSIBLE":"Memori not accessible","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Only owner can change tag or pin","SESSION_NOT_FOUND":"Session not found","SESSION_IS_NOT_ADMINISTRATIVE":"Non-administrative session","SESSION_EXPIRED":"Session expired","MEMORI_MISSING_CONFIGURATION":"Memori: missing configuration","MEMORI_CONFIGURATION_NOT_FOUND":"Memories: configuration not found","MEMORI_INVALID_PRIVACY_TYPE":"Memories: invalid privacy type","MEMORI_MISSING_PASSWORD":"Memori: missing password","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memories: total number of invalid recovery tokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memories: minimum number of invalid recovery tokens","MEMORI_INVALID_VOICE_TYPE":"Memories: invalid voice type","MEMORI_MISSING_NAME":"Memories: missing name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memories: missing password or recovery token","MEMORI_INVALID_ID":"Memories: invalid ID","MEMORI_NAME_ALREADY_USED":"Memory name already in use","MEMORI_INVALID_PIN":"Memories: Invalid PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memories: TAG and PIN change require separate operations","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memories: no password required when public","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Deep Thought requires completions to be enabled","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transfer: missing destination user","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transfer: invalid destination user ID","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transfer: invalid destination user data","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfer: nothing to do","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memories: configuration cannot be changed","MEMORI_MISSING_NEW_PASSWORD":"Memories: new password missing","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Feature requires subscription","INTEGRATION_NOT_FOUND":"Integration not found","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Invalid date from format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Invalid date to format","INTEGRATION_INVALID_TYPE":"Invalid integration type","INTEGRATION_ALREADY_EXISTS":"Integration already exists","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Non-public memories cannot be integrated","INTEGRATION_MISSING_INVOCATION_TEXT":"Integration: missing invocation text","INTEGRATION_MISSING_DEVICE_EMAILS":"Integration: missing device email","INTEGRATION_MEMORI_IS_EMPTY":"Empty memories cannot be integrated","INTEGRATION_MISSING_PRIVACY_POLICY":"Integration: privacy policy missing","INTEGRATION_MISSING_CATEGORY":"Integration category missing","INTEGRATION_MISSING_DESCRIPTION":"Missing integration description","INTEGRATION_INVALID_INVOCATION_TEXT":"Invalid invocation text","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home no more available","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Upload requires multipart encoding","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: missing content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: maximum size exceeded","UPLOAD_FILE_IS_EMPTY":"Upload: empty file","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: invalid file type or signature","UPLOAD_MISSING_FILE_NAME":"Upload: missing file name","UPLOAD_INVALID_MEMORY_ID":"Upload: Invalid content ID","UPLOAD_MISSING_FILE_CONTENT":"Upload: Missing file content","ASSET_NOT_FOUND":"Asset not found","ASSET_NOT_ACCESSIBLE":"Asset not accessible","ASSET_MISSING_SESSION_ID":"Asset: missing session ID","ASSET_INVALID_FILE_NAME":"Asset: invalid file name","INVITATION_NOT_FOUND":"Invitation not found","INVITATION_NOT_ACCESSIBLE":"Invitation not accessible","INVITATION_ALREADY_ACCEPTED":"Invitation already accepted","INVITATION_ALREADY_REJECTED":"Invitation already rejected","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation: missing destination email","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation: destination email invalid","INVITATION_MISSING_TAG":"Invitation: missing tag","INVITATION_MISSING_PIN":"Invitation: PIN missing","INVITATION_INVALID_PIN":"Invitation: invalid PIN","INVITATION_INVALID_TYPE":"Invitation: invalid type","INVITATION_MISSING_DESTINATION_NAME":"Invitation: destination name missing","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation: tag and pin can\'t be changed","INVITATION_CANT_BE_CHANGED":"Intation: can\'t be changed","ACTIONLOG_INVALID_USER_ID":"Invalid user ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","ACTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","CONSUMPTIONLOG_INVALID_TYPE":"Invalid log type","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","CONSUMPTIONLOG_INVALID_USER_ID":"Invalid user ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifications: Invalid chat log extraction period","PROCESS_INVALID_TYPE":"Invalid process type","PROCESS_ALREADY_RUNNING":"Process already running","PROCESS_NOT_FOUND":"Process not found","IMPORTCSV_MISSING_ROWS":"CSV import: missing rows","IMPORTCSV_MISSING_CSV":"CSV Import: Missing CSV","IMPORTCSV_MISSING_SEPARATOR":"CSV import: missing separator","IMPORTCSV_INVALID_SEPARATOR":"CSV import: invalid separator","IMPORTCSV_MISSING_HEADERS":"CSV import: missing headers","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV import: missing title variant separator","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"CSV import: undetectable character encoding","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"CSV Import: Cannot import to Secret Memories","IMPORTTXT_MISSING_ROWS":"Importing TXT: missing rows","IMPORTTXT_INVALID_GRANULARITY":"Import TXT: invalid granularity","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"TXT import: undetectable character encoding","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"TXT Import: Cannot import to Secret Memories","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Import TXT: import limit exceeded","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Import TXT: import on GPT-4 requires API key","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Import TXT: Import requires a paying plan","EXPORTCSV_MISSING_CSV_SPECS":"CSV export: missing CSV specifications","EXPORTCSV_MISSING_SEPARATOR":"CSV export: missing separator","EXPORTCSV_INVALID_SEPARATOR":"CSV export: invalid separator","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV export: missing title variant separator","EXPORTCSV_MISSING_NEW_LINE_CHAR":"CSV export: missing newline character","EXPORTCSV_INVALID_NEW_LINE_CHAR":"CSV export: invalid newline character","EXPORTCSV_MISSING_PASSWORD":"CSV export: missing password","EXPORTJSONL_MISSING_JSONL_SPECS":"JSONL export: missing JSONL specifications","EXPORTJSONL_MISSING_PLATFORM":"JSONL export: missing platform","EXPORTJSONL_INVALID_PLATFORM":"JSONL export: invalid platform","EXPORTJSONL_MISSING_PASSWORD":"JSONL export: missing password","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"JSONL Export: Export requires a paid plan","ANALYSIS_MISSING_QUERY":"Analysis: missing query","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analysis: Unable to analyze Secret Memories","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analysis: matching user query requires Deep Thinking","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Badge assignment: incorrect or missing credentials","BADGE_ASSIGNMENT_MISSING_REF_ID":"Badge assignment: ref ID missing","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Badge assignment: result not found","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Badge assignment: Missing assertion URL","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Badge Assignment: Missing Badge URL","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Badge assignment: missing issuer URL","BADGE_ASSIGNMENT_INVALID_URL":"Badge assignment: Invalid URL","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Badge assignment: missing recipient","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Badge assignment: unknown recipient type","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Badge assignment: missing recipient identity","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Badge assignment: missing recipient hash type","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Badge assignment: recipient hash type unknown","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Badge assignment: incorrect recipient identity","BADGE_NOT_FOUND":"Badge not found","OUTCOME_NO_DCM_CONFIGURED":"Result: no DCM configured","OUTCOME_USER_BADGES_DISABLED":"Result: user badges disabled"}}'))},it:{translation:t(xG)}},lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});wG.init();var CG=wG;c=o("85Hg2");function AG(e){var t=e.i18n,n=e.defaultNS,r=e.children,i=(0,c.useMemo)((function(){return{i18n:t,defaultNS:n}}),[t,n]);return(0,c.createElement)(se.Provider,{value:i},r)}const EG=({ownerUserName:e,ownerUserID:t,memoriName:n,memoriID:r,integrationID:i,tenantID:o,secretToken:a,sessionID:l,layout:u="DEFAULT",customLayout:d,showShare:h=!0,showSettings:p=!0,showInstruct:f=!1,showTypingText:m=!1,showClear:g=!1,showOnlyLastMessages:v=!1,showInputs:y=!0,showDates:b=!1,showContextPerLine:S=!1,showLogin:x,height:_="100%",baseURL:w,apiURL:C="https://backend.memori.ai",tag:A,pin:E,context:T,initialQuestion:M,uiLang:I,spokenLang:R,multilingual:P,authToken:k,AZURE_COGNITIVE_SERVICES_TTS_KEY:O,defaultSpeakerActive:N=!0,onStateChange:L,additionalInfo:D,customMediaRenderer:B,additionalSettings:z,userAvatar:F})=>{var U,j,H;const[G,V]=(0,c.useState)(),[W,q]=(0,c.useState)(),[K,J]=(0,c.useState)(O),{t:Y}=Se();if(!(r&&t||n&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const Z=Q(C),X=(0,c.useCallback)((async()=>{const e=w||(o.startsWith("https://")?o:`https://${o}`),t=await fetch(`${e}/api/speechkey`),n=await t.json();n.AZURE_COGNITIVE_SERVICES_TTS_KEY&&J(n.AZURE_COGNITIVE_SERVICES_TTS_KEY)}),[]);(0,c.useEffect)((()=>{O||X()}),[O]);const $=(0,c.useCallback)((async()=>{if(r&&t){const{memori:e,...n}=await Z.backend.getMemoriByUserAndId(o,t,r);0===n.resultCode&&e?V(e):console.error("[MEMORI]",n,e)}else if(n&&e){const{memori:t,...r}=await Z.backend.getMemori(o,e,n);0===r.resultCode&&t?V(t):console.error("[MEMORI]",r,t)}}),[r,t,n,e,o]);(0,c.useEffect)((()=>{$()}),[$,o]);const ee=(0,c.useCallback)((async()=>{const e=await nH(o,w);e&&q(e)}),[o,C]);(0,c.useEffect)((()=>{ee()}),[ee]),(0,c.useEffect)((()=>{if(I)CG.changeLanguage(I.toLowerCase());else{const{lng:e,fallbackLng:t}=(()=>{const e=navigator.language;if(e){let t=e.split("-")[0];if(["en","it"].includes(t))return{lng:t,fallbackLng:"en"===t?"it":"en"}}return{lng:"en",fallbackLng:"it"}})();CG.changeLanguage(e).catch((()=>{CG.changeLanguage(t)}))}}),[I]);const te=G?(0,s.jsx)(eH,{layout:u,customLayout:d,height:_,baseUrl:w||(o.startsWith("https://")?o:`https://${o}`),apiUrl:C,memori:{...G,secretToken:a},memoriLang:null!=R?R:null===(j=null===(U=G.culture)||void 0===U?void 0:U.split("-"))||void 0===j?void 0:j[0],multilingual:P,tenant:W,secret:a,sessionID:l,showShare:h,showSettings:p,showInstruct:f,showTypingText:m,showClear:g,showOnlyLastMessages:v,showInputs:y,showDates:b,showContextPerLine:S,showLogin:null!=x?x:null==G?void 0:G.enableDeepThought,integration:null===(H=null==G?void 0:G.integrations)||void 0===H?void 0:H.find((e=>i?e.integrationID===i:!!e.publish&&"LANDING_EXPERIENCE"===e.type)),initialContextVars:T,initialQuestion:M,authToken:k,AZURE_COGNITIVE_SERVICES_TTS_KEY:K||O,defaultSpeakerActive:N,onStateChange:L,additionalInfo:D,customMediaRenderer:B,additionalSettings:z,userAvatar:F,...A&&E?{personification:{tag:A,pin:E}}:{}}):(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,s.jsxs)("p",{style:{textAlign:"center",margin:"2rem auto",textTransform:"capitalize"},children:[Y("loading")||"Loading","..."]})});return(0,s.jsxs)(AG,{i18n:CG,children:[(0,s.jsx)(Ku.Toaster,{position:"top-center",reverseOrder:!0}),te]})};EG.propTypes={memoriName:t(l).string,memoriID:t(l).string,ownerUserName:t(l).string,ownerUserID:t(l).string,integrationID:t(l).string,tenantID:t(l).string.isRequired,secretToken:t(l).string,sessionID:t(l).string,layout:t(l).oneOf(["DEFAULT","FULLPAGE","TOTEM","WEBSITE_ASSISTANT","CHAT"]),customLayout:t(l).any,showShare:t(l).bool,showInstruct:t(l).bool,showInputs:t(l).bool,showDates:t(l).bool,showContextPerLine:t(l).bool,showSettings:t(l).bool,showClear:t(l).bool,showOnlyLastMessages:t(l).bool,showTypingText:t(l).bool,showLogin:t(l).bool,height:t(l).oneOfType([t(l).string,t(l).number]),baseURL:t(l).string,apiURL:t(l).string,tag:t(l).string,pin:t(l).string,context:t(l).objectOf(t(l).any),initialQuestion:t(l).string,uiLang:t(l).oneOf(["en","it","EN","IT"]),spokenLang:t(l).string,multilingual:t(l).bool,authToken:t(l).string,AZURE_COGNITIVE_SERVICES_TTS_KEY:t(l).string,defaultSpeakerActive:t(l).bool,onStateChange:t(l).func,additionalInfo:t(l).objectOf(t(l).any),customMediaRenderer:t(l).func,additionalSettings:t(l).any,userAvatar:t(l).oneOfType([t(l).string,t(l).any])};var TG=EG;class MG extends HTMLElement{connectedCallback(){const e=document.createElement("div"),n=document.createElement("div");n.setAttribute("id","memori-root"),e.appendChild(n),this.appendChild(e);const r=Object.keys(TG.propTypes).reduce(((e,t)=>(this.hasAttribute(t)&&(e[t]=this.getAttribute(t),"true"!==e[t]&&"false"!==e[t]||(e[t]="true"===e[t])),e)),{}),i=this.getAttribute("tenantId"),o=this.getAttribute("context")?.split(",")?.reduce(((e,t)=>{const[n,r]=t.split(":").map((e=>e.trim()));return{...e,[n]:r}}),{}),l=(e=>{try{return JSON.parse(e)}catch(e){return null}})(this.getAttribute("additionalInfo")||"{}")||{};i?t(a).render((0,s.jsx)(TG,{...r,context:o,tenantID:i,additionalInfo:l}),n):console.error("No tenantId attribute found")}}customElements.define("memori-client",MG)})();
250
+ */function zU(e,t=0){const n=[];return e.forEach((function(e,r){let i=null;e.forEach((function(o,s){if(!o&&null!==i)return n.push(`M${i+t} ${r+t}h${s-i}v1H${i+t}z`),void(i=null);if(s!==e.length-1)o&&null===i&&(i=s);else{if(!o)return;null===i?n.push(`M${s+t},${r+t} h1v1H${s+t}z`):n.push(`M${i+t},${r+t} h${s+1-i}v1H${i+t}z`)}}))})),n.join("")}function FU(e,t){return e.slice().map(((e,n)=>n<t.y||n>=t.y+t.h?e:e.map(((e,n)=>(n<t.x||n>=t.x+t.w)&&e))))}function UU(e,t,n,r){if(null==r)return null;const i=n?4:0,o=e.length+2*i,s=Math.floor(.1*t),a=o/t,l=(r.width||s)*a,c=(r.height||s)*a,u=null==r.x?e.length/2-l/2:r.x*a,d=null==r.y?e.length/2-c/2:r.y*a;let h=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);h={x:e,y:t,w:Math.ceil(l+u-e),h:Math.ceil(c+d-t)}}return{x:u,y:d,h:c,w:l,excavation:h}}var jU=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function HU(e){const n=e,{value:r,size:i=OU,level:o=NU,bgColor:s=LU,fgColor:a=DU,includeMargin:l=BU,style:u,imageSettings:d}=n,h=RU(n,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),p=null==d?void 0:d.src,f=(0,c.useRef)(null),m=(0,c.useRef)(null),[g,v]=(0,c.useState)(!1);(0,c.useEffect)((()=>{if(null!=f.current){const e=f.current,t=e.getContext("2d");if(!t)return;let n=PU.QrCode.encodeText(r,kU[o]).getModules();const c=l?4:0,u=n.length+2*c,h=UU(n,i,l,d),p=m.current,g=null!=h&&null!==p&&p.complete&&0!==p.naturalHeight&&0!==p.naturalWidth;g&&null!=h.excavation&&(n=FU(n,h.excavation));const v=window.devicePixelRatio||1;e.height=e.width=i*v;const y=i/u*v;t.scale(y,y),t.fillStyle=s,t.fillRect(0,0,u,u),t.fillStyle=a,jU?t.fill(new Path2D(zU(n,c))):n.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+c,n+c,1,1)}))})),g&&t.drawImage(p,h.x+c,h.y+c,h.w,h.h)}})),(0,c.useEffect)((()=>{v(!1)}),[p]);const y=IU({height:i,width:i},u);let b=null;return null!=p&&(b=t(c).createElement("img",{src:p,key:p,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),t(c).createElement(t(c).Fragment,null,t(c).createElement("canvas",IU({style:y,height:i,width:i,ref:f},h)),b)}var GU=({tenant:e,url:n,title:r="",className:i,baseUrl:o,primary:a=!0,showQrCode:l=!0,align:u="right"})=>{const{t:d}=Se(),[h,p]=(0,c.useState)(n),f=(0,c.useMemo)((()=>(null==e?void 0:e.theme)?`${null!=o?o:"https://aisuru.com"}/images/${e.theme}/square_logo.png`:`${null!=o?o:"https://aisuru.com"}/images/memori_logo.png`),[e,o]);(0,c.useEffect)((()=>{n||p(window.location.href)}),[n]);const m=[{id:"facebook",title:"Facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${h}`,icon:mU},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${h}`,icon:gU},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${r}&url=${h}`,icon:vU},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${h}`,icon:yU},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${r}&url=${h}`,icon:wU},{id:"email",title:"Email",url:`mailto:?subject=${(null==r?void 0:r.length)>0?r:n}&body=${h}`,icon:bU}];return(0,s.jsxs)(Tv,{as:"div",className:t(xs)("memori-share-button",{"memori-share-button--align-left":"left"===u}),children:[(0,s.jsx)(Tv.Button,{className:t(xs)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button",i,{"memori-button--primary":a}),title:d("widget.share")||void 0,children:(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(SU,{})})}),(0,s.jsxs)(Tv.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,s.jsx)(Tv.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsx)(Sf,{className:"memori-share-button--link",ghost:!0,icon:(0,s.jsx)(tS,{}),onClick:()=>{h&&navigator.clipboard.writeText(h)},children:d("copyToClipboard")||void 0})},"copy"),m.map((e=>{var n;return(0,s.jsx)(Tv.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsxs)("a",{className:t(xs)("memori-button","memori-button--with-icon","memori-button--ghost","memori-button--padded","memori-share-button--link"),href:null!==(n=e.url)&&void 0!==n?n:"",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(e.icon,{})}),e.title]})},e.id)})),l&&(0,s.jsxs)(Tv.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,s.jsx)(HU,{id:"qr-canvas",value:null!=h?h:"",size:128,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:f,x:void 0,y:void 0,height:32,width:32,excavate:!0}}),(0,s.jsx)("div",{children:(0,s.jsx)(Sf,{onClick:()=>{const e=document.getElementById("qr-canvas");if(!e)return;const t=document.createElement("a");t.href=e.toDataURL(),t.download=`memori-${r}-share.png`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},icon:(0,s.jsx)(xU,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};var VU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M290 236.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0 0 13.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 0 0 0 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 0 0-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"})});var WU=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",focusable:"false",role:"img",className:e,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","aria-label":t,children:[(0,s.jsx)("path",{d:"M23 4L23 10 17 10"}),(0,s.jsx)("path",{d:"M1 20L1 14 7 14"}),(0,s.jsx)("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})]});var qU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6c-.3 1.5-.4 3-.4 4.4 0 14.4 11.6 26 26 26h723c1.5 0 3-.1 4.4-.4 14.2-2.4 23.7-15.9 21.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"})});var KU=({className:e,memori:n,tenant:r,history:i,position:o,setShowPositionDrawer:a,setShowSettingsDrawer:l,setShowKnownFactsDrawer:u,setShowExpertsDrawer:d,speakerMuted:h,setSpeakerMuted:p,hasUserActivatedSpeak:f=!1,showShare:m=!0,showSettings:g=!0,showSpeaker:v=!0,showReload:y=!1,showClear:b=!1,showLogin:S=!0,setShowLoginDrawer:x,clearHistory:_,loginToken:w,user:C,sessionID:A})=>{const{t:E}=Se(),[T,M]=(0,c.useState)(!1),[I,R]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{document.fullscreenEnabled&&M(!0)}),[]),(0,s.jsxs)("div",{className:t(xs)("memori-header",e),children:[y&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--reload",title:E("reload")||"Reload",icon:(0,s.jsx)(WU,{}),onClick:()=>{window.location.reload()}}),b&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--clear",title:E("clearHistory")||"Clear chat",icon:(0,s.jsx)(qU,{}),onClick:_}),n.needsPosition&&o&&(0,s.jsxs)("div",{className:"memori-header--position",children:[0!==o.latitude&&0!==o.longitude&&(0,s.jsx)("span",{className:"memori-header--position-placeName",children:o.placeName}),(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--position",title:E("widget.position")||"Position",icon:(0,s.jsx)(XS,{}),onClick:()=>a(!0)})]}),T&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--fullscreen",title:I?E("fullscreenExit")||"Exit fullscreen":E("fullscreenEnter")||"Enter fullscreen",icon:I?(0,s.jsx)(DS,{}):(0,s.jsx)(VU,{}),onClick:()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),R(!1)):(document.documentElement.requestFullscreen(),R(!0))}}),n.enableDeepThought&&!!w&&(null==C?void 0:C.pAndCUAccepted)&&(0,s.jsx)(Sf,{primary:!!A&&!!f,shape:"circle",icon:(0,s.jsx)(YS,{}),className:"memori-header--button memori-header--button--knownfacts",disabled:!f||!A,onClick:()=>u(!0),title:E("knownFacts.title")||"Known facts"}),n.enableBoardOfExperts&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",icon:(0,s.jsx)(QS,{}),className:"memori-header--button memori-header--button--experts",disabled:!f||!A,onClick:()=>d(!0),title:E("widget.showExpertsInTheBoard")||"Experts in this board"}),v&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--speaker",icon:h?(0,s.jsx)(VF,{}):(0,s.jsx)(qF,{}),onClick:()=>p(!h),title:E("widget.sound")||"Sound"}),(0,s.jsx)(pU,{history:i,memori:n,className:"memori-header--button memori-header--button--export",disabled:!f||0===i.length}),g&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-settings",icon:(0,s.jsx)(fU,{}),onClick:()=>l(!0),title:E("widget.settings")||"Settings"}),m&&(0,s.jsx)(GU,{className:"memori-header--button memori-header--button-share",title:n.name,tenant:r,showQrCode:!0,align:"left"}),S&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-login",icon:(0,s.jsx)(cv,{}),onClick:()=>x(!0),title:w?E("login.user")||"User":E("login.login")||"Login"})]})};var JU=({tenant:e,userLang:t="en",integrationID:n,memoriHash:r})=>{const i="memorytwin"===(null==e?void 0:e.theme)?"memorytwin":"twincreator"===(null==e?void 0:e.theme)?"twincreator":"aisuru";return(0,s.jsxs)("div",{className:"memori--powered-by",children:[(0,s.jsx)("img",{src:`https://aisuru.com/images/${i}/logo.png`,alt:""}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"sr-only",children:"Powered by"}),(0,s.jsx)("a",{href:`https://memori.ai/${"it"===(null==t?void 0:t.toLowerCase())?"it":"en"}${n?`?integrationID=${n}`:""}${r?`${n?"&":"?"}memori=${r}`:""}`,target:"_blank",rel:"noopener noreferrer",children:"Memori.AI"})]})]})},QU=(c=o("85Hg2"),c=o("85Hg2"),(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(QU||{})),YU=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(YU||{}),ZU=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(ZU||{}),XU=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.SetOrientation=3]="SetOrientation",e[e.GoToOption=4]="GoToOption",e[e.Search=5]="Search",e[e.ClearSearch=6]="ClearSearch",e[e.RegisterOption=7]="RegisterOption",e[e.UnregisterOption=8]="UnregisterOption",e))(XU||{});function $U(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=wp(t(e.options.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{options:r,activeOptionIndex:i}}let ej={1:e=>e.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1},0(e){if(e.disabled||0===e.listboxState)return e;let t=e.activeOptionIndex,{value:n,mode:r,compare:i}=e.propsRef.current,o=e.options.findIndex((e=>{let t=e.dataRef.current.value;return ah(r,{1:()=>n.some((e=>i(e,t))),0:()=>i(n,t)})}));return-1!==o&&(t=o),{...e,listboxState:0,activeOptionIndex:t}},2:(e,t)=>e.disabled===t.disabled?e:{...e,disabled:t.disabled},3:(e,t)=>e.orientation===t.orientation?e:{...e,orientation:t.orientation},4(e,t){var n;if(e.disabled||1===e.listboxState)return e;let r=$U(e),i=am(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},5:(e,t)=>{if(e.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find((e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))})),o=i?e.options.indexOf(i):-1;return-1===o||o===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:o,activationTrigger:1}},6:e=>e.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},7:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=$U(e,(e=>[...e,n]));if(null===e.activeOptionIndex){let{value:i,mode:o,compare:s}=e.propsRef.current,a=t.dataRef.current.value;ah(o,{1:()=>i.some((e=>s(e,a))),0:()=>s(i,a)})&&(r.activeOptionIndex=r.options.indexOf(n))}return{...e,...r}},8:(e,t)=>{let n=$U(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},tj=(0,c.createContext)(null);function nj(e){let t=(0,c.useContext)(tj);if(null===t){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,nj),t}return t}function rj(e,t){return ah(t.type,ej,e,t)}tj.displayName="ListboxContext";let ij=c.Fragment,oj=fh((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,horizontal:u=!1,multiple:d=!1,...h}=e;const p=u?"horizontal":"vertical";let f=Rh(n),[m,g]=hm(r,s,i),v=(0,c.useReducer)(rj,{listboxState:1,propsRef:{current:{value:m,onChange:g,mode:d?1:0,compare:Th("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a)}},labelRef:(0,c.createRef)(),buttonRef:(0,c.createRef)(),optionsRef:(0,c.createRef)(),disabled:l,orientation:p,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1}),[{listboxState:y,propsRef:b,optionsRef:S,buttonRef:x},_]=v;b.current.value=m,b.current.mode=d?1:0,_h((()=>{b.current.onChange=e=>ah(b.current.mode,{0:()=>g(e),1(){let t=b.current.value.slice(),{compare:n}=b.current,r=t.findIndex((t=>n(t,e)));return-1===r?t.push(e):t.splice(r,1),g(t)}})}),[g,b]),_h((()=>_({type:2,disabled:l})),[l]),_h((()=>_({type:3,orientation:p})),[p]),nf([x,S],((e,t)=>{var n;_({type:1}),bp(t,yp.Loose)||(e.preventDefault(),null==(n=x.current)||n.focus())}),0===y);let w=(0,c.useMemo)((()=>({open:0===y,disabled:l,value:m})),[y,l,m]),C={ref:f};return t(c).createElement(tj.Provider,{value:v},t(c).createElement(Sh,{value:ah(y,{0:yh.Open,1:yh.Closed})},null!=o&&null!=m&&lm({[o]:m}).map((([e,n])=>t(c).createElement(up,{features:cp.Hidden,...mh({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:n})}))),dh({ourProps:C,theirProps:h,slot:w,defaultTag:ij,name:"Listbox"})))})),sj=fh((function(e,t){var n;let[r,i]=nj("Listbox.Button"),o=Rh(r.buttonRef,t),s=`headlessui-listbox-button-${lp()}`,a=Fh(),l=Th((e=>{switch(e.key){case rp.Space:case rp.Enter:case rp.ArrowDown:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:sm.First})}));break;case rp.ArrowUp:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:sm.Last})}))}})),u=Th((e=>{if(e.key===rp.Space)e.preventDefault()})),d=Th((e=>{if(ip(e.currentTarget))return e.preventDefault();0===r.listboxState?(i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),i({type:0}))})),h=nm((()=>{if(r.labelRef.current)return[r.labelRef.current.id,s].join(" ")}),[r.labelRef.current,s]),p=(0,c.useMemo)((()=>({open:0===r.listboxState,disabled:r.disabled,value:r.propsRef.current.value})),[r]),f=e;return dh({ourProps:{ref:o,id:s,type:im(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.optionsRef.current)?void 0:n.id,"aria-expanded":r.disabled?void 0:0===r.listboxState,"aria-labelledby":h,disabled:r.disabled,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:f,slot:p,defaultTag:"button",name:"Listbox.Button"})})),aj=fh((function(e,t){let[n]=nj("Listbox.Label"),r=`headlessui-listbox-label-${lp()}`;return dh({ourProps:{ref:Rh(n.labelRef,t),id:r,onClick:Th((()=>{var e;return null==(e=n.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))},theirProps:e,slot:(0,c.useMemo)((()=>({open:0===n.listboxState,disabled:n.disabled})),[n]),defaultTag:"label",name:"Listbox.Label"})})),lj=ch.RenderStrategy|ch.Static,cj=fh((function(e,t){var n;let[r,i]=nj("Listbox.Options"),o=Rh(r.optionsRef,t),s=`headlessui-listbox-options-${lp()}`,a=Fh(),l=Fh(),u=bh(),d=null!==u?u===yh.Open:0===r.listboxState;(0,c.useEffect)((()=>{var e;let t=r.optionsRef.current;!t||0===r.listboxState&&t!==(null==(e=dp(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})}),[r.listboxState,r.optionsRef]);let h=Th((e=>{switch(l.dispose(),e.key){case rp.Space:if(""!==r.searchQuery)return e.preventDefault(),e.stopPropagation(),i({type:5,value:e.key});case rp.Enter:if(e.preventDefault(),e.stopPropagation(),null!==r.activeOptionIndex){let{dataRef:e}=r.options[r.activeOptionIndex];r.propsRef.current.onChange(e.current.value)}0===r.propsRef.current.mode&&(i({type:1}),Oh().nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})})));break;case ah(r.orientation,{vertical:rp.ArrowDown,horizontal:rp.ArrowRight}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:sm.Next});case ah(r.orientation,{vertical:rp.ArrowUp,horizontal:rp.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:sm.Previous});case rp.Home:case rp.PageUp:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:sm.First});case rp.End:case rp.PageDown:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:sm.Last});case rp.Escape:return e.preventDefault(),e.stopPropagation(),i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case rp.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(i({type:5,value:e.key}),l.setTimeout((()=>i({type:6})),350))}})),p=nm((()=>{var e,t,n;return null!=(n=null==(e=r.labelRef.current)?void 0:e.id)?n:null==(t=r.buttonRef.current)?void 0:t.id}),[r.labelRef.current,r.buttonRef.current]),f=(0,c.useMemo)((()=>({open:0===r.listboxState})),[r]),m=e;return dh({ourProps:{"aria-activedescendant":null===r.activeOptionIndex||null==(n=r.options[r.activeOptionIndex])?void 0:n.id,"aria-multiselectable":1===r.propsRef.current.mode||void 0,"aria-labelledby":p,"aria-orientation":r.orientation,id:s,onKeyDown:h,role:"listbox",tabIndex:0,ref:o},theirProps:m,slot:f,defaultTag:"ul",features:lj,visible:d,name:"Listbox.Options"})})),uj=fh((function(e,t){let{disabled:n=!1,value:r,...i}=e,[o,s]=nj("Listbox.Option"),a=`headlessui-listbox-option-${lp()}`,l=null!==o.activeOptionIndex&&o.options[o.activeOptionIndex].id===a,{value:u,compare:d}=o.propsRef.current,h=ah(o.propsRef.current.mode,{1:()=>u.some((e=>d(e,r))),0:()=>d(u,r)}),p=(0,c.useRef)(null),f=Rh(t,p);_h((()=>{if(0!==o.listboxState||!l||0===o.activationTrigger)return;let e=Oh();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=p.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[p,l,o.listboxState,o.activationTrigger,o.activeOptionIndex]);let m=(0,c.useRef)({disabled:n,value:r,domRef:p});_h((()=>{m.current.disabled=n}),[m,n]),_h((()=>{m.current.value=r}),[m,r]),_h((()=>{var e,t;m.current.textValue=null==(t=null==(e=p.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[m,p]);let g=Th((()=>o.propsRef.current.onChange(r)));_h((()=>(s({type:7,id:a,dataRef:m}),()=>s({type:8,id:a}))),[m,a]);let v=Th((e=>{if(n)return e.preventDefault();g(),0===o.propsRef.current.mode&&(s({type:1}),Oh().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})})))})),y=Th((()=>{if(n)return s({type:4,focus:sm.Nothing});s({type:4,focus:sm.Specific,id:a})})),b=Th((()=>{n||l||s({type:4,focus:sm.Specific,id:a,trigger:0})})),S=Th((()=>{n||!l||s({type:4,focus:sm.Nothing})})),x=(0,c.useMemo)((()=>({active:l,selected:h,disabled:n})),[l,h,n]);return dh({ourProps:{id:a,ref:f,role:"option",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,"aria-selected":h,disabled:void 0,onClick:v,onFocus:y,onPointerMove:b,onMouseMove:b,onPointerLeave:S,onMouseLeave:S},theirProps:i,slot:x,defaultTag:"li",name:"Listbox.Option"})})),dj=Object.assign(oj,{Button:sj,Label:aj,Options:cj,Option:uj});var hj=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",focusable:"false",role:"img",className:e,fill:"currentColor","aria-label":t,children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z",clipRule:"evenodd"})});const pj={en:["January","February","March","April","May","June","July","August","September","October","November","December"],it:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"]},fj=(0,c.memo)((({defaultDate:e,onChange:t,disabled:n=!1})=>{const{t:r,i18n:i}=Se(),[o,a]=(0,c.useState)(e?"string"==typeof e?_s.DateTime.fromISO(e):_s.DateTime.fromJSDate(e):_s.DateTime.now());return(0,c.useEffect)((()=>{t(o)}),[o,t]),(0,s.jsxs)("div",{className:"memori--date-selector",children:[(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(dj,{value:o,onChange:e=>{a(e)},disabled:n,name:"day",children:[(0,s.jsxs)(dj.Label,{className:"memori--date-selector__select-label",children:[r("day"),":"]}),(0,s.jsxs)(dj.Button,{"aria-label":r("day"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.day}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(hj,{})})]}),(0,s.jsx)(tp,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(dj.Options,{className:"memori--date-selector__select-options",children:[...Array(31).keys()].map((e=>(0,s.jsx)(dj.Option,{value:o.set({day:e+1}),className:"memori--date-selector__select-option",children:e+1},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(dj,{value:o,onChange:e=>{a(e)},disabled:n,name:"month",children:[(0,s.jsxs)(dj.Label,{className:"memori--date-selector__select-label",children:[r("month"),":"]}),(0,s.jsxs)(dj.Button,{"aria-label":r("month"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:pj["it"===i.language?"it":"en"][o.month-1]}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(hj,{})})]}),(0,s.jsx)(tp,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(dj.Options,{className:"memori--date-selector__select-options",children:pj["it"===i.language?"it":"en"].map((e=>(0,s.jsx)(dj.Option,{className:"memori--date-selector__select-option",value:o.set({month:pj["it"===i.language?"it":"en"].findIndex((t=>t===e))+1}),children:e},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(dj,{value:o,onChange:e=>{a(e)},disabled:n,name:"year",children:[(0,s.jsxs)(dj.Label,{className:"memori--date-selector__select-label",children:[r("year"),":"]}),(0,s.jsxs)(dj.Button,{"aria-label":r("year"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.year}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(hj,{})})]}),(0,s.jsx)(tp,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(dj.Options,{className:"memori--date-selector__select-options",children:[...Array(_s.DateTime.now().year-1899).keys()].sort(((e,t)=>t-e)).map((e=>(0,s.jsx)(dj.Option,{value:o.set({year:e+1900}),className:"memori--date-selector__select-option",children:e+1900},e)))})})]})})]})}));fj.displayName="DateSelector";var mj=fj;c=o("85Hg2");var gj=({visible:e=!1,onClose:n,minAge:r})=>{const{t:i}=Se(),[o,a]=(0,c.useState)(),[l,u]=(0,c.useState)(),[d,h]=(0,c.useState)(!1),p=(0,c.useCallback)((()=>{if(h(!0),!o)return t(Ku).error(i("requiredField")),u(i("requiredField")||"Required field"),void h(!1);if(_s.DateTime.now().diff(o,"years").years<r)return t(Ku).error(i("underageTwinSession",{age:r})),u(i("underageTwinSession",{age:r})||`You must be at least ${r} years old to interact with this Twin`),void h(!1);n(o.toJSDate().toISOString())}),[o,r,n,i]);return(0,s.jsxs)(Fm,{open:e,title:i("ageVerification"),className:"age-verification-modal",closable:!0,onClose:()=>n(),children:[(0,s.jsx)("p",{children:i("ageVerificationText",{minAge:r})}),(0,s.jsxs)("form",{className:"age-verification-form",onSubmit:e=>{e.preventDefault(),p()},children:[(0,s.jsx)("div",{className:"form-item",children:(0,s.jsxs)("fieldset",{name:"birthDate",children:[(0,s.jsx)("legend",{className:"sr-only",children:i("birthDate")}),(0,s.jsx)(mj,{defaultDate:new Date(Date.now()),onChange:e=>{a(e)}}),(0,s.jsx)("p",{className:"form-item-help",children:i("birthDateHelper")}),l&&(0,s.jsx)("p",{className:"form-item-error",children:l})]})}),(0,s.jsx)("div",{className:"form-item form-submit",children:(0,s.jsx)(Sf,{primary:!0,htmlType:"submit",className:"age-verification-submit",loading:d,disabled:!o,children:i("confirm")})})]})]})};c=o("85Hg2");var vj=({label:e,className:n,disabled:r=!1,indeterminate:i=!1,checked:o,children:a,onChange:l,name:u,...d})=>{const h=(0,c.useRef)(null);return(0,c.useEffect)((()=>{h.current&&(h.current.indeterminate=i)}),[h,i]),(0,s.jsxs)("label",{className:t(xs)("memori-checkbox",n,{"memori-checkbox--disabled":r,"memori-checkbox--indeterminate":i}),children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{ref:h,type:"checkbox",...d,name:u,disabled:r,checked:o||i,className:"memori-checkbox--input",onChange:l}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),!!(null==e?void 0:e.length)&&(0,s.jsx)("span",{className:"memori-checkbox--text",children:e})]})};c=o("85Hg2");var yj=({className:e,value:n,name:r,displayValue:i,options:o,onChange:a,disabled:l=!1,label:u,placeholder:d})=>(0,s.jsx)("div",{className:t(xs)("memori-select",e),children:(0,s.jsxs)(dj,{value:n,onChange:e=>{a(e)},disabled:l,name:r,children:[u&&(0,s.jsxs)(dj.Label,{className:"memori-select--label",children:[u,":"]}),(0,s.jsxs)(dj.Button,{"aria-label":u,className:"memori-select--button",children:[(0,s.jsx)("span",{className:t(xs)("memori-select--value",{"memori-select--value-placeholder":!n}),children:n?i||n:d}),(0,s.jsx)("span",{className:"memori-select--icon",children:(0,s.jsx)(hj,{})})]}),(0,s.jsx)(tp,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(dj.Options,{className:"memori-select--options",children:o.map((e=>(0,s.jsx)(dj.Option,{value:e.value,className:"memori-select--option",children:e.label},e.value)))})})]})});const bj={muteSpeaker:"@memori:muteSpeaker",microphoneMode:"@memori:microphoneMode",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",sendOnEnter:"@memori:sendOnEnter",birthDate:"@memori:birthDate",controlsPosition:"@memori:controlsPosition",hideEmissions:"@memori:hideEmissions",loginToken:"@memori:loginToken",location:"@memori:location"},Sj=(e,t)=>{var n;try{const r=window.localStorage.getItem(null!==(n=bj[e])&&void 0!==n?n:e);if(!r)return t;try{return JSON.parse(r)}catch(e){return r}}catch(e){return console.error("error",e),t}},xj=(e,t)=>{var n;try{window.localStorage.setItem(null!==(n=bj[e])&&void 0!==n?n:e,t.toString())}catch(e){console.error("error",e)}},_j=e=>{var t;try{window.localStorage.removeItem(null!==(t=bj[e])&&void 0!==t?t:e)}catch(e){console.error("error",e)}},wj=[2,3,5,10,15,20,30,60];var Cj=({open:e,layout:t="DEFAULT",onClose:n,microphoneMode:r="HOLD_TO_TALK",continuousSpeechTimeout:i,setMicrophoneMode:o,setContinuousSpeechTimeout:a,controlsPosition:l,setControlsPosition:c,hideEmissions:u,setHideEmissions:d,additionalSettings:h})=>{const{t:p}=Se();return(0,s.jsxs)(_f,{className:"memori-settings-drawer",open:e,onClose:n,title:p("widget.settings")||"Settings",description:p("write_and_speak.settingsHeaderLabel"),children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#microphoneMode",children:[p("write_and_speak.microphoneMode")||"Microphone mode",":"]}),(0,s.jsxs)(OS,{id:"microphoneMode",name:"microphoneMode",value:r,defaultValue:r,className:"memori-settings-drawer--microphoneMode-radio",onChange:e=>{let t="CONTINUOUS"===e?"CONTINUOUS":"HOLD_TO_TALK";o(t),xj("microphoneMode",t)},children:[(0,s.jsx)(OS.Option,{value:"HOLD_TO_TALK",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Sf,{primary:e,outlined:!e,children:p("write_and_speak.holdToSpeak")||"Hold to speak"})}),(0,s.jsx)(OS.Option,{value:"CONTINUOUS",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Sf,{primary:e,outlined:!e,children:p("write_and_speak.continuousSpeechLabel")||"Continuous speech"})})]})]}),"CONTINUOUS"===r&&(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(yj,{label:p("write_and_speak.secondsLabel")||"Seconds",placeholder:p("write_and_speak.secondsLabel")||"Seconds",options:wj.map((e=>({value:e,label:e}))),value:i,onChange:e=>{a(e),xj("continuousSpeechTimeout",e)}})}),"TOTEM"===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#controlsPosition",children:[p("write_and_speak.controlsPosition")||"Controls",":"]}),(0,s.jsxs)(OS,{id:"controlsPosition",name:"controlsPosition",value:l,defaultValue:l,className:"memori-settings-drawer--controlsposition-radio",onChange:e=>{c(e),xj("controlsPosition",e)},children:[(0,s.jsx)(OS.Option,{value:"center",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Sf,{primary:e,outlined:!e,children:p("center")||"Center"})}),(0,s.jsx)(OS.Option,{value:"bottom",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Sf,{primary:e,outlined:!e,children:p("bottom")||"Bottom"})})]})]}),(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(vj,{label:p("write_and_speak.hideEmissionsLabel")||"Hide emissions",name:"hideControls",checked:u,onChange:e=>{d(e.target.checked),xj("hideEmissions",e.target.checked)}})})]}),h&&(0,s.jsx)("div",{className:"memori-settings-drawer--field controls",children:h})]})};c=o("85Hg2");var Aj=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"})});var Ej=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M15 18L9 12 15 6"})});var Tj=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M9 18L15 12 9 6"})});var Mj=({apiURL:e,sessionID:n,memori:r,visible:i=!0,initialKnownFacts:o=[],closeDrawer:a})=>{var l;const{t:u}=Se(),d=Q(e),{getKnownFactsPaginated:h,deleteKnownFact:p}=d.knownFacts,[f,m]=(0,c.useState)(o),[g,v]=(0,c.useState)(25),[y,b]=(0,c.useState)(0),[S,x]=(0,c.useState)(null!==(l=null==o?void 0:o.length)&&void 0!==l?l:0),[_,w]=(0,c.useState)(!1),C=async(e,r,i)=>{if(n||e){w(!0);try{const{knownFacts:o,count:s,...a}=await h(null!=e?e:n,null!=r?r:y,null!=i?i:g);m(null!=o?o:[]),x(null!=s?s:0),0!==a.resultCode&&(console.error(a),t(Ku).error(u(zv(a.resultCode))))}catch(e){console.error("KNOWN_FACTS/FETCH",e),m(null!=o?o:[])}w(!1)}};(0,c.useEffect)((()=>{C()}),[]);const[A,E]=(0,c.useState)(!1),[T,M]=(0,c.useState)(),[I,R]=(0,c.useState)([]);return(0,s.jsxs)(_f,{open:i,width:"80%",className:"memori-known-facts-drawer",onClose:()=>a(),title:u("knownFacts.title"),children:[(0,s.jsx)("p",{children:u("knownFacts.description",{memoriName:r.name})}),(0,s.jsxs)(bf,{spinning:_,children:[(0,s.jsxs)("div",{className:"memori-known-facts-actions",children:[(0,s.jsxs)(Sf,{primary:!0,danger:!0,onClick:()=>{E(!0)},className:"memori-known-facts-delete-selected",disabled:0===(null==I?void 0:I.length),icon:(0,s.jsx)(Aj,{}),loading:_,children:[u("selected")," (",null==I?void 0:I.length,")"]}),(0,s.jsx)(Fm,{className:"memori-known-facts-modal",open:A,closable:!0,title:I.length>1?u("knownFacts.deleteSelectedConfirmTitle"):u("knownFacts.deleteConfirmTitle"),description:I.length>1?u("knownFacts.deleteSelectedConfirmMessage",{number:I.length}):u("knownFacts.deleteConfirmMessage"),onClose:()=>{E(!1)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Sf,{ghost:!0,onClick:()=>{E(!1)},children:u("cancel")}),(0,s.jsx)(Sf,{primary:!0,danger:!0,onClick:async()=>{try{const e=I.map((e=>p(n,e)));Promise.all(e).then((e=>{if(e.every((e=>0===e.resultCode)))t(Ku).success(u("knownFacts.deleteSuccess")),R([]),C(),E(!1);else{let n=e.find((e=>0!==e.resultCode));console.error(n),void 0!==(null==n?void 0:n.resultCode)&&t(Ku).error(u(zv(null==n?void 0:n.resultCode)))}}))}catch(e){let n=e;t(Ku).error(u("Error")+n.message)}},children:u("confirm")})]})})]}),S>25&&(0,s.jsxs)("nav",{className:"memori--table--pagination",children:[S>g&&(0,s.jsxs)("div",{className:"memori--table--pagination--pages",children:[(0,s.jsx)(Sf,{shape:"circle",disabled:0===y||y<g,padded:!1,title:u("previous")||"Previous",icon:(0,s.jsx)(Ej,{}),onClick:()=>{let e=(y/g-1)*g;b(e),C(void 0,e,g)}}),(0,s.jsxs)("span",{className:"memori--table--pagination--pages--current",children:[Math.ceil(y/g)+1," /"," ",Math.ceil(S/g)]}),(0,s.jsx)(Sf,{shape:"circle",padded:!1,title:u("next")||"Next",icon:(0,s.jsx)(Tj,{}),disabled:(y/g+1)*g>=S,onClick:()=>{let e=(y/g+1)*g;b(e),C(void 0,e,g)}})]}),(0,s.jsx)(yj,{options:[{label:`25 / ${u("page")||"page"}`,value:25},{label:`50 / ${u("page")||"page"}`,value:50},{label:`100 / ${u("page")||"page"}`,value:100}],value:g,displayValue:`${g} / ${u("page")||"page"}`,onChange:e=>{v(e),b(0),C(void 0,0,e)}})]}),(0,s.jsxs)("table",{className:"memori--table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(vj,{checked:!!(null==f?void 0:f.length)&&(null==I?void 0:I.length)===f.length,indeterminate:!!(null==f?void 0:f.length)&&!!(null==I?void 0:I.length)&&(null==I?void 0:I.length)!==(null==f?void 0:f.length),onChange:e=>{e.target.checked?R(f.map((e=>e.knownFactID))):R([])}})}),(0,s.jsx)("th",{children:u("knownFacts.text")}),(0,s.jsx)("th",{className:"mobile-hidden",children:u("createdAt")}),(0,s.jsx)("th",{className:"memori--table--column-right",children:u("actions")})]})}),(0,s.jsx)("tbody",{children:f.map((e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(vj,{checked:null==I?void 0:I.includes(e.knownFactID),onChange:t=>{t.target.checked?R((t=>[...new Set([...t,e.knownFactID])])):R((t=>t.filter((t=>t!==e.knownFactID))))}})}),(0,s.jsx)("td",{children:e.text}),(0,s.jsx)("td",{className:"mobile-hidden",children:(0,s.jsx)("span",{className:"memori--table--date",children:e.creationTimestamp?new Intl.DateTimeFormat("it",{dateStyle:"short",timeStyle:"short"}).format(new Date(e.creationTimestamp)):"-"})}),(0,s.jsx)("td",{className:"memori--table--column-right",children:(0,s.jsxs)("div",{className:"memori--table--action-column",children:[(0,s.jsx)(Sf,{danger:!0,ghost:!0,shape:"circle",icon:(0,s.jsx)(Aj,{}),disabled:(null==I?void 0:I.length)>0,title:u("delete")||"Delete",onClick:()=>M(e.knownFactID)}),(0,s.jsx)(Fm,{className:"memori-known-facts-modal",open:T===e.knownFactID,closable:!0,title:u("knownFacts.deleteConfirmTitle"),description:u("knownFacts.deleteConfirmMessage"),onClose:()=>{M(void 0)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Sf,{ghost:!0,onClick:()=>{M(void 0)},children:u("cancel")}),(0,s.jsx)(Sf,{primary:!0,danger:!0,onClick:async()=>{try{const r=await p(n,e.knownFactID);0===r.resultCode?(t(Ku).success(u("knownFacts.deleteSuccess")),R([]),C(),M(void 0)):(console.error(r),t(Ku).error(u(zv(r.resultCode),{ns:"common"})))}catch(e){let n=e;t(Ku).error(u("Error")+n.message)}},children:u("confirm")})]})})]})})]},e.knownFactID)))})]})]})]})};var Ij=({open:e=!1,baseUrl:t,apiUrl:n,tenant:r,experts:i,onClose:o})=>{const{t:a}=Se();return(0,s.jsx)(_f,{open:e,onClose:o,className:"memori--experts-drawer",title:(0,s.jsx)("h2",{className:"memori--experts-drawer--title",children:a("widget.expertsInTheBoard")}),children:(0,s.jsx)("ul",{className:"memori--experts-drawer--list",children:i.map((e=>(0,s.jsxs)("li",{className:"memori--experts-drawer--item",children:[(0,s.jsx)("figure",{className:"memori--experts-drawer--avatar",children:(0,s.jsx)("img",{src:`${n}/api/v1/memoriai/memori/avatar/${e.expertMemoriID}`,alt:e.name,onError:e=>{e.currentTarget.src=lv({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:t}),e.currentTarget.onerror=null}})}),(0,s.jsxs)("div",{className:"memori--experts-drawer--content",children:[(0,s.jsx)("h3",{className:"memori--experts-drawer--name",children:e.name}),(0,s.jsx)("p",{className:"memori--experts-drawer--description",children:e.description})]})]},e.expertID)))})})};c=o("85Hg2");const Rj=/^\w+([.-]?[+]?\w+)*@\w+([.-]?\w+)*(\.\w{2,})+$/;var Pj=({open:e=!1,onClose:n,onLogin:r,onLogout:i,user:o,loginToken:a,tenant:l,apiUrl:u,__TEST__needMissingData:d=!1})=>{var h;const{t:p,i18n:f}=Se(),m="it"===f.language?"it":"en",g=Q(u),{userLogin:v,updateUser:y}=g.backend,[b,S]=(0,c.useState)(!1),[x,_]=(0,c.useState)(d?{token:"token",birthDate:!0,tnCAndPPAccepted:!0}:{}),[w,C]=(0,c.useState)(null),[A,E]=(0,c.useState)(null);(0,c.useEffect)((()=>{E(window.location.href)}),[]);const T=(null==o?void 0:o.userID)&&a;return(0,s.jsx)(_f,{open:e,onClose:n,className:t(xs)("memori--login-drawer",{"memori--login-drawer--logged":T}),title:(0,s.jsx)("h2",{className:"memori--login-drawer--title",children:T?p("login.loggedDrawerTitle",{name:o.userName}):p("login.loginDrawerTitle")}),children:T?(0,s.jsx)("div",{className:"memori--login-drawer--logged",children:(0,s.jsx)(Sf,{primary:!0,onClick:()=>{i()},children:p("login.logout")})}):(null===(h=null==x?void 0:x.token)||void 0===h?void 0:h.length)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{children:p("login.missingData")}),(0,s.jsx)("p",{children:p("login.missingDataHelper")}),(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:async e=>{var n,i,s;e.preventDefault();const a=e.currentTarget,l=null===(n=a.birthDate)||void 0===n?void 0:n.value,c=null===(i=a.tnCAndPPAccepted)||void 0===i?void 0:i.checked,u=null===(s=a.pAndCUAccepted)||void 0===s?void 0:s.checked;if(!(null==o?void 0:o.userID)||!(null==x?void 0:x.token))return;if(!l||!c)return void C(p("missingData"));let d={userID:o.userID,birthDate:(null==o?void 0:o.birthDate)||!x.birthDate?void 0:l,tnCAndPPAccepted:c||(null==o?void 0:o.tnCAndPPAccepted),tnCAndPPAcceptanceDate:c?(new Date).toISOString():void 0,pAndCUAccepted:u||(null==o?void 0:o.pAndCUAccepted),pAndCUAcceptanceDate:u?(new Date).toISOString():void 0};const{user:h,...f}=await y(x.token,o.userID,d);0!==f.resultCode?(console.error(f),t(Ku).error(p(zv(f.resultCode),{ns:"common"})),C(f.resultMessage)):(t(Ku).success(p("success")),r(h||d,x.token))},children:[x.birthDate&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{htmlFor:"#birthDate",children:[p("login.birthDate"),(0,s.jsx)("input",{id:"birthDate",name:"birthDate",type:"date",required:!0,autoComplete:"bday"})]}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:p("login.birthDateHelper")})})]}),(null==x?void 0:x.tnCAndPPAccepted)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"tnCAndPPAccepted",className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[p("login.privacyLabel")," ",(0,s.jsx)("a",{href:`https://memori.ai/${m}/privacy_and_cookie`,target:"_blank",rel:"noopener noreferrer",children:p("login.privacyAndCookiePolicy")})," ",p("login.and")," ",(0,s.jsx)("a",{href:`https://memori.ai/${m}/tos`,target:"_blank",rel:"noopener noreferrer",children:p("login.termsOfService")})]})]}),(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"pAndCUAccepted",defaultChecked:null==o?void 0:o.pAndCUAccepted,className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[p("login.pAndCUAccepted")," ",(0,s.jsx)("small",{children:(0,s.jsxs)("em",{children:["(",p("login.optional"),")"]})})]})]}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:p("login.goToAccountToChangeYourPreferences")})}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:p("login.deepThoughtExplaination")})})]}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,loading:b,children:p("login.save")})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:e=>{e.preventDefault();const n=e.currentTarget,i=n.userNameOrEmail.value,o=n.password.value,s=Rj.test(i)?{tenant:null==l?void 0:l.id,eMail:i,password:o}:{tenant:null==l?void 0:l.id,userName:i,password:o};S(!0),C(null),v(s).then((e=>{var n,i,o,s;0!==e.resultCode?(console.error(e),t(Ku).error(p(zv(e.resultCode),{ns:"common"})),C(e.resultMessage)):e.user&&e.token&&(r(e.user,e.token),(null===(n=e.user)||void 0===n?void 0:n.tnCAndPPAccepted)&&(null===(i=e.user)||void 0===i?void 0:i.birthDate)||_({token:e.token,birthDate:!(null===(o=e.user)||void 0===o?void 0:o.birthDate),tnCAndPPAccepted:!(null===(s=e.user)||void 0===s?void 0:s.tnCAndPPAccepted)}))})).catch((e=>{console.error("[LOGIN]",e),t(Ku).error(e),e.message&&C(e.message)})).finally((()=>{S(!1)}))},children:[(0,s.jsxs)("label",{htmlFor:"#userNameOrEmail",children:[p("login.userNameOrEmail"),(0,s.jsx)("input",{id:"userNameOrEmail",name:"userNameOrEmail",required:!0,autoComplete:"email",placeholder:"Username/email"})]}),(0,s.jsxs)("label",{htmlFor:"#password",children:["Password",(0,s.jsx)("input",{id:"password",name:"password",type:"password",required:!0,autoComplete:"password",placeholder:"Password"})]}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,loading:b,children:p("login.login")}),(null==l?void 0:l.disableRegistration)?l.adminEmail?(0,s.jsxs)("div",{className:"memori--login-drawer--signup",children:[(0,s.jsx)("p",{children:p("login.registrationDisabled")}),(0,s.jsxs)("p",{children:[p("login.contactAdmin"),":"," ",(0,s.jsx)("a",{href:`mailto:${l.adminEmail}`,children:l.adminEmail})]})]}):null:(0,s.jsxs)("p",{className:"memori--login-drawer--signup",children:[p("login.newUserSignUp")," ",(0,s.jsx)("a",{href:`https://${l.name||"www.aisuru.com"}/${m}/auth?signup=1&redirectTo=${A}`,children:p("login.signUp")})]})]}),w&&(0,s.jsx)("p",{role:"alert",className:"memori--login-drawer--error",children:w})]})})};var kj=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:h,sessionId:p,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(bf,{spinning:g,children:[m&&d&&h&&(0,s.jsx)(d,{...h}),e&&t&&(0,s.jsx)(e,{...t}),(0,s.jsxs)("div",{className:"memori--grid",children:[(0,s.jsxs)("div",{className:"memori--grid-column memori--grid-column-left",children:[n&&r&&(0,s.jsx)(n,{...r}),(0,s.jsx)("div",{id:"extension"})]}),(0,s.jsx)("div",{className:"memori--grid-column memori--grid-column-right",children:p&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null}),v]})]})]});var Oj=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:h,sessionId:p,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(bf,{spinning:g,className:"memori-totem-layout",children:[v,m&&d&&h&&(0,s.jsx)(d,{...h}),(0,s.jsx)("div",{className:"memori-totem-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{className:"memori-totem-layout--avatar",children:n&&r&&(0,s.jsx)(n,{...r})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-totem-layout--controls",children:p&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]});var Nj=({Header:e,headerProps:t,Chat:n,chatProps:r,StartPanel:i,startPanelProps:o,integrationStyle:a,integrationBackground:l,ChangeMode:c,changeModeProps:u,sessionId:d,hasUserActivatedSpeak:h,showInstruct:p=!1,loading:f=!1,poweredBy:m})=>(0,s.jsxs)(s.Fragment,{children:[a,l,(0,s.jsxs)(bf,{spinning:f,className:"memori-chat-layout",children:[m,p&&c&&u&&(0,s.jsx)(c,{...u}),(0,s.jsx)("div",{className:"memori-chat-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-chat-layout--controls",children:d&&h&&n&&r?(0,s.jsx)(n,{...r}):o?(0,s.jsx)(i,{...o}):null})]})]});c=o("85Hg2"),c=o("85Hg2");var Lj=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:u,ChangeMode:d,changeModeProps:h,sessionId:p,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>{var y,b;const{t:S}=Se(),[x,_]=(0,c.useState)(!0),[w,C]=(0,c.useState)(),A=(0,c.useMemo)((()=>null==o?void 0:o.stopAudio),[null==o?void 0:o.stopAudio]),E=e=>{_(e),C(e?void 0:(new Date).toISOString());try{null==A||A()}catch(e){console.log(e)}};return(0,s.jsx)("div",{className:"memori-website_assistant--"+(x?"collapsed":"expanded"),children:x?(0,s.jsx)("div",{className:"memori-website_assistant--trigger",children:(0,s.jsx)(Sf,{className:"memori-website_assistant--trigger-button",ghost:!0,shape:"circle",onClick:()=>E(!1),title:S("expand")||"Expand",children:(0,s.jsx)(zF,{avatar:null==r?void 0:r.memori.avatarURL})})}):(0,s.jsxs)(s.Fragment,{children:[u,(0,s.jsxs)(bf,{spinning:g,className:"memori-website_assistant-layout",children:[v,(0,s.jsx)("div",{className:"memori-website_assistant--close-button-wrapper",children:(0,s.jsx)(Sf,{className:"memori-website_assistant--close-button",primary:!0,shape:"circle",onClick:()=>E(!0),icon:(0,s.jsx)(xf,{}),title:S("close")||"Close"})}),m&&d&&h&&(0,s.jsx)(d,{...h}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--header",children:e&&t&&(0,s.jsx)(e,{...t,showSettings:!1,showReload:!1})}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--avatar",children:n&&r&&(0,c.createElement)(n,{...r,integrationConfig:r.integrationConfig?{...r.integrationConfig,avatarURL:(null===(y=r.integrationConfig)||void 0===y?void 0:y.avatarURL)?`${null===(b=r.integrationConfig)||void 0===b?void 0:b.avatarURL.split("#")[0]}#${w}`:void 0}:{},key:w})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--controls",children:p&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]})})};const{deleteSession:Dj,getStatistics:Bj,initSession:zj}=Q(),Fj=new Map([[0,"🆕"],[10,"🐹"],[20,"🐇"],[30,"🐰"],[40,"💡"],[50,"🏆"],[60,"🏅"],[70,"🥉"],[80,"🥈"],[90,"🥇"],[100,"🔥"],[110,"🎓"],[120,"🤖"],[130,"👾"],[150,"🌍"],[180,"💜"],[200,"💙"],[250,"🧡"],[300,"💚"],[350,"💛"],[400,"💖"],[450,"💝"],[500,"🖤"],[550,"❤️"],[600,"🧠"]]),Uj=e=>{const t=Array.from(Fj.keys()).filter((t=>t<=e));if(t.length>0){const e=t[t.length-1];return Fj.get(e)}return""},jj=e=>{if("🆕"===e)return{points:10,badge:"🐹"};let t,n,r=!1;for(const[i,o]of Fj){if(r){t=i,n=o;break}o===e&&(r=!0)}return n&&t?{points:t,badge:n}:void 0},Hj=e=>{let t=0;for(const[n,r]of Fj)if(r===e){t=n;break}return t},Gj=e=>{const t=Math.round(e),n=Uj(t);return{points:t,badge:n,pointsForCurrentBadge:Hj(n),nextBadge:jj(n)}},Vj=(e,t=!0,n=!1,r,i=!1,o=!1)=>{const s=new CustomEvent("MemoriTextEntered",{detail:{text:e,waitForPrevious:t,hidden:n,typingText:r,useLoaderTextAsMsg:i,hasBatchQueued:o}});document.dispatchEvent(s);window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak"))}),300)};let Wj,qj,Kj,Jj,Qj,Yj;window.getMemoriState=e=>{var t,n,r,i,o;let s=e?document.querySelector(`.memori-widget[data-memori-integration="${e}"]`)||(null===(n=null===(t=document.querySelector("memori-client"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector(".memori-widget[data-memori-integration]")):document.querySelector(".memori-widget")||(null===(i=null===(r=document.querySelector("memori-client"))||void 0===r?void 0:r.shadowRoot)||void 0===i?void 0:i.querySelector(".memori-widget"));if(!s)return null;let a=null===(o=s.dataset)||void 0===o?void 0:o.memoriEngineState;return a?JSON.parse(a):null},window.typeMessage=Vj,window.typeMessageHidden=(e,t=!0,n,r=!1,i=!1)=>Vj(e,t,!0,n,r,i),window.typeBatchMessages=e=>{function t(){var e,t,n,r;null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e||e.setAttribute("disabled","");const i="opacity: 0.5; touch-action: none; pointer-events: none;";null===(t=document.querySelector("textarea.memori-chat-textarea--input"))||void 0===t||t.setAttribute("style",i),null===(n=document.querySelector("button.memori-chat-inputs--send"))||void 0===n||n.setAttribute("style",i),null===(r=document.querySelector("button.memori-chat-inputs--mic"))||void 0===r||r.setAttribute("style",i)}function n(){var e,t,n,r;null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e||e.removeAttribute("disabled"),null===(t=document.querySelector("textarea.memori-chat-textarea--input"))||void 0===t||t.removeAttribute("style"),null===(n=document.querySelector("button.memori-chat-inputs--send"))||void 0===n||n.removeAttribute("style"),null===(r=document.querySelector("button.memori-chat-inputs--mic"))||void 0===r||r.removeAttribute("style")}function r(){var e;return!!(null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e?void 0:e.hasAttribute("disabled"))}const i=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent),o=function*(){yield*e}();t();const s=()=>{const e=o.next(),a=e.value;if(a){r()||t();let o=a.waitForPrevious;i&&(o=!1),Vj(a.message,o,a.hidden,a.typingText,a.useLoaderTextAsMsg,!e.done),i&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak")),n()}),3e3)}else r()&&n();if(e.done)return document.removeEventListener("MemoriEndSpeak",s),void(r()&&n())};document.addEventListener("MemoriEndSpeak",s),s()};let Zj,Xj=!1,$j=!1;var eH=({memori:e,memoriConfigs:n,memoriLang:r,multilingual:i,integration:o,layout:a="DEFAULT",customLayout:l,showInstruct:u=!1,showShare:d,preview:h=!1,embed:p=!1,showInputs:f=!0,showDates:m=!1,showContextPerLine:g=!1,showSettings:v=!0,showTypingText:y=!1,showClear:b=!1,showLogin:S=!1,showOnlyLastMessages:x,height:_="100vh",secret:w,baseUrl:C="https://aisuru.com",apiUrl:A="https://backend.memori.ai",initialContextVars:E,initialQuestion:T,ogImage:M,sessionID:I,tenant:R,personification:P,authToken:k,AZURE_COGNITIVE_SERVICES_TTS_KEY:O,defaultSpeakerActive:N=!0,onStateChange:L,additionalInfo:D,additionalSettings:B,customMediaRenderer:z,userAvatar:F})=>{var U,j,H,G,V,W,q,K,J,Y,Z,X,$,ee,te,ne,re,ie,oe,se,ae,le,ce,ue;const{t:de,i18n:he}=Se(),[pe,fe]=(0,c.useState)(!1);(0,c.useEffect)((()=>{fe(!0)}),[]);const me=Q(A),{initSession:ge,postTextEnteredEvent:ve,postPlaceChangedEvent:ye,postDateChangedEvent:be,postTimeoutEvent:xe,postTagChangedEvent:_e,getSession:we,getContentQualityIndexes:Ce,getExpertReferences:Ae}=me,[Ee,Te]=(0,c.useState)(!1),[Me,Ie]=(0,c.useState)(null!==(U=null==D?void 0:D.loginToken)&&void 0!==U?U:k),[Re,Pe]=(0,c.useState)({avatarURL:"string"==typeof F?F:void 0});(0,c.useEffect)((()=>{Me&&!(null==Re?void 0:Re.userID)&&S&&me.backend.getCurrentUser(Me).then((({user:e,resultCode:t})=>{e&&0===t?(Pe(e),xj("loginToken",Me)):_j("loginToken")}))}),[Me,null==Re?void 0:Re.userID]);const[ke,Oe]=(0,c.useState)(!1),[Ne,Le]=(0,c.useState)(!1),[De,Be]=(0,c.useState)(!1),ze=(null===(G=null===(H=null===(j=e.culture)||void 0===j?void 0:j.split("-"))||void 0===H?void 0:H[0])||void 0===G?void 0:G.toUpperCase())||(null===(K=null===(q=null===(W=null===(V=null==n?void 0:n.find((t=>t.memoriConfigID===e.memoriConfigurationID)))||void 0===V?void 0:V.culture)||void 0===W?void 0:W.split("-"))||void 0===q?void 0:q[0])||void 0===K?void 0:K.toUpperCase()),Fe=(null==o?void 0:o.customData)?JSON.parse(o.customData):null,Ue=void 0!==i?i:!!(null==Fe?void 0:Fe.multilanguage),je=null==Fe?void 0:Fe.forcedTimeout,[He,Ge]=(0,c.useState)(null!==(X=null!==(Z=null!==(Y=null!==(J=null!=r?r:null==Fe?void 0:Fe.lang)&&void 0!==J?J:ze)&&void 0!==Y?Y:null==Fe?void 0:Fe.uiLang)&&void 0!==Z?Z:he.language)&&void 0!==X?X:"IT"),[Ve,We]=(0,c.useState)(!1),[qe,Ke]=(0,c.useState)(!1),[Je,Qe]=(0,c.useState)(),Ye=a||(null==Fe?void 0:Fe.layout)||"DEFAULT",[Ze,Xe]=(0,c.useState)(!1),[$e,et]=(0,c.useState)(!1),[tt,nt]=(0,c.useState)(!1),[rt,it]=(0,c.useState)(!1),[ot,st]=(0,c.useState)(!1),[at,lt]=(0,c.useState)(!1),[ct,ut]=(0,c.useState)(!N),[dt,ht]=(0,c.useState)(!1),[pt,ft]=(0,c.useState)(2),[mt,gt]=(0,c.useState)(!1),[vt,yt]=(0,c.useState)("center"),[bt,St]=(0,c.useState)(!1);(0,c.useEffect)((()=>{gt(!!Kj),$j=!!Kj}),[Kj]),(0,c.useEffect)((()=>{let e="bottom",t=Sj("microphoneMode","HOLD_TO_TALK");window.innerWidth<=768?(e="bottom",t="HOLD_TO_TALK"):e=window.matchMedia("(orientation: portrait)").matches||window.innerHeight>window.innerWidth?"center":"bottom",ut(Sj("muteSpeaker",!N)),Xj=Sj("muteSpeaker",!N),ht("CONTINUOUS"===t),ft(Sj("continuousSpeechTimeout",2)),yt(Sj("controlsPosition",e)),St(Sj("hideEmissions",!1)),(null==D?void 0:D.loginToken)||k||(Ie(Sj("loginToken",void 0)),Zj=Sj("loginToken",void 0))}),[]);const[xt,_t]=(0,c.useState)(w),[wt,Ct]=(0,c.useState)(),[At,Et]=(0,c.useState)(null),[Tt,Mt]=(0,c.useState)(),It=async(e,t)=>{var n;const r=null!=t?t:Vt;if(e&&r){const{currentState:t,...i}=await ye({sessionId:r,placeName:e.placeName,latitude:e.latitude,longitude:e.longitude,uncertaintyKm:null!==(n=e.uncertainty)&&void 0!==n?n:0});t&&0===i.resultCode&&Kt((e=>{var n;return{...e,...t,hints:(null===(n=t.hints)||void 0===n?void 0:n.length)?t.hints:null==e?void 0:e.hints}}))}};(0,c.useEffect)((()=>{const e=Sj("position",void 0);e&&Mt(e)}),[]);const[Rt,Pt]=(0,c.useState)(""),[kt,Ot]=(0,c.useState)(!1),[Nt,Lt]=(0,c.useState)([]),Dt=e=>{Lt((t=>{var n,r;return[...t,{...e,media:null!==(r=null===(n=e.media)||void 0===n?void 0:n.filter((e=>{var t;return!("text/javascript"===e.mimeType&&(null===(t=e.properties)||void 0===t?void 0:t.executable))})))&&void 0!==r?r:[]}]}))},Bt=async(n,r,i,o=!0,s,a=!1,l,c=!1,u=!1)=>{var d,h,p,f;const m=i||Vt||(null===(d=window.getMemoriState())||void 0===d?void 0:d.sessionID);if(!m||!(null==n?void 0:n.length))return;a||Dt({text:n,translatedText:s,fromUser:!0,media:null!=r?r:[],initial:Vt?!!i&&i!==Vt:!!i}),Ke(!0),Qe(l);let g=n,v=!1;if(o&&!Ee&&Ue&&He.toUpperCase()!==ze.toUpperCase()){g=(await aS(n,ze,He,C)).text}const{currentState:y,...b}=await ve({sessionId:m,text:g});if(0===b.resultCode&&y){const n=c&&l?l:null!==(h=y.emission)&&void 0!==h?h:null==qt?void 0:qt.emission;if("X4"===y.state&&e.giverTag){const{currentState:r,...i}=await _e(m,e.giverTag);0===i.resultCode?(Jt(r),n&&(Dt({text:n,emitter:r.emitter,media:r.media,fromUser:!1,questionAnswered:g,contextVars:r.contextVars,date:r.currentDate,placeName:r.currentPlaceName,placeLatitude:r.currentLatitude,placeLongitude:r.currentLongitude,placeUncertaintyKm:r.currentUncertaintyKm,tag:r.currentTag}),hn(n))):(console.error(b,i),t(Ku).error(de(zv(i.resultCode))),v=!0)}else if("X2d"===y.state&&e.giverTag){const{currentState:r,...i}=await ve({sessionId:m,text:Math.random().toString().substring(2,8)});if(0===i.resultCode){const{currentState:r,...i}=await _e(m,e.giverTag);0===i.resultCode?(Jt(r),n&&(Dt({text:n,emitter:r.emitter,media:r.media,fromUser:!1,questionAnswered:g,contextVars:r.contextVars,date:r.currentDate,placeName:r.currentPlaceName,placeLatitude:r.currentLatitude,placeLongitude:r.currentLongitude,placeUncertaintyKm:r.currentUncertaintyKm,tag:r.currentTag}),hn(n))):(console.error(b,i),t(Ku).error(de(zv(i.resultCode))),v=!0)}else console.error(b,i),t(Ku).error(de(zv(i.resultCode))),v=!0}else He.toLowerCase()!==ze.toLowerCase()&&n&&!Ee&&Ue?zt(y,He,g).then((e=>{e.emission&&hn(e.emission)})):(Jt({...y,emission:n}),n&&(Dt({text:n,emitter:y.emitter,media:y.media,fromUser:!1,questionAnswered:g,generatedByAI:!!y.completion,contextVars:y.contextVars,date:y.currentDate,placeName:y.currentPlaceName,placeLatitude:y.currentLatitude,placeLongitude:y.currentLongitude,placeUncertaintyKm:y.currentUncertaintyKm,tag:y.currentTag}),hn(n)))}else 404===b.resultCode&&(Lt((e=>[...e.slice(0,e.length-1)])),Yt(!1,xt||e.secretToken,wt,Ee&&e.giverTag?e.giverTag:void 0,Ee&&e.giverPIN?e.giverPIN:void 0,{PATHNAME:window.location.pathname,ROUTE:(null===(f=null===(p=window.location.pathname)||void 0===p?void 0:p.split("/"))||void 0===f?void 0:f.pop())||"",...E||{}},T).then((e=>{console.info("session timeout"),(null==e?void 0:e.sessionID)&&setTimeout((()=>{Bt(n,r,null==e?void 0:e.sessionID)}),500)})));u||(Qe(void 0),Ke(!1))},zt=async(e,t,n)=>{var r,i,o;const s=null!==(r=e.emission)&&void 0!==r?r:null==qt?void 0:qt.emission;let a={...e},l=null;if(s&&!Ee&&ze.toUpperCase()!==t.toUpperCase()&&Ue){const r=await aS(s,t,ze,C);if(e.hints&&e.hints.length>0){const n=await Promise.all((null!==(i=e.hints)&&void 0!==i?i:[]).map((async e=>{var n;const r=await aS(e,t,ze,C);return{text:null!==(n=null==r?void 0:r.text)&&void 0!==n?n:e,originalText:e}})));a={...e,emission:r.text,translatedHints:n}}else a={...e,emission:r.text,hints:null!==(o=e.hints)&&void 0!==o?o:"G1"===e.state?null==qt?void 0:qt.hints:[]};r.text.length>0&&(l={text:r.text,emitter:e.emitter,media:e.media,fromUser:!1,questionAnswered:n,generatedByAI:!!e.completion,contextVars:e.contextVars,date:e.currentDate,placeName:e.currentPlaceName,placeLatitude:e.currentLatitude,placeLongitude:e.currentLongitude,placeUncertaintyKm:e.currentUncertaintyKm,tag:e.currentTag})}else a={...e,emission:s},s&&(l={text:s,emitter:e.emitter,media:e.media,fromUser:!1,questionAnswered:n,contextVars:e.contextVars,date:e.currentDate,placeName:e.currentPlaceName,placeLatitude:e.currentLatitude,placeLongitude:e.currentLongitude,placeUncertaintyKm:e.currentUncertaintyKm,tag:e.currentTag});return Jt(a),l&&Dt(l),a},Ft=void 0!==e.ageRestriction?e.ageRestriction:e.nsfw?18:e.enableCompletions?14:0,[Ut,jt]=(0,c.useState)(),[Ht,Gt]=(0,c.useState)(!1),[Vt,Wt]=(0,c.useState)(I),[qt,Kt]=(0,c.useState)(),Jt=e=>{var t;Kt(e),L&&L(e);const n=null===(t=null==e?void 0:e.media)||void 0===t?void 0:t.filter((e=>{var t;return"text/javascript"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)}));null==n||n.forEach((e=>{try{setTimeout((()=>{var t;console.log("snippet",e),new Function(null!==(t=e.content)&&void 0!==t?t:"")(),setTimeout((()=>{var e,t,n;null===(e=document.querySelector(".memori-chat--content"))||void 0===e||e.scrollTo(0,null!==(n=null===(t=document.querySelector(".memori-chat--content"))||void 0===t?void 0:t.scrollHeight)&&void 0!==n?n:0)}),400)}),1e3)}catch(e){console.error(e)}}))},Qt=async n=>{var r,i,o,s,a;let l=Sj("birthDate",void 0);if(Ut||l||!Ft)if("PUBLIC"===e.privacyType||e.secretToken||xt||wt){We(!0);try{if(!e.giverTag&&(null===(r=e.receivedInvitations)||void 0===r?void 0:r.length)){let t=e.receivedInvitations.find((e=>"GIVER"===e.type&&"ACCEPTED"===e.state));t&&(e.giverTag=t.tag,e.giverPIN=t.pin)}let l;try{l=window.location.href}catch(e){console.error(e)}const c=await ge({...n,tag:null!==(i=n.tag)&&void 0!==i?i:null==P?void 0:P.tag,pin:null!==(o=n.pin)&&void 0!==o?o:null==P?void 0:P.pin,additionalInfo:{...D||{},loginToken:null!==(a=null!==(s=null!=Zj?Zj:Me)&&void 0!==s?s:null==D?void 0:D.loginToken)&&void 0!==a?a:k,language:ln(He),referral:l}});if((null==c?void 0:c.sessionID)&&(null==c?void 0:c.currentState)&&0===c.resultCode)return Wt(c.sessionID),Tt&&It(Tt,c.sessionID),We(!1),{dialogState:c.currentState,sessionID:c.sessionID};(null==c?void 0:c.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(c),t(Ku).error(de("underageTwinSession",{age:Ft})),Be(!0)):403===(null==c?void 0:c.resultCode)?(_t(void 0),Et("password")):(console.error(c),t(Ku).error(de(zv(null==c?void 0:c.resultCode))),Be(!0))}catch(e){console.error(e),new Error("Error fetching session")}}else Et("password");else Gt(!0)},Yt=async(n=!1,r,i,o,s,a,l,c)=>{var u,d,h,p,f;We(!0);try{let m,g=Sj("birthDate",void 0);if(!c&&!g&&Ft)return void Gt(!0);if(!("PUBLIC"===e.privacyType||r||e.secretToken||xt||i||wt))return void Et("password");try{m=window.location.href}catch(e){console.error(e)}const{sessionID:v,currentState:y,...b}=await ge({memoriID:null!==(u=e.engineMemoriID)&&void 0!==u?u:"",password:r||xt||e.secretToken,recoveryTokens:i||wt,tag:o,pin:s,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(h=null===(d=window.location.pathname)||void 0===d?void 0:d.split("/"))||void 0===h?void 0:h.pop())||"",...a||{}},initialQuestion:l,birthDate:c||g||void 0,additionalInfo:{...D||{},loginToken:null!==(f=null!==(p=null!=Zj?Zj:Me)&&void 0!==p?p:null==D?void 0:D.loginToken)&&void 0!==f?f:k,language:ln(He),referral:m}});if(v&&y&&0===b.resultCode)return Wt(v),n&&(Jt(y),y.emission&&(Nt.length<=1?Lt([{text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0,contextVars:y.contextVars,date:y.currentDate,placeName:y.currentPlaceName,placeLatitude:y.currentLatitude,placeLongitude:y.currentLongitude,placeUncertaintyKm:y.currentUncertaintyKm,tag:y.currentTag}]):Dt({text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0,contextVars:y.contextVars,date:y.currentDate,placeName:y.currentPlaceName,placeLatitude:y.currentLatitude,placeLongitude:y.currentLongitude,placeUncertaintyKm:y.currentUncertaintyKm,tag:y.currentTag}))),Tt&&It(Tt,v),e.needsDateTime&&Xt({sessionID:v,state:y}),We(!1),{dialogState:y,sessionID:v};(null==b?void 0:b.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(b),t(Ku).error(de("underageTwinSession",{age:Ft})),Be(!0)):403===(null==b?void 0:b.resultCode)?(_t(void 0),Et("password")):(console.error(b),t(Ku).error(de(zv(b.resultCode))),Be(!0))}catch(e){console.error(e)}return We(!1),null},Zt=async(t,n,r,i)=>{var o,s,a,l,c;if(!t||!n)return console.error("CHANGETAG/Session not found"),Promise.reject("Session not found");try{const{currentState:t,resultCode:u}=await _e(n,null!=r?r:jv);if(0===u){let d=0;if(r!==jv&&i&&("X1a"===t.state||"X1b"===t.state)){const{resultCode:e}=await ve({sessionId:n,text:null!=i?i:""});d=e}if(0===d){const{currentState:e,...t}=await we(n);if(0===t.resultCode&&e)return{currentState:e,sessionId:n,...t}}else if([400,401,403,404,500].includes(u)){console.warn("[APPCONTEXT/CHANGETAG]",u);let t,n=Sj("birthDate",void 0);try{t=window.location.href}catch(e){console.error(e)}Qt({memoriID:null!==(o=e.engineMemoriID)&&void 0!==o?o:"",password:w||xt||e.secretToken,tag:e.giverTag,pin:e.giverPIN,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(a=null===(s=window.location.pathname)||void 0===s?void 0:s.split("/"))||void 0===a?void 0:a.pop())||"",...E||{}},initialQuestion:T,birthDate:Ut||n||void 0,additionalInfo:{...D||{},loginToken:null!==(c=null!==(l=null!=Zj?Zj:Me)&&void 0!==l?l:null==D?void 0:D.loginToken)&&void 0!==c?c:k,language:ln(He),referral:t}})}else if(t)return{currentState:t,sessionId:n,resultCode:u}}}catch(e){let t=e;return console.error("[APPCONTEXT/CHANGETAG]",t),Promise.reject(t)}return null};(0,c.useEffect)((()=>()=>{qt&&(null==qt?void 0:qt.currentTag)===e.giverTag||(async()=>{Vt&&e.giverTag&&e.giverPIN&&(Lt([]),await Zt(e.engineMemoriID,Vt,e.giverTag,e.giverPIN))})()}),[]);const Xt=(0,c.useCallback)((async({sessionID:t,date:n,state:r})=>{var i;const o=null!=t?t:Vt,s=null!=r?r:qt;if(!o||!e.needsDateTime||(null===(i=null==s?void 0:s.hints)||void 0===i?void 0:i.length))return;const a=(n?_s.DateTime.fromISO(n):_s.DateTime.now()).toUTC().toFormat("yyyy/MM/dd HH:mm:ss ZZ").split(":").slice(0,-1).join(":"),{currentState:l,...c}=await be(o,a);0===c.resultCode&&l&&Kt((e=>{var t;return{...e,...l,hints:(null===(t=l.hints)||void 0===t?void 0:t.length)?l.hints:null==e?void 0:e.hints}}))}),[qt,e.needsDateTime,Vt]);(0,c.useEffect)((()=>{if(Vt&&e.needsDateTime){Xt({sessionID:Vt,state:qt});let e=setInterval((()=>{Xt({sessionID:Vt})}),6e4);return()=>{clearInterval(e)}}}),[e.needsDateTime,Vt]);const[$t,en]=(0,c.useState)(),tn=(0,c.useRef)(),nn=()=>{$t&&(clearTimeout($t),en(void 0)),(null==tn?void 0:tn.current)&&(clearTimeout(tn.current),tn.current=void 0)},rn=()=>{nn(),mt||Rt.length||qe||kt||sn()},on=async()=>{var e;if(!Ze||mt||Rt.length||qe||kt)rn();else if(Vt&&Ze&&(null==qt?void 0:qt.acceptsTimeout)){const{currentState:t,...n}=await xe(Vt);if(0===n.resultCode&&t){const n=t.emission;if(!Ee&&Ue&&He!==(null==he?void 0:he.language)&&n&&n.length>0)zt({...t,emission:n},He).then((e=>{e.emission&&hn(e.emission)}));else{if(!(n&&n.length>0))return void rn();Dt({text:n,emitter:t.emitter,media:t.media,fromUser:!1,generatedByAI:!!t.completion,contextVars:t.contextVars,date:t.currentDate,placeName:t.currentPlaceName,placeLatitude:t.currentLatitude,placeLongitude:t.currentLongitude,placeUncertaintyKm:t.currentUncertaintyKm,tag:t.currentTag}),hn(n),Jt({...t,hints:null!==(e=t.hints)&&void 0!==e?e:"G1"===t.state?null==qt?void 0:qt.hints:[]})}}}},sn=()=>{let e=null==qt?void 0:qt.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==qt?void 0:qt.emission){e+=qt.emission.length/26.5}}if(je&&(e=je,null==qt?void 0:qt.emission)){e+=qt.emission.length/26.5}let t=setTimeout(on,1e3*e);en(t),tn.current=t};(0,c.useEffect)((()=>{(Rt.length||mt||qe)&&nn(),Vt&&!Rt.length&&rn()}),[null==qt?void 0:qt.acceptsTimeout,null==qt?void 0:qt.timeout,null==qt?void 0:qt.state,mt,Vt,Nt,Rt,qe,Ze]),(0,c.useEffect)((()=>()=>{Xe(!1),Le(!1),nn(),tn.current=void 0}),[]);const an=(0,c.useCallback)((t=>{var n,r,i,o;let s="",a=(null!==(o=null!==(i=null!=t?t:null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])&&void 0!==i?i:he.language)&&void 0!==o?o:"IT").toUpperCase(),l=e.voiceType;if(e.enableBoardOfExperts&&(null==qt?void 0:qt.emitter)){null==Gn||Gn.find((e=>e.name===(null==qt?void 0:qt.emitter)))}switch(a){case"IT":s=""+("MALE"===l?"it-IT-DiegoNeural":"it-IT-ElsaNeural");break;case"DE":s=""+("MALE"===l?"de-DE-ConradNeural":"de-DE-KatjaNeural");break;case"EN":s=""+("MALE"===l?"en-GB-RyanNeural":"en-GB-SoniaNeural");break;case"ES":s=""+("MALE"===l?"es-ES-AlvaroNeural":"es-ES-ElviraNeural");break;case"FR":s=""+("MALE"===l?"fr-FR-HenriNeural":"fr-FR-DeniseNeural");break;case"PT":s=""+("MALE"===l?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural");break;case"UK":s=""+("MALE"===l?"uk-UA-OstapNeural":"uk-UA-PolinaNeural");break;case"RU":s=""+("MALE"===l?"ru-RU-DmitryNeural":"ru-RU-SvetlanaNeural");break;case"PL":s=""+("MALE"===l?"pl-PL-MarekNeural":"pl-PL-AgnieszkaNeural");break;case"FI":s=""+("MALE"===l?"fi-FI-HarriNeural":"fi-FI-SelmaNeural");break;default:s=""+("MALE"===l?"it-IT-DiegoNeural":"it-IT-IsabellaNeural")}return s}),[e.voiceType,e.enableBoardOfExperts,null==qt?void 0:qt.emitter,he.language,e.culture]),ln=t=>{var n,r;let i="";switch((t||(null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])||he.language||"IT").toUpperCase()){case"IT":default:i="it-IT";break;case"DE":i="de-DE";break;case"EN":i="en-GB";break;case"ES":i="es-ES";break;case"FR":i="fr-FR";break;case"PT":i="pt-PT";break;case"UK":i="uk-UK";break;case"RU":i="ru-RU";break;case"PL":i="pl-PL";break;case"FI":i="fi-FI"}return i},[cn,un]=(0,c.useState)();(0,c.useEffect)((()=>{(async()=>{try{const e=await fetch(`${C||"https://aisuru.com"}/api/lexiconmap`);return await e.json()}catch(e){console.error(e)}})().then((e=>{un(e)}))}),[]);const dn=()=>{const e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e)},hn=e=>{if(!O||h)return void dn();if(_n(),h)return;if(ct||Xj)return $j=!1,Ke(!1),dn(),void(dt&&bn());Jj&&Jj.pause();let t=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),n=/iPad|iPhone|iPod/.test(navigator.userAgent);if("interrupted"===Qj.state)return void Qj.resume().then((()=>hn(e)));if("closed"===Qj.state){Qj=new Jo;let e=Qj.createBuffer(1,1e4,22050),t=Qj.createBufferSource();t.buffer=e,t.connect(Qj.destination)}else if("suspended"===Qj.state){pn(),Qj=new Jo;let e=Qj.createBuffer(1,1e4,22050),t=Qj.createBufferSource();t.buffer=e,t.connect(Qj.destination)}if(!Kj){n||(Jj=new ys.SpeakerAudioDestination);let e=ys.AudioConfig.fromSpeakerOutput(Jj);Kj=new ys.SpeechSynthesizer(qj,e)}const r=Qj.createBufferSource();r.addEventListener("ended",(()=>{gt(!1),$j=!1})),Jj.onAudioEnd=()=>{gt(!1),$j=!1,r.disconnect(),dn(),Tn()},Kj.speakSsmlAsync(`<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" xml:lang="${ln(He)}"><voice name="${an(He)}"><s>${((e,t)=>{var n;if(!cn)return e;const r={...null!==(n=cn.common)&&void 0!==n?n:{},...(null==R?void 0:R.id)&&cn[R.id]?cn[R.id]:{}},i=Object.keys(r).map((e=>{var n;return{word:e,phoneme:null!==(n=r[e][t.toLowerCase()])&&void 0!==n?n:r[e].default,caseSensitive:r[e].caseSensitive}}));return i.reduce(((e,{word:t,phoneme:n,caseSensitive:r})=>e.replace(new RegExp(`\\b${t}\\b`,r?"g":"gi"),`<phoneme alphabet="ipa" ph="${n}">${t}</phoneme>`)),e)})((e=>{const t=document.createElement("textarea");return t.textContent=e,t.innerHTML})(em(e)),He.toLowerCase())}</s></voice></speak>`,(i=>{if(i){gt(!0),$j=!0;try{Qj.decodeAudioData(i.audioData,(function(e){r.buffer=e,r.connect(Qj.destination),(Nt.length<1||t&&n)&&r.start(0)})),Qj.onstatechange=()=>{"suspended"===Qj.state||"closed"===Qj.state?(r.disconnect(),gt(!1),$j=!1):"interrupted"===Qj.state&&Qj.resume()},Qj.resume(),Kj&&(Kj.close(),Kj=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),gt(!1),$j=!1,Kj&&(Kj.close(),Kj=null),dn()}}else Qj.resume(),gt(!1),$j=!1,dn()}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),gt(!1),$j=!1,dn()})),Ke(!1)},pn=()=>{gt(!1),$j=!1;try{Kj&&(Kj.close(),Kj=null),"closed"!==Qj.state&&Qj.close(),Jj&&(Jj.pause(),Jj.close())}catch(e){console.error("stopAudio error: ",e)}};(0,c.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==qt?void 0:qt.emission]);const[fn,mn]=(0,c.useState)(""),gn=()=>mn(""),[vn,yn]=(0,c.useState)(null),bn=()=>{let e=setTimeout((async()=>{wn();const e=$f(fn);e.length>0&&kt?(Bt(e),gn(),Pt("")):kt&&rn()}),1e3*pt);yn(e)},Sn=()=>{vn&&(clearTimeout(vn),yn(null))};(0,c.useEffect)((()=>{Sn(),dt&&bn(),rn()}),[fn]);const xn=()=>{if(O){wn(),mn(""),gn();try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){et(!0),qj||(qj=ys.SpeechConfig.fromSubscription(O,"eastus"),qj.speechRecognitionLanguage=ln(He),qj.speechSynthesisLanguage=ln(He),qj.speechSynthesisVoiceName=an(He));const t=ys.AudioConfig.fromDefaultMicrophoneInput();Wj=new ys.SpeechRecognizer(qj,t),Ot(!0),Wj.recognized=(e,t)=>{if(t.result.text)if(t.result.reason===ys.ResultReason.RecognizedSpeech){let e=t.result.text;if(mn(e||""),(null==e?void 0:e.length)>0){const t=$f(e);t.length>0&&Pt((e=>`${e} ${t}`))}}else t.result.reason===ys.ResultReason.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},Wj.canceled=(e,t)=>{t.reason===ys.CancellationReason.Error&&(console.debug(`"CANCELED: ErrorCode=${t.errorCode}`),console.debug(`"CANCELED: ErrorDetails=${t.errorDetails}`),console.debug("CANCELED: Did you set the speech resource key and region values?")),_n()},Wj.sessionStopped=(e,t)=>{_n()},gn(),Wj.startContinuousRecognitionAsync()})).catch(console.error)}catch(e){console.error(e)}}},_n=()=>{Wj&&(Wj.stopContinuousRecognitionAsync(),Wj.close(),Wj=null),Ot(!1)},wn=()=>{et(!1),_n(),Sn()},Cn=()=>{try{wn(),nn(),Le(!1),tn.current=void 0,pn()}catch(e){console.log("Error: resetUIEffects",e)}};(0,c.useEffect)((()=>()=>{Cn()}),[]),(0,c.useEffect)((()=>(document.addEventListener("MemoriResetUIEffects",Cn),()=>{document.removeEventListener("MemoriResetUIEffects",Cn)})),[]),(0,c.useEffect)((()=>{"Z0"===(null==qt?void 0:qt.state)&&wn()}),[null==qt?void 0:qt.state]);const[An,En]=(0,c.useState)(!1),Tn=(0,c.useCallback)((e=>{mt&&Kj&&(Kj.close(),Kj=null),!dt||!$e&&An||(En(!0),xn())}),[dt,$e]);(0,c.useEffect)((()=>{Nt.length>1&&!mt&&dt&&($e||!An)?xn():mt&&kt&&_n()}),[mt]),(0,c.useEffect)((()=>{kt&&(wn(),gn(),Pt(""),xn())}),[ze]);const[Mn,In]=(0,c.useState)("keypress");(0,c.useEffect)((()=>{const e=Sj("sendOnEnter","keypress");window.innerWidth<=768?In("click"):In(e)}),[]),(0,c.useEffect)((()=>{xj("sendOnEnter",Mn)}),[Mn]);const[Rn,Pn]=(0,c.useState)(),kn=null==Fe?void 0:Fe.globalBackground,On=kn?`url(${kn})`:null,Nn=o?{"--memori-chat-bubble-bg":"#fff",...Fe&&!u?{"--memori-text-color":null!==($=Fe.textColor)&&void 0!==$?$:"#000"}:{},...(null==Fe?void 0:Fe.buttonBgColor)?{"--memori-button-bg":Fe.buttonBgColor,"--memori-primary":Fe.buttonBgColor}:{},...(null==Fe?void 0:Fe.buttonTextColor)?{"--memori-button-text":Fe.buttonTextColor}:{},...(null==Fe?void 0:Fe.blurBackground)?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...(null==Fe?void 0:Fe.innerBgColor)?{"--memori-inner-bg":`rgba(${"dark"===Fe.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(ee=Fe.innerBgAlpha)&&void 0!==ee?ee:.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===Fe.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(te=null==Fe?void 0:Fe.innerBgAlpha)&&void 0!==te?te:.4})`}:{"--memori-inner-content-pad":"0px"}}:{},Ln=`\n ${h?"#preview,":"WEBSITE_ASSISTANT"===Ye?"":":root,"} .memori-widget, .memori-drawer, .memori-modal {\n ${Object.entries(Nn).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,Dn=void 0===(null==Fe?void 0:Fe.showAIicon)||(null==Fe?void 0:Fe.showAIicon),[Bn,zn]=(0,c.useState)(!1);(0,c.useEffect)((()=>{(window.innerWidth>=768&&"FULLPAGE"===Ye||"FULLPAGE"!==Ye)&&zn(!0)}),[]);const[Fn,Un]=(0,c.useState)();(0,c.useEffect)((()=>{e.engineMemoriID&&(async e=>{let t,n;try{const{contentQualityIndex:r,answerQualityIndex:i,unansweredQuestions:o,...s}=await Ce(e);0===s.resultCode&&(t=r,n=o)}catch(e){let t=e;console.error("[APPCONTEXT/QUERYGAMIFICATIONPOINTS]",t)}return{points:null!=t?t:0,unansweredQuestions:null!=n?n:0}})(e.engineMemoriID).then((e=>{Un(Gj(e.points))})).catch(console.error)}),[e.engineMemoriID]),(0,c.useEffect)((()=>{if(null==Fe?void 0:Fe.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",Fe.seoTitle),document.head.append(e)}if(null==Fe?void 0:Fe.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",Fe.seoDescription),document.head.append(e)}if(null==Fe?void 0:Fe.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",Fe.seoUrl),document.head.append(e)}let t=M||e.avatarURL;if((null==Fe?void 0:Fe.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}}),[Fe,e.avatarURL,M]);const jn=(0,c.useCallback)((e=>{const{text:t,waitForPrevious:n,hidden:r,typingText:i,useLoaderTextAsMsg:o,hasBatchQueued:s}=e.detail;t&&(n&&!Xj&&($j||qe)?setTimeout((()=>{jn(e)}),1e3):(_n(),pn(),Bt(t,void 0,void 0,void 0,void 0,r,i,o,s)))}),[Vt,mt,qe,He]);(0,c.useEffect)((()=>(document.addEventListener("MemoriTextEntered",jn),()=>{document.removeEventListener("MemoriTextEntered",jn)})),[Vt,He]);const Hn=(0,c.useCallback)((async t=>{var n,r,i,o,s,a,l,c,u,d,h,p,f,m,g,v,y,b;const S=(null==t?void 0:t.sessionID)||Vt,x=(null==t?void 0:t.dialogState)||qt;Le(!0);let _=document.getElementById("memori-audio"),C=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome");_&&C&&(_.muted=!1,_.play().catch((e=>{console.error("error playing intro audio",e)})));let A=Sj("birthDate",void 0),M=Ut||A||void 0;if(S||!Ft||M){if(!S&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!xt&&!wt||!S&&De)return Et("password"),void Le(!1);if(!S){Le(!1),Be(!1);const t=await Qt({memoriID:e.engineMemoriID,password:w||xt||e.secretToken,tag:null==P?void 0:P.tag,pin:null==P?void 0:P.pin,initialContextVars:{PATHNAME:null===(n=window.location.pathname)||void 0===n?void 0:n.toUpperCase(),ROUTE:(null===(o=null===(i=null===(r=window.location.pathname)||void 0===r?void 0:r.split("/"))||void 0===i?void 0:i.pop())||void 0===o?void 0:o.toUpperCase())||"",...E||{}},initialQuestion:T,birthDate:M,additionalInfo:{...D||{},loginToken:null!==(a=null!==(s=null!=Zj?Zj:Me)&&void 0!==s?s:null==D?void 0:D.loginToken)&&void 0!==a?a:k,language:ln(He)}});return void((null==t?void 0:t.dialogState)?(Lt([]),zt(t.dialogState,He).then((e=>{e.emission&&hn(e.emission)})).finally((()=>{Xe(!0)}))):await Hn(t||void 0))}if(I){const{currentState:t,...n}=await we(S);if(0!==n.resultCode||!t)return console.debug("session expired, opening new session"),Be(!0),Wt(void 0),Le(!1),void await Hn();if(Lt([]),Tt&&It(Tt,S),e.needsDateTime&&Xt({sessionID:S,state:t}),Ee&&e.giverTag&&(null==qt?void 0:qt.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await Zt(e.engineMemoriID,S,"-");const t=await Zt(e.engineMemoriID,S,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");zt(t.currentState,He).then((e=>{e.emission&&hn(e.emission)})).finally((()=>{Xe(!0)}))}catch(t){console.error("session #2",t),Yt(!0,null==e?void 0:e.secretToken,void 0,null==e?void 0:e.giverTag,null==e?void 0:e.giverPIN,{PATHNAME:null===(l=window.location.pathname)||void 0===l?void 0:l.toUpperCase(),ROUTE:(null===(d=null===(u=null===(c=window.location.pathname)||void 0===c?void 0:c.split("/"))||void 0===u?void 0:u.pop())||void 0===d?void 0:d.toUpperCase())||"",...E||{}},T,M).then((()=>{Xe(!0)}))}else if(!Ee&&P&&(null==qt?void 0:qt.currentTag)!==P.tag)try{console.debug("change tag #3"),await Zt(e.engineMemoriID,S,"-");const t=await Zt(e.engineMemoriID,S,P.tag,P.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");zt(t.currentState,He).then((e=>{e.emission&&hn(e.emission)})).finally((()=>{Xe(!0)}))}catch(t){console.error("session #5",t),Yt(!0,null==e?void 0:e.secretToken,void 0,P.tag,P.pin,{PATHNAME:null===(h=window.location.pathname)||void 0===h?void 0:h.toUpperCase(),ROUTE:(null===(m=null===(f=null===(p=window.location.pathname)||void 0===p?void 0:p.split("/"))||void 0===f?void 0:f.pop())||void 0===m?void 0:m.toUpperCase())||"",...E||{}},T,M).then((()=>{Xe(!0)}))}else if(Ee||P||(null==qt?void 0:qt.currentTag)===jv)zt(t,He).then((e=>{e.emission&&hn(e.emission)})).finally((()=>{Xe(!0)}));else try{console.debug("change tag #6"),await Zt(e.engineMemoriID,S,"-");const t=await Zt(e.engineMemoriID,S,jv);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");zt(t.currentState,He).then((e=>{e.emission&&hn(e.emission)})).finally((()=>{Xe(!0)}))}catch(t){console.error("session #8",t),Yt(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,{PATHNAME:null===(g=window.location.pathname)||void 0===g?void 0:g.toUpperCase(),ROUTE:(null===(b=null===(y=null===(v=window.location.pathname)||void 0===v?void 0:v.split("/"))||void 0===y?void 0:y.pop())||void 0===b?void 0:b.toUpperCase())||"",...E||{}},T,M).then((()=>{Xe(!0)}))}Tt&&It(Tt,S),e.needsDateTime&&Xt({sessionID:S,state:t})}else Lt([]),zt(x,He).then((e=>{e.emission&&hn(e.emission)})).finally((()=>{Xe(!0)}))}else Gt(!0),Le(!1)}),[xt,e,wt,Ut,Vt,He,Tt]);(0,c.useEffect)((()=>{const t=document.querySelector(`memori-client[memoriname="${e.name}"]`)||document.querySelector(`memori-client[memoriid="${e.memoriID}"]`)||document.querySelector("memori-client");if(!t)return;const n=new MutationObserver(((e,t)=>{var n,r,i;for(const t of e)"attributes"===t.type&&"authtoken"===(null===(n=t.attributeName)||void 0===n?void 0:n.toLowerCase())&&("MEMORI-CLIENT"===t.target.nodeName?(Ie(t.target.getAttribute("authtoken")||void 0),Zj=t.target.getAttribute("authtoken")||void 0):(Ie((null===(i=null===(r=t.target)||void 0===r?void 0:r.parentElement)||void 0===i?void 0:i.getAttribute("authtoken"))||void 0),Zj=t.target.getAttribute("authtoken")||void 0))}));return n.observe(t,{attributes:!0,childList:!1,subtree:!1}),()=>{n.disconnect()}}),[]);const[Gn,Vn]=(0,c.useState)(),Wn=(0,c.useCallback)((async()=>{if(Vt&&(null==e?void 0:e.enableBoardOfExperts))try{const{experts:e,count:t,...n}=await Ae(Vt);0===n.resultCode?Vn(e):console.warn("Error fetching experts",n)}catch(e){console.warn(e)}}),[Vt,null==e?void 0:e.enableBoardOfExperts]);(0,c.useEffect)((()=>{Wn()}),[Vt,Wn]);const qn=void 0===x?"TOTEM"!==a&&"WEBSITE_ASSISTANT"!==a:!x,Kn={memori:e,tenant:R,history:Nt,showShare:null===(ne=null!=d?d:null==Fe?void 0:Fe.showShare)||void 0===ne||ne,position:Tt,setShowPositionDrawer:nt,setShowSettingsDrawer:it,setShowKnownFactsDrawer:st,setShowExpertsDrawer:lt,showSpeaker:!!O,speakerMuted:ct||Xj,setSpeakerMuted:e=>{if(Xj=!!e,ut(e),xj("muteSpeaker",!!e),e)pn();else{Qj=new Jo;let e=Qj.createBuffer(1,1e4,22050),t=Qj.createBufferSource();t.buffer=e,t.connect(Qj.destination)}},showSettings:v,hasUserActivatedSpeak:Ze,showReload:"TOTEM"===Ye,showClear:b,clearHistory:()=>Lt((e=>e.slice(-1))),showLogin:S,setShowLoginDrawer:Oe,loginToken:Me,user:Re,sessionID:Vt},Jn={memori:e,integration:o,integrationConfig:Fe,tenant:R,instruct:Ee,avatar3dVisible:Bn,setAvatar3dVisible:zn,hasUserActivatedSpeak:Ze,isPlayingAudio:mt&&!ct,loading:!!qe,baseUrl:C,apiUrl:A},Qn={memori:e,tenant:R,gamificationLevel:Fn,language:ze,userLang:He,setUserLang:Ge,baseUrl:C,apiUrl:A,position:Tt,openPositionDrawer:()=>nt(!0),integrationConfig:Fe,instruct:Ee,sessionId:Vt,clickedStart:Ne,onClickStart:Hn,initializeTTS:()=>{if(!O)return;qj=ys.SpeechConfig.fromSubscription(O,"eastus"),qj.speechSynthesisLanguage=ln(He),qj.speechSynthesisVoiceName=an(He),qj.speechRecognitionLanguage=ln(He),Yf()&&(qj.speechSynthesisOutputFormat=ys.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3),Qj=new Jo;let e=Qj.createBuffer(1,1e4,22050),t=Qj.createBufferSource();t.buffer=e,t.connect(Qj.destination),Jj=new ys.SpeakerAudioDestination;let n=ys.AudioConfig.fromSpeakerOutput(Jj);Kj=new ys.SpeechSynthesizer(qj,n)},isUserLoggedIn:!!Me&&!!(null==Re?void 0:Re.userID),showLogin:S,setShowLoginDrawer:Oe,user:Re},Yn={memori:e,sessionID:Vt||"",tenant:R,translateTo:Ue&&He.toUpperCase()!==(null===(ae=null!==(se=null!==(oe=null===(ie=null===(re=e.culture)||void 0===re?void 0:re.split("-"))||void 0===ie?void 0:ie[0])&&void 0!==oe?oe:he.language)&&void 0!==se?se:"IT")||void 0===ae?void 0:ae.toUpperCase())?He:void 0,baseUrl:C,apiUrl:A,layout:a,memoriTyping:qe,typingText:Je,showTypingText:y,history:qn?Nt:Nt.slice(-2),authToken:null!==(ce=null!==(le=null!=Me?Me:Zj)&&void 0!==le?le:null==D?void 0:D.loginToken)&&void 0!==ce?ce:k,dialogState:qt,setDialogState:Jt,pushMessage:Dt,simulateUserPrompt:(e,t)=>{_n(),pn(),Bt(e,void 0,void 0,!1,t)},showDates:m,showContextPerLine:g,showAIicon:Dn,client:me,selectReceiverTag:async n=>{var r;if(Vt)try{const{currentState:i,...o}=await _e(Vt,n);if(0===o.resultCode)if(Dt({text:n,fromUser:!0}),"X4"===i.state&&e.giverTag){const{currentState:n,...r}=await me.postTagChangedEvent(Vt,e.giverTag);0===r.resultCode?(Jt(n),n.emission&&Dt({text:n.emission,emitter:n.emitter,media:n.media,fromUser:!1,contextVars:n.contextVars,date:n.currentDate,placeName:n.currentPlaceName,placeLatitude:n.currentLatitude,placeLongitude:n.currentLongitude,placeUncertaintyKm:n.currentUncertaintyKm,tag:n.currentTag})):(console.error(r),t(Ku).error(de(zv(r.resultCode))))}else Jt(i),i.emission&&Dt({text:i.emission,emitter:i.emitter,media:i.media,fromUser:!1,contextVars:i.contextVars,date:i.currentDate,placeName:i.currentPlaceName,placeLatitude:i.currentLatitude,placeLongitude:i.currentLongitude,placeUncertaintyKm:i.currentUncertaintyKm,tag:i.currentTag});else console.error(o,n,null===(r=null==qt?void 0:qt.knownTags)||void 0===r?void 0:r[n]),t(Ku).error(de(zv(o.resultCode)))}catch(e){let n=e;console.error(n),t(Ku).error(n.message)}},preview:h,sendOnEnter:Mn,setSendOnEnter:In,microphoneMode:dt?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen:Rn,setAttachmentsMenuOpen:Pn,instruct:Ee,showInputs:f,showMicrophone:!!O,userMessage:Rt,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return Pt(""),void rn();Pt(e),nn()},sendMessage:e=>{pn(),_n(),Bt(e),Pt(""),gn()},stopListening:wn,startListening:xn,stopAudio:pn,resetTranscript:gn,listening:kt,isPlayingAudio:mt,customMediaRenderer:z,user:Re,userAvatar:F,experts:Gn},Zn=o&&On?(0,s.jsx)("div",{className:"memori--global-background",children:(0,s.jsx)("div",{className:"memori--global-background-image",style:{backgroundImage:On}})}):(0,s.jsx)("div",{className:"memori--global-background no-background-image"}),Xn=o?(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:Ln}}):null,$n={canInstruct:!!e.giverTag,instruct:!!Ee,onChangeMode:e=>{Te("instruct"===e),Xe(!1),Le(!1)}},er=(0,s.jsx)(JU,{tenant:R,userLang:He,integrationID:null==o?void 0:o.integrationID,memoriHash:`${e.ownerTenantName}-${e.ownerUserName}-${e.name}`}),tr=l||("TOTEM"===Ye?Oj:"CHAT"===Ye?Nj:"FULLPAGE"===Ye?kj:"WEBSITE_ASSISTANT"===Ye?Lj:kj);return(0,s.jsxs)("div",{className:t(xs)("memori","memori-widget",`memori-layout-${a.toLowerCase()}`,`memori-controls-${vt.toLowerCase()}`,`memori--avatar-${(null==Fe?void 0:Fe.avatar)||"default"}`,{"memori--preview":h,"memori--embed":p,"memori--with-integration":o,"memori--with-speechkey":!!O,"memori--active":Ze,"memori--hide-emissions":bt,"memori--has-active-session":!!Vt}),"data-memori-name":null==e?void 0:e.name,"data-memori-id":null==e?void 0:e.engineMemoriID,"data-memori-secondary-id":null==e?void 0:e.memoriID,"data-memori-session-id":Vt,"data-memori-integration":null==o?void 0:o.integrationID,"data-memori-engine-state":JSON.stringify({...qt,sessionID:Vt}),style:{height:_},children:[(0,s.jsx)(tr,{Header:KU,headerProps:Kn,Avatar:HF,avatarProps:Jn,Chat:WS,chatProps:Yn,StartPanel:$S,startPanelProps:Qn,integrationStyle:Xn,integrationBackground:Zn,ChangeMode:GF,changeModeProps:$n,poweredBy:er,sessionId:Vt,hasUserActivatedSpeak:Ze,showInstruct:u,loading:Ve}),(0,s.jsx)("audio",{id:"memori-audio",style:{display:"none"},src:"https://aisuru.com/intro.mp3"}),pe&&(0,s.jsx)(av,{withModal:!0,pwdOrTokens:At,openModal:!!At,setPwdOrTokens:Et,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{var n,r,i,o;t.password&&_t(t.password),t.password&&(Yj=t.password),t.tokens&&Ct(t.tokens),Yt(!Vt,t.password,t.tokens,Ee?e.giverTag:null==P?void 0:P.tag,Ee?e.giverPIN:null==P?void 0:P.pin,{PATHNAME:null===(n=window.location.pathname)||void 0===n?void 0:n.toUpperCase(),ROUTE:(null===(o=null===(i=null===(r=window.location.pathname)||void 0===r?void 0:r.split("/"))||void 0===i?void 0:i.pop())||void 0===o?void 0:o.toUpperCase())||"",...E||{}},T,Ut).then((e=>{Et(null),Hn(e||void 0)})).catch((()=>{Et(null),Be(!0)}))},minimumNumberOfRecoveryTokens:null!==(ue=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==ue?ue:1}),pe&&(0,s.jsx)(gj,{visible:Ht,minAge:Ft,onClose:t=>{var n,r,i,o;t?(jt(t),xj("birthDate",t),Yt(!Vt,Yj||xt||(null==e?void 0:e.secretToken),wt,Ee?e.giverTag:null==P?void 0:P.tag,Ee?e.giverPIN:null==P?void 0:P.pin,{PATHNAME:null===(n=window.location.pathname)||void 0===n?void 0:n.toUpperCase(),ROUTE:(null===(o=null===(i=null===(r=window.location.pathname)||void 0===r?void 0:r.split("/"))||void 0===i?void 0:i.pop())||void 0===o?void 0:o.toUpperCase())||"",...E||{}},T,t).then((e=>{Gt(!1),Et(null),Hn(e||void 0)})).catch((()=>{Gt(!1),Be(!0)}))):(Gt(!1),Le(!1))}}),rt&&(0,s.jsx)(Cj,{layout:Ye,open:!!rt,onClose:()=>it(!1),microphoneMode:dt?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout:pt,setMicrophoneMode:e=>ht("CONTINUOUS"===e),setContinuousSpeechTimeout:ft,controlsPosition:vt,setControlsPosition:yt,hideEmissions:bt,setHideEmissions:St,additionalSettings:B}),tt&&(0,s.jsx)(zm,{memori:e,open:!!tt,venue:Tt,setVenue:e=>{Mt(e),It(e),e?xj("position",JSON.stringify(e)):_j("position")},onClose:e=>{e&&It(e),nt(!1)}}),ot&&Vt&&(0,s.jsx)(Mj,{apiURL:A,memori:e,sessionID:Vt,visible:ot,closeDrawer:()=>st(!1)}),at&&!!Gn&&(0,s.jsx)(Ij,{apiUrl:A,baseUrl:C,tenant:R,experts:Gn,open:at,onClose:()=>lt(!1)}),ke&&(null==R?void 0:R.id)&&(0,s.jsx)(Pj,{tenant:R,apiUrl:A,open:!!ke,user:Re,loginToken:Me,onClose:()=>Oe(!1),onLogin:(e,t)=>{Pe(e),Ie(t),Zj=t,Oe(!1),xj("loginToken",t)},onLogout:()=>{Me&&me.backend.userLogout(Me).then((()=>{Oe(!1),Pe(void 0),Ie(void 0),Zj=void 0,_j("loginToken")}))}})]})};const tH={id:"aisuru.com",theme:"aisuru",config:{name:"Memori",showNewUser:!1,requirePosition:!1}},nH=async(e,t)=>{const n=t?new URL(`${t.startsWith("http")?"":t.includes("localhost")?"http://":"https://"}${t}`).origin:"https://aisuru.com";try{const t=await fetch(`${n}/api/tenant/${e}`),{tenant:r}=await t.json();return r||{...tH,tenantID:e}}catch(t){return{...tH,tenantID:e}}};function rH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iH(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,TF(r.key),r)}}function oH(e,t,n){return t&&iH(e.prototype,t),n&&iH(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sH(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aH(e,t){return aH=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},aH(e,t)}function lH(e,t){if("function"!=typeof t&&null!==t)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&&aH(e,t)}function cH(e,t){if(t&&("object"===AF(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return sH(e)}function uH(e){return uH=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},uH(e)}function dH(e){if(Array.isArray(e))return e}function hH(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function pH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fH(e,t){if(e){if("string"==typeof e)return pH(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pH(e,t):void 0}}function mH(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function gH(e){return dH(e)||hH(e)||fH(e)||mH()}function vH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vH(Object(n),!0).forEach((function(t){MF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var bH={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},SH=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};rH(this,e),this.init(t,n)}return oH(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||bH,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,yH(yH({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}(),xH=new SH,_H=function(){function e(){rH(this,e),this.observers={}}return oH(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function wH(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function CH(e){return null==e?"":""+e}function AH(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function EH(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function TH(e,t,n){var r=EH(e,t,Object);r.obj[r.k]=n}function MH(e,t){var n=EH(e,t),r=n.obj,i=n.k;if(r)return r[i]}function IH(e,t,n){var r=MH(e,n);return void 0!==r?r:MH(t,n)}function RH(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):RH(e[r],t[r],n):e[r]=t[r]);return e}function PH(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var kH={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function OH(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return kH[e]})):e}var NH="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,LH=[" ",",","?","!",";"];function DH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function BH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DH(Object(n),!0).forEach((function(t){MF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zH(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=uH(e);if(t){var i=uH(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return cH(this,n)}}function FH(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;o<r.length;++o){if(!i)return;if("string"==typeof i[r[o]]&&o+1<r.length)return;if(void 0===i[r[o]]){for(var s=2,a=r.slice(o,o+s).join(n),l=i[a];void 0===l&&r.length>o+s;)s++,l=i[a=r.slice(o,o+s).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(a)){if("string"==typeof l)return l;if(a&&"string"==typeof l[a])return l[a]}var c=r.slice(o+s).join(n);return c?FH(l,c,n):void 0}i=i[r[o]]}return i}}var UH=function(e){lH(n,e);var t=zH(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return rH(this,n),r=t.call(this),NH&&_H.call(sH(r)),r.data=e||{},r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return oH(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[e,t];n&&"string"!=typeof n&&(s=s.concat(n)),n&&"string"==typeof n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."));var a=MH(this.data,s);return a||!o||"string"!=typeof n?a:FH(this.data&&this.data[e]&&this.data[e][t],n,i)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var s=[e,t];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(s=e.split("."))[1]),this.addNamespaces(t),TH(this.data,s,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var a=MH(this.data,s)||{};r?RH(a,n,i):a=BH(BH({},a),n),TH(this.data,s,a),o.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?BH(BH({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(_H),jH={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}};function HH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function GH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?HH(Object(n),!0).forEach((function(t){MF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function VH(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=uH(e);if(t){var i=uH(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return cH(this,n)}}var WH={},qH=function(e){lH(n,e);var t=VH(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rH(this,n),r=t.call(this),NH&&_H.call(sH(r)),AH(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,sH(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=xH.create("translator"),r}return oH(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=n&&e.indexOf(n)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=LH.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var i=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),o=!i.test(e);if(!o){var s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o}(e,n,r));if(o&&!s){var a=e.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:e,namespaces:i};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(i=l.shift()),e=l.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,r){var i=this;if("object"!==AF(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],t),l=a.key,c=a.namespaces,u=c[c.length-1],d=t.lng||this.language,h=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(h){var p=t.nsSeparator||this.options.nsSeparator;return o?(f.res="".concat(u).concat(p).concat(l),f):"".concat(u).concat(p).concat(l)}return o?(f.res=l,f):l}var f=this.resolve(e,t),m=f&&f.res,g=f&&f.usedKey||l,v=f&&f.exactUsedKey||l,y=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],S=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,_="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(x&&m&&_&&b.indexOf(y)<0&&("string"!=typeof S||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var w=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,GH(GH({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return o?(f.res=w,f):w}if(s){var C="[object Array]"===y,A=C?[]:{},E=C?v:g;for(var T in m)if(Object.prototype.hasOwnProperty.call(m,T)){var M="".concat(E).concat(s).concat(T);A[T]=this.translate(M,GH(GH({},t),{joinArrays:!1,ns:c})),A[T]===M&&(A[T]=m[T])}m=A}}else if(x&&"string"==typeof S&&"[object Array]"===y)(m=m.join(S))&&(m=this.extendTranslation(m,e,t,r));else{var I=!1,R=!1,P=void 0!==t.count&&"string"!=typeof t.count,k=n.hasDefaultValue(t),O=P?this.pluralResolver.getSuffix(d,t.count,t):"",N=t["defaultValue".concat(O)]||t.defaultValue;!this.isValidLookup(m)&&k&&(I=!0,m=N),this.isValidLookup(m)||(R=!0,m=l);var L=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,D=L&&R?void 0:m,B=k&&N!==m&&this.options.updateMissing;if(R||I||B){if(this.logger.log(B?"updateKey":"missingKey",d,u,l,B?N:m),s){var z=this.resolve(l,GH(GH({},t),{},{keySeparator:!1}));z&&z.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var F=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&U&&U[0])for(var j=0;j<U.length;j++)F.push(U[j]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var H=function(e,n,r){var o=k&&r!==m?r:D;i.options.missingKeyHandler?i.options.missingKeyHandler(e,u,n,o,B,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,u,n,o,B,t),i.emit("missingKey",e,u,n,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&P?F.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],l+n,t["defaultValue".concat(n)]||N)}))})):H(F,l,N))}m=this.extendTranslation(m,e,t,f,r),R&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(u,":").concat(l)),(R||I)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(l):l,I?m:void 0):this.options.parseMissingKeyHandler(m))}return o?(f.res=m,f):m}},{key:"extendTranslation",value:function(e,t,n,r,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,GH(GH({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(GH(GH({},n),{interpolation:GH(GH({},this.options.interpolation),n.interpolation)}));var s,a="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){var l=e.match(this.interpolator.nestingRegexp);s=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=GH(GH({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),a){var u=e.match(this.interpolator.nestingRegexp);s<(u&&u.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return i&&i[0]===r[0]&&!n.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):o.translate.apply(o,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,h="string"==typeof d?[d]:d;return null!=e&&h&&h.length&&!1!==n.applyPostProcessor&&(e=jH.handle(h,e,t,this.options&&this.options.postProcessPassResolved?GH({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,o,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var l=s.extractFromKey(e,a),c=l.key;n=c;var u=l.namespaces;s.options.fallbackNS&&(u=u.concat(s.options.fallbackNS));var d=void 0!==a.count&&"string"!=typeof a.count,h=d&&!a.ordinal&&0===a.count&&s.pluralResolver.shouldUseIntlApi(),p=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,f=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);u.forEach((function(e){s.isValidLookup(t)||(o=e,!WH["".concat(f[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(WH["".concat(f[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(n,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((function(n){if(!s.isValidLookup(t)){i=n;var o,l=[c];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(l,c,n,e,a);else{var u;d&&(u=s.pluralResolver.getSuffix(n,a.count,a));var f="".concat(s.options.pluralSeparator,"zero");if(d&&(l.push(c+u),h&&l.push(c+f)),p){var m="".concat(c).concat(s.options.contextSeparator).concat(a.context);l.push(m),d&&(l.push(m+u),h&&l.push(m+f))}}for(;o=l.pop();)s.isValidLookup(t)||(r=o,t=s.getResource(n,e,o,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(_H);function KH(e){return e.charAt(0).toUpperCase()+e.slice(1)}var JH=function(){function e(t){rH(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=xH.create("languageUtils")}return oH(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=KH(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=KH(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=KH(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),QH=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],YH={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},ZH=["v1","v2","v3"],XH={zero:0,one:1,two:2,few:3,many:4,other:5};function $H(){var e={};return QH.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:YH[t.fc]}}))})),e}var eG=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};rH(this,e),this.languageUtils=t,this.options=n,this.logger=xH.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=$H()}return oH(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return XH[e]-XH[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var o=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!ZH.includes(this.options.compatibilityJSON)}}]),e}();function tG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tG(Object(n),!0).forEach((function(t){MF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tG(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var rG=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};rH(this,e),this.logger=xH.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return oH(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:OH,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?PH(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?PH(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?PH(t.nestingPrefix):t.nestingPrefixEscaped||PH("$t("),this.nestingSuffix=t.nestingSuffix?PH(t.nestingSuffix):t.nestingSuffixEscaped||PH(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,s,a=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(a.formatSeparator)<0){var i=IH(t,l,e);return a.alwaysFormat?a.format(i,void 0,n,nG(nG(nG({},r),t),{},{interpolationkey:e})):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(IH(t,l,s),c,n,nG(nG(nG({},r),t),{},{interpolationkey:s}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?c(a.escape(e)):c(e)}}].forEach((function(t){for(s=0;i=t.regex.exec(e);){var n=i[1].trim();if(void 0===(o=u(n)))if("function"==typeof d){var l=d(e,i,r);o="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))o="";else{if(h){o=i[0];continue}a.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),o=""}else"string"==typeof o||a.useRawValueToEscape||(o=CH(o));var c=t.safeValue(o);if(e=e.replace(i[0],c),h?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=nG({},o);function a(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var o=(i=this.interpolate(i,s)).match(/'/g),a=i.match(/"/g);(o&&o.length%2==0&&!a||a.length%2!=0)&&(i=i.replace(/'/g,'"'));try{s=JSON.parse(i),t&&(s=nG(nG({},t),s))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete s.defaultValue,e}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(e);){var l=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),l=u,c=!0}if((r=t(a.call(this,n[1].trim(),s),s))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=CH(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return i.format(e,t,o.lng,nG(nG({},o),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function iG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?iG(Object(n),!0).forEach((function(t){MF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iG(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function sG(e){var t={};return function(n,r,i){var o=r+JSON.stringify(i),s=t[o];return s||(s=e(r,i),t[o]=s),s(n)}}var aG=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};rH(this,e),this.logger=xH.create("formatter"),this.options=t,this.formats={number:sG((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:sG((function(e,t){var n=new Intl.NumberFormat(e,oG(oG({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:sG((function(e,t){var n=new Intl.DateTimeFormat(e,oG({},t));return function(e){return n.format(e)}})),relativetime:sG((function(e,t){var n=new Intl.RelativeTimeFormat(e,oG({},t));return function(e){return n.format(e,t.range||"day")}})),list:sG((function(e,t){var n=new Intl.ListFormat(e,oG({},t));return function(e){return n.format(e)}}))},this.init(t)}return oH(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=sG(t)}},{key:"format",value:function(e,t,n,r){var i=this,o=t.split(this.formatSeparator).reduce((function(e,t){var o=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=gH(e.split(":")),r=t[0],i=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=i),"false"===i&&(n[r.trim()]=!1),"true"===i&&(n[r.trim()]=!0),isNaN(i)||(n[r.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}}(t),s=o.formatName,a=o.formatOptions;if(i.formats[s]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=i.formats[s](e,u,oG(oG(oG({},a),r),c))}catch(e){i.logger.warn(e)}return l}return i.logger.warn("there was no format function for ".concat(s)),e}),e);return o}}]),e}();function lG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lG(Object(n),!0).forEach((function(t){MF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lG(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function uG(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=uH(e);if(t){var i=uH(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return cH(this,n)}}var dG=function(e){lH(n,e);var t=uG(n);function n(e,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return rH(this,n),o=t.call(this),NH&&_H.call(sH(o)),o.backend=e,o.store=r,o.services=i,o.languageUtils=i.languageUtils,o.options=s,o.logger=xH.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=s.maxParallelReads||10,o.readingCalls=0,o.maxRetries=s.maxRetries>=0?s.maxRetries:5,o.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(i,s.backend,s),o}return oH(n,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o={},s={},a={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?void 0===s[a]&&(s[a]=!0):(i.state[a]=1,r=!1,void 0===s[a]&&(s[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(a[e]=!0)})),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){var r,a,l,c,u,d;r=n.loaded,a=o,c=EH(r,[i],Object),u=c.obj,d=c.k,u[d]=u[d]||[],l&&(u[d]=u[d].concat(a)),l||u[d].push(a),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===s[e][t]&&(s[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:o,callback:s}):(this.readingCalls++,this.backend[n](e,t,(function(a,l){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}a&&l&&i<r.maxRetries?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,s)}),o):s(a,l)}))):s(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,s){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&s&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),s),t.loaded(e,r,s)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,cG(cG({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(_H);function hG(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===AF(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===AF(e[2])||"object"===AF(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function pG(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function fG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fG(Object(n),!0).forEach((function(t){MF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fG(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gG(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=uH(e);if(t){var i=uH(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return cH(this,n)}}function vG(){}function yG(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var bG=function(e){lH(n,e);var t=gG(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(rH(this,n),e=t.call(this),NH&&_H.call(sH(e)),e.options=pG(r),e.services={},e.logger=xH,e.modules={external:[]},yG(sH(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),cH(e,sH(e));setTimeout((function(){e.init(r,i)}),0)}return e}return oH(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=hG();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=mG(mG(mG({},r),this.options),pG(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=mG(mG({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var o;this.modules.logger?xH.init(i(this.modules.logger),this.options):xH.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=aG);var s=new JH(this.options);this.store=new UH(this.options.resources,this.options);var a=this.services;a.logger=xH,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new eG(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!o||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(a.formatter=i(o),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new rG(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new dG(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new qH(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=vG),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=wH(),h=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vG,r=n,i="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return r();var o=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(i)s(i);else{var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.forEach((function(e){return s(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=wH();return e||(e=this.languages),t||(t=this.options.ns),n||(n=vG),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&jH.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=wH();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},o=function(o){e||o||!n.services.languageDetector||(o=[]);var s="string"==typeof o?o:n.services.languageUtils.getBestMatchFromCodes(o);s&&(n.language||i(s),n.translator.language||n.translator.changeLanguage(s),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(s)),n.loadResources(s,(function(e){!function(e,o){o?(i(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,s)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,i=function e(t,i){var o;if("object"!==AF(i)){for(var s=arguments.length,a=new Array(s>2?s-2:0),l=2;l<s;l++)a[l-2]=arguments[l];o=r.options.overloadTranslationOptionHandler([t,i].concat(a))}else o=mG({},i);o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,o.keyPrefix=o.keyPrefix||n||e.keyPrefix;var c=r.options.keySeparator||".",u=o.keyPrefix?"".concat(o.keyPrefix).concat(c).concat(t):t;return r.t(u,o)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var a=n.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!s(r,e)||i&&!s(o,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=wH();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=wH();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vG,i=mG(mG(mG({},this.options),t),{isClone:!0}),o=new n(i);void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t));var s=["store","services","language"];return s.forEach((function(t){o[t]=e[t]})),o.services=mG({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new qH(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit.apply(o,[e].concat(n))})),o.init(i,r),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(_H);MF(bG,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new bG(e,t)}));var SG=bG.createInstance();SG.createInstance=bG.createInstance;var xG,_G=SG.createInstance;SG.init,SG.loadResources,SG.reloadResources,SG.use,SG.changeLanguage,SG.getFixedT,SG.t,SG.exists,SG.setDefaultNamespace,SG.hasLoadedNamespace,SG.loadNamespaces,SG.loadLanguages;xG=JSON.parse('{"yes":"Si","no":"No","confirm":"Conferma","apply":"Applica","cancel":"Annulla","show":"Mostra","hide":"Nascondi","send":"Invia","close":"Chiudi","edit":"Modifica","delete":"Elimina","loading":"Caricamento","expand":"Espandi","collapse":"Riduci","fullscreenEnter":"Passa a schermo intero","fullscreenExit":"Esci da schermo intero","center":"Centro","bottom":"In basso","hidden":"Nascosto","day":"Giorno","month":"Mese","year":"Anno","createdAt":"Data creazione","selected":"Selezionati","page":"pagina","actions":"Azioni","next":"Successivo","previous":"Precedente","copy":"Copia","copyToClipboard":"Copia negli appunti","showOriginalText":"Mostra originale","showTranslatedText":"Mostra traduzione","exactPosition":"Posizione esatta","uncertain":"Incertezza","question":"Domanda","nothingFound":"Nessun risultato","venue":"Luogo","searchVenue":"Cerca luogo...","memoriBlockedTitle":"Bloccato","memoriBlockedUntil":"Memori bloccato fino al {{date}}","memoriBlockedAnon":"Attualmente \\"{{name}}\\" non può rispondere, torna qui il {{date}}","memoriBlockedReasonExceedChats":"perchè ha superato la soglia mensile di chat ammesse.","memoriBlockedGiverHelper":"Puoi sempre gestirlo in qualità di amministratore, ma altri utenti non potranno interrogarlo.","generatedByAI":"Risposta generata da IA, può talvolta generare informazioni non corrette","whyThisAnswer":"Perché questa risposta?","whyThisAnswerHelper":"Questa risposta è stata generata automaticamente da un\'intelligenza artificiale sulla base di questi contenuti verificati.","completionsEnabled":"IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette","completionProviderDown":"Questo Twin è integrato con una IA generativa di {{provider}}, ma al momento non è disponibile. Riprova più tardi.","completionProviderFallbackName":"un provider esterno","completionProviderCheckStatusPage":"Vedi pagina di stato","boardOfExperts":"Gruppo di esperti","birthDate":"Data di nascita","birthDateHelper":"Ti chiediamo la data di nascita esclusivamente per abilitare o disabilitare le funzionalità che hanno restrizioni in base all\'età","underage":"Devi avere almeno {{age}} anni per registrarti.","underageTwinSession":"Devi avere almeno {{age}} anni per interagire con questo Twin.","ageVerification":"Verifica dell\'età","ageVerificationText":"Per interagire con questo Twin, devi aver almeno {{minAge}} anni.","nsfw":"NSFW: Questo Twin contiene contenuti per adulti","deepThought":"Pensiero profondo","deepThoughtHelper":"Pensiero Profondo è una funzionalità avanzata delle AI che ti consentirà di poter sfruttare a pieno le tue conversazioni mantenendo memoria delle stesse. Le AI con Pensiero Profondo possono darti informazioni adattandosi a te e alle cose che condividerete insieme.","deepThoughtDisclaimerTitle":"Pensiero profondo abilitato","deepThoughtDisclaimer":"Pensiero Profondo è una funzionalità avanzata delle AI che ti consentirà di poter sfruttare a pieno le tue conversazioni mantenendo memoria delle stesse. Le AI con Pensiero Profondo possono darti informazioni adattandosi a te e alle cose che condividerete insieme.","deepThoughtPreDisclaimerUnlogged":"Accedi per abilitare Pensiero Profondo.","deepThoughtPreDisclaimerNotAllowed":"Pensiero Profondo è disabilitato poiché non hai acconsentito al suo utilizzo, puoi cambiare la tua scelta in qualsiasi momento nelle impostazioni del tuo account.","knownFacts":{"title":"Fatti noti","description":"Dettagli delle informazioni condivise tra te e {{memoriName}}","type":"Tipo","typeShortTerm":"Breve termine","typeLongTerm":"Lungo termine","typeHelper":"Tipi:\\n- Breve termine: questo fatto noto è sempre utilizzato durante le conversazioni\\n- Lungo termine: questo fatto noto è utilizzato durante le conversazioni solo se rilevante per la domanda corrente","text":"Testo","deleteSuccess":"Fatto noto eliminato","deleteConfirmTitle":"Elimina il fatto noto","deleteConfirmMessage":"Confermi di voler eliminare questo fatto noto?","deleteSelectedConfirmTitle":"Elimina i fatti noti selezionati","deleteSelectedConfirmMessage":"Confermi di voler eliminare i fatti noti selezionati?"},"auth":{"title":"Autenticazione","useRecoveryTokens":"Utilizza i token di recupero","tokens":"Token","addToken":"Aggiungi token","usePassword":"Utilizza la password","atLeast":"Almeno"},"widget":{"instruct":"Istruisci","test":"Prova","sound":"Audio","position":"Preferenze posizione","settings":"Impostazioni","share":"Condividi","sendOnKeypress":"Premi Invio per inviare","sendOnClick":"Clicca sul bottone di invio","boardOfExperts":"Gruppo di esperti","showExpertsInTheBoard":"Mostra gli esperti di questo gruppo","expertsInTheBoard":"Esperti di questo gruppo","goToIntegrationsToCustomizeAvatar":"Per personalizzare l\'avatar, vai a Condividimi e configura la pagina pubblica"},"write_and_speak":{"micButtonPopover":"Premi il pulsante per parlare","micButtonPopoverListening":"Premi il pulsante per smettere di parlare","pageInstructExplanation":"Per insegnarmi nuove cose clicca sul pulsante ISTRUISCIMI per cominciare","pageTryMeExplanation":"Per parlare con me clicca sul pulsante INIZIAMO per cominciare","instructButton":"ISTRUISCIMI","tryMeButton":"INIZIAMO","chatHistory":"Cronologia chat","exportChatHistory":"Esporta la cronologia chat","exportChatHistoryMessage":"Vuoi esportare la cronologia chat?","chatBotButtonText":"CLICCA QUI PER APRIRE LA CHAT","conversationStartedLabel":"Conversazione avvenuta il","settingsHeaderLabel":"Configura qui il memori se vuoi impostare una conversazione continua. Setta i secondi di silenzio prima dell\'invio.","continuousSpeechLabel":"Conversazione continua","holdToSpeak":"Tieni premuto per parlare","releaseToEndListening":"Rilascia per smettere di parlare","pressAndHoldToSpeak":"Premi e tieni premuto per parlare","microphoneMode":"Modalità microfono","hideEmissionsLabel":"Nascondi testo emesso dal Twin","secondsLabel":"Secondi","controlsPosition":"Posizione dei controlli","tryMeHeaderLabel":"PROVA","unknownPosition":"Posizione sconosciuta","fieldPlace":"Indica la posizione (es \'Milano\')","showMapLinkFor":"Visualizza sulla mappa la posizione","useMyPosition":"Usa la mia posizione","myPosition":"Posizione corrente","updatingPosition":"Aggiorno la posizione...","placeNotFound":"Luogo sconosciuto!","requirePositionHelp":"Per parlare con {{name}} devi decidere se fornire o meno la tua posizione. Questo perchè diverse risposte che potrà fornirti potrebbero dipendere da dove ti trovi.","dontWantToProvidePosition":"Non voglio fornire la mia posizione","attachmentsLabel":"Arricchisci il tuo messaggio","iWantToTalkToIn":"Voglio parlare con {{name}} in"},"media":{"title":"Titolo","editAttributes":"Modifica attributi media","uploadMimeTypeNotAllowed":"Il tipo di file non è permesso","uploadSizeLimitMessage":"Il file caricato è troppo grande (max {{size}}MB)","uploadWrongResolutionMessage":"La risoluzione deve essere {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"Hai già un Twin con questo nome","uploadHelperImages":"Caricare un file con estensione png, jpg, jpeg o gif e con dimensione massima di {{size}}MB","uploadHelper":"Caricare un file di dimensione massima di {{size}}MB","uploadError":"Errore nel caricamento","square":"quadrato","scaleRatio":"Proporzioni","addMediaLabel":"Aggiungi media","insertThisMediaMsg":"Inserisci questi media","mediaUploadMessage":"Clicca per caricare un nuovo media","addLinkLabel":"Aggiungi un link","linkKey":"URL","linkValue":"Titolo link","insertThisLink":"Inserisci un link a {{url}} con titolo {{title}}"},"gamification":{"level":"Livello","points":"punti","memoriReachedLevel":"è diventato più evoluto ed ha raggiunto il livello","levelGoToStatistics":"{{memori}} è al livello {{level}} con {{points}} punti. Clicca per andare alle statistiche.","congratulationsNewLevel":"Congratulazioni, hai raggiunto un nuovo livello!","congratulationsNewLevelDescription":"Il tuo Memori è diventato più evoluto con {{points}} punti, guarda le","statistics":"statistiche"},"login":{"login":"Accedi","logout":"Esci","user":"Utente","loggedDrawerTitle":"Ciao, {{name}}!","loginDrawerTitle":"Accedi","newUserSignUp":"Sei un nuovo utente?","signUp":"Registrati!","registrationDisabled":"La registrazione è disabilitata.","contactAdmin":"Contatta l\'amministratore per richiedere l\'accesso","userNameOrEmail":"Nome utente o email","underage":"Devi avere almeno {{age}} anni per registrarti.","optional":"opzionale","birthDate":"Data di nascita","birthDateHelper":"Ti chiediamo la data di nascita esclusivamente per abilitare o disabilitare le funzionalità che hanno restrizioni in base all\'età","missingData":"Informazioni mancanti","missingDataHelper":"Sappiamo che questo è un po\' fastidioso, ma abbiamo bisogno di alcune informazioni in più per completare la tua registrazione.","goToAccountToChangeYourPreferences":"Puoi cambiare la tua scelta in qualsiasi momento dalla tua pagina Account.","deepThoughtExplaination":"Pensiero Profondo è una funzionalità avanzata delle AI che ti consentirà di poter sfruttare a pieno le tue conversazioni mantenendo memoria delle stesse. Le AI con Pensiero Profondo possono darti informazioni adattandosi a te e alle cose che condividerete insieme. Consenti all\'autore del twin di contattarti per offerte commerciali riguardanti prodotti su cui hai espresso interesse.","tnCAndPPAcceptedHelper":"Dall\'ultimo accesso, i T&C e l\'Informativa sulla privacy sono stati modificati. Si prega di accettarle, altrimenti non sarà possibile apportare modifiche ai propri gemelli. Puoi sempre cancellare il tuo account nella pagina del tuo profilo utente.","privacyLabel":"Ho letto e accettato l\'","privacyAndCookiePolicy":"informativa sui cookie e sulla privacy","and":"e","termsOfService":"i termini del servizio","pAndCUAccepted":"Accetto le condizioni di utilizzo relative a Pensiero Profondo","save":"Salva"},"success":"Operazione andata a buon fine","Error":"Errore","internal server error":"Ops, scusa... qualcosa è andato storto nel server","error":"Errore","error.loading":"Errore durante il caricamento dei contenuti.","error.notFound":"Ops, non abbiamo trovato ciò che cercavi.","error.generic":"Ops, qualcosa è andato storto.","error.serverNotResponding":"Stiamo facendo manutenzione o rilasciando aggiornamenti. Riprova più tardi.","error.unprocessableEntity":"Errore durante il salvataggio dei dati. Ricontrolla i dati inseriti.","error.goBackTo":"Prova a tornare alla","error.reloadPage":"Ricarica la pagina","error.tryAgain":"Riprova","error.unauthorized":"Non sei autorizzato a visualizzare questo contenuto.","errors":{"TENANT_NOT_FOUND":"Tenant non trovato","TENANT_REGISTRATION_DISABLED":"La registrazione su questa piattaforma è disabilitata","TENANT_MISSING_NAME":"Tenant: nome mancante","TENANT_MAX_USERS_REACHED":"Numero massimo di utenti raggiunto","TENANT_MAX_ADMINS_REACHED":"Numero massimo di utenti amministratori raggiunto","TENANT_ALREADY_EXISTS":"Tenant già esistente","TENANT_MISSING_DESCRIPTION":"Tenant: descrizione mancante","TENANT_CANT_SET_COMPLETION_PROVIDER":"Tenant: non abilitato a gestire il provider di completamento","USER_NOT_CONFIRMED":"Utente ancora non confermato","USER_NOT_FOUND":"Utente non trovato","USER_OR_PASSWORD_INVALID":"Utente o password non validi","USER_MUST_CHANGE_PASSWORD":"Devi cambiare la password","USER_MUST_ENTER_VERIFICATION_CODE":"Devi inserire il codice di verifica","USER_MISSING_TENANT":"Utente: tenant mancante","USER_MISSING_NAME":"Utente: nome mancante","USER_MISSING_PASSWORD":"Utente: password mancante","USER_MISSING_EMAIL":"Utente: email mancante","USER_MISSING_VERIFICATION_CODE":"Utente: codice di verifica mancante","USER_NAME_ALREADY_USED":"Nome utente già in uso","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"La password non rispetta le regole di sicurezza","USER_EMAIL_ALREADY_USED":"Email già in uso","USER_EMAIL_INVALID":"Email non valida","USER_VERIFICATION_CODE_INVALID":"Codice di verifica non valido","USER_MISSING_NAME_OR_EMAIL":"Nome utente o email mancante","USER_NAME_INVALID":"Nome utente non valido","USER_HAS_ONE_OR_MORE_MEMORI":"L\'utente ha uno o più memori","USER_MISSING_NEW_PASSWORD":"Utente: nuova password mancante","USER_NOTHING_TO_DO":"Niente da fare","USER_CANT_CREATE_MEMORI":"Utente non abilitato a creare Memori","USER_MAX_MEMORI_REACHED":"Massimo numero di Memori raggiunto","USER_TOO_MANY_ATTEMPTS":"Troppi tentativi","USER_MUST_ACCEPT_TNC_AND_PP":"Devi accettare i termini e le condizioni","USER_BIRTH_DATE_CANT_BE_CHANGED":"Data di nascita non può essere cambiata","USER_CANT_SET_COMPLETION_PROVIDER":"Utente: non abilitato a gestire il provider di completamento","USER_CANT_ENABLE_DEEP_THOUGHT":"Utente: non abilitato a gestire Pensiero Profondo","USER_CANT_ENABLE_DCM_INTEGRATION":"Utente: non abilitato a gestire l\'integrazione con DCM","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"Utente: non abilitato a gestire la concatenazione o il gruppo di esperti","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"Il gruppo di esperti richiede l\'abilitazione delle completions","MEMORI_NOT_FOUND":"Memori non trovato","MEMORI_NOT_ACCESSIBLE":"Memori non accessibile","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Solo il proprietario può cambiare il tag e il pin","SESSION_NOT_FOUND":"Sessione non trovata","SESSION_IS_NOT_ADMINISTRATIVE":"Sessione non amministrativa","SESSION_EXPIRED":"Sessione scaduta","MEMORI_MISSING_CONFIGURATION":"Memori: configurazione mancante","MEMORI_CONFIGURATION_NOT_FOUND":"Memori: configurazione non trovata","MEMORI_INVALID_PRIVACY_TYPE":"Memori: tipo di privacy non valido","MEMORI_MISSING_PASSWORD":"Memori: password mancante","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero totale di token di recupero non valido","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero minimo di token di recupero non valido","MEMORI_INVALID_VOICE_TYPE":"Memori: tipo di voce non valido","MEMORI_MISSING_NAME":"Memori: nome mancante","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memori: password o token di recupero mancanti","MEMORI_INVALID_ID":"Memori: ID non valido","MEMORI_NAME_ALREADY_USED":"Nome memori già in uso","MEMORI_INVALID_PIN":"Memori: PIN non valido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memori: cambio TAG e PIN richiedono operazioni separate","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memori: password non richiesta su Memori pubblico","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Pensiero Profondo richiede l\'abilitazione delle completions","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Trasferimento: utente di destinazione mancante","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Trasferimento: ID utente di destinazione non valido","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Trasferimento: dati utente di destinazione non validi","MEMORI_TRANSFER_NOTHING_TO_DO":"Trasferimento: alcuna operazione da fare","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memori: la configurazione non può essere modificata","MEMORI_MISSING_NEW_PASSWORD":"Memori: nuova password mancante","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Memori: funzionalità richiede un abbonamento","INTEGRATION_NOT_FOUND":"Integrazione non trovata","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Formato non valido data a partire da","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Formato non valido data fino a","INTEGRATION_INVALID_TYPE":"Tipo integrazione non valido","INTEGRATION_ALREADY_EXISTS":"Integrazione già esistente","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Memori non pubblici non possono essere integrati","INTEGRATION_MISSING_INVOCATION_TEXT":"Integrazione: testo di invocazione mancante","INTEGRATION_MISSING_DEVICE_EMAILS":"Integrazione: email del dispositivo mancante","INTEGRATION_MEMORI_IS_EMPTY":"Memori vuoti non possono essere integrati","INTEGRATION_MISSING_PRIVACY_POLICY":"Integrazione: privacy policy mancante","INTEGRATION_MISSING_CATEGORY":"Categoria integrazione mancante","INTEGRATION_MISSING_DESCRIPTION":"Descrizione integrazione mancante","INTEGRATION_INVALID_INVOCATION_TEXT":"Testo di invocazione non valido","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home non più disponibile","UPLOAD_REQUIRES_MULTIPART_ENCODING":"L\'upload richiede l\'encoding multipart","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: manca il content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: dimensione massima superata","UPLOAD_FILE_IS_EMPTY":"Upload: file vuoto","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: tipo di file o firma non validi","UPLOAD_MISSING_FILE_NAME":"Upload: nome file mancante","UPLOAD_INVALID_MEMORY_ID":"Upload: ID contenuto non valido","UPLOAD_MISSING_FILE_CONTENT":"Upload: contenuto file mancante","ASSET_NOT_FOUND":"Asset non trovato","ASSET_NOT_ACCESSIBLE":"Asset non accessibile","ASSET_MISSING_SESSION_ID":"Asset: ID sessione mancante","ASSET_INVALID_FILE_NAME":"Asset: nome file non valido","INVITATION_NOT_FOUND":"Invito non trovato","INVITATION_NOT_ACCESSIBLE":"Invito non accessibile","INVITATION_ALREADY_ACCEPTED":"Invito già accettato","INVITATION_ALREADY_REJECTED":"Invito già rifiutato","INVITATION_MISSING_DESTINATION_EMAIL":"Invito: email di destinazione mancante","INVITATION_DESTINATION_EMAIL_INVALID":"Invito: email di destinazione non valida","INVITATION_MISSING_TAG":"Invito: tag mancante","INVITATION_MISSING_PIN":"Invito: PIN mancante","INVITATION_INVALID_PIN":"Invito: PIN non valido","INVITATION_INVALID_TYPE":"Invito: tipo non valido","INVITATION_MISSING_DESTINATION_NAME":"Invito: nome destinatario mancante","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invito: tag e pin non possono essere cambiati","INVITATION_CANT_BE_CHANGED":"Invito: non può essere modificato","ACTIONLOG_INVALID_USER_ID":"ID utente non valido","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","ACTIONLOG_INVALID_MEMORI_ID":"ID Memori non valido","CONSUMPTIONLOG_INVALID_TYPE":"Tipo di log non valido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","CONSUMPTIONLOG_INVALID_USER_ID":"ID utente non valido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Memori ID non valido","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifiche: Periodo di estrazione chatlog non valido","PROCESS_INVALID_TYPE":"Tipo di processo non valido","PROCESS_ALREADY_RUNNING":"Processo già in esecuzione","PROCESS_NOT_FOUND":"Processo non trovato","IMPORTCSV_MISSING_ROWS":"Importazione CSV: righe mancanti","IMPORTCSV_MISSING_CSV":"Importazione CSV: CSV mancante","IMPORTCSV_MISSING_SEPARATOR":"Importazione CSV: separatore mancante","IMPORTCSV_INVALID_SEPARATOR":"Importazione CSV: separatore non valido","IMPORTCSV_MISSING_HEADERS":"Importazione CSV: intestazioni mancanti","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Importazione CSV: separatore varianti titolo mancante","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"Importazione CSV: encoding caratteri non rilevabile","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione CSV: impossibile importare in Memori segreti","IMPORTTXT_MISSING_ROWS":"Importazione TXT: righe mancanti","IMPORTTXT_INVALID_GRANULARITY":"Importazione TXT: granularità non valida","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"Importazione TXT: encoding caratteri non rilevabile","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione TXT: impossibile importare in Memori segreti","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Importazione TXT: limite importazione superato","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Importazione TXT: importazione su GPT-4 richiede API key","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Importazione TXT: importazione richiede un piano a pagamento","EXPORTCSV_MISSING_CSV_SPECS":"Esportazione CSV: specifiche CSV mancanti","EXPORTCSV_MISSING_SEPARATOR":"Esportazione CSV: separatore mancante","EXPORTCSV_INVALID_SEPARATOR":"Esportazione CSV: separatore non valido","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Esportazione CSV: separatore varianti titolo mancante","EXPORTCSV_MISSING_NEW_LINE_CHAR":"Esportazione CSV: carattere di nuova riga mancante","EXPORTCSV_INVALID_NEW_LINE_CHAR":"Esportazione CSV: carattere di nuova riga non valido","EXPORTCSV_MISSING_PASSWORD":"Esportazione CSV: password mancante","EXPORTJSONL_MISSING_JSONL_SPECS":"Esportazione JSONL: specifiche JSONL mancanti","EXPORTJSONL_MISSING_PLATFORM":"Esportazione JSONL: piattaforma mancante","EXPORTJSONL_INVALID_PLATFORM":"Esportazione JSONL: piattaforma non valida","EXPORTJSONL_MISSING_PASSWORD":"Esportazione JSONL: password mancante","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"Esportazione JSONL: esportazione richiede un piano a pagamento","ANALYSIS_MISSING_QUERY":"Analisi: query mancante","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analisi: impossibile analizzare Memori segreti","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analisi: corrispondenza query utente richiede Pensiero Profondo","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Assegnazione badge: credenziali errate o mancanti","BADGE_ASSIGNMENT_MISSING_REF_ID":"Assegnazione badge: ID ref mancante","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Assegnazione badge: esito non trovato","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Assegnazione badge: URL di asserzione mancante","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Assegnazione badge: URL badge mancante","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Assegnazione badge: URL issuer mancante","BADGE_ASSIGNMENT_INVALID_URL":"Assegnazione badge: URL non valido","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Assegnazione badge: destinatario mancante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Assegnazione badge: tipo destinatario sconosciuto","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Assegnazione badge: identità destinatario mancante","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Assegnazione badge: tipo hash destinatario mancante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Assegnazione badge: tipo hash destinatario sconosciuto","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Assegnazione badge: identità destinatario errata","BADGE_NOT_FOUND":"Badge non trovato","OUTCOME_NO_DCM_CONFIGURED":"Esito: nessun DCM configurato","OUTCOME_USER_BADGES_DISABLED":"Esito: badge utente disabilitati"}}');const wG=_G({resources:{en:{translation:t(JSON.parse('{"yes":"Yes","no":"No","confirm":"Confirm","apply":"Apply","cancel":"Cancel","show":"Show","hide":"Hide","send":"Send","close":"Close","edit":"Edit","delete":"Delete","loading":"Loading","expand":"Expand","collapse":"Collapse","fullscreenEnter":"Enter fullscreen","fullscreenExit":"Exit fullscreen","center":"Center","bottom":"Bottom","hidden":"Hidden","day":"Day","month":"Month","year":"Year","createdAt":"Creation date","selected":"Selected","page":"page","actions":"Actions","next":"Next","previous":"Previous","copy":"Copy","copyToClipboard":"Copy to clipboard","showOriginalText":"Show original","showTranslatedText":"Show translation","exactPosition":"Exact position","uncertain":"Uncertain","question":"Question","nothingFound":"Nothing found","venue":"Venue","searchVenue":"Search venue...","memoriBlockedTitle":"Blocked","memoriBlockedUntil":"Memori blocked until {{date}}","memoriBlockedAnon":"Currently \\"{{name}}\\" can\'t answer, come back here on {{date}}","memoriBlockedReasonExceedChats":"because it has exceeded the monthly threshold of allowed chats.","memoriBlockedGiverHelper":"You can still manage it as administrator, but other users will not be able to interact with it.","generatedByAI":"Answer generated by AI, may occasionally generate incorrect informations","whyThisAnswer":"Why this answer?","whyThisAnswerHelper":"This answer was generated automatically by an artificial intelligence based on these verified contents.","completionsEnabled":"Advanced AI, can respond with automatically generated answers that may sometimes contain incorrect information","completionProviderDown":"This Twin is integrated with a generative AI from {{provider}}, but it is currently unavailable. Try again later.","completionProviderFallbackName":"an external provider","completionProviderCheckStatusPage":"Check status page","boardOfExperts":"Board of experts","birthDate":"Birth date","birthDateHelper":"We ask for your birth date only to enable or disable functionalities that have age restrictions","underage":"You must be at least {{age}} years old to sign up.","underageTwinSession":"You must be at least {{age}} years old to interact with this Twin.","ageVerification":"Age verification","ageVerificationText":"To interact with this Twin, you must be at least {{minAge}} years old.","nsfw":"NSFW: This Twin contains adult contents","deepThought":"Deep Thought","deepThoughtHelper":"Deep Thought is an advanced feature of the AI that will allow you to fully exploit your conversations by keeping track of them. The AI with Deep Thought can give you information tailored to you and the things you will share together. Allow the twin\'s author to contact you for commercial offers regarding products you have shown interest in.","deepThoughtDisclaimerTitle":"Deep Thought enabled","deepThoughtDisclaimer":"Deep Thought is an advanced feature of the AI that will allow you to fully exploit your conversations by keeping track of them. The AI with Deep Thought can give you information tailored to you and the things you will share together.","deepThoughtPreDisclaimerUnlogged":"Log in to enable Deep Thought.","deepThoughtPreDisclaimerNotAllowed":"Deep Thought is disabled since you didn\'t consent its usage, you can change this any time in your account settings.","knownFacts":{"title":"Known facts","description":"Details of the information shared between you and {{memoriName}}","type":"Type","typeShortTerm":"Short term","typeLongTerm":"Long term","typeHelper":"Types:\\n- Short Term: this Known Fact is always used during conversations\\n- Long Term: this Known Fact is used during conversations only if relevant to the current question","text":"Text","deleteSuccess":"Known fact deleted","deleteConfirmTitle":"Delete known fact","deleteConfirmMessage":"Are you sure you want to delete this known fact?","deleteSelectedConfirmTitle":"Delete selected known facts","deleteSelectedConfirmMessage":"Are you sure you want to delete the selected known facts?"},"auth":{"title":"Authentication","useRecoveryTokens":"Use recovery tokens","tokens":"Tokens","addToken":"Add token","usePassword":"Use password","atLeast":"At least"},"widget":{"instruct":"Instruct","test":"Test","sound":"Sound","position":"Position preferences","settings":"Settings","share":"Share","sendOnKeypress":"Hit Enter to send","sendOnClick":"Click on Submit","boardOfExperts":"Board of experts","showExpertsInTheBoard":"Show experts in this board","expertsInTheBoard":"Experts in this board","goToIntegrationsToCustomizeAvatar":"To customize the avatar, go to Share and customize the public page"},"write_and_speak":{"micButtonPopover":"Click the button to speak","micButtonPopoverListening":"Click the button to stop speak","pageInstructExplanation":"To teach me new things click on the INSTRUCT ME button to get started","pageTryMeExplanation":"To talk to me click on the START button to get started","instructButton":"INSTRUCT ME","tryMeButton":"START","chatHistory":"Chat history","exportChatHistory":"Export chat history","exportChatHistoryMessage":"Do you want to export chat history?","chatBotButtonText":"CLICK HERE TO OPEN CHATBOT","conversationStartedLabel":"Conversation started on","settingsHeaderLabel":"Setup here if you want to set the memori as continuous speech, and change the silence seconds if you want to customize them.","continuousSpeechLabel":"Continuous speech","holdToSpeak":"Hold to speak","releaseToEndListening":"Release to end listening","pressAndHoldToSpeak":"Press and hold to speak","microphoneMode":"Microphone mode","hideEmissionsLabel":"Hide text emitted by the Twin","secondsLabel":"Set seconds","controlsPosition":"Controls position","tryMeHeaderLabel":"TRY","unknownPosition":"Unknown position","fieldPlace":"Write the place (eg \'Milano\')","showMapLinkFor":"Show the position on the map","useMyPosition":"Use my position","myPosition":"Your position","updatingPosition":"Updating position...","placeNotFound":"Place not found!","requirePosition":"Insert your position before start","requirePositionHelp":"To talk to {{name}} you have to decide whether to provide your position or not. This is because different answers that it can provide you may depend on where you are.","dontWantToProvidePosition":"I don\'t want to provide my position","attachmentsLabel":"Enrich your message","iWantToTalkToIn":"I want to talk to {{name}} in"},"media":{"title":"Title","editAttributes":"Edit media attributes","uploadMimeTypeNotAllowed":"The file type is not allowed","uploadSizeLimitMessage":"The uploaded size is too big (max {{size}}MB)","uploadWrongResolutionMessage":"The resolution must be {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"You already have a Twin with this name","uploadHelperImages":"Upload a file with extension png, jpg, jpeg or gif, and having at maximum a size of {{size}}MB","uploadHelper":"Upload a file having at maximum a size of {{size}}MB","uploadError":"Upload failed","square":"square","scaleRatio":"Scale ratio","addMediaLabel":"Add a media","insertThisMediaMsg":"Insert these media","mediaUploadMessage":"Click to load a new media","addLinkLabel":"Add a link","linkKey":"URL","linkValue":"Link title","insertThisLink":"Insert a link to {{url}} with title {{title}}"},"gamification":{"level":"Level","points":"points","memoriReachedLevel":"became more evolved and reached level","levelGoToStatistics":"{{memori}} is at level {{level}} with {{points}} points. Click to go to statistics.","congratulationsNewLevel":"Congratulations, you have reached a new level!","congratulationsNewLevelDescription":"Your Memori became more evolved with {{points}} points, look at the","statistics":"statistics"},"login":{"login":"Login","logout":"Logout","user":"User","loggedDrawerTitle":"Hi, {{name}}!","loginDrawerTitle":"Login","newUserSignUp":"New user?","signUp":"Sign up!","registrationDisabled":"Registration is disabled","contactAdmin":"Contact the administrator to request access","userNameOrEmail":"Username or email","underage":"You must be at least {{age}} years old to sign up.","optional":"Optional","birthDate":"Birth date","birthDateHelper":"We ask for your birth date only to enable or disable functionalities that have age restrictions","missingData":"Missing informations","missingDataHelper":"We know that this is a bit annoying, but we need some more informations to complete your registration.","goToAccountToChangeYourPreferences":"You can change your choice at any time from your Account page.","deepThoughtExplaination":"Deep Thought is an advanced feature of the AI that will allow you to fully exploit your conversations by keeping track of them. The AI with Deep Thought can give you information tailored to you and the things you will share together. Allow the twin\'s author to contact you for commercial offers regarding products you have shown interest in.","tnCAndPPAcceptedHelper":"Since your last login, T&C and Privacy Policy have changed. Please accept them, otherwise you won\'t be able to make changes to your Twins. You can always delete your account in your user profile page.","privacyLabel":"I have read and accepted the","privacyAndCookiePolicy":"Privacy e Cookie Policy","and":"and","termsOfService":"Terms of Service","pAndCUAccepted":"I accept the terms of service about Deep Thought","save":"Save"},"success":"Success","Error":"Error","internal server error":"Oupsie, sorry... Something went wrong on the server","error":"Error","error.loading":"Error while loading content.","error.generic":"Oupsie, sorry... something went wrong.","error.serverNotResponding":"We are doing maintenance or releasing updates. Please try again later.","error.notFound":"Oupsie, we didn\'t find the page you were looking for.","error.goBackTo":"You can try to go back to the","error.reloadPage":"Reload the page","error.tryAgain":"Try again","error.unauthorized":"You are unauthorized to view this content.","error.unprocessableEntity":"Error while processing the request. Check the data you entered.","errors":{"TENANT_NOT_FOUND":"Tenant not found","TENANT_REGISTRATION_DISABLED":"Registration on this platform is disabled","TENANT_MISSING_NAME":"Tenant: name missing","TENANT_MAX_USERS_REACHED":"Maximum number of users reached","TENANT_MAX_ADMINS_REACHED":"Maximum number of admin users reached","TENANT_ALREADY_EXISTS":"Tenant already exists","TENANT_MISSING_DESCRIPTION":"Tenant: description missing","TENANT_CANT_SET_COMPLETION_PROVIDER":"Tenant: can\'t set completion provider","USER_NOT_CONFIRMED":"User still not confirmed","USER_NOT_FOUND":"User not found","USER_OR_PASSWORD_INVALID":"Invalid user or password","USER_MUST_CHANGE_PASSWORD":"You must change your password","USER_MUST_ENTER_VERIFICATION_CODE":"You must enter the verification code","USER_MISSING_TENANT":"User: missing tenant","USER_MISSING_NAME":"User: name is missing","USER_MISSING_PASSWORD":"User: password missing","USER_MISSING_EMAIL":"User: Missing email","USER_MISSING_VERIFICATION_CODE":"User: Missing verification code","USER_NAME_ALREADY_USED":"User name already in use","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"The password does not meet the security rules","USER_EMAIL_ALREADY_USED":"Email already in use","USER_EMAIL_INVALID":"Invalid email","USER_VERIFICATION_CODE_INVALID":"Invalid verification code","USER_MISSING_NAME_OR_EMAIL":"Missing username or email","USER_NAME_INVALID":"Invalid user name","USER_HAS_ONE_OR_MORE_MEMORI":"The user has one or more memories","USER_MISSING_NEW_PASSWORD":"User: new password missing","USER_NOTHING_TO_DO":"Nothing to do","USER_CANT_CREATE_MEMORI":"User not allowed to create Memori","USER_MAX_MEMORI_REACHED":"Maximum number of Memori reached","USER_TOO_MANY_ATTEMPTS":"Too many attempts","USER_MUST_ACCEPT_TNC_AND_PP":"You must accept the terms and conditions","USER_BIRTH_DATE_CANT_BE_CHANGED":"Date of birth cannot be changed","USER_CANT_SET_COMPLETION_PROVIDER":"User: not allowed to manage completion provider","USER_CANT_ENABLE_DEEP_THOUGHT":"User: not enabled to manage Deep Thought","USER_CANT_ENABLE_DCM_INTEGRATION":"User: not enabled to manage DCM integration","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"User: not allowed to manage chaining or expert group","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"The expert group requires completions to be enabled","MEMORI_NOT_FOUND":"Memori not found","MEMORI_NOT_ACCESSIBLE":"Memori not accessible","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Only owner can change tag or pin","SESSION_NOT_FOUND":"Session not found","SESSION_IS_NOT_ADMINISTRATIVE":"Non-administrative session","SESSION_EXPIRED":"Session expired","MEMORI_MISSING_CONFIGURATION":"Memori: missing configuration","MEMORI_CONFIGURATION_NOT_FOUND":"Memories: configuration not found","MEMORI_INVALID_PRIVACY_TYPE":"Memories: invalid privacy type","MEMORI_MISSING_PASSWORD":"Memori: missing password","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memories: total number of invalid recovery tokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memories: minimum number of invalid recovery tokens","MEMORI_INVALID_VOICE_TYPE":"Memories: invalid voice type","MEMORI_MISSING_NAME":"Memories: missing name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memories: missing password or recovery token","MEMORI_INVALID_ID":"Memories: invalid ID","MEMORI_NAME_ALREADY_USED":"Memory name already in use","MEMORI_INVALID_PIN":"Memories: Invalid PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memories: TAG and PIN change require separate operations","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memories: no password required when public","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Deep Thought requires completions to be enabled","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transfer: missing destination user","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transfer: invalid destination user ID","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transfer: invalid destination user data","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfer: nothing to do","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memories: configuration cannot be changed","MEMORI_MISSING_NEW_PASSWORD":"Memories: new password missing","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Feature requires subscription","INTEGRATION_NOT_FOUND":"Integration not found","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Invalid date from format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Invalid date to format","INTEGRATION_INVALID_TYPE":"Invalid integration type","INTEGRATION_ALREADY_EXISTS":"Integration already exists","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Non-public memories cannot be integrated","INTEGRATION_MISSING_INVOCATION_TEXT":"Integration: missing invocation text","INTEGRATION_MISSING_DEVICE_EMAILS":"Integration: missing device email","INTEGRATION_MEMORI_IS_EMPTY":"Empty memories cannot be integrated","INTEGRATION_MISSING_PRIVACY_POLICY":"Integration: privacy policy missing","INTEGRATION_MISSING_CATEGORY":"Integration category missing","INTEGRATION_MISSING_DESCRIPTION":"Missing integration description","INTEGRATION_INVALID_INVOCATION_TEXT":"Invalid invocation text","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home no more available","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Upload requires multipart encoding","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: missing content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: maximum size exceeded","UPLOAD_FILE_IS_EMPTY":"Upload: empty file","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: invalid file type or signature","UPLOAD_MISSING_FILE_NAME":"Upload: missing file name","UPLOAD_INVALID_MEMORY_ID":"Upload: Invalid content ID","UPLOAD_MISSING_FILE_CONTENT":"Upload: Missing file content","ASSET_NOT_FOUND":"Asset not found","ASSET_NOT_ACCESSIBLE":"Asset not accessible","ASSET_MISSING_SESSION_ID":"Asset: missing session ID","ASSET_INVALID_FILE_NAME":"Asset: invalid file name","INVITATION_NOT_FOUND":"Invitation not found","INVITATION_NOT_ACCESSIBLE":"Invitation not accessible","INVITATION_ALREADY_ACCEPTED":"Invitation already accepted","INVITATION_ALREADY_REJECTED":"Invitation already rejected","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation: missing destination email","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation: destination email invalid","INVITATION_MISSING_TAG":"Invitation: missing tag","INVITATION_MISSING_PIN":"Invitation: PIN missing","INVITATION_INVALID_PIN":"Invitation: invalid PIN","INVITATION_INVALID_TYPE":"Invitation: invalid type","INVITATION_MISSING_DESTINATION_NAME":"Invitation: destination name missing","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation: tag and pin can\'t be changed","INVITATION_CANT_BE_CHANGED":"Intation: can\'t be changed","ACTIONLOG_INVALID_USER_ID":"Invalid user ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","ACTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","CONSUMPTIONLOG_INVALID_TYPE":"Invalid log type","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","CONSUMPTIONLOG_INVALID_USER_ID":"Invalid user ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifications: Invalid chat log extraction period","PROCESS_INVALID_TYPE":"Invalid process type","PROCESS_ALREADY_RUNNING":"Process already running","PROCESS_NOT_FOUND":"Process not found","IMPORTCSV_MISSING_ROWS":"CSV import: missing rows","IMPORTCSV_MISSING_CSV":"CSV Import: Missing CSV","IMPORTCSV_MISSING_SEPARATOR":"CSV import: missing separator","IMPORTCSV_INVALID_SEPARATOR":"CSV import: invalid separator","IMPORTCSV_MISSING_HEADERS":"CSV import: missing headers","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV import: missing title variant separator","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"CSV import: undetectable character encoding","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"CSV Import: Cannot import to Secret Memories","IMPORTTXT_MISSING_ROWS":"Importing TXT: missing rows","IMPORTTXT_INVALID_GRANULARITY":"Import TXT: invalid granularity","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"TXT import: undetectable character encoding","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"TXT Import: Cannot import to Secret Memories","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Import TXT: import limit exceeded","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Import TXT: import on GPT-4 requires API key","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Import TXT: Import requires a paying plan","EXPORTCSV_MISSING_CSV_SPECS":"CSV export: missing CSV specifications","EXPORTCSV_MISSING_SEPARATOR":"CSV export: missing separator","EXPORTCSV_INVALID_SEPARATOR":"CSV export: invalid separator","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV export: missing title variant separator","EXPORTCSV_MISSING_NEW_LINE_CHAR":"CSV export: missing newline character","EXPORTCSV_INVALID_NEW_LINE_CHAR":"CSV export: invalid newline character","EXPORTCSV_MISSING_PASSWORD":"CSV export: missing password","EXPORTJSONL_MISSING_JSONL_SPECS":"JSONL export: missing JSONL specifications","EXPORTJSONL_MISSING_PLATFORM":"JSONL export: missing platform","EXPORTJSONL_INVALID_PLATFORM":"JSONL export: invalid platform","EXPORTJSONL_MISSING_PASSWORD":"JSONL export: missing password","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"JSONL Export: Export requires a paid plan","ANALYSIS_MISSING_QUERY":"Analysis: missing query","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analysis: Unable to analyze Secret Memories","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analysis: matching user query requires Deep Thinking","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Badge assignment: incorrect or missing credentials","BADGE_ASSIGNMENT_MISSING_REF_ID":"Badge assignment: ref ID missing","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Badge assignment: result not found","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Badge assignment: Missing assertion URL","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Badge Assignment: Missing Badge URL","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Badge assignment: missing issuer URL","BADGE_ASSIGNMENT_INVALID_URL":"Badge assignment: Invalid URL","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Badge assignment: missing recipient","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Badge assignment: unknown recipient type","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Badge assignment: missing recipient identity","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Badge assignment: missing recipient hash type","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Badge assignment: recipient hash type unknown","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Badge assignment: incorrect recipient identity","BADGE_NOT_FOUND":"Badge not found","OUTCOME_NO_DCM_CONFIGURED":"Result: no DCM configured","OUTCOME_USER_BADGES_DISABLED":"Result: user badges disabled"}}'))},it:{translation:t(xG)}},lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});wG.init();var CG=wG;c=o("85Hg2");function AG(e){var t=e.i18n,n=e.defaultNS,r=e.children,i=(0,c.useMemo)((function(){return{i18n:t,defaultNS:n}}),[t,n]);return(0,c.createElement)(se.Provider,{value:i},r)}const EG=({ownerUserName:e,ownerUserID:t,memoriName:n,memoriID:r,integrationID:i,tenantID:o,secretToken:a,sessionID:l,layout:u="DEFAULT",customLayout:d,showShare:h=!0,showSettings:p=!0,showInstruct:f=!1,showTypingText:m=!1,showClear:g=!1,showOnlyLastMessages:v=!1,showInputs:y=!0,showDates:b=!1,showContextPerLine:S=!1,showLogin:x,height:_="100%",baseURL:w,apiURL:C="https://backend.memori.ai",tag:A,pin:E,context:T,initialQuestion:M,uiLang:I,spokenLang:R,multilingual:P,authToken:k,AZURE_COGNITIVE_SERVICES_TTS_KEY:O,defaultSpeakerActive:N=!0,onStateChange:L,additionalInfo:D,customMediaRenderer:B,additionalSettings:z,userAvatar:F})=>{var U,j,H;const[G,V]=(0,c.useState)(),[W,q]=(0,c.useState)(),[K,J]=(0,c.useState)(O),{t:Y}=Se();if(!(r&&t||n&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const Z=Q(C),X=(0,c.useCallback)((async()=>{const e=w||(o.startsWith("https://")?o:`https://${o}`),t=await fetch(`${e}/api/speechkey`),n=await t.json();n.AZURE_COGNITIVE_SERVICES_TTS_KEY&&J(n.AZURE_COGNITIVE_SERVICES_TTS_KEY)}),[]);(0,c.useEffect)((()=>{O||X()}),[O]);const $=(0,c.useCallback)((async()=>{if(r&&t){const{memori:e,...n}=await Z.backend.getMemoriByUserAndId(o,t,r);0===n.resultCode&&e?V(e):console.error("[MEMORI]",n,e)}else if(n&&e){const{memori:t,...r}=await Z.backend.getMemori(o,e,n);0===r.resultCode&&t?V(t):console.error("[MEMORI]",r,t)}}),[r,t,n,e,o]);(0,c.useEffect)((()=>{$()}),[$,o]);const ee=(0,c.useCallback)((async()=>{const e=await nH(o,w);e&&q(e)}),[o,C]);(0,c.useEffect)((()=>{ee()}),[ee]),(0,c.useEffect)((()=>{if(I)CG.changeLanguage(I.toLowerCase());else{const{lng:e,fallbackLng:t}=(()=>{const e=navigator.language;if(e){let t=e.split("-")[0];if(["en","it"].includes(t))return{lng:t,fallbackLng:"en"===t?"it":"en"}}return{lng:"en",fallbackLng:"it"}})();CG.changeLanguage(e).catch((()=>{CG.changeLanguage(t)}))}}),[I]);const te=G?(0,s.jsx)(eH,{layout:u,customLayout:d,height:_,baseUrl:w||(o.startsWith("https://")?o:`https://${o}`),apiUrl:C,memori:{...G,secretToken:a},memoriLang:null!=R?R:null===(j=null===(U=G.culture)||void 0===U?void 0:U.split("-"))||void 0===j?void 0:j[0],multilingual:P,tenant:W,secret:a,sessionID:l,showShare:h,showSettings:p,showInstruct:f,showTypingText:m,showClear:g,showOnlyLastMessages:v,showInputs:y,showDates:b,showContextPerLine:S,showLogin:null!=x?x:null==G?void 0:G.enableDeepThought,integration:null===(H=null==G?void 0:G.integrations)||void 0===H?void 0:H.find((e=>i?e.integrationID===i:!!e.publish&&"LANDING_EXPERIENCE"===e.type)),initialContextVars:T,initialQuestion:M,authToken:k,AZURE_COGNITIVE_SERVICES_TTS_KEY:K||O,defaultSpeakerActive:N,onStateChange:L,additionalInfo:D,customMediaRenderer:B,additionalSettings:z,userAvatar:F,...A&&E?{personification:{tag:A,pin:E}}:{}}):(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,s.jsxs)("p",{style:{textAlign:"center",margin:"2rem auto",textTransform:"capitalize"},children:[Y("loading")||"Loading","..."]})});return(0,s.jsxs)(AG,{i18n:CG,children:[(0,s.jsx)(Ku.Toaster,{position:"top-center",reverseOrder:!0}),te]})};EG.propTypes={memoriName:t(l).string,memoriID:t(l).string,ownerUserName:t(l).string,ownerUserID:t(l).string,integrationID:t(l).string,tenantID:t(l).string.isRequired,secretToken:t(l).string,sessionID:t(l).string,layout:t(l).oneOf(["DEFAULT","FULLPAGE","TOTEM","WEBSITE_ASSISTANT","CHAT"]),customLayout:t(l).any,showShare:t(l).bool,showInstruct:t(l).bool,showInputs:t(l).bool,showDates:t(l).bool,showContextPerLine:t(l).bool,showSettings:t(l).bool,showClear:t(l).bool,showOnlyLastMessages:t(l).bool,showTypingText:t(l).bool,showLogin:t(l).bool,height:t(l).oneOfType([t(l).string,t(l).number]),baseURL:t(l).string,apiURL:t(l).string,tag:t(l).string,pin:t(l).string,context:t(l).objectOf(t(l).any),initialQuestion:t(l).string,uiLang:t(l).oneOf(["en","it","EN","IT"]),spokenLang:t(l).string,multilingual:t(l).bool,authToken:t(l).string,AZURE_COGNITIVE_SERVICES_TTS_KEY:t(l).string,defaultSpeakerActive:t(l).bool,onStateChange:t(l).func,additionalInfo:t(l).objectOf(t(l).any),customMediaRenderer:t(l).func,additionalSettings:t(l).any,userAvatar:t(l).oneOfType([t(l).string,t(l).any])};var TG=EG;class MG extends HTMLElement{connectedCallback(){const e=document.createElement("div"),n=document.createElement("div");n.setAttribute("id","memori-root"),e.appendChild(n),this.appendChild(e);const r=Object.keys(TG.propTypes).reduce(((e,t)=>(this.hasAttribute(t)&&(e[t]=this.getAttribute(t),"true"!==e[t]&&"false"!==e[t]||(e[t]="true"===e[t])),e)),{}),i=this.getAttribute("tenantId"),o=this.getAttribute("context")?.split(",")?.reduce(((e,t)=>{const[n,r]=t.split(":").map((e=>e.trim()));return{...e,[n]:r}}),{}),l=(e=>{try{return JSON.parse(e)}catch(e){return null}})(this.getAttribute("additionalInfo")||"{}")||{};i?t(a).render((0,s.jsx)(TG,{...r,context:o,tenantID:i,additionalInfo:l}),n):console.error("No tenantId attribute found")}}customElements.define("memori-client",MG)})();