hanbiro-react16-sdk 1.0.3 → 1.0.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.
- package/dist/{index-DWGdUH7T.mjs → hanbiro-react16-sdk.es.js} +461 -427
- package/dist/hanbiro-react16-sdk.umd.js +76 -0
- package/package.json +14 -13
- package/dist/components/index.js +0 -4
- package/dist/components.d.ts +0 -1
- package/dist/index.js +0 -10
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +0 -36
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
(function(B,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],D):(B=typeof globalThis<"u"?globalThis:B||self,D(B.HanbiroReact16SDK={},B.React))})(this,function(B,D){"use strict";var Hn=Object.defineProperty;var Yn=(B,D,ne)=>D in B?Hn(B,D,{enumerable:!0,configurable:!0,writable:!0,value:ne}):B[D]=ne;var S=(B,D,ne)=>Yn(B,typeof D!="symbol"?D+"":D,ne);var Ge;function ne(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const b=ne(D);let ce;const zt=new Uint8Array(16);function Lt(){if(!ce&&(ce=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ce))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ce(zt)}const W=[];for(let t=0;t<256;++t)W.push((t+256).toString(16).slice(1));function jt(t,e=0){return W[t[e+0]]+W[t[e+1]]+W[t[e+2]]+W[t[e+3]]+"-"+W[t[e+4]]+W[t[e+5]]+"-"+W[t[e+6]]+W[t[e+7]]+"-"+W[t[e+8]]+W[t[e+9]]+"-"+W[t[e+10]]+W[t[e+11]]+W[t[e+12]]+W[t[e+13]]+W[t[e+14]]+W[t[e+15]]}const rt={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Dt(t,e,n){if(rt.randomUUID&&!t)return rt.randomUUID();t=t||{};const r=t.random||(t.rng||Lt)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,jt(r)}function Mt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Se={exports:{}},ue={exports:{}},P={};/** @license React v16.13.1
|
|
2
|
+
* react-is.production.min.js
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/var it;function qt(){if(it)return P;it=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,c=t?Symbol.for("react.provider"):60109,o=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.async_mode"):60111,a=t?Symbol.for("react.concurrent_mode"):60111,l=t?Symbol.for("react.forward_ref"):60112,g=t?Symbol.for("react.suspense"):60113,p=t?Symbol.for("react.suspense_list"):60120,k=t?Symbol.for("react.memo"):60115,y=t?Symbol.for("react.lazy"):60116,x=t?Symbol.for("react.block"):60121,z=t?Symbol.for("react.fundamental"):60117,M=t?Symbol.for("react.responder"):60118,F=t?Symbol.for("react.scope"):60119;function L(h){if(typeof h=="object"&&h!==null){var Y=h.$$typeof;switch(Y){case e:switch(h=h.type,h){case u:case a:case r:case s:case i:case g:return h;default:switch(h=h&&h.$$typeof,h){case o:case l:case y:case k:case c:return h;default:return Y}}case n:return Y}}}function q(h){return L(h)===a}return P.AsyncMode=u,P.ConcurrentMode=a,P.ContextConsumer=o,P.ContextProvider=c,P.Element=e,P.ForwardRef=l,P.Fragment=r,P.Lazy=y,P.Memo=k,P.Portal=n,P.Profiler=s,P.StrictMode=i,P.Suspense=g,P.isAsyncMode=function(h){return q(h)||L(h)===u},P.isConcurrentMode=q,P.isContextConsumer=function(h){return L(h)===o},P.isContextProvider=function(h){return L(h)===c},P.isElement=function(h){return typeof h=="object"&&h!==null&&h.$$typeof===e},P.isForwardRef=function(h){return L(h)===l},P.isFragment=function(h){return L(h)===r},P.isLazy=function(h){return L(h)===y},P.isMemo=function(h){return L(h)===k},P.isPortal=function(h){return L(h)===n},P.isProfiler=function(h){return L(h)===s},P.isStrictMode=function(h){return L(h)===i},P.isSuspense=function(h){return L(h)===g},P.isValidElementType=function(h){return typeof h=="string"||typeof h=="function"||h===r||h===a||h===s||h===i||h===g||h===p||typeof h=="object"&&h!==null&&(h.$$typeof===y||h.$$typeof===k||h.$$typeof===c||h.$$typeof===o||h.$$typeof===l||h.$$typeof===z||h.$$typeof===M||h.$$typeof===F||h.$$typeof===x)},P.typeOf=L,P}var O={};/** @license React v16.13.1
|
|
9
|
+
* react-is.development.js
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the MIT license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/var st;function Bt(){return st||(st=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,c=t?Symbol.for("react.provider"):60109,o=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.async_mode"):60111,a=t?Symbol.for("react.concurrent_mode"):60111,l=t?Symbol.for("react.forward_ref"):60112,g=t?Symbol.for("react.suspense"):60113,p=t?Symbol.for("react.suspense_list"):60120,k=t?Symbol.for("react.memo"):60115,y=t?Symbol.for("react.lazy"):60116,x=t?Symbol.for("react.block"):60121,z=t?Symbol.for("react.fundamental"):60117,M=t?Symbol.for("react.responder"):60118,F=t?Symbol.for("react.scope"):60119;function L(d){return typeof d=="string"||typeof d=="function"||d===r||d===a||d===s||d===i||d===g||d===p||typeof d=="object"&&d!==null&&(d.$$typeof===y||d.$$typeof===k||d.$$typeof===c||d.$$typeof===o||d.$$typeof===l||d.$$typeof===z||d.$$typeof===M||d.$$typeof===F||d.$$typeof===x)}function q(d){if(typeof d=="object"&&d!==null){var K=d.$$typeof;switch(K){case e:var we=d.type;switch(we){case u:case a:case r:case s:case i:case g:return we;default:var It=we&&we.$$typeof;switch(It){case o:case l:case y:case k:case c:return It;default:return K}}case n:return K}}}var h=u,Y=a,N=o,le=c,Ve=e,Ke=l,ve=r,Qe=y,Je=k,re=n,Xe=s,V=i,te=g,ke=!1;function et(d){return ke||(ke=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),f(d)||q(d)===u}function f(d){return q(d)===a}function m(d){return q(d)===o}function R(d){return q(d)===c}function T(d){return typeof d=="object"&&d!==null&&d.$$typeof===e}function v(d){return q(d)===l}function _(d){return q(d)===r}function w(d){return q(d)===y}function E(d){return q(d)===k}function C(d){return q(d)===n}function j(d){return q(d)===s}function $(d){return q(d)===i}function H(d){return q(d)===g}O.AsyncMode=h,O.ConcurrentMode=Y,O.ContextConsumer=N,O.ContextProvider=le,O.Element=Ve,O.ForwardRef=Ke,O.Fragment=ve,O.Lazy=Qe,O.Memo=Je,O.Portal=re,O.Profiler=Xe,O.StrictMode=V,O.Suspense=te,O.isAsyncMode=et,O.isConcurrentMode=f,O.isContextConsumer=m,O.isContextProvider=R,O.isElement=T,O.isForwardRef=v,O.isFragment=_,O.isLazy=w,O.isMemo=E,O.isPortal=C,O.isProfiler=j,O.isStrictMode=$,O.isSuspense=H,O.isValidElementType=L,O.typeOf=q}()),O}var ot;function at(){return ot||(ot=1,process.env.NODE_ENV==="production"?ue.exports=qt():ue.exports=Bt()),ue.exports}/*
|
|
16
|
+
object-assign
|
|
17
|
+
(c) Sindre Sorhus
|
|
18
|
+
@license MIT
|
|
19
|
+
*/var Te,lt;function Wt(){if(lt)return Te;lt=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var c={},o=0;o<10;o++)c["_"+String.fromCharCode(o)]=o;var u=Object.getOwnPropertyNames(c).map(function(l){return c[l]});if(u.join("")!=="0123456789")return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(l){a[l]=l}),Object.keys(Object.assign({},a)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Te=i()?Object.assign:function(s,c){for(var o,u=r(s),a,l=1;l<arguments.length;l++){o=Object(arguments[l]);for(var g in o)e.call(o,g)&&(u[g]=o[g]);if(t){a=t(o);for(var p=0;p<a.length;p++)n.call(o,a[p])&&(u[a[p]]=o[a[p]])}}return u},Te}var Ee,ct;function Re(){if(ct)return Ee;ct=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ee=t,Ee}var _e,ut;function pt(){return ut||(ut=1,_e=Function.call.bind(Object.prototype.hasOwnProperty)),_e}var Ce,ft;function Ut(){if(ft)return Ce;ft=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=Re(),n={},r=pt();t=function(s){var c="Warning: "+s;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}}}function i(s,c,o,u,a){if(process.env.NODE_ENV!=="production"){for(var l in s)if(r(s,l)){var g;try{if(typeof s[l]!="function"){var p=Error((u||"React class")+": "+o+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}g=s[l](c,l,u,o,null,e)}catch(y){g=y}if(g&&!(g instanceof Error)&&t((u||"React class")+": type specification of "+o+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof g+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),g instanceof Error&&!(g.message in n)){n[g.message]=!0;var k=a?a():"";t("Failed "+o+" type: "+g.message+(k??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Ce=i,Ce}var $e,ht;function Nt(){if(ht)return $e;ht=1;var t=at(),e=Wt(),n=Re(),r=pt(),i=Ut(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(o){var u="Warning: "+o;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function c(){return null}return $e=function(o,u){var a=typeof Symbol=="function"&&Symbol.iterator,l="@@iterator";function g(f){var m=f&&(a&&f[a]||f[l]);if(typeof m=="function")return m}var p="<<anonymous>>",k={array:M("array"),bigint:M("bigint"),bool:M("boolean"),func:M("function"),number:M("number"),object:M("object"),string:M("string"),symbol:M("symbol"),any:F(),arrayOf:L,element:q(),elementType:h(),instanceOf:Y,node:Ke(),objectOf:le,oneOf:N,oneOfType:Ve,shape:Qe,exact:Je};function y(f,m){return f===m?f!==0||1/f===1/m:f!==f&&m!==m}function x(f,m){this.message=f,this.data=m&&typeof m=="object"?m:{},this.stack=""}x.prototype=Error.prototype;function z(f){if(process.env.NODE_ENV!=="production")var m={},R=0;function T(_,w,E,C,j,$,H){if(C=C||p,$=$||E,H!==n){if(u){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var K=C+":"+E;!m[K]&&R<3&&(s("You are manually calling a React.PropTypes validation function for the `"+$+"` prop on `"+C+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),m[K]=!0,R++)}}return w[E]==null?_?w[E]===null?new x("The "+j+" `"+$+"` is marked as required "+("in `"+C+"`, but its value is `null`.")):new x("The "+j+" `"+$+"` is marked as required in "+("`"+C+"`, but its value is `undefined`.")):null:f(w,E,C,j,$)}var v=T.bind(null,!1);return v.isRequired=T.bind(null,!0),v}function M(f){function m(R,T,v,_,w,E){var C=R[T],j=V(C);if(j!==f){var $=te(C);return new x("Invalid "+_+" `"+w+"` of type "+("`"+$+"` supplied to `"+v+"`, expected ")+("`"+f+"`."),{expectedType:f})}return null}return z(m)}function F(){return z(c)}function L(f){function m(R,T,v,_,w){if(typeof f!="function")return new x("Property `"+w+"` of component `"+v+"` has invalid PropType notation inside arrayOf.");var E=R[T];if(!Array.isArray(E)){var C=V(E);return new x("Invalid "+_+" `"+w+"` of type "+("`"+C+"` supplied to `"+v+"`, expected an array."))}for(var j=0;j<E.length;j++){var $=f(E,j,v,_,w+"["+j+"]",n);if($ instanceof Error)return $}return null}return z(m)}function q(){function f(m,R,T,v,_){var w=m[R];if(!o(w)){var E=V(w);return new x("Invalid "+v+" `"+_+"` of type "+("`"+E+"` supplied to `"+T+"`, expected a single ReactElement."))}return null}return z(f)}function h(){function f(m,R,T,v,_){var w=m[R];if(!t.isValidElementType(w)){var E=V(w);return new x("Invalid "+v+" `"+_+"` of type "+("`"+E+"` supplied to `"+T+"`, expected a single ReactElement type."))}return null}return z(f)}function Y(f){function m(R,T,v,_,w){if(!(R[T]instanceof f)){var E=f.name||p,C=et(R[T]);return new x("Invalid "+_+" `"+w+"` of type "+("`"+C+"` supplied to `"+v+"`, expected ")+("instance of `"+E+"`."))}return null}return z(m)}function N(f){if(!Array.isArray(f))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),c;function m(R,T,v,_,w){for(var E=R[T],C=0;C<f.length;C++)if(y(E,f[C]))return null;var j=JSON.stringify(f,function(H,d){var K=te(d);return K==="symbol"?String(d):d});return new x("Invalid "+_+" `"+w+"` of value `"+String(E)+"` "+("supplied to `"+v+"`, expected one of "+j+"."))}return z(m)}function le(f){function m(R,T,v,_,w){if(typeof f!="function")return new x("Property `"+w+"` of component `"+v+"` has invalid PropType notation inside objectOf.");var E=R[T],C=V(E);if(C!=="object")return new x("Invalid "+_+" `"+w+"` of type "+("`"+C+"` supplied to `"+v+"`, expected an object."));for(var j in E)if(r(E,j)){var $=f(E,j,v,_,w+"."+j,n);if($ instanceof Error)return $}return null}return z(m)}function Ve(f){if(!Array.isArray(f))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),c;for(var m=0;m<f.length;m++){var R=f[m];if(typeof R!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ke(R)+" at index "+m+"."),c}function T(v,_,w,E,C){for(var j=[],$=0;$<f.length;$++){var H=f[$],d=H(v,_,w,E,C,n);if(d==null)return null;d.data&&r(d.data,"expectedType")&&j.push(d.data.expectedType)}var K=j.length>0?", expected one of type ["+j.join(", ")+"]":"";return new x("Invalid "+E+" `"+C+"` supplied to "+("`"+w+"`"+K+"."))}return z(T)}function Ke(){function f(m,R,T,v,_){return re(m[R])?null:new x("Invalid "+v+" `"+_+"` supplied to "+("`"+T+"`, expected a ReactNode."))}return z(f)}function ve(f,m,R,T,v){return new x((f||"React class")+": "+m+" type `"+R+"."+T+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+v+"`.")}function Qe(f){function m(R,T,v,_,w){var E=R[T],C=V(E);if(C!=="object")return new x("Invalid "+_+" `"+w+"` of type `"+C+"` "+("supplied to `"+v+"`, expected `object`."));for(var j in f){var $=f[j];if(typeof $!="function")return ve(v,_,w,j,te($));var H=$(E,j,v,_,w+"."+j,n);if(H)return H}return null}return z(m)}function Je(f){function m(R,T,v,_,w){var E=R[T],C=V(E);if(C!=="object")return new x("Invalid "+_+" `"+w+"` of type `"+C+"` "+("supplied to `"+v+"`, expected `object`."));var j=e({},R[T],f);for(var $ in j){var H=f[$];if(r(f,$)&&typeof H!="function")return ve(v,_,w,$,te(H));if(!H)return new x("Invalid "+_+" `"+w+"` key `"+$+"` supplied to `"+v+"`.\nBad object: "+JSON.stringify(R[T],null," ")+`
|
|
20
|
+
Valid keys: `+JSON.stringify(Object.keys(f),null," "));var d=H(E,$,v,_,w+"."+$,n);if(d)return d}return null}return z(m)}function re(f){switch(typeof f){case"number":case"string":case"undefined":return!0;case"boolean":return!f;case"object":if(Array.isArray(f))return f.every(re);if(f===null||o(f))return!0;var m=g(f);if(m){var R=m.call(f),T;if(m!==f.entries){for(;!(T=R.next()).done;)if(!re(T.value))return!1}else for(;!(T=R.next()).done;){var v=T.value;if(v&&!re(v[1]))return!1}}else return!1;return!0;default:return!1}}function Xe(f,m){return f==="symbol"?!0:m?m["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&m instanceof Symbol:!1}function V(f){var m=typeof f;return Array.isArray(f)?"array":f instanceof RegExp?"object":Xe(m,f)?"symbol":m}function te(f){if(typeof f>"u"||f===null)return""+f;var m=V(f);if(m==="object"){if(f instanceof Date)return"date";if(f instanceof RegExp)return"regexp"}return m}function ke(f){var m=te(f);switch(m){case"array":case"object":return"an "+m;case"boolean":case"date":case"regexp":return"a "+m;default:return m}}function et(f){return!f.constructor||!f.constructor.name?p:f.constructor.name}return k.checkPropTypes=i,k.resetWarningCache=i.resetWarningCache,k.PropTypes=k,k},$e}var Pe,dt;function Ht(){if(dt)return Pe;dt=1;var t=Re();function e(){}function n(){}return n.resetWarningCache=e,Pe=function(){function r(c,o,u,a,l,g){if(g!==t){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return s.PropTypes=s,s},Pe}if(process.env.NODE_ENV!=="production"){var Yt=at(),Zt=!0;Se.exports=Nt()(Yt.isElement,Zt)}else Se.exports=Ht()();var Ft=Se.exports;const Z=Mt(Ft);function Oe(){return Oe=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Oe.apply(this,arguments)}function Gt(t,e){if(t==null)return{};var n=Vt(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Vt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var pe=D.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=t.size,s=i===void 0?24:i,c=Gt(t,["color","size"]);return D.createElement("svg",Oe({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},c),D.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),D.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))});pe.propTypes={color:Z.string,size:Z.oneOfType([Z.string,Z.number])},pe.displayName="Copy";function Ae(){return Ae=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ae.apply(this,arguments)}function Kt(t,e){if(t==null)return{};var n=Qt(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Qt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var Ie=D.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=t.size,s=i===void 0?24:i,c=Kt(t,["color","size"]);return D.createElement("svg",Ae({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},c),D.createElement("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),D.createElement("polygon",{points:"22 2 15 22 11 13 2 9 22 2"}))});Ie.propTypes={color:Z.string,size:Z.oneOfType([Z.string,Z.number])},Ie.displayName="Send";function ze(){return ze=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ze.apply(this,arguments)}function Jt(t,e){if(t==null)return{};var n=Xt(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Xt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var Le=D.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=t.size,s=i===void 0?24:i,c=Jt(t,["color","size"]);return D.createElement("svg",ze({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},c),D.createElement("circle",{cx:"12",cy:"12",r:"3"}),D.createElement("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"}))});Le.propTypes={color:Z.string,size:Z.oneOfType([Z.string,Z.number])},Le.displayName="Settings";const je=[{label:"Korean",value:"KR",extra:"ko"},{label:"English",value:"US",extra:"en"},{label:"Japanese",value:"JP"},{label:"Simplified Chinese",value:"zh-CN",extra:"zh-chs"},{label:"Traditional Chinese (Taiwan)",value:"zh-TW"},{label:"Traditional Chinese (Hong Kong)",value:"zh-HK",extra:"zh-cht"},{label:"Vietnamese",value:"VN",extra:"vi"},{label:"Indonesian",value:"ID",extra:"id"}],en=({isGradient:t=!1,stroke:e=1.5,size:n=40})=>{const r="ai-gradient-"+Math.random().toString(36).substr(2,9);return b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",style:{flexShrink:0}},t&&b.createElement("defs",null,b.createElement("linearGradient",{id:r,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},b.createElement("stop",{offset:"0%",stopColor:"#9D50BB"},b.createElement("animate",{attributeName:"offset",values:"0%;0.4;0%",dur:"1s",repeatCount:"indefinite"})),b.createElement("stop",{offset:"30%",stopColor:"#6E48AA"},b.createElement("animate",{attributeName:"offset",values:"0.4;0.7;0.4",dur:"1s",repeatCount:"indefinite"})),b.createElement("stop",{offset:"50%",stopColor:"#4776E6"},b.createElement("animate",{attributeName:"offset",values:"0.5;0.7;0.5",dur:"1s",repeatCount:"indefinite"})),b.createElement("animateTransform",{attributeName:"gradientTransform",type:"translate",from:"0,0",to:"100,0",dur:"1s",repeatCount:"indefinite"}))),b.createElement("path",{fill:"none",stroke:t?`url(#${r})`:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:e,d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0zM20 3v4m2-2h-4M4 17v2m1-1H3"}))};async function tn(t,{setContent:e,setIsLoading:n,setConversationId:r,signer:i,baseUrl:s}){let c="";try{n(!0);const o={method:"POST",baseURL:s,url:"/nmail/chatdraft",params:t};let u={};i&&typeof i.generateHeaders=="function"&&(u=await i.generateHeaders(o));const a=await fetch(`${s}/nmail/chatdraft`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*",...u}});if(n(!1),!a.body)throw new Error("Response body is not available for streaming.");const l=a.body.getReader();let g="",p=0;for(;;){const{done:k,value:y}=await l.read();if(k)break;let x="",z="";try{const M=new TextDecoder().decode(y);g+=M;const F=/"answer":".*?"/g,L=/"conversation_id"\s*:\s*"([^"]+)"/,q=[...g.matchAll(F)],h=g.match(L);for(h&&h[1]&&r(h[1]);p<q.length;){const Y=q[p];try{x=Y[0];const N=x.slice(10,x.length-1);z=`"${N}"`,N.endsWith("\\")&&(z=`"${N}\\"`);const le=JSON.parse(z);c+=le,e(c)}catch(N){console.error("Parse error: ",N,x,z)}p++}}catch(M){console.error("TextDecoder error: ",M,x)}}return c}catch(o){console.error("Summary error:",o),e("")}finally{n(!1)}return""}function De(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var X=De();function gt(t){X=t}var ie={exec:()=>null};function A(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(i,s)=>{let c=typeof s=="string"?s:s.source;return c=c.replace(U.caret,"$1"),n=n.replace(i,c),r},getRegex:()=>new RegExp(n,e)};return r}var U={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},nn=/^(?:[ \t]*(?:\n|$))+/,rn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,sn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,se=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,on=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Me=/(?:[*+-]|\d{1,9}[.)])/,mt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,bt=A(mt).replace(/bull/g,Me).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),an=A(mt).replace(/bull/g,Me).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),qe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ln=/^[^\n]+/,Be=/(?!\s*\])(?:\\.|[^\[\]\\])+/,cn=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Be).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),un=A(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Me).getRegex(),fe="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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",We=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,pn=A("^ {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",We).replace("tag",fe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),yt=A(qe).replace("hr",se).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",fe).getRegex(),fn=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",yt).getRegex(),Ue={blockquote:fn,code:rn,def:cn,fences:sn,heading:on,hr:se,html:pn,lheading:bt,list:un,newline:nn,paragraph:yt,table:ie,text:ln},xt=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\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",fe).getRegex(),hn={...Ue,lheading:an,table:xt,paragraph:A(qe).replace("hr",se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",xt).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",fe).getRegex()},dn={...Ue,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",We).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:ie,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(qe).replace("hr",se).replace("heading",` *#{1,6} *[^
|
|
21
|
+
]`).replace("lheading",bt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},gn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,mn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,vt=/^( {2,}|\\)\n(?!\s*$)/,bn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,he=/[\p{P}\p{S}]/u,Ne=/[\s\p{P}\p{S}]/u,kt=/[^\s\p{P}\p{S}]/u,yn=A(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ne).getRegex(),wt=/(?!~)[\p{P}\p{S}]/u,xn=/(?!~)[\s\p{P}\p{S}]/u,vn=/(?:[^\s\p{P}\p{S}]|~)/u,kn=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,St=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,wn=A(St,"u").replace(/punct/g,he).getRegex(),Sn=A(St,"u").replace(/punct/g,wt).getRegex(),Tt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Tn=A(Tt,"gu").replace(/notPunctSpace/g,kt).replace(/punctSpace/g,Ne).replace(/punct/g,he).getRegex(),En=A(Tt,"gu").replace(/notPunctSpace/g,vn).replace(/punctSpace/g,xn).replace(/punct/g,wt).getRegex(),Rn=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,kt).replace(/punctSpace/g,Ne).replace(/punct/g,he).getRegex(),_n=A(/\\(punct)/,"gu").replace(/punct/g,he).getRegex(),Cn=A(/^<(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(),$n=A(We).replace("(?:-->|$)","-->").getRegex(),Pn=A("^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",$n).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),de=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,On=A(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",de).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Et=A(/^!?\[(label)\]\[(ref)\]/).replace("label",de).replace("ref",Be).getRegex(),Rt=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",Be).getRegex(),An=A("reflink|nolink(?!\\()","g").replace("reflink",Et).replace("nolink",Rt).getRegex(),He={_backpedal:ie,anyPunctuation:_n,autolink:Cn,blockSkip:kn,br:vt,code:mn,del:ie,emStrongLDelim:wn,emStrongRDelimAst:Tn,emStrongRDelimUnd:Rn,escape:gn,link:On,nolink:Rt,punctuation:yn,reflink:Et,reflinkSearch:An,tag:Pn,text:bn,url:ie},In={...He,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",de).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",de).getRegex()},Ye={...He,emStrongRDelimAst:En,emStrongLDelim:Sn,url:A(/^((?: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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},zn={...Ye,br:A(vt).replace("{2,}","*").getRegex(),text:A(Ye.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ge={normal:Ue,gfm:hn,pedantic:dn},oe={normal:He,gfm:Ye,breaks:zn,pedantic:In},Ln={"&":"&","<":"<",">":">",'"':""","'":"'"},_t=t=>Ln[t];function G(t,e){if(e){if(U.escapeTest.test(t))return t.replace(U.escapeReplace,_t)}else if(U.escapeTestNoEncode.test(t))return t.replace(U.escapeReplaceNoEncode,_t);return t}function Ct(t){try{t=encodeURI(t).replace(U.percentDecode,"%")}catch{return null}return t}function $t(t,e){var s;const n=t.replace(U.findPipe,(c,o,u)=>{let a=!1,l=o;for(;--l>=0&&u[l]==="\\";)a=!a;return a?"|":" |"}),r=n.split(U.splitPipe);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!((s=r.at(-1))!=null&&s.trim())&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(U.slashPipe,"|");return r}function ae(t,e,n){const r=t.length;if(r===0)return"";let i=0;for(;i<r&&t.charAt(r-i-1)===e;)i++;return t.slice(0,r-i)}function jn(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function Pt(t,e,n,r,i){const s=e.href,c=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;const u={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:c,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,u}function Dn(t,e,n){const r=t.match(n.other.indentCodeCompensation);if(r===null)return e;const i=r[1];return e.split(`
|
|
22
|
+
`).map(s=>{const c=s.match(n.other.beginningSpace);if(c===null)return s;const[o]=c;return o.length>=i.length?s.slice(i.length):s}).join(`
|
|
23
|
+
`)}var me=class{constructor(t){S(this,"options");S(this,"rules");S(this,"lexer");this.options=t||X}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ae(n,`
|
|
24
|
+
`)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],r=Dn(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){const r=ae(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:ae(e[0],`
|
|
25
|
+
`)}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let n=ae(e[0],`
|
|
26
|
+
`).split(`
|
|
27
|
+
`),r="",i="";const s=[];for(;n.length>0;){let c=!1;const o=[];let u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))o.push(n[u]),c=!0;else if(!c)o.push(n[u]);else break;n=n.slice(u);const a=o.join(`
|
|
28
|
+
`),l=a.replace(this.rules.other.blockquoteSetextReplace,`
|
|
29
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
30
|
+
${a}`:a,i=i?`${i}
|
|
31
|
+
${l}`:l;const g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,s,!0),this.lexer.state.top=g,n.length===0)break;const p=s.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){const k=p,y=k.raw+`
|
|
32
|
+
`+n.join(`
|
|
33
|
+
`),x=this.blockquote(y);s[s.length-1]=x,r=r.substring(0,r.length-k.raw.length)+x.raw,i=i.substring(0,i.length-k.text.length)+x.text;break}else if((p==null?void 0:p.type)==="list"){const k=p,y=k.raw+`
|
|
34
|
+
`+n.join(`
|
|
35
|
+
`),x=this.list(y);s[s.length-1]=x,r=r.substring(0,r.length-p.raw.length)+x.raw,i=i.substring(0,i.length-k.raw.length)+x.raw,n=y.substring(s.at(-1).raw.length).split(`
|
|
36
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[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 s=this.rules.other.listItemRegex(n);let c=!1;for(;t;){let u=!1,a="",l="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;a=e[0],t=t.substring(a.length);let g=e[2].split(`
|
|
37
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,M=>" ".repeat(3*M.length)),p=t.split(`
|
|
38
|
+
`,1)[0],k=!g.trim(),y=0;if(this.options.pedantic?(y=2,l=g.trimStart()):k?y=e[1].length+1:(y=e[2].search(this.rules.other.nonSpaceChar),y=y>4?1:y,l=g.slice(y),y+=e[1].length),k&&this.rules.other.blankLine.test(p)&&(a+=p+`
|
|
39
|
+
`,t=t.substring(p.length+1),u=!0),!u){const M=this.rules.other.nextBulletRegex(y),F=this.rules.other.hrRegex(y),L=this.rules.other.fencesBeginRegex(y),q=this.rules.other.headingBeginRegex(y),h=this.rules.other.htmlBeginRegex(y);for(;t;){const Y=t.split(`
|
|
40
|
+
`,1)[0];let N;if(p=Y,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),N=p):N=p.replace(this.rules.other.tabCharGlobal," "),L.test(p)||q.test(p)||h.test(p)||M.test(p)||F.test(p))break;if(N.search(this.rules.other.nonSpaceChar)>=y||!p.trim())l+=`
|
|
41
|
+
`+N.slice(y);else{if(k||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||L.test(g)||q.test(g)||F.test(g))break;l+=`
|
|
42
|
+
`+p}!k&&!p.trim()&&(k=!0),a+=Y+`
|
|
43
|
+
`,t=t.substring(Y.length+1),g=N.slice(y)}}i.loose||(c?i.loose=!0:this.rules.other.doubleBlankLine.test(a)&&(c=!0));let x=null,z;this.options.gfm&&(x=this.rules.other.listIsTask.exec(l),x&&(z=x[0]!=="[ ] ",l=l.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:a,task:!!x,checked:z,loose:!1,text:l,tokens:[]}),i.raw+=a}const o=i.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let u=0;u<i.items.length;u++)if(this.lexer.state.top=!1,i.items[u].tokens=this.lexer.blockTokens(i.items[u].text,[]),!i.loose){const a=i.items[u].tokens.filter(g=>g.type==="space"),l=a.length>0&&a.some(g=>this.rules.other.anyLine.test(g.raw));i.loose=l}if(i.loose)for(let u=0;u<i.items.length;u++)i.items[u].loose=!0;return i}}html(t){const e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){const e=this.rules.block.def.exec(t);if(e){const n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:i}}}table(t){var c;const e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const n=$t(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(c=e[3])!=null&&c.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
44
|
+
`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const o of r)this.rules.other.tableAlignRight.test(o)?s.align.push("right"):this.rules.other.tableAlignCenter.test(o)?s.align.push("center"):this.rules.other.tableAlignLeft.test(o)?s.align.push("left"):s.align.push(null);for(let o=0;o<n.length;o++)s.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:s.align[o]});for(const o of i)s.rows.push($t(o,s.header.length).map((u,a)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[a]})));return s}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const n=e[1].charAt(e[1].length-1)===`
|
|
45
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const s=ae(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=jn(e[2],"()");if(s===-2)return;if(s>-1){const o=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){const s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Pt(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[r.toLowerCase()];if(!i){const s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return Pt(n,i,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const s=[...r[0]].length-1;let c,o,u=s,a=0;const l=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,e=e.slice(-1*t.length+s);(r=l.exec(e))!=null;){if(c=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!c)continue;if(o=[...c].length,r[3]||r[4]){u+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){a+=o;continue}if(u-=o,u>0)continue;o=Math.min(o,o+u+a);const g=[...r[0]][0].length,p=t.slice(0,s+r.index+g+o);if(Math.min(s,o)%2){const y=p.slice(1,-1);return{type:"em",raw:p,text:y,tokens:this.lexer.inlineTokens(y)}}const k=p.slice(2,-2);return{type:"strong",raw:p,text:k,tokens:this.lexer.inlineTokens(k)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let e;if(e=this.rules.inline.url.exec(t)){let r,i;if(e[2]==="@")r=e[0],i="mailto:"+r;else{let s;do s=e[0],e[0]=((n=this.rules.inline._backpedal.exec(e[0]))==null?void 0:n[0])??"";while(s!==e[0]);r=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},Q=class tt{constructor(e){S(this,"tokens");S(this,"options");S(this,"state");S(this,"tokenizer");S(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||X,this.options.tokenizer=this.options.tokenizer||new me,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={other:U,block:ge.normal,inline:oe.normal};this.options.pedantic?(n.block=ge.pedantic,n.inline=oe.pedantic):this.options.gfm&&(n.block=ge.gfm,this.options.breaks?n.inline=oe.breaks:n.inline=oe.gfm),this.tokenizer.rules=n}static get rules(){return{block:ge,inline:oe}}static lex(e,n){return new tt(n).lex(e)}static lexInline(e,n){return new tt(n).inlineTokens(e)}lex(e){e=e.replace(U.carriageReturn,`
|
|
46
|
+
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){var i,s,c;for(this.options.pedantic&&(e=e.replace(U.tabCharGlobal," ").replace(U.spaceLine,""));e;){let o;if((s=(i=this.options.extensions)==null?void 0:i.block)!=null&&s.some(a=>(o=a.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);const a=n.at(-1);o.raw.length===1&&a!==void 0?a.raw+=`
|
|
47
|
+
`:n.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);const a=n.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
|
|
48
|
+
`+o.raw,a.text+=`
|
|
49
|
+
`+o.text,this.inlineQueue.at(-1).src=a.text):n.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);const a=n.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
|
|
50
|
+
`+o.raw,a.text+=`
|
|
51
|
+
`+o.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),n.push(o);continue}let u=e;if((c=this.options.extensions)!=null&&c.startBlock){let a=1/0;const l=e.slice(1);let g;this.options.extensions.startBlock.forEach(p=>{g=p.call({lexer:this},l),typeof g=="number"&&g>=0&&(a=Math.min(a,g))}),a<1/0&&a>=0&&(u=e.substring(0,a+1))}if(this.state.top&&(o=this.tokenizer.paragraph(u))){const a=n.at(-1);r&&(a==null?void 0:a.type)==="paragraph"?(a.raw+=`
|
|
52
|
+
`+o.raw,a.text+=`
|
|
53
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(o),r=u.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);const a=n.at(-1);(a==null?void 0:a.type)==="text"?(a.raw+=`
|
|
54
|
+
`+o.raw,a.text+=`
|
|
55
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(o);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){var o,u,a;let r=e,i=null;if(this.tokens.links){const l=Object.keys(this.tokens.links);if(l.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)l.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,c="";for(;e;){s||(c=""),s=!1;let l;if((u=(o=this.options.extensions)==null?void 0:o.inline)!=null&&u.some(p=>(l=p.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);const p=n.at(-1);l.type==="text"&&(p==null?void 0:p.type)==="text"?(p.raw+=l.raw,p.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(e,r,c)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),n.push(l);continue}let g=e;if((a=this.options.extensions)!=null&&a.startInline){let p=1/0;const k=e.slice(1);let y;this.options.extensions.startInline.forEach(x=>{y=x.call({lexer:this},k),typeof y=="number"&&y>=0&&(p=Math.min(p,y))}),p<1/0&&p>=0&&(g=e.substring(0,p+1))}if(l=this.tokenizer.inlineText(g)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(c=l.raw.slice(-1)),s=!0;const p=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=l.raw,p.text+=l.text):n.push(l);continue}if(e){const p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return n}},be=class{constructor(t){S(this,"options");S(this,"parser");this.options=t||X}space(t){return""}code({text:t,lang:e,escaped:n}){var s;const r=(s=(e||"").match(U.notSpaceStart))==null?void 0:s[0],i=t.replace(U.endingNewline,"")+`
|
|
56
|
+
`;return r?'<pre><code class="language-'+G(r)+'">'+(n?i:G(i,!0))+`</code></pre>
|
|
57
|
+
`:"<pre><code>"+(n?i:G(i,!0))+`</code></pre>
|
|
58
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
59
|
+
${this.parser.parse(t)}</blockquote>
|
|
60
|
+
`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
61
|
+
`}hr(t){return`<hr>
|
|
62
|
+
`}list(t){const e=t.ordered,n=t.start;let r="";for(let c=0;c<t.items.length;c++){const o=t.items[c];r+=this.listitem(o)}const i=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
|
|
63
|
+
`+r+"</"+i+`>
|
|
64
|
+
`}listitem(t){var n;let e="";if(t.task){const r=this.checkbox({checked:!!t.checked});t.loose?((n=t.tokens[0])==null?void 0:n.type)==="paragraph"?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=r+" "+G(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
|
|
65
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
66
|
+
`}table(t){let e="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let r="";for(let i=0;i<t.rows.length;i++){const s=t.rows[i];n="";for(let c=0;c<s.length;c++)n+=this.tablecell(s[c]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
67
|
+
<thead>
|
|
68
|
+
`+e+`</thead>
|
|
69
|
+
`+r+`</table>
|
|
70
|
+
`}tablerow({text:t}){return`<tr>
|
|
71
|
+
${t}</tr>
|
|
72
|
+
`}tablecell(t){const e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
73
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${G(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){const r=this.parser.parseInline(n),i=Ct(t);if(i===null)return r;t=i;let s='<a href="'+t+'"';return e&&(s+=' title="'+G(e)+'"'),s+=">"+r+"</a>",s}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const i=Ct(t);if(i===null)return G(n);t=i;let s=`<img src="${t}" alt="${n}"`;return e&&(s+=` title="${G(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:G(t.text)}},Ze=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},J=class nt{constructor(e){S(this,"options");S(this,"renderer");S(this,"textRenderer");this.options=e||X,this.options.renderer=this.options.renderer||new be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ze}static parse(e,n){return new nt(n).parse(e)}static parseInline(e,n){return new nt(n).parseInline(e)}parse(e,n=!0){var i,s;let r="";for(let c=0;c<e.length;c++){const o=e[c];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[o.type]){const a=o,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=l||"";continue}}const u=o;switch(u.type){case"space":{r+=this.renderer.space(u);continue}case"hr":{r+=this.renderer.hr(u);continue}case"heading":{r+=this.renderer.heading(u);continue}case"code":{r+=this.renderer.code(u);continue}case"table":{r+=this.renderer.table(u);continue}case"blockquote":{r+=this.renderer.blockquote(u);continue}case"list":{r+=this.renderer.list(u);continue}case"html":{r+=this.renderer.html(u);continue}case"paragraph":{r+=this.renderer.paragraph(u);continue}case"text":{let a=u,l=this.renderer.text(a);for(;c+1<e.length&&e[c+1].type==="text";)a=e[++c],l+=`
|
|
74
|
+
`+this.renderer.text(a);n?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):r+=l;continue}default:{const a='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,n=this.renderer){var i,s;let r="";for(let c=0;c<e.length;c++){const o=e[c];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[o.type]){const a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){r+=a||"";continue}}const u=o;switch(u.type){case"escape":{r+=n.text(u);break}case"html":{r+=n.html(u);break}case"link":{r+=n.link(u);break}case"image":{r+=n.image(u);break}case"strong":{r+=n.strong(u);break}case"em":{r+=n.em(u);break}case"codespan":{r+=n.codespan(u);break}case"br":{r+=n.br(u);break}case"del":{r+=n.del(u);break}case"text":{r+=n.text(u);break}default:{const a='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},ye=(Ge=class{constructor(t){S(this,"options");S(this,"block");this.options=t||X}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Q.lex:Q.lexInline}provideParser(){return this.block?J.parse:J.parseInline}},S(Ge,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Ge),Mn=class{constructor(...t){S(this,"defaults",De());S(this,"options",this.setOptions);S(this,"parse",this.parseMarkdown(!0));S(this,"parseInline",this.parseMarkdown(!1));S(this,"Parser",J);S(this,"Renderer",be);S(this,"TextRenderer",Ze);S(this,"Lexer",Q);S(this,"Tokenizer",me);S(this,"Hooks",ye);this.use(...t)}walkTokens(t,e){var r,i;let n=[];for(const s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{const c=s;for(const o of c.header)n=n.concat(this.walkTokens(o.tokens,e));for(const o of c.rows)for(const u of o)n=n.concat(this.walkTokens(u.tokens,e));break}case"list":{const c=s;n=n.concat(this.walkTokens(c.items,e));break}default:{const c=s;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[c.type]?this.defaults.extensions.childTokens[c.type].forEach(o=>{const u=c[o].flat(1/0);n=n.concat(this.walkTokens(u,e))}):c.tokens&&(n=n.concat(this.walkTokens(c.tokens,e)))}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const s=e.renderers[i.name];s?e.renderers[i.name]=function(...c){let o=i.renderer.apply(this,c);return o===!1&&(o=s.apply(this,c)),o}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=e[i.level];s?s.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),r.extensions=e),n.renderer){const i=this.defaults.renderer||new be(this.defaults);for(const s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;const c=s,o=n.renderer[c],u=i[c];i[c]=(...a)=>{let l=o.apply(i,a);return l===!1&&(l=u.apply(i,a)),l||""}}r.renderer=i}if(n.tokenizer){const i=this.defaults.tokenizer||new me(this.defaults);for(const s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const c=s,o=n.tokenizer[c],u=i[c];i[c]=(...a)=>{let l=o.apply(i,a);return l===!1&&(l=u.apply(i,a)),l}}r.tokenizer=i}if(n.hooks){const i=this.defaults.hooks||new ye;for(const s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;const c=s,o=n.hooks[c],u=i[c];ye.passThroughHooks.has(s)?i[c]=a=>{if(this.defaults.async)return Promise.resolve(o.call(i,a)).then(g=>u.call(i,g));const l=o.call(i,a);return u.call(i,l)}:i[c]=(...a)=>{let l=o.apply(i,a);return l===!1&&(l=u.apply(i,a)),l}}r.hooks=i}if(n.walkTokens){const i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(c){let o=[];return o.push(s.call(this,c)),i&&(o=o.concat(i.call(this,c))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Q.lex(t,e??this.defaults)}parser(t,e){return J.parse(t,e??this.defaults)}parseMarkdown(t){return(n,r)=>{const i={...r},s={...this.defaults,...i},c=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return c(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return c(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=t);const o=s.hooks?s.hooks.provideLexer():t?Q.lex:Q.lexInline,u=s.hooks?s.hooks.provideParser():t?J.parse:J.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(a=>o(a,s)).then(a=>s.hooks?s.hooks.processAllTokens(a):a).then(a=>s.walkTokens?Promise.all(this.walkTokens(a,s.walkTokens)).then(()=>a):a).then(a=>u(a,s)).then(a=>s.hooks?s.hooks.postprocess(a):a).catch(c);try{s.hooks&&(n=s.hooks.preprocess(n));let a=o(n,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let l=u(a,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(a){return c(a)}}}onError(t,e){return n=>{if(n.message+=`
|
|
75
|
+
Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An error occurred:</p><pre>"+G(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},ee=new Mn;function I(t,e){return ee.parse(t,e)}I.options=I.setOptions=function(t){return ee.setOptions(t),I.defaults=ee.defaults,gt(I.defaults),I},I.getDefaults=De,I.defaults=X,I.use=function(...t){return ee.use(...t),I.defaults=ee.defaults,gt(I.defaults),I},I.walkTokens=function(t,e){return ee.walkTokens(t,e)},I.parseInline=ee.parseInline,I.Parser=J,I.parser=J.parse,I.Renderer=be,I.TextRenderer=Ze,I.Lexer=Q,I.lexer=Q.lex,I.Tokenizer=me,I.Hooks=ye,I.parse=I,I.options,I.setOptions,I.use,I.walkTokens,I.parseInline,J.parse,Q.lex;const Ot=({data:t,style:e})=>b.createElement("div",{style:{maxWidth:"80%",...e}},t&&t.subject?b.createElement("div",{dangerouslySetInnerHTML:{__html:I.parse(t.body,{async:!1})}}):b.createElement("p",{style:{margin:0,whiteSpace:"pre-wrap"}},t?t.question:"")),qn=({items:t,onApply:e,getEditorContent:n})=>{const r=async i=>{const s=/제목:[^\n]*/g;((s.exec(i)||[])[0]||"").replace("제목: ","").replace(`
|
|
76
|
+
`,"");const o=i.replace(s,"").replace("본문: ","");let u=await I.parse(o);const a=/<!--HanbiroSignatureStart-->([\s\S]*?)<!--HanbiroSignatureEnd-->/g,l=n?n():"",g=a.exec(l)||[];g[0]&&(u=u+"<br>"+g[0]),e({html:u})};return b.createElement("div",{style:{flex:1,minHeight:0,position:"relative",overflowY:"auto",paddingRight:16,marginRight:-16,marginBottom:8,display:"flex",flexDirection:"column"}},t&&t.map(i=>b.createElement("div",{key:i.id,style:{display:"flex",flexDirection:"column",marginBottom:16}},b.createElement("div",{style:{width:"100%",display:"flex",alignItems:"flex-end",flexDirection:"column",position:"relative",marginTop:8}},b.createElement(Ot,{data:{question:i.question},style:{borderRadius:8,borderTopRightRadius:0,padding:"8px 12px",background:"var(--background-softGrey)"}})),b.createElement("div",{style:{width:"100%",display:"flex",alignItems:"flex-start",flexDirection:"column",position:"relative",marginTop:8}},i.isLoading?b.createElement("div",{style:{marginTop:8,fontStyle:"italic",color:"var(--text-secondary)"}},"Loading..."):b.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"flex-end",width:"100%"}},b.createElement(Ot,{data:{subject:i.subject,body:i.body},style:{background:"var(--background-softGrey)",borderRadius:8,borderTopLeftRadius:0,padding:"8px 12px",flexShrink:0}}),b.createElement("button",{type:"button",title:"Apply content",onClick:()=>r(i.body),style:{marginLeft:4,background:"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:8,borderRadius:4}},b.createElement(pe,{size:16,color:"#666"})))))))};class Bn extends b.Component{constructor(n){super(n);S(this,"containerRef");S(this,"handleClickOutside",n=>{this.containerRef.current&&!this.containerRef.current.contains(n.target)&&this.setState({open:!1})});S(this,"togglePopper",()=>{this.setState(n=>({open:!n.open}))});S(this,"handleLangChange",n=>{const r=je.find(i=>i.value===n.target.value);this.props.setLang(r||null)});this.state={open:!1},this.containerRef=b.createRef()}componentDidMount(){document.addEventListener("mousedown",this.handleClickOutside)}componentWillUnmount(){document.removeEventListener("mousedown",this.handleClickOutside)}render(){const{lang:n,originalEmail:r,setOriginalEmail:i,getEditorContent:s}=this.props,{open:c}=this.state;return b.createElement("div",{ref:this.containerRef,style:{position:"relative",display:"inline-block"}},b.createElement("button",{type:"button",onClick:this.togglePopper,className:"icon-button small"},b.createElement(Le,{size:16})),c&&b.createElement("div",{style:{position:"absolute",bottom:"100%",left:0,zIndex:1051,background:"#fff",border:"1px solid #ddd",boxShadow:"0px 4px 12px rgba(0, 0, 0, 0.1)",borderRadius:8,padding:16,width:320,marginBottom:8}},b.createElement("div",{style:{display:"flex",flexDirection:"column",gap:12}},b.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4}},b.createElement("span",{style:{fontSize:12,fontWeight:500,color:"var(--text-secondary)"}},"Language"),b.createElement("select",{value:n?n.value:"",onChange:this.handleLangChange,style:{padding:"6px 8px",borderRadius:4,border:"1px solid #ccc",fontSize:14}},b.createElement("option",{value:"",disabled:!0},"Select Language"),je.map(o=>b.createElement("option",{key:o.value,value:o.value},o.label)))),b.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4}},b.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},b.createElement("span",{style:{fontSize:12,fontWeight:500,color:"var(--text-secondary)"}},"AI Context"),s&&b.createElement("button",{type:"button",title:"Copy from origin email",onClick:()=>{const o=s();i(o)},className:"icon-button"},b.createElement(pe,null))),b.createElement("textarea",{value:r,onChange:o=>i(o.target.value),style:{width:"100%",height:120,resize:"vertical",padding:8,border:"1px solid #ccc",borderRadius:4,fontSize:13,fontFamily:"inherit",boxSizing:"border-box"}})))))}}class Wn extends b.Component{constructor(n){super(n);S(this,"setAiContext",n=>{this.setState({originalEmail:n})});S(this,"handleMessageChange",n=>{this.setState({message:n.target.value})});S(this,"handleSubmit",async()=>{const{message:n,messages:r,lang:i,originalEmail:s,conversationId:c}=this.state,{signer:o,baseUrl:u=""}=this.props;if(!n.trim())return;const a=Dt();let l={id:a,question:n,subject:"",body:"",created_at:new Date().getTime(),isLoading:!0};const g=[...r,l];this.setState({messages:g,message:"",isSending:!0});const p={query:n,default_language:i?i.value:"KR",original_email:s,debug_grpc:!0};c&&(p.conversation_id=c),await tn(p,{setContent:z=>{this.setState(M=>({messages:M.messages.map(L=>L.id===a?{...L,subject:"Some thing not used",body:z,isLoading:!1,created_at:new Date().getTime()}:L)}))},setIsLoading:z=>{this.setState(M=>({messages:M.messages.map(L=>L.id===a?{...L,isLoading:z}:L)}))},setConversationId:z=>{this.setState({conversationId:z})},signer:o,baseUrl:u}),this.setState({isSending:!1})});S(this,"handleKeyDown",n=>{!n.shiftKey&&n.key==="Enter"&&!this.state.isSending&&(n.preventDefault(),this.handleSubmit())});S(this,"setLang",n=>{this.setState({lang:n})});S(this,"setOriginalEmail",n=>{this.setState({originalEmail:n})});this.state={message:"",messages:[],isSending:!1,lang:je[0],conversationId:"",originalEmail:""}}render(){const{onApply:n,getEditorContent:r}=this.props,{message:i,messages:s,isSending:c,lang:o,originalEmail:u}=this.state;return b.createElement("div",{style:{display:"flex",height:"100%",padding:16,flexDirection:"column",background:"#fff",fontFamily:"inherit",boxSizing:"border-box"}},s.length>0?b.createElement(qn,{items:s,onApply:n,getEditorContent:r}):b.createElement("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"var(--grey-light)"}},b.createElement(en,{size:46}),b.createElement("h2",{style:{marginTop:16,fontWeight:600,color:"inherit",fontSize:18}},"Build with Agent")),b.createElement("div",{style:{width:"100%",border:"1px solid #ddd",borderRadius:4,background:c?"var(--background-lightGrey)":"#fff",display:"flex",flexDirection:"column"}},b.createElement("textarea",{value:i,onChange:this.handleMessageChange,placeholder:"Describe your email",name:"ai-content",onKeyDown:this.handleKeyDown,disabled:c,style:{flex:1,minWidth:0,borderRadius:4,padding:12,fontSize:13,border:"none",resize:"none",outline:"none",minHeight:60,fontFamily:"inherit"}}),b.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"8px",boxSizing:"border-box"}},b.createElement(Bn,{lang:o,setLang:this.setLang,originalEmail:u,setOriginalEmail:this.setOriginalEmail,getEditorContent:r}),b.createElement("button",{disabled:!i.trim()||c,onClick:this.handleSubmit,className:"icon-button",color:"primary"},b.createElement(Ie,null)))))}}const xe={baseUrl:"V3",signer:null},Un=({baseUrl:t,signer:e})=>{xe.baseUrl=t,xe.signer=e},Fe=(()=>{const t=window.location,{hostname:e}=t;return e==="localhost"||e==="127.0.0.1"})(),At=()=>{var n;let t=window.location;const{host:e}=t;if(Fe){const r=(n=xe.baseUrl)==null?void 0:n.split("/");return r?"https://"+(r==null?void 0:r[2]):"https://vndev.hanbiro.com"}else{const r=localStorage.getItem("host")||e,i=r==null?void 0:r.split("/");return"https://"+(i==null?void 0:i[0])}},Nn=()=>{let t=window.location;if(Fe)return At()||"https://vndev.hanbiro.com/ngw";{window.location!==window.parent.location&&(t=window.parent.location);const{hostname:e,protocol:n}=t;return[n,"//",e,"/ngw"].join("")}};B.ChatAIDraft=Wn,B.SDKConfig=xe,B.getBaseUrl=At,B.getGroupwareUrl=Nn,B.initHanbiroReactSDK=Un,B.isDevelopment=Fe,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hanbiro-react16-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "React 16.2.0 compatible UI components for Hanbiro",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
|
-
"main": "./dist/
|
|
6
|
+
"main": "./dist/hanbiro-react16-sdk.umd.js",
|
|
7
|
+
"module": "./dist/hanbiro-react16-sdk.es.js",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
9
10
|
"types": "./dist/index.d.ts",
|
|
10
|
-
"import": "./dist/
|
|
11
|
-
"require": "./dist/
|
|
11
|
+
"import": "./dist/hanbiro-react16-sdk.es.js",
|
|
12
|
+
"require": "./dist/hanbiro-react16-sdk.umd.js"
|
|
12
13
|
},
|
|
13
14
|
"./components": {
|
|
14
15
|
"types": "./dist/components/index.d.ts",
|
|
15
|
-
"import": "./dist/
|
|
16
|
-
"require": "./dist/
|
|
16
|
+
"import": "./dist/hanbiro-react16-sdk.es.js",
|
|
17
|
+
"require": "./dist/hanbiro-react16-sdk.umd.js"
|
|
17
18
|
},
|
|
18
19
|
"./utils": {
|
|
19
20
|
"types": "./dist/utils/index.d.ts",
|
|
20
|
-
"import": "./dist/
|
|
21
|
-
"require": "./dist/
|
|
21
|
+
"import": "./dist/hanbiro-react16-sdk.es.js",
|
|
22
|
+
"require": "./dist/hanbiro-react16-sdk.umd.js"
|
|
22
23
|
},
|
|
23
24
|
"./constants": {
|
|
24
25
|
"types": "./dist/constants/index.d.ts",
|
|
25
|
-
"import": "./dist/
|
|
26
|
-
"require": "./dist/
|
|
26
|
+
"import": "./dist/hanbiro-react16-sdk.es.js",
|
|
27
|
+
"require": "./dist/hanbiro-react16-sdk.umd.js"
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
30
|
"typesVersions": {
|
|
30
31
|
"*": {
|
|
31
32
|
"components": [
|
|
32
|
-
"./dist/components.d.ts"
|
|
33
|
+
"./dist/components/index.d.ts"
|
|
33
34
|
],
|
|
34
35
|
"utils": [
|
|
35
|
-
"./dist/utils.d.ts"
|
|
36
|
+
"./dist/utils/index.d.ts"
|
|
36
37
|
],
|
|
37
38
|
"constants": [
|
|
38
|
-
"./dist/constants.d.ts"
|
|
39
|
+
"./dist/constants/index.d.ts"
|
|
39
40
|
]
|
|
40
41
|
}
|
|
41
42
|
},
|
package/dist/components/index.js
DELETED
package/dist/components.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/index'
|
package/dist/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { C as t } from "./index-DWGdUH7T.mjs";
|
|
2
|
-
import { SDKConfig as a, getBaseUrl as i, getGroupwareUrl as f, initHanbiroReactSDK as n, isDevelopment as p } from "./utils.js";
|
|
3
|
-
export {
|
|
4
|
-
t as ChatAIDraft,
|
|
5
|
-
a as SDKConfig,
|
|
6
|
-
i as getBaseUrl,
|
|
7
|
-
f as getGroupwareUrl,
|
|
8
|
-
n as initHanbiroReactSDK,
|
|
9
|
-
p as isDevelopment
|
|
10
|
-
};
|
package/dist/utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './utils/index'
|
package/dist/utils.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
const i = {
|
|
2
|
-
baseUrl: "V3",
|
|
3
|
-
signer: null
|
|
4
|
-
}, a = ({ baseUrl: o, signer: t }) => {
|
|
5
|
-
i.baseUrl = o, i.signer = t;
|
|
6
|
-
}, c = () => {
|
|
7
|
-
const o = window.location, { hostname: t } = o;
|
|
8
|
-
return t === "localhost" || t === "127.0.0.1";
|
|
9
|
-
}, l = c(), r = () => {
|
|
10
|
-
var e;
|
|
11
|
-
let o = window.location;
|
|
12
|
-
const { host: t } = o;
|
|
13
|
-
if (l) {
|
|
14
|
-
const n = (e = i.baseUrl) == null ? void 0 : e.split("/");
|
|
15
|
-
return n ? "https://" + (n == null ? void 0 : n[2]) : "https://vndev.hanbiro.com";
|
|
16
|
-
} else {
|
|
17
|
-
const n = localStorage.getItem("host") || t, s = n == null ? void 0 : n.split("/");
|
|
18
|
-
return "https://" + (s == null ? void 0 : s[0]);
|
|
19
|
-
}
|
|
20
|
-
}, w = () => {
|
|
21
|
-
let o = window.location;
|
|
22
|
-
if (l)
|
|
23
|
-
return r() || "https://vndev.hanbiro.com/ngw";
|
|
24
|
-
{
|
|
25
|
-
window.location !== window.parent.location && (o = window.parent.location);
|
|
26
|
-
const { hostname: t, protocol: e } = o;
|
|
27
|
-
return [e, "//", t, "/ngw"].join("");
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
export {
|
|
31
|
-
i as SDKConfig,
|
|
32
|
-
r as getBaseUrl,
|
|
33
|
-
w as getGroupwareUrl,
|
|
34
|
-
a as initHanbiroReactSDK,
|
|
35
|
-
l as isDevelopment
|
|
36
|
-
};
|