diff --git a/dist/cjs/index.js b/dist/cjs/index.js index 767813ee..8ad03278 100644 --- a/dist/cjs/index.js +++ b/dist/cjs/index.js @@ -116,5 +116,5 @@ object-assign * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function y(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:var p=e.type;switch(p){case l:case c:case i:case o:case r:case d:return p;default:var m=p&&p.$$typeof;switch(m){case a:case u:case g:case f:case s:return m;default:return h}}case n:return h}}}var w=l,C=c,x=a,S=s,E=t,A=u,R=i,I=g,k=f,$=n,_=o,L=r,T=d,M=!1;function O(e){return y(e)===c}sl.AsyncMode=w,sl.ConcurrentMode=C,sl.ContextConsumer=x,sl.ContextProvider=S,sl.Element=E,sl.ForwardRef=A,sl.Fragment=R,sl.Lazy=I,sl.Memo=k,sl.Portal=$,sl.Profiler=_,sl.StrictMode=L,sl.Suspense=T,sl.isAsyncMode=function(e){return M||(M=!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.")),O(e)||y(e)===l},sl.isConcurrentMode=O,sl.isContextConsumer=function(e){return y(e)===a},sl.isContextProvider=function(e){return y(e)===s},sl.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},sl.isForwardRef=function(e){return y(e)===u},sl.isFragment=function(e){return y(e)===i},sl.isLazy=function(e){return y(e)===g},sl.isMemo=function(e){return y(e)===f},sl.isPortal=function(e){return y(e)===n},sl.isProfiler=function(e){return y(e)===o},sl.isStrictMode=function(e){return y(e)===r},sl.isSuspense=function(e){return y(e)===d},sl.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===c||e===o||e===r||e===d||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===f||e.$$typeof===s||e.$$typeof===a||e.$$typeof===u||e.$$typeof===m||e.$$typeof===v||e.$$typeof===b||e.$$typeof===p)},sl.typeOf=y}(),"production"===process.env.NODE_ENV?Fa.exports=Pa:Fa.exports=sl;var al=Fa.exports,ll={};ll[al.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ll[al.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};var cl="undefined"!=typeof document;function ul(e,t,n){var i="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):i+=n+" "})),i}var dl=function(e,t,n){var i=e.key+"-"+t.name;(!1===n||!1===cl&&void 0!==e.compat)&&void 0===e.registered[i]&&(e.registered[i]=t.styles)},hl=function(e,t,n){dl(e,t,n);var i=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r="",o=t;do{var s=e.insert(t===o?"."+i:"",o,e.sheet,!0);cl||void 0===s||(r+=s),o=o.next}while(void 0!==o);if(!cl&&0!==r.length)return r}};var fl={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},gl="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",pl="You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).",ml=/[A-Z]|^ms/g,vl=/_EMO_([^_]+?)_([^]*?)_EMO_/g,bl=function(e){return 45===e.charCodeAt(1)},yl=function(e){return null!=e&&"boolean"!=typeof e},wl=wa((function(e){return bl(e)?e:e.replace(ml,"-$&").toLowerCase()})),Cl=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(vl,(function(e,t,n){return Ll={name:t,styles:n,next:Ll},t}))}return 1===fl[e]||bl(e)||"number"!=typeof t||0===t?t:t+"px"};if("production"!==process.env.NODE_ENV){var xl=/(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/,Sl=["normal","none","initial","inherit","unset"],El=Cl,Al=/^-ms-/,Rl=/-(.)/g,Il={};Cl=function(e,t){if("content"===e&&("string"!=typeof t||-1===Sl.indexOf(t)&&!xl.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0))))throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\""+t+"\"'`");var n=El(e,t);return""===n||bl(e)||-1===e.indexOf("-")||void 0!==Il[e]||(Il[e]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean "+e.replace(Al,"ms-").replace(Rl,(function(e,t){return t.toUpperCase()}))+"?")),n}}var kl="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function $l(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles){if("production"!==process.env.NODE_ENV&&"NO_COMPONENT_SELECTOR"===n.toString())throw new Error(kl);return n}switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return Ll={name:n.name,styles:n.styles,next:Ll},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)Ll={name:i.name,styles:i.styles,next:Ll},i=i.next;var r=n.styles+";";return"production"!==process.env.NODE_ENV&&void 0!==n.map&&(r+=n.map),r}return function(e,t,n){var i="";if(Array.isArray(n))for(var r=0;r css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break;case"string":if("production"!==process.env.NODE_ENV){var a=[],l=n.replace(vl,(function(e,t,n){var i="animation"+a.length;return a.push("const "+i+" = keyframes`"+n.replace(/^@keyframes animation-\w+/,"")+"`"),"${"+i+"}"}));a.length&&console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n"+[].concat(a,["`"+l+"`"]).join("\n")+"\n\nYou should wrap it with `css` like this:\n\ncss`"+l+"`")}}if(null==t)return n;var c=t[n];return void 0!==c?c:n}var _l,Ll,Tl=/label:\s*([^\s;\n{]+)\s*(;|$)/g;"production"!==process.env.NODE_ENV&&(_l=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g);var Ml=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var i=!0,r="";Ll=void 0;var o,s=e[0];null==s||void 0===s.raw?(i=!1,r+=$l(n,t,s)):("production"!==process.env.NODE_ENV&&void 0===s[0]&&console.error(gl),r+=s[0]);for(var a=1;a=4;++i,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(i+2))<<16;case 2:n^=(255&e.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(i)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+c;return"production"!==process.env.NODE_ENV?{name:u,styles:r,map:o,next:Ll,toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}}:{name:u,styles:r,next:Ll}},Ol="undefined"!=typeof document,Nl=function(e){return e()},Bl=!!l.useInsertionEffect&&l.useInsertionEffect,Fl=Ol&&Bl||Nl,Pl=Bl||e.useLayoutEffect,Wl="undefined"!=typeof document,Gl={}.hasOwnProperty,Hl=e.createContext("undefined"!=typeof HTMLElement?Ba({key:"css"}):null);"production"!==process.env.NODE_ENV&&(Hl.displayName="EmotionCacheContext"),Hl.Provider;var Dl=function(t){return e.forwardRef((function(n,i){var r=e.useContext(Hl);return t(n,r,i)}))};Wl||(Dl=function(t){return function(n){var i=e.useContext(Hl);return null===i?(i=Ba({key:"css"}),e.createElement(Hl.Provider,{value:i},t(n,i))):t(n,i)}});var Vl=e.createContext({});"production"!==process.env.NODE_ENV&&(Vl.displayName="EmotionThemeContext");var zl=function(e){var t=e.split(".");return t[t.length-1]},jl=function(e){var t=/^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(e);return t||(t=/^([A-Za-z0-9$.]+)@/.exec(e))?zl(t[1]):void 0},Zl=new Set(["renderWithHooks","processChild","finishClassComponent","renderToString"]),Xl=function(e){return e.replace(/\$/g,"-")},Ul="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Yl="__EMOTION_LABEL_PLEASE_DO_NOT_USE__",Jl=function(e,t){if("production"!==process.env.NODE_ENV&&"string"==typeof t.css&&-1!==t.css.indexOf(":"))throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`"+t.css+"`");var n={};for(var i in t)Gl.call(t,i)&&(n[i]=t[i]);if(n[Ul]=e,"production"!==process.env.NODE_ENV&&t.css&&("object"!=typeof t.css||"string"!=typeof t.css.name||-1===t.css.name.indexOf("-"))){var r=function(e){if(e)for(var t=e.split("\n"),n=0;n component."),s="",o)o[a]&&a&&(s&&(s+=" "),s+=a);break;default:s=o}s&&(r&&(r+=" "),r+=s)}}return r};function rc(e,t,n){var i=[],r=ul(e,i,n);return i.length<2?n:r+t(i)}var oc=function(t){var n,i=t.cache,r=t.serializedArr,o=Fl((function(){for(var e="",t=0;te.brand+"/"+e.version)).join(" "),gc):navigator.userAgent}())}const Cc=Math.round;function xc(e){return mc(e)?e:e.contextElement}const Sc={x:1,y:1};function Ec(e){const t=xc(e);if(!pc(t))return Sc;const n=t.getBoundingClientRect(),{width:i,height:r,fallback:o}=function(e){const t=hc(e);let n=parseFloat(t.width),i=parseFloat(t.height);const r=e.offsetWidth,o=e.offsetHeight,s=Cc(n)!==r||Cc(i)!==o;return s&&(n=r,i=o),{width:n,height:i,fallback:s}}(t);let s=(o?Cc(n.width):n.width)/i,a=(o?Cc(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}function Ac(e,t,n,i){var r,o;void 0===t&&(t=!1),void 0===n&&(n=!1);const s=e.getBoundingClientRect(),a=xc(e);let l=Sc;t&&(i?mc(i)&&(l=Ec(i)):l=Ec(e));const c=a?dc(a):window,u=!wc()&&n;let d=(s.left+(u&&(null==(r=c.visualViewport)?void 0:r.offsetLeft)||0))/l.x,h=(s.top+(u&&(null==(o=c.visualViewport)?void 0:o.offsetTop)||0))/l.y,f=s.width/l.x,g=s.height/l.y;if(a){const e=dc(a),t=i&&mc(i)?dc(i):i;let n=e.frameElement;for(;n&&i&&t!==e;){const e=Ec(n),t=n.getBoundingClientRect(),i=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(i.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(i.paddingTop))*e.y,d*=e.x,h*=e.y,f*=e.x,g*=e.y,d+=t.x,h+=t.y,n=dc(n).frameElement}}return{width:f,height:g,top:h,right:d+f,bottom:h+g,left:d,x:d,y:h}}function Rc(e){if("html"===fc(e))return e;const t=e.assignedSlot||e.parentNode||(bc(e)?e.host:null)||function(e){return((vc(e)?e.ownerDocument:e.document)||window.document).documentElement}(e);return bc(t)?t.host:t}function Ic(e){const t=Rc(e);return function(e){return["html","body","#document"].includes(fc(e))}(t)?e.ownerDocument.body:pc(t)&&yc(t)?t:Ic(t)}function kc(e,t){var n;void 0===t&&(t=[]);const i=Ic(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),o=dc(i);return r?t.concat(o,o.visualViewport||[],yc(i)?i:[]):t.concat(i,kc(i))}var $c="undefined"!=typeof document?e.useLayoutEffect:e.useEffect,_c=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Lc=function(){};function Tc(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Mc(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r-1}function Pc(e){return Fc(e)?window.pageYOffset:e.scrollTop}function Wc(e,t){Fc(e)?window.scrollTo(0,t):e.scrollTop=t}function Gc(e,t,n,i){return n*((e=e/i-1)*e*e+1)+t}function Hc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Lc,r=Pc(e),o=t-r,s=10,a=0;function l(){var t=Gc(a+=s,r,o,n);Wc(e,t),an.bottom?Wc(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):i.top-r=g)return{placement:"bottom",maxHeight:t};if(E>=g&&!s)return o&&Hc(l,A,I),{placement:"bottom",maxHeight:t};if(!s&&E>=i||s&&x>=i)return o&&Hc(l,A,I),{placement:"bottom",maxHeight:s?x-y:E-y};if("auto"===r||s){var k=t,$=s?C:S;return $>=i&&(k=Math.min($-y-a,t)),{placement:"top",maxHeight:k}}if("bottom"===r)return o&&Wc(l,A),{placement:"bottom",maxHeight:t};break;case"top":if(C>=g)return{placement:"top",maxHeight:t};if(S>=g&&!s)return o&&Hc(l,R,I),{placement:"top",maxHeight:t};if(!s&&S>=i||s&&C>=i){var _=t;return(!s&&S>=i||s&&C>=i)&&(_=s?C-w:S-w),o&&Hc(l,R,I),{placement:"top",maxHeight:_}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}var Kc=function(e){return"auto"===e?"bottom":e},Qc=e.createContext(null),qc=function(t){var n=t.children,i=t.minMenuHeight,r=t.maxMenuHeight,o=t.menuPlacement,s=t.menuPosition,a=t.menuShouldScrollIntoView,l=t.theme,c=(e.useContext(Qc)||{}).setPortalPlacement,u=e.useRef(null),d=gs(e.useState(r),2),h=d[0],f=d[1],g=gs(e.useState(null),2),p=g[0],m=g[1],v=l.spacing.controlHeight;return $c((function(){var e=u.current;if(e){var t="fixed"===s,n=Jc({maxHeight:r,menuEl:e,minHeight:i,placement:o,shouldScroll:a&&!t,isFixedPosition:t,controlHeight:v});f(n.maxHeight),m(n.placement),null==c||c(n.placement)}}),[r,o,s,a,i,c,v]),n({ref:u,placerProps:ds(ds({},t),{},{placement:p||Kc(o),maxHeight:h})})},eu=function(e,t){var n=e.theme,i=n.spacing.baseUnit,r=n.colors;return ds({textAlign:"center"},t?{}:{color:r.neutral40,padding:"".concat(2*i,"px ").concat(3*i,"px")})},tu=eu,nu=eu,iu=function(e){var t=e.children,n=e.innerProps;return ql("div",bs({},Bc(e,"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),n),t)};iu.defaultProps={children:"No options"};var ru=function(e){var t=e.children,n=e.innerProps;return ql("div",bs({},Bc(e,"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),n),t)};ru.defaultProps={children:"Loading..."};var ou,su=["size"];var au,lu,cu="production"===process.env.NODE_ENV?{name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"}:{name:"tj5bde-Svg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICBDU1NPYmplY3RXaXRoTGFiZWwsXG4gIEdyb3VwQmFzZSxcbn0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgZ2V0U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgU3ZnID0gKHtcbiAgc2l6ZSxcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU6IG51bWJlciB9KSA9PiAoXG4gIDxzdmdcbiAgICBoZWlnaHQ9e3NpemV9XG4gICAgd2lkdGg9e3NpemV9XG4gICAgdmlld0JveD1cIjAgMCAyMCAyMFwiXG4gICAgYXJpYS1oaWRkZW49XCJ0cnVlXCJcbiAgICBmb2N1c2FibGU9XCJmYWxzZVwiXG4gICAgY3NzPXt7XG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIGZpbGw6ICdjdXJyZW50Q29sb3InLFxuICAgICAgbGluZUhlaWdodDogMSxcbiAgICAgIHN0cm9rZTogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBzdHJva2VXaWR0aDogMCxcbiAgICB9fVxuICAgIHsuLi5wcm9wc31cbiAgLz5cbik7XG5cbmV4cG9ydCB0eXBlIENyb3NzSWNvblByb3BzID0gSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZT86IG51bWJlciB9O1xuZXhwb3J0IGNvbnN0IENyb3NzSWNvbiA9IChwcm9wczogQ3Jvc3NJY29uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTE0LjM0OCAxNC44NDljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDBsLTIuNjUxLTMuMDMwLTIuNjUxIDMuMDI5Yy0wLjQ2OSAwLjQ2OS0xLjIyOSAwLjQ2OS0xLjY5NyAwLTAuNDY5LTAuNDY5LTAuNDY5LTEuMjI5IDAtMS42OTdsMi43NTgtMy4xNS0yLjc1OS0zLjE1MmMtMC40NjktMC40NjktMC40NjktMS4yMjggMC0xLjY5N3MxLjIyOC0wLjQ2OSAxLjY5NyAwbDIuNjUyIDMuMDMxIDIuNjUxLTMuMDMxYzAuNDY5LTAuNDY5IDEuMjI4LTAuNDY5IDEuNjk3IDBzMC40NjkgMS4yMjkgMCAxLjY5N2wtMi43NTggMy4xNTIgMi43NTggMy4xNWMwLjQ2OSAwLjQ2OSAwLjQ2OSAxLjIyOSAwIDEuNjk4elwiIC8+XG4gIDwvU3ZnPlxuKTtcbmV4cG9ydCB0eXBlIERvd25DaGV2cm9uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgRG93bkNoZXZyb24gPSAocHJvcHM6IERvd25DaGV2cm9uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTQuNTE2IDcuNTQ4YzAuNDM2LTAuNDQ2IDEuMDQzLTAuNDgxIDEuNTc2IDBsMy45MDggMy43NDcgMy45MDgtMy43NDdjMC41MzMtMC40ODEgMS4xNDEtMC40NDYgMS41NzQgMCAwLjQzNiAwLjQ0NSAwLjQwOCAxLjE5NyAwIDEuNjE1LTAuNDA2IDAuNDE4LTQuNjk1IDQuNTAyLTQuNjk1IDQuNTAyLTAuMjE3IDAuMjIzLTAuNTAyIDAuMzM1LTAuNzg3IDAuMzM1cy0wLjU3LTAuMTEyLTAuNzg5LTAuMzM1YzAgMC00LjI4Ny00LjA4NC00LjY5NS00LjUwMnMtMC40MzYtMS4xNyAwLTEuNjE1elwiIC8+XG4gIDwvU3ZnPlxuKTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEJ1dHRvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xufVxuXG5jb25zdCBiYXNlQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTpcbiAgICB8IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbiAgICB8IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JDb250YWluZXInLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICAgICc6aG92ZXInOiB7XG4gICAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsODAgOiBjb2xvcnMubmV1dHJhbDQwLFxuICAgICAgICB9LFxuICAgICAgfSksXG59KTtcblxuZXhwb3J0IGNvbnN0IGRyb3Bkb3duSW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBEcm9wZG93bkluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2Ryb3Bkb3duSW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdkcm9wZG93bi1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPERvd25DaGV2cm9uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuZXhwb3J0IGludGVyZmFjZSBDbGVhckluZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFRoZSBjaGlsZHJlbiB0byBiZSByZW5kZXJlZCBpbnNpZGUgdGhlIGluZGljYXRvci4gKi9cbiAgY2hpbGRyZW4/OiBSZWFjdE5vZGU7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGNvbnN0IGNsZWFySW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBDbGVhckluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2NsZWFySW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdjbGVhci1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPENyb3NzSWNvbiAvPn1cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gU2VwYXJhdG9yXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuZXhwb3J0IGludGVyZmFjZSBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaW5uZXJQcm9wcz86IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3BhbiddO1xufVxuXG5leHBvcnQgY29uc3QgaW5kaWNhdG9yU2VwYXJhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNEaXNhYmxlZCxcbiAgICB0aGVtZToge1xuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgICAgY29sb3JzLFxuICAgIH0sXG4gIH06IEluZGljYXRvclNlcGFyYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+LFxuICB1bnN0eWxlZDogYm9vbGVhblxuKTogQ1NTT2JqZWN0V2l0aExhYmVsID0+ICh7XG4gIGxhYmVsOiAnaW5kaWNhdG9yU2VwYXJhdG9yJyxcbiAgYWxpZ25TZWxmOiAnc3RyZXRjaCcsXG4gIHdpZHRoOiAxLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGJhY2tncm91bmRDb2xvcjogaXNEaXNhYmxlZCA/IGNvbG9ycy5uZXV0cmFsMTAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBtYXJnaW5Cb3R0b206IGJhc2VVbml0ICogMixcbiAgICAgICAgbWFyZ2luVG9wOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgSW5kaWNhdG9yU2VwYXJhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxzcGFuXG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnaW5kaWNhdG9yU2VwYXJhdG9yJywge1xuICAgICAgICAnaW5kaWNhdG9yLXNlcGFyYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAvPlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBMb2FkaW5nXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgbG9hZGluZ0RvdEFuaW1hdGlvbnMgPSBrZXlmcmFtZXNgXG4gIDAlLCA4MCUsIDEwMCUgeyBvcGFjaXR5OiAwOyB9XG4gIDQwJSB7IG9wYWNpdHk6IDE7IH1cbmA7XG5cbmV4cG9ydCBjb25zdCBsb2FkaW5nSW5kaWNhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHNpemUsXG4gICAgdGhlbWU6IHtcbiAgICAgIGNvbG9ycyxcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICB9LFxuICB9OiBMb2FkaW5nSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdsb2FkaW5nSW5kaWNhdG9yJyxcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICB0cmFuc2l0aW9uOiAnY29sb3IgMTUwbXMnLFxuICBhbGlnblNlbGY6ICdjZW50ZXInLFxuICBmb250U2l6ZTogc2l6ZSxcbiAgbGluZUhlaWdodDogMSxcbiAgbWFyZ2luUmlnaHQ6IHNpemUsXG4gIHRleHRBbGlnbjogJ2NlbnRlcicsXG4gIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGNvbG9yOiBpc0ZvY3VzZWQgPyBjb2xvcnMubmV1dHJhbDYwIDogY29sb3JzLm5ldXRyYWwyMCxcbiAgICAgICAgcGFkZGluZzogYmFzZVVuaXQgKiAyLFxuICAgICAgfSksXG59KTtcblxuaW50ZXJmYWNlIExvYWRpbmdEb3RQcm9wcyB7XG4gIGRlbGF5OiBudW1iZXI7XG4gIG9mZnNldDogYm9vbGVhbjtcbn1cbmNvbnN0IExvYWRpbmdEb3QgPSAoeyBkZWxheSwgb2Zmc2V0IH06IExvYWRpbmdEb3RQcm9wcykgPT4gKFxuICA8c3BhblxuICAgIGNzcz17e1xuICAgICAgYW5pbWF0aW9uOiBgJHtsb2FkaW5nRG90QW5pbWF0aW9uc30gMXMgZWFzZS1pbi1vdXQgJHtkZWxheX1tcyBpbmZpbml0ZTtgLFxuICAgICAgYmFja2dyb3VuZENvbG9yOiAnY3VycmVudENvbG9yJyxcbiAgICAgIGJvcmRlclJhZGl1czogJzFlbScsXG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIG1hcmdpbkxlZnQ6IG9mZnNldCA/ICcxZW0nIDogdW5kZWZpbmVkLFxuICAgICAgaGVpZ2h0OiAnMWVtJyxcbiAgICAgIHZlcnRpY2FsQWxpZ246ICd0b3AnLFxuICAgICAgd2lkdGg6ICcxZW0nLFxuICAgIH19XG4gIC8+XG4pO1xuXG5leHBvcnQgaW50ZXJmYWNlIExvYWRpbmdJbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgLyoqIFNldCBzaXplIG9mIHRoZSBjb250YWluZXIuICovXG4gIHNpemU6IG51bWJlcjtcbn1cbmV4cG9ydCBjb25zdCBMb2FkaW5nSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogTG9hZGluZ0luZGljYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+XG4pID0+IHtcbiAgY29uc3QgeyBpbm5lclByb3BzLCBpc1J0bCB9ID0gcHJvcHM7XG5cbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2xvYWRpbmdJbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2xvYWRpbmctaW5kaWNhdG9yJzogdHJ1ZSxcbiAgICAgIH0pfVxuICAgICAgey4uLmlubmVyUHJvcHN9XG4gICAgPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezB9IG9mZnNldD17aXNSdGx9IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MTYwfSBvZmZzZXQgLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXszMjB9IG9mZnNldD17IWlzUnRsfSAvPlxuICAgIDwvZGl2PlxuICApO1xufTtcbkxvYWRpbmdJbmRpY2F0b3IuZGVmYXVsdFByb3BzID0geyBzaXplOiA0IH07XG4iXX0= */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}},uu=function(e){var t=e.size,n=ps(e,su);return ql("svg",bs({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:cu},n))},du=function(e){return ql(uu,bs({size:20},e),ql("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},hu=function(e){return ql(uu,bs({size:20},e),ql("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},fu=function(e,t){var n=e.isFocused,i=e.theme,r=i.spacing.baseUnit,o=i.colors;return ds({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?o.neutral60:o.neutral20,padding:2*r,":hover":{color:n?o.neutral80:o.neutral40}})},gu=fu,pu=fu,mu=function(){var e=nc.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(ou||(au=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],lu||(lu=au.slice(0)),ou=Object.freeze(Object.defineProperties(au,{raw:{value:Object.freeze(lu)}})))),vu=function(e){var t=e.delay,n=e.offset;return ql("span",{css:nc({animation:"".concat(mu," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"production"===process.env.NODE_ENV?"":";label:LoadingDot;","production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1RSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICBDU1NPYmplY3RXaXRoTGFiZWwsXG4gIEdyb3VwQmFzZSxcbn0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgZ2V0U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgU3ZnID0gKHtcbiAgc2l6ZSxcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU6IG51bWJlciB9KSA9PiAoXG4gIDxzdmdcbiAgICBoZWlnaHQ9e3NpemV9XG4gICAgd2lkdGg9e3NpemV9XG4gICAgdmlld0JveD1cIjAgMCAyMCAyMFwiXG4gICAgYXJpYS1oaWRkZW49XCJ0cnVlXCJcbiAgICBmb2N1c2FibGU9XCJmYWxzZVwiXG4gICAgY3NzPXt7XG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIGZpbGw6ICdjdXJyZW50Q29sb3InLFxuICAgICAgbGluZUhlaWdodDogMSxcbiAgICAgIHN0cm9rZTogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBzdHJva2VXaWR0aDogMCxcbiAgICB9fVxuICAgIHsuLi5wcm9wc31cbiAgLz5cbik7XG5cbmV4cG9ydCB0eXBlIENyb3NzSWNvblByb3BzID0gSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZT86IG51bWJlciB9O1xuZXhwb3J0IGNvbnN0IENyb3NzSWNvbiA9IChwcm9wczogQ3Jvc3NJY29uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTE0LjM0OCAxNC44NDljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDBsLTIuNjUxLTMuMDMwLTIuNjUxIDMuMDI5Yy0wLjQ2OSAwLjQ2OS0xLjIyOSAwLjQ2OS0xLjY5NyAwLTAuNDY5LTAuNDY5LTAuNDY5LTEuMjI5IDAtMS42OTdsMi43NTgtMy4xNS0yLjc1OS0zLjE1MmMtMC40NjktMC40NjktMC40NjktMS4yMjggMC0xLjY5N3MxLjIyOC0wLjQ2OSAxLjY5NyAwbDIuNjUyIDMuMDMxIDIuNjUxLTMuMDMxYzAuNDY5LTAuNDY5IDEuMjI4LTAuNDY5IDEuNjk3IDBzMC40NjkgMS4yMjkgMCAxLjY5N2wtMi43NTggMy4xNTIgMi43NTggMy4xNWMwLjQ2OSAwLjQ2OSAwLjQ2OSAxLjIyOSAwIDEuNjk4elwiIC8+XG4gIDwvU3ZnPlxuKTtcbmV4cG9ydCB0eXBlIERvd25DaGV2cm9uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgRG93bkNoZXZyb24gPSAocHJvcHM6IERvd25DaGV2cm9uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTQuNTE2IDcuNTQ4YzAuNDM2LTAuNDQ2IDEuMDQzLTAuNDgxIDEuNTc2IDBsMy45MDggMy43NDcgMy45MDgtMy43NDdjMC41MzMtMC40ODEgMS4xNDEtMC40NDYgMS41NzQgMCAwLjQzNiAwLjQ0NSAwLjQwOCAxLjE5NyAwIDEuNjE1LTAuNDA2IDAuNDE4LTQuNjk1IDQuNTAyLTQuNjk1IDQuNTAyLTAuMjE3IDAuMjIzLTAuNTAyIDAuMzM1LTAuNzg3IDAuMzM1cy0wLjU3LTAuMTEyLTAuNzg5LTAuMzM1YzAgMC00LjI4Ny00LjA4NC00LjY5NS00LjUwMnMtMC40MzYtMS4xNyAwLTEuNjE1elwiIC8+XG4gIDwvU3ZnPlxuKTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEJ1dHRvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xufVxuXG5jb25zdCBiYXNlQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTpcbiAgICB8IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbiAgICB8IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JDb250YWluZXInLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICAgICc6aG92ZXInOiB7XG4gICAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsODAgOiBjb2xvcnMubmV1dHJhbDQwLFxuICAgICAgICB9LFxuICAgICAgfSksXG59KTtcblxuZXhwb3J0IGNvbnN0IGRyb3Bkb3duSW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBEcm9wZG93bkluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2Ryb3Bkb3duSW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdkcm9wZG93bi1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPERvd25DaGV2cm9uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuZXhwb3J0IGludGVyZmFjZSBDbGVhckluZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFRoZSBjaGlsZHJlbiB0byBiZSByZW5kZXJlZCBpbnNpZGUgdGhlIGluZGljYXRvci4gKi9cbiAgY2hpbGRyZW4/OiBSZWFjdE5vZGU7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGNvbnN0IGNsZWFySW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBDbGVhckluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2NsZWFySW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdjbGVhci1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPENyb3NzSWNvbiAvPn1cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gU2VwYXJhdG9yXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuZXhwb3J0IGludGVyZmFjZSBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaW5uZXJQcm9wcz86IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3BhbiddO1xufVxuXG5leHBvcnQgY29uc3QgaW5kaWNhdG9yU2VwYXJhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNEaXNhYmxlZCxcbiAgICB0aGVtZToge1xuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgICAgY29sb3JzLFxuICAgIH0sXG4gIH06IEluZGljYXRvclNlcGFyYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+LFxuICB1bnN0eWxlZDogYm9vbGVhblxuKTogQ1NTT2JqZWN0V2l0aExhYmVsID0+ICh7XG4gIGxhYmVsOiAnaW5kaWNhdG9yU2VwYXJhdG9yJyxcbiAgYWxpZ25TZWxmOiAnc3RyZXRjaCcsXG4gIHdpZHRoOiAxLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGJhY2tncm91bmRDb2xvcjogaXNEaXNhYmxlZCA/IGNvbG9ycy5uZXV0cmFsMTAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBtYXJnaW5Cb3R0b206IGJhc2VVbml0ICogMixcbiAgICAgICAgbWFyZ2luVG9wOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgSW5kaWNhdG9yU2VwYXJhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxzcGFuXG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnaW5kaWNhdG9yU2VwYXJhdG9yJywge1xuICAgICAgICAnaW5kaWNhdG9yLXNlcGFyYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAvPlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBMb2FkaW5nXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgbG9hZGluZ0RvdEFuaW1hdGlvbnMgPSBrZXlmcmFtZXNgXG4gIDAlLCA4MCUsIDEwMCUgeyBvcGFjaXR5OiAwOyB9XG4gIDQwJSB7IG9wYWNpdHk6IDE7IH1cbmA7XG5cbmV4cG9ydCBjb25zdCBsb2FkaW5nSW5kaWNhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHNpemUsXG4gICAgdGhlbWU6IHtcbiAgICAgIGNvbG9ycyxcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICB9LFxuICB9OiBMb2FkaW5nSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdsb2FkaW5nSW5kaWNhdG9yJyxcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICB0cmFuc2l0aW9uOiAnY29sb3IgMTUwbXMnLFxuICBhbGlnblNlbGY6ICdjZW50ZXInLFxuICBmb250U2l6ZTogc2l6ZSxcbiAgbGluZUhlaWdodDogMSxcbiAgbWFyZ2luUmlnaHQ6IHNpemUsXG4gIHRleHRBbGlnbjogJ2NlbnRlcicsXG4gIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGNvbG9yOiBpc0ZvY3VzZWQgPyBjb2xvcnMubmV1dHJhbDYwIDogY29sb3JzLm5ldXRyYWwyMCxcbiAgICAgICAgcGFkZGluZzogYmFzZVVuaXQgKiAyLFxuICAgICAgfSksXG59KTtcblxuaW50ZXJmYWNlIExvYWRpbmdEb3RQcm9wcyB7XG4gIGRlbGF5OiBudW1iZXI7XG4gIG9mZnNldDogYm9vbGVhbjtcbn1cbmNvbnN0IExvYWRpbmdEb3QgPSAoeyBkZWxheSwgb2Zmc2V0IH06IExvYWRpbmdEb3RQcm9wcykgPT4gKFxuICA8c3BhblxuICAgIGNzcz17e1xuICAgICAgYW5pbWF0aW9uOiBgJHtsb2FkaW5nRG90QW5pbWF0aW9uc30gMXMgZWFzZS1pbi1vdXQgJHtkZWxheX1tcyBpbmZpbml0ZTtgLFxuICAgICAgYmFja2dyb3VuZENvbG9yOiAnY3VycmVudENvbG9yJyxcbiAgICAgIGJvcmRlclJhZGl1czogJzFlbScsXG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIG1hcmdpbkxlZnQ6IG9mZnNldCA/ICcxZW0nIDogdW5kZWZpbmVkLFxuICAgICAgaGVpZ2h0OiAnMWVtJyxcbiAgICAgIHZlcnRpY2FsQWxpZ246ICd0b3AnLFxuICAgICAgd2lkdGg6ICcxZW0nLFxuICAgIH19XG4gIC8+XG4pO1xuXG5leHBvcnQgaW50ZXJmYWNlIExvYWRpbmdJbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgLyoqIFNldCBzaXplIG9mIHRoZSBjb250YWluZXIuICovXG4gIHNpemU6IG51bWJlcjtcbn1cbmV4cG9ydCBjb25zdCBMb2FkaW5nSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogTG9hZGluZ0luZGljYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+XG4pID0+IHtcbiAgY29uc3QgeyBpbm5lclByb3BzLCBpc1J0bCB9ID0gcHJvcHM7XG5cbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2xvYWRpbmdJbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2xvYWRpbmctaW5kaWNhdG9yJzogdHJ1ZSxcbiAgICAgIH0pfVxuICAgICAgey4uLmlubmVyUHJvcHN9XG4gICAgPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezB9IG9mZnNldD17aXNSdGx9IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MTYwfSBvZmZzZXQgLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXszMjB9IG9mZnNldD17IWlzUnRsfSAvPlxuICAgIDwvZGl2PlxuICApO1xufTtcbkxvYWRpbmdJbmRpY2F0b3IuZGVmYXVsdFByb3BzID0geyBzaXplOiA0IH07XG4iXX0= */")})},bu=function(e){var t=e.innerProps,n=e.isRtl;return ql("div",bs({},Bc(e,"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),ql(vu,{delay:0,offset:n}),ql(vu,{delay:160,offset:!0}),ql(vu,{delay:320,offset:!n}))};bu.defaultProps={size:4};var yu=["data"],wu=["innerRef","isDisabled","isHidden","inputClassName"],Cu={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},xu={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":ds({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Cu)},Su=function(e){return ds({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Cu)},Eu=function(e){var t=e.children,n=e.innerProps;return ql("div",n,t)};var Au={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return ql("div",bs({},Bc(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||ql(du,null))},Control:function(e){var t=e.children,n=e.isDisabled,i=e.isFocused,r=e.innerRef,o=e.innerProps,s=e.menuIsOpen;return ql("div",bs({ref:r},Bc(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":i,"control--menu-is-open":s}),o),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return ql("div",bs({},Bc(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||ql(hu,null))},DownChevron:hu,CrossIcon:du,Group:function(e){var t=e.children,n=e.cx,i=e.getStyles,r=e.getClassNames,o=e.Heading,s=e.headingProps,a=e.innerProps,l=e.label,c=e.theme,u=e.selectProps;return ql("div",bs({},Bc(e,"group",{group:!0}),a),ql(o,bs({},s,{selectProps:u,theme:c,getStyles:i,getClassNames:r,cx:n}),l),ql("div",null,t))},GroupHeading:function(e){var t=Nc(e);t.data;var n=ps(t,yu);return ql("div",bs({},Bc(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return ql("div",bs({},Bc(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return ql("span",bs({},t,Bc(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,i=Nc(e),r=i.innerRef,o=i.isDisabled,s=i.isHidden,a=i.inputClassName,l=ps(i,wu);return ql("div",bs({},Bc(e,"input",{"input-container":!0}),{"data-value":n||""}),ql("input",bs({className:t({input:!0},a),ref:r,style:Su(s),disabled:o},l)))},LoadingIndicator:bu,Menu:function(e){var t=e.children,n=e.innerRef,i=e.innerProps;return ql("div",bs({},Bc(e,"menu",{menu:!0}),{ref:n},i),t)},MenuList:function(e){var t=e.children,n=e.innerProps,i=e.innerRef,r=e.isMulti;return ql("div",bs({},Bc(e,"menuList",{"menu-list":!0,"menu-list--is-multi":r}),{ref:i},n),t)},MenuPortal:function(t){var n=t.appendTo,i=t.children,o=t.controlElement,s=t.innerProps,a=t.menuPlacement,l=t.menuPosition,c=e.useRef(null),u=e.useRef(null),d=gs(e.useState(Kc(a)),2),h=d[0],f=d[1],g=e.useMemo((function(){return{setPortalPlacement:f}}),[]),p=gs(e.useState(null),2),m=p[0],v=p[1],b=e.useCallback((function(){if(o){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(o),t="fixed"===l?0:window.pageYOffset,n=e[h]+t;n===(null==m?void 0:m.offset)&&e.left===(null==m?void 0:m.rect.left)&&e.width===(null==m?void 0:m.rect.width)||v({offset:n,rect:e})}}),[o,l,h,null==m?void 0:m.offset,null==m?void 0:m.rect.left,null==m?void 0:m.rect.width]);$c((function(){b()}),[b]);var y=e.useCallback((function(){"function"==typeof u.current&&(u.current(),u.current=null),o&&c.current&&(u.current=function(e,t,n,i){void 0===i&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:s=!0,animationFrame:a=!1}=i,l=r&&!a,c=l||o?[...mc(e)?kc(e):e.contextElement?kc(e.contextElement):[],...kc(t)]:[];c.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)}));let u,d=null;if(s){let i=!0;d=new ResizeObserver((()=>{i||n(),i=!1})),mc(e)&&!a&&d.observe(e),mc(e)||!e.contextElement||a||d.observe(e.contextElement),d.observe(t)}let h=a?Ac(e):null;return a&&function t(){const i=Ac(e);!h||i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height||n(),h=i,u=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{l&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)})),null==(e=d)||e.disconnect(),d=null,a&&cancelAnimationFrame(u)}}(o,c.current,b,{elementResize:"ResizeObserver"in window}))}),[o,b]);$c((function(){y()}),[y]);var w=e.useCallback((function(e){c.current=e,y()}),[y]);if(!n&&"fixed"!==l||!m)return null;var C=ql("div",bs({ref:w},Bc(ds(ds({},t),{},{offset:m.offset,position:l,rect:m.rect}),"menuPortal",{"menu-portal":!0}),s),i);return ql(Qc.Provider,{value:g},n?r.createPortal(C,n):C)},LoadingMessage:ru,NoOptionsMessage:iu,MultiValue:function(e){var t=e.children,n=e.components,i=e.data,r=e.innerProps,o=e.isDisabled,s=e.removeProps,a=e.selectProps,l=n.Container,c=n.Label,u=n.Remove;return ql(l,{data:i,innerProps:ds(ds({},Bc(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),r),selectProps:a},ql(c,{data:i,innerProps:ds({},Bc(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:a},t),ql(u,{data:i,innerProps:ds(ds({},Bc(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},s),selectProps:a}))},MultiValueContainer:Eu,MultiValueLabel:Eu,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return ql("div",bs({role:"button"},n),t||ql(du,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,i=e.isFocused,r=e.isSelected,o=e.innerRef,s=e.innerProps;return ql("div",bs({},Bc(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":i,"option--is-selected":r}),{ref:o,"aria-disabled":n},s),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return ql("div",bs({},Bc(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,i=e.isDisabled,r=e.isRtl;return ql("div",bs({},Bc(e,"container",{"--is-disabled":i,"--is-rtl":r}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,i=e.innerProps;return ql("div",bs({},Bc(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),i),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,i=e.isMulti,r=e.hasValue;return ql("div",bs({},Bc(e,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":r}),n),t)}},Ru=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Iu(e,t){if(e.length!==t.length)return!1;for(var n=0;n1?"s":""," ").concat(r.join(","),", selected.");case"select-option":return"option ".concat(i,o?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,i=e.options,r=e.label,o=void 0===r?"":r,s=e.selectValue,a=e.isDisabled,l=e.isSelected,c=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&s)return"value ".concat(o," focused, ").concat(c(s,n),".");if("menu"===t){var u=a?" disabled":"",d="".concat(l?"selected":"focused").concat(u);return"option ".concat(o," ").concat(d,", ").concat(c(i,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Lu=function(t){var n=t.ariaSelection,i=t.focusedOption,r=t.focusedValue,o=t.focusableOptions,s=t.isFocused,a=t.selectValue,l=t.selectProps,c=t.id,u=l.ariaLiveMessages,d=l.getOptionLabel,h=l.inputValue,f=l.isMulti,g=l.isOptionDisabled,p=l.isSearchable,m=l.menuIsOpen,v=l.options,b=l.screenReaderStatus,y=l.tabSelectsValue,w=l["aria-label"],C=l["aria-live"],x=e.useMemo((function(){return ds(ds({},_u),u||{})}),[u]),S=e.useMemo((function(){var e,t="";if(n&&x.onChange){var i=n.option,r=n.options,o=n.removedValue,s=n.removedValues,l=n.value,c=o||i||(e=l,Array.isArray(e)?null:e),u=c?d(c):"",h=r||s||void 0,f=h?h.map(d):[],p=ds({isDisabled:c&&g(c,a),label:u,labels:f},n);t=x.onChange(p)}return t}),[n,x,g,a,d]),E=e.useMemo((function(){var e="",t=i||r,n=!!(i&&a&&a.includes(i));if(t&&x.onFocus){var s={focused:t,label:d(t),isDisabled:g(t,a),isSelected:n,options:o,context:t===i?"menu":"value",selectValue:a};e=x.onFocus(s)}return e}),[i,r,d,g,x,o,a]),A=e.useMemo((function(){var e="";if(m&&v.length&&x.onFilter){var t=b({count:o.length});e=x.onFilter({inputValue:h,resultsMessage:t})}return e}),[o,h,m,x,v,b]),R=e.useMemo((function(){var e="";if(x.guidance){var t=r?"value":m?"menu":"input";e=x.guidance({"aria-label":w,context:t,isDisabled:i&&g(i,a),isMulti:f,isSearchable:p,tabSelectsValue:y})}return e}),[w,i,r,f,g,p,m,x,a,y]),I="".concat(E," ").concat(A," ").concat(R),k=ql(e.Fragment,null,ql("span",{id:"aria-selection"},S),ql("span",{id:"aria-context"},I)),$="initial-input-focus"===(null==n?void 0:n.action);return ql(e.Fragment,null,ql($u,{id:c},$&&k),ql($u,{"aria-live":C,"aria-atomic":"false","aria-relevant":"additions text"},s&&!$&&k))},Tu=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Mu=new RegExp("["+Tu.map((function(e){return e.letters})).join("")+"]","g"),Ou={},Nu=0;Nu1?t-1:0),i=1;i0,p=d-h-c,m=!1;p>t&&a.current&&(r&&r(e),a.current=!1),g&&l.current&&(s&&s(e),l.current=!1),g&&t>p?(i&&!a.current&&i(e),f.scrollTop=d,m=!0,a.current=!0):!g&&-t>c&&(o&&!l.current&&o(e),f.scrollTop=0,m=!0,l.current=!0),m&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[i,r,o,s]),h=e.useCallback((function(e){d(e,e.deltaY)}),[d]),f=e.useCallback((function(e){c.current=e.changedTouches[0].clientY}),[]),g=e.useCallback((function(e){var t=c.current-e.changedTouches[0].clientY;d(e,t)}),[d]),p=e.useCallback((function(e){if(e){var t=!!Xc&&{passive:!1};e.addEventListener("wheel",h,t),e.addEventListener("touchstart",f,t),e.addEventListener("touchmove",g,t)}}),[g,f,h]),m=e.useCallback((function(e){e&&(e.removeEventListener("wheel",h,!1),e.removeEventListener("touchstart",f,!1),e.removeEventListener("touchmove",g,!1))}),[g,f,h]);return e.useEffect((function(){if(n){var e=u.current;return p(e),function(){m(e)}}}),[n,p,m]),function(e){u.current=e}}({isEnabled:void 0===r||r,onBottomArrive:t.onBottomArrive,onBottomLeave:t.onBottomLeave,onTopArrive:t.onTopArrive,onTopLeave:t.onTopLeave}),s=function(t){var n=t.isEnabled,i=t.accountForScrollbars,r=void 0===i||i,o=e.useRef({}),s=e.useRef(null),a=e.useCallback((function(e){if(Ju){var t=document.body,n=t&&t.style;if(r&&zu.forEach((function(e){var t=n&&n[e];o.current[e]=t})),r&&Ku<1){var i=parseInt(o.current.paddingRight,10)||0,s=document.body?document.body.clientWidth:0,a=window.innerWidth-s+i||0;Object.keys(ju).forEach((function(e){var t=ju[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(a,"px"))}t&&Yu()&&(t.addEventListener("touchmove",Zu,Qu),e&&(e.addEventListener("touchstart",Uu,Qu),e.addEventListener("touchmove",Xu,Qu))),Ku+=1}}),[r]),l=e.useCallback((function(e){if(Ju){var t=document.body,n=t&&t.style;Ku=Math.max(Ku-1,0),r&&Ku<1&&zu.forEach((function(e){var t=o.current[e];n&&(n[e]=t)})),t&&Yu()&&(t.removeEventListener("touchmove",Zu,Qu),e&&(e.removeEventListener("touchstart",Uu,Qu),e.removeEventListener("touchmove",Xu,Qu)))}}),[r]);return e.useEffect((function(){if(n){var e=s.current;return a(e),function(){l(e)}}}),[n,a,l]),function(e){s.current=e}}({isEnabled:i});return ql(e.Fragment,null,i&&ql("div",{onClick:qu,css:ed}),n((function(e){o(e),s(e)})))}var nd,id="production"===process.env.NODE_ENV?{name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"}:{name:"5kkxb2-requiredInput-RequiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%;label:RequiredInput;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlcXVpcmVkSW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWFJIiwiZmlsZSI6IlJlcXVpcmVkSW5wdXQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqIEBqc3gganN4ICovXG5pbXBvcnQgeyBGb2N1c0V2ZW50SGFuZGxlciwgRnVuY3Rpb25Db21wb25lbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmNvbnN0IFJlcXVpcmVkSW5wdXQ6IEZ1bmN0aW9uQ29tcG9uZW50PHtcbiAgcmVhZG9ubHkgbmFtZTogc3RyaW5nO1xuICByZWFkb25seSBvbkZvY3VzOiBGb2N1c0V2ZW50SGFuZGxlcjxIVE1MSW5wdXRFbGVtZW50Pjtcbn0+ID0gKHsgbmFtZSwgb25Gb2N1cyB9KSA9PiAoXG4gIDxpbnB1dFxuICAgIHJlcXVpcmVkXG4gICAgbmFtZT17bmFtZX1cbiAgICB0YWJJbmRleD17LTF9XG4gICAgb25Gb2N1cz17b25Gb2N1c31cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAncmVxdWlyZWRJbnB1dCcsXG4gICAgICBvcGFjaXR5OiAwLFxuICAgICAgcG9pbnRlckV2ZW50czogJ25vbmUnLFxuICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICBib3R0b206IDAsXG4gICAgICBsZWZ0OiAwLFxuICAgICAgcmlnaHQ6IDAsXG4gICAgICB3aWR0aDogJzEwMCUnLFxuICAgIH19XG4gICAgLy8gUHJldmVudCBgU3dpdGNoaW5nIGZyb20gdW5jb250cm9sbGVkIHRvIGNvbnRyb2xsZWRgIGVycm9yXG4gICAgdmFsdWU9XCJcIlxuICAgIG9uQ2hhbmdlPXsoKSA9PiB7fX1cbiAgLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IFJlcXVpcmVkSW5wdXQ7XG4iXX0= */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}},rd=function(e){var t=e.name,n=e.onFocus;return ql("input",{required:!0,name:t,tabIndex:-1,onFocus:n,css:id,value:"",onChange:function(){}})},od=function(e){return e.label},sd=function(e){return e.value},ad={clearIndicator:pu,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,i=e.isFocused,r=e.theme,o=r.colors,s=r.borderRadius;return ds({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:r.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?o.neutral5:o.neutral0,borderColor:n?o.neutral10:i?o.primary:o.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},dropdownIndicator:gu,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,i=n.colors,r=n.spacing;return ds({label:"group",cursor:"default",display:"block"},t?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*r.baseUnit,paddingRight:3*r.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,i=e.theme,r=i.spacing.baseUnit,o=i.colors;return ds({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?o.neutral10:o.neutral20,marginBottom:2*r,marginTop:2*r})},input:function(e,t){var n=e.isDisabled,i=e.value,r=e.theme,o=r.spacing,s=r.colors;return ds(ds({visibility:n?"hidden":"visible",transform:i?"translateZ(0)":""},xu),t?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:s.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,i=e.size,r=e.theme,o=r.colors,s=r.spacing.baseUnit;return ds({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?o.neutral60:o.neutral20,padding:2*s})},loadingMessage:nu,menu:function(e,t){var n,i=e.placement,r=e.theme,o=r.borderRadius,s=r.spacing,a=r.colors;return ds((cs(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(i),"100%"),cs(n,"position","absolute"),cs(n,"width","100%"),cs(n,"zIndex",1),n),t?{}:{backgroundColor:a.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},menuList:function(e,t){var n=e.maxHeight,i=e.theme.spacing.baseUnit;return ds({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:i,paddingTop:i})},menuPortal:function(e){var t=e.rect,n=e.offset,i=e.position;return{left:t.left,position:i,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,i=n.spacing,r=n.borderRadius,o=n.colors;return ds({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:o.neutral10,borderRadius:r/2,margin:i.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,i=n.borderRadius,r=n.colors,o=e.cropWithEllipsis;return ds({overflow:"hidden",textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:i/2,color:r.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,i=n.spacing,r=n.borderRadius,o=n.colors,s=e.isFocused;return ds({alignItems:"center",display:"flex"},t?{}:{borderRadius:r/2,backgroundColor:s?o.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},noOptionsMessage:tu,option:function(e,t){var n=e.isDisabled,i=e.isFocused,r=e.isSelected,o=e.theme,s=o.spacing,a=o.colors;return ds({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:r?a.primary:i?a.primary25:"transparent",color:n?a.neutral20:r?a.neutral0:"inherit",padding:"".concat(2*s.baseUnit,"px ").concat(3*s.baseUnit,"px"),":active":{backgroundColor:n?void 0:r?a.primary:a.primary50}})},placeholder:function(e,t){var n=e.theme,i=n.spacing,r=n.colors;return ds({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:r.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,i=e.theme,r=i.spacing,o=i.colors;return ds({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?o.neutral40:o.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,i=e.isMulti,r=e.hasValue,o=e.selectProps.controlShouldRenderValue;return ds({alignItems:"center",display:i&&r&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},ld={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},cd={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Vc(),captureMenuScroll:!Vc(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=ds({ignoreCase:!0,ignoreAccents:!0,stringify:Hu,trim:!0,matchFrom:"any"},nd),i=n.ignoreCase,r=n.ignoreAccents,o=n.stringify,s=n.trim,a=n.matchFrom,l=s?Gu(t):t,c=s?Gu(o(e)):o(e);return i&&(l=l.toLowerCase(),c=c.toLowerCase()),r&&(l=Wu(l),c=Pu(c)),"start"===a?c.substr(0,l.length)===l:c.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:od,getOptionValue:sd,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function ud(e,t,n,i){return{type:"option",data:t,isDisabled:md(e,t,n),isSelected:vd(e,t,n),label:gd(e,t),value:pd(e,t),index:i}}function dd(e,t){return e.options.map((function(n,i){if("options"in n){var r=n.options.map((function(n,i){return ud(e,n,t,i)})).filter((function(t){return fd(e,t)}));return r.length>0?{type:"group",data:n,options:r,index:i}:void 0}var o=ud(e,n,t,i);return fd(e,o)?o:void 0})).filter(Uc)}function hd(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,Es(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function fd(e,t){var n=e.inputValue,i=void 0===n?"":n,r=t.data,o=t.isSelected,s=t.label,a=t.value;return(!yd(e)||!o)&&bd(e,{label:s,value:a,data:r},i)}var gd=function(e,t){return e.getOptionLabel(t)},pd=function(e,t){return e.getOptionValue(t)};function md(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function vd(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var i=pd(e,t);return n.some((function(t){return pd(e,t)===i}))}function bd(e,t,n){return!e.filterOption||e.filterOption(t,n)}var yd=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},wd=1,Cd=function(t){!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&&ws(e,t)}(s,e.Component);var n,i,r,o=Ss(s);function s(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=o.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},t.blockOptionHover=!1,t.isComposing=!1,t.commonProps=void 0,t.initialTouchX=0,t.initialTouchY=0,t.instancePrefix="",t.openAfterFocus=!1,t.scrollToFocusedOptionOnUpdate=!1,t.userIsDragging=void 0,t.controlRef=null,t.getControlRef=function(e){t.controlRef=e},t.focusedOptionRef=null,t.getFocusedOptionRef=function(e){t.focusedOptionRef=e},t.menuListRef=null,t.getMenuListRef=function(e){t.menuListRef=e},t.inputRef=null,t.getInputRef=function(e){t.inputRef=e},t.focus=t.focusInput,t.blur=t.blurInput,t.onChange=function(e,n){var i=t.props,r=i.onChange,o=i.name;n.name=o,t.ariaOnChange(e,n),r(e,n)},t.setValue=function(e,n,i){var r=t.props,o=r.closeMenuOnSelect,s=r.isMulti,a=r.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:a}),o&&(t.setState({inputIsHiddenAfterUpdate:!s}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(e,{action:n,option:i})},t.selectOption=function(e){var n=t.props,i=n.blurInputOnSelect,r=n.isMulti,o=n.name,s=t.state.selectValue,a=r&&t.isOptionSelected(e,s),l=t.isOptionDisabled(e,s);if(a){var c=t.getOptionValue(e);t.setValue(s.filter((function(e){return t.getOptionValue(e)!==c})),"deselect-option",e)}else{if(l)return void t.ariaOnChange(e,{action:"select-option",option:e,name:o});r?t.setValue([].concat(Es(s),[e]),"select-option",e):t.setValue(e,"select-option")}i&&t.blurInput()},t.removeValue=function(e){var n=t.props.isMulti,i=t.state.selectValue,r=t.getOptionValue(e),o=i.filter((function(e){return t.getOptionValue(e)!==r})),s=Yc(n,o,o[0]||null);t.onChange(s,{action:"remove-value",removedValue:e}),t.focusInput()},t.clearValue=function(){var e=t.state.selectValue;t.onChange(Yc(t.props.isMulti,[],null),{action:"clear",removedValues:e})},t.popValue=function(){var e=t.props.isMulti,n=t.state.selectValue,i=n[n.length-1],r=n.slice(0,n.length-1),o=Yc(e,r,r[0]||null);t.onChange(o,{action:"pop-value",removedValue:i})},t.getValue=function(){return t.state.selectValue},t.cx=function(){for(var e=arguments.length,n=new Array(e),i=0;i5||o>5}},t.onTouchEnd=function(e){t.userIsDragging||(t.controlRef&&!t.controlRef.contains(e.target)&&t.menuListRef&&!t.menuListRef.contains(e.target)&&t.blurInput(),t.initialTouchX=0,t.initialTouchY=0)},t.onControlTouchEnd=function(e){t.userIsDragging||t.onControlMouseDown(e)},t.onClearIndicatorTouchEnd=function(e){t.userIsDragging||t.onClearIndicatorMouseDown(e)},t.onDropdownIndicatorTouchEnd=function(e){t.userIsDragging||t.onDropdownIndicatorMouseDown(e)},t.handleInputChange=function(e){var n=t.props.inputValue,i=e.currentTarget.value;t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange(i,{action:"input-change",prevInputValue:n}),t.props.menuIsOpen||t.onMenuOpen()},t.onInputFocus=function(e){t.props.onFocus&&t.props.onFocus(e),t.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(t.openAfterFocus||t.props.openMenuOnFocus)&&t.openMenu("first"),t.openAfterFocus=!1},t.onInputBlur=function(e){var n=t.props.inputValue;t.menuListRef&&t.menuListRef.contains(document.activeElement)?t.inputRef.focus():(t.props.onBlur&&t.props.onBlur(e),t.onInputChange("",{action:"input-blur",prevInputValue:n}),t.onMenuClose(),t.setState({focusedValue:null,isFocused:!1}))},t.onOptionHover=function(e){t.blockOptionHover||t.state.focusedOption===e||t.setState({focusedOption:e})},t.shouldHideSelectedOptions=function(){return yd(t.props)},t.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),t.focus()},t.onKeyDown=function(e){var n=t.props,i=n.isMulti,r=n.backspaceRemovesValue,o=n.escapeClearsValue,s=n.inputValue,a=n.isClearable,l=n.isDisabled,c=n.menuIsOpen,u=n.onKeyDown,d=n.tabSelectsValue,h=n.openMenuOnFocus,f=t.state,g=f.focusedOption,p=f.focusedValue,m=f.selectValue;if(!(l||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(t.blockOptionHover=!0,e.key){case"ArrowLeft":if(!i||s)return;t.focusValue("previous");break;case"ArrowRight":if(!i||s)return;t.focusValue("next");break;case"Delete":case"Backspace":if(s)return;if(p)t.removeValue(p);else{if(!r)return;i?t.popValue():a&&t.clearValue()}break;case"Tab":if(t.isComposing)return;if(e.shiftKey||!c||!d||!g||h&&t.isOptionSelected(g,m))return;t.selectOption(g);break;case"Enter":if(229===e.keyCode)break;if(c){if(!g)return;if(t.isComposing)return;t.selectOption(g);break}return;case"Escape":c?(t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange("",{action:"menu-close",prevInputValue:s}),t.onMenuClose()):a&&o&&t.clearValue();break;case" ":if(s)return;if(!c){t.openMenu("first");break}if(!g)return;t.selectOption(g);break;case"ArrowUp":c?t.focusOption("up"):t.openMenu("last");break;case"ArrowDown":c?t.focusOption("down"):t.openMenu("first");break;case"PageUp":if(!c)return;t.focusOption("pageup");break;case"PageDown":if(!c)return;t.focusOption("pagedown");break;case"Home":if(!c)return;t.focusOption("first");break;case"End":if(!c)return;t.focusOption("last");break;default:return}e.preventDefault()}},t.instancePrefix="react-select-"+(t.props.instanceId||++wd),t.state.selectValue=Oc(e.value),e.menuIsOpen&&t.state.selectValue.length){var n=t.buildFocusableOptions(),i=n.indexOf(t.state.selectValue[0]);t.state.focusedOption=n[i]}return t}return n=s,i=[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Dc(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,i=t.menuIsOpen,r=this.state.isFocused;(r&&!n&&e.isDisabled||r&&i&&!e.menuIsOpen)&&this.focusInput(),r&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):r||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Dc(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,i=n.selectValue,r=n.isFocused,o=this.buildFocusableOptions(),s="first"===e?0:o.length-1;if(!this.props.isMulti){var a=o.indexOf(i[0]);a>-1&&(s=a)}this.scrollToFocusedOptionOnUpdate=!(r&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:o[s]},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,i=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var r=n.indexOf(i);i||(r=-1);var o=n.length-1,s=-1;if(n.length){switch(e){case"previous":s=0===r?0:-1===r?o:r-1;break;case"next":r>-1&&r0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var r=0,o=i.indexOf(n);n||(o=-1),"up"===e?r=o>0?o-1:i.length-1:"down"===e?r=(o+1)%i.length:"pageup"===e?(r=o-t)<0&&(r=0):"pagedown"===e?(r=o+t)>i.length-1&&(r=i.length-1):"last"===e&&(r=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[r],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(ld):ds(ds({},ld),this.props.theme):ld}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,i=this.getClassNames,r=this.getValue,o=this.selectOption,s=this.setValue,a=this.props,l=a.isMulti,c=a.isRtl,u=a.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:i,getValue:r,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:o,selectProps:a,setValue:s,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return md(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return vd(this.props,e,t)}},{key:"filterOption",value:function(e,t){return bd(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,i=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:i})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,i=e.inputId,r=e.inputValue,o=e.tabIndex,s=e.form,a=e.menuIsOpen,c=e.required,u=this.getComponents().Input,d=this.state,h=d.inputIsHidden,f=d.ariaSelection,g=this.commonProps,p=i||this.getElementId("input"),m=ds(ds(ds({"aria-autocomplete":"list","aria-expanded":a,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":c,role:"combobox"},a&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==f?void 0:f.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?l.createElement(u,bs({},g,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:p,innerRef:this.getInputRef,isDisabled:t,isHidden:h,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:o,form:s,type:"text",value:r},m)):l.createElement(Vu,bs({id:p,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Lc,onFocus:this.onInputFocus,disabled:t,tabIndex:o,inputMode:"none",form:s,value:""},m))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,i=t.MultiValueContainer,r=t.MultiValueLabel,o=t.MultiValueRemove,s=t.SingleValue,a=t.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,h=u.isDisabled,f=u.isMulti,g=u.inputValue,p=u.placeholder,m=this.state,v=m.selectValue,b=m.focusedValue,y=m.isFocused;if(!this.hasValue()||!d)return g?null:l.createElement(a,bs({},c,{key:"placeholder",isDisabled:h,isFocused:y,innerProps:{id:this.getElementId("placeholder")}}),p);if(f)return v.map((function(t,s){var a=t===b,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return l.createElement(n,bs({},c,{components:{Container:i,Label:r,Remove:o},isFocused:a,isDisabled:h,key:u,index:s,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))}));if(g)return null;var w=v[0];return l.createElement(s,bs({},c,{data:w,isDisabled:h}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,r=n.isLoading,o=this.state.isFocused;if(!this.isClearable()||!e||i||!this.hasValue()||r)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return l.createElement(e,bs({},t,{innerProps:s,isFocused:o}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,r=n.isLoading,o=this.state.isFocused;return e&&r?l.createElement(e,bs({},t,{innerProps:{"aria-hidden":"true"},isDisabled:i,isFocused:o})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var i=this.commonProps,r=this.props.isDisabled,o=this.state.isFocused;return l.createElement(n,bs({},i,{isDisabled:r,isFocused:o}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,i=this.state.isFocused,r={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return l.createElement(e,bs({},t,{innerProps:r,isDisabled:n,isFocused:i}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,i=t.GroupHeading,r=t.Menu,o=t.MenuList,s=t.MenuPortal,a=t.LoadingMessage,c=t.NoOptionsMessage,u=t.Option,d=this.commonProps,h=this.state.focusedOption,f=this.props,g=f.captureMenuScroll,p=f.inputValue,m=f.isLoading,v=f.loadingMessage,b=f.minMenuHeight,y=f.maxMenuHeight,w=f.menuIsOpen,C=f.menuPlacement,x=f.menuPosition,S=f.menuPortalTarget,E=f.menuShouldBlockScroll,A=f.menuShouldScrollIntoView,R=f.noOptionsMessage,I=f.onMenuScrollToTop,k=f.onMenuScrollToBottom;if(!w)return null;var $,_=function(t,n){var i=t.type,r=t.data,o=t.isDisabled,s=t.isSelected,a=t.label,c=t.value,f=h===r,g=o?void 0:function(){return e.onOptionHover(r)},p=o?void 0:function(){return e.selectOption(r)},m="".concat(e.getElementId("option"),"-").concat(n),v={id:m,onClick:p,onMouseMove:g,onMouseOver:g,tabIndex:-1};return l.createElement(u,bs({},d,{innerProps:v,data:r,isDisabled:o,isSelected:s,key:m,label:a,type:i,value:c,isFocused:f,innerRef:f?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())$=this.getCategorizedOptions().map((function(t){if("group"===t.type){var r=t.data,o=t.options,s=t.index,a="".concat(e.getElementId("group"),"-").concat(s),c="".concat(a,"-heading");return l.createElement(n,bs({},d,{key:a,data:r,options:o,Heading:i,headingProps:{id:c,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return _(e,"".concat(s,"-").concat(e.index))})))}if("option"===t.type)return _(t,"".concat(t.index))}));else if(m){var L=v({inputValue:p});if(null===L)return null;$=l.createElement(a,d,L)}else{var T=R({inputValue:p});if(null===T)return null;$=l.createElement(c,d,T)}var M={minMenuHeight:b,maxMenuHeight:y,menuPlacement:C,menuPosition:x,menuShouldScrollIntoView:A},O=l.createElement(qc,bs({},d,M),(function(t){var n=t.ref,i=t.placerProps,s=i.placement,a=i.maxHeight;return l.createElement(r,bs({},d,M,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove,id:e.getElementId("listbox")},isLoading:m,placement:s}),l.createElement(td,{captureEnabled:g,onTopArrive:I,onBottomArrive:k,lockEnabled:E},(function(t){return l.createElement(o,bs({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},isLoading:m,maxHeight:a,focusedOption:h}),$)})))}));return S||"fixed"===x?l.createElement(s,bs({},d,{appendTo:S,controlElement:this.controlRef,menuPlacement:C,menuPosition:x}),O):O}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,i=t.isDisabled,r=t.isMulti,o=t.name,s=t.required,a=this.state.selectValue;if(o&&!i){if(s&&!this.hasValue())return l.createElement(rd,{name:o,onFocus:this.onValueInputFocus});if(r){if(n){var c=a.map((function(t){return e.getOptionValue(t)})).join(n);return l.createElement("input",{name:o,type:"hidden",value:c})}var u=a.length>0?a.map((function(t,n){return l.createElement("input",{key:"i-".concat(n),name:o,type:"hidden",value:e.getOptionValue(t)})})):l.createElement("input",{name:o,type:"hidden",value:""});return l.createElement("div",null,u)}var d=a[0]?this.getOptionValue(a[0]):"";return l.createElement("input",{name:o,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,i=t.focusedOption,r=t.focusedValue,o=t.isFocused,s=t.selectValue,a=this.getFocusableOptions();return l.createElement(Lu,bs({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:i,focusedValue:r,isFocused:o,selectValue:s,focusableOptions:a}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,i=e.SelectContainer,r=e.ValueContainer,o=this.props,s=o.className,a=o.id,c=o.isDisabled,u=o.menuIsOpen,d=this.state.isFocused,h=this.commonProps=this.getCommonProps();return l.createElement(i,bs({},h,{className:s,innerProps:{id:a,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:d}),this.renderLiveRegion(),l.createElement(t,bs({},h,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:d,menuIsOpen:u}),l.createElement(r,bs({},h,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),l.createElement(n,bs({},h,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,i=t.clearFocusValueOnUpdate,r=t.inputIsHiddenAfterUpdate,o=t.ariaSelection,s=t.isFocused,a=t.prevWasFocused,l=e.options,c=e.value,u=e.menuIsOpen,d=e.inputValue,h=e.isMulti,f=Oc(c),g={};if(n&&(c!==n.value||l!==n.options||u!==n.menuIsOpen||d!==n.inputValue)){var p=u?function(e,t){return hd(dd(e,t))}(e,f):[],m=i?function(e,t){var n=e.focusedValue,i=e.selectValue.indexOf(n);if(i>-1){if(t.indexOf(n)>-1)return n;if(i-1?n:t[0]}(t,p);g={selectValue:f,focusedOption:v,focusedValue:m,clearFocusValueOnUpdate:!1}}var b=null!=r&&e!==n?{inputIsHidden:r,inputIsHiddenAfterUpdate:void 0}:{},y=o,w=s&&a;return s&&!w&&(y={value:Yc(h,f,f[0]||null),options:f,action:"initial-input-focus"},w=!a),"initial-input-focus"===(null==o?void 0:o.action)&&(y=null),ds(ds(ds({},g),b),{},{prevProps:e,ariaSelection:y,prevWasFocused:w})}}],i&&ys(n.prototype,i),r&&ys(n,r),Object.defineProperty(n,"prototype",{writable:!1}),s}();Cd.defaultProps=cd;var xd=e.forwardRef((function(e,t){var n=vs(e);return l.createElement(Cd,bs({ref:t},n))}));function Sd(e){var t=e.data,n=t.label,i=t.icon,r=t.tooltip;return c.default.createElement(Au.Option,u({},e,{className:i?"has-icon":Qt}),c.default.createElement(Vn,{extraClass:"option-tooltip",data:r},c.default.createElement("div",{className:"option-wrapper"},i,n)))}function Ed(e){var t=e.data,n=t.icon,i=t.label;return c.default.createElement(Au.SingleValue,u({},e),n,c.default.createElement(li,{extraClasses:"react-select__single-value-label"},i))}function Ad(e){var t=e.data,n=t.chipLabel,i=t.chipTooltip,r=t.label;return c.default.createElement(Au.MultiValue,u({},e),c.default.createElement(Vn,{data:i||r,placement:"left"},c.default.createElement("span",null,n||r)))}function Rd(e){var t=e.selectProps;return c.default.createElement(Vn,{data:t.clearText||Qt},c.default.createElement("div",null,c.default.createElement(Au.ClearIndicator,u({},e))))}function Id(e){var t=e.children,n=d(e,["children"]);return c.default.createElement(Au.MenuList,u({},n),c.default.createElement("div",{className:"list-wrapper"},t))}function kd(n){var i,r=n.onChange,o=void 0===r?qt:r,s=n.options,a=n.value,l=n.wrapperClass,f=void 0===l?Qt:l,g=n.isMulti,m=n.label,v=n.disabled,b=n.sortOptions,y=n.error,w=n.placeholder,C=n.info,x=n.isRequired,S=n.redInfo,E=void 0===S?qt:S,A=n.isSingleClearable,R=void 0!==A&&A,k=n.isClearable,$=void 0===k||k,_=n.autoFocus,L=void 0!==_&&_,T=n.groupedOptions,M=void 0!==T&&T,O=n.expandInputOnFocus,N=d(n,["onChange","options","value","wrapperClass","isMulti","label","disabled","sortOptions","error","placeholder","info","isRequired","redInfo","isSingleClearable","isClearable","autoFocus","groupedOptions","expandInputOnFocus"]),B=h(e.useState(null),2),F=B[0],P=B[1],W=e.useMemo((function(){return M?s.reduce((function(e,t){return t.options.forEach((function(t){var n=t.label,i=t.value;return e.push(Xn.formatOption(n,i))})),e}),[]):[]}),[JSON.stringify(s)]);e.useEffect((function(){if(P(b?Xn.insensitiveSort(s,"label"):s),g){if(a){var e=a.filter((function(e){return s.find((function(t){return t.value===e}))}));Xn.isEmpty(e)?o([]):e.length!==a.length&&o(e)}}else a&&!s.find((function(e){return e.value===a}))&&o(Qt)}),[JSON.stringify(s)]);var G,H,D=p(((i={"select-wrapper":!0})[f]=!0,i["select-wrapper-is-multi"]=g,i["has-error"]=y,i["no-label"]=!m,i["expand-input-on-focus"]=O,i));return c.default.createElement(t.FormControl,{variant:"outlined",className:D},c.default.createElement("span",{className:"select-label field-1-label-content"},m,x&&c.default.createElement("span",{className:"required-star"},"*"),!!C&&c.default.createElement(Vn,{data:C},c.default.createElement(I,null))),c.default.createElement(xd,u({},N,{menuPosition:"fixed",isDisabled:v,styles:(G=!!y,H=!!m,{menuPortal:function(e,t){return u(u({},e),{zIndex:9999,top:t.offset===t.rect.top?t.offset+6:t.offset-6})},menu:function(e){return u(u({},e),{boxShadow:"0 0 0 2px var(--main-color)",backgroundColor:"var(--neutral-t4)"})},control:function(e,t){return u(u(u(u({},e),{height:H?48:32,minHeight:H?48:32}),G?{boxShadow:"0 0 0 1px var(--focus-key)"}:{boxShadow:t.isFocused?"0 0 0 1px var(--main-color)":0}),G?{borderColor:"var(--focus-key)","&:hover":{borderColor:"state.isFocused"}}:{borderColor:t.isFocused?"var(--main-color)":"var(--ironhide-t1)","&:hover":{borderColor:t.isFocused?"var(--main-color)":"var(--ironhide-t1)"}})},clearIndicator:function(e,t){var n=t.isDisabled;return u(u({},e),{cursor:"pointer",color:n?"var(--ironhide-key)":"var(--main-color)",":hover":{color:n?"var(--ironhide-key)":"var(--main-color)"}})},indicatorSeparator:function(e,t){return u(u({},e),{backgroundColor:t.isFocused?"var(--main-color)":"var(--ironhide-t1)"})},dropdownIndicator:function(e,t){return u(u({},e),{color:t.isDisabled?"var(--ironhide-key)":"var(--main-color)",":hover":{color:t.isDisabled?"var(--ironhide-key)":"var(--main-color)"},">svg":{transform:t.selectProps.menuIsOpen&&"rotate(180deg)"}})},option:function(e,t){var n=t.isDisabled;return u(u({},e),{color:"var(--text-color)",opacity:n&&".5",backgroundColor:n?"transparent":"var(--neutral-t4)",":hover":{backgroundColor:n?"transparent":"var(--ironhide-t3)"}})}}),autoFocus:L,value:g?a?a.map((function(e){return s.find((function(t){return t.value===e}))})):Qt:M?W.find((function(e){return e.value===a})):s.find((function(e){return e.value===a}))||Qt,options:F,autosize:!0,isMulti:g,isClearable:g&&$||R,onChange:function(e){if(g)o(e.map((function(e){return e.value})));else if(e){var t=e.value;o(t)}else o(Qt)},classNamePrefix:"react-select",dropdownAlign:{offset:[0,0]},components:{Option:Sd,SingleValue:Ed,MultiValue:Ad,ClearIndicator:Rd,MenuList:Id},menuPortalTarget:document.body,closeMenuOnSelect:!g,placeholder:w||"Select..."})),c.default.createElement("span",{className:"select-error capitalize-first-letter"},y||E(a)))}var $d=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],_d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=String(e).toLowerCase(),r=String(n.getOptionValue(t)).toLowerCase(),o=String(n.getOptionLabel(t)).toLowerCase();return r===i||o===i},Ld={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,n,i){return!(!e||t.some((function(t){return _d(e,t,i)}))||n.some((function(t){return _d(e,t,i)})))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}};var Td=e.forwardRef((function(t,n){var i=function(t){var n=t.allowCreateWhileLoading,i=void 0!==n&&n,r=t.createOptionPosition,o=void 0===r?"last":r,s=t.formatCreateLabel,a=void 0===s?Ld.formatCreateLabel:s,l=t.isValidNewOption,c=void 0===l?Ld.isValidNewOption:l,u=t.getNewOptionData,d=void 0===u?Ld.getNewOptionData:u,h=t.onCreateOption,f=t.options,g=void 0===f?[]:f,p=t.onChange,m=ps(t,$d),v=m.getOptionValue,b=void 0===v?sd:v,y=m.getOptionLabel,w=void 0===y?od:y,C=m.inputValue,x=m.isLoading,S=m.isMulti,E=m.value,A=m.name,R=e.useMemo((function(){return c(C,Oc(E),g,{getOptionValue:b,getOptionLabel:w})?d(C,a(C)):void 0}),[a,d,w,b,C,c,g,E]),I=e.useMemo((function(){return!i&&x||!R?g:"first"===o?[R].concat(Es(g)):[].concat(Es(g),[R])}),[i,o,x,R,g]),k=e.useCallback((function(e,t){if("select-option"!==t.action)return p(e,t);var n=Array.isArray(e)?e:[e];if(n[n.length-1]!==R)p(e,t);else if(h)h(C);else{var i=d(C,C),r={action:"create-option",name:A,option:i};p(Yc(S,[].concat(Es(Oc(E)),[i]),i),r)}}),[d,C,S,A,R,h,p,E]);return ds(ds({},m),{},{options:I,onChange:k})}(vs(t));return l.createElement(Cd,bs({ref:n},i))}));function Md(n){var i,r=n.label,o=n.onChange,s=n.value,a=void 0===s?[]:s,l=n.error,f=n.placeholder,g=n.wrapperClass,m=void 0===g?"":g,v=n.tagsValidation,b=void 0===v?function(e){return e}:v,y=n.warning,w=n.isRequired,C=n.info,x=n.invalidTagText,S=n.disabled,E=n.isClearable,A=d(n,["label","onChange","value","error","placeholder","wrapperClass","tagsValidation","warning","isRequired","info","invalidTagText","disabled","isClearable"]),R=h(e.useState(Qt),2),k=R[0],$=R[1],_=h(e.useState(!1),2),L=_[0],T=_[1],M=h(e.useState([]),2),O=M[0],N=M[1];e.useEffect((function(){N(null==a?void 0:a.map(Xn.formatOption))}),[JSON.stringify(a)]),e.useEffect((function(){L&&T(!1)}),[k]);var B=p(((i={})[m]=!0,i["tagsbox-wrapper"]=!0,i["has-error"]=!!l,i));function F(e){e.stopPropagation();var t=Array.from(new Set("".concat(a).concat(en).concat(k).split(en).filter((function(e){return e}))));Xn.isEmpty(b([k]))?T(!0):(o(b(t)),$(Qt))}return c.default.createElement(t.FormControl,{className:B},c.default.createElement("span",{className:"tags-label field-1-label-content"},r,w&&c.default.createElement("span",{className:"required-star"},"*"),!!C&&c.default.createElement(Vn,{data:C},c.default.createElement(I,null))),c.default.createElement(Td,u({components:{DropdownIndicator:null},inputValue:k,isClearable:E,isMulti:!0,isDisabled:S,onChange:function(e){o(e.map((function(e){return e.label})))},onInputChange:$,onKeyDown:function(e){if(new Set([en,"Enter"]).has(e.key)){k&&e.preventDefault();var t=Array.from(new Set("".concat(a).concat(en).concat(k).split(en).filter((function(e){return e}))));Xn.isEmpty(b([k]))?T(!0):(o(b(t)),$(Qt))}},placeholder:f,noOptionsMessage:function(){return null},value:O,formatCreateLabel:function(e){return c.default.createElement("div",{onClick:F,className:"tags-user-input-preview"},"'".concat(e,"'"),L&&c.default.createElement("span",{className:"tags-invalid"}," - ".concat(x||"Invalid value")))},classNamePrefix:"react-tagsbox"},A)),c.default.createElement("span",{className:"tags-box-error capitalize-first-letter"},L||l),a&&!l&&y&&c.default.createElement("span",{className:"tags-warning"},y))}var Od=c.default.forwardRef((function(e,t){var n,i=e.label,r=void 0===i?Qt:i,o=e.onChange,s=e.value,a=void 0===s?Qt:s,l=e.error,f=e.placeholder,g=e.wrapperClass,m=void 0===g?"":g,v=e.tooltip,b=e.Icon,y=e.type,w=e.info,C=e.isRequired,x=e.allowDecimal,S=d(e,["label","onChange","value","error","placeholder","wrapperClass","tooltip","Icon","type","info","isRequired","allowDecimal"]),E=h(Po(!1),2),A=E[0],R=E[1];var k=p(((n={})[m]=!0,n["text-box-field"]=!0,n["has-error"]=!!l,n["no-label"]=!r,n["has-icon"]=!!b,n)),$=p({field__input:!0,"is-type-password":"password"===y});return c.default.createElement(Vn,{data:v},c.default.createElement("div",{className:k},b&&c.default.createElement(b,{className:"text-box-icon"}),c.default.createElement("input",u({onKeyDown:function(e){"number"!==y||"e"!==e.key&&"E"!==e.key&&"-"!==e.key&&"+"!==e.key&&(x||"."!==e.key)||e.preventDefault()},step:"any",autoComplete:"new-password",className:$,placeholder:f,value:null===a?Qt:a,onChange:function(e){Number.isNaN(e.target.valueAsNumber)?o(e.target.value):o(e.target.valueAsNumber>=0?e.target.valueAsNumber:0)},ref:t,type:A&&"password"===y?"text":y},S)),"password"===y&&c.default.createElement("span",{className:"password-icon"},Xn.getPasswordIcon(A,R)),c.default.createElement("span",{className:"field__label-wrap"},c.default.createElement("span",{className:"field__label field-1-label-content"},r,C&&c.default.createElement("span",{className:"required-star"},"*"),!!w&&c.default.createElement(Vn,{data:w},c.default.createElement(I,null)))),c.default.createElement("span",{className:"text-box-error capitalize-first-letter"},l)))}));function Nd(e){var n=e.open,i=e.anchorEl,r=e.onClickAway,o=e.items,s=e.disablePortal,a=e.extraPopperClass,l=void 0===a?Qt:a;return c.default.createElement(t.Popper,{open:n,anchorEl:i,transition:!0,disablePortal:s,className:"popper-wrapper",nonce:void 0,onResize:void 0,onResizeCapture:void 0},(function(e){var n=e.TransitionProps;return c.default.createElement(t.Grow,u({},n,{style:{transformOrigin:"center top"}}),c.default.createElement(t.Paper,{className:p("menu-popper",l)},c.default.createElement(t.ClickAwayListener,{onClickAway:r},c.default.createElement(t.MenuList,{disablePadding:!0},o.map((function(e){return e.hideMenu?null:c.default.createElement(Vn,{key:e.key||e.text,data:(n=e.disabled,i=e.tooltip,void 0===n&&(n=""),void 0===i&&(i=""),Xn.isString(n)&&!Xn.isEmpty(n)?n:Xn.isEmpty(i)?Qt:i)},c.default.createElement("div",{className:"menu-popper-item-wrapper dropdown-lines-1 ".concat(e.extraClass)},c.default.createElement(t.MenuItem,{disabled:!!e.disabled,className:"menu-popper-item",onClick:function(t){t.stopPropagation(),e.onClick(),r()}},e.content||e.text),c.default.createElement(t.Divider,{className:"separator"})));var n,i}))))))}))}Nd.defaultProps={disablePortal:!1},Nd.propTypes={};const Bd=[{id:0,value:"Too weak",minDiversity:0,minLength:0},{id:1,value:"Weak",minDiversity:2,minLength:6},{id:2,value:"Medium",minDiversity:4,minLength:8},{id:3,value:"Strong",minDiversity:4,minLength:10}];var Fd=(e,t=Bd,n="!\"#$%&'()*+,-./:;<=>?@[\\\\\\]^_`{|}~")=>{let i=e||"";t[0].minDiversity=0,t[0].minLength=0;const r=[{regex:"[a-z]",message:"lowercase"},{regex:"[A-Z]",message:"uppercase"},{regex:"[0-9]",message:"number"}];n&&r.push({regex:`[${n}]`,message:"symbol"});let o={};o.contains=r.filter((e=>new RegExp(`${e.regex}`).test(i))).map((e=>e.message)),o.length=i.length;let s=t.filter((e=>o.contains.length>=e.minDiversity)).filter((e=>o.length>=e.minLength)).sort(((e,t)=>t.id-e.id)).map((e=>({id:e.id,value:e.value})));return Object.assign(o,s[0]),o};function Pd(e){var n=e.message,i=e.icon;return c.default.createElement("div",{className:"toast-wrapper"},c.default.createElement("span",null,i),c.default.createElement("span",{className:"label-1"},n),c.default.createElement("div",{className:"copy-btn-div"},c.default.createElement(t.IconButton,{className:"toast-copy",onClick:function(e){e.stopPropagation(),ni(n)}},c.default.createElement(y,null))))}Pd.propTypes={};var Wd={exports:{}},Gd={exports:{}};!function(e,t){function n(e,t,n,i,r,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(i,r)}function i(e){return function(){var t=this,i=arguments;return new Promise((function(r,o){var s=e.apply(t,i);function a(e){n(s,r,o,a,l,"next",e)}function l(e){n(s,r,o,a,l,"throw",e)}a(void 0)}))}}function r(){return(r=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}function s(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var a={init:"init"},l=function(e){var t=e.value;return void 0===t?"":t},c=function(){return t.createElement(t.Fragment,null," ")},u={Cell:l,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function d(){for(var e=arguments.length,t=new Array(e),n=0;n(o="number"==typeof o?o:1/0)){var s=r;r=o,o=s}return e.filter((function(e){return t.some((function(t){var n=e.values[t];return n>=r&&n<=o}))}))};Se.autoRemove=function(e){return!e||"number"!=typeof e[0]&&"number"!=typeof e[1]};var Ee=Object.freeze({__proto__:null,text:ge,exactText:pe,exactTextCase:me,includes:ve,includesAll:be,includesSome:ye,includesValue:we,exact:Ce,equals:xe,between:Se});a.resetFilters="resetFilters",a.setFilter="setFilter",a.setAllFilters="setAllFilters";var Ae=function(e){e.stateReducers.push(Re),e.useInstance.push(Ie)};function Re(e,t,n,i){if(t.type===a.init)return r({filters:[]},e);if(t.type===a.resetFilters)return r({},e,{filters:i.initialState.filters||[]});if(t.type===a.setFilter){var o=t.columnId,s=t.filterValue,l=i.allColumns,c=i.filterTypes,u=l.find((function(e){return e.id===o}));if(!u)throw new Error("React-Table: Could not find a column with id: "+o);var d=T(u.filter,c||{},Ee),h=e.filters.find((function(e){return e.id===o})),f=m(s,h&&h.value);return M(d.autoRemove,f,u)?r({},e,{filters:e.filters.filter((function(e){return e.id!==o}))}):r({},e,h?{filters:e.filters.map((function(e){return e.id===o?{id:o,value:f}:e}))}:{filters:[].concat(e.filters,[{id:o,value:f}])})}if(t.type===a.setAllFilters){var g=t.filters,p=i.allColumns,v=i.filterTypes;return r({},e,{filters:m(g,e.filters).filter((function(e){var t=p.find((function(t){return t.id===e.id}));return!M(T(t.filter,v||{},Ee).autoRemove,e.value,t)}))})}}function Ie(e){var n=e.data,i=e.rows,r=e.flatRows,o=e.rowsById,s=e.allColumns,l=e.filterTypes,c=e.manualFilters,u=e.defaultCanFilter,d=void 0!==u&&u,h=e.disableFilters,f=e.state.filters,g=e.dispatch,p=e.autoResetFilters,m=void 0===p||p,b=t.useCallback((function(e,t){g({type:a.setFilter,columnId:e,filterValue:t})}),[g]),w=t.useCallback((function(e){g({type:a.setAllFilters,filters:e})}),[g]);s.forEach((function(e){var t=e.id,n=e.accessor,i=e.defaultCanFilter,r=e.disableFilters;e.canFilter=n?k(!0!==r&&void 0,!0!==h&&void 0,!0):k(i,d,!1),e.setFilter=function(t){return b(e.id,t)};var o=f.find((function(e){return e.id===t}));e.filterValue=o&&o.value}));var C=t.useMemo((function(){if(c||!f.length)return[i,r,o];var e=[],t={};return[function n(i,r){void 0===r&&(r=0);var o=i;return(o=f.reduce((function(e,t){var n=t.id,i=t.value,o=s.find((function(e){return e.id===n}));if(!o)return e;0===r&&(o.preFilteredRows=e);var a=T(o.filter,l||{},Ee);return a?(o.filteredRows=a(e,[n],i),o.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+o.id+"."),e)}),i)).forEach((function(i){e.push(i),t[i.id]=i,i.subRows&&(i.subRows=i.subRows&&i.subRows.length>0?n(i.subRows,r+1):i.subRows)})),o}(i),e,t]}),[c,f,i,r,o,s,l]),x=C[0],S=C[1],E=C[2];t.useMemo((function(){s.filter((function(e){return!f.find((function(t){return t.id===e.id}))})).forEach((function(e){e.preFilteredRows=x,e.filteredRows=x}))}),[x,f,s]);var A=v(m);y((function(){A()&&g({type:a.resetFilters})}),[g,c?null:n]),Object.assign(e,{preFilteredRows:i,preFilteredFlatRows:r,preFilteredRowsById:o,filteredRows:x,filteredFlatRows:S,filteredRowsById:E,rows:x,flatRows:S,rowsById:E,setFilter:b,setAllFilters:w})}Ae.pluginName="useFilters",a.resetGlobalFilter="resetGlobalFilter",a.setGlobalFilter="setGlobalFilter";var ke=function(e){e.stateReducers.push($e),e.useInstance.push(_e)};function $e(e,t,n,i){if(t.type===a.resetGlobalFilter)return r({},e,{globalFilter:i.initialState.globalFilter||void 0});if(t.type===a.setGlobalFilter){var s=t.filterValue,l=i.userFilterTypes,c=T(i.globalFilter,l||{},Ee),u=m(s,e.globalFilter);return M(c.autoRemove,u)?(e.globalFilter,o(e,["globalFilter"])):r({},e,{globalFilter:u})}}function _e(e){var n=e.data,i=e.rows,r=e.flatRows,o=e.rowsById,s=e.allColumns,l=e.filterTypes,c=e.globalFilter,u=e.manualGlobalFilter,d=e.state.globalFilter,h=e.dispatch,f=e.autoResetGlobalFilter,g=void 0===f||f,p=e.disableGlobalFilter,m=t.useCallback((function(e){h({type:a.setGlobalFilter,filterValue:e})}),[h]),b=t.useMemo((function(){if(u||void 0===d)return[i,r,o];var e=[],t={},n=T(c,l||{},Ee);if(!n)return console.warn("Could not find a valid 'globalFilter' option."),i;s.forEach((function(e){var t=e.disableGlobalFilter;e.canFilter=k(!0!==t&&void 0,!0!==p&&void 0,!0)}));var a=s.filter((function(e){return!0===e.canFilter}));return[function i(r){return(r=n(r,a.map((function(e){return e.id})),d)).forEach((function(n){e.push(n),t[n.id]=n,n.subRows=n.subRows&&n.subRows.length?i(n.subRows):n.subRows})),r}(i),e,t]}),[u,d,c,l,s,i,r,o,p]),w=b[0],C=b[1],x=b[2],S=v(g);y((function(){S()&&h({type:a.resetGlobalFilter})}),[h,u?null:n]),Object.assign(e,{preGlobalFilteredRows:i,preGlobalFilteredFlatRows:r,preGlobalFilteredRowsById:o,globalFilteredRows:w,globalFilteredFlatRows:C,globalFilteredRowsById:x,rows:w,flatRows:C,rowsById:x,setGlobalFilter:m,disableGlobalFilter:p})}function Le(e,t){return t.reduce((function(e,t){return e+("number"==typeof t?t:0)}),0)}ke.pluginName="useGlobalFilter";var Te=Object.freeze({__proto__:null,sum:Le,min:function(e){var t=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.min(t,e))})),t},max:function(e){var t=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.max(t,e))})),t},minMax:function(e){var t=e[0]||0,n=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.min(t,e),n=Math.max(n,e))})),t+".."+n},average:function(e){return Le(0,e)/e.length},median:function(e){if(!e.length)return null;var t=Math.floor(e.length/2),n=[].concat(e).sort((function(e,t){return e-t}));return e.length%2!=0?n[t]:(n[t-1]+n[t])/2},unique:function(e){return Array.from(new Set(e).values())},uniqueCount:function(e){return new Set(e).size},count:function(e){return e.length}}),Me=[],Oe={};a.resetGroupBy="resetGroupBy",a.setGroupBy="setGroupBy",a.toggleGroupBy="toggleGroupBy";var Ne=function(e){e.getGroupByToggleProps=[Be],e.stateReducers.push(Fe),e.visibleColumnsDeps.push((function(e,t){var n=t.instance;return[].concat(e,[n.state.groupBy])})),e.visibleColumns.push(Pe),e.useInstance.push(Ge),e.prepareRow.push(He)};Ne.pluginName="useGroupBy";var Be=function(e,t){var n=t.header;return[e,{onClick:n.canGroupBy?function(e){e.persist(),n.toggleGroupBy()}:void 0,style:{cursor:n.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function Fe(e,t,n,i){if(t.type===a.init)return r({groupBy:[]},e);if(t.type===a.resetGroupBy)return r({},e,{groupBy:i.initialState.groupBy||[]});if(t.type===a.setGroupBy)return r({},e,{groupBy:t.value});if(t.type===a.toggleGroupBy){var o=t.columnId,s=t.value,l=void 0!==s?s:!e.groupBy.includes(o);return r({},e,l?{groupBy:[].concat(e.groupBy,[o])}:{groupBy:e.groupBy.filter((function(e){return e!==o}))})}}function Pe(e,t){var n=t.instance.state.groupBy,i=n.map((function(t){return e.find((function(e){return e.id===t}))})).filter(Boolean),r=e.filter((function(e){return!n.includes(e.id)}));return(e=[].concat(i,r)).forEach((function(e){e.isGrouped=n.includes(e.id),e.groupedIndex=n.indexOf(e.id)})),e}var We={};function Ge(e){var n=e.data,i=e.rows,o=e.flatRows,s=e.rowsById,l=e.allColumns,c=e.flatHeaders,u=e.groupByFn,d=void 0===u?De:u,f=e.manualGroupBy,g=e.aggregations,m=void 0===g?We:g,b=e.plugins,w=e.state.groupBy,C=e.dispatch,x=e.autoResetGroupBy,S=void 0===x||x,E=e.disableGroupBy,A=e.defaultCanGroupBy,R=e.getHooks;p(b,["useColumnOrder","useFilters"],"useGroupBy");var I=v(e);l.forEach((function(t){var n=t.accessor,i=t.defaultGroupBy,r=t.disableGroupBy;t.canGroupBy=n?k(t.canGroupBy,!0!==r&&void 0,!0!==E&&void 0,!0):k(t.canGroupBy,i,A,!1),t.canGroupBy&&(t.toggleGroupBy=function(){return e.toggleGroupBy(t.id)}),t.Aggregated=t.Aggregated||t.Cell}));var $=t.useCallback((function(e,t){C({type:a.toggleGroupBy,columnId:e,value:t})}),[C]),L=t.useCallback((function(e){C({type:a.setGroupBy,value:e})}),[C]);c.forEach((function(e){e.getGroupByToggleProps=h(R().getGroupByToggleProps,{instance:I(),header:e})}));var T=t.useMemo((function(){if(f||!w.length)return[i,o,s,Me,Oe,o,s];var e=w.filter((function(e){return l.find((function(t){return t.id===e}))})),t=[],n={},a=[],c={},u=[],h={},g=function i(o,s,f){if(void 0===s&&(s=0),s===e.length)return o.map((function(e){return r({},e,{depth:s})}));var g=e[s],p=d(o,g);return Object.entries(p).map((function(r,o){var d=r[0],p=r[1],v=g+":"+d,b=i(p,s+1,v=f?f+">"+v:v),y=s?_(p,"leafRows"):p,w=function(t,n,i){var r={};return l.forEach((function(o){if(e.includes(o.id))r[o.id]=n[0]?n[0].values[o.id]:null;else{var s="function"==typeof o.aggregate?o.aggregate:m[o.aggregate]||Te[o.aggregate];if(s){var a=n.map((function(e){return e.values[o.id]})),l=t.map((function(e){var t=e.values[o.id];if(!i&&o.aggregateValue){var n="function"==typeof o.aggregateValue?o.aggregateValue:m[o.aggregateValue]||Te[o.aggregateValue];if(!n)throw console.info({column:o}),new Error("React Table: Invalid column.aggregateValue option for column listed above");t=n(t,e,o)}return t}));r[o.id]=s(l,a)}else{if(o.aggregate)throw console.info({column:o}),new Error("React Table: Invalid column.aggregate option for column listed above");r[o.id]=null}}})),r}(y,p,s),C={id:v,isGrouped:!0,groupByID:g,groupByVal:d,values:w,subRows:b,leafRows:y,depth:s,index:o};return b.forEach((function(e){t.push(e),n[e.id]=e,e.isGrouped?(a.push(e),c[e.id]=e):(u.push(e),h[e.id]=e)})),C}))}(i);return g.forEach((function(e){t.push(e),n[e.id]=e,e.isGrouped?(a.push(e),c[e.id]=e):(u.push(e),h[e.id]=e)})),[g,t,n,a,c,u,h]}),[f,w,i,o,s,l,m,d]),M=T[0],O=T[1],N=T[2],B=T[3],F=T[4],P=T[5],W=T[6],G=v(S);y((function(){G()&&C({type:a.resetGroupBy})}),[C,f?null:n]),Object.assign(e,{preGroupedRows:i,preGroupedFlatRow:o,preGroupedRowsById:s,groupedRows:M,groupedFlatRows:O,groupedRowsById:N,onlyGroupedFlatRows:B,onlyGroupedRowsById:F,nonGroupedFlatRows:P,nonGroupedRowsById:W,rows:M,flatRows:O,rowsById:N,toggleGroupBy:$,setGroupBy:L})}function He(e){e.allCells.forEach((function(t){var n;t.isGrouped=t.column.isGrouped&&t.column.id===e.groupByID,t.isPlaceholder=!t.isGrouped&&t.column.isGrouped,t.isAggregated=!t.isGrouped&&!t.isPlaceholder&&(null==(n=e.subRows)?void 0:n.length)}))}function De(e,t){return e.reduce((function(e,n,i){var r=""+n.values[t];return e[r]=Array.isArray(e[r])?e[r]:[],e[r].push(n),e}),{})}var Ve=/([0-9]+)/gm;function ze(e,t){return e===t?0:e>t?1:-1}function je(e,t,n){return[e.values[n],t.values[n]]}function Ze(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}var Xe=Object.freeze({__proto__:null,alphanumeric:function(e,t,n){var i=je(e,t,n),r=i[0],o=i[1];for(r=Ze(r),o=Ze(o),r=r.split(Ve).filter(Boolean),o=o.split(Ve).filter(Boolean);r.length&&o.length;){var s=r.shift(),a=o.shift(),l=parseInt(s,10),c=parseInt(a,10),u=[l,c].sort();if(isNaN(u[0])){if(s>a)return 1;if(a>s)return-1}else{if(isNaN(u[1]))return isNaN(l)?-1:1;if(l>c)return 1;if(c>l)return-1}}return r.length-o.length},datetime:function(e,t,n){var i=je(e,t,n),r=i[0],o=i[1];return ze(r=r.getTime(),o=o.getTime())},basic:function(e,t,n){var i=je(e,t,n);return ze(i[0],i[1])},string:function(e,t,n){var i=je(e,t,n),r=i[0],o=i[1];for(r=r.split("").filter(Boolean),o=o.split("").filter(Boolean);r.length&&o.length;){var s=r.shift(),a=o.shift(),l=s.toLowerCase(),c=a.toLowerCase();if(l>c)return 1;if(c>l)return-1;if(s>a)return 1;if(a>s)return-1}return r.length-o.length},number:function(e,t,n){var i=je(e,t,n),r=i[0],o=i[1],s=/[^0-9.]/gi;return ze(r=Number(String(r).replace(s,"")),o=Number(String(o).replace(s,"")))}});a.resetSortBy="resetSortBy",a.setSortBy="setSortBy",a.toggleSortBy="toggleSortBy",a.clearSortBy="clearSortBy",u.sortType="alphanumeric",u.sortDescFirst=!1;var Ue=function(e){e.getSortByToggleProps=[Ye],e.stateReducers.push(Je),e.useInstance.push(Ke)};Ue.pluginName="useSortBy";var Ye=function(e,t){var n=t.instance,i=t.column,r=n.isMultiSortEvent,o=void 0===r?function(e){return e.shiftKey}:r;return[e,{onClick:i.canSort?function(e){e.persist(),i.toggleSortBy(void 0,!n.disableMultiSort&&o(e))}:void 0,style:{cursor:i.canSort?"pointer":void 0},title:i.canSort?"Toggle SortBy":void 0}]};function Je(e,t,n,i){if(t.type===a.init)return r({sortBy:[]},e);if(t.type===a.resetSortBy)return r({},e,{sortBy:i.initialState.sortBy||[]});if(t.type===a.clearSortBy)return r({},e,{sortBy:e.sortBy.filter((function(e){return e.id!==t.columnId}))});if(t.type===a.setSortBy)return r({},e,{sortBy:t.sortBy});if(t.type===a.toggleSortBy){var o,s=t.columnId,l=t.desc,c=t.multi,u=i.allColumns,d=i.disableMultiSort,h=i.disableSortRemove,f=i.disableMultiRemove,g=i.maxMultiSortColCount,p=void 0===g?Number.MAX_SAFE_INTEGER:g,m=e.sortBy,v=u.find((function(e){return e.id===s})).sortDescFirst,b=m.find((function(e){return e.id===s})),y=m.findIndex((function(e){return e.id===s})),w=null!=l,C=[];return"toggle"!=(o=!d&&c?b?"toggle":"add":y!==m.length-1||1!==m.length?"replace":b?"toggle":"replace")||h||w||c&&f||!(b&&b.desc&&!v||!b.desc&&v)||(o="remove"),"replace"===o?C=[{id:s,desc:w?l:v}]:"add"===o?(C=[].concat(m,[{id:s,desc:w?l:v}])).splice(0,C.length-p):"toggle"===o?C=m.map((function(e){return e.id===s?r({},e,{desc:w?l:!b.desc}):e})):"remove"===o&&(C=m.filter((function(e){return e.id!==s}))),r({},e,{sortBy:C})}}function Ke(e){var n=e.data,i=e.rows,r=e.flatRows,o=e.allColumns,s=e.orderByFn,l=void 0===s?Qe:s,c=e.sortTypes,u=e.manualSortBy,d=e.defaultCanSort,f=e.disableSortBy,g=e.flatHeaders,m=e.state.sortBy,b=e.dispatch,w=e.plugins,C=e.getHooks,x=e.autoResetSortBy,S=void 0===x||x;p(w,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var E=t.useCallback((function(e){b({type:a.setSortBy,sortBy:e})}),[b]),A=t.useCallback((function(e,t,n){b({type:a.toggleSortBy,columnId:e,desc:t,multi:n})}),[b]),R=v(e);g.forEach((function(e){var t=e.accessor,n=e.canSort,i=e.disableSortBy,r=e.id,o=t?k(!0!==i&&void 0,!0!==f&&void 0,!0):k(d,n,!1);e.canSort=o,e.canSort&&(e.toggleSortBy=function(t,n){return A(e.id,t,n)},e.clearSortBy=function(){b({type:a.clearSortBy,columnId:e.id})}),e.getSortByToggleProps=h(C().getSortByToggleProps,{instance:R(),column:e});var s=m.find((function(e){return e.id===r}));e.isSorted=!!s,e.sortedIndex=m.findIndex((function(e){return e.id===r})),e.isSortedDesc=e.isSorted?s.desc:void 0}));var I=t.useMemo((function(){if(u||!m.length)return[i,r];var e=[],t=m.filter((function(e){return o.find((function(t){return t.id===e.id}))}));return[function n(i){var r=l(i,t.map((function(e){var t=o.find((function(t){return t.id===e.id}));if(!t)throw new Error("React-Table: Could not find a column with id: "+e.id+" while sorting");var n=t.sortType,i=$(n)||(c||{})[n]||Xe[n];if(!i)throw new Error("React-Table: Could not find a valid sortType of '"+n+"' for column '"+e.id+"'.");return function(t,n){return i(t,n,e.id,e.desc)}})),t.map((function(e){var t=o.find((function(t){return t.id===e.id}));return t&&t.sortInverted?e.desc:!e.desc})));return r.forEach((function(t){e.push(t),t.subRows&&0!==t.subRows.length&&(t.subRows=n(t.subRows))})),r}(i),e]}),[u,m,i,r,o,l,c]),_=I[0],L=I[1],T=v(S);y((function(){T()&&b({type:a.resetSortBy})}),[u?null:n]),Object.assign(e,{preSortedRows:i,preSortedFlatRows:r,sortedRows:_,sortedFlatRows:L,rows:_,flatRows:L,setSortBy:E,toggleSortBy:A})}function Qe(e,t,n){return[].concat(e).sort((function(e,i){for(var r=0;re.pageIndex?c=-1===o?s.length>=e.pageSize:l-1),c?r({},e,{pageIndex:l}):e}if(t.type===a.setPageSize){var u=t.pageSize,d=e.pageSize*e.pageIndex;return r({},e,{pageIndex:Math.floor(d/u),pageSize:u})}}function tt(e){var n=e.rows,i=e.autoResetPage,r=void 0===i||i,o=e.manualExpandedKey,s=void 0===o?"expanded":o,l=e.plugins,c=e.pageCount,u=e.paginateExpandedRows,d=void 0===u||u,h=e.expandSubRows,f=void 0===h||h,g=e.state,m=g.pageSize,b=g.pageIndex,w=g.expanded,C=g.globalFilter,x=g.filters,S=g.groupBy,E=g.sortBy,A=e.dispatch,R=e.data,I=e.manualPagination;p(l,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var k=v(r);y((function(){k()&&A({type:a.resetPage})}),[A,I?null:R,C,x,S,E]);var $=I?c:Math.ceil(n.length/m),_=t.useMemo((function(){return $>0?[].concat(new Array($)).fill(null).map((function(e,t){return t})):[]}),[$]),T=t.useMemo((function(){var e;if(I)e=n;else{var t=m*b,i=t+m;e=n.slice(t,i)}return d?e:L(e,{manualExpandedKey:s,expanded:w,expandSubRows:f})}),[f,w,s,I,b,m,d,n]),M=b>0,O=-1===$?T.length>=m:b<$-1,N=t.useCallback((function(e){A({type:a.gotoPage,pageIndex:e})}),[A]),B=t.useCallback((function(){return N((function(e){return e-1}))}),[N]),F=t.useCallback((function(){return N((function(e){return e+1}))}),[N]),P=t.useCallback((function(e){A({type:a.setPageSize,pageSize:e})}),[A]);Object.assign(e,{pageOptions:_,pageCount:$,page:T,canPreviousPage:M,canNextPage:O,gotoPage:N,previousPage:B,nextPage:F,setPageSize:P})}qe.pluginName="usePagination",a.resetPivot="resetPivot",a.togglePivot="togglePivot";var nt=function(e){e.getPivotToggleProps=[rt],e.stateReducers.push(ot),e.useInstanceAfterData.push(st),e.allColumns.push(at),e.accessValue.push(lt),e.materializedColumns.push(ct),e.materializedColumnsDeps.push(ut),e.visibleColumns.push(dt),e.visibleColumnsDeps.push(ht),e.useInstance.push(ft),e.prepareRow.push(gt)};nt.pluginName="usePivotColumns";var it=[],rt=function(e,t){var n=t.header;return[e,{onClick:n.canPivot?function(e){e.persist(),n.togglePivot()}:void 0,style:{cursor:n.canPivot?"pointer":void 0},title:"Toggle Pivot"}]};function ot(e,t,n,i){if(t.type===a.init)return r({pivotColumns:it},e);if(t.type===a.resetPivot)return r({},e,{pivotColumns:i.initialState.pivotColumns||it});if(t.type===a.togglePivot){var o=t.columnId,s=t.value,l=void 0!==s?s:!e.pivotColumns.includes(o);return r({},e,l?{pivotColumns:[].concat(e.pivotColumns,[o])}:{pivotColumns:e.pivotColumns.filter((function(e){return e!==o}))})}}function st(e){e.allColumns.forEach((function(t){t.isPivotSource=e.state.pivotColumns.includes(t.id)}))}function at(e,t){var n=t.instance;return e.forEach((function(e){e.isPivotSource=n.state.pivotColumns.includes(e.id),e.uniqueValues=new Set})),e}function lt(e,t){var n=t.column;return n.uniqueValues&&void 0!==e&&n.uniqueValues.add(e),e}function ct(e,t){var n=t.instance,i=n.allColumns,o=n.state;if(!o.pivotColumns.length||!o.groupBy||!o.groupBy.length)return e;var s=o.pivotColumns.map((function(e){return i.find((function(t){return t.id===e}))})).filter(Boolean),a=i.filter((function(e){return!e.isPivotSource&&!o.groupBy.includes(e.id)&&!o.pivotColumns.includes(e.id)})),l=S(function e(t,n,i){void 0===t&&(t=0),void 0===i&&(i=[]);var o=s[t];return o?Array.from(o.uniqueValues).sort().map((function(s){var a=r({},o,{Header:o.PivotHeader||"string"==typeof o.header?o.Header+": "+s:s,isPivotGroup:!0,parent:n,depth:t,id:n?n.id+"."+o.id+"."+s:o.id+"."+s,pivotValue:s});return a.columns=e(t+1,a,[].concat(i,[function(e){return e.values[o.id]===s}])),a})):a.map((function(e){return r({},e,{canPivot:!1,isPivoted:!0,parent:n,depth:t,id:""+(n?n.id+"."+e.id:e.id),accessor:function(t,n,r){if(i.every((function(e){return e(r)})))return r.values[e.id]}})}))}());return[].concat(e,l)}function ut(e,t){var n=t.instance.state,i=n.pivotColumns,r=n.groupBy;return[].concat(e,[i,r])}function dt(e,t){var n=t.instance.state;return e=e.filter((function(e){return!e.isPivotSource})),n.pivotColumns.length&&n.groupBy&&n.groupBy.length&&(e=e.filter((function(e){return e.isGrouped||e.isPivoted}))),e}function ht(e,t){var n=t.instance;return[].concat(e,[n.state.pivotColumns,n.state.groupBy])}function ft(e){var t=e.columns,n=e.allColumns,i=e.flatHeaders,r=e.getHooks,o=e.plugins,s=e.dispatch,l=e.autoResetPivot,c=void 0===l||l,u=e.manaulPivot,d=e.disablePivot,f=e.defaultCanPivot;p(o,["useGroupBy"],"usePivotColumns");var g=v(e);n.forEach((function(t){var n=t.accessor,i=t.defaultPivot,r=t.disablePivot;t.canPivot=n?k(t.canPivot,!0!==r&&void 0,!0!==d&&void 0,!0):k(t.canPivot,i,f,!1),t.canPivot&&(t.togglePivot=function(){return e.togglePivot(t.id)}),t.Aggregated=t.Aggregated||t.Cell})),i.forEach((function(e){e.getPivotToggleProps=h(r().getPivotToggleProps,{instance:g(),header:e})}));var m=v(c);y((function(){m()&&s({type:a.resetPivot})}),[s,u?null:t]),Object.assign(e,{togglePivot:function(e,t){s({type:a.togglePivot,columnId:e,value:t})}})}function gt(e){e.allCells.forEach((function(e){e.isPivoted=e.column.isPivoted}))}a.resetSelectedRows="resetSelectedRows",a.toggleAllRowsSelected="toggleAllRowsSelected",a.toggleRowSelected="toggleRowSelected",a.toggleAllPageRowsSelected="toggleAllPageRowsSelected";var pt=function(e){e.getToggleRowSelectedProps=[mt],e.getToggleAllRowsSelectedProps=[vt],e.getToggleAllPageRowsSelectedProps=[bt],e.stateReducers.push(yt),e.useInstance.push(wt),e.prepareRow.push(Ct)};pt.pluginName="useRowSelect";var mt=function(e,t){var n=t.instance,i=t.row,r=n.manualRowSelectedKey,o=void 0===r?"isSelected":r;return[e,{onChange:function(e){i.toggleRowSelected(e.target.checked)},style:{cursor:"pointer"},checked:!(!i.original||!i.original[o])||i.isSelected,title:"Toggle Row Selected",indeterminate:i.isSomeSelected}]},vt=function(e,t){var n=t.instance;return[e,{onChange:function(e){n.toggleAllRowsSelected(e.target.checked)},style:{cursor:"pointer"},checked:n.isAllRowsSelected,title:"Toggle All Rows Selected",indeterminate:Boolean(!n.isAllRowsSelected&&Object.keys(n.state.selectedRowIds).length)}]},bt=function(e,t){var n=t.instance;return[e,{onChange:function(e){n.toggleAllPageRowsSelected(e.target.checked)},style:{cursor:"pointer"},checked:n.isAllPageRowsSelected,title:"Toggle All Current Page Rows Selected",indeterminate:Boolean(!n.isAllPageRowsSelected&&n.page.some((function(e){var t=e.id;return n.state.selectedRowIds[t]})))}]};function yt(e,t,n,i){if(t.type===a.init)return r({selectedRowIds:{}},e);if(t.type===a.resetSelectedRows)return r({},e,{selectedRowIds:i.initialState.selectedRowIds||{}});if(t.type===a.toggleAllRowsSelected){var o=t.value,s=i.isAllRowsSelected,l=i.rowsById,c=i.nonGroupedRowsById,u=void 0===c?l:c,d=void 0!==o?o:!s,h=Object.assign({},e.selectedRowIds);return d?Object.keys(u).forEach((function(e){h[e]=!0})):Object.keys(u).forEach((function(e){delete h[e]})),r({},e,{selectedRowIds:h})}if(t.type===a.toggleRowSelected){var f=t.id,g=t.value,p=i.rowsById,m=i.selectSubRows,v=void 0===m||m,b=i.getSubRows,y=e.selectedRowIds[f],w=void 0!==g?g:!y;if(y===w)return e;var C=r({},e.selectedRowIds);return function e(t){var n=p[t];if(n&&(n.isGrouped||(w?C[t]=!0:delete C[t]),v&&b(n)))return b(n).forEach((function(t){return e(t.id)}))}(f),r({},e,{selectedRowIds:C})}if(t.type===a.toggleAllPageRowsSelected){var x=t.value,S=i.page,E=i.rowsById,A=i.selectSubRows,R=void 0===A||A,I=i.isAllPageRowsSelected,k=i.getSubRows,$=void 0!==x?x:!I,_=r({},e.selectedRowIds);return S.forEach((function(e){return function e(t){var n=E[t];if(n.isGrouped||($?_[t]=!0:delete _[t]),R&&k(n))return k(n).forEach((function(t){return e(t.id)}))}(e.id)})),r({},e,{selectedRowIds:_})}return e}function wt(e){var n=e.data,i=e.rows,r=e.getHooks,o=e.plugins,s=e.rowsById,l=e.nonGroupedRowsById,c=void 0===l?s:l,u=e.autoResetSelectedRows,d=void 0===u||u,f=e.state.selectedRowIds,g=e.selectSubRows,m=void 0===g||g,b=e.dispatch,w=e.page,C=e.getSubRows;p(o,["useFilters","useGroupBy","useSortBy","useExpanded","usePagination"],"useRowSelect");var x=t.useMemo((function(){var e=[];return i.forEach((function(t){var n=m?function e(t,n,i){if(n[t.id])return!0;var r=i(t);if(r&&r.length){var o=!0,s=!1;return r.forEach((function(t){s&&!o||(e(t,n,i)?s=!0:o=!1)})),!!o||!!s&&null}return!1}(t,f,C):!!f[t.id];t.isSelected=!!n,t.isSomeSelected=null===n,n&&e.push(t)})),e}),[i,m,f,C]),S=Boolean(Object.keys(c).length&&Object.keys(f).length),E=S;S&&Object.keys(c).some((function(e){return!f[e]}))&&(S=!1),S||w&&w.length&&w.some((function(e){var t=e.id;return!f[t]}))&&(E=!1);var A=v(d);y((function(){A()&&b({type:a.resetSelectedRows})}),[b,n]);var R=t.useCallback((function(e){return b({type:a.toggleAllRowsSelected,value:e})}),[b]),I=t.useCallback((function(e){return b({type:a.toggleAllPageRowsSelected,value:e})}),[b]),k=t.useCallback((function(e,t){return b({type:a.toggleRowSelected,id:e,value:t})}),[b]),$=v(e),_=h(r().getToggleAllRowsSelectedProps,{instance:$()}),L=h(r().getToggleAllPageRowsSelectedProps,{instance:$()});Object.assign(e,{selectedFlatRows:x,isAllRowsSelected:S,isAllPageRowsSelected:E,toggleRowSelected:k,toggleAllRowsSelected:R,getToggleAllRowsSelectedProps:_,getToggleAllPageRowsSelectedProps:L,toggleAllPageRowsSelected:I})}function Ct(e,t){var n=t.instance;e.toggleRowSelected=function(t){return n.toggleRowSelected(e.id,t)},e.getToggleRowSelectedProps=h(n.getHooks().getToggleRowSelectedProps,{instance:n,row:e})}var xt=function(e){return{}},St=function(e){return{}};a.setRowState="setRowState",a.setCellState="setCellState",a.resetRowState="resetRowState";var Et=function(e){e.stateReducers.push(At),e.useInstance.push(Rt),e.prepareRow.push(It)};function At(e,t,n,i){var o=i.initialRowStateAccessor,s=void 0===o?xt:o,l=i.initialCellStateAccessor,c=void 0===l?St:l,u=i.rowsById;if(t.type===a.init)return r({rowState:{}},e);if(t.type===a.resetRowState)return r({},e,{rowState:i.initialState.rowState||{}});if(t.type===a.setRowState){var d,h=t.rowId,f=t.value,g=void 0!==e.rowState[h]?e.rowState[h]:s(u[h]);return r({},e,{rowState:r({},e.rowState,(d={},d[h]=m(f,g),d))})}if(t.type===a.setCellState){var p,v,b,y,w,C=t.rowId,x=t.columnId,S=t.value,E=void 0!==e.rowState[C]?e.rowState[C]:s(u[C]),A=void 0!==(null==E||null==(p=E.cellState)?void 0:p[x])?E.cellState[x]:c(null==(v=u[C])||null==(b=v.cells)?void 0:b.find((function(e){return e.column.id===x})));return r({},e,{rowState:r({},e.rowState,(w={},w[C]=r({},E,{cellState:r({},E.cellState||{},(y={},y[x]=m(S,A),y))}),w))})}}function Rt(e){var n=e.autoResetRowState,i=void 0===n||n,r=e.data,o=e.dispatch,s=t.useCallback((function(e,t){return o({type:a.setRowState,rowId:e,value:t})}),[o]),l=t.useCallback((function(e,t,n){return o({type:a.setCellState,rowId:e,columnId:t,value:n})}),[o]),c=v(i);y((function(){c()&&o({type:a.resetRowState})}),[r]),Object.assign(e,{setRowState:s,setCellState:l})}function It(e,t){var n=t.instance,i=n.initialRowStateAccessor,r=void 0===i?xt:i,o=n.initialCellStateAccessor,s=void 0===o?St:o,a=n.state.rowState;e&&(e.state=void 0!==a[e.id]?a[e.id]:r(e),e.setState=function(t){return n.setRowState(e.id,t)},e.cells.forEach((function(t){e.state.cellState||(e.state.cellState={}),t.state=void 0!==e.state.cellState[t.column.id]?e.state.cellState[t.column.id]:s(t),t.setState=function(i){return n.setCellState(e.id,t.column.id,i)}})))}Et.pluginName="useRowState",a.resetColumnOrder="resetColumnOrder",a.setColumnOrder="setColumnOrder";var kt=function(e){e.stateReducers.push($t),e.visibleColumnsDeps.push((function(e,t){var n=t.instance;return[].concat(e,[n.state.columnOrder])})),e.visibleColumns.push(_t),e.useInstance.push(Lt)};function $t(e,t,n,i){return t.type===a.init?r({columnOrder:[]},e):t.type===a.resetColumnOrder?r({},e,{columnOrder:i.initialState.columnOrder||[]}):t.type===a.setColumnOrder?r({},e,{columnOrder:m(t.columnOrder,e.columnOrder)}):void 0}function _t(e,t){var n=t.instance.state.columnOrder;if(!n||!n.length)return e;for(var i=[].concat(n),r=[].concat(e),o=[],s=function(){var e=i.shift(),t=r.findIndex((function(t){return t.id===e}));t>-1&&o.push(r.splice(t,1)[0])};r.length&&i.length;)s();return[].concat(o,r)}function Lt(e){var n=e.dispatch;e.setColumnOrder=t.useCallback((function(e){return n({type:a.setColumnOrder,columnOrder:e})}),[n])}kt.pluginName="useColumnOrder",u.canResize=!0,a.columnStartResizing="columnStartResizing",a.columnResizing="columnResizing",a.columnDoneResizing="columnDoneResizing",a.resetResize="resetResize";var Tt=function(e){e.getResizerProps=[Mt],e.getHeaderProps.push({style:{position:"relative"}}),e.stateReducers.push(Ot),e.useInstance.push(Bt),e.useInstanceBeforeDimensions.push(Nt)},Mt=function(e,t){var n=t.instance,i=t.header,r=n.dispatch,o=function(e,t){var n=!1;if("touchstart"===e.type){if(e.touches&&e.touches.length>1)return;n=!0}var i,o,s=function(e){var t=[];return function e(n){n.columns&&n.columns.length&&n.columns.map(e),t.push(n)}(e),t}(t).map((function(e){return[e.id,e.totalWidth]})),l=n?Math.round(e.touches[0].clientX):e.clientX,c=function(){window.cancelAnimationFrame(i),i=null,r({type:a.columnDoneResizing})},u=function(){window.cancelAnimationFrame(i),i=null,r({type:a.columnResizing,clientX:o})},d=function(e){o=e,i||(i=window.requestAnimationFrame(u))},h={mouse:{moveEvent:"mousemove",moveHandler:function(e){return d(e.clientX)},upEvent:"mouseup",upHandler:function(e){document.removeEventListener("mousemove",h.mouse.moveHandler),document.removeEventListener("mouseup",h.mouse.upHandler),c()}},touch:{moveEvent:"touchmove",moveHandler:function(e){return e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(e){document.removeEventListener(h.touch.moveEvent,h.touch.moveHandler),document.removeEventListener(h.touch.upEvent,h.touch.moveHandler),c()}}},f=n?h.touch:h.mouse,g=!!function(){if("boolean"==typeof N)return N;var e=!1;try{var t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){e=!1}return N=e}()&&{passive:!1};document.addEventListener(f.moveEvent,f.moveHandler,g),document.addEventListener(f.upEvent,f.upHandler,g),r({type:a.columnStartResizing,columnId:t.id,columnWidth:t.totalWidth,headerIdWidths:s,clientX:l})};return[e,{onMouseDown:function(e){return e.persist()||o(e,i)},onTouchStart:function(e){return e.persist()||o(e,i)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function Ot(e,t){if(t.type===a.init)return r({columnResizing:{columnWidths:{}}},e);if(t.type===a.resetResize)return r({},e,{columnResizing:{columnWidths:{}}});if(t.type===a.columnStartResizing){var n=t.clientX,i=t.columnId,o=t.columnWidth,s=t.headerIdWidths;return r({},e,{columnResizing:r({},e.columnResizing,{startX:n,headerIdWidths:s,columnWidth:o,isResizingColumn:i})})}if(t.type===a.columnResizing){var l=t.clientX,c=e.columnResizing,u=c.startX,d=c.columnWidth,h=c.headerIdWidths,f=(l-u)/d,g={};return(void 0===h?[]:h).forEach((function(e){var t=e[0],n=e[1];g[t]=Math.max(n+n*f,0)})),r({},e,{columnResizing:r({},e.columnResizing,{columnWidths:r({},e.columnResizing.columnWidths,{},g)})})}return t.type===a.columnDoneResizing?r({},e,{columnResizing:r({},e.columnResizing,{startX:null,isResizingColumn:null})}):void 0}Tt.pluginName="useResizeColumns";var Nt=function(e){var t=e.flatHeaders,n=e.disableResizing,i=e.getHooks,r=e.state.columnResizing,o=v(e);t.forEach((function(e){var t=k(!0!==e.disableResizing&&void 0,!0!==n&&void 0,!0);e.canResize=t,e.width=r.columnWidths[e.id]||e.originalWidth||e.width,e.isResizing=r.isResizingColumn===e.id,t&&(e.getResizerProps=h(i().getResizerProps,{instance:o(),header:e}))}))};function Bt(e){var n=e.plugins,i=e.dispatch,r=e.autoResetResize,o=void 0===r||r,s=e.columns;p(n,["useAbsoluteLayout"],"useResizeColumns");var l=v(o);y((function(){l()&&i({type:a.resetResize})}),[s]);var c=t.useCallback((function(){return i({type:a.resetResize})}),[i]);Object.assign(e,{resetResizing:c})}var Ft={position:"absolute",top:0},Pt=function(e){e.getTableBodyProps.push(Wt),e.getRowProps.push(Wt),e.getHeaderGroupProps.push(Wt),e.getFooterGroupProps.push(Wt),e.getHeaderProps.push((function(e,t){var n=t.column;return[e,{style:r({},Ft,{left:n.totalLeft+"px",width:n.totalWidth+"px"})}]})),e.getCellProps.push((function(e,t){var n=t.cell;return[e,{style:r({},Ft,{left:n.column.totalLeft+"px",width:n.column.totalWidth+"px"})}]})),e.getFooterProps.push((function(e,t){var n=t.column;return[e,{style:r({},Ft,{left:n.totalLeft+"px",width:n.totalWidth+"px"})}]}))};Pt.pluginName="useAbsoluteLayout";var Wt=function(e,t){return[e,{style:{position:"relative",width:t.instance.totalColumnsWidth+"px"}}]},Gt={display:"inline-block",boxSizing:"border-box"},Ht=function(e,t){return[e,{style:{display:"flex",width:t.instance.totalColumnsWidth+"px"}}]},Dt=function(e){e.getRowProps.push(Ht),e.getHeaderGroupProps.push(Ht),e.getFooterGroupProps.push(Ht),e.getHeaderProps.push((function(e,t){var n=t.column;return[e,{style:r({},Gt,{width:n.totalWidth+"px"})}]})),e.getCellProps.push((function(e,t){var n=t.cell;return[e,{style:r({},Gt,{width:n.column.totalWidth+"px"})}]})),e.getFooterProps.push((function(e,t){var n=t.column;return[e,{style:r({},Gt,{width:n.totalWidth+"px"})}]}))};function Vt(e){e.getTableProps.push(zt),e.getRowProps.push(jt),e.getHeaderGroupProps.push(jt),e.getFooterGroupProps.push(jt),e.getHeaderProps.push(Zt),e.getCellProps.push(Xt),e.getFooterProps.push(Ut)}Dt.pluginName="useBlockLayout",Vt.pluginName="useFlexLayout";var zt=function(e,t){return[e,{style:{minWidth:t.instance.totalColumnsMinWidth+"px"}}]},jt=function(e,t){return[e,{style:{display:"flex",flex:"1 0 auto",minWidth:t.instance.totalColumnsMinWidth+"px"}}]},Zt=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]},Xt=function(e,t){var n=t.cell;return[e,{style:{boxSizing:"border-box",flex:n.column.totalFlexWidth+" 0 auto",minWidth:n.column.totalMinWidth+"px",width:n.column.totalWidth+"px"}}]},Ut=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]};function Yt(e){e.stateReducers.push(qt),e.getTableProps.push(Jt),e.getHeaderProps.push(Kt),e.getRowProps.push(Qt)}a.columnStartResizing="columnStartResizing",a.columnResizing="columnResizing",a.columnDoneResizing="columnDoneResizing",a.resetResize="resetResize",Yt.pluginName="useGridLayout";var Jt=function(e,t){var n=t.instance;return[e,{style:{display:"grid",gridTemplateColumns:n.visibleColumns.map((function(e){var t;return n.state.gridLayout.columnWidths[e.id]?n.state.gridLayout.columnWidths[e.id]+"px":(null==(t=n.state.columnResizing)?void 0:t.isResizingColumn)?n.state.gridLayout.startWidths[e.id]+"px":"number"==typeof e.width?e.width+"px":e.width})).join(" ")}}]},Kt=function(e,t){var n=t.column;return[e,{id:"header-cell-"+n.id,style:{position:"sticky",gridColumn:"span "+n.totalVisibleHeaderCount}}]},Qt=function(e,t){var n=t.row;return n.isExpanded?[e,{style:{gridColumn:"1 / "+(n.cells.length+1)}}]:[e,{}]};function qt(e,t,n,i){if(t.type===a.init)return r({gridLayout:{columnWidths:{}}},e);if(t.type===a.resetResize)return r({},e,{gridLayout:{columnWidths:{}}});if(t.type===a.columnStartResizing){var o=t.columnId,s=t.headerIdWidths,l=en(o);if(void 0!==l){var c=i.visibleColumns.reduce((function(e,t){var n;return r({},e,((n={})[t.id]=en(t.id),n))}),{}),u=i.visibleColumns.reduce((function(e,t){var n;return r({},e,((n={})[t.id]=t.minWidth,n))}),{}),d=i.visibleColumns.reduce((function(e,t){var n;return r({},e,((n={})[t.id]=t.maxWidth,n))}),{}),h=s.map((function(e){var t=e[0];return[t,en(t)]}));return r({},e,{gridLayout:r({},e.gridLayout,{startWidths:c,minWidths:u,maxWidths:d,headerIdGridWidths:h,columnWidth:l})})}return e}if(t.type===a.columnResizing){var f=t.clientX,g=e.columnResizing.startX,p=e.gridLayout,m=p.columnWidth,v=p.minWidths,b=p.maxWidths,y=p.headerIdGridWidths,w=(f-g)/m,C={};return(void 0===y?[]:y).forEach((function(e){var t=e[0],n=e[1];C[t]=Math.min(Math.max(v[t],n+n*w),b[t])})),r({},e,{gridLayout:r({},e.gridLayout,{columnWidths:r({},e.gridLayout.columnWidths,{},C)})})}return t.type===a.columnDoneResizing?r({},e,{gridLayout:r({},e.gridLayout,{startWidths:{},minWidths:{},maxWidths:{}})}):void 0}function en(e){var t,n=null==(t=document.getElementById("header-cell-"+e))?void 0:t.offsetWidth;if(void 0!==n)return n}e._UNSTABLE_usePivotColumns=nt,e.actions=a,e.defaultColumn=u,e.defaultGroupByFn=De,e.defaultOrderByFn=Qe,e.defaultRenderer=l,e.emptyRenderer=c,e.ensurePluginOrder=p,e.flexRender=C,e.functionalUpdate=m,e.loopHooks=g,e.makePropGetter=h,e.makeRenderer=w,e.reduceHooks=f,e.safeUseLayoutEffect=b,e.useAbsoluteLayout=Pt,e.useAsyncDebounce=function(e,n){void 0===n&&(n=0);var r=t.useRef({}),o=v(e),s=v(n);return t.useCallback(function(){var e=i(regeneratorRuntime.mark((function e(){var t,n,a,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=l.length,n=new Array(t),a=0;a1?n-1:0),o=1;o=0||(r[n]=e[n]);return r}function s(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function a(e){var t=s(e,"string");return"symbol"==typeof t?t:String(t)}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var l="Renderer Error ☝️",c={init:"init"},u=function(e){var t=e.value;return void 0===t?"":t},d=function(){return t.createElement(t.Fragment,null," ")},h={Cell:u,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function f(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&i>r)throw new Error("React Table: The "+n+" plugin hook must be placed after the "+t+" plugin hook!")}))}function y(e,t){return"function"==typeof e?e(t):e}function w(e){var n=t.useRef();return n.current=e,t.useCallback((function(){return n.current}),[])}var C="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function x(e,n){var i=t.useRef(!1);C((function(){i.current&&e(),i.current=!0}),n)}function S(e,n){void 0===n&&(n=0);var r=t.useRef({}),o=w(e),s=w(n);return t.useCallback(function(){var e=i(regeneratorRuntime.mark((function e(){var t,n,a,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=l.length,n=new Array(t),a=0;a1?n-1:0),o=1;o(o="number"==typeof o?o:1/0)){var s=r;r=o,o=s}return e.filter((function(e){return t.some((function(t){var n=e.values[t];return n>=r&&n<=o}))}))};Be.autoRemove=function(e){return!e||"number"!=typeof e[0]&&"number"!=typeof e[1]};var Fe=Object.freeze({__proto__:null,text:Ie,exactText:ke,exactTextCase:$e,includes:_e,includesAll:Le,includesSome:Te,includesValue:Me,exact:Oe,equals:Ne,between:Be});c.resetFilters="resetFilters",c.setFilter="setFilter",c.setAllFilters="setAllFilters";var Pe=function(e){e.stateReducers.push(We),e.useInstance.push(Ge)};function We(e,t,n,i){if(t.type===c.init)return r({filters:[]},e);if(t.type===c.resetFilters)return r({},e,{filters:i.initialState.filters||[]});if(t.type===c.setFilter){var o=t.columnId,s=t.filterValue,a=i.allColumns,l=i.filterTypes,u=a.find((function(e){return e.id===o}));if(!u)throw new Error("React-Table: Could not find a column with id: "+o);var d=G(u.filter,l||{},Fe),h=e.filters.find((function(e){return e.id===o})),f=y(s,h&&h.value);return H(d.autoRemove,f,u)?r({},e,{filters:e.filters.filter((function(e){return e.id!==o}))}):r({},e,h?{filters:e.filters.map((function(e){return e.id===o?{id:o,value:f}:e}))}:{filters:[].concat(e.filters,[{id:o,value:f}])})}if(t.type===c.setAllFilters){var g=t.filters,p=i.allColumns,m=i.filterTypes;return r({},e,{filters:y(g,e.filters).filter((function(e){var t=p.find((function(t){return t.id===e.id}));return!H(G(t.filter,m||{},Fe).autoRemove,e.value,t)}))})}}function Ge(e){var n=e.data,i=e.rows,r=e.flatRows,o=e.rowsById,s=e.allColumns,a=e.filterTypes,l=e.manualFilters,u=e.defaultCanFilter,d=void 0!==u&&u,h=e.disableFilters,f=e.state.filters,g=e.dispatch,p=e.autoResetFilters,m=void 0===p||p,v=t.useCallback((function(e,t){g({type:c.setFilter,columnId:e,filterValue:t})}),[g]),b=t.useCallback((function(e){g({type:c.setAllFilters,filters:e})}),[g]);s.forEach((function(e){var t=e.id,n=e.accessor,i=e.defaultCanFilter,r=e.disableFilters;e.canFilter=n?B(!0!==r&&void 0,!0!==h&&void 0,!0):B(i,d,!1),e.setFilter=function(t){return v(e.id,t)};var o=f.find((function(e){return e.id===t}));e.filterValue=o&&o.value}));var y=t.useMemo((function(){if(l||!f.length)return[i,r,o];var e=[],t={},n=function n(i,r){void 0===r&&(r=0);var o=i;return o=f.reduce((function(e,t){var n=t.id,i=t.value,o=s.find((function(e){return e.id===n}));if(!o)return e;0===r&&(o.preFilteredRows=e);var l=G(o.filter,a||{},Fe);return l?(o.filteredRows=l(e,[n],i),o.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+o.id+"."),e)}),i),o.forEach((function(i){e.push(i),t[i.id]=i,i.subRows&&(i.subRows=i.subRows&&i.subRows.length>0?n(i.subRows,r+1):i.subRows)})),o};return[n(i),e,t]}),[l,f,i,r,o,s,a]),C=y[0],S=y[1],E=y[2];t.useMemo((function(){var e=s.filter((function(e){return!f.find((function(t){return t.id===e.id}))}));e.forEach((function(e){e.preFilteredRows=C,e.filteredRows=C}))}),[C,f,s]);var A=w(m);x((function(){A()&&g({type:c.resetFilters})}),[g,l?null:n]),Object.assign(e,{preFilteredRows:i,preFilteredFlatRows:r,preFilteredRowsById:o,filteredRows:C,filteredFlatRows:S,filteredRowsById:E,rows:C,flatRows:S,rowsById:E,setFilter:v,setAllFilters:b})}Pe.pluginName="useFilters",c.resetGlobalFilter="resetGlobalFilter",c.setGlobalFilter="setGlobalFilter";var He=function(e){e.stateReducers.push(De),e.useInstance.push(Ve)};function De(e,t,n,i){if(t.type===c.resetGlobalFilter)return r({},e,{globalFilter:i.initialState.globalFilter||void 0});if(t.type===c.setGlobalFilter){var s=t.filterValue,a=i.userFilterTypes,l=G(i.globalFilter,a||{},Fe),u=y(s,e.globalFilter);return H(l.autoRemove,u)?(e.globalFilter,o(e,["globalFilter"])):r({},e,{globalFilter:u})}}function Ve(e){var n=e.data,i=e.rows,r=e.flatRows,o=e.rowsById,s=e.allColumns,a=e.filterTypes,l=e.globalFilter,u=e.manualGlobalFilter,d=e.state.globalFilter,h=e.dispatch,f=e.autoResetGlobalFilter,g=void 0===f||f,p=e.disableGlobalFilter,m=t.useCallback((function(e){h({type:c.setGlobalFilter,filterValue:e})}),[h]),v=t.useMemo((function(){if(u||void 0===d)return[i,r,o];var e=[],t={},n=G(l,a||{},Fe);if(!n)return console.warn("Could not find a valid 'globalFilter' option."),i;s.forEach((function(e){var t=e.disableGlobalFilter;e.canFilter=B(!0!==t&&void 0,!0!==p&&void 0,!0)}));var c=s.filter((function(e){return!0===e.canFilter})),h=function i(r){return r=n(r,c.map((function(e){return e.id})),d),r.forEach((function(n){e.push(n),t[n.id]=n,n.subRows=n.subRows&&n.subRows.length?i(n.subRows):n.subRows})),r};return[h(i),e,t]}),[u,d,l,a,s,i,r,o,p]),b=v[0],y=v[1],C=v[2],S=w(g);x((function(){S()&&h({type:c.resetGlobalFilter})}),[h,u?null:n]),Object.assign(e,{preGlobalFilteredRows:i,preGlobalFilteredFlatRows:r,preGlobalFilteredRowsById:o,globalFilteredRows:b,globalFilteredFlatRows:y,globalFilteredRowsById:C,rows:b,flatRows:y,rowsById:C,setGlobalFilter:m,disableGlobalFilter:p})}function ze(e,t){return t.reduce((function(e,t){return e+("number"==typeof t?t:0)}),0)}function je(e){var t=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.min(t,e))})),t}function Ze(e){var t=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.max(t,e))})),t}function Xe(e){var t=e[0]||0,n=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.min(t,e),n=Math.max(n,e))})),t+".."+n}function Ue(e){return ze(null,e)/e.length}function Ye(e){if(!e.length)return null;var t=Math.floor(e.length/2),n=[].concat(e).sort((function(e,t){return e-t}));return e.length%2!=0?n[t]:(n[t-1]+n[t])/2}function Je(e){return Array.from(new Set(e).values())}function Ke(e){return new Set(e).size}function Qe(e){return e.length}He.pluginName="useGlobalFilter";var qe=Object.freeze({__proto__:null,sum:ze,min:je,max:Ze,minMax:Xe,average:Ue,median:Ye,unique:Je,uniqueCount:Ke,count:Qe}),et=[],tt={};c.resetGroupBy="resetGroupBy",c.setGroupBy="setGroupBy",c.toggleGroupBy="toggleGroupBy";var nt=function(e){e.getGroupByToggleProps=[it],e.stateReducers.push(rt),e.visibleColumnsDeps.push((function(e,t){var n=t.instance;return[].concat(e,[n.state.groupBy])})),e.visibleColumns.push(ot),e.useInstance.push(at),e.prepareRow.push(lt)};nt.pluginName="useGroupBy";var it=function(e,t){var n=t.header;return[e,{onClick:n.canGroupBy?function(e){e.persist(),n.toggleGroupBy()}:void 0,style:{cursor:n.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function rt(e,t,n,i){if(t.type===c.init)return r({groupBy:[]},e);if(t.type===c.resetGroupBy)return r({},e,{groupBy:i.initialState.groupBy||[]});if(t.type===c.setGroupBy)return r({},e,{groupBy:t.value});if(t.type===c.toggleGroupBy){var o=t.columnId,s=t.value,a=void 0!==s?s:!e.groupBy.includes(o);return r({},e,a?{groupBy:[].concat(e.groupBy,[o])}:{groupBy:e.groupBy.filter((function(e){return e!==o}))})}}function ot(e,t){var n=t.instance.state.groupBy,i=n.map((function(t){return e.find((function(e){return e.id===t}))})).filter(Boolean),r=e.filter((function(e){return!n.includes(e.id)}));return(e=[].concat(i,r)).forEach((function(e){e.isGrouped=n.includes(e.id),e.groupedIndex=n.indexOf(e.id)})),e}var st={};function at(e){var n=e.data,i=e.rows,o=e.flatRows,s=e.rowsById,a=e.allColumns,l=e.flatHeaders,u=e.groupByFn,d=void 0===u?ct:u,h=e.manualGroupBy,f=e.aggregations,g=void 0===f?st:f,m=e.plugins,v=e.state.groupBy,y=e.dispatch,C=e.autoResetGroupBy,S=void 0===C||C,E=e.disableGroupBy,A=e.defaultCanGroupBy,R=e.getHooks;b(m,["useColumnOrder","useFilters"],"useGroupBy");var I=w(e);a.forEach((function(t){var n=t.accessor,i=t.defaultGroupBy,r=t.disableGroupBy;t.canGroupBy=n?B(t.canGroupBy,!0!==r&&void 0,!0!==E&&void 0,!0):B(t.canGroupBy,i,A,!1),t.canGroupBy&&(t.toggleGroupBy=function(){return e.toggleGroupBy(t.id)}),t.Aggregated=t.Aggregated||t.Cell}));var k=t.useCallback((function(e,t){y({type:c.toggleGroupBy,columnId:e,value:t})}),[y]),$=t.useCallback((function(e){y({type:c.setGroupBy,value:e})}),[y]);l.forEach((function(e){e.getGroupByToggleProps=p(R().getGroupByToggleProps,{instance:I(),header:e})}));var _=t.useMemo((function(){if(h||!v.length)return[i,o,s,et,tt,o,s];var e=v.filter((function(e){return a.find((function(t){return t.id===e}))})),t=function(t,n,i){var r={};return a.forEach((function(o){if(e.includes(o.id))r[o.id]=n[0]?n[0].values[o.id]:null;else{var s="function"==typeof o.aggregate?o.aggregate:g[o.aggregate]||qe[o.aggregate];if(s){var a=n.map((function(e){return e.values[o.id]})),l=t.map((function(e){var t=e.values[o.id];if(!i&&o.aggregateValue){var n="function"==typeof o.aggregateValue?o.aggregateValue:g[o.aggregateValue]||qe[o.aggregateValue];if(!n)throw console.info({column:o}),new Error("React Table: Invalid column.aggregateValue option for column listed above");t=n(t,e,o)}return t}));r[o.id]=s(l,a)}else{if(o.aggregate)throw console.info({column:o}),new Error("React Table: Invalid column.aggregate option for column listed above");r[o.id]=null}}})),r},n=[],l={},c=[],u={},f=[],p={},m=function i(o,s,a){if(void 0===s&&(s=0),s===e.length)return o.map((function(e){return r({},e,{depth:s})}));var h=e[s],g=d(o,h),m=Object.entries(g).map((function(e,r){var o=e[0],d=e[1],g=h+":"+o,m=i(d,s+1,g=a?a+">"+g:g),v=s?P(d,"leafRows"):d,b=t(v,d,s),y={id:g,isGrouped:!0,groupByID:h,groupByVal:o,values:b,subRows:m,leafRows:v,depth:s,index:r};return m.forEach((function(e){n.push(e),l[e.id]=e,e.isGrouped?(c.push(e),u[e.id]=e):(f.push(e),p[e.id]=e)})),y}));return m},b=m(i);return b.forEach((function(e){n.push(e),l[e.id]=e,e.isGrouped?(c.push(e),u[e.id]=e):(f.push(e),p[e.id]=e)})),[b,n,l,c,u,f,p]}),[h,v,i,o,s,a,g,d]),L=_[0],T=_[1],M=_[2],O=_[3],N=_[4],F=_[5],W=_[6],G=w(S);x((function(){G()&&y({type:c.resetGroupBy})}),[y,h?null:n]),Object.assign(e,{preGroupedRows:i,preGroupedFlatRow:o,preGroupedRowsById:s,groupedRows:L,groupedFlatRows:T,groupedRowsById:M,onlyGroupedFlatRows:O,onlyGroupedRowsById:N,nonGroupedFlatRows:F,nonGroupedRowsById:W,rows:L,flatRows:T,rowsById:M,toggleGroupBy:k,setGroupBy:$})}function lt(e){e.allCells.forEach((function(t){var n;t.isGrouped=t.column.isGrouped&&t.column.id===e.groupByID,t.isPlaceholder=!t.isGrouped&&t.column.isGrouped,t.isAggregated=!t.isGrouped&&!t.isPlaceholder&&(null==(n=e.subRows)?void 0:n.length)}))}function ct(e,t){return e.reduce((function(e,n,i){var r=""+n.values[t];return e[r]=Array.isArray(e[r])?e[r]:[],e[r].push(n),e}),{})}var ut=/([0-9]+)/gm,dt=function(e,t,n){var i=vt(e,t,n),r=i[0],o=i[1];for(r=bt(r),o=bt(o),r=r.split(ut).filter(Boolean),o=o.split(ut).filter(Boolean);r.length&&o.length;){var s=r.shift(),a=o.shift(),l=parseInt(s,10),c=parseInt(a,10),u=[l,c].sort();if(isNaN(u[0])){if(s>a)return 1;if(a>s)return-1}else{if(isNaN(u[1]))return isNaN(l)?-1:1;if(l>c)return 1;if(c>l)return-1}}return r.length-o.length};function ht(e,t,n){var i=vt(e,t,n),r=i[0],o=i[1];return mt(r=r.getTime(),o=o.getTime())}function ft(e,t,n){var i=vt(e,t,n);return mt(i[0],i[1])}function gt(e,t,n){var i=vt(e,t,n),r=i[0],o=i[1];for(r=r.split("").filter(Boolean),o=o.split("").filter(Boolean);r.length&&o.length;){var s=r.shift(),a=o.shift(),l=s.toLowerCase(),c=a.toLowerCase();if(l>c)return 1;if(c>l)return-1;if(s>a)return 1;if(a>s)return-1}return r.length-o.length}function pt(e,t,n){var i=vt(e,t,n),r=i[0],o=i[1],s=/[^0-9.]/gi;return mt(r=Number(String(r).replace(s,"")),o=Number(String(o).replace(s,"")))}function mt(e,t){return e===t?0:e>t?1:-1}function vt(e,t,n){return[e.values[n],t.values[n]]}function bt(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}var yt=Object.freeze({__proto__:null,alphanumeric:dt,datetime:ht,basic:ft,string:gt,number:pt});c.resetSortBy="resetSortBy",c.setSortBy="setSortBy",c.toggleSortBy="toggleSortBy",c.clearSortBy="clearSortBy",h.sortType="alphanumeric",h.sortDescFirst=!1;var wt=function(e){e.getSortByToggleProps=[Ct],e.stateReducers.push(xt),e.useInstance.push(St)};wt.pluginName="useSortBy";var Ct=function(e,t){var n=t.instance,i=t.column,r=n.isMultiSortEvent,o=void 0===r?function(e){return e.shiftKey}:r;return[e,{onClick:i.canSort?function(e){e.persist(),i.toggleSortBy(void 0,!n.disableMultiSort&&o(e))}:void 0,style:{cursor:i.canSort?"pointer":void 0},title:i.canSort?"Toggle SortBy":void 0}]};function xt(e,t,n,i){if(t.type===c.init)return r({sortBy:[]},e);if(t.type===c.resetSortBy)return r({},e,{sortBy:i.initialState.sortBy||[]});if(t.type===c.clearSortBy){var o=e.sortBy.filter((function(e){return e.id!==t.columnId}));return r({},e,{sortBy:o})}if(t.type===c.setSortBy)return r({},e,{sortBy:t.sortBy});if(t.type===c.toggleSortBy){var s,a=t.columnId,l=t.desc,u=t.multi,d=i.allColumns,h=i.disableMultiSort,f=i.disableSortRemove,g=i.disableMultiRemove,p=i.maxMultiSortColCount,m=void 0===p?Number.MAX_SAFE_INTEGER:p,v=e.sortBy,b=d.find((function(e){return e.id===a})),y=b.sortDescFirst,w=v.find((function(e){return e.id===a})),C=v.findIndex((function(e){return e.id===a})),x=null!=l,S=[];return"toggle"!=(s=!h&&u?w?"toggle":"add":C!==v.length-1||1!==v.length?"replace":w?"toggle":"replace")||f||x||u&&g||!(w&&w.desc&&!y||!w.desc&&y)||(s="remove"),"replace"===s?S=[{id:a,desc:x?l:y}]:"add"===s?(S=[].concat(v,[{id:a,desc:x?l:y}])).splice(0,S.length-m):"toggle"===s?S=v.map((function(e){return e.id===a?r({},e,{desc:x?l:!w.desc}):e})):"remove"===s&&(S=v.filter((function(e){return e.id!==a}))),r({},e,{sortBy:S})}}function St(e){var n=e.data,i=e.rows,r=e.flatRows,o=e.allColumns,s=e.orderByFn,a=void 0===s?Et:s,l=e.sortTypes,u=e.manualSortBy,d=e.defaultCanSort,h=e.disableSortBy,f=e.flatHeaders,g=e.state.sortBy,m=e.dispatch,v=e.plugins,y=e.getHooks,C=e.autoResetSortBy,S=void 0===C||C;b(v,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var E=t.useCallback((function(e){m({type:c.setSortBy,sortBy:e})}),[m]),A=t.useCallback((function(e,t,n){m({type:c.toggleSortBy,columnId:e,desc:t,multi:n})}),[m]),R=w(e);f.forEach((function(e){var t=e.accessor,n=e.canSort,i=e.disableSortBy,r=e.id,o=t?B(!0!==i&&void 0,!0!==h&&void 0,!0):B(d,n,!1);e.canSort=o,e.canSort&&(e.toggleSortBy=function(t,n){return A(e.id,t,n)},e.clearSortBy=function(){m({type:c.clearSortBy,columnId:e.id})}),e.getSortByToggleProps=p(y().getSortByToggleProps,{instance:R(),column:e});var s=g.find((function(e){return e.id===r}));e.isSorted=!!s,e.sortedIndex=g.findIndex((function(e){return e.id===r})),e.isSortedDesc=e.isSorted?s.desc:void 0}));var I=t.useMemo((function(){if(u||!g.length)return[i,r];var e=[],t=g.filter((function(e){return o.find((function(t){return t.id===e.id}))})),n=function n(i){var r=a(i,t.map((function(e){var t=o.find((function(t){return t.id===e.id}));if(!t)throw new Error("React-Table: Could not find a column with id: "+e.id+" while sorting");var n=t.sortType,i=F(n)||(l||{})[n]||yt[n];if(!i)throw new Error("React-Table: Could not find a valid sortType of '"+n+"' for column '"+e.id+"'.");return function(t,n){return i(t,n,e.id,e.desc)}})),t.map((function(e){var t=o.find((function(t){return t.id===e.id}));return t&&t.sortInverted?e.desc:!e.desc})));return r.forEach((function(t){e.push(t),t.subRows&&0!==t.subRows.length&&(t.subRows=n(t.subRows))})),r};return[n(i),e]}),[u,g,i,r,o,a,l]),k=I[0],$=I[1],_=w(S);x((function(){_()&&m({type:c.resetSortBy})}),[u?null:n]),Object.assign(e,{preSortedRows:i,preSortedFlatRows:r,sortedRows:k,sortedFlatRows:$,rows:k,flatRows:$,setSortBy:E,toggleSortBy:A})}function Et(e,t,n){return[].concat(e).sort((function(e,i){for(var r=0;re.pageIndex?l=-1===o?s.length>=e.pageSize:a-1),l?r({},e,{pageIndex:a}):e}if(t.type===c.setPageSize){var u=t.pageSize,d=e.pageSize*e.pageIndex;return r({},e,{pageIndex:Math.floor(d/u),pageSize:u})}}function kt(e){var n=e.rows,i=e.autoResetPage,r=void 0===i||i,o=e.manualExpandedKey,s=void 0===o?"expanded":o,a=e.plugins,l=e.pageCount,u=e.paginateExpandedRows,d=void 0===u||u,h=e.expandSubRows,f=void 0===h||h,g=e.state,p=g.pageSize,m=g.pageIndex,v=g.expanded,y=g.globalFilter,C=g.filters,S=g.groupBy,E=g.sortBy,A=e.dispatch,R=e.data,I=e.manualPagination;b(a,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var k=w(r);x((function(){k()&&A({type:c.resetPage})}),[A,I?null:R,y,C,S,E]);var $=I?l:Math.ceil(n.length/p),_=t.useMemo((function(){return $>0?[].concat(new Array($)).fill(null).map((function(e,t){return t})):[]}),[$]),L=t.useMemo((function(){var e;if(I)e=n;else{var t=p*m,i=t+p;e=n.slice(t,i)}return d?e:W(e,{manualExpandedKey:s,expanded:v,expandSubRows:f})}),[f,v,s,I,m,p,d,n]),T=m>0,M=-1===$?L.length>=p:m<$-1,O=t.useCallback((function(e){A({type:c.gotoPage,pageIndex:e})}),[A]),N=t.useCallback((function(){return O((function(e){return e-1}))}),[O]),B=t.useCallback((function(){return O((function(e){return e+1}))}),[O]),F=t.useCallback((function(e){A({type:c.setPageSize,pageSize:e})}),[A]);Object.assign(e,{pageOptions:_,pageCount:$,page:L,canPreviousPage:T,canNextPage:M,gotoPage:O,previousPage:N,nextPage:B,setPageSize:F})}Rt.pluginName=At,c.resetPivot="resetPivot",c.togglePivot="togglePivot";var $t=function(e){e.getPivotToggleProps=[Lt],e.stateReducers.push(Tt),e.useInstanceAfterData.push(Mt),e.allColumns.push(Ot),e.accessValue.push(Nt),e.materializedColumns.push(Bt),e.materializedColumnsDeps.push(Ft),e.visibleColumns.push(Pt),e.visibleColumnsDeps.push(Wt),e.useInstance.push(Gt),e.prepareRow.push(Ht)};$t.pluginName="usePivotColumns";var _t=[],Lt=function(e,t){var n=t.header;return[e,{onClick:n.canPivot?function(e){e.persist(),n.togglePivot()}:void 0,style:{cursor:n.canPivot?"pointer":void 0},title:"Toggle Pivot"}]};function Tt(e,t,n,i){if(t.type===c.init)return r({pivotColumns:_t},e);if(t.type===c.resetPivot)return r({},e,{pivotColumns:i.initialState.pivotColumns||_t});if(t.type===c.togglePivot){var o=t.columnId,s=t.value,a=void 0!==s?s:!e.pivotColumns.includes(o);return r({},e,a?{pivotColumns:[].concat(e.pivotColumns,[o])}:{pivotColumns:e.pivotColumns.filter((function(e){return e!==o}))})}}function Mt(e){e.allColumns.forEach((function(t){t.isPivotSource=e.state.pivotColumns.includes(t.id)}))}function Ot(e,t){var n=t.instance;return e.forEach((function(e){e.isPivotSource=n.state.pivotColumns.includes(e.id),e.uniqueValues=new Set})),e}function Nt(e,t){var n=t.column;return n.uniqueValues&&void 0!==e&&n.uniqueValues.add(e),e}function Bt(e,t){var n=t.instance,i=n.allColumns,o=n.state;if(!o.pivotColumns.length||!o.groupBy||!o.groupBy.length)return e;var s=o.pivotColumns.map((function(e){return i.find((function(t){return t.id===e}))})).filter(Boolean),a=i.filter((function(e){return!e.isPivotSource&&!o.groupBy.includes(e.id)&&!o.pivotColumns.includes(e.id)})),l=_(function e(t,n,i){void 0===t&&(t=0),void 0===i&&(i=[]);var o=s[t];return o?Array.from(o.uniqueValues).sort().map((function(s){var a=r({},o,{Header:o.PivotHeader||"string"==typeof o.header?o.Header+": "+s:s,isPivotGroup:!0,parent:n,depth:t,id:n?n.id+"."+o.id+"."+s:o.id+"."+s,pivotValue:s});return a.columns=e(t+1,a,[].concat(i,[function(e){return e.values[o.id]===s}])),a})):a.map((function(e){return r({},e,{canPivot:!1,isPivoted:!0,parent:n,depth:t,id:""+(n?n.id+"."+e.id:e.id),accessor:function(t,n,r){if(i.every((function(e){return e(r)})))return r.values[e.id]}})}))}());return[].concat(e,l)}function Ft(e,t){var n=t.instance.state,i=n.pivotColumns,r=n.groupBy;return[].concat(e,[i,r])}function Pt(e,t){var n=t.instance.state;return e=e.filter((function(e){return!e.isPivotSource})),n.pivotColumns.length&&n.groupBy&&n.groupBy.length&&(e=e.filter((function(e){return e.isGrouped||e.isPivoted}))),e}function Wt(e,t){var n=t.instance;return[].concat(e,[n.state.pivotColumns,n.state.groupBy])}function Gt(e){var t=e.columns,n=e.allColumns,i=e.flatHeaders,r=e.getHooks,o=e.plugins,s=e.dispatch,a=e.autoResetPivot,l=void 0===a||a,u=e.manaulPivot,d=e.disablePivot,h=e.defaultCanPivot;b(o,["useGroupBy"],"usePivotColumns");var f=w(e);n.forEach((function(t){var n=t.accessor,i=t.defaultPivot,r=t.disablePivot;t.canPivot=n?B(t.canPivot,!0!==r&&void 0,!0!==d&&void 0,!0):B(t.canPivot,i,h,!1),t.canPivot&&(t.togglePivot=function(){return e.togglePivot(t.id)}),t.Aggregated=t.Aggregated||t.Cell}));var g=function(e,t){s({type:c.togglePivot,columnId:e,value:t})};i.forEach((function(e){e.getPivotToggleProps=p(r().getPivotToggleProps,{instance:f(),header:e})}));var m=w(l);x((function(){m()&&s({type:c.resetPivot})}),[s,u?null:t]),Object.assign(e,{togglePivot:g})}function Ht(e){e.allCells.forEach((function(e){e.isPivoted=e.column.isPivoted}))}var Dt="useRowSelect";c.resetSelectedRows="resetSelectedRows",c.toggleAllRowsSelected="toggleAllRowsSelected",c.toggleRowSelected="toggleRowSelected",c.toggleAllPageRowsSelected="toggleAllPageRowsSelected";var Vt=function(e){e.getToggleRowSelectedProps=[zt],e.getToggleAllRowsSelectedProps=[jt],e.getToggleAllPageRowsSelectedProps=[Zt],e.stateReducers.push(Xt),e.useInstance.push(Ut),e.prepareRow.push(Yt)};Vt.pluginName=Dt;var zt=function(e,t){var n=t.instance,i=t.row,r=n.manualRowSelectedKey,o=void 0===r?"isSelected":r;return[e,{onChange:function(e){i.toggleRowSelected(e.target.checked)},style:{cursor:"pointer"},checked:!(!i.original||!i.original[o])||i.isSelected,title:"Toggle Row Selected",indeterminate:i.isSomeSelected}]},jt=function(e,t){var n=t.instance;return[e,{onChange:function(e){n.toggleAllRowsSelected(e.target.checked)},style:{cursor:"pointer"},checked:n.isAllRowsSelected,title:"Toggle All Rows Selected",indeterminate:Boolean(!n.isAllRowsSelected&&Object.keys(n.state.selectedRowIds).length)}]},Zt=function(e,t){var n=t.instance;return[e,{onChange:function(e){n.toggleAllPageRowsSelected(e.target.checked)},style:{cursor:"pointer"},checked:n.isAllPageRowsSelected,title:"Toggle All Current Page Rows Selected",indeterminate:Boolean(!n.isAllPageRowsSelected&&n.page.some((function(e){var t=e.id;return n.state.selectedRowIds[t]})))}]};function Xt(e,t,n,i){if(t.type===c.init)return r({selectedRowIds:{}},e);if(t.type===c.resetSelectedRows)return r({},e,{selectedRowIds:i.initialState.selectedRowIds||{}});if(t.type===c.toggleAllRowsSelected){var o=t.value,s=i.isAllRowsSelected,a=i.rowsById,l=i.nonGroupedRowsById,u=void 0===l?a:l,d=void 0!==o?o:!s,h=Object.assign({},e.selectedRowIds);return d?Object.keys(u).forEach((function(e){h[e]=!0})):Object.keys(u).forEach((function(e){delete h[e]})),r({},e,{selectedRowIds:h})}if(t.type===c.toggleRowSelected){var f=t.id,g=t.value,p=i.rowsById,m=i.selectSubRows,v=void 0===m||m,b=i.getSubRows,y=e.selectedRowIds[f],w=void 0!==g?g:!y;if(y===w)return e;var C=r({},e.selectedRowIds),x=function e(t){var n=p[t];if(n&&(n.isGrouped||(w?C[t]=!0:delete C[t]),v&&b(n)))return b(n).forEach((function(t){return e(t.id)}))};return x(f),r({},e,{selectedRowIds:C})}if(t.type===c.toggleAllPageRowsSelected){var S=t.value,E=i.page,A=i.rowsById,R=i.selectSubRows,I=void 0===R||R,k=i.isAllPageRowsSelected,$=i.getSubRows,_=void 0!==S?S:!k,L=r({},e.selectedRowIds),T=function e(t){var n=A[t];if(n.isGrouped||(_?L[t]=!0:delete L[t]),I&&$(n))return $(n).forEach((function(t){return e(t.id)}))};return E.forEach((function(e){return T(e.id)})),r({},e,{selectedRowIds:L})}return e}function Ut(e){var n=e.data,i=e.rows,r=e.getHooks,o=e.plugins,s=e.rowsById,a=e.nonGroupedRowsById,l=void 0===a?s:a,u=e.autoResetSelectedRows,d=void 0===u||u,h=e.state.selectedRowIds,f=e.selectSubRows,g=void 0===f||f,m=e.dispatch,v=e.page,y=e.getSubRows;b(o,["useFilters","useGroupBy","useSortBy","useExpanded","usePagination"],"useRowSelect");var C=t.useMemo((function(){var e=[];return i.forEach((function(t){var n=g?Jt(t,h,y):!!h[t.id];t.isSelected=!!n,t.isSomeSelected=null===n,n&&e.push(t)})),e}),[i,g,h,y]),S=Boolean(Object.keys(l).length&&Object.keys(h).length),E=S;S&&Object.keys(l).some((function(e){return!h[e]}))&&(S=!1),S||v&&v.length&&v.some((function(e){var t=e.id;return!h[t]}))&&(E=!1);var A=w(d);x((function(){A()&&m({type:c.resetSelectedRows})}),[m,n]);var R=t.useCallback((function(e){return m({type:c.toggleAllRowsSelected,value:e})}),[m]),I=t.useCallback((function(e){return m({type:c.toggleAllPageRowsSelected,value:e})}),[m]),k=t.useCallback((function(e,t){return m({type:c.toggleRowSelected,id:e,value:t})}),[m]),$=w(e),_=p(r().getToggleAllRowsSelectedProps,{instance:$()}),L=p(r().getToggleAllPageRowsSelectedProps,{instance:$()});Object.assign(e,{selectedFlatRows:C,isAllRowsSelected:S,isAllPageRowsSelected:E,toggleRowSelected:k,toggleAllRowsSelected:R,getToggleAllRowsSelectedProps:_,getToggleAllPageRowsSelectedProps:L,toggleAllPageRowsSelected:I})}function Yt(e,t){var n=t.instance;e.toggleRowSelected=function(t){return n.toggleRowSelected(e.id,t)},e.getToggleRowSelectedProps=p(n.getHooks().getToggleRowSelectedProps,{instance:n,row:e})}function Jt(e,t,n){if(t[e.id])return!0;var i=n(e);if(i&&i.length){var r=!0,o=!1;return i.forEach((function(e){o&&!r||(Jt(e,t,n)?o=!0:r=!1)})),!!r||!!o&&null}return!1}var Kt=function(e){return{}},Qt=function(e){return{}};c.setRowState="setRowState",c.setCellState="setCellState",c.resetRowState="resetRowState";var qt=function(e){e.stateReducers.push(en),e.useInstance.push(tn),e.prepareRow.push(nn)};function en(e,t,n,i){var o=i.initialRowStateAccessor,s=void 0===o?Kt:o,a=i.initialCellStateAccessor,l=void 0===a?Qt:a,u=i.rowsById;if(t.type===c.init)return r({rowState:{}},e);if(t.type===c.resetRowState)return r({},e,{rowState:i.initialState.rowState||{}});if(t.type===c.setRowState){var d,h=t.rowId,f=t.value,g=void 0!==e.rowState[h]?e.rowState[h]:s(u[h]);return r({},e,{rowState:r({},e.rowState,(d={},d[h]=y(f,g),d))})}if(t.type===c.setCellState){var p,m,v,b,w,C=t.rowId,x=t.columnId,S=t.value,E=void 0!==e.rowState[C]?e.rowState[C]:s(u[C]),A=void 0!==(null==E||null==(p=E.cellState)?void 0:p[x])?E.cellState[x]:l(null==(m=u[C])||null==(v=m.cells)?void 0:v.find((function(e){return e.column.id===x})));return r({},e,{rowState:r({},e.rowState,(w={},w[C]=r({},E,{cellState:r({},E.cellState||{},(b={},b[x]=y(S,A),b))}),w))})}}function tn(e){var n=e.autoResetRowState,i=void 0===n||n,r=e.data,o=e.dispatch,s=t.useCallback((function(e,t){return o({type:c.setRowState,rowId:e,value:t})}),[o]),a=t.useCallback((function(e,t,n){return o({type:c.setCellState,rowId:e,columnId:t,value:n})}),[o]),l=w(i);x((function(){l()&&o({type:c.resetRowState})}),[r]),Object.assign(e,{setRowState:s,setCellState:a})}function nn(e,t){var n=t.instance,i=n.initialRowStateAccessor,r=void 0===i?Kt:i,o=n.initialCellStateAccessor,s=void 0===o?Qt:o,a=n.state.rowState;e&&(e.state=void 0!==a[e.id]?a[e.id]:r(e),e.setState=function(t){return n.setRowState(e.id,t)},e.cells.forEach((function(t){e.state.cellState||(e.state.cellState={}),t.state=void 0!==e.state.cellState[t.column.id]?e.state.cellState[t.column.id]:s(t),t.setState=function(i){return n.setCellState(e.id,t.column.id,i)}})))}qt.pluginName="useRowState",c.resetColumnOrder="resetColumnOrder",c.setColumnOrder="setColumnOrder";var rn=function(e){e.stateReducers.push(on),e.visibleColumnsDeps.push((function(e,t){var n=t.instance;return[].concat(e,[n.state.columnOrder])})),e.visibleColumns.push(sn),e.useInstance.push(an)};function on(e,t,n,i){return t.type===c.init?r({columnOrder:[]},e):t.type===c.resetColumnOrder?r({},e,{columnOrder:i.initialState.columnOrder||[]}):t.type===c.setColumnOrder?r({},e,{columnOrder:y(t.columnOrder,e.columnOrder)}):void 0}function sn(e,t){var n=t.instance.state.columnOrder;if(!n||!n.length)return e;for(var i=[].concat(n),r=[].concat(e),o=[],s=function(){var e=i.shift(),t=r.findIndex((function(t){return t.id===e}));t>-1&&o.push(r.splice(t,1)[0])};r.length&&i.length;)s();return[].concat(o,r)}function an(e){var n=e.dispatch;e.setColumnOrder=t.useCallback((function(e){return n({type:c.setColumnOrder,columnOrder:e})}),[n])}rn.pluginName="useColumnOrder",h.canResize=!0,c.columnStartResizing="columnStartResizing",c.columnResizing="columnResizing",c.columnDoneResizing="columnDoneResizing",c.resetResize="resetResize";var ln=function(e){e.getResizerProps=[cn],e.getHeaderProps.push({style:{position:"relative"}}),e.stateReducers.push(un),e.useInstance.push(hn),e.useInstanceBeforeDimensions.push(dn)},cn=function(e,t){var n=t.instance,i=t.header,r=n.dispatch,o=function(e,t){var n=!1;if("touchstart"===e.type){if(e.touches&&e.touches.length>1)return;n=!0}var i,o,s=fn(t).map((function(e){return[e.id,e.totalWidth]})),a=n?Math.round(e.touches[0].clientX):e.clientX,l=function(){window.cancelAnimationFrame(i),i=null,r({type:c.columnDoneResizing})},u=function(){window.cancelAnimationFrame(i),i=null,r({type:c.columnResizing,clientX:o})},d=function(e){o=e,i||(i=window.requestAnimationFrame(u))},h={mouse:{moveEvent:"mousemove",moveHandler:function(e){return d(e.clientX)},upEvent:"mouseup",upHandler:function(e){document.removeEventListener("mousemove",h.mouse.moveHandler),document.removeEventListener("mouseup",h.mouse.upHandler),l()}},touch:{moveEvent:"touchmove",moveHandler:function(e){return e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(e){document.removeEventListener(h.touch.moveEvent,h.touch.moveHandler),document.removeEventListener(h.touch.upEvent,h.touch.moveHandler),l()}}},f=n?h.touch:h.mouse,g=!!z()&&{passive:!1};document.addEventListener(f.moveEvent,f.moveHandler,g),document.addEventListener(f.upEvent,f.upHandler,g),r({type:c.columnStartResizing,columnId:t.id,columnWidth:t.totalWidth,headerIdWidths:s,clientX:a})};return[e,{onMouseDown:function(e){return e.persist()||o(e,i)},onTouchStart:function(e){return e.persist()||o(e,i)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function un(e,t){if(t.type===c.init)return r({columnResizing:{columnWidths:{}}},e);if(t.type===c.resetResize)return r({},e,{columnResizing:{columnWidths:{}}});if(t.type===c.columnStartResizing){var n=t.clientX,i=t.columnId,o=t.columnWidth,s=t.headerIdWidths;return r({},e,{columnResizing:r({},e.columnResizing,{startX:n,headerIdWidths:s,columnWidth:o,isResizingColumn:i})})}if(t.type===c.columnResizing){var a=t.clientX,l=e.columnResizing,u=l.startX,d=l.columnWidth,h=l.headerIdWidths,f=(a-u)/d,g={};return(void 0===h?[]:h).forEach((function(e){var t=e[0],n=e[1];g[t]=Math.max(n+n*f,0)})),r({},e,{columnResizing:r({},e.columnResizing,{columnWidths:r({},e.columnResizing.columnWidths,{},g)})})}return t.type===c.columnDoneResizing?r({},e,{columnResizing:r({},e.columnResizing,{startX:null,isResizingColumn:null})}):void 0}ln.pluginName="useResizeColumns";var dn=function(e){var t=e.flatHeaders,n=e.disableResizing,i=e.getHooks,r=e.state.columnResizing,o=w(e);t.forEach((function(e){var t=B(!0!==e.disableResizing&&void 0,!0!==n&&void 0,!0);e.canResize=t,e.width=r.columnWidths[e.id]||e.originalWidth||e.width,e.isResizing=r.isResizingColumn===e.id,t&&(e.getResizerProps=p(i().getResizerProps,{instance:o(),header:e}))}))};function hn(e){var n=e.plugins,i=e.dispatch,r=e.autoResetResize,o=void 0===r||r,s=e.columns;b(n,["useAbsoluteLayout"],"useResizeColumns");var a=w(o);x((function(){a()&&i({type:c.resetResize})}),[s]);var l=t.useCallback((function(){return i({type:c.resetResize})}),[i]);Object.assign(e,{resetResizing:l})}function fn(e){var t=[],n=function e(n){n.columns&&n.columns.length&&n.columns.map(e),t.push(n)};return n(e),t}var gn={position:"absolute",top:0},pn=function(e){e.getTableBodyProps.push(mn),e.getRowProps.push(mn),e.getHeaderGroupProps.push(mn),e.getFooterGroupProps.push(mn),e.getHeaderProps.push((function(e,t){var n=t.column;return[e,{style:r({},gn,{left:n.totalLeft+"px",width:n.totalWidth+"px"})}]})),e.getCellProps.push((function(e,t){var n=t.cell;return[e,{style:r({},gn,{left:n.column.totalLeft+"px",width:n.column.totalWidth+"px"})}]})),e.getFooterProps.push((function(e,t){var n=t.column;return[e,{style:r({},gn,{left:n.totalLeft+"px",width:n.totalWidth+"px"})}]}))};pn.pluginName="useAbsoluteLayout";var mn=function(e,t){return[e,{style:{position:"relative",width:t.instance.totalColumnsWidth+"px"}}]},vn={display:"inline-block",boxSizing:"border-box"},bn=function(e,t){return[e,{style:{display:"flex",width:t.instance.totalColumnsWidth+"px"}}]},yn=function(e){e.getRowProps.push(bn),e.getHeaderGroupProps.push(bn),e.getFooterGroupProps.push(bn),e.getHeaderProps.push((function(e,t){var n=t.column;return[e,{style:r({},vn,{width:n.totalWidth+"px"})}]})),e.getCellProps.push((function(e,t){var n=t.cell;return[e,{style:r({},vn,{width:n.column.totalWidth+"px"})}]})),e.getFooterProps.push((function(e,t){var n=t.column;return[e,{style:r({},vn,{width:n.totalWidth+"px"})}]}))};function wn(e){e.getTableProps.push(Cn),e.getRowProps.push(xn),e.getHeaderGroupProps.push(xn),e.getFooterGroupProps.push(xn),e.getHeaderProps.push(Sn),e.getCellProps.push(En),e.getFooterProps.push(An)}yn.pluginName="useBlockLayout",wn.pluginName="useFlexLayout";var Cn=function(e,t){return[e,{style:{minWidth:t.instance.totalColumnsMinWidth+"px"}}]},xn=function(e,t){return[e,{style:{display:"flex",flex:"1 0 auto",minWidth:t.instance.totalColumnsMinWidth+"px"}}]},Sn=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]},En=function(e,t){var n=t.cell;return[e,{style:{boxSizing:"border-box",flex:n.column.totalFlexWidth+" 0 auto",minWidth:n.column.totalMinWidth+"px",width:n.column.totalWidth+"px"}}]},An=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]};function Rn(e){e.stateReducers.push(_n),e.getTableProps.push(In),e.getHeaderProps.push(kn),e.getRowProps.push($n)}c.columnStartResizing="columnStartResizing",c.columnResizing="columnResizing",c.columnDoneResizing="columnDoneResizing",c.resetResize="resetResize",Rn.pluginName="useGridLayout";var In=function(e,t){var n=t.instance,i=n.visibleColumns.map((function(e){var t;return n.state.gridLayout.columnWidths[e.id]?n.state.gridLayout.columnWidths[e.id]+"px":(null==(t=n.state.columnResizing)?void 0:t.isResizingColumn)?n.state.gridLayout.startWidths[e.id]+"px":"number"==typeof e.width?e.width+"px":e.width}));return[e,{style:{display:"grid",gridTemplateColumns:i.join(" ")}}]},kn=function(e,t){var n=t.column;return[e,{id:"header-cell-"+n.id,style:{position:"sticky",gridColumn:"span "+n.totalVisibleHeaderCount}}]},$n=function(e,t){var n=t.row;return n.isExpanded?[e,{style:{gridColumn:"1 / "+(n.cells.length+1)}}]:[e,{}]};function _n(e,t,n,i){if(t.type===c.init)return r({gridLayout:{columnWidths:{}}},e);if(t.type===c.resetResize)return r({},e,{gridLayout:{columnWidths:{}}});if(t.type===c.columnStartResizing){var o=t.columnId,s=t.headerIdWidths,a=Ln(o);if(void 0!==a){var l=i.visibleColumns.reduce((function(e,t){var n;return r({},e,((n={})[t.id]=Ln(t.id),n))}),{}),u=i.visibleColumns.reduce((function(e,t){var n;return r({},e,((n={})[t.id]=t.minWidth,n))}),{}),d=i.visibleColumns.reduce((function(e,t){var n;return r({},e,((n={})[t.id]=t.maxWidth,n))}),{}),h=s.map((function(e){var t=e[0];return[t,Ln(t)]}));return r({},e,{gridLayout:r({},e.gridLayout,{startWidths:l,minWidths:u,maxWidths:d,headerIdGridWidths:h,columnWidth:a})})}return e}if(t.type===c.columnResizing){var f=t.clientX,g=e.columnResizing.startX,p=e.gridLayout,m=p.columnWidth,v=p.minWidths,b=p.maxWidths,y=p.headerIdGridWidths,w=(f-g)/m,C={};return(void 0===y?[]:y).forEach((function(e){var t=e[0],n=e[1];C[t]=Math.min(Math.max(v[t],n+n*w),b[t])})),r({},e,{gridLayout:r({},e.gridLayout,{columnWidths:r({},e.gridLayout.columnWidths,{},C)})})}return t.type===c.columnDoneResizing?r({},e,{gridLayout:r({},e.gridLayout,{startWidths:{},minWidths:{},maxWidths:{}})}):void 0}function Ln(e){var t,n=null==(t=document.getElementById("header-cell-"+e))?void 0:t.offsetWidth;if(void 0!==n)return n}e._UNSTABLE_usePivotColumns=$t,e.actions=c,e.defaultColumn=h,e.defaultGroupByFn=ct,e.defaultOrderByFn=Et,e.defaultRenderer=u,e.emptyRenderer=d,e.ensurePluginOrder=b,e.flexRender=A,e.functionalUpdate=y,e.loopHooks=v,e.makePropGetter=p,e.makeRenderer=E,e.reduceHooks=m,e.safeUseLayoutEffect=C,e.useAbsoluteLayout=pn,e.useAsyncDebounce=S,e.useBlockLayout=yn,e.useColumnOrder=rn,e.useExpanded=we,e.useFilters=Pe,e.useFlexLayout=wn,e.useGetLatest=w,e.useGlobalFilter=He,e.useGridLayout=Rn,e.useGroupBy=nt,e.useMountedLayoutEffect=x,e.usePagination=Rt,e.useResizeColumns=ln,e.useRowSelect=Vt,e.useRowState=qt,e.useSortBy=wt,e.useTable=ve,Object.defineProperty(e,"__esModule",{value:!0})}(Hd.exports,c.default),"production"===process.env.NODE_ENV?Wd.exports=Gd.exports:Wd.exports=Hd.exports;var Dd={setItem:function(e,t){return localStorage.setItem(e,t)},getItem:function(e){return localStorage.getItem(e)},removeItem:function(e){return localStorage.removeItem(e)},updateFilters:function(e,t){var n,i,r=null!==(i=Dd.getItem(tn))&&void 0!==i?i:"{}",o=JSON.parse(r),s=u({},o);return Xn.isEmpty(t)?Reflect.deleteProperty(s,e):s=u(u({},s),((n={})[e]=t,n)),Xn.isEmpty(s)?Dd.removeItem(tn):Dd.setItem(tn,JSON.stringify(s))},updateHidden:function(e,t){var n,i=null!==(n=Dd.getItem(rn))&&void 0!==n?n:"{}",r=JSON.parse(i),o=u({},r);o[e]=t,Dd.setItem(rn,JSON.stringify(o))},updateResized:function(e,t){var n,i,r=null!==(i=Dd.getItem(on))&&void 0!==i?i:"{}",o=JSON.parse(r),s=u({},o);return Xn.isEmpty(t)?Reflect.deleteProperty(s,e):s=u(u({},s),((n={})[e]=t,n)),Xn.isEmpty(s)?Dd.removeItem(on):Dd.setItem(on,JSON.stringify(s))},updateResizedEnabled:function(e,t){var n,i,r=null!==(i=Dd.getItem(sn))&&void 0!==i?i:"{}",o=JSON.parse(r),s=u(u({},o),((n={})[e]=t,n));Dd.setItem(sn,JSON.stringify(s))}};function Vd(n){var i=n.columns,r=n.colProperty,o=e.useRef(null),s=h(e.useState(!1),2),a=s[0],l=s[1],d=i.filter((function(e){return e.getToggleHiddenProps().checked})).length;return c.default.createElement("span",{className:"show-columns-wrapper",ref:o},c.default.createElement(Vn,{data:"Show/Hide columns"},c.default.createElement(t.IconButton,{onClick:function(){return l((function(e){return!e}))}},c.default.createElement(L,null))),c.default.createElement(t.Popper,{open:a,anchorEl:o.current,transition:!0,disablePortal:!0,className:"popper-wrapper",nonce:void 0,onResize:void 0,onResizeCapture:void 0},(function(e){var n=e.TransitionProps;return c.default.createElement(t.Grow,u({},n,{style:{transformOrigin:"center top"}}),c.default.createElement(t.Paper,{className:"menu-popper"},c.default.createElement(t.ClickAwayListener,{onClickAway:function(){return l(!1)}},c.default.createElement("div",{className:"show-columns"},i.map((function(e){var t=e.getToggleHiddenProps();return c.default.createElement("div",{key:e.id},c.default.createElement("div",{className:"show-columns-line"},c.default.createElement(jn,u({},t,{disabled:t.checked&&d<=2})),c.default.createElement("span",{className:"capitalize-first-letter"},e[r])))}))))))})))}function zd(n){var i=n.actions,r=n.row,o=n.disablePortal,s=void 0!==o&&o,a=h(Po(!1),2),l=a[0],f=a[1],g=e.useRef(null),p=i.filter((function(e){var t=e.hideAction;return t instanceof Function?!(null==t?void 0:t(r.original)):!t})).map((function(e){var t=e.action,n=e.content,i=e.disabled,o=d(e,["action","content","disabled"]);return u(u(u({},o),{content:n instanceof Function?n(r.original):n,disabled:i instanceof Function?i(r.original):i}),t&&{onClick:function(){t(u(u({},r.original),r.state))}})}));return p.length?c.default.createElement("div",{className:"table-row-actions",ref:g},c.default.createElement(t.IconButton,{className:"actions-btn",onClick:f},c.default.createElement(ae,null)),l&&c.default.createElement(Nd,{disablePortal:s,anchorEl:g.current,open:l,onClickAway:f,items:p})):c.default.createElement("div",{className:"table-row-actions-empty"})}function jd(t){var n=t.cell,r=n.value,o=n.column,s=n.row,a=o.isLink,l=o.getUrl,d=o.openInNewTab,f=e.useRef(null),g=h(e.useState(Qt),2),p=g[0],m=g[1],v=function(){f.current&&Xn.isEllipsisActive(f.current)?m(r):m(Qt)};e.useEffect((function(){return v(),window.addEventListener("resize",v),document.addEventListener(ln,v),function(){window.removeEventListener("resize",v),document.removeEventListener(ln,v)}}),[r]);var b=c.default.createElement("div",{className:"table-default-cell",ref:f},r);return c.default.createElement(Vn,{data:null==p?void 0:p.toString()},a&&l?c.default.createElement(i.Link,u({to:l(s.original),className:"table-link"},d&&{target:"_blank",rel:"noopener noreferrer"}),b):b)}function Zd(e){var n,i=e.row,r=e.action,o=r.Icon,s=r.onClick,a=r.tooltipText,l=r.disabled,d=r.extraClass,h=p(((n={"icon-cell-btn":!0})[void 0===d?Qt:d]=!0,n));return c.default.createElement(Vn,{data:(a instanceof Function?a(i.original):a)||Qt},c.default.createElement("div",null,c.default.createElement(t.IconButton,{onClick:function(){return s(u(u({},i.original),i.state))},disabled:l instanceof Function?l(i.original):l,className:h},c.default.createElement(o,null))))}function Xd(e){var t=e.date,n=void 0===t?null:t,i=e.showSeconds,r=void 0===i||i,o=e.showTime,s=void 0===o||o,a=e.disabled,l=e.enableCustomFormat,u=void 0!==l&&l,d=e.customFormat,h=void 0===d?Tn:d,f=p({"datetime-label":!0,"datetime-label-disabled":a});return c.default.createElement("span",{className:f},n?s?u?"".concat(n.toFormat(h)," • ").concat(Xn.formatDate(n,r,!1).slice(9)):"".concat(Xn.formatDate(n,r,!1).slice(0,9)," • ").concat(Xn.formatDate(n,r,!1).slice(9)):"".concat(Xn.formatDate(n,!1,!1,!1)):Qt)}function Ud(e){var t=e.month,n=e.date,i=e.selected,r=e.onSelect,o=e.minDate,s=void 0===o?null:o,a=e.maxDate,l=void 0===a?null:a;function u(){return t!==n.month||!!l&&n>l||!!s&&nt?t:n)}}),c.default.createElement("div",{className:"arrow-buttons"},c.default.createElement(X,{className:"rotate180",onMouseDown:function(e){e.detail>1&&e.preventDefault()},onClick:function(){r((n+t+2)%(t+1))}}),c.default.createElement(X,{onMouseDown:function(e){e.detail>1&&e.preventDefault()},onClick:function(){r((n+t)%(t+1))}})))}function Kd(t){var i=t.time,r=t.onSubmit,o=t.showSeconds,s=void 0===o||o,a=t.onNowSubmit,l=t.showNow,d=void 0===l||l,f={hour:!1,minute:!1,second:!1},g=h(e.useState(f),2),m=g[0],v=g[1],b=h(e.useState(i?i.hour:0),2),y=b[0],w=b[1],C=h(e.useState(i?i.minute:0),2),x=C[0],S=C[1],E=h(e.useState(i?i.second:0),2),A=E[0],R=E[1];function I(e,t){var n,o={hour:y,minute:x,second:A};r(i.set(u(u({},o),((n={})[e]=t,n))))}var k=p({"datetime-time":!0,"datetime-time-hour-min-only":!s}),$=p({"time-selector":!0,"time-selector-no-now":!d});return c.default.createElement("div",{className:k},c.default.createElement("div",{className:$},d&&c.default.createElement(Gn,{extraClass:"time-selector-now-btn",onClick:function(){return a(n.DateTime.now())}},"Now"),c.default.createElement(Jd,{value:y,max:23,numTitle:$n,initialNumState:f,numFocus:m,setNumFocus:v,onChange:function(e){Number.isNaN(e)||(w(e),I($n,e))}}),c.default.createElement(Jd,{value:x,max:59,numTitle:_n,initialNumState:f,numFocus:m,setNumFocus:v,onChange:function(e){Number.isNaN(e)||(S(e),I(_n,e))}}),s&&c.default.createElement(Jd,{value:A,max:59,numTitle:Ln,initialNumState:f,numFocus:m,setNumFocus:v,onChange:function(e){Number.isNaN(e)||(R(e),I(Ln,e))}})))}function Qd(t){var i=t.onSubmit,r=t.initValue,o=void 0===r?n.DateTime.now():r,s=t.minDate,a=void 0===s?null:s,l=t.maxDate,u=void 0===l?null:l,d=t.showSeconds,f=void 0===d||d,g=t.showTime,p=void 0===g||g,m=t.canClear,v=void 0===m||m,b=t.showNow,y=h(e.useState(o),2),w=y[0],C=y[1];return c.default.createElement("div",{className:"calendar-wrapper"},c.default.createElement("div",null,c.default.createElement(Yd,{date:w,onSubmit:p?C:i,minDate:a,maxDate:u})),p?c.default.createElement(c.default.Fragment,null,c.default.createElement("div",null,c.default.createElement(Kd,{time:w,onSubmit:C,showSeconds:f,onNowSubmit:i,showNow:b})),c.default.createElement("div",{className:"calendar-actions"},c.default.createElement("div",{className:"calendar-actions-sub"},v&&c.default.createElement(Gn,{empty:!0,onClick:function(){return i(void 0)}},"Clear"),c.default.createElement(Gn,{onClick:function(){return i(w)}},"OK")))):null)}function qd(n){var i=n.onChange,r=n.value,o=n.label,s=void 0===o?Qt:o,a=n.minDate,l=n.maxDate,d=n.showSeconds,f=n.isRequired,g=n.error,m=n.disablePortal,v=n.showTime,b=n.showCalendarIcon,y=void 0!==b&&b,w=n.disabled,C=void 0!==w&&w,x=n.canClear,S=void 0===x||x,E=n.showNow,A=n.enableCustomFormat,R=n.customFormat,I=h(e.useState(!1),2),k=I[0],$=I[1],_=e.useRef(null),L=p({"picker-label":!0,"picker-label-disabled":C,"picker-label-active":k,"has-error":g,"picker-no-label":!s,"picker-label-show-calendar":y}),T=p({"datetime-picker":!0,"datetime-picker-no-label":!s});return c.default.createElement("div",{className:T,ref:_},c.default.createElement("div",{className:L,onClick:function(){return $((function(e){return!e}))}},s&&c.default.createElement("div",{className:"picker-label-title"},s,f&&c.default.createElement("span",{className:"required-star"},"*")),y?c.default.createElement(Ze,null):c.default.createElement(X,{className:p({rotate180:k})}),c.default.createElement("div",{className:"picker-label-text"},c.default.createElement(Xd,{date:r,showSeconds:d,showTime:v,disabled:C,enableCustomFormat:A,customFormat:R})),c.default.createElement("span",{className:"datetime-picker-error"},g)),c.default.createElement(t.Popper,{disablePortal:m,open:k,anchorEl:_.current,transition:!0,className:"popper-wrapper",nonce:void 0,onResize:void 0,onResizeCapture:void 0},(function(e){var n=e.TransitionProps;return c.default.createElement(t.Grow,u({},n,{style:{transformOrigin:"center top"}}),c.default.createElement(t.Paper,{className:"menu-popper menu-popper-calendar"},c.default.createElement(t.ClickAwayListener,{onClickAway:function(){return $(!1)}},c.default.createElement("div",{className:"date-time-wrapper"},c.default.createElement(Qd,{initValue:r,minDate:a,maxDate:l,onSubmit:function(e){i(e),$(!1)},showSeconds:d,showTime:v,canClear:S,showNow:E})))))})))}var eh=function(){return!1};function th(n){var i=n.setFilter,r=n.value,o=n.children,s=n.columnTitle,a=void 0===s?Qt:s,l=n.disabledBtnTooltip,d=void 0===l?Qt:l,f=n.hideWrapper,g=void 0!==f&&f,m=n.shouldDisableBtn,v=void 0===m?eh:m,b=n.isPopperOpen,y=n.onTogglePopper,w=h(Po(!1),2),C=w[0],x=w[1],S=null!=b?b:C,E=function(){y?y():x()},A=e.useRef(null),R=e.useRef(null);!function(t,n,i,r){function o(e){e.key===n&&i()}void 0===r&&(r="keydown"),e.useEffect((function(){return t.current&&t.current.addEventListener(r,o),function(){t.current&&t.current.removeEventListener(r,o)}}),[t.current,i])}(R,"Enter",k);var I=Xn.isEmpty(r)||Xn.isString(r)&&0===(null==r?void 0:r.trim().length)||v(r);function k(){I||(i(r),E())}return c.default.createElement("div",{className:"filter-table-wrapper"},c.default.createElement(Vn,{data:"Filter by ".concat(a.charAt(0).toUpperCase()).concat(a.slice(1))},c.default.createElement("span",{onClick:E,ref:A,className:"filter-table-wrapper-icon"},c.default.createElement(De,null))),S&&c.default.createElement(t.Popper,{open:S,anchorEl:A.current,transition:!0,className:"popper-wrapper",nonce:void 0,onResize:void 0,onResizeCapture:void 0},(function(e){var n=e.TransitionProps;return c.default.createElement(t.Grow,u({},n,{style:{transformOrigin:"center top"}}),c.default.createElement(t.Paper,null,c.default.createElement(t.ClickAwayListener,{onClickAway:E},g?o:c.default.createElement("div",{className:"filter-table-wrapper-data"},c.default.createElement("div",{className:p("filter-table-wrapper-inside-filter"),ref:R},o),c.default.createElement(Vn,{data:r&&v(r)?d:Qt},c.default.createElement("div",{className:"filter-table-wrapper-btn"},c.default.createElement(Gn,{disable:I,onClick:k},"Filter")))))))})))}function nh(t){var i=t.column,r=i.filterValue,o=i.setFilter,s=i.id,a=void 0===s?Qt:s,l=i.customTitle,u=void 0===l?Qt:l,d=i.Header,f=i.enableCustomFormat,g=i.customFormat,p=h(e.useState((null==r?void 0:r.startTime)?n.DateTime.fromISO(r.startTime):void 0),2),m=p[0],v=p[1],b=h(e.useState((null==r?void 0:r.endTime)?n.DateTime.fromISO(r.endTime):void 0),2),y=b[0],w=b[1],C=h(Po(!1),2),x=C[0],S=C[1];return e.useEffect((function(){r||(v(void 0),w(void 0))}),[r]),c.default.createElement(th,{setFilter:o,columnTitle:u||a||d,hideWrapper:!0,isPopperOpen:x,onTogglePopper:S},c.default.createElement("div",{className:"date-filter-wrapper"},c.default.createElement("div",null,c.default.createElement(qd,{onChange:v,value:m,label:"FROM",maxDate:y?y.endOf("day"):n.DateTime.now(),showSeconds:!0,enableCustomFormat:f,customFormat:g})),c.default.createElement("div",null,c.default.createElement(qd,{onChange:w,value:y,label:"TO",minDate:m&&m.startOf("day"),showSeconds:!0,enableCustomFormat:f,customFormat:g})),c.default.createElement("div",{className:"date-filter-controller"},c.default.createElement(Gn,{disable:!m&&!y,empty:!0,onClick:function(){v(void 0),w(void 0),o(void 0)}},"Clear"),c.default.createElement(Gn,{disable:!m&&!y,onClick:function(){o({startTime:(null==m?void 0:m.toJSDate().toISOString())||void 0,endTime:(null==y?void 0:y.toJSDate().toISOString())||void 0}),S()}},"Filter"))))}var ih=function(e,t,i){var r=e.startTime,o=e.endTime;return!(!r&&!o)&&(t?"".concat(r?n.DateTime.fromISO(r).toFormat(i):"Anytime"," → ").concat(o?n.DateTime.fromISO(o).toFormat(i):"Anytime"):"".concat(r?Xn.formatISODate(r,!1):"Anytime"," → ").concat(o?Xn.formatISODate(o,!1):"Anytime"))};function rh(t){var n=t.name,i=t.value,r=t.onDelete,o=t.hasCustomDateFormat,s=void 0!==o&&o,a=t.customDateFormat,l=void 0===a?Mn:a,u=e.useMemo((function(){if("string"==typeof i)return i;if(Array.isArray(i))return i.join(", ");if(e=i,Xn.isObject(e)&&("startTime"in e||"endTime"in e))return ih(i,s,l);var e;throw new Error("Unknown filter value!")}),[i]),d=e.useMemo((function(){return n.toUpperCase().replace(/\s/g,"")in cn?cn["".concat(n.toUpperCase().replace(/\s/g,""))]:n.split("_").join(" ")}),[]);return c.default.createElement("div",{className:"box-filter-container",key:n},c.default.createElement("span",{className:"filter-headline"},d,c.default.createElement(W,{onClick:r})),c.default.createElement("span",{className:"filter-data"},u))}function oh(t){var n=t.enabled,r=void 0===n||n,o=t.filterConfig,s=t.filterCategory,a=Fo({filterConfig:o}),l=i.useNavigate(),c=h(e.useState((function(){if(!r)return[];if(window.location.search){var e=new URLSearchParams(window.location.search),t=Xn.parseSearchParamsToObject(e);return o.flatMap((function(e){var n=e.id,i=e.filterParser,r=(void 0===i?hh:i)(t[n]);return r?{id:n,value:r}:[]}))}var n,i=(n=Dd.getItem(tn))&&JSON.parse(n)[s]||{},a=o.flatMap((function(e){var t=e.id,n=i[t];return n?{id:t,value:n}:[]}));return a})),2),u=c[0],d=c[1],g=e.useCallback((function(){var e=new URLSearchParams(window.location.search),t=u.filter((function(e){return!e.defaultFilter})),n=t.reduce((function(e,t){var n=t.id,i=t.value;return e[n]=i,e}),{});Dd.updateFilters(s,n),a.filterConfig.forEach((function(t){var n=t.id;e.delete(n),f([],h(e),!1).forEach((function(t){var i=h(t,1)[0];i.match(new RegExp("".concat(n,"\\[.+\\]")))&&e.delete(i)}))})),t.forEach((function(t){var n=t.id,i=t.value;Array.isArray(i)?i.forEach((function(t){Xn.isEmpty(t)||e.append(n,t.toString())})):Xn.isObject(i)?Object.entries(i).forEach((function(t){var i=h(t,2),r=i[0],o=i[1];Xn.isEmpty(o)||e.append("".concat(n,"[").concat(r,"]"),o.toString())})):Xn.isEmpty(i)||e.append(n,i.toString())})),l({pathname:window.location.pathname,search:"?".concat(e.toString())},{replace:!0})}),[s,u,l,a.filterConfig]);e.useEffect(g,[g]);var p=h(i.useSearchParams(),1)[0],m=e.useRef();return e.useEffect((function(){m.current!==window.location.search&&g(),m.current=window.location.search}),[g,p]),[u,d]}function sh(t){var n=t.column,i=n.filterValue,r=n.setFilter,o=n.preFilteredRows,s=n.id,a=void 0===s?Qt:s,l=n.Header,u=n.fixedOptions,d=h(e.useState(Xn.isEmpty(i)?[]:i),2),g=d[0],p=d[1],m=(u&&c.default.useMemo((function(){var e=new Set;return u.forEach((function(t){e.add(t)})),f([],h(e.values()),!1)}),[a,u])||c.default.useMemo((function(){var e=new Set;return null==o||o.forEach((function(t){e.add(t.values[a])})),f([],h(e.values()),!1)}),[a,o])).map((function(e){return Xn.formatOption(e)}));return c.default.createElement(th,{setFilter:r,value:g,columnTitle:l},c.default.createElement("div",{className:"table-select-filter"},c.default.createElement(kd,{options:m,onChange:p,value:g,autoFocus:!0})))}function ah(t){var n=t.column,i=n.filterValue,r=n.setFilter,o=n.customSetFilter,s=n.preFilteredRows,a=n.id,l=void 0===a?Qt:a,u=n.fixedOptions,d=n.Header,g=void 0===i?[]:Array.isArray(i)?i:[i],p=h(e.useState(g),2),m=p[0],v=p[1],b=(u&&c.default.useMemo((function(){var e=new Set;return u.forEach((function(t){m&&!m.includes(t)&&e.add(t)})),f([],h(e.values()),!1)}),[l,u,m])||c.default.useMemo((function(){var e=new Set;return null==s||s.forEach((function(t){if(m){var n=t.values[l];if(Xn.isEmpty(n))return;Array.isArray(n)?n.forEach((function(t){m.includes(t)||e.add(t)})):m.includes(n)||e.add(n)}})),f([],h(e.values()),!1)}),[l,s,m])).map((function(e){return Xn.formatOption(e)}));e.useEffect((function(){v(g)}),[JSON.stringify(g)]);return c.default.createElement(th,{setFilter:o||r,value:m,columnTitle:d},c.default.createElement("div",{className:"table-multi-select-filter"},c.default.createElement(kd,{options:b,onChange:function(e){v(f(f([],h(m),!1),[e],!1).sort())},value:null,autoFocus:!0,sortOptions:!0}),c.default.createElement("div",{className:"selected-options-wrapper"},m.map((function(e){return c.default.createElement("div",{key:e,className:"selected-option"},c.default.createElement(W,{onClick:function(){return t=e,n=m.filter((function(e){return e!==t})),void v(n);var t,n}}),c.default.createElement("span",{className:"dropdown-lines-1"},e))})))))}function lh(e){var t=e.column,n=t.filterValue,i=t.setFilter,r=t.byMinSeverity,o=void 0===r||r,s=h(Po(!1),2),a=s[0],l=s[1];return c.default.createElement(th,{setFilter:i,value:n,columnTitle:o?"Min. Severity":"Severity",hideWrapper:!0,isPopperOpen:a,onTogglePopper:l},c.default.createElement("div",{className:"severity-filter"},c.default.createElement("span",{className:"heading-4"},"Min. Severity"),Nn.map((function(e){var t,n=Bn[e],r=p(((t={"severity-wrapper":!0})[e.toLowerCase()]=!0,t));return c.default.createElement("div",{key:e,onClick:function(){i(e),l()},className:r},c.default.createElement("span",null,c.default.createElement(n,null)),e)}))))}function ch(t){var n=t.column,i=n.filterValue,r=n.setFilter,o=n.Header,s=d(n,["filterValue","setFilter","Header"]),a=h(e.useState(i),2),l=a[0],f=a[1];return e.useEffect((function(){f(i)}),[i]),c.default.createElement(th,u({setFilter:r,value:l,columnTitle:o},s),c.default.createElement("input",{autoFocus:!0,className:"table-text-filter",value:l||Qt,onChange:function(e){f(e.target.value||void 0)}}))}var uh={length:function(e,t,n){var i=e.values[n].length,r=t.values[n].length;return i===r?0:i>r?1:-1}},dh=new Map,hh=function(e){return Array.isArray(e)&&e[0]?e[0]:null};dh.set(nh,(function(e){var t,n,i,r;return Xn.isObject(e)&&((null===(t=null==e?void 0:e.startTime)||void 0===t?void 0:t[0])||(null===(n=null==e?void 0:e.endTime)||void 0===n?void 0:n[0]))?{startTime:null===(i=null==e?void 0:e.startTime)||void 0===i?void 0:i[0],endTime:null===(r=null==e?void 0:e.endTime)||void 0===r?void 0:r[0]}:null})),dh.set(ah,(function(e){return Array.isArray(e)?e:null})),dh.set(sh,hh),dh.set(lh,(function(e){return"string"==typeof e&&Nn.includes(e)?e:null})),dh.set(ch,hh);var fh=c.default.memo((function(n){var i,r=n.columns,o=n.data,s=n.rowActions,a=void 0===s?[]:s,l=n.tableActions,g=n.title,m=n.defaultSort,v=void 0===m?Qt:m,b=n.globalFilter,y=n.defaultGlobalFilter,w=void 0===y?Qt:y,C=n.checkRowSelected,x=n.checkRowHighlighted,S=n.getRowId,E=n.addFilterToUrl,A=n.RowSubComponent,R=n.listenerPrefix,I=n.onRowClick,k=void 0===I?qt:I,$=n.miniTable,_=n.filterCategory,L=n.fixedPageSize,T=n.disableActionsPortal,M=n.maxRows,O=n.emptyMessage,N=n.colPropForShowColumns,B=n.manualPagination,F=n.itemsAmount,P=n.canExpandAll,W=void 0!==P&&P,G=n.loading,H=n.onFiltersChanged,D=n.defaultDescendingSort,z=void 0!==D&&D,j=n.customRowActions,Z=n.onSortChanged,U=n.manualSorting,Y=n.manualFilters,J=n.extraClasses,Q=n.initialFilters,q=n.groupBy,ee=n.hasCustomDateFormat,te=n.customDateFormat,ne=n.hasResizableColumns,re=void 0!==ne&&ne,oe=n.hasEmptyActionsCell,se=void 0!==oe&&oe,ae=n.collapseRowsOnLeavingPage,le=void 0!==ae&&ae,ce=e.useMemo((function(){return null==Q?void 0:Q.map((function(e){return u(u({},e),{defaultFilter:!0})}))}),[Q]),ue=Dd.getItem(rn),de=ue&&JSON.parse(ue)[_]||r.filter((function(e){return e.defaultHidden})).map((function(e){var t=e.Header,n=e.accessor;return Xn.isString(n)?n:t})),he=Dd.getItem(on),fe=he&&JSON.parse(he)[_]||{columnWidths:{}},ge=c.default.useMemo((function(){return{Cell:jd,width:100,sortType:Xn.stringSort}}),[]),pe=h(function(t){var n=h(e.useState((function(){if(!t)return new Set;var e=Dd.getItem(nn);return new Set(e?JSON.parse(e):[])})),2),i=n[0],r=n[1];return[i,function(e){if(t){var n=new Set(e.map((function(e){return e.id}))),i=[];t.forEach((function(e){var t=e.id;n.has(t)||i.push(t)})),Dd.setItem(nn,JSON.stringify(i)),r(new Set(i))}}]}(ce),2),me=pe[0],ve=pe[1],be=e.useMemo((function(){return r.flatMap((function(e){var t,n=dh.get(e.Filter),i=null!==(t=e.id)&&void 0!==t?t:e.accessor;return n&&"string"==typeof i?{id:i,filterParser:n}:[]}))}),[r]),ye=h(oh({enabled:E,filterConfig:be,filterCategory:_}),2),we=ye[0],Ce=ye[1],xe=h(Po(!1),2),Se=xe[0],Ee=xe[1],Ae=Dd.getItem(sn),Re=h(Po(Ae&&Object.keys(JSON.parse(Ae)).includes(_)?JSON.parse(Ae)[_]:re),2),Ie=Re[0],ke=Re[1],$e=e.useRef(we).current,_e=void 0===$e?[]:$e,Le=e.useMemo((function(){return ce?f([],h(ce),!1).filter((function(e){var t=e.id;return!me.has(t)})).filter((function(e){var t=e.id;return!_e.find((function(e){return e.id===t}))})).concat(_e):_e}),[]),Te=Wd.exports.useTable.apply(void 0,f(f([{columns:r,data:o,manualPagination:B,defaultColumn:ge,globalFilter:b,initialState:u(u({pageSize:L||50},v&&{sortBy:[{id:v,desc:z}]}),{filters:Le,globalFilter:w,hiddenColumns:de,groupBy:q,columnResizing:fe}),autoResetFilters:!1,autoResetSortBy:!1,autoResetExpanded:le&&!Se&&B,autoResetPage:!1,autoResetRowState:!1,autoResetGlobalFilter:!1,autoResetHiddenColumns:!1,autoResetResize:!1,paginateExpandedRows:!1,getRowId:S,sortTypes:uh,manualSortBy:U,manualFilters:Y},Wd.exports.useRowState,Wd.exports.useFilters],h(q?[Wd.exports.useGroupBy]:[]),!1),[Wd.exports.useGlobalFilter,Wd.exports.useSortBy,Wd.exports.useExpanded,Wd.exports.usePagination,Wd.exports.useFlexLayout,Wd.exports.useResizeColumns],!1)),Me=Te.getTableProps,Oe=Te.getTableBodyProps,Ne=Te.headerGroups,Be=Te.rows,Fe=Te.allColumns,Pe=Te.prepareRow,We=Te.canPreviousPage,Ge=Te.canNextPage,He=Te.pageCount,De=Te.toggleSortBy,Ve=Te.gotoPage,ze=Te.nextPage,je=Te.setPageSize,Ze=Te.previousPage,Xe=Te.page,Ue=Te.state,Ye=Ue.pageIndex,Je=Ue.filters,Ke=Ue.columnResizing,Qe=Ue.sortBy,qe=Te.setFilter,et=Te.setAllFilters,tt=Te.visibleColumns,nt=Te.setHiddenColumns,it=Te.getToggleAllRowsExpandedProps,rt=Te.isAllRowsExpanded,ot=Te.resetResizing,st=e.useRef(Z);st.current=Z,e.useEffect((function(){var e;null===(e=st.current)||void 0===e||e.call(st,Qe[0])}),[Qe]),e.useEffect((function(){ve(Je)}),[Je]),e.useEffect((function(){re&&(Dd.updateResized(_,Ke),Xn.dispatchCustomEvent(ln,void 0))}),[JSON.stringify(Ke),_,re]),e.useEffect((function(){re&&Dd.updateResizedEnabled(_,Ie)}),[Ie,_,re]);var at=p({"empty-table":!Be.length,"react-table":!0}),lt=p({"mini-table":$,"scroll-wrapper":!0}),ct=e.useRef(null),ut=!!A,dt=e.useMemo((function(){return Je.filter((function(e){var t=e.id;return Fe.find((function(e){return t===e.id}))}))}),[Je]);function ht(e){var t,n=e.detail,i=n.value,r=n.id,o=(null===(t=Je.find((function(e){return e.id===r})))||void 0===t?void 0:t.value)||[],s=Array.isArray(o)?f([],h(o),!1):[o];(null==s?void 0:s.includes(i))?s.splice(s.indexOf(i),1):s.push(i),qe(r,Xn.isEmpty(s)?void 0:s)}e.useEffect((function(){null==H||H(Je),E&&Ce(Je)}),[Je,E]),e.useEffect((function(){nt((function(e){return Dd.updateHidden(_,e),e}))}),[tt.length]),e.useEffect((function(){return R?(document.addEventListener("".concat(R).concat(an),ht),Xn.dispatchCustomEvent("".concat(R).concat("table-filters"),Je),function(){document.removeEventListener("".concat(R).concat(an),ht)}):function(){}}),[Je]),e.useEffect((function(){Ve(0)}),[He]),e.useEffect((function(){var e;null===(e=ct.current)||void 0===e||e.scrollTo(0,0),le&&A&&!rt&&Be.forEach((function(e){e.isExpanded&&e.toggleRowExpanded(!1)}))}),[Ye,Be]),e.useEffect((function(){$&&!L&&je(Be.length)}),[Be.length]),e.useEffect((function(){L&&je(L)}),[L]);var ft=e.useCallback(ns.debounce((function(){var e,t=null===(e=ct.current)||void 0===e?void 0:e.clientHeight;!t||$||L||je(t/35)}),350),[]);return e.useEffect((function(){return ft(),window.addEventListener("resize",ft),function(){window.removeEventListener("resize",ft)}}),[]),c.default.createElement("div",{className:p("react-table-wrapper",null==J?void 0:J.tableWrapper)},!$&&c.default.createElement("div",{className:"table-top"},c.default.createElement("div",null,c.default.createElement("span",{className:"heading-4"},g),c.default.createElement("span",{className:"sub-title bold"},"".concat(F||Be.length," ").concat(M?"(max ".concat(M,")"):Qt)),Fe.length>2&&c.default.createElement(Vd,{columns:Fe,colProperty:N||"Header"}),W&&ut&&c.default.createElement("span",u({},it(),{className:"table-manipulations-btn"}),c.default.createElement(Vn,{data:rt?"Collapse all":"Expand all"},c.default.createElement(t.IconButton,{onClick:Ee},c.default.createElement(wt,{className:"".concat(rt?"rotate180":Qt)})))),re&&c.default.createElement("span",{className:p((i={},i["table-manipulations-btn"]=!0,i["resizing-btn-is-on"]=Ie,i))},c.default.createElement(Vn,{data:"".concat(Ie?"Disable":"Enable"," column resizing")},c.default.createElement(t.IconButton,{onClick:ke},c.default.createElement(Bt,null)))),re&&c.default.createElement("span",{className:"table-manipulations-btn"},c.default.createElement(Vn,{data:"Reset column resizing"},c.default.createElement(t.IconButton,{onClick:ot},c.default.createElement(Gt,null))))),!Xn.isEmpty(dt)&&c.default.createElement("div",{className:"table-filters"},!Xn.isEmpty(dt)&&dt.map((function(e){var t=e.id,n=e.value;return c.default.createElement(rh,{key:t,name:t,value:n,onDelete:function(){qe(t,void 0)},hasCustomDateFormat:ee,customDateFormat:te})})),c.default.createElement("div",{className:"table-filters-clear"},c.default.createElement(Vn,{data:"Clear Filters"},c.default.createElement(t.IconButton,{onClick:function(){et([])}},c.default.createElement(ie,null))))),c.default.createElement("div",{className:"table-actions"},l)),G?c.default.createElement(Wo,null):c.default.createElement("div",{className:lt,ref:ct},c.default.createElement("table",u({},Me(),{className:at}),c.default.createElement("thead",{className:"sticky-header"},Ne.map((function(e){var t=e.getHeaderGroupProps(),n=t.key,i=d(t,["key"]);return c.default.createElement("tr",u({},i,{key:n}),ut?c.default.createElement("th",{className:"table-header header-cell-for-expandable"}):null,e.headers.map((function(e){var t,n,i=e.getHeaderProps(),r=i.key,o=d(i,["key"]);return c.default.createElement("th",u({},o,{key:r,className:"table-header"}),c.default.createElement(Vn,{data:e.tooltip},c.default.createElement("span",{className:p((t={},t["table-headline"]=!0,t["disable-sort"]=e.disableSort,t)),onClick:function(){e.disableSort||De(e.id,void 0!==e.isSortedDesc&&!e.isSortedDesc)}},e.render("Header"))),e.Filter?e.render("Filter"):null,!e.disableSort&&(e.isSorted||!e.isSorted&&!e.Header)&&c.default.createElement("div",{className:p("table-sort",!e.isSorted&&!e.Header&&"table-sort-no-title"),onClick:function(){return De(e.id,!e.isSortedDesc)}},e.isSortedDesc?c.default.createElement(K,{className:"rotate180"}):c.default.createElement(K,null)),Ie&&!e.disableResize&&c.default.createElement("div",u({className:p((n={},n["column-resizer"]=!0,n["column-resizer-is-resizing"]=e.isResizing,n))},e.getResizerProps())))})),!Xn.isEmpty(j)&&j.map((function(e){var t=e.tooltipText;return c.default.createElement("th",{className:"table-header table-header-actions",key:t},Qt)})),(!Xn.isEmpty(a)||se&&Ie)&&c.default.createElement("th",{className:"table-header table-header-actions"},Qt))}))),c.default.createElement("tbody",u({},Oe(),{className:"table-body",emptymessage:O||"No ".concat(g||Be)}),Xe.map((function(e){var t,n=e;Pe(n);var i=p(u({"table-line":!0,clickable:k!==qt||ut,"is-expand":!n.isGrouped&&n.isExpanded,"is-selected":null==C?void 0:C(n.original),"is-highlighted":null==x?void 0:x(n.original)},(null==J?void 0:J.tableLine)&&((t={})[J.tableLine]=!0,t)));return c.default.createElement(c.default.Fragment,{key:n.getRowProps().key},c.default.createElement("tr",u({},n.getRowProps(),{className:i}),ut&&!q&&c.default.createElement("td",{className:p("expand-cell",null==J?void 0:J.expandCell),onClick:function(){A?n.getToggleRowExpandedProps().onClick():k&&k(n.original)}},n.isExpanded?c.default.createElement(X,null):c.default.createElement(X,{className:"rotate270"})),n.cells.map((function(t,i){var o=t.getCellProps(),s=o.key,a=d(o,["key"]),l=function(){if(t.isAggregated)return!0;if(!q)return!1;var n=t.column.groupedIndex;return n>q.indexOf(e.groupByID)&&t.row.depth=1?"var(--focus-s1)":i>.97?"var(--optimus-key)":"var(--accent-key)"}catch(e){return"var(--accent-key)"}}function mh(e){var t=Xn.getTimeDiffString(e).split(" ");return"0d"!==t[0]?{value:t[0],exactValue:t.join(" ")}:"0h"!==t[1]?{value:t[1],exactValue:t.slice(1).join(" ")}:{value:t[2],exactValue:t[2]}}exports.ActionsCell=zd,exports.ApiCallCell=function(t){var n=t.cell,i=n.value,r=n.column,o=n.state,s=n.setState,a=r,l=a.apiCall,u=a.propertyKey,d=a.errorText,f=h(e.useState(null),2),g=f[0],p=f[1],m=h(e.useState(!0),2),v=m[0],b=m[1];return e.useEffect((function(){!function e(t){void 0===t&&(t=0),l(i).then((function(e){s(e[u]),b(!1)})).catch((function(){t<2?setTimeout((function(){return e(t+1)}),3e3*(t+1)):(p(d),b(!1))}))}()}),[]),v?c.default.createElement(gh,null):c.default.createElement(li,null,g||o)},exports.BarCell=function(e){var t=e.cell.value;return c.default.createElement("div",{className:"bar-cell"},c.default.createElement("span",{className:"table-count-cell"},"".concat(t,"%")),c.default.createElement(Hn,{firstUsage:t/100,firstColor:"var(--accent-key)"}))},exports.BlocksCell=function(e){var t=e.cell,n=e.column,r=t.value,o=t.row,s=n,a=s.showTotalCountOnly,l=s.isLink,d=s.getUrl,h=s.openInNewTab,f=r.filter((function(e){var t=e.status;return t===un||t===hn||t===fn||t===dn})),g=c.default.createElement("div",{className:"blocks-cell"},c.default.createElement("span",{className:p({"table-count-cell":!0,"table-count-cell-is-link":l})},(null!=a?a:!r.length)?r.length:"".concat(f.length,"/").concat(r.length)),c.default.createElement("div",{className:"blocks-wrapper"},r.map((function(e){var t,n=e.uid,i=e.id,r=p(((t={block:!0})[e.status]=!0,t));return c.default.createElement("div",{key:null!=n?n:i,className:r})}))));return l&&d?c.default.createElement(i.Link,u({to:d(o.original)},h&&{target:"_blank",rel:"noopener noreferrer"}),g):c.default.createElement(c.default.Fragment,null,g)},exports.Button=Gn,exports.CapacityBar=Hn,exports.CapacityCell=function(e){var t=e.cell,n=t.value,i=t.column.noDataLabel,r=void 0===i?"Unknown":i,o=n.used,s=n.total,a=n.isThin,l=n.maxThin,u=n.minThin,d=n.caution,h=Xn.formatBytes(s,2),f=Xn.formatBytes(o,2),g=s?"".concat(f.value," ").concat(f.text," out of ").concat(h.value," ").concat(h.text," (").concat((o/s*100).toFixed(1),"%)"):r;return c.default.createElement("div",{className:"capacity-cell"},c.default.createElement("div",{className:"capacity-cell-headline"},c.default.createElement(li,{extraClasses:"label-4"},g),a&&c.default.createElement(Vn,{data:"Thinly Provisioned Filesystem\nMax SSD: ".concat(Xn.formatBytesToString(l),"\nMin SSD: ").concat(Xn.formatBytesToString(u))},c.default.createElement("div",{className:"thin-provision"}))),c.default.createElement("div",{className:"capacity-cell-data"},c.default.createElement(Hn,{firstUsage:s?o/s:0,firstColor:ph(o,s,d)})))},exports.Checkbox=jn,exports.CircularProgress=Dn,exports.CloseButton=function(){return c.default.createElement(t.IconButton,{className:"Toastify__close-button"},c.default.createElement(S,null))},exports.Copy=Bo,exports.CustomTooltipCell=function(e){var t=e.value,n=e.tooltipData,i=void 0===n?Qt:n;return c.default.createElement(Vn,{data:i},c.default.createElement("span",null,t))},exports.DataInfo=function(e){var t=e.label,n=e.value;return c.default.createElement("div",{className:"data-info"},c.default.createElement("div",{className:"data-info-label"},t),c.default.createElement("span",{className:"data-info-value body-copy-1"},n))},exports.DateCell=function(e){var t=e.cell,i=e.column,r=t.value,o=(null==i?void 0:i.showMili)?On:Mn,s=i.showMili,a=i.showRelative,l=i.relativeOnly,u=i.enableCustomFormat,d=void 0!==u&&u,h=i.customFormat,f=void 0===h?o:h,g=n.DateTime.fromISO(r),m=d?g.toFormat(f):Xn.formatISODate(r,s),v=Xn.getRelativeTimeFromISODate(r,!0),b=p({"table-date-cell":!0,"table-date-cell-regular":!a});return c.default.createElement(Vn,{data:g.toLocaleString({dateStyle:"full",timeStyle:"long"})},c.default.createElement("div",{className:b},l?v:a?c.default.createElement(c.default.Fragment,null,c.default.createElement("span",null,m),c.default.createElement("span",{className:"relative-time"}," (".concat(v,")"))):m))},exports.DateFilter=nh,exports.DateTimePicker=qd,exports.EmptyPageMessage=function(e){var t=e.children;return c.default.createElement("div",{className:"empty-page-message"},t)},exports.EntityCell=function(e){var t=e.cell.value,n=t===Wn?Et:kt;return c.default.createElement("div",{className:"events-entity-cell"},c.default.createElement(Vn,{data:t},c.default.createElement("span",{className:"events-entity-cell-wrapper"},c.default.createElement(n,null))))},exports.ErrorPage=function(e){var t=e.error,n=void 0===t?"Something went wrong. Please refresh the page and try again.":t;return c.default.createElement("div",{className:"error-page-wrapper data-important"},c.default.createElement("span",null,n))},exports.ExpandCollapseButton=ai,exports.FilterBox=rh,exports.FilterButton=function(e){var t,n=e.onClick,i=e.disable,r=e.extraClass,o=void 0===r?Qt:r,s=e.tooltipText,a=void 0===s?Qt:s,l=p(((t={})[o]=!0,t["filter-btn"]=!0,t));return c.default.createElement("div",null,c.default.createElement(Vn,{data:a},c.default.createElement("div",null,c.default.createElement(Gn,{onClick:n,disable:i,extraClass:l},c.default.createElement("div",{className:"filter-icon-wrapper"},c.default.createElement(De,{className:"filter-icon"}))))))},exports.FilterHeader=function(n){var i=n.title,r=n.setFilter,o=n.Filter,s=n.dataForFilter,a=n.filterKey,l=void 0===a?Qt:a,d=h(Po(!1),2),f=d[0],g=d[1],m=e.useRef(null),v=p({"filter-table-header":!0,"no-title":!i});return c.default.createElement("div",{className:v},c.default.createElement("span",null,i),c.default.createElement(Vn,{data:"Filter by"},c.default.createElement("span",{onClick:g,ref:m},c.default.createElement(De,null))),f&&c.default.createElement(t.Popper,{open:f,anchorEl:m.current,transition:!0,className:"popper-wrapper",nonce:void 0,onResize:void 0,onResizeCapture:void 0},(function(e){var n=e.TransitionProps;return c.default.createElement(t.Grow,u({},n,{style:{transformOrigin:"center top"}}),c.default.createElement(t.Paper,null,c.default.createElement(t.ClickAwayListener,{onClickAway:g},c.default.createElement("div",null,c.default.createElement(o,u({setFilter:function(e){var t;r(l?((t={})[l]=e,t):e),g()}},s))))))})))},exports.FormSwitch=function(e){var t=e.onChange,n=e.oneColor,i=e.value,r=e.label,o=e.placeholder;e.isRequired;var s=e.info,a=void 0===s?Qt:s,l=d(e,["onChange","oneColor","value","label","placeholder","isRequired","info"]);return c.default.createElement("div",{className:"form-switch"},c.default.createElement("div",null,c.default.createElement("span",{className:"form-switch-label"},r),a&&c.default.createElement(Vn,{data:a},c.default.createElement(I,{className:"form-switch-info"}))),c.default.createElement(Zn,u({onChange:t,oneColor:n,checked:i||o||!1},l)))},exports.IconButtonCell=Zd,exports.IconCell=function(e){var t=e.cell,n=t.value,i=t.column,r=t.row,o=i,s=o.Icon,a=o.extraClass,l=void 0===a?Qt:a,u=o.tooltipText,d=void 0===u?Qt:u,h=l instanceof Function?l(r.original):l,f=d instanceof Function?d(r.original):d;return c.default.createElement(Vn,{data:f},c.default.createElement("div",{className:p("icon-cell",h)},n&&c.default.createElement(s,null)))},exports.Info=zn,exports.IpRangeTextBox=function(t){var n,i=t.label,r=t.onChange,o=t.value,s=t.error,a=t.wrapperClass,l=void 0===a?"":a,g=t.subnet,m=t.disabled,v=t.isRequired,b=t.info,y=d(t,["label","onChange","value","error","wrapperClass","subnet","disabled","isRequired","info"]),w=e.useRef(null),C=function(e){var t,n,i=[];if(e)for(var r=null===(t=e.ip)||void 0===t?void 0:t.split("."),o=null===(n=e.mask)||void 0===n?void 0:n.split("."),s=0;s<4;s++)"255"===o[s]&&i.push(r[s]);return i}(g),x=h(o?o.split("-"):[f(f([],h(C),!1),["","","",""],!1).slice(0,4).join("."),""],2),S=x[0],E=x[1],A=h(e.useState(f(f([],h(S.split(".")),!1),[E],!1)),2),R=A[0],k=A[1],$=p(((n={})[l]=!0,n["ip-range-text-box-field"]=!0,n["ip-range-text-box-disabled"]=m,n["has-error"]=!!s,n));return e.useEffect((function(){g&&(R.slice(0,4).some(Xn.isEmpty)?r(Qt):r("".concat(R.slice(0,4).join(".")).concat(R[4]!==Qt?"-".concat(R[4]):Qt)))}),[]),e.useLayoutEffect((function(){if(w.current){var e=Array.from(w.current.getElementsByTagName("input"));(e.find((function(e){return e.value===Qt}))||e[0]).focus()}}),[]),c.default.createElement("div",{className:$},c.default.createElement("div",{className:"value-container",ref:w},Xn.range(5).map((function(e){return c.default.createElement("div",{className:"ip-part-value-edit",key:"input_".concat(e)},c.default.createElement("input",u({value:R[e],disabled:C.length>=e+1,onKeyDown:Un,type:"number",onChange:function(t){return function(e,t){var n=f([],h(R),!1);n[e]=t.target.value&&Math.max(0,Math.min(255,parseInt(t.target.value,10))),n[e]>=100&&Xn.goToNextInput(),k(n),n.slice(0,4).some(Xn.isEmpty)?r(Qt):r("".concat(n.slice(0,4).join(".")).concat(n[4]!==Qt?"-".concat(n[4]):Qt))}(e,t)}},y)),[".",".",".","-",Qt][e])}))),c.default.createElement("span",{className:"field__label-wrap"},c.default.createElement("span",{className:"field__label field-1-label-content"},i,v&&c.default.createElement("span",{className:"required-star"},"*"),!!b&&c.default.createElement(Vn,{data:b},c.default.createElement(I,null)))),c.default.createElement("span",{className:"ip-range-text-box-error capitalize-first-letter"},s))},exports.IpSubnetTextBox=function(t){var n,i=t.label,r=t.onChange,o=void 0===r?qt:r,s=t.value,a=t.error,l=t.wrapperClass,g=void 0===l?"":l,m=t.isRequired,v=t.info,b=d(t,["label","onChange","value","error","wrapperClass","isRequired","info"]),y=b.disabled,w=h(s?s.split("/"):["...",""],2),C=w[0],x=w[1],S=h(e.useState(f(f([],h(C.split(".")),!1),[Xn.subnet2MaskOp(x)],!1)),2),E=S[0],A=S[1],R=p(((n={})[g]=!0,n["ip-subnet-text-box-field"]=!0,n.disabled=y,n["has-error"]=!!a,n)),k=e.useRef(null);return e.useEffect((function(){var e,t=document.activeElement;t.parentNode&&t.parentNode.parentNode===k.current&&(null===(e=k.current)||void 0===e||e.firstElementChild.firstElementChild.focus())}),[k.current]),c.default.createElement("div",{className:R},c.default.createElement("div",{ref:k,className:"value-container"},Xn.range(5).map((function(e){return c.default.createElement("div",{className:"ip-part-value-edit",key:"input_".concat(e)},c.default.createElement("input",u({value:E[e],onKeyDown:Yn,type:"number",onChange:function(t){return function(e,t){var n=f([],h(E),!1);4===e?n[e]=t.target.value&&Math.max(0,Math.min(32,parseInt(t.target.value,10))):(n[e]=t.target.value&&Math.max(0,Math.min(255,parseInt(t.target.value,10))),n[e]>=100&&Xn.goToNextInput()),A(n),n.some(Xn.isEmpty)?o(Qt):o("".concat(n.slice(0,4).join("."),"/").concat(Xn.mask2SubnetOp(n.slice(4))))}(e,t)}},b)),[".",".",".","/"][e])}))),c.default.createElement("span",{className:"field__label-wrap"},c.default.createElement("span",{className:"field__label field-1-label-content"},i,m&&c.default.createElement("span",{className:"required-star"},"*"),!!v&&c.default.createElement(Vn,{data:v},c.default.createElement(I,null)))),c.default.createElement("span",{className:"ip-subnet-error capitalize-first-letter"},a))},exports.IpTextBox=function(t){var n,i=t.label,r=t.onChange,o=void 0===r?qt:r,s=t.value,a=t.error,l=t.wrapperClass,g=void 0===l?"":l,m=t.isRequired,v=t.info,b=d(t,["label","onChange","value","error","wrapperClass","isRequired","info"]),y=b.disabled,w=h(e.useState(s?s.split("."):["","","",""]),2),C=w[0],x=w[1],S=p(((n={})[g]=!0,n["ip-text-box-field"]=!0,n["ip-text-box-disabled"]=y,n["has-error"]=!!a,n));return c.default.createElement("div",{className:S},c.default.createElement("div",{className:"value-container"},Xn.range(4).map((function(e){return c.default.createElement("div",{className:"ip-part-value-edit",key:"input_".concat(e)},c.default.createElement("input",u({value:C[e],onKeyDown:Jn,type:"number",onChange:function(t){return function(e,t){var n=f([],h(C),!1);n[e]=t.target.value&&Math.max(0,Math.min(255,parseInt(t.target.value,10))),n[e]>=100&&Xn.goToNextInput(),x(n),n.some(Xn.isEmpty)?o(Qt):o(n.join("."))}(e,t)}},b)),3!==e?".":Qt)}))),c.default.createElement("span",{className:"field__label-wrap"},c.default.createElement("span",{className:"field__label field-1-label-content"},i,m&&c.default.createElement("span",{className:"required-star"},"*"),!!v&&c.default.createElement(Vn,{data:v},c.default.createElement(I,null)))),c.default.createElement("span",{className:"ip-text-box-error capitalize-first-letter"},a))},exports.JsonBox=function(e){var t,n=e.label,i=e.error,r=e.wrapperClass,o=void 0===r?"":r,s=e.info,a=e.isRequired,l=e.disabled,h=d(e,["label","error","wrapperClass","info","isRequired","disabled"]),f=p(((t={"json-box":!0,"has-error":!!i})[o]=!0,t));return c.default.createElement("div",{className:f},c.default.createElement("span",{className:"json-box__label field-1-label-content"},n,a&&c.default.createElement("span",{className:"required-star"},"*"),!!s&&c.default.createElement(Vn,{data:s},c.default.createElement(I,null))),c.default.createElement(ss,u({readOnly:l},h,{tabSize:2})),c.default.createElement("span",{className:"json-box-error capitalize-first-letter"},i))},exports.Loader=Wo,exports.LoginField=function(e){var t,n=e.label,i=e.onChange,r=e.value,o=void 0===r?Qt:r,s=e.error,a=e.placeholder,l=e.type,f=e.wrapperClass,g=void 0===f?Qt:f,m=e.tooltip,v=e.isRequired,b=d(e,["label","onChange","value","error","placeholder","type","wrapperClass","tooltip","isRequired"]),y=h(Po(!1),2),w=y[0],C=y[1],x=p(((t={})[g]=!0,t["login-text-field"]=!0,t["has-error"]=!!s,t)),S=p({"login-field-input":!0,"is-type-password-login":"password"===l});return c.default.createElement("div",{className:x},c.default.createElement("span",{className:"login-field-label"},c.default.createElement("span",{className:"body-copy-1"},n),v&&c.default.createElement("span",{className:"required-star"},"*"),m?c.default.createElement(zn,{data:m}):null),c.default.createElement("input",u({autoComplete:"new-password",className:S,placeholder:a,type:w&&"password"===l?"text":l,value:o,onChange:function(e){i(Number.isNaN(e.target.valueAsNumber)?e.target.value:e.target.valueAsNumber)}},b)),"password"===l&&c.default.createElement("span",{className:"login-password-icon"},Xn.getPasswordIcon(w,C)),c.default.createElement("span",{className:"text-login-error capitalize-first-letter"},s))},exports.MenuPopper=Nd,exports.MultiSelectFilter=ah,exports.MultilineCell=function(e){var t=e.cell.value;return c.default.createElement("div",{className:"multiline-cell"},null==t?void 0:t.map((function(e,t){return c.default.createElement("div",{key:t},e?c.default.createElement(li,{extraClasses:"tooltip"},e):c.default.createElement("br",null))})))},exports.NewPasswordTooltip=function(e){var t=e.passValue,n=Fd(void 0===t?Qt:t);return c.default.createElement("div",{className:"password-min-demand"},c.default.createElement("span",{className:"demand-headline"},"Password must contain:"),c.default.createElement("span",{className:n.length>=8?"valid":Qt},"● At least 8 characters"),c.default.createElement("span",{className:n.contains.includes("uppercase")?"valid":Qt},"● Uppercase letter"),c.default.createElement("span",{className:n.contains.includes("lowercase")?"valid":Qt},"● Lowercase letter"),c.default.createElement("span",{className:n.contains.includes("number")||n.contains.includes("symbol")?"valid":Qt},"● Number or special character"))},exports.NodeCell=function(e){var t=e.cell.value,n=t.nid,i=t.isBackend,r=t.roles,o=p({"is-backend":i,"is-client":!i}),s=(null==r?void 0:r.length)?"(".concat(null==r?void 0:r.reduce((function(e,t){return Fn[t]?e.push(Fn[t]):e.push(t),e}),[]).join(", "),") "):Qt;return c.default.createElement(Vn,{data:"".concat(n," ").concat(s," (").concat(i?"Backend":"Client",")")},c.default.createElement("div",{className:"node-cell"},c.default.createElement("span",null,n," "),i&&c.default.createElement("span",null,s),c.default.createElement("span",{className:o},i?"(B)":" (C)")))},exports.NumInput=Jd,exports.Pagination=function(n){var i=n.onPageChange,r=n.totalRows,o=n.rowsPerPage,s=n.defaultCurrentPage,a=n.isLoading,l=h(e.useState(s),2),u=l[0],d=l[1],f=h(e.useState(!1),2),g=f[0],p=f[1],m=h(e.useState(!0),2),v=m[0],b=m[1],y=Math.ceil(r/o);return e.useEffect((function(){d(s)}),[s]),e.useEffect((function(){i(u)}),[u]),e.useEffect((function(){b(!(y===u||!y)),p(1!==u)}),[y,u]),a?null:c.default.createElement("div",{className:"pagination-footer"},c.default.createElement("div",{className:"pagination-wrapper"},c.default.createElement("div",{className:"pagination"},c.default.createElement(Vn,{data:g?"First Page":Qt},c.default.createElement("div",null,c.default.createElement(t.IconButton,{onClick:function(){return d(1)},className:"pagination-arrow",disabled:!g},c.default.createElement(V,{className:"rotate180"})))),c.default.createElement(Vn,{data:g?"Previous Page":Qt},c.default.createElement("div",null,c.default.createElement(t.IconButton,{onClick:function(){return d((function(e){return e-1}))},className:"pagination-arrow",disabled:!g},c.default.createElement(X,{className:"rotate90"})))),c.default.createElement("div",null,c.default.createElement("span",{className:"note"},"".concat(u," / ").concat(y||1," "))),c.default.createElement(Vn,{data:v?"Next Page":Qt},c.default.createElement("div",null,c.default.createElement(t.IconButton,{onClick:function(){return d((function(e){return e+1}))},disabled:!v,className:"pagination-arrow"},c.default.createElement(X,{className:"rotate270"})))),c.default.createElement(Vn,{data:v?"Last Page":Qt},c.default.createElement("div",null,c.default.createElement(t.IconButton,{onClick:function(){return d(y)},disabled:!v,className:"pagination-arrow"},c.default.createElement(V,null)))))))},exports.PerPage=function(e){var t=e.value,n=e.onChange,i=e.options,r=void 0===i?Pn:i;return c.default.createElement("div",{className:"per-page"},c.default.createElement(kd,{value:t,options:r,wrapperClass:"per-page-select",onChange:n}),c.default.createElement("span",null,"per page"))},exports.ProgressCell=function(e){var t=e.cell.value,n=t.status,i=t.progress,r="N/A"!==i?"".concat(n," - ").concat(i):n;return c.default.createElement("div",null,r)},exports.RadioSwitch=function(e){var n=e.label,i=e.checked,r=e.onChange,o=e.value,s=e.disabled,a=e.info,l=p({disabled:s,"radio-switch":!0});return c.default.createElement("div",{className:l},c.default.createElement(t.Radio,{classes:{root:"radio-btn"},checked:i,disabled:s,onChange:function(e){r(e.target.value)},value:o}),c.default.createElement("span",{className:"radio-label"},n,!!a&&c.default.createElement(Vn,{data:a},c.default.createElement(I,null))))},exports.Select=kd,exports.SelectFilter=sh,exports.SeverityCell=function(e){var t,n=e.cell.value,i=Bn[n],r=p(((t={"event-severity":!0})[n.toLowerCase()]=!0,t));return c.default.createElement(Vn,{data:n,placement:"right"},c.default.createElement("div",{className:r},i?c.default.createElement(i,null):n))},exports.SeverityFilter=lh,exports.SpanTooltip=li,exports.StatusCell=function(e){var t=e.cell,n=t.value,i=t.column,r=t.row,o=i,s=o.getTooltip,a=o.showString,l=null==n?void 0:n.replaceAll("_"," "),u=s?s(r.original):l;return c.default.createElement(Vn,{data:u},c.default.createElement("div",{className:"status-cell-wrapper"},function(e){switch(e){case gn:case pn:case vn:case yn:case wn:return c.default.createElement(de,{className:"up"});case Cn:return c.default.createElement(xe,{className:"updating"});case xn:case En:return c.default.createElement(be,{className:"working"});case mn:return c.default.createElement(Re,{className:"degraded-status"});case Sn:case bn:case dn:case fn:return c.default.createElement(be,{className:"working"});default:return c.default.createElement(_e,{className:"down"})}}(n),a&&c.default.createElement("span",{className:"status-string"},l)))},exports.Summary=function(e){var t=e.title,n=e.children,i=e.expanded,r=e.onExpand,o=h(Po(!0),2),s=o[0],a=o[1],l=null!=i?i:s;return c.default.createElement("div",{className:"summary"},c.default.createElement("button",{className:p({title:!0,"title-expanded":l}),onClick:function(){a(),null==r||r(!l)}},c.default.createElement(X,{className:p({arrow:!0,"arrow-expanded":l})}),c.default.createElement(li,null,t)),l&&c.default.createElement("div",{className:"content"},n))},exports.Switch=Zn,exports.SwitchCell=function(e){var t=e.cell,n=e.column,i=e.row,r=t.value,o=n,s=o.onChange,a=o.tooltipText,l=void 0===a?Qt:a,u=l instanceof Function?l(r):l;return c.default.createElement(Vn,{data:u},c.default.createElement("div",{className:"switch-cell"},c.default.createElement(Zn,{onClick:function(e){return e.stopPropagation()},checked:r,onChange:function(){return s(i)}})))},exports.Tab=function(e){var t,n=e.title,r=e.subComponent,o=void 0===r?null:r,s=e.active,a=e.setActive,l=e.wrapperClass,u=void 0===l?Qt:l,d=e.disabled,h=void 0!==d&&d,f=e.isSideTab,g=void 0!==f&&f,m=e.isSubTab,v=void 0!==m&&m,b=e.navigateTo,y=p(((t={"custom-tab":!0,"custom-tab-side":g,"custom-tab-sub":v,"tab-active":s})[u]=!0,t.disabled=h,t)),w=c.default.createElement("div",{className:y,onClick:a},c.default.createElement("div",{className:"tab-title"},n),o);return b?c.default.createElement(i.Link,{to:b,className:"link-tab"},w):c.default.createElement(c.default.Fragment,null,w)},exports.Table=fh,exports.TagsBox=Md,exports.TextArea=function(e){var t,n=e.label,i=e.onChange,r=e.value,o=e.error,s=e.placeholder,a=e.wrapperClass,l=void 0===a?"":a,h=e.isRequired,f=e.info,g=e.tooltip,m=void 0===g?Qt:g,v=e.disabled,b=void 0!==v&&v,y=d(e,["label","onChange","value","error","placeholder","wrapperClass","isRequired","info","tooltip","disabled"]);var w=p(((t={})[l]=!0,t["text-area-field"]=!0,t["has-error"]=!!o,t));return c.default.createElement("div",{className:w},c.default.createElement(Vn,{data:m},c.default.createElement("textarea",u({className:"field__input",placeholder:s,value:null===r?Qt:r,onChange:function(e){i(e.target.value)},disabled:b},y))),c.default.createElement("span",{className:"field__label-wrap"},c.default.createElement("span",{className:"field__label field-1-label-content"},n,h&&c.default.createElement("span",{className:"required-star"},"*"),!!f&&c.default.createElement(Vn,{data:f},c.default.createElement(I,null)))),c.default.createElement("span",{className:"text-area-error capitalize-first-letter"},o))},exports.TextBox=Od,exports.TextEditor=ss,exports.TextField=function(e){var t,n=e.label,i=e.onChange,r=e.value,o=e.error,s=e.wrapperClass,a=e.secondLabel,l=d(e,["label","onChange","value","error","wrapperClass","secondLabel"]),h=p(((t={})[s]=!0,t["text-field"]=!0,t["has-error"]=!!o,t));return c.default.createElement("div",{className:h},c.default.createElement("span",{className:"text-field-first-label label-5"},n),c.default.createElement("div",{className:"field-input-wrapper"},c.default.createElement("input",u({className:"field__input",value:r||Qt,onChange:function(e){i(Number.isNaN(e.target.valueAsNumber)?e.target.value:e.target.valueAsNumber)}},l)),c.default.createElement("span",{className:"text-field-error capitalize-first-letter"},o)),c.default.createElement("span",{className:"text-field-second-label label-5"},a))},exports.TextFilter=ch,exports.TextSelectBox=function(t){var n,i=t.label,r=t.onChange,o=t.value,s=t.wrapperClass,a=void 0===s?"":s,l=t.options,f=t.formatFunc,g=t.info,m=t.selectPlaceholder,v=t.error,b=t.isRequired,y=d(t,["label","onChange","value","wrapperClass","options","formatFunc","info","selectPlaceholder","error","isRequired"]),w=f(o),C=w.number,x=w.unit,S=h(e.useState(C),2),E=S[0],A=S[1],R=h(e.useState(x.value||m),2),I=R[0],k=R[1],$=p(((n={})[a]=!0,n["has-error"]=!!v,n["text-select-wrapper"]=!0,n));return c.default.createElement("div",{className:$},c.default.createElement("span",{className:"text-select-label field-1-label-content"},i,b&&c.default.createElement("span",{className:"required-star"},"*"),g&&c.default.createElement(zn,{data:g})),c.default.createElement(Od,u({value:E,type:"number",onChange:function(e){Xn.isEmpty(e)?r(void 0):Xn.isEmpty(I)||r(Math.floor(I*e)),A(e)}},y)),c.default.createElement("div",{className:"spread-line"}),c.default.createElement(kd,{value:I,options:l,onChange:function(e){Xn.isEmpty(e)||Xn.isEmpty(E)?r(void 0):r(Math.floor(E*e)),k(e)}}),c.default.createElement("span",{className:"text-select-error capitalize-first-letter"},v))},exports.TieringCell=function(e){var t=e.cell.value;return c.default.createElement("div",{className:"tiering-cell"},t.map((function(e){return function(e){var t=e.mode,n=e.name,i=e.state,r=e.detachProgress,o=void 0===r?0:r;if("DETACHING"===i)return c.default.createElement(Vn,{data:"Object Store Bucket is being detached",key:n},c.default.createElement("div",null,c.default.createElement(Dn,{progress:"number"==typeof o?o:void 0})));var s=t===An?Pe:Oe;return c.default.createElement(s,{key:n,className:t.toLowerCase()})}(e)})))},exports.TimeCell=function(e){var t=e.cell.value,i=n.Duration.fromMillis(1e3*t).shiftTo("months","weeks","days","hours","minutes","seconds").toObject(),r=Qt,o=Qt,s={};return Object.entries(i).forEach((function(e){var t=h(e,2),n=t[0],i=t[1];i&&(s[n]=i,r+="".concat(i).concat(Rn[n]," "))})),Object.entries(s).forEach((function(e,t){var n=h(e,2),i=n[0],r=n[1];t<2&&(o+="".concat(r).concat(Rn[i]," "))})),c.default.createElement(Vn,{data:r},c.default.createElement("div",null,t?o:Qt))},exports.Toast=Pd,exports.ToggleButton=function(t){var n=t.options,i=t.value,r=t.onChange,o=e.useRef(null);return e.useEffect((function(){o.current&&Array.from(o.current.children).forEach((function(e){e.getAttribute("data-value")===i&&function(e){if(e){var t=e&&e.parentNode&&e.parentNode.parentNode&&e.parentNode.parentNode.firstChild;t&&(t.style.width="".concat(e.offsetWidth,"px"),t.style.height="".concat(e.offsetHeight+5,"px"),t.style.transform="translateX(".concat(e.offsetLeft,"px)"),t.style.display="block",Array.from(e.parentNode.children).forEach((function(e){return e.classList.remove("toggle-button-option-selected")})),e.classList.add("toggle-button-option-selected"))}}(e)}))}),[i]),c.default.createElement("div",{className:"toggle-button"},c.default.createElement("div",{className:"toggle-button-pad"}),c.default.createElement("div",{className:"toggle-button-options",ref:o},n.map((function(e){return c.default.createElement("span",{className:"toggle-button-option",key:e.value,"data-value":e.value,onClick:function(){r(e.value)}},e.label)}))))},exports.Tooltip=Vn,exports.UploadField=function(n){var i,r=n.label,o=n.onChange,s=void 0===o?qt:o,a=n.disabled,l=n.wrapperClass,f=void 0===l?"":l,g=n.placeholder,m=n.error,v=n.onReadError,b=n.tooltipText,y=void 0===b?Qt:b,w=n.shouldBeBinary,C=void 0!==w&&w,x=d(n,["label","onChange","disabled","wrapperClass","placeholder","error","onReadError","tooltipText","shouldBeBinary"]),S=e.useId(),E=h(e.useState(Qt),2),A=E[0],R=E[1],I=p(((i={"upload-wrapper":!0})[f]=!0,i["upload-wrapper-disabled"]=a,i));return c.default.createElement(Vn,{data:y},c.default.createElement("div",{className:I},c.default.createElement("input",u({id:S,disabled:a,placeholder:g,type:"file",onClick:function(e){e.stopPropagation(),e.target.value=Qt},onChange:function(e){return function(e){if(C)s(e);else try{var t=new FileReader;t.onload=function(t){R(e.name),s(t.target.result)},t.readAsText(e)}catch(e){v()}}(e.target.files[0])}},x)),c.default.createElement("label",{htmlFor:S,className:"button small",onClick:function(e){return e.stopPropagation()}},r),c.default.createElement("span",{className:"upload-field-error capitalize-first-letter"},m),A&&c.default.createElement("div",{className:"file-name-wrapper"},c.default.createElement(li,{extraClasses:"file-name"},A),c.default.createElement(t.IconButton,{onClick:function(){R(Qt),s(Qt)}},c.default.createElement(W,null)))))},exports.UptimeCell=function(t){var n=t.cell.value,i=h(e.useState(mh(n).value),2),r=i[0],o=i[1],s=h(e.useState(mh(n).exactValue),2),a=s[0],l=s[1];return e.useEffect((function(){var e=setInterval((function(){o(mh(n).value),l(mh(n).exactValue)}),1e4);return function(){clearInterval(e)}}),[n]),c.default.createElement(Vn,{data:a},c.default.createElement("div",null,r))},exports.Utils=Xn,exports.useUrlFilters=oh; + */"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function y(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:var p=e.type;switch(p){case l:case c:case i:case o:case r:case d:return p;default:var m=p&&p.$$typeof;switch(m){case a:case u:case g:case f:case s:return m;default:return h}}case n:return h}}}var w=l,C=c,x=a,S=s,E=t,A=u,R=i,I=g,k=f,$=n,_=o,L=r,T=d,M=!1;function O(e){return y(e)===c}sl.AsyncMode=w,sl.ConcurrentMode=C,sl.ContextConsumer=x,sl.ContextProvider=S,sl.Element=E,sl.ForwardRef=A,sl.Fragment=R,sl.Lazy=I,sl.Memo=k,sl.Portal=$,sl.Profiler=_,sl.StrictMode=L,sl.Suspense=T,sl.isAsyncMode=function(e){return M||(M=!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.")),O(e)||y(e)===l},sl.isConcurrentMode=O,sl.isContextConsumer=function(e){return y(e)===a},sl.isContextProvider=function(e){return y(e)===s},sl.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},sl.isForwardRef=function(e){return y(e)===u},sl.isFragment=function(e){return y(e)===i},sl.isLazy=function(e){return y(e)===g},sl.isMemo=function(e){return y(e)===f},sl.isPortal=function(e){return y(e)===n},sl.isProfiler=function(e){return y(e)===o},sl.isStrictMode=function(e){return y(e)===r},sl.isSuspense=function(e){return y(e)===d},sl.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===c||e===o||e===r||e===d||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===f||e.$$typeof===s||e.$$typeof===a||e.$$typeof===u||e.$$typeof===m||e.$$typeof===v||e.$$typeof===b||e.$$typeof===p)},sl.typeOf=y}(),"production"===process.env.NODE_ENV?Fa.exports=Pa:Fa.exports=sl;var al=Fa.exports,ll={};ll[al.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ll[al.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};var cl="undefined"!=typeof document;function ul(e,t,n){var i="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):i+=n+" "})),i}var dl=function(e,t,n){var i=e.key+"-"+t.name;(!1===n||!1===cl&&void 0!==e.compat)&&void 0===e.registered[i]&&(e.registered[i]=t.styles)},hl=function(e,t,n){dl(e,t,n);var i=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r="",o=t;do{var s=e.insert(t===o?"."+i:"",o,e.sheet,!0);cl||void 0===s||(r+=s),o=o.next}while(void 0!==o);if(!cl&&0!==r.length)return r}};var fl={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},gl="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",pl="You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).",ml=/[A-Z]|^ms/g,vl=/_EMO_([^_]+?)_([^]*?)_EMO_/g,bl=function(e){return 45===e.charCodeAt(1)},yl=function(e){return null!=e&&"boolean"!=typeof e},wl=wa((function(e){return bl(e)?e:e.replace(ml,"-$&").toLowerCase()})),Cl=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(vl,(function(e,t,n){return Ll={name:t,styles:n,next:Ll},t}))}return 1===fl[e]||bl(e)||"number"!=typeof t||0===t?t:t+"px"};if("production"!==process.env.NODE_ENV){var xl=/(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/,Sl=["normal","none","initial","inherit","unset"],El=Cl,Al=/^-ms-/,Rl=/-(.)/g,Il={};Cl=function(e,t){if("content"===e&&("string"!=typeof t||-1===Sl.indexOf(t)&&!xl.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0))))throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\""+t+"\"'`");var n=El(e,t);return""===n||bl(e)||-1===e.indexOf("-")||void 0!==Il[e]||(Il[e]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean "+e.replace(Al,"ms-").replace(Rl,(function(e,t){return t.toUpperCase()}))+"?")),n}}var kl="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function $l(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles){if("production"!==process.env.NODE_ENV&&"NO_COMPONENT_SELECTOR"===n.toString())throw new Error(kl);return n}switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return Ll={name:n.name,styles:n.styles,next:Ll},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)Ll={name:i.name,styles:i.styles,next:Ll},i=i.next;var r=n.styles+";";return"production"!==process.env.NODE_ENV&&void 0!==n.map&&(r+=n.map),r}return function(e,t,n){var i="";if(Array.isArray(n))for(var r=0;r css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break;case"string":if("production"!==process.env.NODE_ENV){var a=[],l=n.replace(vl,(function(e,t,n){var i="animation"+a.length;return a.push("const "+i+" = keyframes`"+n.replace(/^@keyframes animation-\w+/,"")+"`"),"${"+i+"}"}));a.length&&console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n"+[].concat(a,["`"+l+"`"]).join("\n")+"\n\nYou should wrap it with `css` like this:\n\ncss`"+l+"`")}}if(null==t)return n;var c=t[n];return void 0!==c?c:n}var _l,Ll,Tl=/label:\s*([^\s;\n{]+)\s*(;|$)/g;"production"!==process.env.NODE_ENV&&(_l=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g);var Ml=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var i=!0,r="";Ll=void 0;var o,s=e[0];null==s||void 0===s.raw?(i=!1,r+=$l(n,t,s)):("production"!==process.env.NODE_ENV&&void 0===s[0]&&console.error(gl),r+=s[0]);for(var a=1;a=4;++i,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(i+2))<<16;case 2:n^=(255&e.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(i)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+c;return"production"!==process.env.NODE_ENV?{name:u,styles:r,map:o,next:Ll,toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}}:{name:u,styles:r,next:Ll}},Ol="undefined"!=typeof document,Nl=function(e){return e()},Bl=!!l.useInsertionEffect&&l.useInsertionEffect,Fl=Ol&&Bl||Nl,Pl=Bl||e.useLayoutEffect,Wl="undefined"!=typeof document,Gl={}.hasOwnProperty,Hl=e.createContext("undefined"!=typeof HTMLElement?Ba({key:"css"}):null);"production"!==process.env.NODE_ENV&&(Hl.displayName="EmotionCacheContext"),Hl.Provider;var Dl=function(t){return e.forwardRef((function(n,i){var r=e.useContext(Hl);return t(n,r,i)}))};Wl||(Dl=function(t){return function(n){var i=e.useContext(Hl);return null===i?(i=Ba({key:"css"}),e.createElement(Hl.Provider,{value:i},t(n,i))):t(n,i)}});var Vl=e.createContext({});"production"!==process.env.NODE_ENV&&(Vl.displayName="EmotionThemeContext");var zl=function(e){var t=e.split(".");return t[t.length-1]},jl=function(e){var t=/^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(e);return t||(t=/^([A-Za-z0-9$.]+)@/.exec(e))?zl(t[1]):void 0},Zl=new Set(["renderWithHooks","processChild","finishClassComponent","renderToString"]),Xl=function(e){return e.replace(/\$/g,"-")},Ul="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Yl="__EMOTION_LABEL_PLEASE_DO_NOT_USE__",Jl=function(e,t){if("production"!==process.env.NODE_ENV&&"string"==typeof t.css&&-1!==t.css.indexOf(":"))throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`"+t.css+"`");var n={};for(var i in t)Gl.call(t,i)&&(n[i]=t[i]);if(n[Ul]=e,"production"!==process.env.NODE_ENV&&t.css&&("object"!=typeof t.css||"string"!=typeof t.css.name||-1===t.css.name.indexOf("-"))){var r=function(e){if(e)for(var t=e.split("\n"),n=0;n component."),s="",o)o[a]&&a&&(s&&(s+=" "),s+=a);break;default:s=o}s&&(r&&(r+=" "),r+=s)}}return r};function rc(e,t,n){var i=[],r=ul(e,i,n);return i.length<2?n:r+t(i)}var oc=function(t){var n,i=t.cache,r=t.serializedArr,o=Fl((function(){for(var e="",t=0;te.brand+"/"+e.version)).join(" "),gc):navigator.userAgent}())}const Cc=Math.round;function xc(e){return mc(e)?e:e.contextElement}const Sc={x:1,y:1};function Ec(e){const t=xc(e);if(!pc(t))return Sc;const n=t.getBoundingClientRect(),{width:i,height:r,fallback:o}=function(e){const t=hc(e);let n=parseFloat(t.width),i=parseFloat(t.height);const r=e.offsetWidth,o=e.offsetHeight,s=Cc(n)!==r||Cc(i)!==o;return s&&(n=r,i=o),{width:n,height:i,fallback:s}}(t);let s=(o?Cc(n.width):n.width)/i,a=(o?Cc(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}function Ac(e,t,n,i){var r,o;void 0===t&&(t=!1),void 0===n&&(n=!1);const s=e.getBoundingClientRect(),a=xc(e);let l=Sc;t&&(i?mc(i)&&(l=Ec(i)):l=Ec(e));const c=a?dc(a):window,u=!wc()&&n;let d=(s.left+(u&&(null==(r=c.visualViewport)?void 0:r.offsetLeft)||0))/l.x,h=(s.top+(u&&(null==(o=c.visualViewport)?void 0:o.offsetTop)||0))/l.y,f=s.width/l.x,g=s.height/l.y;if(a){const e=dc(a),t=i&&mc(i)?dc(i):i;let n=e.frameElement;for(;n&&i&&t!==e;){const e=Ec(n),t=n.getBoundingClientRect(),i=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(i.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(i.paddingTop))*e.y,d*=e.x,h*=e.y,f*=e.x,g*=e.y,d+=t.x,h+=t.y,n=dc(n).frameElement}}return{width:f,height:g,top:h,right:d+f,bottom:h+g,left:d,x:d,y:h}}function Rc(e){if("html"===fc(e))return e;const t=e.assignedSlot||e.parentNode||(bc(e)?e.host:null)||function(e){return((vc(e)?e.ownerDocument:e.document)||window.document).documentElement}(e);return bc(t)?t.host:t}function Ic(e){const t=Rc(e);return function(e){return["html","body","#document"].includes(fc(e))}(t)?e.ownerDocument.body:pc(t)&&yc(t)?t:Ic(t)}function kc(e,t){var n;void 0===t&&(t=[]);const i=Ic(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),o=dc(i);return r?t.concat(o,o.visualViewport||[],yc(i)?i:[]):t.concat(i,kc(i))}var $c="undefined"!=typeof document?e.useLayoutEffect:e.useEffect,_c=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Lc=function(){};function Tc(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Mc(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r-1}function Pc(e){return Fc(e)?window.pageYOffset:e.scrollTop}function Wc(e,t){Fc(e)?window.scrollTo(0,t):e.scrollTop=t}function Gc(e,t,n,i){return n*((e=e/i-1)*e*e+1)+t}function Hc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Lc,r=Pc(e),o=t-r,s=10,a=0;function l(){var t=Gc(a+=s,r,o,n);Wc(e,t),an.bottom?Wc(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):i.top-r=g)return{placement:"bottom",maxHeight:t};if(E>=g&&!s)return o&&Hc(l,A,I),{placement:"bottom",maxHeight:t};if(!s&&E>=i||s&&x>=i)return o&&Hc(l,A,I),{placement:"bottom",maxHeight:s?x-y:E-y};if("auto"===r||s){var k=t,$=s?C:S;return $>=i&&(k=Math.min($-y-a,t)),{placement:"top",maxHeight:k}}if("bottom"===r)return o&&Wc(l,A),{placement:"bottom",maxHeight:t};break;case"top":if(C>=g)return{placement:"top",maxHeight:t};if(S>=g&&!s)return o&&Hc(l,R,I),{placement:"top",maxHeight:t};if(!s&&S>=i||s&&C>=i){var _=t;return(!s&&S>=i||s&&C>=i)&&(_=s?C-w:S-w),o&&Hc(l,R,I),{placement:"top",maxHeight:_}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}var Kc=function(e){return"auto"===e?"bottom":e},Qc=e.createContext(null),qc=function(t){var n=t.children,i=t.minMenuHeight,r=t.maxMenuHeight,o=t.menuPlacement,s=t.menuPosition,a=t.menuShouldScrollIntoView,l=t.theme,c=(e.useContext(Qc)||{}).setPortalPlacement,u=e.useRef(null),d=gs(e.useState(r),2),h=d[0],f=d[1],g=gs(e.useState(null),2),p=g[0],m=g[1],v=l.spacing.controlHeight;return $c((function(){var e=u.current;if(e){var t="fixed"===s,n=Jc({maxHeight:r,menuEl:e,minHeight:i,placement:o,shouldScroll:a&&!t,isFixedPosition:t,controlHeight:v});f(n.maxHeight),m(n.placement),null==c||c(n.placement)}}),[r,o,s,a,i,c,v]),n({ref:u,placerProps:ds(ds({},t),{},{placement:p||Kc(o),maxHeight:h})})},eu=function(e,t){var n=e.theme,i=n.spacing.baseUnit,r=n.colors;return ds({textAlign:"center"},t?{}:{color:r.neutral40,padding:"".concat(2*i,"px ").concat(3*i,"px")})},tu=eu,nu=eu,iu=function(e){var t=e.children,n=e.innerProps;return ql("div",bs({},Bc(e,"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),n),t)};iu.defaultProps={children:"No options"};var ru=function(e){var t=e.children,n=e.innerProps;return ql("div",bs({},Bc(e,"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),n),t)};ru.defaultProps={children:"Loading..."};var ou,su=["size"];var au,lu,cu="production"===process.env.NODE_ENV?{name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"}:{name:"tj5bde-Svg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICBDU1NPYmplY3RXaXRoTGFiZWwsXG4gIEdyb3VwQmFzZSxcbn0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgZ2V0U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgU3ZnID0gKHtcbiAgc2l6ZSxcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU6IG51bWJlciB9KSA9PiAoXG4gIDxzdmdcbiAgICBoZWlnaHQ9e3NpemV9XG4gICAgd2lkdGg9e3NpemV9XG4gICAgdmlld0JveD1cIjAgMCAyMCAyMFwiXG4gICAgYXJpYS1oaWRkZW49XCJ0cnVlXCJcbiAgICBmb2N1c2FibGU9XCJmYWxzZVwiXG4gICAgY3NzPXt7XG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIGZpbGw6ICdjdXJyZW50Q29sb3InLFxuICAgICAgbGluZUhlaWdodDogMSxcbiAgICAgIHN0cm9rZTogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBzdHJva2VXaWR0aDogMCxcbiAgICB9fVxuICAgIHsuLi5wcm9wc31cbiAgLz5cbik7XG5cbmV4cG9ydCB0eXBlIENyb3NzSWNvblByb3BzID0gSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZT86IG51bWJlciB9O1xuZXhwb3J0IGNvbnN0IENyb3NzSWNvbiA9IChwcm9wczogQ3Jvc3NJY29uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTE0LjM0OCAxNC44NDljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDBsLTIuNjUxLTMuMDMwLTIuNjUxIDMuMDI5Yy0wLjQ2OSAwLjQ2OS0xLjIyOSAwLjQ2OS0xLjY5NyAwLTAuNDY5LTAuNDY5LTAuNDY5LTEuMjI5IDAtMS42OTdsMi43NTgtMy4xNS0yLjc1OS0zLjE1MmMtMC40NjktMC40NjktMC40NjktMS4yMjggMC0xLjY5N3MxLjIyOC0wLjQ2OSAxLjY5NyAwbDIuNjUyIDMuMDMxIDIuNjUxLTMuMDMxYzAuNDY5LTAuNDY5IDEuMjI4LTAuNDY5IDEuNjk3IDBzMC40NjkgMS4yMjkgMCAxLjY5N2wtMi43NTggMy4xNTIgMi43NTggMy4xNWMwLjQ2OSAwLjQ2OSAwLjQ2OSAxLjIyOSAwIDEuNjk4elwiIC8+XG4gIDwvU3ZnPlxuKTtcbmV4cG9ydCB0eXBlIERvd25DaGV2cm9uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgRG93bkNoZXZyb24gPSAocHJvcHM6IERvd25DaGV2cm9uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTQuNTE2IDcuNTQ4YzAuNDM2LTAuNDQ2IDEuMDQzLTAuNDgxIDEuNTc2IDBsMy45MDggMy43NDcgMy45MDgtMy43NDdjMC41MzMtMC40ODEgMS4xNDEtMC40NDYgMS41NzQgMCAwLjQzNiAwLjQ0NSAwLjQwOCAxLjE5NyAwIDEuNjE1LTAuNDA2IDAuNDE4LTQuNjk1IDQuNTAyLTQuNjk1IDQuNTAyLTAuMjE3IDAuMjIzLTAuNTAyIDAuMzM1LTAuNzg3IDAuMzM1cy0wLjU3LTAuMTEyLTAuNzg5LTAuMzM1YzAgMC00LjI4Ny00LjA4NC00LjY5NS00LjUwMnMtMC40MzYtMS4xNyAwLTEuNjE1elwiIC8+XG4gIDwvU3ZnPlxuKTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEJ1dHRvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xufVxuXG5jb25zdCBiYXNlQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTpcbiAgICB8IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbiAgICB8IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JDb250YWluZXInLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICAgICc6aG92ZXInOiB7XG4gICAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsODAgOiBjb2xvcnMubmV1dHJhbDQwLFxuICAgICAgICB9LFxuICAgICAgfSksXG59KTtcblxuZXhwb3J0IGNvbnN0IGRyb3Bkb3duSW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBEcm9wZG93bkluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2Ryb3Bkb3duSW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdkcm9wZG93bi1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPERvd25DaGV2cm9uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuZXhwb3J0IGludGVyZmFjZSBDbGVhckluZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFRoZSBjaGlsZHJlbiB0byBiZSByZW5kZXJlZCBpbnNpZGUgdGhlIGluZGljYXRvci4gKi9cbiAgY2hpbGRyZW4/OiBSZWFjdE5vZGU7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGNvbnN0IGNsZWFySW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBDbGVhckluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2NsZWFySW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdjbGVhci1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPENyb3NzSWNvbiAvPn1cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gU2VwYXJhdG9yXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuZXhwb3J0IGludGVyZmFjZSBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaW5uZXJQcm9wcz86IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3BhbiddO1xufVxuXG5leHBvcnQgY29uc3QgaW5kaWNhdG9yU2VwYXJhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNEaXNhYmxlZCxcbiAgICB0aGVtZToge1xuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgICAgY29sb3JzLFxuICAgIH0sXG4gIH06IEluZGljYXRvclNlcGFyYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+LFxuICB1bnN0eWxlZDogYm9vbGVhblxuKTogQ1NTT2JqZWN0V2l0aExhYmVsID0+ICh7XG4gIGxhYmVsOiAnaW5kaWNhdG9yU2VwYXJhdG9yJyxcbiAgYWxpZ25TZWxmOiAnc3RyZXRjaCcsXG4gIHdpZHRoOiAxLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGJhY2tncm91bmRDb2xvcjogaXNEaXNhYmxlZCA/IGNvbG9ycy5uZXV0cmFsMTAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBtYXJnaW5Cb3R0b206IGJhc2VVbml0ICogMixcbiAgICAgICAgbWFyZ2luVG9wOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgSW5kaWNhdG9yU2VwYXJhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxzcGFuXG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnaW5kaWNhdG9yU2VwYXJhdG9yJywge1xuICAgICAgICAnaW5kaWNhdG9yLXNlcGFyYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAvPlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBMb2FkaW5nXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgbG9hZGluZ0RvdEFuaW1hdGlvbnMgPSBrZXlmcmFtZXNgXG4gIDAlLCA4MCUsIDEwMCUgeyBvcGFjaXR5OiAwOyB9XG4gIDQwJSB7IG9wYWNpdHk6IDE7IH1cbmA7XG5cbmV4cG9ydCBjb25zdCBsb2FkaW5nSW5kaWNhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHNpemUsXG4gICAgdGhlbWU6IHtcbiAgICAgIGNvbG9ycyxcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICB9LFxuICB9OiBMb2FkaW5nSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdsb2FkaW5nSW5kaWNhdG9yJyxcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICB0cmFuc2l0aW9uOiAnY29sb3IgMTUwbXMnLFxuICBhbGlnblNlbGY6ICdjZW50ZXInLFxuICBmb250U2l6ZTogc2l6ZSxcbiAgbGluZUhlaWdodDogMSxcbiAgbWFyZ2luUmlnaHQ6IHNpemUsXG4gIHRleHRBbGlnbjogJ2NlbnRlcicsXG4gIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGNvbG9yOiBpc0ZvY3VzZWQgPyBjb2xvcnMubmV1dHJhbDYwIDogY29sb3JzLm5ldXRyYWwyMCxcbiAgICAgICAgcGFkZGluZzogYmFzZVVuaXQgKiAyLFxuICAgICAgfSksXG59KTtcblxuaW50ZXJmYWNlIExvYWRpbmdEb3RQcm9wcyB7XG4gIGRlbGF5OiBudW1iZXI7XG4gIG9mZnNldDogYm9vbGVhbjtcbn1cbmNvbnN0IExvYWRpbmdEb3QgPSAoeyBkZWxheSwgb2Zmc2V0IH06IExvYWRpbmdEb3RQcm9wcykgPT4gKFxuICA8c3BhblxuICAgIGNzcz17e1xuICAgICAgYW5pbWF0aW9uOiBgJHtsb2FkaW5nRG90QW5pbWF0aW9uc30gMXMgZWFzZS1pbi1vdXQgJHtkZWxheX1tcyBpbmZpbml0ZTtgLFxuICAgICAgYmFja2dyb3VuZENvbG9yOiAnY3VycmVudENvbG9yJyxcbiAgICAgIGJvcmRlclJhZGl1czogJzFlbScsXG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIG1hcmdpbkxlZnQ6IG9mZnNldCA/ICcxZW0nIDogdW5kZWZpbmVkLFxuICAgICAgaGVpZ2h0OiAnMWVtJyxcbiAgICAgIHZlcnRpY2FsQWxpZ246ICd0b3AnLFxuICAgICAgd2lkdGg6ICcxZW0nLFxuICAgIH19XG4gIC8+XG4pO1xuXG5leHBvcnQgaW50ZXJmYWNlIExvYWRpbmdJbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgLyoqIFNldCBzaXplIG9mIHRoZSBjb250YWluZXIuICovXG4gIHNpemU6IG51bWJlcjtcbn1cbmV4cG9ydCBjb25zdCBMb2FkaW5nSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogTG9hZGluZ0luZGljYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+XG4pID0+IHtcbiAgY29uc3QgeyBpbm5lclByb3BzLCBpc1J0bCB9ID0gcHJvcHM7XG5cbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2xvYWRpbmdJbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2xvYWRpbmctaW5kaWNhdG9yJzogdHJ1ZSxcbiAgICAgIH0pfVxuICAgICAgey4uLmlubmVyUHJvcHN9XG4gICAgPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezB9IG9mZnNldD17aXNSdGx9IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MTYwfSBvZmZzZXQgLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXszMjB9IG9mZnNldD17IWlzUnRsfSAvPlxuICAgIDwvZGl2PlxuICApO1xufTtcbkxvYWRpbmdJbmRpY2F0b3IuZGVmYXVsdFByb3BzID0geyBzaXplOiA0IH07XG4iXX0= */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}},uu=function(e){var t=e.size,n=ps(e,su);return ql("svg",bs({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:cu},n))},du=function(e){return ql(uu,bs({size:20},e),ql("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},hu=function(e){return ql(uu,bs({size:20},e),ql("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},fu=function(e,t){var n=e.isFocused,i=e.theme,r=i.spacing.baseUnit,o=i.colors;return ds({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?o.neutral60:o.neutral20,padding:2*r,":hover":{color:n?o.neutral80:o.neutral40}})},gu=fu,pu=fu,mu=function(){var e=nc.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(ou||(au=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],lu||(lu=au.slice(0)),ou=Object.freeze(Object.defineProperties(au,{raw:{value:Object.freeze(lu)}})))),vu=function(e){var t=e.delay,n=e.offset;return ql("span",{css:nc({animation:"".concat(mu," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"production"===process.env.NODE_ENV?"":";label:LoadingDot;","production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1RSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICBDU1NPYmplY3RXaXRoTGFiZWwsXG4gIEdyb3VwQmFzZSxcbn0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgZ2V0U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgU3ZnID0gKHtcbiAgc2l6ZSxcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU6IG51bWJlciB9KSA9PiAoXG4gIDxzdmdcbiAgICBoZWlnaHQ9e3NpemV9XG4gICAgd2lkdGg9e3NpemV9XG4gICAgdmlld0JveD1cIjAgMCAyMCAyMFwiXG4gICAgYXJpYS1oaWRkZW49XCJ0cnVlXCJcbiAgICBmb2N1c2FibGU9XCJmYWxzZVwiXG4gICAgY3NzPXt7XG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIGZpbGw6ICdjdXJyZW50Q29sb3InLFxuICAgICAgbGluZUhlaWdodDogMSxcbiAgICAgIHN0cm9rZTogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBzdHJva2VXaWR0aDogMCxcbiAgICB9fVxuICAgIHsuLi5wcm9wc31cbiAgLz5cbik7XG5cbmV4cG9ydCB0eXBlIENyb3NzSWNvblByb3BzID0gSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZT86IG51bWJlciB9O1xuZXhwb3J0IGNvbnN0IENyb3NzSWNvbiA9IChwcm9wczogQ3Jvc3NJY29uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTE0LjM0OCAxNC44NDljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDBsLTIuNjUxLTMuMDMwLTIuNjUxIDMuMDI5Yy0wLjQ2OSAwLjQ2OS0xLjIyOSAwLjQ2OS0xLjY5NyAwLTAuNDY5LTAuNDY5LTAuNDY5LTEuMjI5IDAtMS42OTdsMi43NTgtMy4xNS0yLjc1OS0zLjE1MmMtMC40NjktMC40NjktMC40NjktMS4yMjggMC0xLjY5N3MxLjIyOC0wLjQ2OSAxLjY5NyAwbDIuNjUyIDMuMDMxIDIuNjUxLTMuMDMxYzAuNDY5LTAuNDY5IDEuMjI4LTAuNDY5IDEuNjk3IDBzMC40NjkgMS4yMjkgMCAxLjY5N2wtMi43NTggMy4xNTIgMi43NTggMy4xNWMwLjQ2OSAwLjQ2OSAwLjQ2OSAxLjIyOSAwIDEuNjk4elwiIC8+XG4gIDwvU3ZnPlxuKTtcbmV4cG9ydCB0eXBlIERvd25DaGV2cm9uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgRG93bkNoZXZyb24gPSAocHJvcHM6IERvd25DaGV2cm9uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTQuNTE2IDcuNTQ4YzAuNDM2LTAuNDQ2IDEuMDQzLTAuNDgxIDEuNTc2IDBsMy45MDggMy43NDcgMy45MDgtMy43NDdjMC41MzMtMC40ODEgMS4xNDEtMC40NDYgMS41NzQgMCAwLjQzNiAwLjQ0NSAwLjQwOCAxLjE5NyAwIDEuNjE1LTAuNDA2IDAuNDE4LTQuNjk1IDQuNTAyLTQuNjk1IDQuNTAyLTAuMjE3IDAuMjIzLTAuNTAyIDAuMzM1LTAuNzg3IDAuMzM1cy0wLjU3LTAuMTEyLTAuNzg5LTAuMzM1YzAgMC00LjI4Ny00LjA4NC00LjY5NS00LjUwMnMtMC40MzYtMS4xNyAwLTEuNjE1elwiIC8+XG4gIDwvU3ZnPlxuKTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEJ1dHRvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xufVxuXG5jb25zdCBiYXNlQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTpcbiAgICB8IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbiAgICB8IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JDb250YWluZXInLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICAgICc6aG92ZXInOiB7XG4gICAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsODAgOiBjb2xvcnMubmV1dHJhbDQwLFxuICAgICAgICB9LFxuICAgICAgfSksXG59KTtcblxuZXhwb3J0IGNvbnN0IGRyb3Bkb3duSW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBEcm9wZG93bkluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2Ryb3Bkb3duSW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdkcm9wZG93bi1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPERvd25DaGV2cm9uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuZXhwb3J0IGludGVyZmFjZSBDbGVhckluZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFRoZSBjaGlsZHJlbiB0byBiZSByZW5kZXJlZCBpbnNpZGUgdGhlIGluZGljYXRvci4gKi9cbiAgY2hpbGRyZW4/OiBSZWFjdE5vZGU7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGNvbnN0IGNsZWFySW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBDbGVhckluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2NsZWFySW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdjbGVhci1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPENyb3NzSWNvbiAvPn1cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gU2VwYXJhdG9yXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuZXhwb3J0IGludGVyZmFjZSBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaW5uZXJQcm9wcz86IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3BhbiddO1xufVxuXG5leHBvcnQgY29uc3QgaW5kaWNhdG9yU2VwYXJhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNEaXNhYmxlZCxcbiAgICB0aGVtZToge1xuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgICAgY29sb3JzLFxuICAgIH0sXG4gIH06IEluZGljYXRvclNlcGFyYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+LFxuICB1bnN0eWxlZDogYm9vbGVhblxuKTogQ1NTT2JqZWN0V2l0aExhYmVsID0+ICh7XG4gIGxhYmVsOiAnaW5kaWNhdG9yU2VwYXJhdG9yJyxcbiAgYWxpZ25TZWxmOiAnc3RyZXRjaCcsXG4gIHdpZHRoOiAxLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGJhY2tncm91bmRDb2xvcjogaXNEaXNhYmxlZCA/IGNvbG9ycy5uZXV0cmFsMTAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBtYXJnaW5Cb3R0b206IGJhc2VVbml0ICogMixcbiAgICAgICAgbWFyZ2luVG9wOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgSW5kaWNhdG9yU2VwYXJhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxzcGFuXG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnaW5kaWNhdG9yU2VwYXJhdG9yJywge1xuICAgICAgICAnaW5kaWNhdG9yLXNlcGFyYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAvPlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBMb2FkaW5nXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgbG9hZGluZ0RvdEFuaW1hdGlvbnMgPSBrZXlmcmFtZXNgXG4gIDAlLCA4MCUsIDEwMCUgeyBvcGFjaXR5OiAwOyB9XG4gIDQwJSB7IG9wYWNpdHk6IDE7IH1cbmA7XG5cbmV4cG9ydCBjb25zdCBsb2FkaW5nSW5kaWNhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHNpemUsXG4gICAgdGhlbWU6IHtcbiAgICAgIGNvbG9ycyxcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICB9LFxuICB9OiBMb2FkaW5nSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdsb2FkaW5nSW5kaWNhdG9yJyxcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICB0cmFuc2l0aW9uOiAnY29sb3IgMTUwbXMnLFxuICBhbGlnblNlbGY6ICdjZW50ZXInLFxuICBmb250U2l6ZTogc2l6ZSxcbiAgbGluZUhlaWdodDogMSxcbiAgbWFyZ2luUmlnaHQ6IHNpemUsXG4gIHRleHRBbGlnbjogJ2NlbnRlcicsXG4gIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGNvbG9yOiBpc0ZvY3VzZWQgPyBjb2xvcnMubmV1dHJhbDYwIDogY29sb3JzLm5ldXRyYWwyMCxcbiAgICAgICAgcGFkZGluZzogYmFzZVVuaXQgKiAyLFxuICAgICAgfSksXG59KTtcblxuaW50ZXJmYWNlIExvYWRpbmdEb3RQcm9wcyB7XG4gIGRlbGF5OiBudW1iZXI7XG4gIG9mZnNldDogYm9vbGVhbjtcbn1cbmNvbnN0IExvYWRpbmdEb3QgPSAoeyBkZWxheSwgb2Zmc2V0IH06IExvYWRpbmdEb3RQcm9wcykgPT4gKFxuICA8c3BhblxuICAgIGNzcz17e1xuICAgICAgYW5pbWF0aW9uOiBgJHtsb2FkaW5nRG90QW5pbWF0aW9uc30gMXMgZWFzZS1pbi1vdXQgJHtkZWxheX1tcyBpbmZpbml0ZTtgLFxuICAgICAgYmFja2dyb3VuZENvbG9yOiAnY3VycmVudENvbG9yJyxcbiAgICAgIGJvcmRlclJhZGl1czogJzFlbScsXG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIG1hcmdpbkxlZnQ6IG9mZnNldCA/ICcxZW0nIDogdW5kZWZpbmVkLFxuICAgICAgaGVpZ2h0OiAnMWVtJyxcbiAgICAgIHZlcnRpY2FsQWxpZ246ICd0b3AnLFxuICAgICAgd2lkdGg6ICcxZW0nLFxuICAgIH19XG4gIC8+XG4pO1xuXG5leHBvcnQgaW50ZXJmYWNlIExvYWRpbmdJbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgLyoqIFNldCBzaXplIG9mIHRoZSBjb250YWluZXIuICovXG4gIHNpemU6IG51bWJlcjtcbn1cbmV4cG9ydCBjb25zdCBMb2FkaW5nSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogTG9hZGluZ0luZGljYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+XG4pID0+IHtcbiAgY29uc3QgeyBpbm5lclByb3BzLCBpc1J0bCB9ID0gcHJvcHM7XG5cbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2xvYWRpbmdJbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2xvYWRpbmctaW5kaWNhdG9yJzogdHJ1ZSxcbiAgICAgIH0pfVxuICAgICAgey4uLmlubmVyUHJvcHN9XG4gICAgPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezB9IG9mZnNldD17aXNSdGx9IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MTYwfSBvZmZzZXQgLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXszMjB9IG9mZnNldD17IWlzUnRsfSAvPlxuICAgIDwvZGl2PlxuICApO1xufTtcbkxvYWRpbmdJbmRpY2F0b3IuZGVmYXVsdFByb3BzID0geyBzaXplOiA0IH07XG4iXX0= */")})},bu=function(e){var t=e.innerProps,n=e.isRtl;return ql("div",bs({},Bc(e,"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),ql(vu,{delay:0,offset:n}),ql(vu,{delay:160,offset:!0}),ql(vu,{delay:320,offset:!n}))};bu.defaultProps={size:4};var yu=["data"],wu=["innerRef","isDisabled","isHidden","inputClassName"],Cu={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},xu={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":ds({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Cu)},Su=function(e){return ds({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Cu)},Eu=function(e){var t=e.children,n=e.innerProps;return ql("div",n,t)};var Au={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return ql("div",bs({},Bc(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||ql(du,null))},Control:function(e){var t=e.children,n=e.isDisabled,i=e.isFocused,r=e.innerRef,o=e.innerProps,s=e.menuIsOpen;return ql("div",bs({ref:r},Bc(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":i,"control--menu-is-open":s}),o),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return ql("div",bs({},Bc(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||ql(hu,null))},DownChevron:hu,CrossIcon:du,Group:function(e){var t=e.children,n=e.cx,i=e.getStyles,r=e.getClassNames,o=e.Heading,s=e.headingProps,a=e.innerProps,l=e.label,c=e.theme,u=e.selectProps;return ql("div",bs({},Bc(e,"group",{group:!0}),a),ql(o,bs({},s,{selectProps:u,theme:c,getStyles:i,getClassNames:r,cx:n}),l),ql("div",null,t))},GroupHeading:function(e){var t=Nc(e);t.data;var n=ps(t,yu);return ql("div",bs({},Bc(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return ql("div",bs({},Bc(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return ql("span",bs({},t,Bc(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,i=Nc(e),r=i.innerRef,o=i.isDisabled,s=i.isHidden,a=i.inputClassName,l=ps(i,wu);return ql("div",bs({},Bc(e,"input",{"input-container":!0}),{"data-value":n||""}),ql("input",bs({className:t({input:!0},a),ref:r,style:Su(s),disabled:o},l)))},LoadingIndicator:bu,Menu:function(e){var t=e.children,n=e.innerRef,i=e.innerProps;return ql("div",bs({},Bc(e,"menu",{menu:!0}),{ref:n},i),t)},MenuList:function(e){var t=e.children,n=e.innerProps,i=e.innerRef,r=e.isMulti;return ql("div",bs({},Bc(e,"menuList",{"menu-list":!0,"menu-list--is-multi":r}),{ref:i},n),t)},MenuPortal:function(t){var n=t.appendTo,i=t.children,o=t.controlElement,s=t.innerProps,a=t.menuPlacement,l=t.menuPosition,c=e.useRef(null),u=e.useRef(null),d=gs(e.useState(Kc(a)),2),h=d[0],f=d[1],g=e.useMemo((function(){return{setPortalPlacement:f}}),[]),p=gs(e.useState(null),2),m=p[0],v=p[1],b=e.useCallback((function(){if(o){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(o),t="fixed"===l?0:window.pageYOffset,n=e[h]+t;n===(null==m?void 0:m.offset)&&e.left===(null==m?void 0:m.rect.left)&&e.width===(null==m?void 0:m.rect.width)||v({offset:n,rect:e})}}),[o,l,h,null==m?void 0:m.offset,null==m?void 0:m.rect.left,null==m?void 0:m.rect.width]);$c((function(){b()}),[b]);var y=e.useCallback((function(){"function"==typeof u.current&&(u.current(),u.current=null),o&&c.current&&(u.current=function(e,t,n,i){void 0===i&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:s=!0,animationFrame:a=!1}=i,l=r&&!a,c=l||o?[...mc(e)?kc(e):e.contextElement?kc(e.contextElement):[],...kc(t)]:[];c.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)}));let u,d=null;if(s){let i=!0;d=new ResizeObserver((()=>{i||n(),i=!1})),mc(e)&&!a&&d.observe(e),mc(e)||!e.contextElement||a||d.observe(e.contextElement),d.observe(t)}let h=a?Ac(e):null;return a&&function t(){const i=Ac(e);!h||i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height||n(),h=i,u=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{l&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)})),null==(e=d)||e.disconnect(),d=null,a&&cancelAnimationFrame(u)}}(o,c.current,b,{elementResize:"ResizeObserver"in window}))}),[o,b]);$c((function(){y()}),[y]);var w=e.useCallback((function(e){c.current=e,y()}),[y]);if(!n&&"fixed"!==l||!m)return null;var C=ql("div",bs({ref:w},Bc(ds(ds({},t),{},{offset:m.offset,position:l,rect:m.rect}),"menuPortal",{"menu-portal":!0}),s),i);return ql(Qc.Provider,{value:g},n?r.createPortal(C,n):C)},LoadingMessage:ru,NoOptionsMessage:iu,MultiValue:function(e){var t=e.children,n=e.components,i=e.data,r=e.innerProps,o=e.isDisabled,s=e.removeProps,a=e.selectProps,l=n.Container,c=n.Label,u=n.Remove;return ql(l,{data:i,innerProps:ds(ds({},Bc(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),r),selectProps:a},ql(c,{data:i,innerProps:ds({},Bc(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:a},t),ql(u,{data:i,innerProps:ds(ds({},Bc(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},s),selectProps:a}))},MultiValueContainer:Eu,MultiValueLabel:Eu,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return ql("div",bs({role:"button"},n),t||ql(du,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,i=e.isFocused,r=e.isSelected,o=e.innerRef,s=e.innerProps;return ql("div",bs({},Bc(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":i,"option--is-selected":r}),{ref:o,"aria-disabled":n},s),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return ql("div",bs({},Bc(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,i=e.isDisabled,r=e.isRtl;return ql("div",bs({},Bc(e,"container",{"--is-disabled":i,"--is-rtl":r}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,i=e.innerProps;return ql("div",bs({},Bc(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),i),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,i=e.isMulti,r=e.hasValue;return ql("div",bs({},Bc(e,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":r}),n),t)}},Ru=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Iu(e,t){if(e.length!==t.length)return!1;for(var n=0;n1?"s":""," ").concat(r.join(","),", selected.");case"select-option":return"option ".concat(i,o?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,i=e.options,r=e.label,o=void 0===r?"":r,s=e.selectValue,a=e.isDisabled,l=e.isSelected,c=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&s)return"value ".concat(o," focused, ").concat(c(s,n),".");if("menu"===t){var u=a?" disabled":"",d="".concat(l?"selected":"focused").concat(u);return"option ".concat(o," ").concat(d,", ").concat(c(i,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Lu=function(t){var n=t.ariaSelection,i=t.focusedOption,r=t.focusedValue,o=t.focusableOptions,s=t.isFocused,a=t.selectValue,l=t.selectProps,c=t.id,u=l.ariaLiveMessages,d=l.getOptionLabel,h=l.inputValue,f=l.isMulti,g=l.isOptionDisabled,p=l.isSearchable,m=l.menuIsOpen,v=l.options,b=l.screenReaderStatus,y=l.tabSelectsValue,w=l["aria-label"],C=l["aria-live"],x=e.useMemo((function(){return ds(ds({},_u),u||{})}),[u]),S=e.useMemo((function(){var e,t="";if(n&&x.onChange){var i=n.option,r=n.options,o=n.removedValue,s=n.removedValues,l=n.value,c=o||i||(e=l,Array.isArray(e)?null:e),u=c?d(c):"",h=r||s||void 0,f=h?h.map(d):[],p=ds({isDisabled:c&&g(c,a),label:u,labels:f},n);t=x.onChange(p)}return t}),[n,x,g,a,d]),E=e.useMemo((function(){var e="",t=i||r,n=!!(i&&a&&a.includes(i));if(t&&x.onFocus){var s={focused:t,label:d(t),isDisabled:g(t,a),isSelected:n,options:o,context:t===i?"menu":"value",selectValue:a};e=x.onFocus(s)}return e}),[i,r,d,g,x,o,a]),A=e.useMemo((function(){var e="";if(m&&v.length&&x.onFilter){var t=b({count:o.length});e=x.onFilter({inputValue:h,resultsMessage:t})}return e}),[o,h,m,x,v,b]),R=e.useMemo((function(){var e="";if(x.guidance){var t=r?"value":m?"menu":"input";e=x.guidance({"aria-label":w,context:t,isDisabled:i&&g(i,a),isMulti:f,isSearchable:p,tabSelectsValue:y})}return e}),[w,i,r,f,g,p,m,x,a,y]),I="".concat(E," ").concat(A," ").concat(R),k=ql(e.Fragment,null,ql("span",{id:"aria-selection"},S),ql("span",{id:"aria-context"},I)),$="initial-input-focus"===(null==n?void 0:n.action);return ql(e.Fragment,null,ql($u,{id:c},$&&k),ql($u,{"aria-live":C,"aria-atomic":"false","aria-relevant":"additions text"},s&&!$&&k))},Tu=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Mu=new RegExp("["+Tu.map((function(e){return e.letters})).join("")+"]","g"),Ou={},Nu=0;Nu1?t-1:0),i=1;i0,p=d-h-c,m=!1;p>t&&a.current&&(r&&r(e),a.current=!1),g&&l.current&&(s&&s(e),l.current=!1),g&&t>p?(i&&!a.current&&i(e),f.scrollTop=d,m=!0,a.current=!0):!g&&-t>c&&(o&&!l.current&&o(e),f.scrollTop=0,m=!0,l.current=!0),m&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[i,r,o,s]),h=e.useCallback((function(e){d(e,e.deltaY)}),[d]),f=e.useCallback((function(e){c.current=e.changedTouches[0].clientY}),[]),g=e.useCallback((function(e){var t=c.current-e.changedTouches[0].clientY;d(e,t)}),[d]),p=e.useCallback((function(e){if(e){var t=!!Xc&&{passive:!1};e.addEventListener("wheel",h,t),e.addEventListener("touchstart",f,t),e.addEventListener("touchmove",g,t)}}),[g,f,h]),m=e.useCallback((function(e){e&&(e.removeEventListener("wheel",h,!1),e.removeEventListener("touchstart",f,!1),e.removeEventListener("touchmove",g,!1))}),[g,f,h]);return e.useEffect((function(){if(n){var e=u.current;return p(e),function(){m(e)}}}),[n,p,m]),function(e){u.current=e}}({isEnabled:void 0===r||r,onBottomArrive:t.onBottomArrive,onBottomLeave:t.onBottomLeave,onTopArrive:t.onTopArrive,onTopLeave:t.onTopLeave}),s=function(t){var n=t.isEnabled,i=t.accountForScrollbars,r=void 0===i||i,o=e.useRef({}),s=e.useRef(null),a=e.useCallback((function(e){if(Ju){var t=document.body,n=t&&t.style;if(r&&zu.forEach((function(e){var t=n&&n[e];o.current[e]=t})),r&&Ku<1){var i=parseInt(o.current.paddingRight,10)||0,s=document.body?document.body.clientWidth:0,a=window.innerWidth-s+i||0;Object.keys(ju).forEach((function(e){var t=ju[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(a,"px"))}t&&Yu()&&(t.addEventListener("touchmove",Zu,Qu),e&&(e.addEventListener("touchstart",Uu,Qu),e.addEventListener("touchmove",Xu,Qu))),Ku+=1}}),[r]),l=e.useCallback((function(e){if(Ju){var t=document.body,n=t&&t.style;Ku=Math.max(Ku-1,0),r&&Ku<1&&zu.forEach((function(e){var t=o.current[e];n&&(n[e]=t)})),t&&Yu()&&(t.removeEventListener("touchmove",Zu,Qu),e&&(e.removeEventListener("touchstart",Uu,Qu),e.removeEventListener("touchmove",Xu,Qu)))}}),[r]);return e.useEffect((function(){if(n){var e=s.current;return a(e),function(){l(e)}}}),[n,a,l]),function(e){s.current=e}}({isEnabled:i});return ql(e.Fragment,null,i&&ql("div",{onClick:qu,css:ed}),n((function(e){o(e),s(e)})))}var nd,id="production"===process.env.NODE_ENV?{name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"}:{name:"5kkxb2-requiredInput-RequiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%;label:RequiredInput;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlcXVpcmVkSW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWFJIiwiZmlsZSI6IlJlcXVpcmVkSW5wdXQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqIEBqc3gganN4ICovXG5pbXBvcnQgeyBGb2N1c0V2ZW50SGFuZGxlciwgRnVuY3Rpb25Db21wb25lbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmNvbnN0IFJlcXVpcmVkSW5wdXQ6IEZ1bmN0aW9uQ29tcG9uZW50PHtcbiAgcmVhZG9ubHkgbmFtZTogc3RyaW5nO1xuICByZWFkb25seSBvbkZvY3VzOiBGb2N1c0V2ZW50SGFuZGxlcjxIVE1MSW5wdXRFbGVtZW50Pjtcbn0+ID0gKHsgbmFtZSwgb25Gb2N1cyB9KSA9PiAoXG4gIDxpbnB1dFxuICAgIHJlcXVpcmVkXG4gICAgbmFtZT17bmFtZX1cbiAgICB0YWJJbmRleD17LTF9XG4gICAgb25Gb2N1cz17b25Gb2N1c31cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAncmVxdWlyZWRJbnB1dCcsXG4gICAgICBvcGFjaXR5OiAwLFxuICAgICAgcG9pbnRlckV2ZW50czogJ25vbmUnLFxuICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICBib3R0b206IDAsXG4gICAgICBsZWZ0OiAwLFxuICAgICAgcmlnaHQ6IDAsXG4gICAgICB3aWR0aDogJzEwMCUnLFxuICAgIH19XG4gICAgLy8gUHJldmVudCBgU3dpdGNoaW5nIGZyb20gdW5jb250cm9sbGVkIHRvIGNvbnRyb2xsZWRgIGVycm9yXG4gICAgdmFsdWU9XCJcIlxuICAgIG9uQ2hhbmdlPXsoKSA9PiB7fX1cbiAgLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IFJlcXVpcmVkSW5wdXQ7XG4iXX0= */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}},rd=function(e){var t=e.name,n=e.onFocus;return ql("input",{required:!0,name:t,tabIndex:-1,onFocus:n,css:id,value:"",onChange:function(){}})},od=function(e){return e.label},sd=function(e){return e.value},ad={clearIndicator:pu,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,i=e.isFocused,r=e.theme,o=r.colors,s=r.borderRadius;return ds({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:r.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?o.neutral5:o.neutral0,borderColor:n?o.neutral10:i?o.primary:o.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},dropdownIndicator:gu,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,i=n.colors,r=n.spacing;return ds({label:"group",cursor:"default",display:"block"},t?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*r.baseUnit,paddingRight:3*r.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,i=e.theme,r=i.spacing.baseUnit,o=i.colors;return ds({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?o.neutral10:o.neutral20,marginBottom:2*r,marginTop:2*r})},input:function(e,t){var n=e.isDisabled,i=e.value,r=e.theme,o=r.spacing,s=r.colors;return ds(ds({visibility:n?"hidden":"visible",transform:i?"translateZ(0)":""},xu),t?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:s.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,i=e.size,r=e.theme,o=r.colors,s=r.spacing.baseUnit;return ds({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?o.neutral60:o.neutral20,padding:2*s})},loadingMessage:nu,menu:function(e,t){var n,i=e.placement,r=e.theme,o=r.borderRadius,s=r.spacing,a=r.colors;return ds((cs(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(i),"100%"),cs(n,"position","absolute"),cs(n,"width","100%"),cs(n,"zIndex",1),n),t?{}:{backgroundColor:a.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},menuList:function(e,t){var n=e.maxHeight,i=e.theme.spacing.baseUnit;return ds({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:i,paddingTop:i})},menuPortal:function(e){var t=e.rect,n=e.offset,i=e.position;return{left:t.left,position:i,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,i=n.spacing,r=n.borderRadius,o=n.colors;return ds({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:o.neutral10,borderRadius:r/2,margin:i.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,i=n.borderRadius,r=n.colors,o=e.cropWithEllipsis;return ds({overflow:"hidden",textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:i/2,color:r.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,i=n.spacing,r=n.borderRadius,o=n.colors,s=e.isFocused;return ds({alignItems:"center",display:"flex"},t?{}:{borderRadius:r/2,backgroundColor:s?o.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},noOptionsMessage:tu,option:function(e,t){var n=e.isDisabled,i=e.isFocused,r=e.isSelected,o=e.theme,s=o.spacing,a=o.colors;return ds({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:r?a.primary:i?a.primary25:"transparent",color:n?a.neutral20:r?a.neutral0:"inherit",padding:"".concat(2*s.baseUnit,"px ").concat(3*s.baseUnit,"px"),":active":{backgroundColor:n?void 0:r?a.primary:a.primary50}})},placeholder:function(e,t){var n=e.theme,i=n.spacing,r=n.colors;return ds({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:r.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,i=e.theme,r=i.spacing,o=i.colors;return ds({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?o.neutral40:o.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,i=e.isMulti,r=e.hasValue,o=e.selectProps.controlShouldRenderValue;return ds({alignItems:"center",display:i&&r&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},ld={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},cd={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Vc(),captureMenuScroll:!Vc(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=ds({ignoreCase:!0,ignoreAccents:!0,stringify:Hu,trim:!0,matchFrom:"any"},nd),i=n.ignoreCase,r=n.ignoreAccents,o=n.stringify,s=n.trim,a=n.matchFrom,l=s?Gu(t):t,c=s?Gu(o(e)):o(e);return i&&(l=l.toLowerCase(),c=c.toLowerCase()),r&&(l=Wu(l),c=Pu(c)),"start"===a?c.substr(0,l.length)===l:c.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:od,getOptionValue:sd,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function ud(e,t,n,i){return{type:"option",data:t,isDisabled:md(e,t,n),isSelected:vd(e,t,n),label:gd(e,t),value:pd(e,t),index:i}}function dd(e,t){return e.options.map((function(n,i){if("options"in n){var r=n.options.map((function(n,i){return ud(e,n,t,i)})).filter((function(t){return fd(e,t)}));return r.length>0?{type:"group",data:n,options:r,index:i}:void 0}var o=ud(e,n,t,i);return fd(e,o)?o:void 0})).filter(Uc)}function hd(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,Es(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function fd(e,t){var n=e.inputValue,i=void 0===n?"":n,r=t.data,o=t.isSelected,s=t.label,a=t.value;return(!yd(e)||!o)&&bd(e,{label:s,value:a,data:r},i)}var gd=function(e,t){return e.getOptionLabel(t)},pd=function(e,t){return e.getOptionValue(t)};function md(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function vd(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var i=pd(e,t);return n.some((function(t){return pd(e,t)===i}))}function bd(e,t,n){return!e.filterOption||e.filterOption(t,n)}var yd=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},wd=1,Cd=function(t){!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&&ws(e,t)}(s,e.Component);var n,i,r,o=Ss(s);function s(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=o.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},t.blockOptionHover=!1,t.isComposing=!1,t.commonProps=void 0,t.initialTouchX=0,t.initialTouchY=0,t.instancePrefix="",t.openAfterFocus=!1,t.scrollToFocusedOptionOnUpdate=!1,t.userIsDragging=void 0,t.controlRef=null,t.getControlRef=function(e){t.controlRef=e},t.focusedOptionRef=null,t.getFocusedOptionRef=function(e){t.focusedOptionRef=e},t.menuListRef=null,t.getMenuListRef=function(e){t.menuListRef=e},t.inputRef=null,t.getInputRef=function(e){t.inputRef=e},t.focus=t.focusInput,t.blur=t.blurInput,t.onChange=function(e,n){var i=t.props,r=i.onChange,o=i.name;n.name=o,t.ariaOnChange(e,n),r(e,n)},t.setValue=function(e,n,i){var r=t.props,o=r.closeMenuOnSelect,s=r.isMulti,a=r.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:a}),o&&(t.setState({inputIsHiddenAfterUpdate:!s}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(e,{action:n,option:i})},t.selectOption=function(e){var n=t.props,i=n.blurInputOnSelect,r=n.isMulti,o=n.name,s=t.state.selectValue,a=r&&t.isOptionSelected(e,s),l=t.isOptionDisabled(e,s);if(a){var c=t.getOptionValue(e);t.setValue(s.filter((function(e){return t.getOptionValue(e)!==c})),"deselect-option",e)}else{if(l)return void t.ariaOnChange(e,{action:"select-option",option:e,name:o});r?t.setValue([].concat(Es(s),[e]),"select-option",e):t.setValue(e,"select-option")}i&&t.blurInput()},t.removeValue=function(e){var n=t.props.isMulti,i=t.state.selectValue,r=t.getOptionValue(e),o=i.filter((function(e){return t.getOptionValue(e)!==r})),s=Yc(n,o,o[0]||null);t.onChange(s,{action:"remove-value",removedValue:e}),t.focusInput()},t.clearValue=function(){var e=t.state.selectValue;t.onChange(Yc(t.props.isMulti,[],null),{action:"clear",removedValues:e})},t.popValue=function(){var e=t.props.isMulti,n=t.state.selectValue,i=n[n.length-1],r=n.slice(0,n.length-1),o=Yc(e,r,r[0]||null);t.onChange(o,{action:"pop-value",removedValue:i})},t.getValue=function(){return t.state.selectValue},t.cx=function(){for(var e=arguments.length,n=new Array(e),i=0;i5||o>5}},t.onTouchEnd=function(e){t.userIsDragging||(t.controlRef&&!t.controlRef.contains(e.target)&&t.menuListRef&&!t.menuListRef.contains(e.target)&&t.blurInput(),t.initialTouchX=0,t.initialTouchY=0)},t.onControlTouchEnd=function(e){t.userIsDragging||t.onControlMouseDown(e)},t.onClearIndicatorTouchEnd=function(e){t.userIsDragging||t.onClearIndicatorMouseDown(e)},t.onDropdownIndicatorTouchEnd=function(e){t.userIsDragging||t.onDropdownIndicatorMouseDown(e)},t.handleInputChange=function(e){var n=t.props.inputValue,i=e.currentTarget.value;t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange(i,{action:"input-change",prevInputValue:n}),t.props.menuIsOpen||t.onMenuOpen()},t.onInputFocus=function(e){t.props.onFocus&&t.props.onFocus(e),t.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(t.openAfterFocus||t.props.openMenuOnFocus)&&t.openMenu("first"),t.openAfterFocus=!1},t.onInputBlur=function(e){var n=t.props.inputValue;t.menuListRef&&t.menuListRef.contains(document.activeElement)?t.inputRef.focus():(t.props.onBlur&&t.props.onBlur(e),t.onInputChange("",{action:"input-blur",prevInputValue:n}),t.onMenuClose(),t.setState({focusedValue:null,isFocused:!1}))},t.onOptionHover=function(e){t.blockOptionHover||t.state.focusedOption===e||t.setState({focusedOption:e})},t.shouldHideSelectedOptions=function(){return yd(t.props)},t.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),t.focus()},t.onKeyDown=function(e){var n=t.props,i=n.isMulti,r=n.backspaceRemovesValue,o=n.escapeClearsValue,s=n.inputValue,a=n.isClearable,l=n.isDisabled,c=n.menuIsOpen,u=n.onKeyDown,d=n.tabSelectsValue,h=n.openMenuOnFocus,f=t.state,g=f.focusedOption,p=f.focusedValue,m=f.selectValue;if(!(l||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(t.blockOptionHover=!0,e.key){case"ArrowLeft":if(!i||s)return;t.focusValue("previous");break;case"ArrowRight":if(!i||s)return;t.focusValue("next");break;case"Delete":case"Backspace":if(s)return;if(p)t.removeValue(p);else{if(!r)return;i?t.popValue():a&&t.clearValue()}break;case"Tab":if(t.isComposing)return;if(e.shiftKey||!c||!d||!g||h&&t.isOptionSelected(g,m))return;t.selectOption(g);break;case"Enter":if(229===e.keyCode)break;if(c){if(!g)return;if(t.isComposing)return;t.selectOption(g);break}return;case"Escape":c?(t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange("",{action:"menu-close",prevInputValue:s}),t.onMenuClose()):a&&o&&t.clearValue();break;case" ":if(s)return;if(!c){t.openMenu("first");break}if(!g)return;t.selectOption(g);break;case"ArrowUp":c?t.focusOption("up"):t.openMenu("last");break;case"ArrowDown":c?t.focusOption("down"):t.openMenu("first");break;case"PageUp":if(!c)return;t.focusOption("pageup");break;case"PageDown":if(!c)return;t.focusOption("pagedown");break;case"Home":if(!c)return;t.focusOption("first");break;case"End":if(!c)return;t.focusOption("last");break;default:return}e.preventDefault()}},t.instancePrefix="react-select-"+(t.props.instanceId||++wd),t.state.selectValue=Oc(e.value),e.menuIsOpen&&t.state.selectValue.length){var n=t.buildFocusableOptions(),i=n.indexOf(t.state.selectValue[0]);t.state.focusedOption=n[i]}return t}return n=s,i=[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Dc(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,i=t.menuIsOpen,r=this.state.isFocused;(r&&!n&&e.isDisabled||r&&i&&!e.menuIsOpen)&&this.focusInput(),r&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):r||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Dc(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,i=n.selectValue,r=n.isFocused,o=this.buildFocusableOptions(),s="first"===e?0:o.length-1;if(!this.props.isMulti){var a=o.indexOf(i[0]);a>-1&&(s=a)}this.scrollToFocusedOptionOnUpdate=!(r&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:o[s]},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,i=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var r=n.indexOf(i);i||(r=-1);var o=n.length-1,s=-1;if(n.length){switch(e){case"previous":s=0===r?0:-1===r?o:r-1;break;case"next":r>-1&&r0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var r=0,o=i.indexOf(n);n||(o=-1),"up"===e?r=o>0?o-1:i.length-1:"down"===e?r=(o+1)%i.length:"pageup"===e?(r=o-t)<0&&(r=0):"pagedown"===e?(r=o+t)>i.length-1&&(r=i.length-1):"last"===e&&(r=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[r],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(ld):ds(ds({},ld),this.props.theme):ld}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,i=this.getClassNames,r=this.getValue,o=this.selectOption,s=this.setValue,a=this.props,l=a.isMulti,c=a.isRtl,u=a.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:i,getValue:r,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:o,selectProps:a,setValue:s,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return md(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return vd(this.props,e,t)}},{key:"filterOption",value:function(e,t){return bd(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,i=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:i})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,i=e.inputId,r=e.inputValue,o=e.tabIndex,s=e.form,a=e.menuIsOpen,c=e.required,u=this.getComponents().Input,d=this.state,h=d.inputIsHidden,f=d.ariaSelection,g=this.commonProps,p=i||this.getElementId("input"),m=ds(ds(ds({"aria-autocomplete":"list","aria-expanded":a,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":c,role:"combobox"},a&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==f?void 0:f.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?l.createElement(u,bs({},g,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:p,innerRef:this.getInputRef,isDisabled:t,isHidden:h,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:o,form:s,type:"text",value:r},m)):l.createElement(Vu,bs({id:p,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Lc,onFocus:this.onInputFocus,disabled:t,tabIndex:o,inputMode:"none",form:s,value:""},m))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,i=t.MultiValueContainer,r=t.MultiValueLabel,o=t.MultiValueRemove,s=t.SingleValue,a=t.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,h=u.isDisabled,f=u.isMulti,g=u.inputValue,p=u.placeholder,m=this.state,v=m.selectValue,b=m.focusedValue,y=m.isFocused;if(!this.hasValue()||!d)return g?null:l.createElement(a,bs({},c,{key:"placeholder",isDisabled:h,isFocused:y,innerProps:{id:this.getElementId("placeholder")}}),p);if(f)return v.map((function(t,s){var a=t===b,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return l.createElement(n,bs({},c,{components:{Container:i,Label:r,Remove:o},isFocused:a,isDisabled:h,key:u,index:s,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))}));if(g)return null;var w=v[0];return l.createElement(s,bs({},c,{data:w,isDisabled:h}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,r=n.isLoading,o=this.state.isFocused;if(!this.isClearable()||!e||i||!this.hasValue()||r)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return l.createElement(e,bs({},t,{innerProps:s,isFocused:o}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,r=n.isLoading,o=this.state.isFocused;return e&&r?l.createElement(e,bs({},t,{innerProps:{"aria-hidden":"true"},isDisabled:i,isFocused:o})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var i=this.commonProps,r=this.props.isDisabled,o=this.state.isFocused;return l.createElement(n,bs({},i,{isDisabled:r,isFocused:o}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,i=this.state.isFocused,r={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return l.createElement(e,bs({},t,{innerProps:r,isDisabled:n,isFocused:i}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,i=t.GroupHeading,r=t.Menu,o=t.MenuList,s=t.MenuPortal,a=t.LoadingMessage,c=t.NoOptionsMessage,u=t.Option,d=this.commonProps,h=this.state.focusedOption,f=this.props,g=f.captureMenuScroll,p=f.inputValue,m=f.isLoading,v=f.loadingMessage,b=f.minMenuHeight,y=f.maxMenuHeight,w=f.menuIsOpen,C=f.menuPlacement,x=f.menuPosition,S=f.menuPortalTarget,E=f.menuShouldBlockScroll,A=f.menuShouldScrollIntoView,R=f.noOptionsMessage,I=f.onMenuScrollToTop,k=f.onMenuScrollToBottom;if(!w)return null;var $,_=function(t,n){var i=t.type,r=t.data,o=t.isDisabled,s=t.isSelected,a=t.label,c=t.value,f=h===r,g=o?void 0:function(){return e.onOptionHover(r)},p=o?void 0:function(){return e.selectOption(r)},m="".concat(e.getElementId("option"),"-").concat(n),v={id:m,onClick:p,onMouseMove:g,onMouseOver:g,tabIndex:-1};return l.createElement(u,bs({},d,{innerProps:v,data:r,isDisabled:o,isSelected:s,key:m,label:a,type:i,value:c,isFocused:f,innerRef:f?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())$=this.getCategorizedOptions().map((function(t){if("group"===t.type){var r=t.data,o=t.options,s=t.index,a="".concat(e.getElementId("group"),"-").concat(s),c="".concat(a,"-heading");return l.createElement(n,bs({},d,{key:a,data:r,options:o,Heading:i,headingProps:{id:c,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return _(e,"".concat(s,"-").concat(e.index))})))}if("option"===t.type)return _(t,"".concat(t.index))}));else if(m){var L=v({inputValue:p});if(null===L)return null;$=l.createElement(a,d,L)}else{var T=R({inputValue:p});if(null===T)return null;$=l.createElement(c,d,T)}var M={minMenuHeight:b,maxMenuHeight:y,menuPlacement:C,menuPosition:x,menuShouldScrollIntoView:A},O=l.createElement(qc,bs({},d,M),(function(t){var n=t.ref,i=t.placerProps,s=i.placement,a=i.maxHeight;return l.createElement(r,bs({},d,M,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove,id:e.getElementId("listbox")},isLoading:m,placement:s}),l.createElement(td,{captureEnabled:g,onTopArrive:I,onBottomArrive:k,lockEnabled:E},(function(t){return l.createElement(o,bs({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},isLoading:m,maxHeight:a,focusedOption:h}),$)})))}));return S||"fixed"===x?l.createElement(s,bs({},d,{appendTo:S,controlElement:this.controlRef,menuPlacement:C,menuPosition:x}),O):O}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,i=t.isDisabled,r=t.isMulti,o=t.name,s=t.required,a=this.state.selectValue;if(o&&!i){if(s&&!this.hasValue())return l.createElement(rd,{name:o,onFocus:this.onValueInputFocus});if(r){if(n){var c=a.map((function(t){return e.getOptionValue(t)})).join(n);return l.createElement("input",{name:o,type:"hidden",value:c})}var u=a.length>0?a.map((function(t,n){return l.createElement("input",{key:"i-".concat(n),name:o,type:"hidden",value:e.getOptionValue(t)})})):l.createElement("input",{name:o,type:"hidden",value:""});return l.createElement("div",null,u)}var d=a[0]?this.getOptionValue(a[0]):"";return l.createElement("input",{name:o,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,i=t.focusedOption,r=t.focusedValue,o=t.isFocused,s=t.selectValue,a=this.getFocusableOptions();return l.createElement(Lu,bs({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:i,focusedValue:r,isFocused:o,selectValue:s,focusableOptions:a}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,i=e.SelectContainer,r=e.ValueContainer,o=this.props,s=o.className,a=o.id,c=o.isDisabled,u=o.menuIsOpen,d=this.state.isFocused,h=this.commonProps=this.getCommonProps();return l.createElement(i,bs({},h,{className:s,innerProps:{id:a,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:d}),this.renderLiveRegion(),l.createElement(t,bs({},h,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:d,menuIsOpen:u}),l.createElement(r,bs({},h,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),l.createElement(n,bs({},h,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,i=t.clearFocusValueOnUpdate,r=t.inputIsHiddenAfterUpdate,o=t.ariaSelection,s=t.isFocused,a=t.prevWasFocused,l=e.options,c=e.value,u=e.menuIsOpen,d=e.inputValue,h=e.isMulti,f=Oc(c),g={};if(n&&(c!==n.value||l!==n.options||u!==n.menuIsOpen||d!==n.inputValue)){var p=u?function(e,t){return hd(dd(e,t))}(e,f):[],m=i?function(e,t){var n=e.focusedValue,i=e.selectValue.indexOf(n);if(i>-1){if(t.indexOf(n)>-1)return n;if(i-1?n:t[0]}(t,p);g={selectValue:f,focusedOption:v,focusedValue:m,clearFocusValueOnUpdate:!1}}var b=null!=r&&e!==n?{inputIsHidden:r,inputIsHiddenAfterUpdate:void 0}:{},y=o,w=s&&a;return s&&!w&&(y={value:Yc(h,f,f[0]||null),options:f,action:"initial-input-focus"},w=!a),"initial-input-focus"===(null==o?void 0:o.action)&&(y=null),ds(ds(ds({},g),b),{},{prevProps:e,ariaSelection:y,prevWasFocused:w})}}],i&&ys(n.prototype,i),r&&ys(n,r),Object.defineProperty(n,"prototype",{writable:!1}),s}();Cd.defaultProps=cd;var xd=e.forwardRef((function(e,t){var n=vs(e);return l.createElement(Cd,bs({ref:t},n))}));function Sd(e){var t=e.data,n=t.label,i=t.icon,r=t.tooltip;return c.default.createElement(Au.Option,u({},e,{className:i?"has-icon":Qt}),c.default.createElement(Vn,{extraClass:"option-tooltip",data:r},c.default.createElement("div",{className:"option-wrapper"},i,n)))}function Ed(e){var t=e.data,n=t.icon,i=t.label;return c.default.createElement(Au.SingleValue,u({},e),n,c.default.createElement(li,{extraClasses:"react-select__single-value-label"},i))}function Ad(e){var t=e.data,n=t.chipLabel,i=t.chipTooltip,r=t.label;return c.default.createElement(Au.MultiValue,u({},e),c.default.createElement(Vn,{data:i||r,placement:"left"},c.default.createElement("span",null,n||r)))}function Rd(e){var t=e.selectProps;return c.default.createElement(Vn,{data:t.clearText||Qt},c.default.createElement("div",null,c.default.createElement(Au.ClearIndicator,u({},e))))}function Id(e){var t=e.children,n=d(e,["children"]);return c.default.createElement(Au.MenuList,u({},n),c.default.createElement("div",{className:"list-wrapper"},t))}function kd(n){var i,r=n.onChange,o=void 0===r?qt:r,s=n.options,a=n.value,l=n.wrapperClass,f=void 0===l?Qt:l,g=n.isMulti,m=n.label,v=n.disabled,b=n.sortOptions,y=n.error,w=n.placeholder,C=n.info,x=n.isRequired,S=n.redInfo,E=void 0===S?qt:S,A=n.isSingleClearable,R=void 0!==A&&A,k=n.isClearable,$=void 0===k||k,_=n.autoFocus,L=void 0!==_&&_,T=n.groupedOptions,M=void 0!==T&&T,O=n.expandInputOnFocus,N=d(n,["onChange","options","value","wrapperClass","isMulti","label","disabled","sortOptions","error","placeholder","info","isRequired","redInfo","isSingleClearable","isClearable","autoFocus","groupedOptions","expandInputOnFocus"]),B=h(e.useState(null),2),F=B[0],P=B[1],W=e.useMemo((function(){return M?s.reduce((function(e,t){return t.options.forEach((function(t){var n=t.label,i=t.value;return e.push(Xn.formatOption(n,i))})),e}),[]):[]}),[JSON.stringify(s)]);e.useEffect((function(){if(P(b?Xn.insensitiveSort(s,"label"):s),g){if(a){var e=a.filter((function(e){return s.find((function(t){return t.value===e}))}));Xn.isEmpty(e)?o([]):e.length!==a.length&&o(e)}}else a&&!s.find((function(e){return e.value===a}))&&o(Qt)}),[JSON.stringify(s)]);var G,H,D=p(((i={"select-wrapper":!0})[f]=!0,i["select-wrapper-is-multi"]=g,i["has-error"]=y,i["no-label"]=!m,i["expand-input-on-focus"]=O,i));return c.default.createElement(t.FormControl,{variant:"outlined",className:D},c.default.createElement("span",{className:"select-label field-1-label-content"},m,x&&c.default.createElement("span",{className:"required-star"},"*"),!!C&&c.default.createElement(Vn,{data:C},c.default.createElement(I,null))),c.default.createElement(xd,u({},N,{menuPosition:"fixed",isDisabled:v,styles:(G=!!y,H=!!m,{menuPortal:function(e,t){return u(u({},e),{zIndex:9999,top:t.offset===t.rect.top?t.offset+6:t.offset-6})},menu:function(e){return u(u({},e),{boxShadow:"0 0 0 2px var(--main-color)",backgroundColor:"var(--neutral-t4)"})},control:function(e,t){return u(u(u(u({},e),{height:H?48:32,minHeight:H?48:32}),G?{boxShadow:"0 0 0 1px var(--focus-key)"}:{boxShadow:t.isFocused?"0 0 0 1px var(--main-color)":0}),G?{borderColor:"var(--focus-key)","&:hover":{borderColor:"state.isFocused"}}:{borderColor:t.isFocused?"var(--main-color)":"var(--ironhide-t1)","&:hover":{borderColor:t.isFocused?"var(--main-color)":"var(--ironhide-t1)"}})},clearIndicator:function(e,t){var n=t.isDisabled;return u(u({},e),{cursor:"pointer",color:n?"var(--ironhide-key)":"var(--main-color)",":hover":{color:n?"var(--ironhide-key)":"var(--main-color)"}})},indicatorSeparator:function(e,t){return u(u({},e),{backgroundColor:t.isFocused?"var(--main-color)":"var(--ironhide-t1)"})},dropdownIndicator:function(e,t){return u(u({},e),{color:t.isDisabled?"var(--ironhide-key)":"var(--main-color)",":hover":{color:t.isDisabled?"var(--ironhide-key)":"var(--main-color)"},">svg":{transform:t.selectProps.menuIsOpen&&"rotate(180deg)"}})},option:function(e,t){var n=t.isDisabled;return u(u({},e),{color:"var(--text-color)",opacity:n&&".5",backgroundColor:n?"transparent":"var(--neutral-t4)",":hover":{backgroundColor:n?"transparent":"var(--ironhide-t3)"}})}}),autoFocus:L,value:g?a?a.map((function(e){return s.find((function(t){return t.value===e}))})):Qt:M?W.find((function(e){return e.value===a})):s.find((function(e){return e.value===a}))||Qt,options:F,autosize:!0,isMulti:g,isClearable:g&&$||R,onChange:function(e){if(g)o(e.map((function(e){return e.value})));else if(e){var t=e.value;o(t)}else o(Qt)},classNamePrefix:"react-select",dropdownAlign:{offset:[0,0]},components:{Option:Sd,SingleValue:Ed,MultiValue:Ad,ClearIndicator:Rd,MenuList:Id},menuPortalTarget:document.body,closeMenuOnSelect:!g,placeholder:w||"Select..."})),c.default.createElement("span",{className:"select-error capitalize-first-letter"},y||E(a)))}var $d=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],_d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=String(e).toLowerCase(),r=String(n.getOptionValue(t)).toLowerCase(),o=String(n.getOptionLabel(t)).toLowerCase();return r===i||o===i},Ld={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,n,i){return!(!e||t.some((function(t){return _d(e,t,i)}))||n.some((function(t){return _d(e,t,i)})))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}};var Td=e.forwardRef((function(t,n){var i=function(t){var n=t.allowCreateWhileLoading,i=void 0!==n&&n,r=t.createOptionPosition,o=void 0===r?"last":r,s=t.formatCreateLabel,a=void 0===s?Ld.formatCreateLabel:s,l=t.isValidNewOption,c=void 0===l?Ld.isValidNewOption:l,u=t.getNewOptionData,d=void 0===u?Ld.getNewOptionData:u,h=t.onCreateOption,f=t.options,g=void 0===f?[]:f,p=t.onChange,m=ps(t,$d),v=m.getOptionValue,b=void 0===v?sd:v,y=m.getOptionLabel,w=void 0===y?od:y,C=m.inputValue,x=m.isLoading,S=m.isMulti,E=m.value,A=m.name,R=e.useMemo((function(){return c(C,Oc(E),g,{getOptionValue:b,getOptionLabel:w})?d(C,a(C)):void 0}),[a,d,w,b,C,c,g,E]),I=e.useMemo((function(){return!i&&x||!R?g:"first"===o?[R].concat(Es(g)):[].concat(Es(g),[R])}),[i,o,x,R,g]),k=e.useCallback((function(e,t){if("select-option"!==t.action)return p(e,t);var n=Array.isArray(e)?e:[e];if(n[n.length-1]!==R)p(e,t);else if(h)h(C);else{var i=d(C,C),r={action:"create-option",name:A,option:i};p(Yc(S,[].concat(Es(Oc(E)),[i]),i),r)}}),[d,C,S,A,R,h,p,E]);return ds(ds({},m),{},{options:I,onChange:k})}(vs(t));return l.createElement(Cd,bs({ref:n},i))}));function Md(n){var i,r=n.label,o=n.onChange,s=n.value,a=void 0===s?[]:s,l=n.error,f=n.placeholder,g=n.wrapperClass,m=void 0===g?"":g,v=n.tagsValidation,b=void 0===v?function(e){return e}:v,y=n.warning,w=n.isRequired,C=n.info,x=n.invalidTagText,S=n.disabled,E=n.isClearable,A=d(n,["label","onChange","value","error","placeholder","wrapperClass","tagsValidation","warning","isRequired","info","invalidTagText","disabled","isClearable"]),R=h(e.useState(Qt),2),k=R[0],$=R[1],_=h(e.useState(!1),2),L=_[0],T=_[1],M=h(e.useState([]),2),O=M[0],N=M[1];e.useEffect((function(){N(null==a?void 0:a.map(Xn.formatOption))}),[JSON.stringify(a)]),e.useEffect((function(){L&&T(!1)}),[k]);var B=p(((i={})[m]=!0,i["tagsbox-wrapper"]=!0,i["has-error"]=!!l,i));function F(e){e.stopPropagation();var t=Array.from(new Set("".concat(a).concat(en).concat(k).split(en).filter((function(e){return e}))));Xn.isEmpty(b([k]))?T(!0):(o(b(t)),$(Qt))}return c.default.createElement(t.FormControl,{className:B},c.default.createElement("span",{className:"tags-label field-1-label-content"},r,w&&c.default.createElement("span",{className:"required-star"},"*"),!!C&&c.default.createElement(Vn,{data:C},c.default.createElement(I,null))),c.default.createElement(Td,u({components:{DropdownIndicator:null},inputValue:k,isClearable:E,isMulti:!0,isDisabled:S,onChange:function(e){o(e.map((function(e){return e.label})))},onInputChange:$,onKeyDown:function(e){if(new Set([en,"Enter"]).has(e.key)){k&&e.preventDefault();var t=Array.from(new Set("".concat(a).concat(en).concat(k).split(en).filter((function(e){return e}))));Xn.isEmpty(b([k]))?T(!0):(o(b(t)),$(Qt))}},placeholder:f,noOptionsMessage:function(){return null},value:O,formatCreateLabel:function(e){return c.default.createElement("div",{onClick:F,className:"tags-user-input-preview"},"'".concat(e,"'"),L&&c.default.createElement("span",{className:"tags-invalid"}," - ".concat(x||"Invalid value")))},classNamePrefix:"react-tagsbox"},A)),c.default.createElement("span",{className:"tags-box-error capitalize-first-letter"},L||l),a&&!l&&y&&c.default.createElement("span",{className:"tags-warning"},y))}var Od=c.default.forwardRef((function(e,t){var n,i=e.label,r=void 0===i?Qt:i,o=e.onChange,s=e.value,a=void 0===s?Qt:s,l=e.error,f=e.placeholder,g=e.wrapperClass,m=void 0===g?"":g,v=e.tooltip,b=e.Icon,y=e.type,w=e.info,C=e.isRequired,x=e.allowDecimal,S=d(e,["label","onChange","value","error","placeholder","wrapperClass","tooltip","Icon","type","info","isRequired","allowDecimal"]),E=h(Po(!1),2),A=E[0],R=E[1];var k=p(((n={})[m]=!0,n["text-box-field"]=!0,n["has-error"]=!!l,n["no-label"]=!r,n["has-icon"]=!!b,n)),$=p({field__input:!0,"is-type-password":"password"===y});return c.default.createElement(Vn,{data:v},c.default.createElement("div",{className:k},b&&c.default.createElement(b,{className:"text-box-icon"}),c.default.createElement("input",u({onKeyDown:function(e){"number"!==y||"e"!==e.key&&"E"!==e.key&&"-"!==e.key&&"+"!==e.key&&(x||"."!==e.key)||e.preventDefault()},step:"any",autoComplete:"new-password",className:$,placeholder:f,value:null===a?Qt:a,onChange:function(e){Number.isNaN(e.target.valueAsNumber)?o(e.target.value):o(e.target.valueAsNumber>=0?e.target.valueAsNumber:0)},ref:t,type:A&&"password"===y?"text":y},S)),"password"===y&&c.default.createElement("span",{className:"password-icon"},Xn.getPasswordIcon(A,R)),c.default.createElement("span",{className:"field__label-wrap"},c.default.createElement("span",{className:"field__label field-1-label-content"},r,C&&c.default.createElement("span",{className:"required-star"},"*"),!!w&&c.default.createElement(Vn,{data:w},c.default.createElement(I,null)))),c.default.createElement("span",{className:"text-box-error capitalize-first-letter"},l)))}));function Nd(e){var n=e.open,i=e.anchorEl,r=e.onClickAway,o=e.items,s=e.disablePortal,a=e.extraPopperClass,l=void 0===a?Qt:a;return c.default.createElement(t.Popper,{open:n,anchorEl:i,transition:!0,disablePortal:s,className:"popper-wrapper",nonce:void 0,onResize:void 0,onResizeCapture:void 0},(function(e){var n=e.TransitionProps;return c.default.createElement(t.Grow,u({},n,{style:{transformOrigin:"center top"}}),c.default.createElement(t.Paper,{className:p("menu-popper",l)},c.default.createElement(t.ClickAwayListener,{onClickAway:r},c.default.createElement(t.MenuList,{disablePadding:!0},o.map((function(e){return e.hideMenu?null:c.default.createElement(Vn,{key:e.key||e.text,data:(n=e.disabled,i=e.tooltip,void 0===n&&(n=""),void 0===i&&(i=""),Xn.isString(n)&&!Xn.isEmpty(n)?n:Xn.isEmpty(i)?Qt:i)},c.default.createElement("div",{className:"menu-popper-item-wrapper dropdown-lines-1 ".concat(e.extraClass)},c.default.createElement(t.MenuItem,{disabled:!!e.disabled,className:"menu-popper-item",onClick:function(t){t.stopPropagation(),e.onClick(),r()}},e.content||e.text),c.default.createElement(t.Divider,{className:"separator"})));var n,i}))))))}))}Nd.defaultProps={disablePortal:!1},Nd.propTypes={};const Bd=[{id:0,value:"Too weak",minDiversity:0,minLength:0},{id:1,value:"Weak",minDiversity:2,minLength:6},{id:2,value:"Medium",minDiversity:4,minLength:8},{id:3,value:"Strong",minDiversity:4,minLength:10}];var Fd=(e,t=Bd,n="!\"#$%&'()*+,-./:;<=>?@[\\\\\\]^_`{|}~")=>{let i=e||"";t[0].minDiversity=0,t[0].minLength=0;const r=[{regex:"[a-z]",message:"lowercase"},{regex:"[A-Z]",message:"uppercase"},{regex:"[0-9]",message:"number"}];n&&r.push({regex:`[${n}]`,message:"symbol"});let o={};o.contains=r.filter((e=>new RegExp(`${e.regex}`).test(i))).map((e=>e.message)),o.length=i.length;let s=t.filter((e=>o.contains.length>=e.minDiversity)).filter((e=>o.length>=e.minLength)).sort(((e,t)=>t.id-e.id)).map((e=>({id:e.id,value:e.value})));return Object.assign(o,s[0]),o};function Pd(e){var n=e.message,i=e.icon;return c.default.createElement("div",{className:"toast-wrapper"},c.default.createElement("span",null,i),c.default.createElement("span",{className:"label-1"},n),c.default.createElement("div",{className:"copy-btn-div"},c.default.createElement(t.IconButton,{className:"toast-copy",onClick:function(e){e.stopPropagation(),ni(n)}},c.default.createElement(y,null))))}Pd.propTypes={};var Wd={exports:{}},Gd={exports:{}};!function(e,t){function n(e,t,n,i,r,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(i,r)}function i(e){return function(){var t=this,i=arguments;return new Promise((function(r,o){var s=e.apply(t,i);function a(e){n(s,r,o,a,l,"next",e)}function l(e){n(s,r,o,a,l,"throw",e)}a(void 0)}))}}function r(){return(r=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}function s(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var a={init:"init"},l=function(e){var t=e.value;return void 0===t?"":t},c=function(){return t.createElement(t.Fragment,null," ")},u={Cell:l,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function d(){for(var e=arguments.length,t=new Array(e),n=0;n(o="number"==typeof o?o:1/0)){var s=r;r=o,o=s}return e.filter((function(e){return t.some((function(t){var n=e.values[t];return n>=r&&n<=o}))}))};Se.autoRemove=function(e){return!e||"number"!=typeof e[0]&&"number"!=typeof e[1]};var Ee=Object.freeze({__proto__:null,text:ge,exactText:pe,exactTextCase:me,includes:ve,includesAll:be,includesSome:ye,includesValue:we,exact:Ce,equals:xe,between:Se});a.resetFilters="resetFilters",a.setFilter="setFilter",a.setAllFilters="setAllFilters";var Ae=function(e){e.stateReducers.push(Re),e.useInstance.push(Ie)};function Re(e,t,n,i){if(t.type===a.init)return r({filters:[]},e);if(t.type===a.resetFilters)return r({},e,{filters:i.initialState.filters||[]});if(t.type===a.setFilter){var o=t.columnId,s=t.filterValue,l=i.allColumns,c=i.filterTypes,u=l.find((function(e){return e.id===o}));if(!u)throw new Error("React-Table: Could not find a column with id: "+o);var d=T(u.filter,c||{},Ee),h=e.filters.find((function(e){return e.id===o})),f=m(s,h&&h.value);return M(d.autoRemove,f,u)?r({},e,{filters:e.filters.filter((function(e){return e.id!==o}))}):r({},e,h?{filters:e.filters.map((function(e){return e.id===o?{id:o,value:f}:e}))}:{filters:[].concat(e.filters,[{id:o,value:f}])})}if(t.type===a.setAllFilters){var g=t.filters,p=i.allColumns,v=i.filterTypes;return r({},e,{filters:m(g,e.filters).filter((function(e){var t=p.find((function(t){return t.id===e.id}));return!M(T(t.filter,v||{},Ee).autoRemove,e.value,t)}))})}}function Ie(e){var n=e.data,i=e.rows,r=e.flatRows,o=e.rowsById,s=e.allColumns,l=e.filterTypes,c=e.manualFilters,u=e.defaultCanFilter,d=void 0!==u&&u,h=e.disableFilters,f=e.state.filters,g=e.dispatch,p=e.autoResetFilters,m=void 0===p||p,b=t.useCallback((function(e,t){g({type:a.setFilter,columnId:e,filterValue:t})}),[g]),w=t.useCallback((function(e){g({type:a.setAllFilters,filters:e})}),[g]);s.forEach((function(e){var t=e.id,n=e.accessor,i=e.defaultCanFilter,r=e.disableFilters;e.canFilter=n?k(!0!==r&&void 0,!0!==h&&void 0,!0):k(i,d,!1),e.setFilter=function(t){return b(e.id,t)};var o=f.find((function(e){return e.id===t}));e.filterValue=o&&o.value}));var C=t.useMemo((function(){if(c||!f.length)return[i,r,o];var e=[],t={};return[function n(i,r){void 0===r&&(r=0);var o=i;return(o=f.reduce((function(e,t){var n=t.id,i=t.value,o=s.find((function(e){return e.id===n}));if(!o)return e;0===r&&(o.preFilteredRows=e);var a=T(o.filter,l||{},Ee);return a?(o.filteredRows=a(e,[n],i),o.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+o.id+"."),e)}),i)).forEach((function(i){e.push(i),t[i.id]=i,i.subRows&&(i.subRows=i.subRows&&i.subRows.length>0?n(i.subRows,r+1):i.subRows)})),o}(i),e,t]}),[c,f,i,r,o,s,l]),x=C[0],S=C[1],E=C[2];t.useMemo((function(){s.filter((function(e){return!f.find((function(t){return t.id===e.id}))})).forEach((function(e){e.preFilteredRows=x,e.filteredRows=x}))}),[x,f,s]);var A=v(m);y((function(){A()&&g({type:a.resetFilters})}),[g,c?null:n]),Object.assign(e,{preFilteredRows:i,preFilteredFlatRows:r,preFilteredRowsById:o,filteredRows:x,filteredFlatRows:S,filteredRowsById:E,rows:x,flatRows:S,rowsById:E,setFilter:b,setAllFilters:w})}Ae.pluginName="useFilters",a.resetGlobalFilter="resetGlobalFilter",a.setGlobalFilter="setGlobalFilter";var ke=function(e){e.stateReducers.push($e),e.useInstance.push(_e)};function $e(e,t,n,i){if(t.type===a.resetGlobalFilter)return r({},e,{globalFilter:i.initialState.globalFilter||void 0});if(t.type===a.setGlobalFilter){var s=t.filterValue,l=i.userFilterTypes,c=T(i.globalFilter,l||{},Ee),u=m(s,e.globalFilter);return M(c.autoRemove,u)?(e.globalFilter,o(e,["globalFilter"])):r({},e,{globalFilter:u})}}function _e(e){var n=e.data,i=e.rows,r=e.flatRows,o=e.rowsById,s=e.allColumns,l=e.filterTypes,c=e.globalFilter,u=e.manualGlobalFilter,d=e.state.globalFilter,h=e.dispatch,f=e.autoResetGlobalFilter,g=void 0===f||f,p=e.disableGlobalFilter,m=t.useCallback((function(e){h({type:a.setGlobalFilter,filterValue:e})}),[h]),b=t.useMemo((function(){if(u||void 0===d)return[i,r,o];var e=[],t={},n=T(c,l||{},Ee);if(!n)return console.warn("Could not find a valid 'globalFilter' option."),i;s.forEach((function(e){var t=e.disableGlobalFilter;e.canFilter=k(!0!==t&&void 0,!0!==p&&void 0,!0)}));var a=s.filter((function(e){return!0===e.canFilter}));return[function i(r){return(r=n(r,a.map((function(e){return e.id})),d)).forEach((function(n){e.push(n),t[n.id]=n,n.subRows=n.subRows&&n.subRows.length?i(n.subRows):n.subRows})),r}(i),e,t]}),[u,d,c,l,s,i,r,o,p]),w=b[0],C=b[1],x=b[2],S=v(g);y((function(){S()&&h({type:a.resetGlobalFilter})}),[h,u?null:n]),Object.assign(e,{preGlobalFilteredRows:i,preGlobalFilteredFlatRows:r,preGlobalFilteredRowsById:o,globalFilteredRows:w,globalFilteredFlatRows:C,globalFilteredRowsById:x,rows:w,flatRows:C,rowsById:x,setGlobalFilter:m,disableGlobalFilter:p})}function Le(e,t){return t.reduce((function(e,t){return e+("number"==typeof t?t:0)}),0)}ke.pluginName="useGlobalFilter";var Te=Object.freeze({__proto__:null,sum:Le,min:function(e){var t=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.min(t,e))})),t},max:function(e){var t=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.max(t,e))})),t},minMax:function(e){var t=e[0]||0,n=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.min(t,e),n=Math.max(n,e))})),t+".."+n},average:function(e){return Le(0,e)/e.length},median:function(e){if(!e.length)return null;var t=Math.floor(e.length/2),n=[].concat(e).sort((function(e,t){return e-t}));return e.length%2!=0?n[t]:(n[t-1]+n[t])/2},unique:function(e){return Array.from(new Set(e).values())},uniqueCount:function(e){return new Set(e).size},count:function(e){return e.length}}),Me=[],Oe={};a.resetGroupBy="resetGroupBy",a.setGroupBy="setGroupBy",a.toggleGroupBy="toggleGroupBy";var Ne=function(e){e.getGroupByToggleProps=[Be],e.stateReducers.push(Fe),e.visibleColumnsDeps.push((function(e,t){var n=t.instance;return[].concat(e,[n.state.groupBy])})),e.visibleColumns.push(Pe),e.useInstance.push(Ge),e.prepareRow.push(He)};Ne.pluginName="useGroupBy";var Be=function(e,t){var n=t.header;return[e,{onClick:n.canGroupBy?function(e){e.persist(),n.toggleGroupBy()}:void 0,style:{cursor:n.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function Fe(e,t,n,i){if(t.type===a.init)return r({groupBy:[]},e);if(t.type===a.resetGroupBy)return r({},e,{groupBy:i.initialState.groupBy||[]});if(t.type===a.setGroupBy)return r({},e,{groupBy:t.value});if(t.type===a.toggleGroupBy){var o=t.columnId,s=t.value,l=void 0!==s?s:!e.groupBy.includes(o);return r({},e,l?{groupBy:[].concat(e.groupBy,[o])}:{groupBy:e.groupBy.filter((function(e){return e!==o}))})}}function Pe(e,t){var n=t.instance.state.groupBy,i=n.map((function(t){return e.find((function(e){return e.id===t}))})).filter(Boolean),r=e.filter((function(e){return!n.includes(e.id)}));return(e=[].concat(i,r)).forEach((function(e){e.isGrouped=n.includes(e.id),e.groupedIndex=n.indexOf(e.id)})),e}var We={};function Ge(e){var n=e.data,i=e.rows,o=e.flatRows,s=e.rowsById,l=e.allColumns,c=e.flatHeaders,u=e.groupByFn,d=void 0===u?De:u,f=e.manualGroupBy,g=e.aggregations,m=void 0===g?We:g,b=e.plugins,w=e.state.groupBy,C=e.dispatch,x=e.autoResetGroupBy,S=void 0===x||x,E=e.disableGroupBy,A=e.defaultCanGroupBy,R=e.getHooks;p(b,["useColumnOrder","useFilters"],"useGroupBy");var I=v(e);l.forEach((function(t){var n=t.accessor,i=t.defaultGroupBy,r=t.disableGroupBy;t.canGroupBy=n?k(t.canGroupBy,!0!==r&&void 0,!0!==E&&void 0,!0):k(t.canGroupBy,i,A,!1),t.canGroupBy&&(t.toggleGroupBy=function(){return e.toggleGroupBy(t.id)}),t.Aggregated=t.Aggregated||t.Cell}));var $=t.useCallback((function(e,t){C({type:a.toggleGroupBy,columnId:e,value:t})}),[C]),L=t.useCallback((function(e){C({type:a.setGroupBy,value:e})}),[C]);c.forEach((function(e){e.getGroupByToggleProps=h(R().getGroupByToggleProps,{instance:I(),header:e})}));var T=t.useMemo((function(){if(f||!w.length)return[i,o,s,Me,Oe,o,s];var e=w.filter((function(e){return l.find((function(t){return t.id===e}))})),t=[],n={},a=[],c={},u=[],h={},g=function i(o,s,f){if(void 0===s&&(s=0),s===e.length)return o.map((function(e){return r({},e,{depth:s})}));var g=e[s],p=d(o,g);return Object.entries(p).map((function(r,o){var d=r[0],p=r[1],v=g+":"+d,b=i(p,s+1,v=f?f+">"+v:v),y=s?_(p,"leafRows"):p,w=function(t,n,i){var r={};return l.forEach((function(o){if(e.includes(o.id))r[o.id]=n[0]?n[0].values[o.id]:null;else{var s="function"==typeof o.aggregate?o.aggregate:m[o.aggregate]||Te[o.aggregate];if(s){var a=n.map((function(e){return e.values[o.id]})),l=t.map((function(e){var t=e.values[o.id];if(!i&&o.aggregateValue){var n="function"==typeof o.aggregateValue?o.aggregateValue:m[o.aggregateValue]||Te[o.aggregateValue];if(!n)throw console.info({column:o}),new Error("React Table: Invalid column.aggregateValue option for column listed above");t=n(t,e,o)}return t}));r[o.id]=s(l,a)}else{if(o.aggregate)throw console.info({column:o}),new Error("React Table: Invalid column.aggregate option for column listed above");r[o.id]=null}}})),r}(y,p,s),C={id:v,isGrouped:!0,groupByID:g,groupByVal:d,values:w,subRows:b,leafRows:y,depth:s,index:o};return b.forEach((function(e){t.push(e),n[e.id]=e,e.isGrouped?(a.push(e),c[e.id]=e):(u.push(e),h[e.id]=e)})),C}))}(i);return g.forEach((function(e){t.push(e),n[e.id]=e,e.isGrouped?(a.push(e),c[e.id]=e):(u.push(e),h[e.id]=e)})),[g,t,n,a,c,u,h]}),[f,w,i,o,s,l,m,d]),M=T[0],O=T[1],N=T[2],B=T[3],F=T[4],P=T[5],W=T[6],G=v(S);y((function(){G()&&C({type:a.resetGroupBy})}),[C,f?null:n]),Object.assign(e,{preGroupedRows:i,preGroupedFlatRow:o,preGroupedRowsById:s,groupedRows:M,groupedFlatRows:O,groupedRowsById:N,onlyGroupedFlatRows:B,onlyGroupedRowsById:F,nonGroupedFlatRows:P,nonGroupedRowsById:W,rows:M,flatRows:O,rowsById:N,toggleGroupBy:$,setGroupBy:L})}function He(e){e.allCells.forEach((function(t){var n;t.isGrouped=t.column.isGrouped&&t.column.id===e.groupByID,t.isPlaceholder=!t.isGrouped&&t.column.isGrouped,t.isAggregated=!t.isGrouped&&!t.isPlaceholder&&(null==(n=e.subRows)?void 0:n.length)}))}function De(e,t){return e.reduce((function(e,n,i){var r=""+n.values[t];return e[r]=Array.isArray(e[r])?e[r]:[],e[r].push(n),e}),{})}var Ve=/([0-9]+)/gm;function ze(e,t){return e===t?0:e>t?1:-1}function je(e,t,n){return[e.values[n],t.values[n]]}function Ze(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}var Xe=Object.freeze({__proto__:null,alphanumeric:function(e,t,n){var i=je(e,t,n),r=i[0],o=i[1];for(r=Ze(r),o=Ze(o),r=r.split(Ve).filter(Boolean),o=o.split(Ve).filter(Boolean);r.length&&o.length;){var s=r.shift(),a=o.shift(),l=parseInt(s,10),c=parseInt(a,10),u=[l,c].sort();if(isNaN(u[0])){if(s>a)return 1;if(a>s)return-1}else{if(isNaN(u[1]))return isNaN(l)?-1:1;if(l>c)return 1;if(c>l)return-1}}return r.length-o.length},datetime:function(e,t,n){var i=je(e,t,n),r=i[0],o=i[1];return ze(r=r.getTime(),o=o.getTime())},basic:function(e,t,n){var i=je(e,t,n);return ze(i[0],i[1])},string:function(e,t,n){var i=je(e,t,n),r=i[0],o=i[1];for(r=r.split("").filter(Boolean),o=o.split("").filter(Boolean);r.length&&o.length;){var s=r.shift(),a=o.shift(),l=s.toLowerCase(),c=a.toLowerCase();if(l>c)return 1;if(c>l)return-1;if(s>a)return 1;if(a>s)return-1}return r.length-o.length},number:function(e,t,n){var i=je(e,t,n),r=i[0],o=i[1],s=/[^0-9.]/gi;return ze(r=Number(String(r).replace(s,"")),o=Number(String(o).replace(s,"")))}});a.resetSortBy="resetSortBy",a.setSortBy="setSortBy",a.toggleSortBy="toggleSortBy",a.clearSortBy="clearSortBy",u.sortType="alphanumeric",u.sortDescFirst=!1;var Ue=function(e){e.getSortByToggleProps=[Ye],e.stateReducers.push(Je),e.useInstance.push(Ke)};Ue.pluginName="useSortBy";var Ye=function(e,t){var n=t.instance,i=t.column,r=n.isMultiSortEvent,o=void 0===r?function(e){return e.shiftKey}:r;return[e,{onClick:i.canSort?function(e){e.persist(),i.toggleSortBy(void 0,!n.disableMultiSort&&o(e))}:void 0,style:{cursor:i.canSort?"pointer":void 0},title:i.canSort?"Toggle SortBy":void 0}]};function Je(e,t,n,i){if(t.type===a.init)return r({sortBy:[]},e);if(t.type===a.resetSortBy)return r({},e,{sortBy:i.initialState.sortBy||[]});if(t.type===a.clearSortBy)return r({},e,{sortBy:e.sortBy.filter((function(e){return e.id!==t.columnId}))});if(t.type===a.setSortBy)return r({},e,{sortBy:t.sortBy});if(t.type===a.toggleSortBy){var o,s=t.columnId,l=t.desc,c=t.multi,u=i.allColumns,d=i.disableMultiSort,h=i.disableSortRemove,f=i.disableMultiRemove,g=i.maxMultiSortColCount,p=void 0===g?Number.MAX_SAFE_INTEGER:g,m=e.sortBy,v=u.find((function(e){return e.id===s})).sortDescFirst,b=m.find((function(e){return e.id===s})),y=m.findIndex((function(e){return e.id===s})),w=null!=l,C=[];return"toggle"!=(o=!d&&c?b?"toggle":"add":y!==m.length-1||1!==m.length?"replace":b?"toggle":"replace")||h||w||c&&f||!(b&&b.desc&&!v||!b.desc&&v)||(o="remove"),"replace"===o?C=[{id:s,desc:w?l:v}]:"add"===o?(C=[].concat(m,[{id:s,desc:w?l:v}])).splice(0,C.length-p):"toggle"===o?C=m.map((function(e){return e.id===s?r({},e,{desc:w?l:!b.desc}):e})):"remove"===o&&(C=m.filter((function(e){return e.id!==s}))),r({},e,{sortBy:C})}}function Ke(e){var n=e.data,i=e.rows,r=e.flatRows,o=e.allColumns,s=e.orderByFn,l=void 0===s?Qe:s,c=e.sortTypes,u=e.manualSortBy,d=e.defaultCanSort,f=e.disableSortBy,g=e.flatHeaders,m=e.state.sortBy,b=e.dispatch,w=e.plugins,C=e.getHooks,x=e.autoResetSortBy,S=void 0===x||x;p(w,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var E=t.useCallback((function(e){b({type:a.setSortBy,sortBy:e})}),[b]),A=t.useCallback((function(e,t,n){b({type:a.toggleSortBy,columnId:e,desc:t,multi:n})}),[b]),R=v(e);g.forEach((function(e){var t=e.accessor,n=e.canSort,i=e.disableSortBy,r=e.id,o=t?k(!0!==i&&void 0,!0!==f&&void 0,!0):k(d,n,!1);e.canSort=o,e.canSort&&(e.toggleSortBy=function(t,n){return A(e.id,t,n)},e.clearSortBy=function(){b({type:a.clearSortBy,columnId:e.id})}),e.getSortByToggleProps=h(C().getSortByToggleProps,{instance:R(),column:e});var s=m.find((function(e){return e.id===r}));e.isSorted=!!s,e.sortedIndex=m.findIndex((function(e){return e.id===r})),e.isSortedDesc=e.isSorted?s.desc:void 0}));var I=t.useMemo((function(){if(u||!m.length)return[i,r];var e=[],t=m.filter((function(e){return o.find((function(t){return t.id===e.id}))}));return[function n(i){var r=l(i,t.map((function(e){var t=o.find((function(t){return t.id===e.id}));if(!t)throw new Error("React-Table: Could not find a column with id: "+e.id+" while sorting");var n=t.sortType,i=$(n)||(c||{})[n]||Xe[n];if(!i)throw new Error("React-Table: Could not find a valid sortType of '"+n+"' for column '"+e.id+"'.");return function(t,n){return i(t,n,e.id,e.desc)}})),t.map((function(e){var t=o.find((function(t){return t.id===e.id}));return t&&t.sortInverted?e.desc:!e.desc})));return r.forEach((function(t){e.push(t),t.subRows&&0!==t.subRows.length&&(t.subRows=n(t.subRows))})),r}(i),e]}),[u,m,i,r,o,l,c]),_=I[0],L=I[1],T=v(S);y((function(){T()&&b({type:a.resetSortBy})}),[u?null:n]),Object.assign(e,{preSortedRows:i,preSortedFlatRows:r,sortedRows:_,sortedFlatRows:L,rows:_,flatRows:L,setSortBy:E,toggleSortBy:A})}function Qe(e,t,n){return[].concat(e).sort((function(e,i){for(var r=0;re.pageIndex?c=-1===o?s.length>=e.pageSize:l-1),c?r({},e,{pageIndex:l}):e}if(t.type===a.setPageSize){var u=t.pageSize,d=e.pageSize*e.pageIndex;return r({},e,{pageIndex:Math.floor(d/u),pageSize:u})}}function tt(e){var n=e.rows,i=e.autoResetPage,r=void 0===i||i,o=e.manualExpandedKey,s=void 0===o?"expanded":o,l=e.plugins,c=e.pageCount,u=e.paginateExpandedRows,d=void 0===u||u,h=e.expandSubRows,f=void 0===h||h,g=e.state,m=g.pageSize,b=g.pageIndex,w=g.expanded,C=g.globalFilter,x=g.filters,S=g.groupBy,E=g.sortBy,A=e.dispatch,R=e.data,I=e.manualPagination;p(l,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var k=v(r);y((function(){k()&&A({type:a.resetPage})}),[A,I?null:R,C,x,S,E]);var $=I?c:Math.ceil(n.length/m),_=t.useMemo((function(){return $>0?[].concat(new Array($)).fill(null).map((function(e,t){return t})):[]}),[$]),T=t.useMemo((function(){var e;if(I)e=n;else{var t=m*b,i=t+m;e=n.slice(t,i)}return d?e:L(e,{manualExpandedKey:s,expanded:w,expandSubRows:f})}),[f,w,s,I,b,m,d,n]),M=b>0,O=-1===$?T.length>=m:b<$-1,N=t.useCallback((function(e){A({type:a.gotoPage,pageIndex:e})}),[A]),B=t.useCallback((function(){return N((function(e){return e-1}))}),[N]),F=t.useCallback((function(){return N((function(e){return e+1}))}),[N]),P=t.useCallback((function(e){A({type:a.setPageSize,pageSize:e})}),[A]);Object.assign(e,{pageOptions:_,pageCount:$,page:T,canPreviousPage:M,canNextPage:O,gotoPage:N,previousPage:B,nextPage:F,setPageSize:P})}qe.pluginName="usePagination",a.resetPivot="resetPivot",a.togglePivot="togglePivot";var nt=function(e){e.getPivotToggleProps=[rt],e.stateReducers.push(ot),e.useInstanceAfterData.push(st),e.allColumns.push(at),e.accessValue.push(lt),e.materializedColumns.push(ct),e.materializedColumnsDeps.push(ut),e.visibleColumns.push(dt),e.visibleColumnsDeps.push(ht),e.useInstance.push(ft),e.prepareRow.push(gt)};nt.pluginName="usePivotColumns";var it=[],rt=function(e,t){var n=t.header;return[e,{onClick:n.canPivot?function(e){e.persist(),n.togglePivot()}:void 0,style:{cursor:n.canPivot?"pointer":void 0},title:"Toggle Pivot"}]};function ot(e,t,n,i){if(t.type===a.init)return r({pivotColumns:it},e);if(t.type===a.resetPivot)return r({},e,{pivotColumns:i.initialState.pivotColumns||it});if(t.type===a.togglePivot){var o=t.columnId,s=t.value,l=void 0!==s?s:!e.pivotColumns.includes(o);return r({},e,l?{pivotColumns:[].concat(e.pivotColumns,[o])}:{pivotColumns:e.pivotColumns.filter((function(e){return e!==o}))})}}function st(e){e.allColumns.forEach((function(t){t.isPivotSource=e.state.pivotColumns.includes(t.id)}))}function at(e,t){var n=t.instance;return e.forEach((function(e){e.isPivotSource=n.state.pivotColumns.includes(e.id),e.uniqueValues=new Set})),e}function lt(e,t){var n=t.column;return n.uniqueValues&&void 0!==e&&n.uniqueValues.add(e),e}function ct(e,t){var n=t.instance,i=n.allColumns,o=n.state;if(!o.pivotColumns.length||!o.groupBy||!o.groupBy.length)return e;var s=o.pivotColumns.map((function(e){return i.find((function(t){return t.id===e}))})).filter(Boolean),a=i.filter((function(e){return!e.isPivotSource&&!o.groupBy.includes(e.id)&&!o.pivotColumns.includes(e.id)})),l=S(function e(t,n,i){void 0===t&&(t=0),void 0===i&&(i=[]);var o=s[t];return o?Array.from(o.uniqueValues).sort().map((function(s){var a=r({},o,{Header:o.PivotHeader||"string"==typeof o.header?o.Header+": "+s:s,isPivotGroup:!0,parent:n,depth:t,id:n?n.id+"."+o.id+"."+s:o.id+"."+s,pivotValue:s});return a.columns=e(t+1,a,[].concat(i,[function(e){return e.values[o.id]===s}])),a})):a.map((function(e){return r({},e,{canPivot:!1,isPivoted:!0,parent:n,depth:t,id:""+(n?n.id+"."+e.id:e.id),accessor:function(t,n,r){if(i.every((function(e){return e(r)})))return r.values[e.id]}})}))}());return[].concat(e,l)}function ut(e,t){var n=t.instance.state,i=n.pivotColumns,r=n.groupBy;return[].concat(e,[i,r])}function dt(e,t){var n=t.instance.state;return e=e.filter((function(e){return!e.isPivotSource})),n.pivotColumns.length&&n.groupBy&&n.groupBy.length&&(e=e.filter((function(e){return e.isGrouped||e.isPivoted}))),e}function ht(e,t){var n=t.instance;return[].concat(e,[n.state.pivotColumns,n.state.groupBy])}function ft(e){var t=e.columns,n=e.allColumns,i=e.flatHeaders,r=e.getHooks,o=e.plugins,s=e.dispatch,l=e.autoResetPivot,c=void 0===l||l,u=e.manaulPivot,d=e.disablePivot,f=e.defaultCanPivot;p(o,["useGroupBy"],"usePivotColumns");var g=v(e);n.forEach((function(t){var n=t.accessor,i=t.defaultPivot,r=t.disablePivot;t.canPivot=n?k(t.canPivot,!0!==r&&void 0,!0!==d&&void 0,!0):k(t.canPivot,i,f,!1),t.canPivot&&(t.togglePivot=function(){return e.togglePivot(t.id)}),t.Aggregated=t.Aggregated||t.Cell})),i.forEach((function(e){e.getPivotToggleProps=h(r().getPivotToggleProps,{instance:g(),header:e})}));var m=v(c);y((function(){m()&&s({type:a.resetPivot})}),[s,u?null:t]),Object.assign(e,{togglePivot:function(e,t){s({type:a.togglePivot,columnId:e,value:t})}})}function gt(e){e.allCells.forEach((function(e){e.isPivoted=e.column.isPivoted}))}a.resetSelectedRows="resetSelectedRows",a.toggleAllRowsSelected="toggleAllRowsSelected",a.toggleRowSelected="toggleRowSelected",a.toggleAllPageRowsSelected="toggleAllPageRowsSelected";var pt=function(e){e.getToggleRowSelectedProps=[mt],e.getToggleAllRowsSelectedProps=[vt],e.getToggleAllPageRowsSelectedProps=[bt],e.stateReducers.push(yt),e.useInstance.push(wt),e.prepareRow.push(Ct)};pt.pluginName="useRowSelect";var mt=function(e,t){var n=t.instance,i=t.row,r=n.manualRowSelectedKey,o=void 0===r?"isSelected":r;return[e,{onChange:function(e){i.toggleRowSelected(e.target.checked)},style:{cursor:"pointer"},checked:!(!i.original||!i.original[o])||i.isSelected,title:"Toggle Row Selected",indeterminate:i.isSomeSelected}]},vt=function(e,t){var n=t.instance;return[e,{onChange:function(e){n.toggleAllRowsSelected(e.target.checked)},style:{cursor:"pointer"},checked:n.isAllRowsSelected,title:"Toggle All Rows Selected",indeterminate:Boolean(!n.isAllRowsSelected&&Object.keys(n.state.selectedRowIds).length)}]},bt=function(e,t){var n=t.instance;return[e,{onChange:function(e){n.toggleAllPageRowsSelected(e.target.checked)},style:{cursor:"pointer"},checked:n.isAllPageRowsSelected,title:"Toggle All Current Page Rows Selected",indeterminate:Boolean(!n.isAllPageRowsSelected&&n.page.some((function(e){var t=e.id;return n.state.selectedRowIds[t]})))}]};function yt(e,t,n,i){if(t.type===a.init)return r({selectedRowIds:{}},e);if(t.type===a.resetSelectedRows)return r({},e,{selectedRowIds:i.initialState.selectedRowIds||{}});if(t.type===a.toggleAllRowsSelected){var o=t.value,s=i.isAllRowsSelected,l=i.rowsById,c=i.nonGroupedRowsById,u=void 0===c?l:c,d=void 0!==o?o:!s,h=Object.assign({},e.selectedRowIds);return d?Object.keys(u).forEach((function(e){h[e]=!0})):Object.keys(u).forEach((function(e){delete h[e]})),r({},e,{selectedRowIds:h})}if(t.type===a.toggleRowSelected){var f=t.id,g=t.value,p=i.rowsById,m=i.selectSubRows,v=void 0===m||m,b=i.getSubRows,y=e.selectedRowIds[f],w=void 0!==g?g:!y;if(y===w)return e;var C=r({},e.selectedRowIds);return function e(t){var n=p[t];if(n&&(n.isGrouped||(w?C[t]=!0:delete C[t]),v&&b(n)))return b(n).forEach((function(t){return e(t.id)}))}(f),r({},e,{selectedRowIds:C})}if(t.type===a.toggleAllPageRowsSelected){var x=t.value,S=i.page,E=i.rowsById,A=i.selectSubRows,R=void 0===A||A,I=i.isAllPageRowsSelected,k=i.getSubRows,$=void 0!==x?x:!I,_=r({},e.selectedRowIds);return S.forEach((function(e){return function e(t){var n=E[t];if(n.isGrouped||($?_[t]=!0:delete _[t]),R&&k(n))return k(n).forEach((function(t){return e(t.id)}))}(e.id)})),r({},e,{selectedRowIds:_})}return e}function wt(e){var n=e.data,i=e.rows,r=e.getHooks,o=e.plugins,s=e.rowsById,l=e.nonGroupedRowsById,c=void 0===l?s:l,u=e.autoResetSelectedRows,d=void 0===u||u,f=e.state.selectedRowIds,g=e.selectSubRows,m=void 0===g||g,b=e.dispatch,w=e.page,C=e.getSubRows;p(o,["useFilters","useGroupBy","useSortBy","useExpanded","usePagination"],"useRowSelect");var x=t.useMemo((function(){var e=[];return i.forEach((function(t){var n=m?function e(t,n,i){if(n[t.id])return!0;var r=i(t);if(r&&r.length){var o=!0,s=!1;return r.forEach((function(t){s&&!o||(e(t,n,i)?s=!0:o=!1)})),!!o||!!s&&null}return!1}(t,f,C):!!f[t.id];t.isSelected=!!n,t.isSomeSelected=null===n,n&&e.push(t)})),e}),[i,m,f,C]),S=Boolean(Object.keys(c).length&&Object.keys(f).length),E=S;S&&Object.keys(c).some((function(e){return!f[e]}))&&(S=!1),S||w&&w.length&&w.some((function(e){var t=e.id;return!f[t]}))&&(E=!1);var A=v(d);y((function(){A()&&b({type:a.resetSelectedRows})}),[b,n]);var R=t.useCallback((function(e){return b({type:a.toggleAllRowsSelected,value:e})}),[b]),I=t.useCallback((function(e){return b({type:a.toggleAllPageRowsSelected,value:e})}),[b]),k=t.useCallback((function(e,t){return b({type:a.toggleRowSelected,id:e,value:t})}),[b]),$=v(e),_=h(r().getToggleAllRowsSelectedProps,{instance:$()}),L=h(r().getToggleAllPageRowsSelectedProps,{instance:$()});Object.assign(e,{selectedFlatRows:x,isAllRowsSelected:S,isAllPageRowsSelected:E,toggleRowSelected:k,toggleAllRowsSelected:R,getToggleAllRowsSelectedProps:_,getToggleAllPageRowsSelectedProps:L,toggleAllPageRowsSelected:I})}function Ct(e,t){var n=t.instance;e.toggleRowSelected=function(t){return n.toggleRowSelected(e.id,t)},e.getToggleRowSelectedProps=h(n.getHooks().getToggleRowSelectedProps,{instance:n,row:e})}var xt=function(e){return{}},St=function(e){return{}};a.setRowState="setRowState",a.setCellState="setCellState",a.resetRowState="resetRowState";var Et=function(e){e.stateReducers.push(At),e.useInstance.push(Rt),e.prepareRow.push(It)};function At(e,t,n,i){var o=i.initialRowStateAccessor,s=void 0===o?xt:o,l=i.initialCellStateAccessor,c=void 0===l?St:l,u=i.rowsById;if(t.type===a.init)return r({rowState:{}},e);if(t.type===a.resetRowState)return r({},e,{rowState:i.initialState.rowState||{}});if(t.type===a.setRowState){var d,h=t.rowId,f=t.value,g=void 0!==e.rowState[h]?e.rowState[h]:s(u[h]);return r({},e,{rowState:r({},e.rowState,(d={},d[h]=m(f,g),d))})}if(t.type===a.setCellState){var p,v,b,y,w,C=t.rowId,x=t.columnId,S=t.value,E=void 0!==e.rowState[C]?e.rowState[C]:s(u[C]),A=void 0!==(null==E||null==(p=E.cellState)?void 0:p[x])?E.cellState[x]:c(null==(v=u[C])||null==(b=v.cells)?void 0:b.find((function(e){return e.column.id===x})));return r({},e,{rowState:r({},e.rowState,(w={},w[C]=r({},E,{cellState:r({},E.cellState||{},(y={},y[x]=m(S,A),y))}),w))})}}function Rt(e){var n=e.autoResetRowState,i=void 0===n||n,r=e.data,o=e.dispatch,s=t.useCallback((function(e,t){return o({type:a.setRowState,rowId:e,value:t})}),[o]),l=t.useCallback((function(e,t,n){return o({type:a.setCellState,rowId:e,columnId:t,value:n})}),[o]),c=v(i);y((function(){c()&&o({type:a.resetRowState})}),[r]),Object.assign(e,{setRowState:s,setCellState:l})}function It(e,t){var n=t.instance,i=n.initialRowStateAccessor,r=void 0===i?xt:i,o=n.initialCellStateAccessor,s=void 0===o?St:o,a=n.state.rowState;e&&(e.state=void 0!==a[e.id]?a[e.id]:r(e),e.setState=function(t){return n.setRowState(e.id,t)},e.cells.forEach((function(t){e.state.cellState||(e.state.cellState={}),t.state=void 0!==e.state.cellState[t.column.id]?e.state.cellState[t.column.id]:s(t),t.setState=function(i){return n.setCellState(e.id,t.column.id,i)}})))}Et.pluginName="useRowState",a.resetColumnOrder="resetColumnOrder",a.setColumnOrder="setColumnOrder";var kt=function(e){e.stateReducers.push($t),e.visibleColumnsDeps.push((function(e,t){var n=t.instance;return[].concat(e,[n.state.columnOrder])})),e.visibleColumns.push(_t),e.useInstance.push(Lt)};function $t(e,t,n,i){return t.type===a.init?r({columnOrder:[]},e):t.type===a.resetColumnOrder?r({},e,{columnOrder:i.initialState.columnOrder||[]}):t.type===a.setColumnOrder?r({},e,{columnOrder:m(t.columnOrder,e.columnOrder)}):void 0}function _t(e,t){var n=t.instance.state.columnOrder;if(!n||!n.length)return e;for(var i=[].concat(n),r=[].concat(e),o=[],s=function(){var e=i.shift(),t=r.findIndex((function(t){return t.id===e}));t>-1&&o.push(r.splice(t,1)[0])};r.length&&i.length;)s();return[].concat(o,r)}function Lt(e){var n=e.dispatch;e.setColumnOrder=t.useCallback((function(e){return n({type:a.setColumnOrder,columnOrder:e})}),[n])}kt.pluginName="useColumnOrder",u.canResize=!0,a.columnStartResizing="columnStartResizing",a.columnResizing="columnResizing",a.columnDoneResizing="columnDoneResizing",a.resetResize="resetResize";var Tt=function(e){e.getResizerProps=[Mt],e.getHeaderProps.push({style:{position:"relative"}}),e.stateReducers.push(Ot),e.useInstance.push(Bt),e.useInstanceBeforeDimensions.push(Nt)},Mt=function(e,t){var n=t.instance,i=t.header,r=n.dispatch,o=function(e,t){var n=!1;if("touchstart"===e.type){if(e.touches&&e.touches.length>1)return;n=!0}var i,o,s=function(e){var t=[];return function e(n){n.columns&&n.columns.length&&n.columns.map(e),t.push(n)}(e),t}(t).map((function(e){return[e.id,e.totalWidth]})),l=n?Math.round(e.touches[0].clientX):e.clientX,c=function(){window.cancelAnimationFrame(i),i=null,r({type:a.columnDoneResizing})},u=function(){window.cancelAnimationFrame(i),i=null,r({type:a.columnResizing,clientX:o})},d=function(e){o=e,i||(i=window.requestAnimationFrame(u))},h={mouse:{moveEvent:"mousemove",moveHandler:function(e){return d(e.clientX)},upEvent:"mouseup",upHandler:function(e){document.removeEventListener("mousemove",h.mouse.moveHandler),document.removeEventListener("mouseup",h.mouse.upHandler),c()}},touch:{moveEvent:"touchmove",moveHandler:function(e){return e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(e){document.removeEventListener(h.touch.moveEvent,h.touch.moveHandler),document.removeEventListener(h.touch.upEvent,h.touch.moveHandler),c()}}},f=n?h.touch:h.mouse,g=!!function(){if("boolean"==typeof N)return N;var e=!1;try{var t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){e=!1}return N=e}()&&{passive:!1};document.addEventListener(f.moveEvent,f.moveHandler,g),document.addEventListener(f.upEvent,f.upHandler,g),r({type:a.columnStartResizing,columnId:t.id,columnWidth:t.totalWidth,headerIdWidths:s,clientX:l})};return[e,{onMouseDown:function(e){return e.persist()||o(e,i)},onTouchStart:function(e){return e.persist()||o(e,i)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function Ot(e,t){if(t.type===a.init)return r({columnResizing:{columnWidths:{}}},e);if(t.type===a.resetResize)return r({},e,{columnResizing:{columnWidths:{}}});if(t.type===a.columnStartResizing){var n=t.clientX,i=t.columnId,o=t.columnWidth,s=t.headerIdWidths;return r({},e,{columnResizing:r({},e.columnResizing,{startX:n,headerIdWidths:s,columnWidth:o,isResizingColumn:i})})}if(t.type===a.columnResizing){var l=t.clientX,c=e.columnResizing,u=c.startX,d=c.columnWidth,h=c.headerIdWidths,f=(l-u)/d,g={};return(void 0===h?[]:h).forEach((function(e){var t=e[0],n=e[1];g[t]=Math.max(n+n*f,0)})),r({},e,{columnResizing:r({},e.columnResizing,{columnWidths:r({},e.columnResizing.columnWidths,{},g)})})}return t.type===a.columnDoneResizing?r({},e,{columnResizing:r({},e.columnResizing,{startX:null,isResizingColumn:null})}):void 0}Tt.pluginName="useResizeColumns";var Nt=function(e){var t=e.flatHeaders,n=e.disableResizing,i=e.getHooks,r=e.state.columnResizing,o=v(e);t.forEach((function(e){var t=k(!0!==e.disableResizing&&void 0,!0!==n&&void 0,!0);e.canResize=t,e.width=r.columnWidths[e.id]||e.originalWidth||e.width,e.isResizing=r.isResizingColumn===e.id,t&&(e.getResizerProps=h(i().getResizerProps,{instance:o(),header:e}))}))};function Bt(e){var n=e.plugins,i=e.dispatch,r=e.autoResetResize,o=void 0===r||r,s=e.columns;p(n,["useAbsoluteLayout"],"useResizeColumns");var l=v(o);y((function(){l()&&i({type:a.resetResize})}),[s]);var c=t.useCallback((function(){return i({type:a.resetResize})}),[i]);Object.assign(e,{resetResizing:c})}var Ft={position:"absolute",top:0},Pt=function(e){e.getTableBodyProps.push(Wt),e.getRowProps.push(Wt),e.getHeaderGroupProps.push(Wt),e.getFooterGroupProps.push(Wt),e.getHeaderProps.push((function(e,t){var n=t.column;return[e,{style:r({},Ft,{left:n.totalLeft+"px",width:n.totalWidth+"px"})}]})),e.getCellProps.push((function(e,t){var n=t.cell;return[e,{style:r({},Ft,{left:n.column.totalLeft+"px",width:n.column.totalWidth+"px"})}]})),e.getFooterProps.push((function(e,t){var n=t.column;return[e,{style:r({},Ft,{left:n.totalLeft+"px",width:n.totalWidth+"px"})}]}))};Pt.pluginName="useAbsoluteLayout";var Wt=function(e,t){return[e,{style:{position:"relative",width:t.instance.totalColumnsWidth+"px"}}]},Gt={display:"inline-block",boxSizing:"border-box"},Ht=function(e,t){return[e,{style:{display:"flex",width:t.instance.totalColumnsWidth+"px"}}]},Dt=function(e){e.getRowProps.push(Ht),e.getHeaderGroupProps.push(Ht),e.getFooterGroupProps.push(Ht),e.getHeaderProps.push((function(e,t){var n=t.column;return[e,{style:r({},Gt,{width:n.totalWidth+"px"})}]})),e.getCellProps.push((function(e,t){var n=t.cell;return[e,{style:r({},Gt,{width:n.column.totalWidth+"px"})}]})),e.getFooterProps.push((function(e,t){var n=t.column;return[e,{style:r({},Gt,{width:n.totalWidth+"px"})}]}))};function Vt(e){e.getTableProps.push(zt),e.getRowProps.push(jt),e.getHeaderGroupProps.push(jt),e.getFooterGroupProps.push(jt),e.getHeaderProps.push(Zt),e.getCellProps.push(Xt),e.getFooterProps.push(Ut)}Dt.pluginName="useBlockLayout",Vt.pluginName="useFlexLayout";var zt=function(e,t){return[e,{style:{minWidth:t.instance.totalColumnsMinWidth+"px"}}]},jt=function(e,t){return[e,{style:{display:"flex",flex:"1 0 auto",minWidth:t.instance.totalColumnsMinWidth+"px"}}]},Zt=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]},Xt=function(e,t){var n=t.cell;return[e,{style:{boxSizing:"border-box",flex:n.column.totalFlexWidth+" 0 auto",minWidth:n.column.totalMinWidth+"px",width:n.column.totalWidth+"px"}}]},Ut=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]};function Yt(e){e.stateReducers.push(qt),e.getTableProps.push(Jt),e.getHeaderProps.push(Kt),e.getRowProps.push(Qt)}a.columnStartResizing="columnStartResizing",a.columnResizing="columnResizing",a.columnDoneResizing="columnDoneResizing",a.resetResize="resetResize",Yt.pluginName="useGridLayout";var Jt=function(e,t){var n=t.instance;return[e,{style:{display:"grid",gridTemplateColumns:n.visibleColumns.map((function(e){var t;return n.state.gridLayout.columnWidths[e.id]?n.state.gridLayout.columnWidths[e.id]+"px":(null==(t=n.state.columnResizing)?void 0:t.isResizingColumn)?n.state.gridLayout.startWidths[e.id]+"px":"number"==typeof e.width?e.width+"px":e.width})).join(" ")}}]},Kt=function(e,t){var n=t.column;return[e,{id:"header-cell-"+n.id,style:{position:"sticky",gridColumn:"span "+n.totalVisibleHeaderCount}}]},Qt=function(e,t){var n=t.row;return n.isExpanded?[e,{style:{gridColumn:"1 / "+(n.cells.length+1)}}]:[e,{}]};function qt(e,t,n,i){if(t.type===a.init)return r({gridLayout:{columnWidths:{}}},e);if(t.type===a.resetResize)return r({},e,{gridLayout:{columnWidths:{}}});if(t.type===a.columnStartResizing){var o=t.columnId,s=t.headerIdWidths,l=en(o);if(void 0!==l){var c=i.visibleColumns.reduce((function(e,t){var n;return r({},e,((n={})[t.id]=en(t.id),n))}),{}),u=i.visibleColumns.reduce((function(e,t){var n;return r({},e,((n={})[t.id]=t.minWidth,n))}),{}),d=i.visibleColumns.reduce((function(e,t){var n;return r({},e,((n={})[t.id]=t.maxWidth,n))}),{}),h=s.map((function(e){var t=e[0];return[t,en(t)]}));return r({},e,{gridLayout:r({},e.gridLayout,{startWidths:c,minWidths:u,maxWidths:d,headerIdGridWidths:h,columnWidth:l})})}return e}if(t.type===a.columnResizing){var f=t.clientX,g=e.columnResizing.startX,p=e.gridLayout,m=p.columnWidth,v=p.minWidths,b=p.maxWidths,y=p.headerIdGridWidths,w=(f-g)/m,C={};return(void 0===y?[]:y).forEach((function(e){var t=e[0],n=e[1];C[t]=Math.min(Math.max(v[t],n+n*w),b[t])})),r({},e,{gridLayout:r({},e.gridLayout,{columnWidths:r({},e.gridLayout.columnWidths,{},C)})})}return t.type===a.columnDoneResizing?r({},e,{gridLayout:r({},e.gridLayout,{startWidths:{},minWidths:{},maxWidths:{}})}):void 0}function en(e){var t,n=null==(t=document.getElementById("header-cell-"+e))?void 0:t.offsetWidth;if(void 0!==n)return n}e._UNSTABLE_usePivotColumns=nt,e.actions=a,e.defaultColumn=u,e.defaultGroupByFn=De,e.defaultOrderByFn=Qe,e.defaultRenderer=l,e.emptyRenderer=c,e.ensurePluginOrder=p,e.flexRender=C,e.functionalUpdate=m,e.loopHooks=g,e.makePropGetter=h,e.makeRenderer=w,e.reduceHooks=f,e.safeUseLayoutEffect=b,e.useAbsoluteLayout=Pt,e.useAsyncDebounce=function(e,n){void 0===n&&(n=0);var r=t.useRef({}),o=v(e),s=v(n);return t.useCallback(function(){var e=i(regeneratorRuntime.mark((function e(){var t,n,a,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=l.length,n=new Array(t),a=0;a1?n-1:0),o=1;o=0||(r[n]=e[n]);return r}function s(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function a(e){var t=s(e,"string");return"symbol"==typeof t?t:String(t)}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var l="Renderer Error ☝️",c={init:"init"},u=function(e){var t=e.value;return void 0===t?"":t},d=function(){return t.createElement(t.Fragment,null," ")},h={Cell:u,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function f(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&i>r)throw new Error("React Table: The "+n+" plugin hook must be placed after the "+t+" plugin hook!")}))}function y(e,t){return"function"==typeof e?e(t):e}function w(e){var n=t.useRef();return n.current=e,t.useCallback((function(){return n.current}),[])}var C="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function x(e,n){var i=t.useRef(!1);C((function(){i.current&&e(),i.current=!0}),n)}function S(e,n){void 0===n&&(n=0);var r=t.useRef({}),o=w(e),s=w(n);return t.useCallback(function(){var e=i(regeneratorRuntime.mark((function e(){var t,n,a,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=l.length,n=new Array(t),a=0;a1?n-1:0),o=1;o(o="number"==typeof o?o:1/0)){var s=r;r=o,o=s}return e.filter((function(e){return t.some((function(t){var n=e.values[t];return n>=r&&n<=o}))}))};Be.autoRemove=function(e){return!e||"number"!=typeof e[0]&&"number"!=typeof e[1]};var Fe=Object.freeze({__proto__:null,text:Ie,exactText:ke,exactTextCase:$e,includes:_e,includesAll:Le,includesSome:Te,includesValue:Me,exact:Oe,equals:Ne,between:Be});c.resetFilters="resetFilters",c.setFilter="setFilter",c.setAllFilters="setAllFilters";var Pe=function(e){e.stateReducers.push(We),e.useInstance.push(Ge)};function We(e,t,n,i){if(t.type===c.init)return r({filters:[]},e);if(t.type===c.resetFilters)return r({},e,{filters:i.initialState.filters||[]});if(t.type===c.setFilter){var o=t.columnId,s=t.filterValue,a=i.allColumns,l=i.filterTypes,u=a.find((function(e){return e.id===o}));if(!u)throw new Error("React-Table: Could not find a column with id: "+o);var d=G(u.filter,l||{},Fe),h=e.filters.find((function(e){return e.id===o})),f=y(s,h&&h.value);return H(d.autoRemove,f,u)?r({},e,{filters:e.filters.filter((function(e){return e.id!==o}))}):r({},e,h?{filters:e.filters.map((function(e){return e.id===o?{id:o,value:f}:e}))}:{filters:[].concat(e.filters,[{id:o,value:f}])})}if(t.type===c.setAllFilters){var g=t.filters,p=i.allColumns,m=i.filterTypes;return r({},e,{filters:y(g,e.filters).filter((function(e){var t=p.find((function(t){return t.id===e.id}));return!H(G(t.filter,m||{},Fe).autoRemove,e.value,t)}))})}}function Ge(e){var n=e.data,i=e.rows,r=e.flatRows,o=e.rowsById,s=e.allColumns,a=e.filterTypes,l=e.manualFilters,u=e.defaultCanFilter,d=void 0!==u&&u,h=e.disableFilters,f=e.state.filters,g=e.dispatch,p=e.autoResetFilters,m=void 0===p||p,v=t.useCallback((function(e,t){g({type:c.setFilter,columnId:e,filterValue:t})}),[g]),b=t.useCallback((function(e){g({type:c.setAllFilters,filters:e})}),[g]);s.forEach((function(e){var t=e.id,n=e.accessor,i=e.defaultCanFilter,r=e.disableFilters;e.canFilter=n?B(!0!==r&&void 0,!0!==h&&void 0,!0):B(i,d,!1),e.setFilter=function(t){return v(e.id,t)};var o=f.find((function(e){return e.id===t}));e.filterValue=o&&o.value}));var y=t.useMemo((function(){if(l||!f.length)return[i,r,o];var e=[],t={},n=function n(i,r){void 0===r&&(r=0);var o=i;return o=f.reduce((function(e,t){var n=t.id,i=t.value,o=s.find((function(e){return e.id===n}));if(!o)return e;0===r&&(o.preFilteredRows=e);var l=G(o.filter,a||{},Fe);return l?(o.filteredRows=l(e,[n],i),o.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+o.id+"."),e)}),i),o.forEach((function(i){e.push(i),t[i.id]=i,i.subRows&&(i.subRows=i.subRows&&i.subRows.length>0?n(i.subRows,r+1):i.subRows)})),o};return[n(i),e,t]}),[l,f,i,r,o,s,a]),C=y[0],S=y[1],E=y[2];t.useMemo((function(){var e=s.filter((function(e){return!f.find((function(t){return t.id===e.id}))}));e.forEach((function(e){e.preFilteredRows=C,e.filteredRows=C}))}),[C,f,s]);var A=w(m);x((function(){A()&&g({type:c.resetFilters})}),[g,l?null:n]),Object.assign(e,{preFilteredRows:i,preFilteredFlatRows:r,preFilteredRowsById:o,filteredRows:C,filteredFlatRows:S,filteredRowsById:E,rows:C,flatRows:S,rowsById:E,setFilter:v,setAllFilters:b})}Pe.pluginName="useFilters",c.resetGlobalFilter="resetGlobalFilter",c.setGlobalFilter="setGlobalFilter";var He=function(e){e.stateReducers.push(De),e.useInstance.push(Ve)};function De(e,t,n,i){if(t.type===c.resetGlobalFilter)return r({},e,{globalFilter:i.initialState.globalFilter||void 0});if(t.type===c.setGlobalFilter){var s=t.filterValue,a=i.userFilterTypes,l=G(i.globalFilter,a||{},Fe),u=y(s,e.globalFilter);return H(l.autoRemove,u)?(e.globalFilter,o(e,["globalFilter"])):r({},e,{globalFilter:u})}}function Ve(e){var n=e.data,i=e.rows,r=e.flatRows,o=e.rowsById,s=e.allColumns,a=e.filterTypes,l=e.globalFilter,u=e.manualGlobalFilter,d=e.state.globalFilter,h=e.dispatch,f=e.autoResetGlobalFilter,g=void 0===f||f,p=e.disableGlobalFilter,m=t.useCallback((function(e){h({type:c.setGlobalFilter,filterValue:e})}),[h]),v=t.useMemo((function(){if(u||void 0===d)return[i,r,o];var e=[],t={},n=G(l,a||{},Fe);if(!n)return console.warn("Could not find a valid 'globalFilter' option."),i;s.forEach((function(e){var t=e.disableGlobalFilter;e.canFilter=B(!0!==t&&void 0,!0!==p&&void 0,!0)}));var c=s.filter((function(e){return!0===e.canFilter})),h=function i(r){return r=n(r,c.map((function(e){return e.id})),d),r.forEach((function(n){e.push(n),t[n.id]=n,n.subRows=n.subRows&&n.subRows.length?i(n.subRows):n.subRows})),r};return[h(i),e,t]}),[u,d,l,a,s,i,r,o,p]),b=v[0],y=v[1],C=v[2],S=w(g);x((function(){S()&&h({type:c.resetGlobalFilter})}),[h,u?null:n]),Object.assign(e,{preGlobalFilteredRows:i,preGlobalFilteredFlatRows:r,preGlobalFilteredRowsById:o,globalFilteredRows:b,globalFilteredFlatRows:y,globalFilteredRowsById:C,rows:b,flatRows:y,rowsById:C,setGlobalFilter:m,disableGlobalFilter:p})}function ze(e,t){return t.reduce((function(e,t){return e+("number"==typeof t?t:0)}),0)}function je(e){var t=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.min(t,e))})),t}function Ze(e){var t=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.max(t,e))})),t}function Xe(e){var t=e[0]||0,n=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.min(t,e),n=Math.max(n,e))})),t+".."+n}function Ue(e){return ze(null,e)/e.length}function Ye(e){if(!e.length)return null;var t=Math.floor(e.length/2),n=[].concat(e).sort((function(e,t){return e-t}));return e.length%2!=0?n[t]:(n[t-1]+n[t])/2}function Je(e){return Array.from(new Set(e).values())}function Ke(e){return new Set(e).size}function Qe(e){return e.length}He.pluginName="useGlobalFilter";var qe=Object.freeze({__proto__:null,sum:ze,min:je,max:Ze,minMax:Xe,average:Ue,median:Ye,unique:Je,uniqueCount:Ke,count:Qe}),et=[],tt={};c.resetGroupBy="resetGroupBy",c.setGroupBy="setGroupBy",c.toggleGroupBy="toggleGroupBy";var nt=function(e){e.getGroupByToggleProps=[it],e.stateReducers.push(rt),e.visibleColumnsDeps.push((function(e,t){var n=t.instance;return[].concat(e,[n.state.groupBy])})),e.visibleColumns.push(ot),e.useInstance.push(at),e.prepareRow.push(lt)};nt.pluginName="useGroupBy";var it=function(e,t){var n=t.header;return[e,{onClick:n.canGroupBy?function(e){e.persist(),n.toggleGroupBy()}:void 0,style:{cursor:n.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function rt(e,t,n,i){if(t.type===c.init)return r({groupBy:[]},e);if(t.type===c.resetGroupBy)return r({},e,{groupBy:i.initialState.groupBy||[]});if(t.type===c.setGroupBy)return r({},e,{groupBy:t.value});if(t.type===c.toggleGroupBy){var o=t.columnId,s=t.value,a=void 0!==s?s:!e.groupBy.includes(o);return r({},e,a?{groupBy:[].concat(e.groupBy,[o])}:{groupBy:e.groupBy.filter((function(e){return e!==o}))})}}function ot(e,t){var n=t.instance.state.groupBy,i=n.map((function(t){return e.find((function(e){return e.id===t}))})).filter(Boolean),r=e.filter((function(e){return!n.includes(e.id)}));return(e=[].concat(i,r)).forEach((function(e){e.isGrouped=n.includes(e.id),e.groupedIndex=n.indexOf(e.id)})),e}var st={};function at(e){var n=e.data,i=e.rows,o=e.flatRows,s=e.rowsById,a=e.allColumns,l=e.flatHeaders,u=e.groupByFn,d=void 0===u?ct:u,h=e.manualGroupBy,f=e.aggregations,g=void 0===f?st:f,m=e.plugins,v=e.state.groupBy,y=e.dispatch,C=e.autoResetGroupBy,S=void 0===C||C,E=e.disableGroupBy,A=e.defaultCanGroupBy,R=e.getHooks;b(m,["useColumnOrder","useFilters"],"useGroupBy");var I=w(e);a.forEach((function(t){var n=t.accessor,i=t.defaultGroupBy,r=t.disableGroupBy;t.canGroupBy=n?B(t.canGroupBy,!0!==r&&void 0,!0!==E&&void 0,!0):B(t.canGroupBy,i,A,!1),t.canGroupBy&&(t.toggleGroupBy=function(){return e.toggleGroupBy(t.id)}),t.Aggregated=t.Aggregated||t.Cell}));var k=t.useCallback((function(e,t){y({type:c.toggleGroupBy,columnId:e,value:t})}),[y]),$=t.useCallback((function(e){y({type:c.setGroupBy,value:e})}),[y]);l.forEach((function(e){e.getGroupByToggleProps=p(R().getGroupByToggleProps,{instance:I(),header:e})}));var _=t.useMemo((function(){if(h||!v.length)return[i,o,s,et,tt,o,s];var e=v.filter((function(e){return a.find((function(t){return t.id===e}))})),t=function(t,n,i){var r={};return a.forEach((function(o){if(e.includes(o.id))r[o.id]=n[0]?n[0].values[o.id]:null;else{var s="function"==typeof o.aggregate?o.aggregate:g[o.aggregate]||qe[o.aggregate];if(s){var a=n.map((function(e){return e.values[o.id]})),l=t.map((function(e){var t=e.values[o.id];if(!i&&o.aggregateValue){var n="function"==typeof o.aggregateValue?o.aggregateValue:g[o.aggregateValue]||qe[o.aggregateValue];if(!n)throw console.info({column:o}),new Error("React Table: Invalid column.aggregateValue option for column listed above");t=n(t,e,o)}return t}));r[o.id]=s(l,a)}else{if(o.aggregate)throw console.info({column:o}),new Error("React Table: Invalid column.aggregate option for column listed above");r[o.id]=null}}})),r},n=[],l={},c=[],u={},f=[],p={},m=function i(o,s,a){if(void 0===s&&(s=0),s===e.length)return o.map((function(e){return r({},e,{depth:s})}));var h=e[s],g=d(o,h),m=Object.entries(g).map((function(e,r){var o=e[0],d=e[1],g=h+":"+o,m=i(d,s+1,g=a?a+">"+g:g),v=s?P(d,"leafRows"):d,b=t(v,d,s),y={id:g,isGrouped:!0,groupByID:h,groupByVal:o,values:b,subRows:m,leafRows:v,depth:s,index:r};return m.forEach((function(e){n.push(e),l[e.id]=e,e.isGrouped?(c.push(e),u[e.id]=e):(f.push(e),p[e.id]=e)})),y}));return m},b=m(i);return b.forEach((function(e){n.push(e),l[e.id]=e,e.isGrouped?(c.push(e),u[e.id]=e):(f.push(e),p[e.id]=e)})),[b,n,l,c,u,f,p]}),[h,v,i,o,s,a,g,d]),L=_[0],T=_[1],M=_[2],O=_[3],N=_[4],F=_[5],W=_[6],G=w(S);x((function(){G()&&y({type:c.resetGroupBy})}),[y,h?null:n]),Object.assign(e,{preGroupedRows:i,preGroupedFlatRow:o,preGroupedRowsById:s,groupedRows:L,groupedFlatRows:T,groupedRowsById:M,onlyGroupedFlatRows:O,onlyGroupedRowsById:N,nonGroupedFlatRows:F,nonGroupedRowsById:W,rows:L,flatRows:T,rowsById:M,toggleGroupBy:k,setGroupBy:$})}function lt(e){e.allCells.forEach((function(t){var n;t.isGrouped=t.column.isGrouped&&t.column.id===e.groupByID,t.isPlaceholder=!t.isGrouped&&t.column.isGrouped,t.isAggregated=!t.isGrouped&&!t.isPlaceholder&&(null==(n=e.subRows)?void 0:n.length)}))}function ct(e,t){return e.reduce((function(e,n,i){var r=""+n.values[t];return e[r]=Array.isArray(e[r])?e[r]:[],e[r].push(n),e}),{})}var ut=/([0-9]+)/gm,dt=function(e,t,n){var i=vt(e,t,n),r=i[0],o=i[1];for(r=bt(r),o=bt(o),r=r.split(ut).filter(Boolean),o=o.split(ut).filter(Boolean);r.length&&o.length;){var s=r.shift(),a=o.shift(),l=parseInt(s,10),c=parseInt(a,10),u=[l,c].sort();if(isNaN(u[0])){if(s>a)return 1;if(a>s)return-1}else{if(isNaN(u[1]))return isNaN(l)?-1:1;if(l>c)return 1;if(c>l)return-1}}return r.length-o.length};function ht(e,t,n){var i=vt(e,t,n),r=i[0],o=i[1];return mt(r=r.getTime(),o=o.getTime())}function ft(e,t,n){var i=vt(e,t,n);return mt(i[0],i[1])}function gt(e,t,n){var i=vt(e,t,n),r=i[0],o=i[1];for(r=r.split("").filter(Boolean),o=o.split("").filter(Boolean);r.length&&o.length;){var s=r.shift(),a=o.shift(),l=s.toLowerCase(),c=a.toLowerCase();if(l>c)return 1;if(c>l)return-1;if(s>a)return 1;if(a>s)return-1}return r.length-o.length}function pt(e,t,n){var i=vt(e,t,n),r=i[0],o=i[1],s=/[^0-9.]/gi;return mt(r=Number(String(r).replace(s,"")),o=Number(String(o).replace(s,"")))}function mt(e,t){return e===t?0:e>t?1:-1}function vt(e,t,n){return[e.values[n],t.values[n]]}function bt(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}var yt=Object.freeze({__proto__:null,alphanumeric:dt,datetime:ht,basic:ft,string:gt,number:pt});c.resetSortBy="resetSortBy",c.setSortBy="setSortBy",c.toggleSortBy="toggleSortBy",c.clearSortBy="clearSortBy",h.sortType="alphanumeric",h.sortDescFirst=!1;var wt=function(e){e.getSortByToggleProps=[Ct],e.stateReducers.push(xt),e.useInstance.push(St)};wt.pluginName="useSortBy";var Ct=function(e,t){var n=t.instance,i=t.column,r=n.isMultiSortEvent,o=void 0===r?function(e){return e.shiftKey}:r;return[e,{onClick:i.canSort?function(e){e.persist(),i.toggleSortBy(void 0,!n.disableMultiSort&&o(e))}:void 0,style:{cursor:i.canSort?"pointer":void 0},title:i.canSort?"Toggle SortBy":void 0}]};function xt(e,t,n,i){if(t.type===c.init)return r({sortBy:[]},e);if(t.type===c.resetSortBy)return r({},e,{sortBy:i.initialState.sortBy||[]});if(t.type===c.clearSortBy){var o=e.sortBy.filter((function(e){return e.id!==t.columnId}));return r({},e,{sortBy:o})}if(t.type===c.setSortBy)return r({},e,{sortBy:t.sortBy});if(t.type===c.toggleSortBy){var s,a=t.columnId,l=t.desc,u=t.multi,d=i.allColumns,h=i.disableMultiSort,f=i.disableSortRemove,g=i.disableMultiRemove,p=i.maxMultiSortColCount,m=void 0===p?Number.MAX_SAFE_INTEGER:p,v=e.sortBy,b=d.find((function(e){return e.id===a})),y=b.sortDescFirst,w=v.find((function(e){return e.id===a})),C=v.findIndex((function(e){return e.id===a})),x=null!=l,S=[];return"toggle"!=(s=!h&&u?w?"toggle":"add":C!==v.length-1||1!==v.length?"replace":w?"toggle":"replace")||f||x||u&&g||!(w&&w.desc&&!y||!w.desc&&y)||(s="remove"),"replace"===s?S=[{id:a,desc:x?l:y}]:"add"===s?(S=[].concat(v,[{id:a,desc:x?l:y}])).splice(0,S.length-m):"toggle"===s?S=v.map((function(e){return e.id===a?r({},e,{desc:x?l:!w.desc}):e})):"remove"===s&&(S=v.filter((function(e){return e.id!==a}))),r({},e,{sortBy:S})}}function St(e){var n=e.data,i=e.rows,r=e.flatRows,o=e.allColumns,s=e.orderByFn,a=void 0===s?Et:s,l=e.sortTypes,u=e.manualSortBy,d=e.defaultCanSort,h=e.disableSortBy,f=e.flatHeaders,g=e.state.sortBy,m=e.dispatch,v=e.plugins,y=e.getHooks,C=e.autoResetSortBy,S=void 0===C||C;b(v,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var E=t.useCallback((function(e){m({type:c.setSortBy,sortBy:e})}),[m]),A=t.useCallback((function(e,t,n){m({type:c.toggleSortBy,columnId:e,desc:t,multi:n})}),[m]),R=w(e);f.forEach((function(e){var t=e.accessor,n=e.canSort,i=e.disableSortBy,r=e.id,o=t?B(!0!==i&&void 0,!0!==h&&void 0,!0):B(d,n,!1);e.canSort=o,e.canSort&&(e.toggleSortBy=function(t,n){return A(e.id,t,n)},e.clearSortBy=function(){m({type:c.clearSortBy,columnId:e.id})}),e.getSortByToggleProps=p(y().getSortByToggleProps,{instance:R(),column:e});var s=g.find((function(e){return e.id===r}));e.isSorted=!!s,e.sortedIndex=g.findIndex((function(e){return e.id===r})),e.isSortedDesc=e.isSorted?s.desc:void 0}));var I=t.useMemo((function(){if(u||!g.length)return[i,r];var e=[],t=g.filter((function(e){return o.find((function(t){return t.id===e.id}))})),n=function n(i){var r=a(i,t.map((function(e){var t=o.find((function(t){return t.id===e.id}));if(!t)throw new Error("React-Table: Could not find a column with id: "+e.id+" while sorting");var n=t.sortType,i=F(n)||(l||{})[n]||yt[n];if(!i)throw new Error("React-Table: Could not find a valid sortType of '"+n+"' for column '"+e.id+"'.");return function(t,n){return i(t,n,e.id,e.desc)}})),t.map((function(e){var t=o.find((function(t){return t.id===e.id}));return t&&t.sortInverted?e.desc:!e.desc})));return r.forEach((function(t){e.push(t),t.subRows&&0!==t.subRows.length&&(t.subRows=n(t.subRows))})),r};return[n(i),e]}),[u,g,i,r,o,a,l]),k=I[0],$=I[1],_=w(S);x((function(){_()&&m({type:c.resetSortBy})}),[u?null:n]),Object.assign(e,{preSortedRows:i,preSortedFlatRows:r,sortedRows:k,sortedFlatRows:$,rows:k,flatRows:$,setSortBy:E,toggleSortBy:A})}function Et(e,t,n){return[].concat(e).sort((function(e,i){for(var r=0;re.pageIndex?l=-1===o?s.length>=e.pageSize:a-1),l?r({},e,{pageIndex:a}):e}if(t.type===c.setPageSize){var u=t.pageSize,d=e.pageSize*e.pageIndex;return r({},e,{pageIndex:Math.floor(d/u),pageSize:u})}}function kt(e){var n=e.rows,i=e.autoResetPage,r=void 0===i||i,o=e.manualExpandedKey,s=void 0===o?"expanded":o,a=e.plugins,l=e.pageCount,u=e.paginateExpandedRows,d=void 0===u||u,h=e.expandSubRows,f=void 0===h||h,g=e.state,p=g.pageSize,m=g.pageIndex,v=g.expanded,y=g.globalFilter,C=g.filters,S=g.groupBy,E=g.sortBy,A=e.dispatch,R=e.data,I=e.manualPagination;b(a,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var k=w(r);x((function(){k()&&A({type:c.resetPage})}),[A,I?null:R,y,C,S,E]);var $=I?l:Math.ceil(n.length/p),_=t.useMemo((function(){return $>0?[].concat(new Array($)).fill(null).map((function(e,t){return t})):[]}),[$]),L=t.useMemo((function(){var e;if(I)e=n;else{var t=p*m,i=t+p;e=n.slice(t,i)}return d?e:W(e,{manualExpandedKey:s,expanded:v,expandSubRows:f})}),[f,v,s,I,m,p,d,n]),T=m>0,M=-1===$?L.length>=p:m<$-1,O=t.useCallback((function(e){A({type:c.gotoPage,pageIndex:e})}),[A]),N=t.useCallback((function(){return O((function(e){return e-1}))}),[O]),B=t.useCallback((function(){return O((function(e){return e+1}))}),[O]),F=t.useCallback((function(e){A({type:c.setPageSize,pageSize:e})}),[A]);Object.assign(e,{pageOptions:_,pageCount:$,page:L,canPreviousPage:T,canNextPage:M,gotoPage:O,previousPage:N,nextPage:B,setPageSize:F})}Rt.pluginName=At,c.resetPivot="resetPivot",c.togglePivot="togglePivot";var $t=function(e){e.getPivotToggleProps=[Lt],e.stateReducers.push(Tt),e.useInstanceAfterData.push(Mt),e.allColumns.push(Ot),e.accessValue.push(Nt),e.materializedColumns.push(Bt),e.materializedColumnsDeps.push(Ft),e.visibleColumns.push(Pt),e.visibleColumnsDeps.push(Wt),e.useInstance.push(Gt),e.prepareRow.push(Ht)};$t.pluginName="usePivotColumns";var _t=[],Lt=function(e,t){var n=t.header;return[e,{onClick:n.canPivot?function(e){e.persist(),n.togglePivot()}:void 0,style:{cursor:n.canPivot?"pointer":void 0},title:"Toggle Pivot"}]};function Tt(e,t,n,i){if(t.type===c.init)return r({pivotColumns:_t},e);if(t.type===c.resetPivot)return r({},e,{pivotColumns:i.initialState.pivotColumns||_t});if(t.type===c.togglePivot){var o=t.columnId,s=t.value,a=void 0!==s?s:!e.pivotColumns.includes(o);return r({},e,a?{pivotColumns:[].concat(e.pivotColumns,[o])}:{pivotColumns:e.pivotColumns.filter((function(e){return e!==o}))})}}function Mt(e){e.allColumns.forEach((function(t){t.isPivotSource=e.state.pivotColumns.includes(t.id)}))}function Ot(e,t){var n=t.instance;return e.forEach((function(e){e.isPivotSource=n.state.pivotColumns.includes(e.id),e.uniqueValues=new Set})),e}function Nt(e,t){var n=t.column;return n.uniqueValues&&void 0!==e&&n.uniqueValues.add(e),e}function Bt(e,t){var n=t.instance,i=n.allColumns,o=n.state;if(!o.pivotColumns.length||!o.groupBy||!o.groupBy.length)return e;var s=o.pivotColumns.map((function(e){return i.find((function(t){return t.id===e}))})).filter(Boolean),a=i.filter((function(e){return!e.isPivotSource&&!o.groupBy.includes(e.id)&&!o.pivotColumns.includes(e.id)})),l=_(function e(t,n,i){void 0===t&&(t=0),void 0===i&&(i=[]);var o=s[t];return o?Array.from(o.uniqueValues).sort().map((function(s){var a=r({},o,{Header:o.PivotHeader||"string"==typeof o.header?o.Header+": "+s:s,isPivotGroup:!0,parent:n,depth:t,id:n?n.id+"."+o.id+"."+s:o.id+"."+s,pivotValue:s});return a.columns=e(t+1,a,[].concat(i,[function(e){return e.values[o.id]===s}])),a})):a.map((function(e){return r({},e,{canPivot:!1,isPivoted:!0,parent:n,depth:t,id:""+(n?n.id+"."+e.id:e.id),accessor:function(t,n,r){if(i.every((function(e){return e(r)})))return r.values[e.id]}})}))}());return[].concat(e,l)}function Ft(e,t){var n=t.instance.state,i=n.pivotColumns,r=n.groupBy;return[].concat(e,[i,r])}function Pt(e,t){var n=t.instance.state;return e=e.filter((function(e){return!e.isPivotSource})),n.pivotColumns.length&&n.groupBy&&n.groupBy.length&&(e=e.filter((function(e){return e.isGrouped||e.isPivoted}))),e}function Wt(e,t){var n=t.instance;return[].concat(e,[n.state.pivotColumns,n.state.groupBy])}function Gt(e){var t=e.columns,n=e.allColumns,i=e.flatHeaders,r=e.getHooks,o=e.plugins,s=e.dispatch,a=e.autoResetPivot,l=void 0===a||a,u=e.manaulPivot,d=e.disablePivot,h=e.defaultCanPivot;b(o,["useGroupBy"],"usePivotColumns");var f=w(e);n.forEach((function(t){var n=t.accessor,i=t.defaultPivot,r=t.disablePivot;t.canPivot=n?B(t.canPivot,!0!==r&&void 0,!0!==d&&void 0,!0):B(t.canPivot,i,h,!1),t.canPivot&&(t.togglePivot=function(){return e.togglePivot(t.id)}),t.Aggregated=t.Aggregated||t.Cell}));var g=function(e,t){s({type:c.togglePivot,columnId:e,value:t})};i.forEach((function(e){e.getPivotToggleProps=p(r().getPivotToggleProps,{instance:f(),header:e})}));var m=w(l);x((function(){m()&&s({type:c.resetPivot})}),[s,u?null:t]),Object.assign(e,{togglePivot:g})}function Ht(e){e.allCells.forEach((function(e){e.isPivoted=e.column.isPivoted}))}var Dt="useRowSelect";c.resetSelectedRows="resetSelectedRows",c.toggleAllRowsSelected="toggleAllRowsSelected",c.toggleRowSelected="toggleRowSelected",c.toggleAllPageRowsSelected="toggleAllPageRowsSelected";var Vt=function(e){e.getToggleRowSelectedProps=[zt],e.getToggleAllRowsSelectedProps=[jt],e.getToggleAllPageRowsSelectedProps=[Zt],e.stateReducers.push(Xt),e.useInstance.push(Ut),e.prepareRow.push(Yt)};Vt.pluginName=Dt;var zt=function(e,t){var n=t.instance,i=t.row,r=n.manualRowSelectedKey,o=void 0===r?"isSelected":r;return[e,{onChange:function(e){i.toggleRowSelected(e.target.checked)},style:{cursor:"pointer"},checked:!(!i.original||!i.original[o])||i.isSelected,title:"Toggle Row Selected",indeterminate:i.isSomeSelected}]},jt=function(e,t){var n=t.instance;return[e,{onChange:function(e){n.toggleAllRowsSelected(e.target.checked)},style:{cursor:"pointer"},checked:n.isAllRowsSelected,title:"Toggle All Rows Selected",indeterminate:Boolean(!n.isAllRowsSelected&&Object.keys(n.state.selectedRowIds).length)}]},Zt=function(e,t){var n=t.instance;return[e,{onChange:function(e){n.toggleAllPageRowsSelected(e.target.checked)},style:{cursor:"pointer"},checked:n.isAllPageRowsSelected,title:"Toggle All Current Page Rows Selected",indeterminate:Boolean(!n.isAllPageRowsSelected&&n.page.some((function(e){var t=e.id;return n.state.selectedRowIds[t]})))}]};function Xt(e,t,n,i){if(t.type===c.init)return r({selectedRowIds:{}},e);if(t.type===c.resetSelectedRows)return r({},e,{selectedRowIds:i.initialState.selectedRowIds||{}});if(t.type===c.toggleAllRowsSelected){var o=t.value,s=i.isAllRowsSelected,a=i.rowsById,l=i.nonGroupedRowsById,u=void 0===l?a:l,d=void 0!==o?o:!s,h=Object.assign({},e.selectedRowIds);return d?Object.keys(u).forEach((function(e){h[e]=!0})):Object.keys(u).forEach((function(e){delete h[e]})),r({},e,{selectedRowIds:h})}if(t.type===c.toggleRowSelected){var f=t.id,g=t.value,p=i.rowsById,m=i.selectSubRows,v=void 0===m||m,b=i.getSubRows,y=e.selectedRowIds[f],w=void 0!==g?g:!y;if(y===w)return e;var C=r({},e.selectedRowIds),x=function e(t){var n=p[t];if(n&&(n.isGrouped||(w?C[t]=!0:delete C[t]),v&&b(n)))return b(n).forEach((function(t){return e(t.id)}))};return x(f),r({},e,{selectedRowIds:C})}if(t.type===c.toggleAllPageRowsSelected){var S=t.value,E=i.page,A=i.rowsById,R=i.selectSubRows,I=void 0===R||R,k=i.isAllPageRowsSelected,$=i.getSubRows,_=void 0!==S?S:!k,L=r({},e.selectedRowIds),T=function e(t){var n=A[t];if(n.isGrouped||(_?L[t]=!0:delete L[t]),I&&$(n))return $(n).forEach((function(t){return e(t.id)}))};return E.forEach((function(e){return T(e.id)})),r({},e,{selectedRowIds:L})}return e}function Ut(e){var n=e.data,i=e.rows,r=e.getHooks,o=e.plugins,s=e.rowsById,a=e.nonGroupedRowsById,l=void 0===a?s:a,u=e.autoResetSelectedRows,d=void 0===u||u,h=e.state.selectedRowIds,f=e.selectSubRows,g=void 0===f||f,m=e.dispatch,v=e.page,y=e.getSubRows;b(o,["useFilters","useGroupBy","useSortBy","useExpanded","usePagination"],"useRowSelect");var C=t.useMemo((function(){var e=[];return i.forEach((function(t){var n=g?Jt(t,h,y):!!h[t.id];t.isSelected=!!n,t.isSomeSelected=null===n,n&&e.push(t)})),e}),[i,g,h,y]),S=Boolean(Object.keys(l).length&&Object.keys(h).length),E=S;S&&Object.keys(l).some((function(e){return!h[e]}))&&(S=!1),S||v&&v.length&&v.some((function(e){var t=e.id;return!h[t]}))&&(E=!1);var A=w(d);x((function(){A()&&m({type:c.resetSelectedRows})}),[m,n]);var R=t.useCallback((function(e){return m({type:c.toggleAllRowsSelected,value:e})}),[m]),I=t.useCallback((function(e){return m({type:c.toggleAllPageRowsSelected,value:e})}),[m]),k=t.useCallback((function(e,t){return m({type:c.toggleRowSelected,id:e,value:t})}),[m]),$=w(e),_=p(r().getToggleAllRowsSelectedProps,{instance:$()}),L=p(r().getToggleAllPageRowsSelectedProps,{instance:$()});Object.assign(e,{selectedFlatRows:C,isAllRowsSelected:S,isAllPageRowsSelected:E,toggleRowSelected:k,toggleAllRowsSelected:R,getToggleAllRowsSelectedProps:_,getToggleAllPageRowsSelectedProps:L,toggleAllPageRowsSelected:I})}function Yt(e,t){var n=t.instance;e.toggleRowSelected=function(t){return n.toggleRowSelected(e.id,t)},e.getToggleRowSelectedProps=p(n.getHooks().getToggleRowSelectedProps,{instance:n,row:e})}function Jt(e,t,n){if(t[e.id])return!0;var i=n(e);if(i&&i.length){var r=!0,o=!1;return i.forEach((function(e){o&&!r||(Jt(e,t,n)?o=!0:r=!1)})),!!r||!!o&&null}return!1}var Kt=function(e){return{}},Qt=function(e){return{}};c.setRowState="setRowState",c.setCellState="setCellState",c.resetRowState="resetRowState";var qt=function(e){e.stateReducers.push(en),e.useInstance.push(tn),e.prepareRow.push(nn)};function en(e,t,n,i){var o=i.initialRowStateAccessor,s=void 0===o?Kt:o,a=i.initialCellStateAccessor,l=void 0===a?Qt:a,u=i.rowsById;if(t.type===c.init)return r({rowState:{}},e);if(t.type===c.resetRowState)return r({},e,{rowState:i.initialState.rowState||{}});if(t.type===c.setRowState){var d,h=t.rowId,f=t.value,g=void 0!==e.rowState[h]?e.rowState[h]:s(u[h]);return r({},e,{rowState:r({},e.rowState,(d={},d[h]=y(f,g),d))})}if(t.type===c.setCellState){var p,m,v,b,w,C=t.rowId,x=t.columnId,S=t.value,E=void 0!==e.rowState[C]?e.rowState[C]:s(u[C]),A=void 0!==(null==E||null==(p=E.cellState)?void 0:p[x])?E.cellState[x]:l(null==(m=u[C])||null==(v=m.cells)?void 0:v.find((function(e){return e.column.id===x})));return r({},e,{rowState:r({},e.rowState,(w={},w[C]=r({},E,{cellState:r({},E.cellState||{},(b={},b[x]=y(S,A),b))}),w))})}}function tn(e){var n=e.autoResetRowState,i=void 0===n||n,r=e.data,o=e.dispatch,s=t.useCallback((function(e,t){return o({type:c.setRowState,rowId:e,value:t})}),[o]),a=t.useCallback((function(e,t,n){return o({type:c.setCellState,rowId:e,columnId:t,value:n})}),[o]),l=w(i);x((function(){l()&&o({type:c.resetRowState})}),[r]),Object.assign(e,{setRowState:s,setCellState:a})}function nn(e,t){var n=t.instance,i=n.initialRowStateAccessor,r=void 0===i?Kt:i,o=n.initialCellStateAccessor,s=void 0===o?Qt:o,a=n.state.rowState;e&&(e.state=void 0!==a[e.id]?a[e.id]:r(e),e.setState=function(t){return n.setRowState(e.id,t)},e.cells.forEach((function(t){e.state.cellState||(e.state.cellState={}),t.state=void 0!==e.state.cellState[t.column.id]?e.state.cellState[t.column.id]:s(t),t.setState=function(i){return n.setCellState(e.id,t.column.id,i)}})))}qt.pluginName="useRowState",c.resetColumnOrder="resetColumnOrder",c.setColumnOrder="setColumnOrder";var rn=function(e){e.stateReducers.push(on),e.visibleColumnsDeps.push((function(e,t){var n=t.instance;return[].concat(e,[n.state.columnOrder])})),e.visibleColumns.push(sn),e.useInstance.push(an)};function on(e,t,n,i){return t.type===c.init?r({columnOrder:[]},e):t.type===c.resetColumnOrder?r({},e,{columnOrder:i.initialState.columnOrder||[]}):t.type===c.setColumnOrder?r({},e,{columnOrder:y(t.columnOrder,e.columnOrder)}):void 0}function sn(e,t){var n=t.instance.state.columnOrder;if(!n||!n.length)return e;for(var i=[].concat(n),r=[].concat(e),o=[],s=function(){var e=i.shift(),t=r.findIndex((function(t){return t.id===e}));t>-1&&o.push(r.splice(t,1)[0])};r.length&&i.length;)s();return[].concat(o,r)}function an(e){var n=e.dispatch;e.setColumnOrder=t.useCallback((function(e){return n({type:c.setColumnOrder,columnOrder:e})}),[n])}rn.pluginName="useColumnOrder",h.canResize=!0,c.columnStartResizing="columnStartResizing",c.columnResizing="columnResizing",c.columnDoneResizing="columnDoneResizing",c.resetResize="resetResize";var ln=function(e){e.getResizerProps=[cn],e.getHeaderProps.push({style:{position:"relative"}}),e.stateReducers.push(un),e.useInstance.push(hn),e.useInstanceBeforeDimensions.push(dn)},cn=function(e,t){var n=t.instance,i=t.header,r=n.dispatch,o=function(e,t){var n=!1;if("touchstart"===e.type){if(e.touches&&e.touches.length>1)return;n=!0}var i,o,s=fn(t).map((function(e){return[e.id,e.totalWidth]})),a=n?Math.round(e.touches[0].clientX):e.clientX,l=function(){window.cancelAnimationFrame(i),i=null,r({type:c.columnDoneResizing})},u=function(){window.cancelAnimationFrame(i),i=null,r({type:c.columnResizing,clientX:o})},d=function(e){o=e,i||(i=window.requestAnimationFrame(u))},h={mouse:{moveEvent:"mousemove",moveHandler:function(e){return d(e.clientX)},upEvent:"mouseup",upHandler:function(e){document.removeEventListener("mousemove",h.mouse.moveHandler),document.removeEventListener("mouseup",h.mouse.upHandler),l()}},touch:{moveEvent:"touchmove",moveHandler:function(e){return e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(e){document.removeEventListener(h.touch.moveEvent,h.touch.moveHandler),document.removeEventListener(h.touch.upEvent,h.touch.moveHandler),l()}}},f=n?h.touch:h.mouse,g=!!z()&&{passive:!1};document.addEventListener(f.moveEvent,f.moveHandler,g),document.addEventListener(f.upEvent,f.upHandler,g),r({type:c.columnStartResizing,columnId:t.id,columnWidth:t.totalWidth,headerIdWidths:s,clientX:a})};return[e,{onMouseDown:function(e){return e.persist()||o(e,i)},onTouchStart:function(e){return e.persist()||o(e,i)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function un(e,t){if(t.type===c.init)return r({columnResizing:{columnWidths:{}}},e);if(t.type===c.resetResize)return r({},e,{columnResizing:{columnWidths:{}}});if(t.type===c.columnStartResizing){var n=t.clientX,i=t.columnId,o=t.columnWidth,s=t.headerIdWidths;return r({},e,{columnResizing:r({},e.columnResizing,{startX:n,headerIdWidths:s,columnWidth:o,isResizingColumn:i})})}if(t.type===c.columnResizing){var a=t.clientX,l=e.columnResizing,u=l.startX,d=l.columnWidth,h=l.headerIdWidths,f=(a-u)/d,g={};return(void 0===h?[]:h).forEach((function(e){var t=e[0],n=e[1];g[t]=Math.max(n+n*f,0)})),r({},e,{columnResizing:r({},e.columnResizing,{columnWidths:r({},e.columnResizing.columnWidths,{},g)})})}return t.type===c.columnDoneResizing?r({},e,{columnResizing:r({},e.columnResizing,{startX:null,isResizingColumn:null})}):void 0}ln.pluginName="useResizeColumns";var dn=function(e){var t=e.flatHeaders,n=e.disableResizing,i=e.getHooks,r=e.state.columnResizing,o=w(e);t.forEach((function(e){var t=B(!0!==e.disableResizing&&void 0,!0!==n&&void 0,!0);e.canResize=t,e.width=r.columnWidths[e.id]||e.originalWidth||e.width,e.isResizing=r.isResizingColumn===e.id,t&&(e.getResizerProps=p(i().getResizerProps,{instance:o(),header:e}))}))};function hn(e){var n=e.plugins,i=e.dispatch,r=e.autoResetResize,o=void 0===r||r,s=e.columns;b(n,["useAbsoluteLayout"],"useResizeColumns");var a=w(o);x((function(){a()&&i({type:c.resetResize})}),[s]);var l=t.useCallback((function(){return i({type:c.resetResize})}),[i]);Object.assign(e,{resetResizing:l})}function fn(e){var t=[],n=function e(n){n.columns&&n.columns.length&&n.columns.map(e),t.push(n)};return n(e),t}var gn={position:"absolute",top:0},pn=function(e){e.getTableBodyProps.push(mn),e.getRowProps.push(mn),e.getHeaderGroupProps.push(mn),e.getFooterGroupProps.push(mn),e.getHeaderProps.push((function(e,t){var n=t.column;return[e,{style:r({},gn,{left:n.totalLeft+"px",width:n.totalWidth+"px"})}]})),e.getCellProps.push((function(e,t){var n=t.cell;return[e,{style:r({},gn,{left:n.column.totalLeft+"px",width:n.column.totalWidth+"px"})}]})),e.getFooterProps.push((function(e,t){var n=t.column;return[e,{style:r({},gn,{left:n.totalLeft+"px",width:n.totalWidth+"px"})}]}))};pn.pluginName="useAbsoluteLayout";var mn=function(e,t){return[e,{style:{position:"relative",width:t.instance.totalColumnsWidth+"px"}}]},vn={display:"inline-block",boxSizing:"border-box"},bn=function(e,t){return[e,{style:{display:"flex",width:t.instance.totalColumnsWidth+"px"}}]},yn=function(e){e.getRowProps.push(bn),e.getHeaderGroupProps.push(bn),e.getFooterGroupProps.push(bn),e.getHeaderProps.push((function(e,t){var n=t.column;return[e,{style:r({},vn,{width:n.totalWidth+"px"})}]})),e.getCellProps.push((function(e,t){var n=t.cell;return[e,{style:r({},vn,{width:n.column.totalWidth+"px"})}]})),e.getFooterProps.push((function(e,t){var n=t.column;return[e,{style:r({},vn,{width:n.totalWidth+"px"})}]}))};function wn(e){e.getTableProps.push(Cn),e.getRowProps.push(xn),e.getHeaderGroupProps.push(xn),e.getFooterGroupProps.push(xn),e.getHeaderProps.push(Sn),e.getCellProps.push(En),e.getFooterProps.push(An)}yn.pluginName="useBlockLayout",wn.pluginName="useFlexLayout";var Cn=function(e,t){return[e,{style:{minWidth:t.instance.totalColumnsMinWidth+"px"}}]},xn=function(e,t){return[e,{style:{display:"flex",flex:"1 0 auto",minWidth:t.instance.totalColumnsMinWidth+"px"}}]},Sn=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]},En=function(e,t){var n=t.cell;return[e,{style:{boxSizing:"border-box",flex:n.column.totalFlexWidth+" 0 auto",minWidth:n.column.totalMinWidth+"px",width:n.column.totalWidth+"px"}}]},An=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]};function Rn(e){e.stateReducers.push(_n),e.getTableProps.push(In),e.getHeaderProps.push(kn),e.getRowProps.push($n)}c.columnStartResizing="columnStartResizing",c.columnResizing="columnResizing",c.columnDoneResizing="columnDoneResizing",c.resetResize="resetResize",Rn.pluginName="useGridLayout";var In=function(e,t){var n=t.instance,i=n.visibleColumns.map((function(e){var t;return n.state.gridLayout.columnWidths[e.id]?n.state.gridLayout.columnWidths[e.id]+"px":(null==(t=n.state.columnResizing)?void 0:t.isResizingColumn)?n.state.gridLayout.startWidths[e.id]+"px":"number"==typeof e.width?e.width+"px":e.width}));return[e,{style:{display:"grid",gridTemplateColumns:i.join(" ")}}]},kn=function(e,t){var n=t.column;return[e,{id:"header-cell-"+n.id,style:{position:"sticky",gridColumn:"span "+n.totalVisibleHeaderCount}}]},$n=function(e,t){var n=t.row;return n.isExpanded?[e,{style:{gridColumn:"1 / "+(n.cells.length+1)}}]:[e,{}]};function _n(e,t,n,i){if(t.type===c.init)return r({gridLayout:{columnWidths:{}}},e);if(t.type===c.resetResize)return r({},e,{gridLayout:{columnWidths:{}}});if(t.type===c.columnStartResizing){var o=t.columnId,s=t.headerIdWidths,a=Ln(o);if(void 0!==a){var l=i.visibleColumns.reduce((function(e,t){var n;return r({},e,((n={})[t.id]=Ln(t.id),n))}),{}),u=i.visibleColumns.reduce((function(e,t){var n;return r({},e,((n={})[t.id]=t.minWidth,n))}),{}),d=i.visibleColumns.reduce((function(e,t){var n;return r({},e,((n={})[t.id]=t.maxWidth,n))}),{}),h=s.map((function(e){var t=e[0];return[t,Ln(t)]}));return r({},e,{gridLayout:r({},e.gridLayout,{startWidths:l,minWidths:u,maxWidths:d,headerIdGridWidths:h,columnWidth:a})})}return e}if(t.type===c.columnResizing){var f=t.clientX,g=e.columnResizing.startX,p=e.gridLayout,m=p.columnWidth,v=p.minWidths,b=p.maxWidths,y=p.headerIdGridWidths,w=(f-g)/m,C={};return(void 0===y?[]:y).forEach((function(e){var t=e[0],n=e[1];C[t]=Math.min(Math.max(v[t],n+n*w),b[t])})),r({},e,{gridLayout:r({},e.gridLayout,{columnWidths:r({},e.gridLayout.columnWidths,{},C)})})}return t.type===c.columnDoneResizing?r({},e,{gridLayout:r({},e.gridLayout,{startWidths:{},minWidths:{},maxWidths:{}})}):void 0}function Ln(e){var t,n=null==(t=document.getElementById("header-cell-"+e))?void 0:t.offsetWidth;if(void 0!==n)return n}e._UNSTABLE_usePivotColumns=$t,e.actions=c,e.defaultColumn=h,e.defaultGroupByFn=ct,e.defaultOrderByFn=Et,e.defaultRenderer=u,e.emptyRenderer=d,e.ensurePluginOrder=b,e.flexRender=A,e.functionalUpdate=y,e.loopHooks=v,e.makePropGetter=p,e.makeRenderer=E,e.reduceHooks=m,e.safeUseLayoutEffect=C,e.useAbsoluteLayout=pn,e.useAsyncDebounce=S,e.useBlockLayout=yn,e.useColumnOrder=rn,e.useExpanded=we,e.useFilters=Pe,e.useFlexLayout=wn,e.useGetLatest=w,e.useGlobalFilter=He,e.useGridLayout=Rn,e.useGroupBy=nt,e.useMountedLayoutEffect=x,e.usePagination=Rt,e.useResizeColumns=ln,e.useRowSelect=Vt,e.useRowState=qt,e.useSortBy=wt,e.useTable=ve,Object.defineProperty(e,"__esModule",{value:!0})}(Hd.exports,c.default),"production"===process.env.NODE_ENV?Wd.exports=Gd.exports:Wd.exports=Hd.exports;var Dd={setItem:function(e,t){return localStorage.setItem(e,t)},getItem:function(e){return localStorage.getItem(e)},removeItem:function(e){return localStorage.removeItem(e)},updateFilters:function(e,t){var n,i,r=null!==(i=Dd.getItem(tn))&&void 0!==i?i:"{}",o=JSON.parse(r),s=u({},o);return Xn.isEmpty(t)?Reflect.deleteProperty(s,e):s=u(u({},s),((n={})[e]=t,n)),Xn.isEmpty(s)?Dd.removeItem(tn):Dd.setItem(tn,JSON.stringify(s))},updateHidden:function(e,t){var n,i=null!==(n=Dd.getItem(rn))&&void 0!==n?n:"{}",r=JSON.parse(i),o=u({},r);o[e]=t,Dd.setItem(rn,JSON.stringify(o))},updateResized:function(e,t){var n,i,r=null!==(i=Dd.getItem(on))&&void 0!==i?i:"{}",o=JSON.parse(r),s=u({},o);return Xn.isEmpty(t)?Reflect.deleteProperty(s,e):s=u(u({},s),((n={})[e]=t,n)),Xn.isEmpty(s)?Dd.removeItem(on):Dd.setItem(on,JSON.stringify(s))},updateResizedEnabled:function(e,t){var n,i,r=null!==(i=Dd.getItem(sn))&&void 0!==i?i:"{}",o=JSON.parse(r),s=u(u({},o),((n={})[e]=t,n));Dd.setItem(sn,JSON.stringify(s))}};function Vd(n){var i=n.columns,r=n.colProperty,o=e.useRef(null),s=h(e.useState(!1),2),a=s[0],l=s[1],d=i.filter((function(e){return e.getToggleHiddenProps().checked})).length;return c.default.createElement("span",{className:"show-columns-wrapper",ref:o},c.default.createElement(Vn,{data:"Show/Hide columns"},c.default.createElement(t.IconButton,{onClick:function(){return l((function(e){return!e}))}},c.default.createElement(L,null))),c.default.createElement(t.Popper,{open:a,anchorEl:o.current,transition:!0,disablePortal:!0,className:"popper-wrapper",nonce:void 0,onResize:void 0,onResizeCapture:void 0},(function(e){var n=e.TransitionProps;return c.default.createElement(t.Grow,u({},n,{style:{transformOrigin:"center top"}}),c.default.createElement(t.Paper,{className:"menu-popper"},c.default.createElement(t.ClickAwayListener,{onClickAway:function(){return l(!1)}},c.default.createElement("div",{className:"show-columns"},i.map((function(e){var t=e.getToggleHiddenProps();return c.default.createElement("div",{key:e.id},c.default.createElement("div",{className:"show-columns-line"},c.default.createElement(jn,u({},t,{disabled:t.checked&&d<=2})),c.default.createElement("span",{className:"capitalize-first-letter"},e[r])))}))))))})))}function zd(n){var i=n.actions,r=n.row,o=n.disablePortal,s=void 0!==o&&o,a=h(Po(!1),2),l=a[0],f=a[1],g=e.useRef(null),p=i.filter((function(e){var t=e.hideAction;return t instanceof Function?!(null==t?void 0:t(r.original)):!t})).map((function(e){var t=e.action,n=e.content,i=e.disabled,o=d(e,["action","content","disabled"]);return u(u(u({},o),{content:n instanceof Function?n(r.original):n,disabled:i instanceof Function?i(r.original):i}),t&&{onClick:function(){t(u(u({},r.original),r.state))}})}));return p.length?c.default.createElement("div",{className:"table-row-actions",ref:g},c.default.createElement(t.IconButton,{className:"actions-btn",onClick:f},c.default.createElement(ae,null)),l&&c.default.createElement(Nd,{disablePortal:s,anchorEl:g.current,open:l,onClickAway:f,items:p})):c.default.createElement("div",{className:"table-row-actions-empty"})}function jd(t){var n=t.cell,r=n.value,o=n.column,s=n.row,a=o.isLink,l=o.getUrl,d=o.openInNewTab,f=e.useRef(null),g=h(e.useState(Qt),2),p=g[0],m=g[1],v=function(){f.current&&Xn.isEllipsisActive(f.current)?m(r):m(Qt)};e.useEffect((function(){return v(),window.addEventListener("resize",v),document.addEventListener(ln,v),function(){window.removeEventListener("resize",v),document.removeEventListener(ln,v)}}),[r]);var b=c.default.createElement("div",{className:"table-default-cell",ref:f},r);return c.default.createElement(Vn,{data:null==p?void 0:p.toString()},a&&l?c.default.createElement(i.Link,u({to:l(s.original||s.values),className:"table-link"},d&&{target:"_blank",rel:"noopener noreferrer"}),b):b)}function Zd(e){var n,i=e.row,r=e.action,o=r.Icon,s=r.onClick,a=r.tooltipText,l=r.disabled,d=r.extraClass,h=p(((n={"icon-cell-btn":!0})[void 0===d?Qt:d]=!0,n));return c.default.createElement(Vn,{data:(a instanceof Function?a(i.original):a)||Qt},c.default.createElement("div",null,c.default.createElement(t.IconButton,{onClick:function(){return s(u(u({},i.original),i.state))},disabled:l instanceof Function?l(i.original):l,className:h},c.default.createElement(o,null))))}function Xd(e){var t=e.date,n=void 0===t?null:t,i=e.showSeconds,r=void 0===i||i,o=e.showTime,s=void 0===o||o,a=e.disabled,l=e.enableCustomFormat,u=void 0!==l&&l,d=e.customFormat,h=void 0===d?Tn:d,f=p({"datetime-label":!0,"datetime-label-disabled":a});return c.default.createElement("span",{className:f},n?s?u?"".concat(n.toFormat(h)," • ").concat(Xn.formatDate(n,r,!1).slice(9)):"".concat(Xn.formatDate(n,r,!1).slice(0,9)," • ").concat(Xn.formatDate(n,r,!1).slice(9)):"".concat(Xn.formatDate(n,!1,!1,!1)):Qt)}function Ud(e){var t=e.month,n=e.date,i=e.selected,r=e.onSelect,o=e.minDate,s=void 0===o?null:o,a=e.maxDate,l=void 0===a?null:a;function u(){return t!==n.month||!!l&&n>l||!!s&&nt?t:n)}}),c.default.createElement("div",{className:"arrow-buttons"},c.default.createElement(X,{className:"rotate180",onMouseDown:function(e){e.detail>1&&e.preventDefault()},onClick:function(){r((n+t+2)%(t+1))}}),c.default.createElement(X,{onMouseDown:function(e){e.detail>1&&e.preventDefault()},onClick:function(){r((n+t)%(t+1))}})))}function Kd(t){var i=t.time,r=t.onSubmit,o=t.showSeconds,s=void 0===o||o,a=t.onNowSubmit,l=t.showNow,d=void 0===l||l,f={hour:!1,minute:!1,second:!1},g=h(e.useState(f),2),m=g[0],v=g[1],b=h(e.useState(i?i.hour:0),2),y=b[0],w=b[1],C=h(e.useState(i?i.minute:0),2),x=C[0],S=C[1],E=h(e.useState(i?i.second:0),2),A=E[0],R=E[1];function I(e,t){var n,o={hour:y,minute:x,second:A};r(i.set(u(u({},o),((n={})[e]=t,n))))}var k=p({"datetime-time":!0,"datetime-time-hour-min-only":!s}),$=p({"time-selector":!0,"time-selector-no-now":!d});return c.default.createElement("div",{className:k},c.default.createElement("div",{className:$},d&&c.default.createElement(Gn,{extraClass:"time-selector-now-btn",onClick:function(){return a(n.DateTime.now())}},"Now"),c.default.createElement(Jd,{value:y,max:23,numTitle:$n,initialNumState:f,numFocus:m,setNumFocus:v,onChange:function(e){Number.isNaN(e)||(w(e),I($n,e))}}),c.default.createElement(Jd,{value:x,max:59,numTitle:_n,initialNumState:f,numFocus:m,setNumFocus:v,onChange:function(e){Number.isNaN(e)||(S(e),I(_n,e))}}),s&&c.default.createElement(Jd,{value:A,max:59,numTitle:Ln,initialNumState:f,numFocus:m,setNumFocus:v,onChange:function(e){Number.isNaN(e)||(R(e),I(Ln,e))}})))}function Qd(t){var i=t.onSubmit,r=t.initValue,o=void 0===r?n.DateTime.now():r,s=t.minDate,a=void 0===s?null:s,l=t.maxDate,u=void 0===l?null:l,d=t.showSeconds,f=void 0===d||d,g=t.showTime,p=void 0===g||g,m=t.canClear,v=void 0===m||m,b=t.showNow,y=h(e.useState(o),2),w=y[0],C=y[1];return c.default.createElement("div",{className:"calendar-wrapper"},c.default.createElement("div",null,c.default.createElement(Yd,{date:w,onSubmit:p?C:i,minDate:a,maxDate:u})),p?c.default.createElement(c.default.Fragment,null,c.default.createElement("div",null,c.default.createElement(Kd,{time:w,onSubmit:C,showSeconds:f,onNowSubmit:i,showNow:b})),c.default.createElement("div",{className:"calendar-actions"},c.default.createElement("div",{className:"calendar-actions-sub"},v&&c.default.createElement(Gn,{empty:!0,onClick:function(){return i(void 0)}},"Clear"),c.default.createElement(Gn,{onClick:function(){return i(w)}},"OK")))):null)}function qd(n){var i=n.onChange,r=n.value,o=n.label,s=void 0===o?Qt:o,a=n.minDate,l=n.maxDate,d=n.showSeconds,f=n.isRequired,g=n.error,m=n.disablePortal,v=n.showTime,b=n.showCalendarIcon,y=void 0!==b&&b,w=n.disabled,C=void 0!==w&&w,x=n.canClear,S=void 0===x||x,E=n.showNow,A=n.enableCustomFormat,R=n.customFormat,I=h(e.useState(!1),2),k=I[0],$=I[1],_=e.useRef(null),L=p({"picker-label":!0,"picker-label-disabled":C,"picker-label-active":k,"has-error":g,"picker-no-label":!s,"picker-label-show-calendar":y}),T=p({"datetime-picker":!0,"datetime-picker-no-label":!s});return c.default.createElement("div",{className:T,ref:_},c.default.createElement("div",{className:L,onClick:function(){return $((function(e){return!e}))}},s&&c.default.createElement("div",{className:"picker-label-title"},s,f&&c.default.createElement("span",{className:"required-star"},"*")),y?c.default.createElement(Ze,null):c.default.createElement(X,{className:p({rotate180:k})}),c.default.createElement("div",{className:"picker-label-text"},c.default.createElement(Xd,{date:r,showSeconds:d,showTime:v,disabled:C,enableCustomFormat:A,customFormat:R})),c.default.createElement("span",{className:"datetime-picker-error"},g)),c.default.createElement(t.Popper,{disablePortal:m,open:k,anchorEl:_.current,transition:!0,className:"popper-wrapper",nonce:void 0,onResize:void 0,onResizeCapture:void 0},(function(e){var n=e.TransitionProps;return c.default.createElement(t.Grow,u({},n,{style:{transformOrigin:"center top"}}),c.default.createElement(t.Paper,{className:"menu-popper menu-popper-calendar"},c.default.createElement(t.ClickAwayListener,{onClickAway:function(){return $(!1)}},c.default.createElement("div",{className:"date-time-wrapper"},c.default.createElement(Qd,{initValue:r,minDate:a,maxDate:l,onSubmit:function(e){i(e),$(!1)},showSeconds:d,showTime:v,canClear:S,showNow:E})))))})))}var eh=function(){return!1};function th(n){var i=n.setFilter,r=n.value,o=n.children,s=n.columnTitle,a=void 0===s?Qt:s,l=n.disabledBtnTooltip,d=void 0===l?Qt:l,f=n.hideWrapper,g=void 0!==f&&f,m=n.shouldDisableBtn,v=void 0===m?eh:m,b=n.isPopperOpen,y=n.onTogglePopper,w=h(Po(!1),2),C=w[0],x=w[1],S=null!=b?b:C,E=function(){y?y():x()},A=e.useRef(null),R=e.useRef(null);!function(t,n,i,r){function o(e){e.key===n&&i()}void 0===r&&(r="keydown"),e.useEffect((function(){return t.current&&t.current.addEventListener(r,o),function(){t.current&&t.current.removeEventListener(r,o)}}),[t.current,i])}(R,"Enter",k);var I=Xn.isEmpty(r)||Xn.isString(r)&&0===(null==r?void 0:r.trim().length)||v(r);function k(){I||(i(r),E())}return c.default.createElement("div",{className:"filter-table-wrapper"},c.default.createElement(Vn,{data:"Filter by ".concat(a.charAt(0).toUpperCase()).concat(a.slice(1))},c.default.createElement("span",{onClick:E,ref:A,className:"filter-table-wrapper-icon"},c.default.createElement(De,null))),S&&c.default.createElement(t.Popper,{open:S,anchorEl:A.current,transition:!0,className:"popper-wrapper",nonce:void 0,onResize:void 0,onResizeCapture:void 0},(function(e){var n=e.TransitionProps;return c.default.createElement(t.Grow,u({},n,{style:{transformOrigin:"center top"}}),c.default.createElement(t.Paper,null,c.default.createElement(t.ClickAwayListener,{onClickAway:E},g?o:c.default.createElement("div",{className:"filter-table-wrapper-data"},c.default.createElement("div",{className:p("filter-table-wrapper-inside-filter"),ref:R},o),c.default.createElement(Vn,{data:r&&v(r)?d:Qt},c.default.createElement("div",{className:"filter-table-wrapper-btn"},c.default.createElement(Gn,{disable:I,onClick:k},"Filter")))))))})))}function nh(t){var i=t.column,r=i.filterValue,o=i.setFilter,s=i.id,a=void 0===s?Qt:s,l=i.customTitle,u=void 0===l?Qt:l,d=i.Header,f=i.enableCustomFormat,g=i.customFormat,p=h(e.useState((null==r?void 0:r.startTime)?n.DateTime.fromISO(r.startTime):void 0),2),m=p[0],v=p[1],b=h(e.useState((null==r?void 0:r.endTime)?n.DateTime.fromISO(r.endTime):void 0),2),y=b[0],w=b[1],C=h(Po(!1),2),x=C[0],S=C[1];return e.useEffect((function(){r||(v(void 0),w(void 0))}),[r]),c.default.createElement(th,{setFilter:o,columnTitle:u||a||d,hideWrapper:!0,isPopperOpen:x,onTogglePopper:S},c.default.createElement("div",{className:"date-filter-wrapper"},c.default.createElement("div",null,c.default.createElement(qd,{onChange:v,value:m,label:"FROM",maxDate:y?y.endOf("day"):n.DateTime.now(),showSeconds:!0,enableCustomFormat:f,customFormat:g})),c.default.createElement("div",null,c.default.createElement(qd,{onChange:w,value:y,label:"TO",minDate:m&&m.startOf("day"),showSeconds:!0,enableCustomFormat:f,customFormat:g})),c.default.createElement("div",{className:"date-filter-controller"},c.default.createElement(Gn,{disable:!m&&!y,empty:!0,onClick:function(){v(void 0),w(void 0),o(void 0)}},"Clear"),c.default.createElement(Gn,{disable:!m&&!y,onClick:function(){o({startTime:(null==m?void 0:m.toJSDate().toISOString())||void 0,endTime:(null==y?void 0:y.toJSDate().toISOString())||void 0}),S()}},"Filter"))))}var ih=function(e,t,i){var r=e.startTime,o=e.endTime;return!(!r&&!o)&&(t?"".concat(r?n.DateTime.fromISO(r).toFormat(i):"Anytime"," → ").concat(o?n.DateTime.fromISO(o).toFormat(i):"Anytime"):"".concat(r?Xn.formatISODate(r,!1):"Anytime"," → ").concat(o?Xn.formatISODate(o,!1):"Anytime"))};function rh(t){var n=t.name,i=t.value,r=t.onDelete,o=t.hasCustomDateFormat,s=void 0!==o&&o,a=t.customDateFormat,l=void 0===a?Mn:a,u=e.useMemo((function(){if("string"==typeof i)return i;if(Array.isArray(i))return i.join(", ");if(e=i,Xn.isObject(e)&&("startTime"in e||"endTime"in e))return ih(i,s,l);var e;throw new Error("Unknown filter value!")}),[i]),d=e.useMemo((function(){return n.toUpperCase().replace(/\s/g,"")in cn?cn["".concat(n.toUpperCase().replace(/\s/g,""))]:n.split("_").join(" ")}),[]);return c.default.createElement("div",{className:"box-filter-container",key:n},c.default.createElement("span",{className:"filter-headline"},d,c.default.createElement(W,{onClick:r})),c.default.createElement("span",{className:"filter-data"},u))}function oh(t){var n=t.enabled,r=void 0===n||n,o=t.filterConfig,s=t.filterCategory,a=Fo({filterConfig:o}),l=i.useNavigate(),c=h(e.useState((function(){if(!r)return[];if(window.location.search){var e=new URLSearchParams(window.location.search),t=Xn.parseSearchParamsToObject(e);return o.flatMap((function(e){var n=e.id,i=e.filterParser,r=(void 0===i?hh:i)(t[n]);return r?{id:n,value:r}:[]}))}var n,i=(n=Dd.getItem(tn))&&JSON.parse(n)[s]||{},a=o.flatMap((function(e){var t=e.id,n=i[t];return n?{id:t,value:n}:[]}));return a})),2),u=c[0],d=c[1],g=e.useCallback((function(){var e=new URLSearchParams(window.location.search),t=u.filter((function(e){return!e.defaultFilter})),n=t.reduce((function(e,t){var n=t.id,i=t.value;return e[n]=i,e}),{});Dd.updateFilters(s,n),a.filterConfig.forEach((function(t){var n=t.id;e.delete(n),f([],h(e),!1).forEach((function(t){var i=h(t,1)[0];i.match(new RegExp("".concat(n,"\\[.+\\]")))&&e.delete(i)}))})),t.forEach((function(t){var n=t.id,i=t.value;Array.isArray(i)?i.forEach((function(t){Xn.isEmpty(t)||e.append(n,t.toString())})):Xn.isObject(i)?Object.entries(i).forEach((function(t){var i=h(t,2),r=i[0],o=i[1];Xn.isEmpty(o)||e.append("".concat(n,"[").concat(r,"]"),o.toString())})):Xn.isEmpty(i)||e.append(n,i.toString())})),l({pathname:window.location.pathname,search:"?".concat(e.toString())},{replace:!0})}),[s,u,l,a.filterConfig]);e.useEffect(g,[g]);var p=h(i.useSearchParams(),1)[0],m=e.useRef();return e.useEffect((function(){m.current!==window.location.search&&g(),m.current=window.location.search}),[g,p]),[u,d]}function sh(t){var n=t.column,i=n.filterValue,r=n.setFilter,o=n.preFilteredRows,s=n.id,a=void 0===s?Qt:s,l=n.Header,u=n.fixedOptions,d=h(e.useState(Xn.isEmpty(i)?[]:i),2),g=d[0],p=d[1],m=(u&&c.default.useMemo((function(){var e=new Set;return u.forEach((function(t){e.add(t)})),f([],h(e.values()),!1)}),[a,u])||c.default.useMemo((function(){var e=new Set;return null==o||o.forEach((function(t){e.add(t.values[a])})),f([],h(e.values()),!1)}),[a,o])).map((function(e){return Xn.formatOption(e)}));return c.default.createElement(th,{setFilter:r,value:g,columnTitle:l},c.default.createElement("div",{className:"table-select-filter"},c.default.createElement(kd,{options:m,onChange:p,value:g,autoFocus:!0})))}function ah(t){var n=t.column,i=n.filterValue,r=n.setFilter,o=n.customSetFilter,s=n.preFilteredRows,a=n.id,l=void 0===a?Qt:a,u=n.fixedOptions,d=n.Header,g=void 0===i?[]:Array.isArray(i)?i:[i],p=h(e.useState(g),2),m=p[0],v=p[1],b=(u&&c.default.useMemo((function(){var e=new Set;return u.forEach((function(t){m&&!m.includes(t)&&e.add(t)})),f([],h(e.values()),!1)}),[l,u,m])||c.default.useMemo((function(){var e=new Set;return null==s||s.forEach((function(t){if(m){var n=t.values[l];if(Xn.isEmpty(n))return;Array.isArray(n)?n.forEach((function(t){m.includes(t)||e.add(t)})):m.includes(n)||e.add(n)}})),f([],h(e.values()),!1)}),[l,s,m])).map((function(e){return Xn.formatOption(e)}));e.useEffect((function(){v(g)}),[JSON.stringify(g)]);return c.default.createElement(th,{setFilter:o||r,value:m,columnTitle:d},c.default.createElement("div",{className:"table-multi-select-filter"},c.default.createElement(kd,{options:b,onChange:function(e){v(f(f([],h(m),!1),[e],!1).sort())},value:null,autoFocus:!0,sortOptions:!0}),c.default.createElement("div",{className:"selected-options-wrapper"},m.map((function(e){return c.default.createElement("div",{key:e,className:"selected-option"},c.default.createElement(W,{onClick:function(){return t=e,n=m.filter((function(e){return e!==t})),void v(n);var t,n}}),c.default.createElement("span",{className:"dropdown-lines-1"},e))})))))}function lh(e){var t=e.column,n=t.filterValue,i=t.setFilter,r=t.byMinSeverity,o=void 0===r||r,s=h(Po(!1),2),a=s[0],l=s[1];return c.default.createElement(th,{setFilter:i,value:n,columnTitle:o?"Min. Severity":"Severity",hideWrapper:!0,isPopperOpen:a,onTogglePopper:l},c.default.createElement("div",{className:"severity-filter"},c.default.createElement("span",{className:"heading-4"},"Min. Severity"),Nn.map((function(e){var t,n=Bn[e],r=p(((t={"severity-wrapper":!0})[e.toLowerCase()]=!0,t));return c.default.createElement("div",{key:e,onClick:function(){i(e),l()},className:r},c.default.createElement("span",null,c.default.createElement(n,null)),e)}))))}function ch(t){var n=t.column,i=n.filterValue,r=n.setFilter,o=n.Header,s=d(n,["filterValue","setFilter","Header"]),a=h(e.useState(i),2),l=a[0],f=a[1];return e.useEffect((function(){f(i)}),[i]),c.default.createElement(th,u({setFilter:r,value:l,columnTitle:o},s),c.default.createElement("input",{autoFocus:!0,className:"table-text-filter",value:l||Qt,onChange:function(e){f(e.target.value||void 0)}}))}var uh={length:function(e,t,n){var i=e.values[n].length,r=t.values[n].length;return i===r?0:i>r?1:-1}},dh=new Map,hh=function(e){return Array.isArray(e)&&e[0]?e[0]:null};dh.set(nh,(function(e){var t,n,i,r;return Xn.isObject(e)&&((null===(t=null==e?void 0:e.startTime)||void 0===t?void 0:t[0])||(null===(n=null==e?void 0:e.endTime)||void 0===n?void 0:n[0]))?{startTime:null===(i=null==e?void 0:e.startTime)||void 0===i?void 0:i[0],endTime:null===(r=null==e?void 0:e.endTime)||void 0===r?void 0:r[0]}:null})),dh.set(ah,(function(e){return Array.isArray(e)?e:null})),dh.set(sh,hh),dh.set(lh,(function(e){return"string"==typeof e&&Nn.includes(e)?e:null})),dh.set(ch,hh);var fh=c.default.memo((function(n){var i,r=n.columns,o=n.data,s=n.rowActions,a=void 0===s?[]:s,l=n.tableActions,g=n.title,m=n.defaultSort,v=void 0===m?Qt:m,b=n.globalFilter,y=n.defaultGlobalFilter,w=void 0===y?Qt:y,C=n.checkRowSelected,x=n.checkRowHighlighted,S=n.getRowId,E=n.addFilterToUrl,A=n.RowSubComponent,R=n.listenerPrefix,I=n.onRowClick,k=void 0===I?qt:I,$=n.miniTable,_=n.filterCategory,L=n.fixedPageSize,T=n.disableActionsPortal,M=n.maxRows,O=n.emptyMessage,N=n.colPropForShowColumns,B=n.manualPagination,F=n.itemsAmount,P=n.canExpandAll,W=void 0!==P&&P,G=n.loading,H=n.onFiltersChanged,D=n.defaultDescendingSort,z=void 0!==D&&D,j=n.customRowActions,Z=n.onSortChanged,U=n.manualSorting,Y=n.manualFilters,J=n.extraClasses,Q=n.initialFilters,q=n.groupBy,ee=n.hasCustomDateFormat,te=n.customDateFormat,ne=n.hasResizableColumns,re=void 0!==ne&&ne,oe=n.hasEmptyActionsCell,se=void 0!==oe&&oe,ae=n.collapseRowsOnLeavingPage,le=void 0!==ae&&ae,ce=e.useMemo((function(){return null==Q?void 0:Q.map((function(e){return u(u({},e),{defaultFilter:!0})}))}),[Q]),ue=Dd.getItem(rn),de=ue&&JSON.parse(ue)[_]||r.filter((function(e){return e.defaultHidden})).map((function(e){var t=e.Header,n=e.accessor;return Xn.isString(n)?n:t})),he=Dd.getItem(on),fe=he&&JSON.parse(he)[_]||{columnWidths:{}},ge=c.default.useMemo((function(){return{Cell:jd,width:100,sortType:Xn.stringSort}}),[]),pe=h(function(t){var n=h(e.useState((function(){if(!t)return new Set;var e=Dd.getItem(nn);return new Set(e?JSON.parse(e):[])})),2),i=n[0],r=n[1];return[i,function(e){if(t){var n=new Set(e.map((function(e){return e.id}))),i=[];t.forEach((function(e){var t=e.id;n.has(t)||i.push(t)})),Dd.setItem(nn,JSON.stringify(i)),r(new Set(i))}}]}(ce),2),me=pe[0],ve=pe[1],be=e.useMemo((function(){return r.flatMap((function(e){var t,n=dh.get(e.Filter),i=null!==(t=e.id)&&void 0!==t?t:e.accessor;return n&&"string"==typeof i?{id:i,filterParser:n}:[]}))}),[r]),ye=h(oh({enabled:E,filterConfig:be,filterCategory:_}),2),we=ye[0],Ce=ye[1],xe=h(Po(!1),2),Se=xe[0],Ee=xe[1],Ae=Dd.getItem(sn),Re=h(Po(Ae&&Object.keys(JSON.parse(Ae)).includes(_)?JSON.parse(Ae)[_]:re),2),Ie=Re[0],ke=Re[1],$e=e.useRef(we).current,_e=void 0===$e?[]:$e,Le=e.useMemo((function(){return ce?f([],h(ce),!1).filter((function(e){var t=e.id;return!me.has(t)})).filter((function(e){var t=e.id;return!_e.find((function(e){return e.id===t}))})).concat(_e):_e}),[]),Te=Wd.exports.useTable.apply(void 0,f(f([{columns:r,data:o,manualPagination:B,defaultColumn:ge,globalFilter:b,initialState:u(u({pageSize:L||50},v&&{sortBy:[{id:v,desc:z}]}),{filters:Le,globalFilter:w,hiddenColumns:de,groupBy:q,columnResizing:fe}),autoResetFilters:!1,autoResetSortBy:!1,autoResetExpanded:le&&!Se&&B,autoResetPage:!1,autoResetRowState:!1,autoResetGlobalFilter:!1,autoResetHiddenColumns:!1,autoResetResize:!1,paginateExpandedRows:!1,getRowId:S,sortTypes:uh,manualSortBy:U,manualFilters:Y},Wd.exports.useRowState,Wd.exports.useFilters],h(q?[Wd.exports.useGroupBy]:[]),!1),[Wd.exports.useGlobalFilter,Wd.exports.useSortBy,Wd.exports.useExpanded,Wd.exports.usePagination,Wd.exports.useFlexLayout,Wd.exports.useResizeColumns],!1)),Me=Te.getTableProps,Oe=Te.getTableBodyProps,Ne=Te.headerGroups,Be=Te.rows,Fe=Te.allColumns,Pe=Te.prepareRow,We=Te.canPreviousPage,Ge=Te.canNextPage,He=Te.pageCount,De=Te.toggleSortBy,Ve=Te.gotoPage,ze=Te.nextPage,je=Te.setPageSize,Ze=Te.previousPage,Xe=Te.page,Ue=Te.state,Ye=Ue.pageIndex,Je=Ue.filters,Ke=Ue.columnResizing,Qe=Ue.sortBy,qe=Te.setFilter,et=Te.setAllFilters,tt=Te.visibleColumns,nt=Te.setHiddenColumns,it=Te.getToggleAllRowsExpandedProps,rt=Te.isAllRowsExpanded,ot=Te.resetResizing,st=e.useRef(Z);st.current=Z,e.useEffect((function(){var e;null===(e=st.current)||void 0===e||e.call(st,Qe[0])}),[Qe]),e.useEffect((function(){ve(Je)}),[Je]),e.useEffect((function(){re&&(Dd.updateResized(_,Ke),Xn.dispatchCustomEvent(ln,void 0))}),[JSON.stringify(Ke),_,re]),e.useEffect((function(){re&&Dd.updateResizedEnabled(_,Ie)}),[Ie,_,re]);var at=p({"empty-table":!Be.length,"react-table":!0}),lt=p({"mini-table":$,"scroll-wrapper":!0}),ct=e.useRef(null),ut=!!A,dt=e.useMemo((function(){return Je.filter((function(e){var t=e.id;return Fe.find((function(e){return t===e.id}))}))}),[Je]);function ht(e){var t,n=e.detail,i=n.value,r=n.id,o=(null===(t=Je.find((function(e){return e.id===r})))||void 0===t?void 0:t.value)||[],s=Array.isArray(o)?f([],h(o),!1):[o];(null==s?void 0:s.includes(i))?s.splice(s.indexOf(i),1):s.push(i),qe(r,Xn.isEmpty(s)?void 0:s)}e.useEffect((function(){null==H||H(Je),E&&Ce(Je)}),[Je,E]),e.useEffect((function(){nt((function(e){return Dd.updateHidden(_,e),e}))}),[tt.length]),e.useEffect((function(){return R?(document.addEventListener("".concat(R).concat(an),ht),Xn.dispatchCustomEvent("".concat(R).concat("table-filters"),Je),function(){document.removeEventListener("".concat(R).concat(an),ht)}):function(){}}),[Je]),e.useEffect((function(){Ve(0)}),[He]),e.useEffect((function(){var e;null===(e=ct.current)||void 0===e||e.scrollTo(0,0),le&&A&&!rt&&Be.forEach((function(e){e.isExpanded&&e.toggleRowExpanded(!1)}))}),[Ye,Be]),e.useEffect((function(){$&&!L&&je(Be.length)}),[Be.length]),e.useEffect((function(){L&&je(L)}),[L]);var ft=e.useCallback(ns.debounce((function(){var e,t=null===(e=ct.current)||void 0===e?void 0:e.clientHeight;!t||$||L||je(t/35)}),350),[]);return e.useEffect((function(){return ft(),window.addEventListener("resize",ft),function(){window.removeEventListener("resize",ft)}}),[]),c.default.createElement("div",{className:p("react-table-wrapper",null==J?void 0:J.tableWrapper)},!$&&c.default.createElement("div",{className:"table-top"},c.default.createElement("div",null,c.default.createElement("span",{className:"heading-4"},g),c.default.createElement("span",{className:"sub-title bold"},"".concat(F||Be.length," ").concat(M?"(max ".concat(M,")"):Qt)),Fe.length>2&&c.default.createElement(Vd,{columns:Fe,colProperty:N||"Header"}),W&&ut&&c.default.createElement("span",u({},it(),{className:"table-manipulations-btn"}),c.default.createElement(Vn,{data:rt?"Collapse all":"Expand all"},c.default.createElement(t.IconButton,{onClick:Ee},c.default.createElement(wt,{className:"".concat(rt?"rotate180":Qt)})))),re&&c.default.createElement("span",{className:p((i={},i["table-manipulations-btn"]=!0,i["resizing-btn-is-on"]=Ie,i))},c.default.createElement(Vn,{data:"".concat(Ie?"Disable":"Enable"," column resizing")},c.default.createElement(t.IconButton,{onClick:ke},c.default.createElement(Bt,null)))),re&&c.default.createElement("span",{className:"table-manipulations-btn"},c.default.createElement(Vn,{data:"Reset column resizing"},c.default.createElement(t.IconButton,{onClick:ot},c.default.createElement(Gt,null))))),!Xn.isEmpty(dt)&&c.default.createElement("div",{className:"table-filters"},!Xn.isEmpty(dt)&&dt.map((function(e){var t=e.id,n=e.value;return c.default.createElement(rh,{key:t,name:t,value:n,onDelete:function(){qe(t,void 0)},hasCustomDateFormat:ee,customDateFormat:te})})),c.default.createElement("div",{className:"table-filters-clear"},c.default.createElement(Vn,{data:"Clear Filters"},c.default.createElement(t.IconButton,{onClick:function(){et([])}},c.default.createElement(ie,null))))),c.default.createElement("div",{className:"table-actions"},l)),G?c.default.createElement(Wo,null):c.default.createElement("div",{className:lt,ref:ct},c.default.createElement("table",u({},Me(),{className:at}),c.default.createElement("thead",{className:"sticky-header"},Ne.map((function(e){var t=e.getHeaderGroupProps(),n=t.key,i=d(t,["key"]);return c.default.createElement("tr",u({},i,{key:n}),ut?c.default.createElement("th",{className:"table-header header-cell-for-expandable"}):null,e.headers.map((function(e){var t,n,i=e.getHeaderProps(),r=i.key,o=d(i,["key"]);return c.default.createElement("th",u({},o,{key:r,className:"table-header"}),c.default.createElement(Vn,{data:e.tooltip},c.default.createElement("span",{className:p((t={},t["table-headline"]=!0,t["disable-sort"]=e.disableSort,t)),onClick:function(){e.disableSort||De(e.id,void 0!==e.isSortedDesc&&!e.isSortedDesc)}},e.render("Header"))),e.Filter?e.render("Filter"):null,!e.disableSort&&(e.isSorted||!e.isSorted&&!e.Header)&&c.default.createElement("div",{className:p("table-sort",!e.isSorted&&!e.Header&&"table-sort-no-title"),onClick:function(){return De(e.id,!e.isSortedDesc)}},e.isSortedDesc?c.default.createElement(K,{className:"rotate180"}):c.default.createElement(K,null)),Ie&&!e.disableResize&&c.default.createElement("div",u({className:p((n={},n["column-resizer"]=!0,n["column-resizer-is-resizing"]=e.isResizing,n))},e.getResizerProps())))})),!Xn.isEmpty(j)&&j.map((function(e){var t=e.tooltipText;return c.default.createElement("th",{className:"table-header table-header-actions",key:t},Qt)})),(!Xn.isEmpty(a)||se&&Ie)&&c.default.createElement("th",{className:"table-header table-header-actions"},Qt))}))),c.default.createElement("tbody",u({},Oe(),{className:"table-body",emptymessage:O||"No ".concat(g||Be)}),Xe.map((function(e){var t,n=e;Pe(n);var i=p(u({"table-line":!0,clickable:k!==qt||ut,"is-expand":!n.isGrouped&&n.isExpanded,"is-selected":null==C?void 0:C(n.original),"is-highlighted":null==x?void 0:x(n.original)},(null==J?void 0:J.tableLine)&&((t={})[J.tableLine]=!0,t)));return c.default.createElement(c.default.Fragment,{key:n.getRowProps().key},c.default.createElement("tr",u({},n.getRowProps(),{className:i}),ut&&!q&&c.default.createElement("td",{className:p("expand-cell",null==J?void 0:J.expandCell),onClick:function(){A?n.getToggleRowExpandedProps().onClick():k&&k(n.original)}},n.isExpanded?c.default.createElement(X,null):c.default.createElement(X,{className:"rotate270"})),n.cells.map((function(e,t){var i=e.getCellProps(),o=i.key,s=d(i,["key"]),a=function(){if(e.isAggregated)return!0;if(!q)return!1;var t=e.column.groupedIndex;return t>q.indexOf(n.groupByID)&&e.row.depth=1?"var(--focus-s1)":i>.97?"var(--optimus-key)":"var(--accent-key)"}catch(e){return"var(--accent-key)"}}function mh(e){var t=Xn.getTimeDiffString(e).split(" ");return"0d"!==t[0]?{value:t[0],exactValue:t.join(" ")}:"0h"!==t[1]?{value:t[1],exactValue:t.slice(1).join(" ")}:{value:t[2],exactValue:t[2]}}exports.ActionsCell=zd,exports.ApiCallCell=function(t){var n=t.cell,i=n.value,r=n.column,o=n.state,s=n.setState,a=r,l=a.apiCall,u=a.propertyKey,d=a.errorText,f=h(e.useState(null),2),g=f[0],p=f[1],m=h(e.useState(!0),2),v=m[0],b=m[1];return e.useEffect((function(){!function e(t){void 0===t&&(t=0),l(i).then((function(e){s(e[u]),b(!1)})).catch((function(){t<2?setTimeout((function(){return e(t+1)}),3e3*(t+1)):(p(d),b(!1))}))}()}),[]),v?c.default.createElement(gh,null):c.default.createElement(li,null,g||o)},exports.BarCell=function(e){var t=e.cell.value;return c.default.createElement("div",{className:"bar-cell"},c.default.createElement("span",{className:"table-count-cell"},"".concat(t,"%")),c.default.createElement(Hn,{firstUsage:t/100,firstColor:"var(--accent-key)"}))},exports.BlocksCell=function(e){var t=e.cell,n=e.column,r=t.value,o=t.row,s=n,a=s.showTotalCountOnly,l=s.isLink,d=s.getUrl,h=s.openInNewTab,f=r.filter((function(e){var t=e.status;return t===un||t===hn||t===fn||t===dn})),g=c.default.createElement("div",{className:"blocks-cell"},c.default.createElement("span",{className:p({"table-count-cell":!0,"table-count-cell-is-link":l})},(null!=a?a:!r.length)?r.length:"".concat(f.length,"/").concat(r.length)),c.default.createElement("div",{className:"blocks-wrapper"},r.map((function(e){var t,n=e.uid,i=e.id,r=p(((t={block:!0})[e.status]=!0,t));return c.default.createElement("div",{key:null!=n?n:i,className:r})}))));return l&&d?c.default.createElement(i.Link,u({to:d(o.original||o.values)},h&&{target:"_blank",rel:"noopener noreferrer"}),g):c.default.createElement(c.default.Fragment,null,g)},exports.Button=Gn,exports.CapacityBar=Hn,exports.CapacityCell=function(e){var t=e.cell,n=t.value,i=t.column.noDataLabel,r=void 0===i?"Unknown":i,o=n.used,s=n.total,a=n.isThin,l=n.maxThin,u=n.minThin,d=n.caution,h=Xn.formatBytes(s,2),f=Xn.formatBytes(o,2),g=s?"".concat(f.value," ").concat(f.text," out of ").concat(h.value," ").concat(h.text," (").concat((o/s*100).toFixed(1),"%)"):r;return c.default.createElement("div",{className:"capacity-cell"},c.default.createElement("div",{className:"capacity-cell-headline"},c.default.createElement(li,{extraClasses:"label-4"},g),a&&c.default.createElement(Vn,{data:"Thinly Provisioned Filesystem\nMax SSD: ".concat(Xn.formatBytesToString(l),"\nMin SSD: ").concat(Xn.formatBytesToString(u))},c.default.createElement("div",{className:"thin-provision"}))),c.default.createElement("div",{className:"capacity-cell-data"},c.default.createElement(Hn,{firstUsage:s?o/s:0,firstColor:ph(o,s,d)})))},exports.Checkbox=jn,exports.CircularProgress=Dn,exports.CloseButton=function(){return c.default.createElement(t.IconButton,{className:"Toastify__close-button"},c.default.createElement(S,null))},exports.Copy=Bo,exports.CustomTooltipCell=function(e){var t=e.value,n=e.tooltipData,i=void 0===n?Qt:n;return c.default.createElement(Vn,{data:i},c.default.createElement("span",null,t))},exports.DataInfo=function(e){var t=e.label,n=e.value;return c.default.createElement("div",{className:"data-info"},c.default.createElement("div",{className:"data-info-label"},t),c.default.createElement("span",{className:"data-info-value body-copy-1"},n))},exports.DateCell=function(e){var t=e.cell,i=e.column,r=t.value,o=(null==i?void 0:i.showMili)?On:Mn,s=i.showMili,a=i.showRelative,l=i.relativeOnly,u=i.enableCustomFormat,d=void 0!==u&&u,h=i.customFormat,f=void 0===h?o:h,g=n.DateTime.fromISO(r),m=d?g.toFormat(f):Xn.formatISODate(r,s),v=Xn.getRelativeTimeFromISODate(r,!0),b=p({"table-date-cell":!0,"table-date-cell-regular":!a});return c.default.createElement(Vn,{data:g.toLocaleString({dateStyle:"full",timeStyle:"long"})},c.default.createElement("div",{className:b},l?v:a?c.default.createElement(c.default.Fragment,null,c.default.createElement("span",null,m),c.default.createElement("span",{className:"relative-time"}," (".concat(v,")"))):m))},exports.DateFilter=nh,exports.DateTimePicker=qd,exports.EmptyPageMessage=function(e){var t=e.children;return c.default.createElement("div",{className:"empty-page-message"},t)},exports.EntityCell=function(e){var t=e.cell.value,n=t===Wn?Et:kt;return c.default.createElement("div",{className:"events-entity-cell"},c.default.createElement(Vn,{data:t},c.default.createElement("span",{className:"events-entity-cell-wrapper"},c.default.createElement(n,null))))},exports.ErrorPage=function(e){var t=e.error,n=void 0===t?"Something went wrong. Please refresh the page and try again.":t;return c.default.createElement("div",{className:"error-page-wrapper data-important"},c.default.createElement("span",null,n))},exports.ExpandCollapseButton=ai,exports.FilterBox=rh,exports.FilterButton=function(e){var t,n=e.onClick,i=e.disable,r=e.extraClass,o=void 0===r?Qt:r,s=e.tooltipText,a=void 0===s?Qt:s,l=p(((t={})[o]=!0,t["filter-btn"]=!0,t));return c.default.createElement("div",null,c.default.createElement(Vn,{data:a},c.default.createElement("div",null,c.default.createElement(Gn,{onClick:n,disable:i,extraClass:l},c.default.createElement("div",{className:"filter-icon-wrapper"},c.default.createElement(De,{className:"filter-icon"}))))))},exports.FilterHeader=function(n){var i=n.title,r=n.setFilter,o=n.Filter,s=n.dataForFilter,a=n.filterKey,l=void 0===a?Qt:a,d=h(Po(!1),2),f=d[0],g=d[1],m=e.useRef(null),v=p({"filter-table-header":!0,"no-title":!i});return c.default.createElement("div",{className:v},c.default.createElement("span",null,i),c.default.createElement(Vn,{data:"Filter by"},c.default.createElement("span",{onClick:g,ref:m},c.default.createElement(De,null))),f&&c.default.createElement(t.Popper,{open:f,anchorEl:m.current,transition:!0,className:"popper-wrapper",nonce:void 0,onResize:void 0,onResizeCapture:void 0},(function(e){var n=e.TransitionProps;return c.default.createElement(t.Grow,u({},n,{style:{transformOrigin:"center top"}}),c.default.createElement(t.Paper,null,c.default.createElement(t.ClickAwayListener,{onClickAway:g},c.default.createElement("div",null,c.default.createElement(o,u({setFilter:function(e){var t;r(l?((t={})[l]=e,t):e),g()}},s))))))})))},exports.FormSwitch=function(e){var t=e.onChange,n=e.oneColor,i=e.value,r=e.label,o=e.placeholder;e.isRequired;var s=e.info,a=void 0===s?Qt:s,l=d(e,["onChange","oneColor","value","label","placeholder","isRequired","info"]);return c.default.createElement("div",{className:"form-switch"},c.default.createElement("div",null,c.default.createElement("span",{className:"form-switch-label"},r),a&&c.default.createElement(Vn,{data:a},c.default.createElement(I,{className:"form-switch-info"}))),c.default.createElement(Zn,u({onChange:t,oneColor:n,checked:i||o||!1},l)))},exports.IconButtonCell=Zd,exports.IconCell=function(e){var t=e.cell,n=t.value,i=t.column,r=t.row,o=i,s=o.Icon,a=o.extraClass,l=void 0===a?Qt:a,u=o.tooltipText,d=void 0===u?Qt:u,h=l instanceof Function?l(r.original):l,f=d instanceof Function?d(r.original):d;return c.default.createElement(Vn,{data:f},c.default.createElement("div",{className:p("icon-cell",h)},n&&c.default.createElement(s,null)))},exports.Info=zn,exports.IpRangeTextBox=function(t){var n,i=t.label,r=t.onChange,o=t.value,s=t.error,a=t.wrapperClass,l=void 0===a?"":a,g=t.subnet,m=t.disabled,v=t.isRequired,b=t.info,y=d(t,["label","onChange","value","error","wrapperClass","subnet","disabled","isRequired","info"]),w=e.useRef(null),C=function(e){var t,n,i=[];if(e)for(var r=null===(t=e.ip)||void 0===t?void 0:t.split("."),o=null===(n=e.mask)||void 0===n?void 0:n.split("."),s=0;s<4;s++)"255"===o[s]&&i.push(r[s]);return i}(g),x=h(o?o.split("-"):[f(f([],h(C),!1),["","","",""],!1).slice(0,4).join("."),""],2),S=x[0],E=x[1],A=h(e.useState(f(f([],h(S.split(".")),!1),[E],!1)),2),R=A[0],k=A[1],$=p(((n={})[l]=!0,n["ip-range-text-box-field"]=!0,n["ip-range-text-box-disabled"]=m,n["has-error"]=!!s,n));return e.useEffect((function(){g&&(R.slice(0,4).some(Xn.isEmpty)?r(Qt):r("".concat(R.slice(0,4).join(".")).concat(R[4]!==Qt?"-".concat(R[4]):Qt)))}),[]),e.useLayoutEffect((function(){if(w.current){var e=Array.from(w.current.getElementsByTagName("input"));(e.find((function(e){return e.value===Qt}))||e[0]).focus()}}),[]),c.default.createElement("div",{className:$},c.default.createElement("div",{className:"value-container",ref:w},Xn.range(5).map((function(e){return c.default.createElement("div",{className:"ip-part-value-edit",key:"input_".concat(e)},c.default.createElement("input",u({value:R[e],disabled:C.length>=e+1,onKeyDown:Un,type:"number",onChange:function(t){return function(e,t){var n=f([],h(R),!1);n[e]=t.target.value&&Math.max(0,Math.min(255,parseInt(t.target.value,10))),n[e]>=100&&Xn.goToNextInput(),k(n),n.slice(0,4).some(Xn.isEmpty)?r(Qt):r("".concat(n.slice(0,4).join(".")).concat(n[4]!==Qt?"-".concat(n[4]):Qt))}(e,t)}},y)),[".",".",".","-",Qt][e])}))),c.default.createElement("span",{className:"field__label-wrap"},c.default.createElement("span",{className:"field__label field-1-label-content"},i,v&&c.default.createElement("span",{className:"required-star"},"*"),!!b&&c.default.createElement(Vn,{data:b},c.default.createElement(I,null)))),c.default.createElement("span",{className:"ip-range-text-box-error capitalize-first-letter"},s))},exports.IpSubnetTextBox=function(t){var n,i=t.label,r=t.onChange,o=void 0===r?qt:r,s=t.value,a=t.error,l=t.wrapperClass,g=void 0===l?"":l,m=t.isRequired,v=t.info,b=d(t,["label","onChange","value","error","wrapperClass","isRequired","info"]),y=b.disabled,w=h(s?s.split("/"):["...",""],2),C=w[0],x=w[1],S=h(e.useState(f(f([],h(C.split(".")),!1),[Xn.subnet2MaskOp(x)],!1)),2),E=S[0],A=S[1],R=p(((n={})[g]=!0,n["ip-subnet-text-box-field"]=!0,n.disabled=y,n["has-error"]=!!a,n)),k=e.useRef(null);return e.useEffect((function(){var e,t=document.activeElement;t.parentNode&&t.parentNode.parentNode===k.current&&(null===(e=k.current)||void 0===e||e.firstElementChild.firstElementChild.focus())}),[k.current]),c.default.createElement("div",{className:R},c.default.createElement("div",{ref:k,className:"value-container"},Xn.range(5).map((function(e){return c.default.createElement("div",{className:"ip-part-value-edit",key:"input_".concat(e)},c.default.createElement("input",u({value:E[e],onKeyDown:Yn,type:"number",onChange:function(t){return function(e,t){var n=f([],h(E),!1);4===e?n[e]=t.target.value&&Math.max(0,Math.min(32,parseInt(t.target.value,10))):(n[e]=t.target.value&&Math.max(0,Math.min(255,parseInt(t.target.value,10))),n[e]>=100&&Xn.goToNextInput()),A(n),n.some(Xn.isEmpty)?o(Qt):o("".concat(n.slice(0,4).join("."),"/").concat(Xn.mask2SubnetOp(n.slice(4))))}(e,t)}},b)),[".",".",".","/"][e])}))),c.default.createElement("span",{className:"field__label-wrap"},c.default.createElement("span",{className:"field__label field-1-label-content"},i,m&&c.default.createElement("span",{className:"required-star"},"*"),!!v&&c.default.createElement(Vn,{data:v},c.default.createElement(I,null)))),c.default.createElement("span",{className:"ip-subnet-error capitalize-first-letter"},a))},exports.IpTextBox=function(t){var n,i=t.label,r=t.onChange,o=void 0===r?qt:r,s=t.value,a=t.error,l=t.wrapperClass,g=void 0===l?"":l,m=t.isRequired,v=t.info,b=d(t,["label","onChange","value","error","wrapperClass","isRequired","info"]),y=b.disabled,w=h(e.useState(s?s.split("."):["","","",""]),2),C=w[0],x=w[1],S=p(((n={})[g]=!0,n["ip-text-box-field"]=!0,n["ip-text-box-disabled"]=y,n["has-error"]=!!a,n));return c.default.createElement("div",{className:S},c.default.createElement("div",{className:"value-container"},Xn.range(4).map((function(e){return c.default.createElement("div",{className:"ip-part-value-edit",key:"input_".concat(e)},c.default.createElement("input",u({value:C[e],onKeyDown:Jn,type:"number",onChange:function(t){return function(e,t){var n=f([],h(C),!1);n[e]=t.target.value&&Math.max(0,Math.min(255,parseInt(t.target.value,10))),n[e]>=100&&Xn.goToNextInput(),x(n),n.some(Xn.isEmpty)?o(Qt):o(n.join("."))}(e,t)}},b)),3!==e?".":Qt)}))),c.default.createElement("span",{className:"field__label-wrap"},c.default.createElement("span",{className:"field__label field-1-label-content"},i,m&&c.default.createElement("span",{className:"required-star"},"*"),!!v&&c.default.createElement(Vn,{data:v},c.default.createElement(I,null)))),c.default.createElement("span",{className:"ip-text-box-error capitalize-first-letter"},a))},exports.JsonBox=function(e){var t,n=e.label,i=e.error,r=e.wrapperClass,o=void 0===r?"":r,s=e.info,a=e.isRequired,l=e.disabled,h=d(e,["label","error","wrapperClass","info","isRequired","disabled"]),f=p(((t={"json-box":!0,"has-error":!!i})[o]=!0,t));return c.default.createElement("div",{className:f},c.default.createElement("span",{className:"json-box__label field-1-label-content"},n,a&&c.default.createElement("span",{className:"required-star"},"*"),!!s&&c.default.createElement(Vn,{data:s},c.default.createElement(I,null))),c.default.createElement(ss,u({readOnly:l},h,{tabSize:2})),c.default.createElement("span",{className:"json-box-error capitalize-first-letter"},i))},exports.Loader=Wo,exports.LoginField=function(e){var t,n=e.label,i=e.onChange,r=e.value,o=void 0===r?Qt:r,s=e.error,a=e.placeholder,l=e.type,f=e.wrapperClass,g=void 0===f?Qt:f,m=e.tooltip,v=e.isRequired,b=d(e,["label","onChange","value","error","placeholder","type","wrapperClass","tooltip","isRequired"]),y=h(Po(!1),2),w=y[0],C=y[1],x=p(((t={})[g]=!0,t["login-text-field"]=!0,t["has-error"]=!!s,t)),S=p({"login-field-input":!0,"is-type-password-login":"password"===l});return c.default.createElement("div",{className:x},c.default.createElement("span",{className:"login-field-label"},c.default.createElement("span",{className:"body-copy-1"},n),v&&c.default.createElement("span",{className:"required-star"},"*"),m?c.default.createElement(zn,{data:m}):null),c.default.createElement("input",u({autoComplete:"new-password",className:S,placeholder:a,type:w&&"password"===l?"text":l,value:o,onChange:function(e){i(Number.isNaN(e.target.valueAsNumber)?e.target.value:e.target.valueAsNumber)}},b)),"password"===l&&c.default.createElement("span",{className:"login-password-icon"},Xn.getPasswordIcon(w,C)),c.default.createElement("span",{className:"text-login-error capitalize-first-letter"},s))},exports.MenuPopper=Nd,exports.MultiSelectFilter=ah,exports.MultilineCell=function(e){var t=e.cell.value;return c.default.createElement("div",{className:"multiline-cell"},null==t?void 0:t.map((function(e,t){return c.default.createElement("div",{key:t},e?c.default.createElement(li,{extraClasses:"tooltip"},e):c.default.createElement("br",null))})))},exports.NewPasswordTooltip=function(e){var t=e.passValue,n=Fd(void 0===t?Qt:t);return c.default.createElement("div",{className:"password-min-demand"},c.default.createElement("span",{className:"demand-headline"},"Password must contain:"),c.default.createElement("span",{className:n.length>=8?"valid":Qt},"● At least 8 characters"),c.default.createElement("span",{className:n.contains.includes("uppercase")?"valid":Qt},"● Uppercase letter"),c.default.createElement("span",{className:n.contains.includes("lowercase")?"valid":Qt},"● Lowercase letter"),c.default.createElement("span",{className:n.contains.includes("number")||n.contains.includes("symbol")?"valid":Qt},"● Number or special character"))},exports.NodeCell=function(e){var t=e.cell.value,n=t.nid,i=t.isBackend,r=t.roles,o=p({"is-backend":i,"is-client":!i}),s=(null==r?void 0:r.length)?"(".concat(null==r?void 0:r.reduce((function(e,t){return Fn[t]?e.push(Fn[t]):e.push(t),e}),[]).join(", "),") "):Qt;return c.default.createElement(Vn,{data:"".concat(n," ").concat(s," (").concat(i?"Backend":"Client",")")},c.default.createElement("div",{className:"node-cell"},c.default.createElement("span",null,n," "),i&&c.default.createElement("span",null,s),c.default.createElement("span",{className:o},i?"(B)":" (C)")))},exports.NumInput=Jd,exports.Pagination=function(n){var i=n.onPageChange,r=n.totalRows,o=n.rowsPerPage,s=n.defaultCurrentPage,a=n.isLoading,l=h(e.useState(s),2),u=l[0],d=l[1],f=h(e.useState(!1),2),g=f[0],p=f[1],m=h(e.useState(!0),2),v=m[0],b=m[1],y=Math.ceil(r/o);return e.useEffect((function(){d(s)}),[s]),e.useEffect((function(){i(u)}),[u]),e.useEffect((function(){b(!(y===u||!y)),p(1!==u)}),[y,u]),a?null:c.default.createElement("div",{className:"pagination-footer"},c.default.createElement("div",{className:"pagination-wrapper"},c.default.createElement("div",{className:"pagination"},c.default.createElement(Vn,{data:g?"First Page":Qt},c.default.createElement("div",null,c.default.createElement(t.IconButton,{onClick:function(){return d(1)},className:"pagination-arrow",disabled:!g},c.default.createElement(V,{className:"rotate180"})))),c.default.createElement(Vn,{data:g?"Previous Page":Qt},c.default.createElement("div",null,c.default.createElement(t.IconButton,{onClick:function(){return d((function(e){return e-1}))},className:"pagination-arrow",disabled:!g},c.default.createElement(X,{className:"rotate90"})))),c.default.createElement("div",null,c.default.createElement("span",{className:"note"},"".concat(u," / ").concat(y||1," "))),c.default.createElement(Vn,{data:v?"Next Page":Qt},c.default.createElement("div",null,c.default.createElement(t.IconButton,{onClick:function(){return d((function(e){return e+1}))},disabled:!v,className:"pagination-arrow"},c.default.createElement(X,{className:"rotate270"})))),c.default.createElement(Vn,{data:v?"Last Page":Qt},c.default.createElement("div",null,c.default.createElement(t.IconButton,{onClick:function(){return d(y)},disabled:!v,className:"pagination-arrow"},c.default.createElement(V,null)))))))},exports.PerPage=function(e){var t=e.value,n=e.onChange,i=e.options,r=void 0===i?Pn:i;return c.default.createElement("div",{className:"per-page"},c.default.createElement(kd,{value:t,options:r,wrapperClass:"per-page-select",onChange:n}),c.default.createElement("span",null,"per page"))},exports.ProgressCell=function(e){var t=e.cell.value,n=t.status,i=t.progress,r="N/A"!==i?"".concat(n," - ").concat(i):n;return c.default.createElement("div",null,r)},exports.RadioSwitch=function(e){var n=e.label,i=e.checked,r=e.onChange,o=e.value,s=e.disabled,a=e.info,l=p({disabled:s,"radio-switch":!0});return c.default.createElement("div",{className:l},c.default.createElement(t.Radio,{classes:{root:"radio-btn"},checked:i,disabled:s,onChange:function(e){r(e.target.value)},value:o}),c.default.createElement("span",{className:"radio-label"},n,!!a&&c.default.createElement(Vn,{data:a},c.default.createElement(I,null))))},exports.Select=kd,exports.SelectFilter=sh,exports.SeverityCell=function(e){var t,n=e.cell.value,i=Bn[n],r=p(((t={"event-severity":!0})[n.toLowerCase()]=!0,t));return c.default.createElement(Vn,{data:n,placement:"right"},c.default.createElement("div",{className:r},i?c.default.createElement(i,null):n))},exports.SeverityFilter=lh,exports.SpanTooltip=li,exports.StatusCell=function(e){var t=e.cell,n=t.value,i=t.column,r=t.row,o=i,s=o.getTooltip,a=o.showString,l=null==n?void 0:n.replaceAll("_"," "),u=s?s(r.original):l;return c.default.createElement(Vn,{data:u},c.default.createElement("div",{className:"status-cell-wrapper"},function(e){switch(e){case gn:case pn:case vn:case yn:case wn:return c.default.createElement(de,{className:"up"});case Cn:return c.default.createElement(xe,{className:"updating"});case xn:case En:return c.default.createElement(be,{className:"working"});case mn:return c.default.createElement(Re,{className:"degraded-status"});case Sn:case bn:case dn:case fn:return c.default.createElement(be,{className:"working"});default:return c.default.createElement(_e,{className:"down"})}}(n),a&&c.default.createElement("span",{className:"status-string"},l)))},exports.Summary=function(e){var t=e.title,n=e.children,i=e.expanded,r=e.onExpand,o=h(Po(!0),2),s=o[0],a=o[1],l=null!=i?i:s;return c.default.createElement("div",{className:"summary"},c.default.createElement("button",{className:p({title:!0,"title-expanded":l}),onClick:function(){a(),null==r||r(!l)}},c.default.createElement(X,{className:p({arrow:!0,"arrow-expanded":l})}),c.default.createElement(li,null,t)),l&&c.default.createElement("div",{className:"content"},n))},exports.Switch=Zn,exports.SwitchCell=function(e){var t=e.cell,n=e.column,i=e.row,r=t.value,o=n,s=o.onChange,a=o.tooltipText,l=void 0===a?Qt:a,u=l instanceof Function?l(r):l;return c.default.createElement(Vn,{data:u},c.default.createElement("div",{className:"switch-cell"},c.default.createElement(Zn,{onClick:function(e){return e.stopPropagation()},checked:r,onChange:function(){return s(i)}})))},exports.Tab=function(e){var t,n=e.title,r=e.subComponent,o=void 0===r?null:r,s=e.active,a=e.setActive,l=e.wrapperClass,u=void 0===l?Qt:l,d=e.disabled,h=void 0!==d&&d,f=e.isSideTab,g=void 0!==f&&f,m=e.isSubTab,v=void 0!==m&&m,b=e.navigateTo,y=p(((t={"custom-tab":!0,"custom-tab-side":g,"custom-tab-sub":v,"tab-active":s})[u]=!0,t.disabled=h,t)),w=c.default.createElement("div",{className:y,onClick:a},c.default.createElement("div",{className:"tab-title"},n),o);return b?c.default.createElement(i.Link,{to:b,className:"link-tab"},w):c.default.createElement(c.default.Fragment,null,w)},exports.Table=fh,exports.TagsBox=Md,exports.TextArea=function(e){var t,n=e.label,i=e.onChange,r=e.value,o=e.error,s=e.placeholder,a=e.wrapperClass,l=void 0===a?"":a,h=e.isRequired,f=e.info,g=e.tooltip,m=void 0===g?Qt:g,v=e.disabled,b=void 0!==v&&v,y=d(e,["label","onChange","value","error","placeholder","wrapperClass","isRequired","info","tooltip","disabled"]);var w=p(((t={})[l]=!0,t["text-area-field"]=!0,t["has-error"]=!!o,t));return c.default.createElement("div",{className:w},c.default.createElement(Vn,{data:m},c.default.createElement("textarea",u({className:"field__input",placeholder:s,value:null===r?Qt:r,onChange:function(e){i(e.target.value)},disabled:b},y))),c.default.createElement("span",{className:"field__label-wrap"},c.default.createElement("span",{className:"field__label field-1-label-content"},n,h&&c.default.createElement("span",{className:"required-star"},"*"),!!f&&c.default.createElement(Vn,{data:f},c.default.createElement(I,null)))),c.default.createElement("span",{className:"text-area-error capitalize-first-letter"},o))},exports.TextBox=Od,exports.TextEditor=ss,exports.TextField=function(e){var t,n=e.label,i=e.onChange,r=e.value,o=e.error,s=e.wrapperClass,a=e.secondLabel,l=d(e,["label","onChange","value","error","wrapperClass","secondLabel"]),h=p(((t={})[s]=!0,t["text-field"]=!0,t["has-error"]=!!o,t));return c.default.createElement("div",{className:h},c.default.createElement("span",{className:"text-field-first-label label-5"},n),c.default.createElement("div",{className:"field-input-wrapper"},c.default.createElement("input",u({className:"field__input",value:r||Qt,onChange:function(e){i(Number.isNaN(e.target.valueAsNumber)?e.target.value:e.target.valueAsNumber)}},l)),c.default.createElement("span",{className:"text-field-error capitalize-first-letter"},o)),c.default.createElement("span",{className:"text-field-second-label label-5"},a))},exports.TextFilter=ch,exports.TextSelectBox=function(t){var n,i=t.label,r=t.onChange,o=t.value,s=t.wrapperClass,a=void 0===s?"":s,l=t.options,f=t.formatFunc,g=t.info,m=t.selectPlaceholder,v=t.error,b=t.isRequired,y=d(t,["label","onChange","value","wrapperClass","options","formatFunc","info","selectPlaceholder","error","isRequired"]),w=f(o),C=w.number,x=w.unit,S=h(e.useState(C),2),E=S[0],A=S[1],R=h(e.useState(x.value||m),2),I=R[0],k=R[1],$=p(((n={})[a]=!0,n["has-error"]=!!v,n["text-select-wrapper"]=!0,n));return c.default.createElement("div",{className:$},c.default.createElement("span",{className:"text-select-label field-1-label-content"},i,b&&c.default.createElement("span",{className:"required-star"},"*"),g&&c.default.createElement(zn,{data:g})),c.default.createElement(Od,u({value:E,type:"number",onChange:function(e){Xn.isEmpty(e)?r(void 0):Xn.isEmpty(I)||r(Math.floor(I*e)),A(e)}},y)),c.default.createElement("div",{className:"spread-line"}),c.default.createElement(kd,{value:I,options:l,onChange:function(e){Xn.isEmpty(e)||Xn.isEmpty(E)?r(void 0):r(Math.floor(E*e)),k(e)}}),c.default.createElement("span",{className:"text-select-error capitalize-first-letter"},v))},exports.TieringCell=function(e){var t=e.cell.value;return c.default.createElement("div",{className:"tiering-cell"},t.map((function(e){return function(e){var t=e.mode,n=e.name,i=e.state,r=e.detachProgress,o=void 0===r?0:r;if("DETACHING"===i)return c.default.createElement(Vn,{data:"Object Store Bucket is being detached",key:n},c.default.createElement("div",null,c.default.createElement(Dn,{progress:"number"==typeof o?o:void 0})));var s=t===An?Pe:Oe;return c.default.createElement(s,{key:n,className:t.toLowerCase()})}(e)})))},exports.TimeCell=function(e){var t=e.cell.value,i=n.Duration.fromMillis(1e3*t).shiftTo("months","weeks","days","hours","minutes","seconds").toObject(),r=Qt,o=Qt,s={};return Object.entries(i).forEach((function(e){var t=h(e,2),n=t[0],i=t[1];i&&(s[n]=i,r+="".concat(i).concat(Rn[n]," "))})),Object.entries(s).forEach((function(e,t){var n=h(e,2),i=n[0],r=n[1];t<2&&(o+="".concat(r).concat(Rn[i]," "))})),c.default.createElement(Vn,{data:r},c.default.createElement("div",null,t?o:Qt))},exports.Toast=Pd,exports.ToggleButton=function(t){var n=t.options,i=t.value,r=t.onChange,o=e.useRef(null);return e.useEffect((function(){o.current&&Array.from(o.current.children).forEach((function(e){e.getAttribute("data-value")===i&&function(e){if(e){var t=e&&e.parentNode&&e.parentNode.parentNode&&e.parentNode.parentNode.firstChild;t&&(t.style.width="".concat(e.offsetWidth,"px"),t.style.height="".concat(e.offsetHeight+5,"px"),t.style.transform="translateX(".concat(e.offsetLeft,"px)"),t.style.display="block",Array.from(e.parentNode.children).forEach((function(e){return e.classList.remove("toggle-button-option-selected")})),e.classList.add("toggle-button-option-selected"))}}(e)}))}),[i]),c.default.createElement("div",{className:"toggle-button"},c.default.createElement("div",{className:"toggle-button-pad"}),c.default.createElement("div",{className:"toggle-button-options",ref:o},n.map((function(e){return c.default.createElement("span",{className:"toggle-button-option",key:e.value,"data-value":e.value,onClick:function(){r(e.value)}},e.label)}))))},exports.Tooltip=Vn,exports.UploadField=function(n){var i,r=n.label,o=n.onChange,s=void 0===o?qt:o,a=n.disabled,l=n.wrapperClass,f=void 0===l?"":l,g=n.placeholder,m=n.error,v=n.onReadError,b=n.tooltipText,y=void 0===b?Qt:b,w=n.shouldBeBinary,C=void 0!==w&&w,x=d(n,["label","onChange","disabled","wrapperClass","placeholder","error","onReadError","tooltipText","shouldBeBinary"]),S=e.useId(),E=h(e.useState(Qt),2),A=E[0],R=E[1],I=p(((i={"upload-wrapper":!0})[f]=!0,i["upload-wrapper-disabled"]=a,i));return c.default.createElement(Vn,{data:y},c.default.createElement("div",{className:I},c.default.createElement("input",u({id:S,disabled:a,placeholder:g,type:"file",onClick:function(e){e.stopPropagation(),e.target.value=Qt},onChange:function(e){return function(e){if(C)s(e);else try{var t=new FileReader;t.onload=function(t){R(e.name),s(t.target.result)},t.readAsText(e)}catch(e){v()}}(e.target.files[0])}},x)),c.default.createElement("label",{htmlFor:S,className:"button small",onClick:function(e){return e.stopPropagation()}},r),c.default.createElement("span",{className:"upload-field-error capitalize-first-letter"},m),A&&c.default.createElement("div",{className:"file-name-wrapper"},c.default.createElement(li,{extraClasses:"file-name"},A),c.default.createElement(t.IconButton,{onClick:function(){R(Qt),s(Qt)}},c.default.createElement(W,null)))))},exports.UptimeCell=function(t){var n=t.cell.value,i=h(e.useState(mh(n).value),2),r=i[0],o=i[1],s=h(e.useState(mh(n).exactValue),2),a=s[0],l=s[1];return e.useEffect((function(){var e=setInterval((function(){o(mh(n).value),l(mh(n).exactValue)}),1e4);return function(){clearInterval(e)}}),[n]),c.default.createElement(Vn,{data:a},c.default.createElement("div",null,r))},exports.Utils=Xn,exports.useUrlFilters=oh; //# sourceMappingURL=index.js.map diff --git a/dist/cjs/index.js.map b/dist/cjs/index.js.map index bb38c75c..7377edb0 100644 --- a/dist/cjs/index.js.map +++ b/dist/cjs/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../../src/svgs/114-copy-16.svg","../../node_modules/tslib/tslib.es6.js","../../node_modules/clsx/dist/clsx.mjs","../../src/svgs/141-close-12.svg","../../src/svgs/018-info-16.svg","../../src/svgs/104-view-16.svg","../../src/svgs/142-close-16.svg","../../src/svgs/026-close-8.svg","../../src/svgs/065-last-8.svg","../../src/svgs/015-arrow-8.svg","../../src/svgs/143-arrow-16.svg","../../src/svgs/139-filter-cancel-16.svg","../../src/svgs/019-menu-16.svg","../../src/svgs/icn-status-connected.svg","../../src/svgs/115-propeller-24.svg","../../src/svgs/elipces.svg","../../src/svgs/025-warning-24.svg","../../src/svgs/icn-status-disconnected.svg","../../src/svgs/082-tiered-24.svg","../../src/svgs/080-tiered-remote-24.svg","../../src/svgs/038-filter-16.svg","../../src/svgs/empty-calendar.svg","../../src/svgs/032-warning-debug-24.svg","../../src/svgs/033-info-24.svg","../../src/svgs/034-accident-minor-24.svg","../../src/svgs/035-accident-major-24.svg","../../src/svgs/036-accident-critical-24.svg","../../src/svgs/031-warning-24.svg","../../src/svgs/079-arrow-12.svg","../../src/svgs/017-user-16.svg","../../src/svgs/043-weka-16.svg","../../src/svgs/016-checkmark-10.svg","../../src/svgs/188-column-resize-enable-16.svg","../../src/svgs/189-column-resize-reset-16.svg","../../src/svgs/193-fontSize-enlarge-16.svg","../../src/svgs/194-fontSize-reduce-16.svg","../../src/svgs/047-search-16.svg","../../src/consts.ts","../../src/components/Button/Button.tsx","../../src/components/CapacityBar/CapacityBar.tsx","../../src/components/CircularProgress/CircularProgress.tsx","../../src/components/Tooltip/Tooltip.tsx","../../src/components/Info/Info.tsx","../../src/components/inputs/Checkbox/Checkbox.tsx","../../src/components/Switch/Switch.tsx","../../src/utils.tsx","../../src/components/inputs/IpRangeTextBox/IpRangeTextBox.tsx","../../src/components/inputs/IpSubnetTextBox/IpSubnetTextBox.tsx","../../src/components/inputs/IpTextBox/IpTextBox.tsx","../../node_modules/react-use/esm/misc/util.js","../../node_modules/copy-to-clipboard/index.js","../../node_modules/toggle-selection/index.js","../../node_modules/react-use/esm/useLocalStorage.js","../../src/components/TextEditor/components/FontSizeControls/FontSizeControls.tsx","../../src/components/TextEditor/context/context.tsx","../../src/components/ExpandCollapseButton/ExpandCollapseButton.tsx","../../src/components/SpanTooltip/SpanTooltip.tsx","../../node_modules/ace-builds/src-noconflict/ace.js","../../node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js","../../node_modules/prop-types/node_modules/react-is/index.js","../../node_modules/object-assign/index.js","../../node_modules/prop-types/lib/ReactPropTypesSecret.js","../../node_modules/prop-types/lib/has.js","../../node_modules/prop-types/checkPropTypes.js","../../node_modules/prop-types/factoryWithTypeCheckers.js","../../node_modules/prop-types/factoryWithThrowingShims.js","../../node_modules/prop-types/index.js","../../node_modules/lodash.isequal/index.js","../../node_modules/react-ace/lib/editorOptions.js","../../node_modules/react-ace/lib/ace.js","../../node_modules/ace-builds/src-noconflict/ext-split.js","../../node_modules/lodash.get/index.js","../../node_modules/react-ace/lib/split.js","../../node_modules/diff-match-patch/index.js","../../node_modules/react-ace/lib/diff.js","../../node_modules/react-ace/lib/index.js","../../src/components/Copy/Copy.tsx","../../src/hooks/useStaticProps.ts","../../src/hooks/useToggle.ts","../../src/components/Loader/Loader.tsx","../../node_modules/ace-builds/src-noconflict/mode-json.js","../../node_modules/ace-builds/src-min-noconflict/ext-searchbox.js","../../src/components/TextEditor/components/TextEditorFull/TextEditorFull.tsx","../../src/components/TextEditor/components/TextEditorFull/hooks/useSearch.ts","../../src/components/TextEditor/components/TextEditorFull/hooks/useOnlyMatching.ts","../../src/components/TextEditor/components/TextEditorFull/hooks/useFoldAll.ts","../../src/components/TextEditor/components/TextEditorFull/hooks/useLinePosition.ts","../../src/components/TextEditor/components/TextEditorFull/hooks/useTags.ts","../../src/components/TextEditor/components/TextEditorFull/hooks/useEditor.ts","../../node_modules/@tanstack/react-virtual/build/lib/_virtual/_rollupPluginBabelHelpers.mjs","../../node_modules/@tanstack/virtual-core/build/lib/_virtual/_rollupPluginBabelHelpers.mjs","../../node_modules/@tanstack/virtual-core/build/lib/utils.mjs","../../node_modules/@tanstack/virtual-core/build/lib/index.mjs","../../node_modules/@tanstack/react-virtual/build/lib/index.mjs","../../node_modules/lodash/lodash.js","../../src/components/TextEditor/components/TextViewerLite/TextViewerLite.tsx","../../src/components/TextEditor/components/TextViewerLite/hooks/useScrolledX.ts","../../src/components/TextEditor/components/TextViewerLite/hooks/useCharacterSize.ts","../../src/components/TextEditor/TextEditor.tsx","../../src/components/TextEditor/hooks/useTags.ts","../../src/components/TextEditor/hooks/useLinesCount.ts","../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../src/components/TextEditor/components/TagsInput/TagsInput.tsx","../../src/components/TextEditor/components/FoldAllButton/FoldAllButton.tsx","../../src/components/TextEditor/components/LinesCount/LinesCount.tsx","../../src/components/TextEditor/components/SearchButton/SearchButton.tsx","../../node_modules/react-select/dist/useStateManager-7e1e8489.esm.js","../../node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/@babel/runtime/helpers/esm/createClass.js","../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../../node_modules/@babel/runtime/helpers/esm/createSuper.js","../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../../node_modules/@emotion/cache/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js","../../node_modules/stylis/src/Enum.js","../../node_modules/stylis/src/Utility.js","../../node_modules/stylis/src/Tokenizer.js","../../node_modules/stylis/src/Parser.js","../../node_modules/stylis/src/Serializer.js","../../node_modules/stylis/src/Middleware.js","../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","../../node_modules/@emotion/cache/dist/emotion-cache.esm.js","../../node_modules/@emotion/cache/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js","../../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js","../../node_modules/hoist-non-react-statics/node_modules/react-is/index.js","../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../../node_modules/@emotion/react/node_modules/@emotion/utils/dist/emotion-utils.esm.js","../../node_modules/@emotion/react/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","../../node_modules/@emotion/react/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js","../../node_modules/@emotion/react/node_modules/@emotion/hash/dist/emotion-hash.esm.js","../../node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.esm.js","../../node_modules/@emotion/react/dist/emotion-element-3838ba9e.esm.js","../../node_modules/@emotion/react/dist/emotion-react.esm.js","../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../../node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js","../../node_modules/react-select/dist/index-a86253bb.esm.js","../../node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js","../../node_modules/memoize-one/dist/memoize-one.esm.js","../../node_modules/react-select/dist/Select-40119e12.esm.js","../../node_modules/@babel/runtime/helpers/esm/inherits.js","../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../../node_modules/react-select/dist/react-select.esm.js","../../src/components/inputs/Select/SelectOption/SelectOption.tsx","../../src/components/inputs/Select/SingleValue/SingleValue.tsx","../../src/components/inputs/Select/MultiValue/MultiValue.tsx","../../src/components/inputs/Select/ClearIndicator/ClearIndicator.tsx","../../src/components/inputs/Select/MenuList/MenuList.tsx","../../src/components/inputs/Select/Select.tsx","../../node_modules/react-select/dist/useCreatable-36230047.esm.js","../../node_modules/react-select/creatable/dist/react-select-creatable.esm.js","../../src/components/inputs/TagsBox/TagsBox.tsx","../../src/components/inputs/TextArea/TextArea.tsx","../../src/components/inputs/TextBox/TextBox.tsx","../../src/components/MenuPopper/MenuPopper.tsx","../../node_modules/check-password-strength/dist/es.js","../../src/components/Toast/Toast.tsx","../../node_modules/react-table/dist/react-table.production.min.js","../../node_modules/react-table/dist/react-table.development.js","../../node_modules/react-table/index.js","../../src/localStorageService.ts","../../src/components/Table/ShowColumns/ShowColumns.tsx","../../src/components/Table/cells/ActionsCell/ActionsCell.tsx","../../src/components/Table/cells/DefaultCell/DefaultCell.tsx","../../src/components/Table/cells/IconButtonCell/IconButtonCell.tsx","../../src/components/DateTimePicker/components/DateTimeLabel/DateTimeLabel.tsx","../../src/components/DateTimePicker/components/DayCell/DayCell.tsx","../../src/components/DateTimePicker/components/DateSelector/DateSelector.tsx","../../src/components/DateTimePicker/components/NumInput/NumInput.tsx","../../src/components/DateTimePicker/components/TimeSelector/TimeSelector.tsx","../../src/components/DateTimePicker/components/DateTimeCalendar/DateTimeCalendar.tsx","../../src/components/DateTimePicker/DateTimePicker.tsx","../../src/components/Table/filters/FilterWrapper/FilterWrapper.tsx","../../src/hooks/useKeyEvent.ts","../../src/components/Table/filters/DateFilter/DateFilter.tsx","../../src/components/FilterBox/FilterBox.tsx","../../src/components/Table/hooks/useUrlFilters.ts","../../src/components/Table/filters/SelectFilter/SelectFilter.tsx","../../src/components/Table/filters/MultiSelectFilter/MultiSelectFilter.tsx","../../src/components/Table/filters/SeverityFilter/SeverityFilter.tsx","../../src/components/Table/filters/TextFilter/TextFilter.tsx","../../src/components/Table/Table.tsx","../../src/components/Table/hooks/useExplicityRemovedFilters.ts","../../src/components/Spinner/Spinner.tsx","../../src/components/Table/cells/CapacityCell/CapacityCell.tsx","../../src/components/Table/cells/UptimeCell/UptimeCell.tsx","../../src/components/Table/cells/ApiCallCell/ApiCallCell.tsx","../../src/components/Table/cells/BarCell/BarCell.tsx","../../src/components/Table/cells/BlocksCell/BlocksCell.tsx","../../src/components/CloseButton/CloseButton.tsx","../../src/components/Table/cells/CustomTooltipCell/CustomTooltipCell.tsx","../../src/components/inputs/DataInfo/DataInfo.tsx","../../src/components/Table/cells/DateCell/DateCell.tsx","../../src/components/EmptyPageMessage/EmptyPageMessage.tsx","../../src/components/Table/cells/EntityCell/EntityCell.tsx","../../src/components/ErrorPage/ErrorPage.tsx","../../src/components/FilterButton/FilterButton.tsx","../../src/components/Table/filters/FilterHeader/FilterHeader.tsx","../../src/components/inputs/FormSwitch/FormSwitch.tsx","../../src/components/Table/cells/IconCell/IconCell.tsx","../../src/components/inputs/JsonBox/JsonBox.tsx","../../src/components/inputs/LoginField/LoginField.tsx","../../src/components/Table/cells/MultilineCell/MultilineCell.tsx","../../src/components/NewPasswordTooltip/NewPasswordTooltip.tsx","../../src/components/Table/cells/NodeCell/NodeCell.tsx","../../src/components/Table/Pagination/Pagination.tsx","../../src/components/Table/PerPage/PerPage.tsx","../../src/components/Table/cells/ProgressCell/ProgressCell.tsx","../../src/components/inputs/RadioSwitch/RadioSwitch.tsx","../../src/components/Table/cells/SeverityCell/SeverityCell.tsx","../../src/components/Table/cells/StatusCell/StatusCell.tsx","../../src/components/Summary/Summary.tsx","../../src/components/Table/cells/SwitchCell/SwitchCell.tsx","../../src/components/Tab/Tab.tsx","../../src/components/inputs/TextField/TextField.tsx","../../src/components/inputs/TextSelectBox/TextSelectBox.tsx","../../src/components/Table/cells/TieringCell/TieringCell.tsx","../../src/components/Table/cells/TimeCell/TimeCell.tsx","../../src/components/ToggleButton/ToggleButton.tsx","../../src/components/inputs/UploadField/UploadField.tsx"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M4%2C11H1.5A1.5%2C1.5%2C0%2C0%2C1%2C0%2C9.5v-8A1.5%2C1.5%2C0%2C0%2C1%2C1.5%2C0h8A1.5%2C1.5%2C0%2C0%2C1%2C11%2C1.5V4H10V1.5A.5.5%2C0%2C0%2C0%2C9.5%2C1h-8a.5.5%2C0%2C0%2C0-.5.5v8a.5.5%2C0%2C0%2C0%2C.5.5H4ZM6%2C7.5v-1A.5.5%2C0%2C0%2C1%2C6.5%2C6h1a.5.5%2C0%2C0%2C0%2C0-1h-1A1.5%2C1.5%2C0%2C0%2C0%2C5%2C6.5v1a.5.5%2C0%2C0%2C0%2C1%2C0Zm10%2C0v-1A1.5%2C1.5%2C0%2C0%2C0%2C14.5%2C5h-1a.5.5%2C0%2C0%2C0%2C0%2C1h1a.5.5%2C0%2C0%2C1%2C.5.5v1a.5.5%2C0%2C0%2C0%2C1%2C0Zm0%2C7v-1a.5.5%2C0%2C0%2C0-1%2C0v1a.5.5%2C0%2C0%2C1-.5.5h-1a.5.5%2C0%2C0%2C0%2C0%2C1h1A1.5%2C1.5%2C0%2C0%2C0%2C16%2C14.5Zm-8%2C1a.5.5%2C0%2C0%2C0-.5-.5h-1a.5.5%2C0%2C0%2C1-.5-.5v-1a.5.5%2C0%2C0%2C0-1%2C0v1A1.5%2C1.5%2C0%2C0%2C0%2C6.5%2C16h1A.5.5%2C0%2C0%2C0%2C8%2C15.5Zm-2-4v-2a.5.5%2C0%2C0%2C0-1%2C0v2a.5.5%2C0%2C0%2C0%2C1%2C0Zm10%2C0v-2a.5.5%2C0%2C0%2C0-1%2C0v2a.5.5%2C0%2C0%2C0%2C1%2C0Zm-4-6a.5.5%2C0%2C0%2C0-.5-.5h-2a.5.5%2C0%2C0%2C0%2C0%2C1h2A.5.5%2C0%2C0%2C0%2C12%2C5.5Zm0%2C10a.5.5%2C0%2C0%2C0-.5-.5h-2a.5.5%2C0%2C0%2C0%2C0%2C1h2A.5.5%2C0%2C0%2C0%2C12%2C15.5Z%22%20fill%3D%22%23b3b3b3%22%2F%3E%3C%2Fsvg%3E\"","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n });\n}\nif (!String.prototype.repeat) {\n defineProp(String.prototype, \"repeat\", function (count) {\n var result = \"\";\n var string = this;\n while (count > 0) {\n if (count & 1)\n result += string;\n if ((count >>= 1))\n string += string;\n }\n return result;\n });\n}\nif (!String.prototype.includes) {\n defineProp(String.prototype, \"includes\", function (str, position) {\n return this.indexOf(str, position) != -1;\n });\n}\nif (!Object.assign) {\n Object.assign = function (target) {\n if (target === undefined || target === null) {\n throw new TypeError(\"Cannot convert undefined or null to object\");\n }\n var output = Object(target);\n for (var index = 1; index < arguments.length; index++) {\n var source = arguments[index];\n if (source !== undefined && source !== null) {\n Object.keys(source).forEach(function (key) {\n output[key] = source[key];\n });\n }\n }\n return output;\n };\n}\nif (!Object.values) {\n Object.values = function (o) {\n return Object.keys(o).map(function (k) {\n return o[k];\n });\n };\n}\nif (!Array.prototype.find) {\n defineProp(Array.prototype, \"find\", function (predicate) {\n var len = this.length;\n var thisArg = arguments[1];\n for (var k = 0; k < len; k++) {\n var kValue = this[k];\n if (predicate.call(thisArg, kValue, k, this)) {\n return kValue;\n }\n }\n });\n}\nif (!Array.prototype.findIndex) {\n defineProp(Array.prototype, \"findIndex\", function (predicate) {\n var len = this.length;\n var thisArg = arguments[1];\n for (var k = 0; k < len; k++) {\n var kValue = this[k];\n if (predicate.call(thisArg, kValue, k, this)) {\n return k;\n }\n }\n });\n}\nif (!Array.prototype.includes) {\n defineProp(Array.prototype, \"includes\", function (item, position) {\n return this.indexOf(item, position) != -1;\n });\n}\nif (!Array.prototype.fill) {\n defineProp(Array.prototype, \"fill\", function (value) {\n var O = this;\n var len = O.length >>> 0;\n var start = arguments[1];\n var relativeStart = start >> 0;\n var k = relativeStart < 0\n ? Math.max(len + relativeStart, 0)\n : Math.min(relativeStart, len);\n var end = arguments[2];\n var relativeEnd = end === undefined ? len : end >> 0;\n var final = relativeEnd < 0\n ? Math.max(len + relativeEnd, 0)\n : Math.min(relativeEnd, len);\n while (k < final) {\n O[k] = value;\n k++;\n }\n return O;\n });\n}\nif (!Array.of) {\n defineProp(Array, \"of\", function () {\n return Array.prototype.slice.call(arguments);\n });\n}\n\n});\n\nace.define(\"ace/lib/fixoldbrowsers\",[\"require\",\"exports\",\"module\",\"ace/lib/es6-shim\"], function(require, exports, module){// vim:set ts=4 sts=4 sw=4 st:\n\"use strict\";\nrequire(\"./es6-shim\");\n\n});\n\nace.define(\"ace/lib/lang\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nexports.last = function (a) {\n return a[a.length - 1];\n};\nexports.stringReverse = function (string) {\n return string.split(\"\").reverse().join(\"\");\n};\nexports.stringRepeat = function (string, count) {\n var result = '';\n while (count > 0) {\n if (count & 1)\n result += string;\n if (count >>= 1)\n string += string;\n }\n return result;\n};\nvar trimBeginRegexp = /^\\s\\s*/;\nvar trimEndRegexp = /\\s\\s*$/;\nexports.stringTrimLeft = function (string) {\n return string.replace(trimBeginRegexp, '');\n};\nexports.stringTrimRight = function (string) {\n return string.replace(trimEndRegexp, '');\n};\nexports.copyObject = function (obj) {\n var copy = {};\n for (var key in obj) {\n copy[key] = obj[key];\n }\n return copy;\n};\nexports.copyArray = function (array) {\n var copy = [];\n for (var i = 0, l = array.length; i < l; i++) {\n if (array[i] && typeof array[i] == \"object\")\n copy[i] = this.copyObject(array[i]);\n else\n copy[i] = array[i];\n }\n return copy;\n};\nexports.deepCopy = function deepCopy(obj) {\n if (typeof obj !== \"object\" || !obj)\n return obj;\n var copy;\n if (Array.isArray(obj)) {\n copy = [];\n for (var key = 0; key < obj.length; key++) {\n copy[key] = deepCopy(obj[key]);\n }\n return copy;\n }\n if (Object.prototype.toString.call(obj) !== \"[object Object]\")\n return obj;\n copy = {};\n for (var key in obj)\n copy[key] = deepCopy(obj[key]);\n return copy;\n};\nexports.arrayToMap = function (arr) {\n var map = {};\n for (var i = 0; i < arr.length; i++) {\n map[arr[i]] = 1;\n }\n return map;\n};\nexports.createMap = function (props) {\n var map = Object.create(null);\n for (var i in props) {\n map[i] = props[i];\n }\n return map;\n};\nexports.arrayRemove = function (array, value) {\n for (var i = 0; i <= array.length; i++) {\n if (value === array[i]) {\n array.splice(i, 1);\n }\n }\n};\nexports.escapeRegExp = function (str) {\n return str.replace(/([.*+?^${}()|[\\]\\/\\\\])/g, '\\\\$1');\n};\nexports.escapeHTML = function (str) {\n return (\"\" + str).replace(/&/g, \"&\").replace(/\"/g, \""\").replace(/'/g, \"'\").replace(/= 0)\n ? parseFloat((ua.match(/(?:MSIE |Trident\\/[0-9]+[\\.0-9]+;.*rv:)([0-9]+[\\.0-9]+)/) || [])[1])\n : parseFloat((ua.match(/(?:Trident\\/[0-9]+[\\.0-9]+;.*rv:)([0-9]+[\\.0-9]+)/) || [])[1]); // for ie\nexports.isOldIE = exports.isIE && exports.isIE < 9;\nexports.isGecko = exports.isMozilla = ua.match(/ Gecko\\/\\d+/);\nexports.isOpera = typeof opera == \"object\" && Object.prototype.toString.call(window.opera) == \"[object Opera]\";\nexports.isWebKit = parseFloat(ua.split(\"WebKit/\")[1]) || undefined;\nexports.isChrome = parseFloat(ua.split(\" Chrome/\")[1]) || undefined;\nexports.isEdge = parseFloat(ua.split(\" Edge/\")[1]) || undefined;\nexports.isAIR = ua.indexOf(\"AdobeAIR\") >= 0;\nexports.isAndroid = ua.indexOf(\"Android\") >= 0;\nexports.isChromeOS = ua.indexOf(\" CrOS \") >= 0;\nexports.isIOS = /iPad|iPhone|iPod/.test(ua) && !window.MSStream;\nif (exports.isIOS)\n exports.isMac = true;\nexports.isMobile = exports.isIOS || exports.isAndroid;\n\n});\n\nace.define(\"ace/lib/dom\",[\"require\",\"exports\",\"module\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar useragent = require(\"./useragent\");\nvar XHTML_NS = \"http://www.w3.org/1999/xhtml\";\nexports.buildDom = function buildDom(arr, parent, refs) {\n if (typeof arr == \"string\" && arr) {\n var txt = document.createTextNode(arr);\n if (parent)\n parent.appendChild(txt);\n return txt;\n }\n if (!Array.isArray(arr)) {\n if (arr && arr.appendChild && parent)\n parent.appendChild(arr);\n return arr;\n }\n if (typeof arr[0] != \"string\" || !arr[0]) {\n var els = [];\n for (var i = 0; i < arr.length; i++) {\n var ch = buildDom(arr[i], parent, refs);\n ch && els.push(ch);\n }\n return els;\n }\n var el = document.createElement(arr[0]);\n var options = arr[1];\n var childIndex = 1;\n if (options && typeof options == \"object\" && !Array.isArray(options))\n childIndex = 2;\n for (var i = childIndex; i < arr.length; i++)\n buildDom(arr[i], el, refs);\n if (childIndex == 2) {\n Object.keys(options).forEach(function (n) {\n var val = options[n];\n if (n === \"class\") {\n el.className = Array.isArray(val) ? val.join(\" \") : val;\n }\n else if (typeof val == \"function\" || n == \"value\" || n[0] == \"$\") {\n el[n] = val;\n }\n else if (n === \"ref\") {\n if (refs)\n refs[val] = el;\n }\n else if (n === \"style\") {\n if (typeof val == \"string\")\n el.style.cssText = val;\n }\n else if (val != null) {\n el.setAttribute(n, val);\n }\n });\n }\n if (parent)\n parent.appendChild(el);\n return el;\n};\nexports.getDocumentHead = function (doc) {\n if (!doc)\n doc = document;\n return doc.head || doc.getElementsByTagName(\"head\")[0] || doc.documentElement;\n};\nexports.createElement = function (tag, ns) {\n return document.createElementNS ?\n document.createElementNS(ns || XHTML_NS, tag) :\n document.createElement(tag);\n};\nexports.removeChildren = function (element) {\n element.innerHTML = \"\";\n};\nexports.createTextNode = function (textContent, element) {\n var doc = element ? element.ownerDocument : document;\n return doc.createTextNode(textContent);\n};\nexports.createFragment = function (element) {\n var doc = element ? element.ownerDocument : document;\n return doc.createDocumentFragment();\n};\nexports.hasCssClass = function (el, name) {\n var classes = (el.className + \"\").split(/\\s+/g);\n return classes.indexOf(name) !== -1;\n};\nexports.addCssClass = function (el, name) {\n if (!exports.hasCssClass(el, name)) {\n el.className += \" \" + name;\n }\n};\nexports.removeCssClass = function (el, name) {\n var classes = el.className.split(/\\s+/g);\n while (true) {\n var index = classes.indexOf(name);\n if (index == -1) {\n break;\n }\n classes.splice(index, 1);\n }\n el.className = classes.join(\" \");\n};\nexports.toggleCssClass = function (el, name) {\n var classes = el.className.split(/\\s+/g), add = true;\n while (true) {\n var index = classes.indexOf(name);\n if (index == -1) {\n break;\n }\n add = false;\n classes.splice(index, 1);\n }\n if (add)\n classes.push(name);\n el.className = classes.join(\" \");\n return add;\n};\nexports.setCssClass = function (node, className, include) {\n if (include) {\n exports.addCssClass(node, className);\n }\n else {\n exports.removeCssClass(node, className);\n }\n};\nexports.hasCssString = function (id, doc) {\n var index = 0, sheets;\n doc = doc || document;\n if ((sheets = doc.querySelectorAll(\"style\"))) {\n while (index < sheets.length) {\n if (sheets[index++].id === id) {\n return true;\n }\n }\n }\n};\nexports.removeElementById = function (id, doc) {\n doc = doc || document;\n if (doc.getElementById(id)) {\n doc.getElementById(id).remove();\n }\n};\nvar strictCSP;\nvar cssCache = [];\nexports.useStrictCSP = function (value) {\n strictCSP = value;\n if (value == false)\n insertPendingStyles();\n else if (!cssCache)\n cssCache = [];\n};\nfunction insertPendingStyles() {\n var cache = cssCache;\n cssCache = null;\n cache && cache.forEach(function (item) {\n importCssString(item[0], item[1]);\n });\n}\nfunction importCssString(cssText, id, target) {\n if (typeof document == \"undefined\")\n return;\n if (cssCache) {\n if (target) {\n insertPendingStyles();\n }\n else if (target === false) {\n return cssCache.push([cssText, id]);\n }\n }\n if (strictCSP)\n return;\n var container = target;\n if (!target || !target.getRootNode) {\n container = document;\n }\n else {\n container = target.getRootNode();\n if (!container || container == target)\n container = document;\n }\n var doc = container.ownerDocument || container;\n if (id && exports.hasCssString(id, container))\n return null;\n if (id)\n cssText += \"\\n/*# sourceURL=ace/css/\" + id + \" */\";\n var style = exports.createElement(\"style\");\n style.appendChild(doc.createTextNode(cssText));\n if (id)\n style.id = id;\n if (container == doc)\n container = exports.getDocumentHead(doc);\n container.insertBefore(style, container.firstChild);\n}\nexports.importCssString = importCssString;\nexports.importCssStylsheet = function (uri, doc) {\n exports.buildDom([\"link\", { rel: \"stylesheet\", href: uri }], exports.getDocumentHead(doc));\n};\nexports.scrollbarWidth = function (doc) {\n var inner = exports.createElement(\"ace_inner\");\n inner.style.width = \"100%\";\n inner.style.minWidth = \"0px\";\n inner.style.height = \"200px\";\n inner.style.display = \"block\";\n var outer = exports.createElement(\"ace_outer\");\n var style = outer.style;\n style.position = \"absolute\";\n style.left = \"-10000px\";\n style.overflow = \"hidden\";\n style.width = \"200px\";\n style.minWidth = \"0px\";\n style.height = \"150px\";\n style.display = \"block\";\n outer.appendChild(inner);\n var body = (doc && doc.documentElement) || (document && document.documentElement);\n if (!body)\n return 0;\n body.appendChild(outer);\n var noScrollbar = inner.offsetWidth;\n style.overflow = \"scroll\";\n var withScrollbar = inner.offsetWidth;\n if (noScrollbar === withScrollbar) {\n withScrollbar = outer.clientWidth;\n }\n body.removeChild(outer);\n return noScrollbar - withScrollbar;\n};\nexports.computedStyle = function (element, style) {\n return window.getComputedStyle(element, \"\") || {};\n};\nexports.setStyle = function (styles, property, value) {\n if (styles[property] !== value) {\n styles[property] = value;\n }\n};\nexports.HAS_CSS_ANIMATION = false;\nexports.HAS_CSS_TRANSFORMS = false;\nexports.HI_DPI = useragent.isWin\n ? typeof window !== \"undefined\" && window.devicePixelRatio >= 1.5\n : true;\nif (useragent.isChromeOS)\n exports.HI_DPI = false;\nif (typeof document !== \"undefined\") {\n var div = document.createElement(\"div\");\n if (exports.HI_DPI && div.style.transform !== undefined)\n exports.HAS_CSS_TRANSFORMS = true;\n if (!useragent.isEdge && typeof div.style.animationName !== \"undefined\")\n exports.HAS_CSS_ANIMATION = true;\n div = null;\n}\nif (exports.HAS_CSS_TRANSFORMS) {\n exports.translate = function (element, tx, ty) {\n element.style.transform = \"translate(\" + Math.round(tx) + \"px, \" + Math.round(ty) + \"px)\";\n };\n}\nelse {\n exports.translate = function (element, tx, ty) {\n element.style.top = Math.round(ty) + \"px\";\n element.style.left = Math.round(tx) + \"px\";\n };\n}\n\n});\n\nace.define(\"ace/lib/net\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(require, exports, module){/*\n * based on code from:\n *\n * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\"use strict\";\nvar dom = require(\"./dom\");\nexports.get = function (url, callback) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n callback(xhr.responseText);\n }\n };\n xhr.send(null);\n};\nexports.loadScript = function (path, callback) {\n var head = dom.getDocumentHead();\n var s = document.createElement('script');\n s.src = path;\n head.appendChild(s);\n s.onload = s.onreadystatechange = function (_, isAbort) {\n if (isAbort || !s.readyState || s.readyState == \"loaded\" || s.readyState == \"complete\") {\n s = s.onload = s.onreadystatechange = null;\n if (!isAbort)\n callback();\n }\n };\n};\nexports.qualifyURL = function (url) {\n var a = document.createElement('a');\n a.href = url;\n return a.href;\n};\n\n});\n\nace.define(\"ace/lib/event_emitter\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nvar EventEmitter = {};\nvar stopPropagation = function () { this.propagationStopped = true; };\nvar preventDefault = function () { this.defaultPrevented = true; };\nEventEmitter._emit =\n EventEmitter._dispatchEvent = function (eventName, e) {\n this._eventRegistry || (this._eventRegistry = {});\n this._defaultHandlers || (this._defaultHandlers = {});\n var listeners = this._eventRegistry[eventName] || [];\n var defaultHandler = this._defaultHandlers[eventName];\n if (!listeners.length && !defaultHandler)\n return;\n if (typeof e != \"object\" || !e)\n e = {};\n if (!e.type)\n e.type = eventName;\n if (!e.stopPropagation)\n e.stopPropagation = stopPropagation;\n if (!e.preventDefault)\n e.preventDefault = preventDefault;\n listeners = listeners.slice();\n for (var i = 0; i < listeners.length; i++) {\n listeners[i](e, this);\n if (e.propagationStopped)\n break;\n }\n if (defaultHandler && !e.defaultPrevented)\n return defaultHandler(e, this);\n };\nEventEmitter._signal = function (eventName, e) {\n var listeners = (this._eventRegistry || {})[eventName];\n if (!listeners)\n return;\n listeners = listeners.slice();\n for (var i = 0; i < listeners.length; i++)\n listeners[i](e, this);\n};\nEventEmitter.once = function (eventName, callback) {\n var _self = this;\n this.on(eventName, function newCallback() {\n _self.off(eventName, newCallback);\n callback.apply(null, arguments);\n });\n if (!callback) {\n return new Promise(function (resolve) {\n callback = resolve;\n });\n }\n};\nEventEmitter.setDefaultHandler = function (eventName, callback) {\n var handlers = this._defaultHandlers;\n if (!handlers)\n handlers = this._defaultHandlers = { _disabled_: {} };\n if (handlers[eventName]) {\n var old = handlers[eventName];\n var disabled = handlers._disabled_[eventName];\n if (!disabled)\n handlers._disabled_[eventName] = disabled = [];\n disabled.push(old);\n var i = disabled.indexOf(callback);\n if (i != -1)\n disabled.splice(i, 1);\n }\n handlers[eventName] = callback;\n};\nEventEmitter.removeDefaultHandler = function (eventName, callback) {\n var handlers = this._defaultHandlers;\n if (!handlers)\n return;\n var disabled = handlers._disabled_[eventName];\n if (handlers[eventName] == callback) {\n if (disabled)\n this.setDefaultHandler(eventName, disabled.pop());\n }\n else if (disabled) {\n var i = disabled.indexOf(callback);\n if (i != -1)\n disabled.splice(i, 1);\n }\n};\nEventEmitter.on =\n EventEmitter.addEventListener = function (eventName, callback, capturing) {\n this._eventRegistry = this._eventRegistry || {};\n var listeners = this._eventRegistry[eventName];\n if (!listeners)\n listeners = this._eventRegistry[eventName] = [];\n if (listeners.indexOf(callback) == -1)\n listeners[capturing ? \"unshift\" : \"push\"](callback);\n return callback;\n };\nEventEmitter.off =\n EventEmitter.removeListener =\n EventEmitter.removeEventListener = function (eventName, callback) {\n this._eventRegistry = this._eventRegistry || {};\n var listeners = this._eventRegistry[eventName];\n if (!listeners)\n return;\n var index = listeners.indexOf(callback);\n if (index !== -1)\n listeners.splice(index, 1);\n };\nEventEmitter.removeAllListeners = function (eventName) {\n if (!eventName)\n this._eventRegistry = this._defaultHandlers = undefined;\n if (this._eventRegistry)\n this._eventRegistry[eventName] = undefined;\n if (this._defaultHandlers)\n this._defaultHandlers[eventName] = undefined;\n};\nexports.EventEmitter = EventEmitter;\n\n});\n\nace.define(\"ace/lib/app_config\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/event_emitter\"], function(require, exports, module){\"no use strict\";\nvar oop = require(\"./oop\");\nvar EventEmitter = require(\"./event_emitter\").EventEmitter;\nvar optionsProvider = {\n setOptions: function (optList) {\n Object.keys(optList).forEach(function (key) {\n this.setOption(key, optList[key]);\n }, this);\n },\n getOptions: function (optionNames) {\n var result = {};\n if (!optionNames) {\n var options = this.$options;\n optionNames = Object.keys(options).filter(function (key) {\n return !options[key].hidden;\n });\n }\n else if (!Array.isArray(optionNames)) {\n result = optionNames;\n optionNames = Object.keys(result);\n }\n optionNames.forEach(function (key) {\n result[key] = this.getOption(key);\n }, this);\n return result;\n },\n setOption: function (name, value) {\n if (this[\"$\" + name] === value)\n return;\n var opt = this.$options[name];\n if (!opt) {\n return warn('misspelled option \"' + name + '\"');\n }\n if (opt.forwardTo)\n return this[opt.forwardTo] && this[opt.forwardTo].setOption(name, value);\n if (!opt.handlesSet)\n this[\"$\" + name] = value;\n if (opt && opt.set)\n opt.set.call(this, value);\n },\n getOption: function (name) {\n var opt = this.$options[name];\n if (!opt) {\n return warn('misspelled option \"' + name + '\"');\n }\n if (opt.forwardTo)\n return this[opt.forwardTo] && this[opt.forwardTo].getOption(name);\n return opt && opt.get ? opt.get.call(this) : this[\"$\" + name];\n }\n};\nfunction warn(message) {\n if (typeof console != \"undefined\" && console.warn)\n console.warn.apply(console, arguments);\n}\nfunction reportError(msg, data) {\n var e = new Error(msg);\n e.data = data;\n if (typeof console == \"object\" && console.error)\n console.error(e);\n setTimeout(function () { throw e; });\n}\nvar AppConfig = function () {\n this.$defaultOptions = {};\n};\n(function () {\n oop.implement(this, EventEmitter);\n this.defineOptions = function (obj, path, options) {\n if (!obj.$options)\n this.$defaultOptions[path] = obj.$options = {};\n Object.keys(options).forEach(function (key) {\n var opt = options[key];\n if (typeof opt == \"string\")\n opt = { forwardTo: opt };\n opt.name || (opt.name = key);\n obj.$options[opt.name] = opt;\n if (\"initialValue\" in opt)\n obj[\"$\" + opt.name] = opt.initialValue;\n });\n oop.implement(obj, optionsProvider);\n return this;\n };\n this.resetOptions = function (obj) {\n Object.keys(obj.$options).forEach(function (key) {\n var opt = obj.$options[key];\n if (\"value\" in opt)\n obj.setOption(key, opt.value);\n });\n };\n this.setDefaultValue = function (path, name, value) {\n if (!path) {\n for (path in this.$defaultOptions)\n if (this.$defaultOptions[path][name])\n break;\n if (!this.$defaultOptions[path][name])\n return false;\n }\n var opts = this.$defaultOptions[path] || (this.$defaultOptions[path] = {});\n if (opts[name]) {\n if (opts.forwardTo)\n this.setDefaultValue(opts.forwardTo, name, value);\n else\n opts[name].value = value;\n }\n };\n this.setDefaultValues = function (path, optionHash) {\n Object.keys(optionHash).forEach(function (key) {\n this.setDefaultValue(path, key, optionHash[key]);\n }, this);\n };\n this.warn = warn;\n this.reportError = reportError;\n}).call(AppConfig.prototype);\nexports.AppConfig = AppConfig;\n\n});\n\nace.define(\"ace/theme/textmate.css\",[\"require\",\"exports\",\"module\"], function(require, exports, module){module.exports = \".ace-tm .ace_gutter {\\n background: #f0f0f0;\\n color: #333;\\n}\\n\\n.ace-tm .ace_print-margin {\\n width: 1px;\\n background: #e8e8e8;\\n}\\n\\n.ace-tm .ace_fold {\\n background-color: #6B72E6;\\n}\\n\\n.ace-tm {\\n background-color: #FFFFFF;\\n color: black;\\n}\\n\\n.ace-tm .ace_cursor {\\n color: black;\\n}\\n \\n.ace-tm .ace_invisible {\\n color: rgb(191, 191, 191);\\n}\\n\\n.ace-tm .ace_storage,\\n.ace-tm .ace_keyword {\\n color: blue;\\n}\\n\\n.ace-tm .ace_constant {\\n color: rgb(197, 6, 11);\\n}\\n\\n.ace-tm .ace_constant.ace_buildin {\\n color: rgb(88, 72, 246);\\n}\\n\\n.ace-tm .ace_constant.ace_language {\\n color: rgb(88, 92, 246);\\n}\\n\\n.ace-tm .ace_constant.ace_library {\\n color: rgb(6, 150, 14);\\n}\\n\\n.ace-tm .ace_invalid {\\n background-color: rgba(255, 0, 0, 0.1);\\n color: red;\\n}\\n\\n.ace-tm .ace_support.ace_function {\\n color: rgb(60, 76, 114);\\n}\\n\\n.ace-tm .ace_support.ace_constant {\\n color: rgb(6, 150, 14);\\n}\\n\\n.ace-tm .ace_support.ace_type,\\n.ace-tm .ace_support.ace_class {\\n color: rgb(109, 121, 222);\\n}\\n\\n.ace-tm .ace_keyword.ace_operator {\\n color: rgb(104, 118, 135);\\n}\\n\\n.ace-tm .ace_string {\\n color: rgb(3, 106, 7);\\n}\\n\\n.ace-tm .ace_comment {\\n color: rgb(76, 136, 107);\\n}\\n\\n.ace-tm .ace_comment.ace_doc {\\n color: rgb(0, 102, 255);\\n}\\n\\n.ace-tm .ace_comment.ace_doc.ace_tag {\\n color: rgb(128, 159, 191);\\n}\\n\\n.ace-tm .ace_constant.ace_numeric {\\n color: rgb(0, 0, 205);\\n}\\n\\n.ace-tm .ace_variable {\\n color: rgb(49, 132, 149);\\n}\\n\\n.ace-tm .ace_xml-pe {\\n color: rgb(104, 104, 91);\\n}\\n\\n.ace-tm .ace_entity.ace_name.ace_function {\\n color: #0000A2;\\n}\\n\\n\\n.ace-tm .ace_heading {\\n color: rgb(12, 7, 255);\\n}\\n\\n.ace-tm .ace_list {\\n color:rgb(185, 6, 144);\\n}\\n\\n.ace-tm .ace_meta.ace_tag {\\n color:rgb(0, 22, 142);\\n}\\n\\n.ace-tm .ace_string.ace_regex {\\n color: rgb(255, 0, 0)\\n}\\n\\n.ace-tm .ace_marker-layer .ace_selection {\\n background: rgb(181, 213, 255);\\n}\\n.ace-tm.ace_multiselect .ace_selection.ace_start {\\n box-shadow: 0 0 3px 0px white;\\n}\\n.ace-tm .ace_marker-layer .ace_step {\\n background: rgb(252, 255, 0);\\n}\\n\\n.ace-tm .ace_marker-layer .ace_stack {\\n background: rgb(164, 229, 101);\\n}\\n\\n.ace-tm .ace_marker-layer .ace_bracket {\\n margin: -1px 0 0 -1px;\\n border: 1px solid rgb(192, 192, 192);\\n}\\n\\n.ace-tm .ace_marker-layer .ace_active-line {\\n background: rgba(0, 0, 0, 0.07);\\n}\\n\\n.ace-tm .ace_gutter-active-line {\\n background-color : #dcdcdc;\\n}\\n\\n.ace-tm .ace_marker-layer .ace_selected-word {\\n background: rgb(250, 250, 255);\\n border: 1px solid rgb(200, 200, 250);\\n}\\n\\n.ace-tm .ace_indent-guide {\\n background: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\\\") right repeat-y;\\n}\\n\\n.ace-tm .ace_indent-guide-active {\\n background: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC\\\") right repeat-y;\\n}\\n\";\n\n});\n\nace.define(\"ace/theme/textmate\",[\"require\",\"exports\",\"module\",\"ace/theme/textmate.css\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nexports.isDark = false;\nexports.cssClass = \"ace-tm\";\nexports.cssText = require(\"./textmate.css\");\nexports.$id = \"ace/theme/textmate\";\nvar dom = require(\"../lib/dom\");\ndom.importCssString(exports.cssText, exports.cssClass, false);\n\n});\n\nace.define(\"ace/config\",[\"require\",\"exports\",\"module\",\"ace/lib/lang\",\"ace/lib/oop\",\"ace/lib/net\",\"ace/lib/dom\",\"ace/lib/app_config\",\"ace/theme/textmate\"], function(require, exports, module){\"no use strict\";\nvar lang = require(\"./lib/lang\");\nvar oop = require(\"./lib/oop\");\nvar net = require(\"./lib/net\");\nvar dom = require(\"./lib/dom\");\nvar AppConfig = require(\"./lib/app_config\").AppConfig;\nmodule.exports = exports = new AppConfig();\nvar options = {\n packaged: false,\n workerPath: null,\n modePath: null,\n themePath: null,\n basePath: \"\",\n suffix: \".js\",\n $moduleUrls: {},\n loadWorkerFromBlob: true,\n sharedPopups: false,\n useStrictCSP: null\n};\nexports.get = function (key) {\n if (!options.hasOwnProperty(key))\n throw new Error(\"Unknown config key: \" + key);\n return options[key];\n};\nexports.set = function (key, value) {\n if (options.hasOwnProperty(key))\n options[key] = value;\n else if (this.setDefaultValue(\"\", key, value) == false)\n throw new Error(\"Unknown config key: \" + key);\n if (key == \"useStrictCSP\")\n dom.useStrictCSP(value);\n};\nexports.all = function () {\n return lang.copyObject(options);\n};\nexports.$modes = {};\nexports.moduleUrl = function (name, component) {\n if (options.$moduleUrls[name])\n return options.$moduleUrls[name];\n var parts = name.split(\"/\");\n component = component || parts[parts.length - 2] || \"\";\n var sep = component == \"snippets\" ? \"/\" : \"-\";\n var base = parts[parts.length - 1];\n if (component == \"worker\" && sep == \"-\") {\n var re = new RegExp(\"^\" + component + \"[\\\\-_]|[\\\\-_]\" + component + \"$\", \"g\");\n base = base.replace(re, \"\");\n }\n if ((!base || base == component) && parts.length > 1)\n base = parts[parts.length - 2];\n var path = options[component + \"Path\"];\n if (path == null) {\n path = options.basePath;\n }\n else if (sep == \"/\") {\n component = sep = \"\";\n }\n if (path && path.slice(-1) != \"/\")\n path += \"/\";\n return path + component + sep + base + this.get(\"suffix\");\n};\nexports.setModuleUrl = function (name, subst) {\n return options.$moduleUrls[name] = subst;\n};\nvar loader = function (moduleName, cb) {\n if (moduleName == \"ace/theme/textmate\")\n return cb(null, require(\"./theme/textmate\"));\n return console.error(\"loader is not configured\");\n};\nexports.setLoader = function (cb) {\n loader = cb;\n};\nexports.$loading = {};\nexports.loadModule = function (moduleName, onLoad) {\n var module, moduleType;\n if (Array.isArray(moduleName)) {\n moduleType = moduleName[0];\n moduleName = moduleName[1];\n }\n try {\n module = require(moduleName);\n }\n catch (e) { }\n if (module && !exports.$loading[moduleName])\n return onLoad && onLoad(module);\n if (!exports.$loading[moduleName])\n exports.$loading[moduleName] = [];\n exports.$loading[moduleName].push(onLoad);\n if (exports.$loading[moduleName].length > 1)\n return;\n var afterLoad = function () {\n loader(moduleName, function (err, module) {\n exports._emit(\"load.module\", { name: moduleName, module: module });\n var listeners = exports.$loading[moduleName];\n exports.$loading[moduleName] = null;\n listeners.forEach(function (onLoad) {\n onLoad && onLoad(module);\n });\n });\n };\n if (!exports.get(\"packaged\"))\n return afterLoad();\n net.loadScript(exports.moduleUrl(moduleName, moduleType), afterLoad);\n reportErrorIfPathIsNotConfigured();\n};\nvar reportErrorIfPathIsNotConfigured = function () {\n if (!options.basePath && !options.workerPath\n && !options.modePath && !options.themePath\n && !Object.keys(options.$moduleUrls).length) {\n console.error(\"Unable to infer path to ace from script src,\", \"use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes\", \"or with webpack use ace/webpack-resolver\");\n reportErrorIfPathIsNotConfigured = function () { };\n }\n};\nexports.version = \"1.14.0\";\n\n});\n\nace.define(\"ace/loader_build\",[\"require\",\"exports\",\"module\",\"ace/lib/fixoldbrowsers\",\"ace/config\"], function(require, exports, module) {\n\"use strict\";\n\nrequire(\"./lib/fixoldbrowsers\");\nvar config = require(\"./config\");\nconfig.setLoader(function(moduleName, cb) {\n require([moduleName], function(module) {\n cb(null, module);\n });\n});\n\nvar global = (function() {\n return this || typeof window != \"undefined\" && window;\n})();\n\nmodule.exports = function(ace) {\n config.init = init;\n ace.require = require;\n\n if (typeof define === \"function\")\n ace.define = define;\n};\ninit(true);function init(packaged) {\n\n if (!global || !global.document)\n return;\n \n config.set(\"packaged\", packaged || require.packaged || module.packaged || (global.define && define.packaged));\n\n var scriptOptions = {};\n var scriptUrl = \"\";\n var currentScript = (document.currentScript || document._currentScript ); // native or polyfill\n var currentDocument = currentScript && currentScript.ownerDocument || document;\n \n var scripts = currentDocument.getElementsByTagName(\"script\");\n for (var i=0; i 1) {\n clicks++;\n if (clicks > 4)\n clicks = 1;\n }\n else {\n clicks = 1;\n }\n if (useragent.isIE) {\n var isNewClick = Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5;\n if (!timer || isNewClick)\n clicks = 1;\n if (timer)\n clearTimeout(timer);\n timer = setTimeout(function () { timer = null; }, timeouts[clicks - 1] || 600);\n if (clicks == 1) {\n startX = e.clientX;\n startY = e.clientY;\n }\n }\n e._clicks = clicks;\n eventHandler[callbackName](\"mousedown\", e);\n if (clicks > 4)\n clicks = 0;\n else if (clicks > 1)\n return eventHandler[callbackName](eventNames[clicks], e);\n }\n if (!Array.isArray(elements))\n elements = [elements];\n elements.forEach(function (el) {\n addListener(el, \"mousedown\", onMousedown, destroyer);\n });\n};\nvar getModifierHash = function (e) {\n return 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0);\n};\nexports.getModifierString = function (e) {\n return keys.KEY_MODS[getModifierHash(e)];\n};\nfunction normalizeCommandKeys(callback, e, keyCode) {\n var hashId = getModifierHash(e);\n if (!useragent.isMac && pressedKeys) {\n if (e.getModifierState && (e.getModifierState(\"OS\") || e.getModifierState(\"Win\")))\n hashId |= 8;\n if (pressedKeys.altGr) {\n if ((3 & hashId) != 3)\n pressedKeys.altGr = 0;\n else\n return;\n }\n if (keyCode === 18 || keyCode === 17) {\n var location = \"location\" in e ? e.location : e.keyLocation;\n if (keyCode === 17 && location === 1) {\n if (pressedKeys[keyCode] == 1)\n ts = e.timeStamp;\n }\n else if (keyCode === 18 && hashId === 3 && location === 2) {\n var dt = e.timeStamp - ts;\n if (dt < 50)\n pressedKeys.altGr = true;\n }\n }\n }\n if (keyCode in keys.MODIFIER_KEYS) {\n keyCode = -1;\n }\n if (!hashId && keyCode === 13) {\n var location = \"location\" in e ? e.location : e.keyLocation;\n if (location === 3) {\n callback(e, hashId, -keyCode);\n if (e.defaultPrevented)\n return;\n }\n }\n if (useragent.isChromeOS && hashId & 8) {\n callback(e, hashId, keyCode);\n if (e.defaultPrevented)\n return;\n else\n hashId &= ~8;\n }\n if (!hashId && !(keyCode in keys.FUNCTION_KEYS) && !(keyCode in keys.PRINTABLE_KEYS)) {\n return false;\n }\n return callback(e, hashId, keyCode);\n}\nexports.addCommandKeyListener = function (el, callback, destroyer) {\n if (useragent.isOldGecko || (useragent.isOpera && !(\"KeyboardEvent\" in window))) {\n var lastKeyDownKeyCode = null;\n addListener(el, \"keydown\", function (e) {\n lastKeyDownKeyCode = e.keyCode;\n }, destroyer);\n addListener(el, \"keypress\", function (e) {\n return normalizeCommandKeys(callback, e, lastKeyDownKeyCode);\n }, destroyer);\n }\n else {\n var lastDefaultPrevented = null;\n addListener(el, \"keydown\", function (e) {\n pressedKeys[e.keyCode] = (pressedKeys[e.keyCode] || 0) + 1;\n var result = normalizeCommandKeys(callback, e, e.keyCode);\n lastDefaultPrevented = e.defaultPrevented;\n return result;\n }, destroyer);\n addListener(el, \"keypress\", function (e) {\n if (lastDefaultPrevented && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey)) {\n exports.stopEvent(e);\n lastDefaultPrevented = null;\n }\n }, destroyer);\n addListener(el, \"keyup\", function (e) {\n pressedKeys[e.keyCode] = null;\n }, destroyer);\n if (!pressedKeys) {\n resetPressedKeys();\n addListener(window, \"focus\", resetPressedKeys);\n }\n }\n};\nfunction resetPressedKeys() {\n pressedKeys = Object.create(null);\n}\nif (typeof window == \"object\" && window.postMessage && !useragent.isOldIE) {\n var postMessageId = 1;\n exports.nextTick = function (callback, win) {\n win = win || window;\n var messageName = \"zero-timeout-message-\" + (postMessageId++);\n var listener = function (e) {\n if (e.data == messageName) {\n exports.stopPropagation(e);\n removeListener(win, \"message\", listener);\n callback();\n }\n };\n addListener(win, \"message\", listener);\n win.postMessage(messageName, \"*\");\n };\n}\nexports.$idleBlocked = false;\nexports.onIdle = function (cb, timeout) {\n return setTimeout(function handler() {\n if (!exports.$idleBlocked) {\n cb();\n }\n else {\n setTimeout(handler, 100);\n }\n }, timeout);\n};\nexports.$idleBlockId = null;\nexports.blockIdle = function (delay) {\n if (exports.$idleBlockId)\n clearTimeout(exports.$idleBlockId);\n exports.$idleBlocked = true;\n exports.$idleBlockId = setTimeout(function () {\n exports.$idleBlocked = false;\n }, delay || 100);\n};\nexports.nextFrame = typeof window == \"object\" && (window.requestAnimationFrame\n || window.mozRequestAnimationFrame\n || window.webkitRequestAnimationFrame\n || window.msRequestAnimationFrame\n || window.oRequestAnimationFrame);\nif (exports.nextFrame)\n exports.nextFrame = exports.nextFrame.bind(window);\nelse\n exports.nextFrame = function (callback) {\n setTimeout(callback, 17);\n };\n\n});\n\nace.define(\"ace/range\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nvar comparePoints = function (p1, p2) {\n return p1.row - p2.row || p1.column - p2.column;\n};\nvar Range = function (startRow, startColumn, endRow, endColumn) {\n this.start = {\n row: startRow,\n column: startColumn\n };\n this.end = {\n row: endRow,\n column: endColumn\n };\n};\n(function () {\n this.isEqual = function (range) {\n return this.start.row === range.start.row &&\n this.end.row === range.end.row &&\n this.start.column === range.start.column &&\n this.end.column === range.end.column;\n };\n this.toString = function () {\n return (\"Range: [\" + this.start.row + \"/\" + this.start.column +\n \"] -> [\" + this.end.row + \"/\" + this.end.column + \"]\");\n };\n this.contains = function (row, column) {\n return this.compare(row, column) == 0;\n };\n this.compareRange = function (range) {\n var cmp, end = range.end, start = range.start;\n cmp = this.compare(end.row, end.column);\n if (cmp == 1) {\n cmp = this.compare(start.row, start.column);\n if (cmp == 1) {\n return 2;\n }\n else if (cmp == 0) {\n return 1;\n }\n else {\n return 0;\n }\n }\n else if (cmp == -1) {\n return -2;\n }\n else {\n cmp = this.compare(start.row, start.column);\n if (cmp == -1) {\n return -1;\n }\n else if (cmp == 1) {\n return 42;\n }\n else {\n return 0;\n }\n }\n };\n this.comparePoint = function (p) {\n return this.compare(p.row, p.column);\n };\n this.containsRange = function (range) {\n return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;\n };\n this.intersects = function (range) {\n var cmp = this.compareRange(range);\n return (cmp == -1 || cmp == 0 || cmp == 1);\n };\n this.isEnd = function (row, column) {\n return this.end.row == row && this.end.column == column;\n };\n this.isStart = function (row, column) {\n return this.start.row == row && this.start.column == column;\n };\n this.setStart = function (row, column) {\n if (typeof row == \"object\") {\n this.start.column = row.column;\n this.start.row = row.row;\n }\n else {\n this.start.row = row;\n this.start.column = column;\n }\n };\n this.setEnd = function (row, column) {\n if (typeof row == \"object\") {\n this.end.column = row.column;\n this.end.row = row.row;\n }\n else {\n this.end.row = row;\n this.end.column = column;\n }\n };\n this.inside = function (row, column) {\n if (this.compare(row, column) == 0) {\n if (this.isEnd(row, column) || this.isStart(row, column)) {\n return false;\n }\n else {\n return true;\n }\n }\n return false;\n };\n this.insideStart = function (row, column) {\n if (this.compare(row, column) == 0) {\n if (this.isEnd(row, column)) {\n return false;\n }\n else {\n return true;\n }\n }\n return false;\n };\n this.insideEnd = function (row, column) {\n if (this.compare(row, column) == 0) {\n if (this.isStart(row, column)) {\n return false;\n }\n else {\n return true;\n }\n }\n return false;\n };\n this.compare = function (row, column) {\n if (!this.isMultiLine()) {\n if (row === this.start.row) {\n return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0);\n }\n }\n if (row < this.start.row)\n return -1;\n if (row > this.end.row)\n return 1;\n if (this.start.row === row)\n return column >= this.start.column ? 0 : -1;\n if (this.end.row === row)\n return column <= this.end.column ? 0 : 1;\n return 0;\n };\n this.compareStart = function (row, column) {\n if (this.start.row == row && this.start.column == column) {\n return -1;\n }\n else {\n return this.compare(row, column);\n }\n };\n this.compareEnd = function (row, column) {\n if (this.end.row == row && this.end.column == column) {\n return 1;\n }\n else {\n return this.compare(row, column);\n }\n };\n this.compareInside = function (row, column) {\n if (this.end.row == row && this.end.column == column) {\n return 1;\n }\n else if (this.start.row == row && this.start.column == column) {\n return -1;\n }\n else {\n return this.compare(row, column);\n }\n };\n this.clipRows = function (firstRow, lastRow) {\n if (this.end.row > lastRow)\n var end = { row: lastRow + 1, column: 0 };\n else if (this.end.row < firstRow)\n var end = { row: firstRow, column: 0 };\n if (this.start.row > lastRow)\n var start = { row: lastRow + 1, column: 0 };\n else if (this.start.row < firstRow)\n var start = { row: firstRow, column: 0 };\n return Range.fromPoints(start || this.start, end || this.end);\n };\n this.extend = function (row, column) {\n var cmp = this.compare(row, column);\n if (cmp == 0)\n return this;\n else if (cmp == -1)\n var start = { row: row, column: column };\n else\n var end = { row: row, column: column };\n return Range.fromPoints(start || this.start, end || this.end);\n };\n this.isEmpty = function () {\n return (this.start.row === this.end.row && this.start.column === this.end.column);\n };\n this.isMultiLine = function () {\n return (this.start.row !== this.end.row);\n };\n this.clone = function () {\n return Range.fromPoints(this.start, this.end);\n };\n this.collapseRows = function () {\n if (this.end.column == 0)\n return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0);\n else\n return new Range(this.start.row, 0, this.end.row, 0);\n };\n this.toScreenRange = function (session) {\n var screenPosStart = session.documentToScreenPosition(this.start);\n var screenPosEnd = session.documentToScreenPosition(this.end);\n return new Range(screenPosStart.row, screenPosStart.column, screenPosEnd.row, screenPosEnd.column);\n };\n this.moveBy = function (row, column) {\n this.start.row += row;\n this.start.column += column;\n this.end.row += row;\n this.end.column += column;\n };\n}).call(Range.prototype);\nRange.fromPoints = function (start, end) {\n return new Range(start.row, start.column, end.row, end.column);\n};\nRange.comparePoints = comparePoints;\nRange.comparePoints = function (p1, p2) {\n return p1.row - p2.row || p1.column - p2.column;\n};\nexports.Range = Range;\n\n});\n\nace.define(\"ace/clipboard\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nvar $cancelT;\nmodule.exports = {\n lineMode: false,\n pasteCancelled: function () {\n if ($cancelT && $cancelT > Date.now() - 50)\n return true;\n return $cancelT = false;\n },\n cancel: function () {\n $cancelT = Date.now();\n }\n};\n\n});\n\nace.define(\"ace/keyboard/textinput\",[\"require\",\"exports\",\"module\",\"ace/lib/event\",\"ace/lib/useragent\",\"ace/lib/dom\",\"ace/lib/lang\",\"ace/clipboard\",\"ace/lib/keys\"], function(require, exports, module){\"use strict\";\nvar event = require(\"../lib/event\");\nvar useragent = require(\"../lib/useragent\");\nvar dom = require(\"../lib/dom\");\nvar lang = require(\"../lib/lang\");\nvar clipboard = require(\"../clipboard\");\nvar BROKEN_SETDATA = useragent.isChrome < 18;\nvar USE_IE_MIME_TYPE = useragent.isIE;\nvar HAS_FOCUS_ARGS = useragent.isChrome > 63;\nvar MAX_LINE_LENGTH = 400;\nvar KEYS = require(\"../lib/keys\");\nvar MODS = KEYS.KEY_MODS;\nvar isIOS = useragent.isIOS;\nvar valueResetRegex = isIOS ? /\\s/ : /\\n/;\nvar isMobile = useragent.isMobile;\nvar TextInput = function (parentNode, host) {\n var text = dom.createElement(\"textarea\");\n text.className = \"ace_text-input\";\n text.setAttribute(\"wrap\", \"off\");\n text.setAttribute(\"autocorrect\", \"off\");\n text.setAttribute(\"autocapitalize\", \"off\");\n text.setAttribute(\"spellcheck\", false);\n text.style.opacity = \"0\";\n parentNode.insertBefore(text, parentNode.firstChild);\n var copied = false;\n var pasted = false;\n var inComposition = false;\n var sendingText = false;\n var tempStyle = '';\n if (!isMobile)\n text.style.fontSize = \"1px\";\n var commandMode = false;\n var ignoreFocusEvents = false;\n var lastValue = \"\";\n var lastSelectionStart = 0;\n var lastSelectionEnd = 0;\n var lastRestoreEnd = 0;\n try {\n var isFocused = document.activeElement === text;\n }\n catch (e) { }\n this.setAriaOptions = function (options) {\n if (options.activeDescendant) {\n text.setAttribute(\"aria-haspopup\", \"true\");\n text.setAttribute(\"aria-autocomplete\", \"list\");\n text.setAttribute(\"aria-activedescendant\", options.activeDescendant);\n }\n else {\n text.setAttribute(\"aria-haspopup\", \"false\");\n text.setAttribute(\"aria-autocomplete\", \"both\");\n text.removeAttribute(\"aria-activedescendant\");\n }\n if (options.role) {\n text.setAttribute(\"role\", options.role);\n }\n };\n this.setAriaOptions({ role: \"textbox\" });\n event.addListener(text, \"blur\", function (e) {\n if (ignoreFocusEvents)\n return;\n host.onBlur(e);\n isFocused = false;\n }, host);\n event.addListener(text, \"focus\", function (e) {\n if (ignoreFocusEvents)\n return;\n isFocused = true;\n if (useragent.isEdge) {\n try {\n if (!document.hasFocus())\n return;\n }\n catch (e) { }\n }\n host.onFocus(e);\n if (useragent.isEdge)\n setTimeout(resetSelection);\n else\n resetSelection();\n }, host);\n this.$focusScroll = false;\n this.focus = function () {\n if (tempStyle || HAS_FOCUS_ARGS || this.$focusScroll == \"browser\")\n return text.focus({ preventScroll: true });\n var top = text.style.top;\n text.style.position = \"fixed\";\n text.style.top = \"0px\";\n try {\n var isTransformed = text.getBoundingClientRect().top != 0;\n }\n catch (e) {\n return;\n }\n var ancestors = [];\n if (isTransformed) {\n var t = text.parentElement;\n while (t && t.nodeType == 1) {\n ancestors.push(t);\n t.setAttribute(\"ace_nocontext\", true);\n if (!t.parentElement && t.getRootNode)\n t = t.getRootNode().host;\n else\n t = t.parentElement;\n }\n }\n text.focus({ preventScroll: true });\n if (isTransformed) {\n ancestors.forEach(function (p) {\n p.removeAttribute(\"ace_nocontext\");\n });\n }\n setTimeout(function () {\n text.style.position = \"\";\n if (text.style.top == \"0px\")\n text.style.top = top;\n }, 0);\n };\n this.blur = function () {\n text.blur();\n };\n this.isFocused = function () {\n return isFocused;\n };\n host.on(\"beforeEndOperation\", function () {\n var curOp = host.curOp;\n var commandName = curOp && curOp.command && curOp.command.name;\n if (commandName == \"insertstring\")\n return;\n var isUserAction = commandName && (curOp.docChanged || curOp.selectionChanged);\n if (inComposition && isUserAction) {\n lastValue = text.value = \"\";\n onCompositionEnd();\n }\n resetSelection();\n });\n var resetSelection = isIOS\n ? function (value) {\n if (!isFocused || (copied && !value) || sendingText)\n return;\n if (!value)\n value = \"\";\n var newValue = \"\\n ab\" + value + \"cde fg\\n\";\n if (newValue != text.value)\n text.value = lastValue = newValue;\n var selectionStart = 4;\n var selectionEnd = 4 + (value.length || (host.selection.isEmpty() ? 0 : 1));\n if (lastSelectionStart != selectionStart || lastSelectionEnd != selectionEnd) {\n text.setSelectionRange(selectionStart, selectionEnd);\n }\n lastSelectionStart = selectionStart;\n lastSelectionEnd = selectionEnd;\n }\n : function () {\n if (inComposition || sendingText)\n return;\n if (!isFocused && !afterContextMenu)\n return;\n inComposition = true;\n var selectionStart = 0;\n var selectionEnd = 0;\n var line = \"\";\n if (host.session) {\n var selection = host.selection;\n var range = selection.getRange();\n var row = selection.cursor.row;\n selectionStart = range.start.column;\n selectionEnd = range.end.column;\n line = host.session.getLine(row);\n if (range.start.row != row) {\n var prevLine = host.session.getLine(row - 1);\n selectionStart = range.start.row < row - 1 ? 0 : selectionStart;\n selectionEnd += prevLine.length + 1;\n line = prevLine + \"\\n\" + line;\n }\n else if (range.end.row != row) {\n var nextLine = host.session.getLine(row + 1);\n selectionEnd = range.end.row > row + 1 ? nextLine.length : selectionEnd;\n selectionEnd += line.length + 1;\n line = line + \"\\n\" + nextLine;\n }\n else if (isMobile && row > 0) {\n line = \"\\n\" + line;\n selectionEnd += 1;\n selectionStart += 1;\n }\n if (line.length > MAX_LINE_LENGTH) {\n if (selectionStart < MAX_LINE_LENGTH && selectionEnd < MAX_LINE_LENGTH) {\n line = line.slice(0, MAX_LINE_LENGTH);\n }\n else {\n line = \"\\n\";\n if (selectionStart == selectionEnd) {\n selectionStart = selectionEnd = 0;\n }\n else {\n selectionStart = 0;\n selectionEnd = 1;\n }\n }\n }\n }\n var newValue = line + \"\\n\\n\";\n if (newValue != lastValue) {\n text.value = lastValue = newValue;\n lastSelectionStart = lastSelectionEnd = newValue.length;\n }\n if (afterContextMenu) {\n lastSelectionStart = text.selectionStart;\n lastSelectionEnd = text.selectionEnd;\n }\n if (lastSelectionEnd != selectionEnd\n || lastSelectionStart != selectionStart\n || text.selectionEnd != lastSelectionEnd // on ie edge selectionEnd changes silently after the initialization\n ) {\n try {\n text.setSelectionRange(selectionStart, selectionEnd);\n lastSelectionStart = selectionStart;\n lastSelectionEnd = selectionEnd;\n }\n catch (e) { }\n }\n inComposition = false;\n };\n this.resetSelection = resetSelection;\n if (isFocused)\n host.onFocus();\n var isAllSelected = function (text) {\n return text.selectionStart === 0 && text.selectionEnd >= lastValue.length\n && text.value === lastValue && lastValue\n && text.selectionEnd !== lastSelectionEnd;\n };\n var onSelect = function (e) {\n if (inComposition)\n return;\n if (copied) {\n copied = false;\n }\n else if (isAllSelected(text)) {\n host.selectAll();\n resetSelection();\n }\n else if (isMobile && text.selectionStart != lastSelectionStart) {\n resetSelection();\n }\n };\n var inputHandler = null;\n this.setInputHandler = function (cb) { inputHandler = cb; };\n this.getInputHandler = function () { return inputHandler; };\n var afterContextMenu = false;\n var sendText = function (value, fromInput) {\n if (afterContextMenu)\n afterContextMenu = false;\n if (pasted) {\n resetSelection();\n if (value)\n host.onPaste(value);\n pasted = false;\n return \"\";\n }\n else {\n var selectionStart = text.selectionStart;\n var selectionEnd = text.selectionEnd;\n var extendLeft = lastSelectionStart;\n var extendRight = lastValue.length - lastSelectionEnd;\n var inserted = value;\n var restoreStart = value.length - selectionStart;\n var restoreEnd = value.length - selectionEnd;\n var i = 0;\n while (extendLeft > 0 && lastValue[i] == value[i]) {\n i++;\n extendLeft--;\n }\n inserted = inserted.slice(i);\n i = 1;\n while (extendRight > 0 && lastValue.length - i > lastSelectionStart - 1 && lastValue[lastValue.length - i] == value[value.length - i]) {\n i++;\n extendRight--;\n }\n restoreStart -= i - 1;\n restoreEnd -= i - 1;\n var endIndex = inserted.length - i + 1;\n if (endIndex < 0) {\n extendLeft = -endIndex;\n endIndex = 0;\n }\n inserted = inserted.slice(0, endIndex);\n if (!fromInput && !inserted && !restoreStart && !extendLeft && !extendRight && !restoreEnd)\n return \"\";\n sendingText = true;\n var shouldReset = false;\n if (useragent.isAndroid && inserted == \". \") {\n inserted = \" \";\n shouldReset = true;\n }\n if (inserted && !extendLeft && !extendRight && !restoreStart && !restoreEnd || commandMode) {\n host.onTextInput(inserted);\n }\n else {\n host.onTextInput(inserted, {\n extendLeft: extendLeft,\n extendRight: extendRight,\n restoreStart: restoreStart,\n restoreEnd: restoreEnd\n });\n }\n sendingText = false;\n lastValue = value;\n lastSelectionStart = selectionStart;\n lastSelectionEnd = selectionEnd;\n lastRestoreEnd = restoreEnd;\n return shouldReset ? \"\\n\" : inserted;\n }\n };\n var onInput = function (e) {\n if (inComposition)\n return onCompositionUpdate();\n if (e && e.inputType) {\n if (e.inputType == \"historyUndo\")\n return host.execCommand(\"undo\");\n if (e.inputType == \"historyRedo\")\n return host.execCommand(\"redo\");\n }\n var data = text.value;\n var inserted = sendText(data, true);\n if (data.length > MAX_LINE_LENGTH + 100\n || valueResetRegex.test(inserted)\n || isMobile && lastSelectionStart < 1 && lastSelectionStart == lastSelectionEnd) {\n resetSelection();\n }\n };\n var handleClipboardData = function (e, data, forceIEMime) {\n var clipboardData = e.clipboardData || window.clipboardData;\n if (!clipboardData || BROKEN_SETDATA)\n return;\n var mime = USE_IE_MIME_TYPE || forceIEMime ? \"Text\" : \"text/plain\";\n try {\n if (data) {\n return clipboardData.setData(mime, data) !== false;\n }\n else {\n return clipboardData.getData(mime);\n }\n }\n catch (e) {\n if (!forceIEMime)\n return handleClipboardData(e, data, true);\n }\n };\n var doCopy = function (e, isCut) {\n var data = host.getCopyText();\n if (!data)\n return event.preventDefault(e);\n if (handleClipboardData(e, data)) {\n if (isIOS) {\n resetSelection(data);\n copied = data;\n setTimeout(function () {\n copied = false;\n }, 10);\n }\n isCut ? host.onCut() : host.onCopy();\n event.preventDefault(e);\n }\n else {\n copied = true;\n text.value = data;\n text.select();\n setTimeout(function () {\n copied = false;\n resetSelection();\n isCut ? host.onCut() : host.onCopy();\n });\n }\n };\n var onCut = function (e) {\n doCopy(e, true);\n };\n var onCopy = function (e) {\n doCopy(e, false);\n };\n var onPaste = function (e) {\n var data = handleClipboardData(e);\n if (clipboard.pasteCancelled())\n return;\n if (typeof data == \"string\") {\n if (data)\n host.onPaste(data, e);\n if (useragent.isIE)\n setTimeout(resetSelection);\n event.preventDefault(e);\n }\n else {\n text.value = \"\";\n pasted = true;\n }\n };\n event.addCommandKeyListener(text, host.onCommandKey.bind(host), host);\n event.addListener(text, \"select\", onSelect, host);\n event.addListener(text, \"input\", onInput, host);\n event.addListener(text, \"cut\", onCut, host);\n event.addListener(text, \"copy\", onCopy, host);\n event.addListener(text, \"paste\", onPaste, host);\n if (!('oncut' in text) || !('oncopy' in text) || !('onpaste' in text)) {\n event.addListener(parentNode, \"keydown\", function (e) {\n if ((useragent.isMac && !e.metaKey) || !e.ctrlKey)\n return;\n switch (e.keyCode) {\n case 67:\n onCopy(e);\n break;\n case 86:\n onPaste(e);\n break;\n case 88:\n onCut(e);\n break;\n }\n }, host);\n }\n var onCompositionStart = function (e) {\n if (inComposition || !host.onCompositionStart || host.$readOnly)\n return;\n inComposition = {};\n if (commandMode)\n return;\n if (e.data)\n inComposition.useTextareaForIME = false;\n setTimeout(onCompositionUpdate, 0);\n host._signal(\"compositionStart\");\n host.on(\"mousedown\", cancelComposition);\n var range = host.getSelectionRange();\n range.end.row = range.start.row;\n range.end.column = range.start.column;\n inComposition.markerRange = range;\n inComposition.selectionStart = lastSelectionStart;\n host.onCompositionStart(inComposition);\n if (inComposition.useTextareaForIME) {\n lastValue = text.value = \"\";\n lastSelectionStart = 0;\n lastSelectionEnd = 0;\n }\n else {\n if (text.msGetInputContext)\n inComposition.context = text.msGetInputContext();\n if (text.getInputContext)\n inComposition.context = text.getInputContext();\n }\n };\n var onCompositionUpdate = function () {\n if (!inComposition || !host.onCompositionUpdate || host.$readOnly)\n return;\n if (commandMode)\n return cancelComposition();\n if (inComposition.useTextareaForIME) {\n host.onCompositionUpdate(text.value);\n }\n else {\n var data = text.value;\n sendText(data);\n if (inComposition.markerRange) {\n if (inComposition.context) {\n inComposition.markerRange.start.column = inComposition.selectionStart\n = inComposition.context.compositionStartOffset;\n }\n inComposition.markerRange.end.column = inComposition.markerRange.start.column\n + lastSelectionEnd - inComposition.selectionStart + lastRestoreEnd;\n }\n }\n };\n var onCompositionEnd = function (e) {\n if (!host.onCompositionEnd || host.$readOnly)\n return;\n inComposition = false;\n host.onCompositionEnd();\n host.off(\"mousedown\", cancelComposition);\n if (e)\n onInput();\n };\n function cancelComposition() {\n ignoreFocusEvents = true;\n text.blur();\n text.focus();\n ignoreFocusEvents = false;\n }\n var syncComposition = lang.delayedCall(onCompositionUpdate, 50).schedule.bind(null, null);\n function onKeyup(e) {\n if (e.keyCode == 27 && text.value.length < text.selectionStart) {\n if (!inComposition)\n lastValue = text.value;\n lastSelectionStart = lastSelectionEnd = -1;\n resetSelection();\n }\n syncComposition();\n }\n event.addListener(text, \"compositionstart\", onCompositionStart, host);\n event.addListener(text, \"compositionupdate\", onCompositionUpdate, host);\n event.addListener(text, \"keyup\", onKeyup, host);\n event.addListener(text, \"keydown\", syncComposition, host);\n event.addListener(text, \"compositionend\", onCompositionEnd, host);\n this.getElement = function () {\n return text;\n };\n this.setCommandMode = function (value) {\n commandMode = value;\n text.readOnly = false;\n };\n this.setReadOnly = function (readOnly) {\n if (!commandMode)\n text.readOnly = readOnly;\n };\n this.setCopyWithEmptySelection = function (value) {\n };\n this.onContextMenu = function (e) {\n afterContextMenu = true;\n resetSelection();\n host._emit(\"nativecontextmenu\", { target: host, domEvent: e });\n this.moveToMouse(e, true);\n };\n this.moveToMouse = function (e, bringToFront) {\n if (!tempStyle)\n tempStyle = text.style.cssText;\n text.style.cssText = (bringToFront ? \"z-index:100000;\" : \"\")\n + (useragent.isIE ? \"opacity:0.1;\" : \"\")\n + \"text-indent: -\" + (lastSelectionStart + lastSelectionEnd) * host.renderer.characterWidth * 0.5 + \"px;\";\n var rect = host.container.getBoundingClientRect();\n var style = dom.computedStyle(host.container);\n var top = rect.top + (parseInt(style.borderTopWidth) || 0);\n var left = rect.left + (parseInt(rect.borderLeftWidth) || 0);\n var maxTop = rect.bottom - top - text.clientHeight - 2;\n var move = function (e) {\n dom.translate(text, e.clientX - left - 2, Math.min(e.clientY - top - 2, maxTop));\n };\n move(e);\n if (e.type != \"mousedown\")\n return;\n host.renderer.$isMousePressed = true;\n clearTimeout(closeTimeout);\n if (useragent.isWin)\n event.capture(host.container, move, onContextMenuClose);\n };\n this.onContextMenuClose = onContextMenuClose;\n var closeTimeout;\n function onContextMenuClose() {\n clearTimeout(closeTimeout);\n closeTimeout = setTimeout(function () {\n if (tempStyle) {\n text.style.cssText = tempStyle;\n tempStyle = '';\n }\n host.renderer.$isMousePressed = false;\n if (host.renderer.$keepTextAreaAtCursor)\n host.renderer.$moveTextAreaToCursor();\n }, 0);\n }\n var onContextMenu = function (e) {\n host.textInput.onContextMenu(e);\n onContextMenuClose();\n };\n event.addListener(text, \"mouseup\", onContextMenu, host);\n event.addListener(text, \"mousedown\", function (e) {\n e.preventDefault();\n onContextMenuClose();\n }, host);\n event.addListener(host.renderer.scroller, \"contextmenu\", onContextMenu, host);\n event.addListener(text, \"contextmenu\", onContextMenu, host);\n if (isIOS)\n addIosSelectionHandler(parentNode, host, text);\n function addIosSelectionHandler(parentNode, host, text) {\n var typingResetTimeout = null;\n var typing = false;\n text.addEventListener(\"keydown\", function (e) {\n if (typingResetTimeout)\n clearTimeout(typingResetTimeout);\n typing = true;\n }, true);\n text.addEventListener(\"keyup\", function (e) {\n typingResetTimeout = setTimeout(function () {\n typing = false;\n }, 100);\n }, true);\n var detectArrowKeys = function (e) {\n if (document.activeElement !== text)\n return;\n if (typing || inComposition || host.$mouseHandler.isMousePressed)\n return;\n if (copied) {\n return;\n }\n var selectionStart = text.selectionStart;\n var selectionEnd = text.selectionEnd;\n var key = null;\n var modifier = 0;\n if (selectionStart == 0) {\n key = KEYS.up;\n }\n else if (selectionStart == 1) {\n key = KEYS.home;\n }\n else if (selectionEnd > lastSelectionEnd && lastValue[selectionEnd] == \"\\n\") {\n key = KEYS.end;\n }\n else if (selectionStart < lastSelectionStart && lastValue[selectionStart - 1] == \" \") {\n key = KEYS.left;\n modifier = MODS.option;\n }\n else if (selectionStart < lastSelectionStart\n || (selectionStart == lastSelectionStart\n && lastSelectionEnd != lastSelectionStart\n && selectionStart == selectionEnd)) {\n key = KEYS.left;\n }\n else if (selectionEnd > lastSelectionEnd && lastValue.slice(0, selectionEnd).split(\"\\n\").length > 2) {\n key = KEYS.down;\n }\n else if (selectionEnd > lastSelectionEnd && lastValue[selectionEnd - 1] == \" \") {\n key = KEYS.right;\n modifier = MODS.option;\n }\n else if (selectionEnd > lastSelectionEnd\n || (selectionEnd == lastSelectionEnd\n && lastSelectionEnd != lastSelectionStart\n && selectionStart == selectionEnd)) {\n key = KEYS.right;\n }\n if (selectionStart !== selectionEnd)\n modifier |= MODS.shift;\n if (key) {\n var result = host.onCommandKey({}, modifier, key);\n if (!result && host.commands) {\n key = KEYS.keyCodeToString(key);\n var command = host.commands.findKeyCommand(modifier, key);\n if (command)\n host.execCommand(command);\n }\n lastSelectionStart = selectionStart;\n lastSelectionEnd = selectionEnd;\n resetSelection(\"\");\n }\n };\n document.addEventListener(\"selectionchange\", detectArrowKeys);\n host.on(\"destroy\", function () {\n document.removeEventListener(\"selectionchange\", detectArrowKeys);\n });\n }\n this.destroy = function () {\n if (text.parentElement)\n text.parentElement.removeChild(text);\n };\n};\nexports.TextInput = TextInput;\nexports.$setUserAgentForTests = function (_isMobile, _isIOS) {\n isMobile = _isMobile;\n isIOS = _isIOS;\n};\n\n});\n\nace.define(\"ace/mouse/default_handlers\",[\"require\",\"exports\",\"module\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar useragent = require(\"../lib/useragent\");\nvar DRAG_OFFSET = 0; // pixels\nvar SCROLL_COOLDOWN_T = 550; // milliseconds\nfunction DefaultHandlers(mouseHandler) {\n mouseHandler.$clickSelection = null;\n var editor = mouseHandler.editor;\n editor.setDefaultHandler(\"mousedown\", this.onMouseDown.bind(mouseHandler));\n editor.setDefaultHandler(\"dblclick\", this.onDoubleClick.bind(mouseHandler));\n editor.setDefaultHandler(\"tripleclick\", this.onTripleClick.bind(mouseHandler));\n editor.setDefaultHandler(\"quadclick\", this.onQuadClick.bind(mouseHandler));\n editor.setDefaultHandler(\"mousewheel\", this.onMouseWheel.bind(mouseHandler));\n var exports = [\"select\", \"startSelect\", \"selectEnd\", \"selectAllEnd\", \"selectByWordsEnd\",\n \"selectByLinesEnd\", \"dragWait\", \"dragWaitEnd\", \"focusWait\"];\n exports.forEach(function (x) {\n mouseHandler[x] = this[x];\n }, this);\n mouseHandler.selectByLines = this.extendSelectionBy.bind(mouseHandler, \"getLineRange\");\n mouseHandler.selectByWords = this.extendSelectionBy.bind(mouseHandler, \"getWordRange\");\n}\n(function () {\n this.onMouseDown = function (ev) {\n var inSelection = ev.inSelection();\n var pos = ev.getDocumentPosition();\n this.mousedownEvent = ev;\n var editor = this.editor;\n var button = ev.getButton();\n if (button !== 0) {\n var selectionRange = editor.getSelectionRange();\n var selectionEmpty = selectionRange.isEmpty();\n if (selectionEmpty || button == 1)\n editor.selection.moveToPosition(pos);\n if (button == 2) {\n editor.textInput.onContextMenu(ev.domEvent);\n if (!useragent.isMozilla)\n ev.preventDefault();\n }\n return;\n }\n this.mousedownEvent.time = Date.now();\n if (inSelection && !editor.isFocused()) {\n editor.focus();\n if (this.$focusTimeout && !this.$clickSelection && !editor.inMultiSelectMode) {\n this.setState(\"focusWait\");\n this.captureMouse(ev);\n return;\n }\n }\n this.captureMouse(ev);\n this.startSelect(pos, ev.domEvent._clicks > 1);\n return ev.preventDefault();\n };\n this.startSelect = function (pos, waitForClickSelection) {\n pos = pos || this.editor.renderer.screenToTextCoordinates(this.x, this.y);\n var editor = this.editor;\n if (!this.mousedownEvent)\n return;\n if (this.mousedownEvent.getShiftKey())\n editor.selection.selectToPosition(pos);\n else if (!waitForClickSelection)\n editor.selection.moveToPosition(pos);\n if (!waitForClickSelection)\n this.select();\n if (editor.renderer.scroller.setCapture) {\n editor.renderer.scroller.setCapture();\n }\n editor.setStyle(\"ace_selecting\");\n this.setState(\"select\");\n };\n this.select = function () {\n var anchor, editor = this.editor;\n var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y);\n if (this.$clickSelection) {\n var cmp = this.$clickSelection.comparePoint(cursor);\n if (cmp == -1) {\n anchor = this.$clickSelection.end;\n }\n else if (cmp == 1) {\n anchor = this.$clickSelection.start;\n }\n else {\n var orientedRange = calcRangeOrientation(this.$clickSelection, cursor);\n cursor = orientedRange.cursor;\n anchor = orientedRange.anchor;\n }\n editor.selection.setSelectionAnchor(anchor.row, anchor.column);\n }\n editor.selection.selectToPosition(cursor);\n editor.renderer.scrollCursorIntoView();\n };\n this.extendSelectionBy = function (unitName) {\n var anchor, editor = this.editor;\n var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y);\n var range = editor.selection[unitName](cursor.row, cursor.column);\n if (this.$clickSelection) {\n var cmpStart = this.$clickSelection.comparePoint(range.start);\n var cmpEnd = this.$clickSelection.comparePoint(range.end);\n if (cmpStart == -1 && cmpEnd <= 0) {\n anchor = this.$clickSelection.end;\n if (range.end.row != cursor.row || range.end.column != cursor.column)\n cursor = range.start;\n }\n else if (cmpEnd == 1 && cmpStart >= 0) {\n anchor = this.$clickSelection.start;\n if (range.start.row != cursor.row || range.start.column != cursor.column)\n cursor = range.end;\n }\n else if (cmpStart == -1 && cmpEnd == 1) {\n cursor = range.end;\n anchor = range.start;\n }\n else {\n var orientedRange = calcRangeOrientation(this.$clickSelection, cursor);\n cursor = orientedRange.cursor;\n anchor = orientedRange.anchor;\n }\n editor.selection.setSelectionAnchor(anchor.row, anchor.column);\n }\n editor.selection.selectToPosition(cursor);\n editor.renderer.scrollCursorIntoView();\n };\n this.selectEnd =\n this.selectAllEnd =\n this.selectByWordsEnd =\n this.selectByLinesEnd = function () {\n this.$clickSelection = null;\n this.editor.unsetStyle(\"ace_selecting\");\n if (this.editor.renderer.scroller.releaseCapture) {\n this.editor.renderer.scroller.releaseCapture();\n }\n };\n this.focusWait = function () {\n var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);\n var time = Date.now();\n if (distance > DRAG_OFFSET || time - this.mousedownEvent.time > this.$focusTimeout)\n this.startSelect(this.mousedownEvent.getDocumentPosition());\n };\n this.onDoubleClick = function (ev) {\n var pos = ev.getDocumentPosition();\n var editor = this.editor;\n var session = editor.session;\n var range = session.getBracketRange(pos);\n if (range) {\n if (range.isEmpty()) {\n range.start.column--;\n range.end.column++;\n }\n this.setState(\"select\");\n }\n else {\n range = editor.selection.getWordRange(pos.row, pos.column);\n this.setState(\"selectByWords\");\n }\n this.$clickSelection = range;\n this.select();\n };\n this.onTripleClick = function (ev) {\n var pos = ev.getDocumentPosition();\n var editor = this.editor;\n this.setState(\"selectByLines\");\n var range = editor.getSelectionRange();\n if (range.isMultiLine() && range.contains(pos.row, pos.column)) {\n this.$clickSelection = editor.selection.getLineRange(range.start.row);\n this.$clickSelection.end = editor.selection.getLineRange(range.end.row).end;\n }\n else {\n this.$clickSelection = editor.selection.getLineRange(pos.row);\n }\n this.select();\n };\n this.onQuadClick = function (ev) {\n var editor = this.editor;\n editor.selectAll();\n this.$clickSelection = editor.getSelectionRange();\n this.setState(\"selectAll\");\n };\n this.onMouseWheel = function (ev) {\n if (ev.getAccelKey())\n return;\n if (ev.getShiftKey() && ev.wheelY && !ev.wheelX) {\n ev.wheelX = ev.wheelY;\n ev.wheelY = 0;\n }\n var editor = this.editor;\n if (!this.$lastScroll)\n this.$lastScroll = { t: 0, vx: 0, vy: 0, allowed: 0 };\n var prevScroll = this.$lastScroll;\n var t = ev.domEvent.timeStamp;\n var dt = t - prevScroll.t;\n var vx = dt ? ev.wheelX / dt : prevScroll.vx;\n var vy = dt ? ev.wheelY / dt : prevScroll.vy;\n if (dt < SCROLL_COOLDOWN_T) {\n vx = (vx + prevScroll.vx) / 2;\n vy = (vy + prevScroll.vy) / 2;\n }\n var direction = Math.abs(vx / vy);\n var canScroll = false;\n if (direction >= 1 && editor.renderer.isScrollableBy(ev.wheelX * ev.speed, 0))\n canScroll = true;\n if (direction <= 1 && editor.renderer.isScrollableBy(0, ev.wheelY * ev.speed))\n canScroll = true;\n if (canScroll) {\n prevScroll.allowed = t;\n }\n else if (t - prevScroll.allowed < SCROLL_COOLDOWN_T) {\n var isSlower = Math.abs(vx) <= 1.5 * Math.abs(prevScroll.vx)\n && Math.abs(vy) <= 1.5 * Math.abs(prevScroll.vy);\n if (isSlower) {\n canScroll = true;\n prevScroll.allowed = t;\n }\n else {\n prevScroll.allowed = 0;\n }\n }\n prevScroll.t = t;\n prevScroll.vx = vx;\n prevScroll.vy = vy;\n if (canScroll) {\n editor.renderer.scrollBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed);\n return ev.stop();\n }\n };\n}).call(DefaultHandlers.prototype);\nexports.DefaultHandlers = DefaultHandlers;\nfunction calcDistance(ax, ay, bx, by) {\n return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2));\n}\nfunction calcRangeOrientation(range, cursor) {\n if (range.start.row == range.end.row)\n var cmp = 2 * cursor.column - range.start.column - range.end.column;\n else if (range.start.row == range.end.row - 1 && !range.start.column && !range.end.column)\n var cmp = cursor.column - 4;\n else\n var cmp = 2 * cursor.row - range.start.row - range.end.row;\n if (cmp < 0)\n return { cursor: range.start, anchor: range.end };\n else\n return { cursor: range.end, anchor: range.start };\n}\n\n});\n\nace.define(\"ace/tooltip\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar dom = require(\"./lib/dom\");\nvar CLASSNAME = \"ace_tooltip\";\nfunction Tooltip(parentNode) {\n this.isOpen = false;\n this.$element = null;\n this.$parentNode = parentNode;\n}\n(function () {\n this.$init = function () {\n this.$element = dom.createElement(\"div\");\n this.$element.className = CLASSNAME;\n this.$element.style.display = \"none\";\n this.$parentNode.appendChild(this.$element);\n return this.$element;\n };\n this.getElement = function () {\n return this.$element || this.$init();\n };\n this.setText = function (text) {\n this.getElement().textContent = text;\n };\n this.setHtml = function (html) {\n this.getElement().innerHTML = html;\n };\n this.setPosition = function (x, y) {\n this.getElement().style.left = x + \"px\";\n this.getElement().style.top = y + \"px\";\n };\n this.setClassName = function (className) {\n dom.addCssClass(this.getElement(), className);\n };\n this.show = function (text, x, y) {\n if (text != null)\n this.setText(text);\n if (x != null && y != null)\n this.setPosition(x, y);\n if (!this.isOpen) {\n this.getElement().style.display = \"block\";\n this.isOpen = true;\n }\n };\n this.hide = function () {\n if (this.isOpen) {\n this.getElement().style.display = \"none\";\n this.getElement().className = CLASSNAME;\n this.isOpen = false;\n }\n };\n this.getHeight = function () {\n return this.getElement().offsetHeight;\n };\n this.getWidth = function () {\n return this.getElement().offsetWidth;\n };\n this.destroy = function () {\n this.isOpen = false;\n if (this.$element && this.$element.parentNode) {\n this.$element.parentNode.removeChild(this.$element);\n }\n };\n}).call(Tooltip.prototype);\nexports.Tooltip = Tooltip;\n\n});\n\nace.define(\"ace/mouse/default_gutter_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/lib/oop\",\"ace/lib/event\",\"ace/tooltip\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar oop = require(\"../lib/oop\");\nvar event = require(\"../lib/event\");\nvar Tooltip = require(\"../tooltip\").Tooltip;\nfunction GutterHandler(mouseHandler) {\n var editor = mouseHandler.editor;\n var gutter = editor.renderer.$gutterLayer;\n var tooltip = new GutterTooltip(editor.container);\n mouseHandler.editor.setDefaultHandler(\"guttermousedown\", function (e) {\n if (!editor.isFocused() || e.getButton() != 0)\n return;\n var gutterRegion = gutter.getRegion(e);\n if (gutterRegion == \"foldWidgets\")\n return;\n var row = e.getDocumentPosition().row;\n var selection = editor.session.selection;\n if (e.getShiftKey())\n selection.selectTo(row, 0);\n else {\n if (e.domEvent.detail == 2) {\n editor.selectAll();\n return e.preventDefault();\n }\n mouseHandler.$clickSelection = editor.selection.getLineRange(row);\n }\n mouseHandler.setState(\"selectByLines\");\n mouseHandler.captureMouse(e);\n return e.preventDefault();\n });\n var tooltipTimeout, mouseEvent, tooltipAnnotation;\n function showTooltip() {\n var row = mouseEvent.getDocumentPosition().row;\n var annotation = gutter.$annotations[row];\n if (!annotation)\n return hideTooltip();\n var maxRow = editor.session.getLength();\n if (row == maxRow) {\n var screenRow = editor.renderer.pixelToScreenCoordinates(0, mouseEvent.y).row;\n var pos = mouseEvent.$pos;\n if (screenRow > editor.session.documentToScreenRow(pos.row, pos.column))\n return hideTooltip();\n }\n if (tooltipAnnotation == annotation)\n return;\n tooltipAnnotation = annotation.text.join(\"
\");\n tooltip.setHtml(tooltipAnnotation);\n var annotationClassName = annotation.className;\n if (annotationClassName) {\n tooltip.setClassName(annotationClassName.trim());\n }\n tooltip.show();\n editor._signal(\"showGutterTooltip\", tooltip);\n editor.on(\"mousewheel\", hideTooltip);\n if (mouseHandler.$tooltipFollowsMouse) {\n moveTooltip(mouseEvent);\n }\n else {\n var gutterElement = mouseEvent.domEvent.target;\n var rect = gutterElement.getBoundingClientRect();\n var style = tooltip.getElement().style;\n style.left = rect.right + \"px\";\n style.top = rect.bottom + \"px\";\n }\n }\n function hideTooltip() {\n if (tooltipTimeout)\n tooltipTimeout = clearTimeout(tooltipTimeout);\n if (tooltipAnnotation) {\n tooltip.hide();\n tooltipAnnotation = null;\n editor._signal(\"hideGutterTooltip\", tooltip);\n editor.off(\"mousewheel\", hideTooltip);\n }\n }\n function moveTooltip(e) {\n tooltip.setPosition(e.x, e.y);\n }\n mouseHandler.editor.setDefaultHandler(\"guttermousemove\", function (e) {\n var target = e.domEvent.target || e.domEvent.srcElement;\n if (dom.hasCssClass(target, \"ace_fold-widget\"))\n return hideTooltip();\n if (tooltipAnnotation && mouseHandler.$tooltipFollowsMouse)\n moveTooltip(e);\n mouseEvent = e;\n if (tooltipTimeout)\n return;\n tooltipTimeout = setTimeout(function () {\n tooltipTimeout = null;\n if (mouseEvent && !mouseHandler.isMousePressed)\n showTooltip();\n else\n hideTooltip();\n }, 50);\n });\n event.addListener(editor.renderer.$gutter, \"mouseout\", function (e) {\n mouseEvent = null;\n if (!tooltipAnnotation || tooltipTimeout)\n return;\n tooltipTimeout = setTimeout(function () {\n tooltipTimeout = null;\n hideTooltip();\n }, 50);\n }, editor);\n editor.on(\"changeSession\", hideTooltip);\n}\nfunction GutterTooltip(parentNode) {\n Tooltip.call(this, parentNode);\n}\noop.inherits(GutterTooltip, Tooltip);\n(function () {\n this.setPosition = function (x, y) {\n var windowWidth = window.innerWidth || document.documentElement.clientWidth;\n var windowHeight = window.innerHeight || document.documentElement.clientHeight;\n var width = this.getWidth();\n var height = this.getHeight();\n x += 15;\n y += 15;\n if (x + width > windowWidth) {\n x -= (x + width) - windowWidth;\n }\n if (y + height > windowHeight) {\n y -= 20 + height;\n }\n Tooltip.prototype.setPosition.call(this, x, y);\n };\n}).call(GutterTooltip.prototype);\nexports.GutterHandler = GutterHandler;\n\n});\n\nace.define(\"ace/mouse/mouse_event\",[\"require\",\"exports\",\"module\",\"ace/lib/event\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar event = require(\"../lib/event\");\nvar useragent = require(\"../lib/useragent\");\nvar MouseEvent = exports.MouseEvent = function (domEvent, editor) {\n this.domEvent = domEvent;\n this.editor = editor;\n this.x = this.clientX = domEvent.clientX;\n this.y = this.clientY = domEvent.clientY;\n this.$pos = null;\n this.$inSelection = null;\n this.propagationStopped = false;\n this.defaultPrevented = false;\n};\n(function () {\n this.stopPropagation = function () {\n event.stopPropagation(this.domEvent);\n this.propagationStopped = true;\n };\n this.preventDefault = function () {\n event.preventDefault(this.domEvent);\n this.defaultPrevented = true;\n };\n this.stop = function () {\n this.stopPropagation();\n this.preventDefault();\n };\n this.getDocumentPosition = function () {\n if (this.$pos)\n return this.$pos;\n this.$pos = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY);\n return this.$pos;\n };\n this.inSelection = function () {\n if (this.$inSelection !== null)\n return this.$inSelection;\n var editor = this.editor;\n var selectionRange = editor.getSelectionRange();\n if (selectionRange.isEmpty())\n this.$inSelection = false;\n else {\n var pos = this.getDocumentPosition();\n this.$inSelection = selectionRange.contains(pos.row, pos.column);\n }\n return this.$inSelection;\n };\n this.getButton = function () {\n return event.getButton(this.domEvent);\n };\n this.getShiftKey = function () {\n return this.domEvent.shiftKey;\n };\n this.getAccelKey = useragent.isMac\n ? function () { return this.domEvent.metaKey; }\n : function () { return this.domEvent.ctrlKey; };\n}).call(MouseEvent.prototype);\n\n});\n\nace.define(\"ace/mouse/dragdrop_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/lib/event\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar event = require(\"../lib/event\");\nvar useragent = require(\"../lib/useragent\");\nvar AUTOSCROLL_DELAY = 200;\nvar SCROLL_CURSOR_DELAY = 200;\nvar SCROLL_CURSOR_HYSTERESIS = 5;\nfunction DragdropHandler(mouseHandler) {\n var editor = mouseHandler.editor;\n var dragImage = dom.createElement(\"div\");\n dragImage.style.cssText = \"top:-100px;position:absolute;z-index:2147483647;opacity:0.5\";\n dragImage.textContent = \"\\xa0\";\n var exports = [\"dragWait\", \"dragWaitEnd\", \"startDrag\", \"dragReadyEnd\", \"onMouseDrag\"];\n exports.forEach(function (x) {\n mouseHandler[x] = this[x];\n }, this);\n editor.on(\"mousedown\", this.onMouseDown.bind(mouseHandler));\n var mouseTarget = editor.container;\n var dragSelectionMarker, x, y;\n var timerId, range;\n var dragCursor, counter = 0;\n var dragOperation;\n var isInternal;\n var autoScrollStartTime;\n var cursorMovedTime;\n var cursorPointOnCaretMoved;\n this.onDragStart = function (e) {\n if (this.cancelDrag || !mouseTarget.draggable) {\n var self = this;\n setTimeout(function () {\n self.startSelect();\n self.captureMouse(e);\n }, 0);\n return e.preventDefault();\n }\n range = editor.getSelectionRange();\n var dataTransfer = e.dataTransfer;\n dataTransfer.effectAllowed = editor.getReadOnly() ? \"copy\" : \"copyMove\";\n editor.container.appendChild(dragImage);\n dataTransfer.setDragImage && dataTransfer.setDragImage(dragImage, 0, 0);\n setTimeout(function () {\n editor.container.removeChild(dragImage);\n });\n dataTransfer.clearData();\n dataTransfer.setData(\"Text\", editor.session.getTextRange());\n isInternal = true;\n this.setState(\"drag\");\n };\n this.onDragEnd = function (e) {\n mouseTarget.draggable = false;\n isInternal = false;\n this.setState(null);\n if (!editor.getReadOnly()) {\n var dropEffect = e.dataTransfer.dropEffect;\n if (!dragOperation && dropEffect == \"move\")\n editor.session.remove(editor.getSelectionRange());\n editor.$resetCursorStyle();\n }\n this.editor.unsetStyle(\"ace_dragging\");\n this.editor.renderer.setCursorStyle(\"\");\n };\n this.onDragEnter = function (e) {\n if (editor.getReadOnly() || !canAccept(e.dataTransfer))\n return;\n x = e.clientX;\n y = e.clientY;\n if (!dragSelectionMarker)\n addDragMarker();\n counter++;\n e.dataTransfer.dropEffect = dragOperation = getDropEffect(e);\n return event.preventDefault(e);\n };\n this.onDragOver = function (e) {\n if (editor.getReadOnly() || !canAccept(e.dataTransfer))\n return;\n x = e.clientX;\n y = e.clientY;\n if (!dragSelectionMarker) {\n addDragMarker();\n counter++;\n }\n if (onMouseMoveTimer !== null)\n onMouseMoveTimer = null;\n e.dataTransfer.dropEffect = dragOperation = getDropEffect(e);\n return event.preventDefault(e);\n };\n this.onDragLeave = function (e) {\n counter--;\n if (counter <= 0 && dragSelectionMarker) {\n clearDragMarker();\n dragOperation = null;\n return event.preventDefault(e);\n }\n };\n this.onDrop = function (e) {\n if (!dragCursor)\n return;\n var dataTransfer = e.dataTransfer;\n if (isInternal) {\n switch (dragOperation) {\n case \"move\":\n if (range.contains(dragCursor.row, dragCursor.column)) {\n range = {\n start: dragCursor,\n end: dragCursor\n };\n }\n else {\n range = editor.moveText(range, dragCursor);\n }\n break;\n case \"copy\":\n range = editor.moveText(range, dragCursor, true);\n break;\n }\n }\n else {\n var dropData = dataTransfer.getData('Text');\n range = {\n start: dragCursor,\n end: editor.session.insert(dragCursor, dropData)\n };\n editor.focus();\n dragOperation = null;\n }\n clearDragMarker();\n return event.preventDefault(e);\n };\n event.addListener(mouseTarget, \"dragstart\", this.onDragStart.bind(mouseHandler), editor);\n event.addListener(mouseTarget, \"dragend\", this.onDragEnd.bind(mouseHandler), editor);\n event.addListener(mouseTarget, \"dragenter\", this.onDragEnter.bind(mouseHandler), editor);\n event.addListener(mouseTarget, \"dragover\", this.onDragOver.bind(mouseHandler), editor);\n event.addListener(mouseTarget, \"dragleave\", this.onDragLeave.bind(mouseHandler), editor);\n event.addListener(mouseTarget, \"drop\", this.onDrop.bind(mouseHandler), editor);\n function scrollCursorIntoView(cursor, prevCursor) {\n var now = Date.now();\n var vMovement = !prevCursor || cursor.row != prevCursor.row;\n var hMovement = !prevCursor || cursor.column != prevCursor.column;\n if (!cursorMovedTime || vMovement || hMovement) {\n editor.moveCursorToPosition(cursor);\n cursorMovedTime = now;\n cursorPointOnCaretMoved = { x: x, y: y };\n }\n else {\n var distance = calcDistance(cursorPointOnCaretMoved.x, cursorPointOnCaretMoved.y, x, y);\n if (distance > SCROLL_CURSOR_HYSTERESIS) {\n cursorMovedTime = null;\n }\n else if (now - cursorMovedTime >= SCROLL_CURSOR_DELAY) {\n editor.renderer.scrollCursorIntoView();\n cursorMovedTime = null;\n }\n }\n }\n function autoScroll(cursor, prevCursor) {\n var now = Date.now();\n var lineHeight = editor.renderer.layerConfig.lineHeight;\n var characterWidth = editor.renderer.layerConfig.characterWidth;\n var editorRect = editor.renderer.scroller.getBoundingClientRect();\n var offsets = {\n x: {\n left: x - editorRect.left,\n right: editorRect.right - x\n },\n y: {\n top: y - editorRect.top,\n bottom: editorRect.bottom - y\n }\n };\n var nearestXOffset = Math.min(offsets.x.left, offsets.x.right);\n var nearestYOffset = Math.min(offsets.y.top, offsets.y.bottom);\n var scrollCursor = { row: cursor.row, column: cursor.column };\n if (nearestXOffset / characterWidth <= 2) {\n scrollCursor.column += (offsets.x.left < offsets.x.right ? -3 : +2);\n }\n if (nearestYOffset / lineHeight <= 1) {\n scrollCursor.row += (offsets.y.top < offsets.y.bottom ? -1 : +1);\n }\n var vScroll = cursor.row != scrollCursor.row;\n var hScroll = cursor.column != scrollCursor.column;\n var vMovement = !prevCursor || cursor.row != prevCursor.row;\n if (vScroll || (hScroll && !vMovement)) {\n if (!autoScrollStartTime)\n autoScrollStartTime = now;\n else if (now - autoScrollStartTime >= AUTOSCROLL_DELAY)\n editor.renderer.scrollCursorIntoView(scrollCursor);\n }\n else {\n autoScrollStartTime = null;\n }\n }\n function onDragInterval() {\n var prevCursor = dragCursor;\n dragCursor = editor.renderer.screenToTextCoordinates(x, y);\n scrollCursorIntoView(dragCursor, prevCursor);\n autoScroll(dragCursor, prevCursor);\n }\n function addDragMarker() {\n range = editor.selection.toOrientedRange();\n dragSelectionMarker = editor.session.addMarker(range, \"ace_selection\", editor.getSelectionStyle());\n editor.clearSelection();\n if (editor.isFocused())\n editor.renderer.$cursorLayer.setBlinking(false);\n clearInterval(timerId);\n onDragInterval();\n timerId = setInterval(onDragInterval, 20);\n counter = 0;\n event.addListener(document, \"mousemove\", onMouseMove);\n }\n function clearDragMarker() {\n clearInterval(timerId);\n editor.session.removeMarker(dragSelectionMarker);\n dragSelectionMarker = null;\n editor.selection.fromOrientedRange(range);\n if (editor.isFocused() && !isInternal)\n editor.$resetCursorStyle();\n range = null;\n dragCursor = null;\n counter = 0;\n autoScrollStartTime = null;\n cursorMovedTime = null;\n event.removeListener(document, \"mousemove\", onMouseMove);\n }\n var onMouseMoveTimer = null;\n function onMouseMove() {\n if (onMouseMoveTimer == null) {\n onMouseMoveTimer = setTimeout(function () {\n if (onMouseMoveTimer != null && dragSelectionMarker)\n clearDragMarker();\n }, 20);\n }\n }\n function canAccept(dataTransfer) {\n var types = dataTransfer.types;\n return !types || Array.prototype.some.call(types, function (type) {\n return type == 'text/plain' || type == 'Text';\n });\n }\n function getDropEffect(e) {\n var copyAllowed = ['copy', 'copymove', 'all', 'uninitialized'];\n var moveAllowed = ['move', 'copymove', 'linkmove', 'all', 'uninitialized'];\n var copyModifierState = useragent.isMac ? e.altKey : e.ctrlKey;\n var effectAllowed = \"uninitialized\";\n try {\n effectAllowed = e.dataTransfer.effectAllowed.toLowerCase();\n }\n catch (e) { }\n var dropEffect = \"none\";\n if (copyModifierState && copyAllowed.indexOf(effectAllowed) >= 0)\n dropEffect = \"copy\";\n else if (moveAllowed.indexOf(effectAllowed) >= 0)\n dropEffect = \"move\";\n else if (copyAllowed.indexOf(effectAllowed) >= 0)\n dropEffect = \"copy\";\n return dropEffect;\n }\n}\n(function () {\n this.dragWait = function () {\n var interval = Date.now() - this.mousedownEvent.time;\n if (interval > this.editor.getDragDelay())\n this.startDrag();\n };\n this.dragWaitEnd = function () {\n var target = this.editor.container;\n target.draggable = false;\n this.startSelect(this.mousedownEvent.getDocumentPosition());\n this.selectEnd();\n };\n this.dragReadyEnd = function (e) {\n this.editor.$resetCursorStyle();\n this.editor.unsetStyle(\"ace_dragging\");\n this.editor.renderer.setCursorStyle(\"\");\n this.dragWaitEnd();\n };\n this.startDrag = function () {\n this.cancelDrag = false;\n var editor = this.editor;\n var target = editor.container;\n target.draggable = true;\n editor.renderer.$cursorLayer.setBlinking(false);\n editor.setStyle(\"ace_dragging\");\n var cursorStyle = useragent.isWin ? \"default\" : \"move\";\n editor.renderer.setCursorStyle(cursorStyle);\n this.setState(\"dragReady\");\n };\n this.onMouseDrag = function (e) {\n var target = this.editor.container;\n if (useragent.isIE && this.state == \"dragReady\") {\n var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);\n if (distance > 3)\n target.dragDrop();\n }\n if (this.state === \"dragWait\") {\n var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);\n if (distance > 0) {\n target.draggable = false;\n this.startSelect(this.mousedownEvent.getDocumentPosition());\n }\n }\n };\n this.onMouseDown = function (e) {\n if (!this.$dragEnabled)\n return;\n this.mousedownEvent = e;\n var editor = this.editor;\n var inSelection = e.inSelection();\n var button = e.getButton();\n var clickCount = e.domEvent.detail || 1;\n if (clickCount === 1 && button === 0 && inSelection) {\n if (e.editor.inMultiSelectMode && (e.getAccelKey() || e.getShiftKey()))\n return;\n this.mousedownEvent.time = Date.now();\n var eventTarget = e.domEvent.target || e.domEvent.srcElement;\n if (\"unselectable\" in eventTarget)\n eventTarget.unselectable = \"on\";\n if (editor.getDragDelay()) {\n if (useragent.isWebKit) {\n this.cancelDrag = true;\n var mouseTarget = editor.container;\n mouseTarget.draggable = true;\n }\n this.setState(\"dragWait\");\n }\n else {\n this.startDrag();\n }\n this.captureMouse(e, this.onMouseDrag.bind(this));\n e.defaultPrevented = true;\n }\n };\n}).call(DragdropHandler.prototype);\nfunction calcDistance(ax, ay, bx, by) {\n return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2));\n}\nexports.DragdropHandler = DragdropHandler;\n\n});\n\nace.define(\"ace/mouse/touch_handler\",[\"require\",\"exports\",\"module\",\"ace/mouse/mouse_event\",\"ace/lib/event\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar MouseEvent = require(\"./mouse_event\").MouseEvent;\nvar event = require(\"../lib/event\");\nvar dom = require(\"../lib/dom\");\nexports.addTouchListeners = function (el, editor) {\n var mode = \"scroll\";\n var startX;\n var startY;\n var touchStartT;\n var lastT;\n var longTouchTimer;\n var animationTimer;\n var animationSteps = 0;\n var pos;\n var clickCount = 0;\n var vX = 0;\n var vY = 0;\n var pressed;\n var contextMenu;\n function createContextMenu() {\n var clipboard = window.navigator && window.navigator.clipboard;\n var isOpen = false;\n var updateMenu = function () {\n var selected = editor.getCopyText();\n var hasUndo = editor.session.getUndoManager().hasUndo();\n contextMenu.replaceChild(dom.buildDom(isOpen ? [\"span\",\n !selected && [\"span\", { class: \"ace_mobile-button\", action: \"selectall\" }, \"Select All\"],\n selected && [\"span\", { class: \"ace_mobile-button\", action: \"copy\" }, \"Copy\"],\n selected && [\"span\", { class: \"ace_mobile-button\", action: \"cut\" }, \"Cut\"],\n clipboard && [\"span\", { class: \"ace_mobile-button\", action: \"paste\" }, \"Paste\"],\n hasUndo && [\"span\", { class: \"ace_mobile-button\", action: \"undo\" }, \"Undo\"],\n [\"span\", { class: \"ace_mobile-button\", action: \"find\" }, \"Find\"],\n [\"span\", { class: \"ace_mobile-button\", action: \"openCommandPallete\" }, \"Palette\"]\n ] : [\"span\"]), contextMenu.firstChild);\n };\n var handleClick = function (e) {\n var action = e.target.getAttribute(\"action\");\n if (action == \"more\" || !isOpen) {\n isOpen = !isOpen;\n return updateMenu();\n }\n if (action == \"paste\") {\n clipboard.readText().then(function (text) {\n editor.execCommand(action, text);\n });\n }\n else if (action) {\n if (action == \"cut\" || action == \"copy\") {\n if (clipboard)\n clipboard.writeText(editor.getCopyText());\n else\n document.execCommand(\"copy\");\n }\n editor.execCommand(action);\n }\n contextMenu.firstChild.style.display = \"none\";\n isOpen = false;\n if (action != \"openCommandPallete\")\n editor.focus();\n };\n contextMenu = dom.buildDom([\"div\",\n {\n class: \"ace_mobile-menu\",\n ontouchstart: function (e) {\n mode = \"menu\";\n e.stopPropagation();\n e.preventDefault();\n editor.textInput.focus();\n },\n ontouchend: function (e) {\n e.stopPropagation();\n e.preventDefault();\n handleClick(e);\n },\n onclick: handleClick\n },\n [\"span\"],\n [\"span\", { class: \"ace_mobile-button\", action: \"more\" }, \"...\"]\n ], editor.container);\n }\n function showContextMenu() {\n if (!contextMenu)\n createContextMenu();\n var cursor = editor.selection.cursor;\n var pagePos = editor.renderer.textToScreenCoordinates(cursor.row, cursor.column);\n var leftOffset = editor.renderer.textToScreenCoordinates(0, 0).pageX;\n var scrollLeft = editor.renderer.scrollLeft;\n var rect = editor.container.getBoundingClientRect();\n contextMenu.style.top = pagePos.pageY - rect.top - 3 + \"px\";\n if (pagePos.pageX - rect.left < rect.width - 70) {\n contextMenu.style.left = \"\";\n contextMenu.style.right = \"10px\";\n }\n else {\n contextMenu.style.right = \"\";\n contextMenu.style.left = leftOffset + scrollLeft - rect.left + \"px\";\n }\n contextMenu.style.display = \"\";\n contextMenu.firstChild.style.display = \"none\";\n editor.on(\"input\", hideContextMenu);\n }\n function hideContextMenu(e) {\n if (contextMenu)\n contextMenu.style.display = \"none\";\n editor.off(\"input\", hideContextMenu);\n }\n function handleLongTap() {\n longTouchTimer = null;\n clearTimeout(longTouchTimer);\n var range = editor.selection.getRange();\n var inSelection = range.contains(pos.row, pos.column);\n if (range.isEmpty() || !inSelection) {\n editor.selection.moveToPosition(pos);\n editor.selection.selectWord();\n }\n mode = \"wait\";\n showContextMenu();\n }\n function switchToSelectionMode() {\n longTouchTimer = null;\n clearTimeout(longTouchTimer);\n editor.selection.moveToPosition(pos);\n var range = clickCount >= 2\n ? editor.selection.getLineRange(pos.row)\n : editor.session.getBracketRange(pos);\n if (range && !range.isEmpty()) {\n editor.selection.setRange(range);\n }\n else {\n editor.selection.selectWord();\n }\n mode = \"wait\";\n }\n event.addListener(el, \"contextmenu\", function (e) {\n if (!pressed)\n return;\n var textarea = editor.textInput.getElement();\n textarea.focus();\n }, editor);\n event.addListener(el, \"touchstart\", function (e) {\n var touches = e.touches;\n if (longTouchTimer || touches.length > 1) {\n clearTimeout(longTouchTimer);\n longTouchTimer = null;\n touchStartT = -1;\n mode = \"zoom\";\n return;\n }\n pressed = editor.$mouseHandler.isMousePressed = true;\n var h = editor.renderer.layerConfig.lineHeight;\n var w = editor.renderer.layerConfig.lineHeight;\n var t = e.timeStamp;\n lastT = t;\n var touchObj = touches[0];\n var x = touchObj.clientX;\n var y = touchObj.clientY;\n if (Math.abs(startX - x) + Math.abs(startY - y) > h)\n touchStartT = -1;\n startX = e.clientX = x;\n startY = e.clientY = y;\n vX = vY = 0;\n var ev = new MouseEvent(e, editor);\n pos = ev.getDocumentPosition();\n if (t - touchStartT < 500 && touches.length == 1 && !animationSteps) {\n clickCount++;\n e.preventDefault();\n e.button = 0;\n switchToSelectionMode();\n }\n else {\n clickCount = 0;\n var cursor = editor.selection.cursor;\n var anchor = editor.selection.isEmpty() ? cursor : editor.selection.anchor;\n var cursorPos = editor.renderer.$cursorLayer.getPixelPosition(cursor, true);\n var anchorPos = editor.renderer.$cursorLayer.getPixelPosition(anchor, true);\n var rect = editor.renderer.scroller.getBoundingClientRect();\n var offsetTop = editor.renderer.layerConfig.offset;\n var offsetLeft = editor.renderer.scrollLeft;\n var weightedDistance = function (x, y) {\n x = x / w;\n y = y / h - 0.75;\n return x * x + y * y;\n };\n if (e.clientX < rect.left) {\n mode = \"zoom\";\n return;\n }\n var diff1 = weightedDistance(e.clientX - rect.left - cursorPos.left + offsetLeft, e.clientY - rect.top - cursorPos.top + offsetTop);\n var diff2 = weightedDistance(e.clientX - rect.left - anchorPos.left + offsetLeft, e.clientY - rect.top - anchorPos.top + offsetTop);\n if (diff1 < 3.5 && diff2 < 3.5)\n mode = diff1 > diff2 ? \"cursor\" : \"anchor\";\n if (diff2 < 3.5)\n mode = \"anchor\";\n else if (diff1 < 3.5)\n mode = \"cursor\";\n else\n mode = \"scroll\";\n longTouchTimer = setTimeout(handleLongTap, 450);\n }\n touchStartT = t;\n }, editor);\n event.addListener(el, \"touchend\", function (e) {\n pressed = editor.$mouseHandler.isMousePressed = false;\n if (animationTimer)\n clearInterval(animationTimer);\n if (mode == \"zoom\") {\n mode = \"\";\n animationSteps = 0;\n }\n else if (longTouchTimer) {\n editor.selection.moveToPosition(pos);\n animationSteps = 0;\n showContextMenu();\n }\n else if (mode == \"scroll\") {\n animate();\n hideContextMenu();\n }\n else {\n showContextMenu();\n }\n clearTimeout(longTouchTimer);\n longTouchTimer = null;\n }, editor);\n event.addListener(el, \"touchmove\", function (e) {\n if (longTouchTimer) {\n clearTimeout(longTouchTimer);\n longTouchTimer = null;\n }\n var touches = e.touches;\n if (touches.length > 1 || mode == \"zoom\")\n return;\n var touchObj = touches[0];\n var wheelX = startX - touchObj.clientX;\n var wheelY = startY - touchObj.clientY;\n if (mode == \"wait\") {\n if (wheelX * wheelX + wheelY * wheelY > 4)\n mode = \"cursor\";\n else\n return e.preventDefault();\n }\n startX = touchObj.clientX;\n startY = touchObj.clientY;\n e.clientX = touchObj.clientX;\n e.clientY = touchObj.clientY;\n var t = e.timeStamp;\n var dt = t - lastT;\n lastT = t;\n if (mode == \"scroll\") {\n var mouseEvent = new MouseEvent(e, editor);\n mouseEvent.speed = 1;\n mouseEvent.wheelX = wheelX;\n mouseEvent.wheelY = wheelY;\n if (10 * Math.abs(wheelX) < Math.abs(wheelY))\n wheelX = 0;\n if (10 * Math.abs(wheelY) < Math.abs(wheelX))\n wheelY = 0;\n if (dt != 0) {\n vX = wheelX / dt;\n vY = wheelY / dt;\n }\n editor._emit(\"mousewheel\", mouseEvent);\n if (!mouseEvent.propagationStopped) {\n vX = vY = 0;\n }\n }\n else {\n var ev = new MouseEvent(e, editor);\n var pos = ev.getDocumentPosition();\n if (mode == \"cursor\")\n editor.selection.moveCursorToPosition(pos);\n else if (mode == \"anchor\")\n editor.selection.setSelectionAnchor(pos.row, pos.column);\n editor.renderer.scrollCursorIntoView(pos);\n e.preventDefault();\n }\n }, editor);\n function animate() {\n animationSteps += 60;\n animationTimer = setInterval(function () {\n if (animationSteps-- <= 0) {\n clearInterval(animationTimer);\n animationTimer = null;\n }\n if (Math.abs(vX) < 0.01)\n vX = 0;\n if (Math.abs(vY) < 0.01)\n vY = 0;\n if (animationSteps < 20)\n vX = 0.9 * vX;\n if (animationSteps < 20)\n vY = 0.9 * vY;\n var oldScrollTop = editor.session.getScrollTop();\n editor.renderer.scrollBy(10 * vX, 10 * vY);\n if (oldScrollTop == editor.session.getScrollTop())\n animationSteps = 0;\n }, 10);\n }\n};\n\n});\n\nace.define(\"ace/mouse/mouse_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/event\",\"ace/lib/useragent\",\"ace/mouse/default_handlers\",\"ace/mouse/default_gutter_handler\",\"ace/mouse/mouse_event\",\"ace/mouse/dragdrop_handler\",\"ace/mouse/touch_handler\",\"ace/config\"], function(require, exports, module){\"use strict\";\nvar event = require(\"../lib/event\");\nvar useragent = require(\"../lib/useragent\");\nvar DefaultHandlers = require(\"./default_handlers\").DefaultHandlers;\nvar DefaultGutterHandler = require(\"./default_gutter_handler\").GutterHandler;\nvar MouseEvent = require(\"./mouse_event\").MouseEvent;\nvar DragdropHandler = require(\"./dragdrop_handler\").DragdropHandler;\nvar addTouchListeners = require(\"./touch_handler\").addTouchListeners;\nvar config = require(\"../config\");\nvar MouseHandler = function (editor) {\n var _self = this;\n this.editor = editor;\n new DefaultHandlers(this);\n new DefaultGutterHandler(this);\n new DragdropHandler(this);\n var focusEditor = function (e) {\n var windowBlurred = !document.hasFocus || !document.hasFocus()\n || !editor.isFocused() && document.activeElement == (editor.textInput && editor.textInput.getElement());\n if (windowBlurred)\n window.focus();\n editor.focus();\n setTimeout(function () {\n if (!editor.isFocused())\n editor.focus();\n });\n };\n var mouseTarget = editor.renderer.getMouseEventTarget();\n event.addListener(mouseTarget, \"click\", this.onMouseEvent.bind(this, \"click\"), editor);\n event.addListener(mouseTarget, \"mousemove\", this.onMouseMove.bind(this, \"mousemove\"), editor);\n event.addMultiMouseDownListener([\n mouseTarget,\n editor.renderer.scrollBarV && editor.renderer.scrollBarV.inner,\n editor.renderer.scrollBarH && editor.renderer.scrollBarH.inner,\n editor.textInput && editor.textInput.getElement()\n ].filter(Boolean), [400, 300, 250], this, \"onMouseEvent\", editor);\n event.addMouseWheelListener(editor.container, this.onMouseWheel.bind(this, \"mousewheel\"), editor);\n addTouchListeners(editor.container, editor);\n var gutterEl = editor.renderer.$gutter;\n event.addListener(gutterEl, \"mousedown\", this.onMouseEvent.bind(this, \"guttermousedown\"), editor);\n event.addListener(gutterEl, \"click\", this.onMouseEvent.bind(this, \"gutterclick\"), editor);\n event.addListener(gutterEl, \"dblclick\", this.onMouseEvent.bind(this, \"gutterdblclick\"), editor);\n event.addListener(gutterEl, \"mousemove\", this.onMouseEvent.bind(this, \"guttermousemove\"), editor);\n event.addListener(mouseTarget, \"mousedown\", focusEditor, editor);\n event.addListener(gutterEl, \"mousedown\", focusEditor, editor);\n if (useragent.isIE && editor.renderer.scrollBarV) {\n event.addListener(editor.renderer.scrollBarV.element, \"mousedown\", focusEditor, editor);\n event.addListener(editor.renderer.scrollBarH.element, \"mousedown\", focusEditor, editor);\n }\n editor.on(\"mousemove\", function (e) {\n if (_self.state || _self.$dragDelay || !_self.$dragEnabled)\n return;\n var character = editor.renderer.screenToTextCoordinates(e.x, e.y);\n var range = editor.session.selection.getRange();\n var renderer = editor.renderer;\n if (!range.isEmpty() && range.insideStart(character.row, character.column)) {\n renderer.setCursorStyle(\"default\");\n }\n else {\n renderer.setCursorStyle(\"\");\n }\n }, editor);\n};\n(function () {\n this.onMouseEvent = function (name, e) {\n if (!this.editor.session)\n return;\n this.editor._emit(name, new MouseEvent(e, this.editor));\n };\n this.onMouseMove = function (name, e) {\n var listeners = this.editor._eventRegistry && this.editor._eventRegistry.mousemove;\n if (!listeners || !listeners.length)\n return;\n this.editor._emit(name, new MouseEvent(e, this.editor));\n };\n this.onMouseWheel = function (name, e) {\n var mouseEvent = new MouseEvent(e, this.editor);\n mouseEvent.speed = this.$scrollSpeed * 2;\n mouseEvent.wheelX = e.wheelX;\n mouseEvent.wheelY = e.wheelY;\n this.editor._emit(name, mouseEvent);\n };\n this.setState = function (state) {\n this.state = state;\n };\n this.captureMouse = function (ev, mouseMoveHandler) {\n this.x = ev.x;\n this.y = ev.y;\n this.isMousePressed = true;\n var editor = this.editor;\n var renderer = this.editor.renderer;\n renderer.$isMousePressed = true;\n var self = this;\n var onMouseMove = function (e) {\n if (!e)\n return;\n if (useragent.isWebKit && !e.which && self.releaseMouse)\n return self.releaseMouse();\n self.x = e.clientX;\n self.y = e.clientY;\n mouseMoveHandler && mouseMoveHandler(e);\n self.mouseEvent = new MouseEvent(e, self.editor);\n self.$mouseMoved = true;\n };\n var onCaptureEnd = function (e) {\n editor.off(\"beforeEndOperation\", onOperationEnd);\n clearInterval(timerId);\n if (editor.session)\n onCaptureInterval();\n self[self.state + \"End\"] && self[self.state + \"End\"](e);\n self.state = \"\";\n self.isMousePressed = renderer.$isMousePressed = false;\n if (renderer.$keepTextAreaAtCursor)\n renderer.$moveTextAreaToCursor();\n self.$onCaptureMouseMove = self.releaseMouse = null;\n e && self.onMouseEvent(\"mouseup\", e);\n editor.endOperation();\n };\n var onCaptureInterval = function () {\n self[self.state] && self[self.state]();\n self.$mouseMoved = false;\n };\n if (useragent.isOldIE && ev.domEvent.type == \"dblclick\") {\n return setTimeout(function () { onCaptureEnd(ev); });\n }\n var onOperationEnd = function (e) {\n if (!self.releaseMouse)\n return;\n if (editor.curOp.command.name && editor.curOp.selectionChanged) {\n self[self.state + \"End\"] && self[self.state + \"End\"]();\n self.state = \"\";\n self.releaseMouse();\n }\n };\n editor.on(\"beforeEndOperation\", onOperationEnd);\n editor.startOperation({ command: { name: \"mouse\" } });\n self.$onCaptureMouseMove = onMouseMove;\n self.releaseMouse = event.capture(this.editor.container, onMouseMove, onCaptureEnd);\n var timerId = setInterval(onCaptureInterval, 20);\n };\n this.releaseMouse = null;\n this.cancelContextMenu = function () {\n var stop = function (e) {\n if (e && e.domEvent && e.domEvent.type != \"contextmenu\")\n return;\n this.editor.off(\"nativecontextmenu\", stop);\n if (e && e.domEvent)\n event.stopEvent(e.domEvent);\n }.bind(this);\n setTimeout(stop, 10);\n this.editor.on(\"nativecontextmenu\", stop);\n };\n this.destroy = function () {\n if (this.releaseMouse)\n this.releaseMouse();\n };\n}).call(MouseHandler.prototype);\nconfig.defineOptions(MouseHandler.prototype, \"mouseHandler\", {\n scrollSpeed: { initialValue: 2 },\n dragDelay: { initialValue: (useragent.isMac ? 150 : 0) },\n dragEnabled: { initialValue: true },\n focusTimeout: { initialValue: 0 },\n tooltipFollowsMouse: { initialValue: true }\n});\nexports.MouseHandler = MouseHandler;\n\n});\n\nace.define(\"ace/mouse/fold_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nfunction FoldHandler(editor) {\n editor.on(\"click\", function (e) {\n var position = e.getDocumentPosition();\n var session = editor.session;\n var fold = session.getFoldAt(position.row, position.column, 1);\n if (fold) {\n if (e.getAccelKey())\n session.removeFold(fold);\n else\n session.expandFold(fold);\n e.stop();\n }\n var target = e.domEvent && e.domEvent.target;\n if (target && dom.hasCssClass(target, \"ace_inline_button\")) {\n if (dom.hasCssClass(target, \"ace_toggle_wrap\")) {\n session.setOption(\"wrap\", !session.getUseWrapMode());\n editor.renderer.scrollCursorIntoView();\n }\n }\n });\n editor.on(\"gutterclick\", function (e) {\n var gutterRegion = editor.renderer.$gutterLayer.getRegion(e);\n if (gutterRegion == \"foldWidgets\") {\n var row = e.getDocumentPosition().row;\n var session = editor.session;\n if (session.foldWidgets && session.foldWidgets[row])\n editor.session.onFoldWidgetClick(row, e);\n if (!editor.isFocused())\n editor.focus();\n e.stop();\n }\n });\n editor.on(\"gutterdblclick\", function (e) {\n var gutterRegion = editor.renderer.$gutterLayer.getRegion(e);\n if (gutterRegion == \"foldWidgets\") {\n var row = e.getDocumentPosition().row;\n var session = editor.session;\n var data = session.getParentFoldRangeData(row, true);\n var range = data.range || data.firstRange;\n if (range) {\n row = range.start.row;\n var fold = session.getFoldAt(row, session.getLine(row).length, 1);\n if (fold) {\n session.removeFold(fold);\n }\n else {\n session.addFold(\"...\", range);\n editor.renderer.scrollCursorIntoView({ row: range.start.row, column: 0 });\n }\n }\n e.stop();\n }\n });\n}\nexports.FoldHandler = FoldHandler;\n\n});\n\nace.define(\"ace/keyboard/keybinding\",[\"require\",\"exports\",\"module\",\"ace/lib/keys\",\"ace/lib/event\"], function(require, exports, module){\"use strict\";\nvar keyUtil = require(\"../lib/keys\");\nvar event = require(\"../lib/event\");\nvar KeyBinding = function (editor) {\n this.$editor = editor;\n this.$data = { editor: editor };\n this.$handlers = [];\n this.setDefaultHandler(editor.commands);\n};\n(function () {\n this.setDefaultHandler = function (kb) {\n this.removeKeyboardHandler(this.$defaultHandler);\n this.$defaultHandler = kb;\n this.addKeyboardHandler(kb, 0);\n };\n this.setKeyboardHandler = function (kb) {\n var h = this.$handlers;\n if (h[h.length - 1] == kb)\n return;\n while (h[h.length - 1] && h[h.length - 1] != this.$defaultHandler)\n this.removeKeyboardHandler(h[h.length - 1]);\n this.addKeyboardHandler(kb, 1);\n };\n this.addKeyboardHandler = function (kb, pos) {\n if (!kb)\n return;\n if (typeof kb == \"function\" && !kb.handleKeyboard)\n kb.handleKeyboard = kb;\n var i = this.$handlers.indexOf(kb);\n if (i != -1)\n this.$handlers.splice(i, 1);\n if (pos == undefined)\n this.$handlers.push(kb);\n else\n this.$handlers.splice(pos, 0, kb);\n if (i == -1 && kb.attach)\n kb.attach(this.$editor);\n };\n this.removeKeyboardHandler = function (kb) {\n var i = this.$handlers.indexOf(kb);\n if (i == -1)\n return false;\n this.$handlers.splice(i, 1);\n kb.detach && kb.detach(this.$editor);\n return true;\n };\n this.getKeyboardHandler = function () {\n return this.$handlers[this.$handlers.length - 1];\n };\n this.getStatusText = function () {\n var data = this.$data;\n var editor = data.editor;\n return this.$handlers.map(function (h) {\n return h.getStatusText && h.getStatusText(editor, data) || \"\";\n }).filter(Boolean).join(\" \");\n };\n this.$callKeyboardHandlers = function (hashId, keyString, keyCode, e) {\n var toExecute;\n var success = false;\n var commands = this.$editor.commands;\n for (var i = this.$handlers.length; i--;) {\n toExecute = this.$handlers[i].handleKeyboard(this.$data, hashId, keyString, keyCode, e);\n if (!toExecute || !toExecute.command)\n continue;\n if (toExecute.command == \"null\") {\n success = true;\n }\n else {\n success = commands.exec(toExecute.command, this.$editor, toExecute.args, e);\n }\n if (success && e && hashId != -1 &&\n toExecute.passEvent != true && toExecute.command.passEvent != true) {\n event.stopEvent(e);\n }\n if (success)\n break;\n }\n if (!success && hashId == -1) {\n toExecute = { command: \"insertstring\" };\n success = commands.exec(\"insertstring\", this.$editor, keyString);\n }\n if (success && this.$editor._signal)\n this.$editor._signal(\"keyboardActivity\", toExecute);\n return success;\n };\n this.onCommandKey = function (e, hashId, keyCode) {\n var keyString = keyUtil.keyCodeToString(keyCode);\n return this.$callKeyboardHandlers(hashId, keyString, keyCode, e);\n };\n this.onTextInput = function (text) {\n return this.$callKeyboardHandlers(-1, text);\n };\n}).call(KeyBinding.prototype);\nexports.KeyBinding = KeyBinding;\n\n});\n\nace.define(\"ace/lib/bidiutil\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nvar ArabicAlefBetIntervalsBegine = ['\\u0621', '\\u0641'];\nvar ArabicAlefBetIntervalsEnd = ['\\u063A', '\\u064a'];\nvar dir = 0, hiLevel = 0;\nvar lastArabic = false, hasUBAT_AL = false, hasUBAT_B = false, hasUBAT_S = false, hasBlockSep = false, hasSegSep = false;\nvar impTab_LTR = [ [0, 3, 0, 1, 0, 0, 0], [0, 3, 0, 1, 2, 2, 0], [0, 3, 0, 0x11, 2, 0, 1], [0, 3, 5, 5, 4, 1, 0], [0, 3, 0x15, 0x15, 4, 0, 1], [0, 3, 5, 5, 4, 2, 0]\n];\nvar impTab_RTL = [ [2, 0, 1, 1, 0, 1, 0], [2, 0, 1, 1, 0, 2, 0], [2, 0, 2, 1, 3, 2, 0], [2, 0, 2, 0x21, 3, 1, 1]\n];\nvar LTR = 0, RTL = 1;\nvar L = 0;\nvar R = 1;\nvar EN = 2;\nvar AN = 3;\nvar ON = 4;\nvar B = 5;\nvar S = 6;\nvar AL = 7;\nvar WS = 8;\nvar CS = 9;\nvar ES = 10;\nvar ET = 11;\nvar NSM = 12;\nvar LRE = 13;\nvar RLE = 14;\nvar PDF = 15;\nvar LRO = 16;\nvar RLO = 17;\nvar BN = 18;\nvar UnicodeTBL00 = [\n BN, BN, BN, BN, BN, BN, BN, BN, BN, S, B, S, WS, B, BN, BN,\n BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, B, B, B, S,\n WS, ON, ON, ET, ET, ET, ON, ON, ON, ON, ON, ES, CS, ES, CS, CS,\n EN, EN, EN, EN, EN, EN, EN, EN, EN, EN, CS, ON, ON, ON, ON, ON,\n ON, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L,\n L, L, L, L, L, L, L, L, L, L, L, ON, ON, ON, ON, ON,\n ON, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L,\n L, L, L, L, L, L, L, L, L, L, L, ON, ON, ON, ON, BN,\n BN, BN, BN, BN, BN, B, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN,\n BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN,\n CS, ON, ET, ET, ET, ET, ON, ON, ON, ON, L, ON, ON, BN, ON, ON,\n ET, ET, EN, EN, ON, L, ON, ON, ON, EN, L, ON, ON, ON, ON, ON\n];\nvar UnicodeTBL20 = [\n WS, WS, WS, WS, WS, WS, WS, WS, WS, WS, WS, BN, BN, BN, L, R,\n ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON,\n ON, ON, ON, ON, ON, ON, ON, ON, WS, B, LRE, RLE, PDF, LRO, RLO, CS,\n ET, ET, ET, ET, ET, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON,\n ON, ON, ON, ON, CS, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON,\n ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, WS\n];\nfunction _computeLevels(chars, levels, len, charTypes) {\n var impTab = dir ? impTab_RTL : impTab_LTR, prevState = null, newClass = null, newLevel = null, newState = 0, action = null, cond = null, condPos = -1, i = null, ix = null, classes = [];\n if (!charTypes) {\n for (i = 0, charTypes = []; i < len; i++) {\n charTypes[i] = _getCharacterType(chars[i]);\n }\n }\n hiLevel = dir;\n lastArabic = false;\n hasUBAT_AL = false;\n hasUBAT_B = false;\n hasUBAT_S = false;\n for (ix = 0; ix < len; ix++) {\n prevState = newState;\n classes[ix] = newClass = _getCharClass(chars, charTypes, classes, ix);\n newState = impTab[prevState][newClass];\n action = newState & 0xF0;\n newState &= 0x0F;\n levels[ix] = newLevel = impTab[newState][5];\n if (action > 0) {\n if (action == 0x10) {\n for (i = condPos; i < ix; i++) {\n levels[i] = 1;\n }\n condPos = -1;\n }\n else {\n condPos = -1;\n }\n }\n cond = impTab[newState][6];\n if (cond) {\n if (condPos == -1) {\n condPos = ix;\n }\n }\n else {\n if (condPos > -1) {\n for (i = condPos; i < ix; i++) {\n levels[i] = newLevel;\n }\n condPos = -1;\n }\n }\n if (charTypes[ix] == B) {\n levels[ix] = 0;\n }\n hiLevel |= newLevel;\n }\n if (hasUBAT_S) {\n for (i = 0; i < len; i++) {\n if (charTypes[i] == S) {\n levels[i] = dir;\n for (var j = i - 1; j >= 0; j--) {\n if (charTypes[j] == WS) {\n levels[j] = dir;\n }\n else {\n break;\n }\n }\n }\n }\n }\n}\nfunction _invertLevel(lev, levels, _array) {\n if (hiLevel < lev) {\n return;\n }\n if (lev == 1 && dir == RTL && !hasUBAT_B) {\n _array.reverse();\n return;\n }\n var len = _array.length, start = 0, end, lo, hi, tmp;\n while (start < len) {\n if (levels[start] >= lev) {\n end = start + 1;\n while (end < len && levels[end] >= lev) {\n end++;\n }\n for (lo = start, hi = end - 1; lo < hi; lo++, hi--) {\n tmp = _array[lo];\n _array[lo] = _array[hi];\n _array[hi] = tmp;\n }\n start = end;\n }\n start++;\n }\n}\nfunction _getCharClass(chars, types, classes, ix) {\n var cType = types[ix], wType, nType, len, i;\n switch (cType) {\n case L:\n case R:\n lastArabic = false;\n case ON:\n case AN:\n return cType;\n case EN:\n return lastArabic ? AN : EN;\n case AL:\n lastArabic = true;\n hasUBAT_AL = true;\n return R;\n case WS:\n return ON;\n case CS:\n if (ix < 1 || (ix + 1) >= types.length ||\n ((wType = classes[ix - 1]) != EN && wType != AN) ||\n ((nType = types[ix + 1]) != EN && nType != AN)) {\n return ON;\n }\n if (lastArabic) {\n nType = AN;\n }\n return nType == wType ? nType : ON;\n case ES:\n wType = ix > 0 ? classes[ix - 1] : B;\n if (wType == EN && (ix + 1) < types.length && types[ix + 1] == EN) {\n return EN;\n }\n return ON;\n case ET:\n if (ix > 0 && classes[ix - 1] == EN) {\n return EN;\n }\n if (lastArabic) {\n return ON;\n }\n i = ix + 1;\n len = types.length;\n while (i < len && types[i] == ET) {\n i++;\n }\n if (i < len && types[i] == EN) {\n return EN;\n }\n return ON;\n case NSM:\n len = types.length;\n i = ix + 1;\n while (i < len && types[i] == NSM) {\n i++;\n }\n if (i < len) {\n var c = chars[ix], rtlCandidate = (c >= 0x0591 && c <= 0x08FF) || c == 0xFB1E;\n wType = types[i];\n if (rtlCandidate && (wType == R || wType == AL)) {\n return R;\n }\n }\n if (ix < 1 || (wType = types[ix - 1]) == B) {\n return ON;\n }\n return classes[ix - 1];\n case B:\n lastArabic = false;\n hasUBAT_B = true;\n return dir;\n case S:\n hasUBAT_S = true;\n return ON;\n case LRE:\n case RLE:\n case LRO:\n case RLO:\n case PDF:\n lastArabic = false;\n case BN:\n return ON;\n }\n}\nfunction _getCharacterType(ch) {\n var uc = ch.charCodeAt(0), hi = uc >> 8;\n if (hi == 0) {\n return ((uc > 0x00BF) ? L : UnicodeTBL00[uc]);\n }\n else if (hi == 5) {\n return (/[\\u0591-\\u05f4]/.test(ch) ? R : L);\n }\n else if (hi == 6) {\n if (/[\\u0610-\\u061a\\u064b-\\u065f\\u06d6-\\u06e4\\u06e7-\\u06ed]/.test(ch))\n return NSM;\n else if (/[\\u0660-\\u0669\\u066b-\\u066c]/.test(ch))\n return AN;\n else if (uc == 0x066A)\n return ET;\n else if (/[\\u06f0-\\u06f9]/.test(ch))\n return EN;\n else\n return AL;\n }\n else if (hi == 0x20 && uc <= 0x205F) {\n return UnicodeTBL20[uc & 0xFF];\n }\n else if (hi == 0xFE) {\n return (uc >= 0xFE70 ? AL : ON);\n }\n return ON;\n}\nfunction _isArabicDiacritics(ch) {\n return (ch >= '\\u064b' && ch <= '\\u0655');\n}\nexports.L = L;\nexports.R = R;\nexports.EN = EN;\nexports.ON_R = 3;\nexports.AN = 4;\nexports.R_H = 5;\nexports.B = 6;\nexports.RLE = 7;\nexports.DOT = \"\\xB7\";\nexports.doBidiReorder = function (text, textCharTypes, isRtl) {\n if (text.length < 2)\n return {};\n var chars = text.split(\"\"), logicalFromVisual = new Array(chars.length), bidiLevels = new Array(chars.length), levels = [];\n dir = isRtl ? RTL : LTR;\n _computeLevels(chars, levels, chars.length, textCharTypes);\n for (var i = 0; i < logicalFromVisual.length; logicalFromVisual[i] = i, i++)\n ;\n _invertLevel(2, levels, logicalFromVisual);\n _invertLevel(1, levels, logicalFromVisual);\n for (var i = 0; i < logicalFromVisual.length - 1; i++) { //fix levels to reflect character width\n if (textCharTypes[i] === AN) {\n levels[i] = exports.AN;\n }\n else if (levels[i] === R && ((textCharTypes[i] > AL && textCharTypes[i] < LRE)\n || textCharTypes[i] === ON || textCharTypes[i] === BN)) {\n levels[i] = exports.ON_R;\n }\n else if ((i > 0 && chars[i - 1] === '\\u0644') && /\\u0622|\\u0623|\\u0625|\\u0627/.test(chars[i])) {\n levels[i - 1] = levels[i] = exports.R_H;\n i++;\n }\n }\n if (chars[chars.length - 1] === exports.DOT)\n levels[chars.length - 1] = exports.B;\n if (chars[0] === '\\u202B')\n levels[0] = exports.RLE;\n for (var i = 0; i < logicalFromVisual.length; i++) {\n bidiLevels[i] = levels[logicalFromVisual[i]];\n }\n return { 'logicalFromVisual': logicalFromVisual, 'bidiLevels': bidiLevels };\n};\nexports.hasBidiCharacters = function (text, textCharTypes) {\n var ret = false;\n for (var i = 0; i < text.length; i++) {\n textCharTypes[i] = _getCharacterType(text.charAt(i));\n if (!ret && (textCharTypes[i] == R || textCharTypes[i] == AL || textCharTypes[i] == AN))\n ret = true;\n }\n return ret;\n};\nexports.getVisualFromLogicalIdx = function (logIdx, rowMap) {\n for (var i = 0; i < rowMap.logicalFromVisual.length; i++) {\n if (rowMap.logicalFromVisual[i] == logIdx)\n return i;\n }\n return 0;\n};\n\n});\n\nace.define(\"ace/bidihandler\",[\"require\",\"exports\",\"module\",\"ace/lib/bidiutil\",\"ace/lib/lang\"], function(require, exports, module){\"use strict\";\nvar bidiUtil = require(\"./lib/bidiutil\");\nvar lang = require(\"./lib/lang\");\nvar bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac\\u202B]/;\nvar BidiHandler = function (session) {\n this.session = session;\n this.bidiMap = {};\n this.currentRow = null;\n this.bidiUtil = bidiUtil;\n this.charWidths = [];\n this.EOL = \"\\xAC\";\n this.showInvisibles = true;\n this.isRtlDir = false;\n this.$isRtl = false;\n this.line = \"\";\n this.wrapIndent = 0;\n this.EOF = \"\\xB6\";\n this.RLE = \"\\u202B\";\n this.contentWidth = 0;\n this.fontMetrics = null;\n this.rtlLineOffset = 0;\n this.wrapOffset = 0;\n this.isMoveLeftOperation = false;\n this.seenBidi = bidiRE.test(session.getValue());\n};\n(function () {\n this.isBidiRow = function (screenRow, docRow, splitIndex) {\n if (!this.seenBidi)\n return false;\n if (screenRow !== this.currentRow) {\n this.currentRow = screenRow;\n this.updateRowLine(docRow, splitIndex);\n this.updateBidiMap();\n }\n return this.bidiMap.bidiLevels;\n };\n this.onChange = function (delta) {\n if (!this.seenBidi) {\n if (delta.action == \"insert\" && bidiRE.test(delta.lines.join(\"\\n\"))) {\n this.seenBidi = true;\n this.currentRow = null;\n }\n }\n else {\n this.currentRow = null;\n }\n };\n this.getDocumentRow = function () {\n var docRow = 0;\n var rowCache = this.session.$screenRowCache;\n if (rowCache.length) {\n var index = this.session.$getRowCacheIndex(rowCache, this.currentRow);\n if (index >= 0)\n docRow = this.session.$docRowCache[index];\n }\n return docRow;\n };\n this.getSplitIndex = function () {\n var splitIndex = 0;\n var rowCache = this.session.$screenRowCache;\n if (rowCache.length) {\n var currentIndex, prevIndex = this.session.$getRowCacheIndex(rowCache, this.currentRow);\n while (this.currentRow - splitIndex > 0) {\n currentIndex = this.session.$getRowCacheIndex(rowCache, this.currentRow - splitIndex - 1);\n if (currentIndex !== prevIndex)\n break;\n prevIndex = currentIndex;\n splitIndex++;\n }\n }\n else {\n splitIndex = this.currentRow;\n }\n return splitIndex;\n };\n this.updateRowLine = function (docRow, splitIndex) {\n if (docRow === undefined)\n docRow = this.getDocumentRow();\n var isLastRow = (docRow === this.session.getLength() - 1), endOfLine = isLastRow ? this.EOF : this.EOL;\n this.wrapIndent = 0;\n this.line = this.session.getLine(docRow);\n this.isRtlDir = this.$isRtl || this.line.charAt(0) === this.RLE;\n if (this.session.$useWrapMode) {\n var splits = this.session.$wrapData[docRow];\n if (splits) {\n if (splitIndex === undefined)\n splitIndex = this.getSplitIndex();\n if (splitIndex > 0 && splits.length) {\n this.wrapIndent = splits.indent;\n this.wrapOffset = this.wrapIndent * this.charWidths[bidiUtil.L];\n this.line = (splitIndex < splits.length) ?\n this.line.substring(splits[splitIndex - 1], splits[splitIndex]) :\n this.line.substring(splits[splits.length - 1]);\n }\n else {\n this.line = this.line.substring(0, splits[splitIndex]);\n }\n if (splitIndex == splits.length) {\n this.line += (this.showInvisibles) ? endOfLine : bidiUtil.DOT;\n }\n }\n }\n else {\n this.line += this.showInvisibles ? endOfLine : bidiUtil.DOT;\n }\n var session = this.session, shift = 0, size;\n this.line = this.line.replace(/\\t|[\\u1100-\\u2029, \\u202F-\\uFFE6]/g, function (ch, i) {\n if (ch === '\\t' || session.isFullWidth(ch.charCodeAt(0))) {\n size = (ch === '\\t') ? session.getScreenTabSize(i + shift) : 2;\n shift += size - 1;\n return lang.stringRepeat(bidiUtil.DOT, size);\n }\n return ch;\n });\n if (this.isRtlDir) {\n this.fontMetrics.$main.textContent = (this.line.charAt(this.line.length - 1) == bidiUtil.DOT) ? this.line.substr(0, this.line.length - 1) : this.line;\n this.rtlLineOffset = this.contentWidth - this.fontMetrics.$main.getBoundingClientRect().width;\n }\n };\n this.updateBidiMap = function () {\n var textCharTypes = [];\n if (bidiUtil.hasBidiCharacters(this.line, textCharTypes) || this.isRtlDir) {\n this.bidiMap = bidiUtil.doBidiReorder(this.line, textCharTypes, this.isRtlDir);\n }\n else {\n this.bidiMap = {};\n }\n };\n this.markAsDirty = function () {\n this.currentRow = null;\n };\n this.updateCharacterWidths = function (fontMetrics) {\n if (this.characterWidth === fontMetrics.$characterSize.width)\n return;\n this.fontMetrics = fontMetrics;\n var characterWidth = this.characterWidth = fontMetrics.$characterSize.width;\n var bidiCharWidth = fontMetrics.$measureCharWidth(\"\\u05d4\");\n this.charWidths[bidiUtil.L] = this.charWidths[bidiUtil.EN] = this.charWidths[bidiUtil.ON_R] = characterWidth;\n this.charWidths[bidiUtil.R] = this.charWidths[bidiUtil.AN] = bidiCharWidth;\n this.charWidths[bidiUtil.R_H] = bidiCharWidth * 0.45;\n this.charWidths[bidiUtil.B] = this.charWidths[bidiUtil.RLE] = 0;\n this.currentRow = null;\n };\n this.setShowInvisibles = function (showInvisibles) {\n this.showInvisibles = showInvisibles;\n this.currentRow = null;\n };\n this.setEolChar = function (eolChar) {\n this.EOL = eolChar;\n };\n this.setContentWidth = function (width) {\n this.contentWidth = width;\n };\n this.isRtlLine = function (row) {\n if (this.$isRtl)\n return true;\n if (row != undefined)\n return (this.session.getLine(row).charAt(0) == this.RLE);\n else\n return this.isRtlDir;\n };\n this.setRtlDirection = function (editor, isRtlDir) {\n var cursor = editor.getCursorPosition();\n for (var row = editor.selection.getSelectionAnchor().row; row <= cursor.row; row++) {\n if (!isRtlDir && editor.session.getLine(row).charAt(0) === editor.session.$bidiHandler.RLE)\n editor.session.doc.removeInLine(row, 0, 1);\n else if (isRtlDir && editor.session.getLine(row).charAt(0) !== editor.session.$bidiHandler.RLE)\n editor.session.doc.insert({ column: 0, row: row }, editor.session.$bidiHandler.RLE);\n }\n };\n this.getPosLeft = function (col) {\n col -= this.wrapIndent;\n var leftBoundary = (this.line.charAt(0) === this.RLE) ? 1 : 0;\n var logicalIdx = (col > leftBoundary) ? (this.session.getOverwrite() ? col : col - 1) : leftBoundary;\n var visualIdx = bidiUtil.getVisualFromLogicalIdx(logicalIdx, this.bidiMap), levels = this.bidiMap.bidiLevels, left = 0;\n if (!this.session.getOverwrite() && col <= leftBoundary && levels[visualIdx] % 2 !== 0)\n visualIdx++;\n for (var i = 0; i < visualIdx; i++) {\n left += this.charWidths[levels[i]];\n }\n if (!this.session.getOverwrite() && (col > leftBoundary) && (levels[visualIdx] % 2 === 0))\n left += this.charWidths[levels[visualIdx]];\n if (this.wrapIndent)\n left += this.isRtlDir ? (-1 * this.wrapOffset) : this.wrapOffset;\n if (this.isRtlDir)\n left += this.rtlLineOffset;\n return left;\n };\n this.getSelections = function (startCol, endCol) {\n var map = this.bidiMap, levels = map.bidiLevels, level, selections = [], offset = 0, selColMin = Math.min(startCol, endCol) - this.wrapIndent, selColMax = Math.max(startCol, endCol) - this.wrapIndent, isSelected = false, isSelectedPrev = false, selectionStart = 0;\n if (this.wrapIndent)\n offset += this.isRtlDir ? (-1 * this.wrapOffset) : this.wrapOffset;\n for (var logIdx, visIdx = 0; visIdx < levels.length; visIdx++) {\n logIdx = map.logicalFromVisual[visIdx];\n level = levels[visIdx];\n isSelected = (logIdx >= selColMin) && (logIdx < selColMax);\n if (isSelected && !isSelectedPrev) {\n selectionStart = offset;\n }\n else if (!isSelected && isSelectedPrev) {\n selections.push({ left: selectionStart, width: offset - selectionStart });\n }\n offset += this.charWidths[level];\n isSelectedPrev = isSelected;\n }\n if (isSelected && (visIdx === levels.length)) {\n selections.push({ left: selectionStart, width: offset - selectionStart });\n }\n if (this.isRtlDir) {\n for (var i = 0; i < selections.length; i++) {\n selections[i].left += this.rtlLineOffset;\n }\n }\n return selections;\n };\n this.offsetToCol = function (posX) {\n if (this.isRtlDir)\n posX -= this.rtlLineOffset;\n var logicalIdx = 0, posX = Math.max(posX, 0), offset = 0, visualIdx = 0, levels = this.bidiMap.bidiLevels, charWidth = this.charWidths[levels[visualIdx]];\n if (this.wrapIndent)\n posX -= this.isRtlDir ? (-1 * this.wrapOffset) : this.wrapOffset;\n while (posX > offset + charWidth / 2) {\n offset += charWidth;\n if (visualIdx === levels.length - 1) {\n charWidth = 0;\n break;\n }\n charWidth = this.charWidths[levels[++visualIdx]];\n }\n if (visualIdx > 0 && (levels[visualIdx - 1] % 2 !== 0) && (levels[visualIdx] % 2 === 0)) {\n if (posX < offset)\n visualIdx--;\n logicalIdx = this.bidiMap.logicalFromVisual[visualIdx];\n }\n else if (visualIdx > 0 && (levels[visualIdx - 1] % 2 === 0) && (levels[visualIdx] % 2 !== 0)) {\n logicalIdx = 1 + ((posX > offset) ? this.bidiMap.logicalFromVisual[visualIdx]\n : this.bidiMap.logicalFromVisual[visualIdx - 1]);\n }\n else if ((this.isRtlDir && visualIdx === levels.length - 1 && charWidth === 0 && (levels[visualIdx - 1] % 2 === 0))\n || (!this.isRtlDir && visualIdx === 0 && (levels[visualIdx] % 2 !== 0))) {\n logicalIdx = 1 + this.bidiMap.logicalFromVisual[visualIdx];\n }\n else {\n if (visualIdx > 0 && (levels[visualIdx - 1] % 2 !== 0) && charWidth !== 0)\n visualIdx--;\n logicalIdx = this.bidiMap.logicalFromVisual[visualIdx];\n }\n if (logicalIdx === 0 && this.isRtlDir)\n logicalIdx++;\n return (logicalIdx + this.wrapIndent);\n };\n}).call(BidiHandler.prototype);\nexports.BidiHandler = BidiHandler;\n\n});\n\nace.define(\"ace/selection\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/lang\",\"ace/lib/event_emitter\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar lang = require(\"./lib/lang\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar Range = require(\"./range\").Range;\nvar Selection = function (session) {\n this.session = session;\n this.doc = session.getDocument();\n this.clearSelection();\n this.cursor = this.lead = this.doc.createAnchor(0, 0);\n this.anchor = this.doc.createAnchor(0, 0);\n this.$silent = false;\n var self = this;\n this.cursor.on(\"change\", function (e) {\n self.$cursorChanged = true;\n if (!self.$silent)\n self._emit(\"changeCursor\");\n if (!self.$isEmpty && !self.$silent)\n self._emit(\"changeSelection\");\n if (!self.$keepDesiredColumnOnChange && e.old.column != e.value.column)\n self.$desiredColumn = null;\n });\n this.anchor.on(\"change\", function () {\n self.$anchorChanged = true;\n if (!self.$isEmpty && !self.$silent)\n self._emit(\"changeSelection\");\n });\n};\n(function () {\n oop.implement(this, EventEmitter);\n this.isEmpty = function () {\n return this.$isEmpty || (this.anchor.row == this.lead.row &&\n this.anchor.column == this.lead.column);\n };\n this.isMultiLine = function () {\n return !this.$isEmpty && this.anchor.row != this.cursor.row;\n };\n this.getCursor = function () {\n return this.lead.getPosition();\n };\n this.setSelectionAnchor = function (row, column) {\n this.$isEmpty = false;\n this.anchor.setPosition(row, column);\n };\n this.getAnchor =\n this.getSelectionAnchor = function () {\n if (this.$isEmpty)\n return this.getSelectionLead();\n return this.anchor.getPosition();\n };\n this.getSelectionLead = function () {\n return this.lead.getPosition();\n };\n this.isBackwards = function () {\n var anchor = this.anchor;\n var lead = this.lead;\n return (anchor.row > lead.row || (anchor.row == lead.row && anchor.column > lead.column));\n };\n this.getRange = function () {\n var anchor = this.anchor;\n var lead = this.lead;\n if (this.$isEmpty)\n return Range.fromPoints(lead, lead);\n return this.isBackwards()\n ? Range.fromPoints(lead, anchor)\n : Range.fromPoints(anchor, lead);\n };\n this.clearSelection = function () {\n if (!this.$isEmpty) {\n this.$isEmpty = true;\n this._emit(\"changeSelection\");\n }\n };\n this.selectAll = function () {\n this.$setSelection(0, 0, Number.MAX_VALUE, Number.MAX_VALUE);\n };\n this.setRange =\n this.setSelectionRange = function (range, reverse) {\n var start = reverse ? range.end : range.start;\n var end = reverse ? range.start : range.end;\n this.$setSelection(start.row, start.column, end.row, end.column);\n };\n this.$setSelection = function (anchorRow, anchorColumn, cursorRow, cursorColumn) {\n if (this.$silent)\n return;\n var wasEmpty = this.$isEmpty;\n var wasMultiselect = this.inMultiSelectMode;\n this.$silent = true;\n this.$cursorChanged = this.$anchorChanged = false;\n this.anchor.setPosition(anchorRow, anchorColumn);\n this.cursor.setPosition(cursorRow, cursorColumn);\n this.$isEmpty = !Range.comparePoints(this.anchor, this.cursor);\n this.$silent = false;\n if (this.$cursorChanged)\n this._emit(\"changeCursor\");\n if (this.$cursorChanged || this.$anchorChanged || wasEmpty != this.$isEmpty || wasMultiselect)\n this._emit(\"changeSelection\");\n };\n this.$moveSelection = function (mover) {\n var lead = this.lead;\n if (this.$isEmpty)\n this.setSelectionAnchor(lead.row, lead.column);\n mover.call(this);\n };\n this.selectTo = function (row, column) {\n this.$moveSelection(function () {\n this.moveCursorTo(row, column);\n });\n };\n this.selectToPosition = function (pos) {\n this.$moveSelection(function () {\n this.moveCursorToPosition(pos);\n });\n };\n this.moveTo = function (row, column) {\n this.clearSelection();\n this.moveCursorTo(row, column);\n };\n this.moveToPosition = function (pos) {\n this.clearSelection();\n this.moveCursorToPosition(pos);\n };\n this.selectUp = function () {\n this.$moveSelection(this.moveCursorUp);\n };\n this.selectDown = function () {\n this.$moveSelection(this.moveCursorDown);\n };\n this.selectRight = function () {\n this.$moveSelection(this.moveCursorRight);\n };\n this.selectLeft = function () {\n this.$moveSelection(this.moveCursorLeft);\n };\n this.selectLineStart = function () {\n this.$moveSelection(this.moveCursorLineStart);\n };\n this.selectLineEnd = function () {\n this.$moveSelection(this.moveCursorLineEnd);\n };\n this.selectFileEnd = function () {\n this.$moveSelection(this.moveCursorFileEnd);\n };\n this.selectFileStart = function () {\n this.$moveSelection(this.moveCursorFileStart);\n };\n this.selectWordRight = function () {\n this.$moveSelection(this.moveCursorWordRight);\n };\n this.selectWordLeft = function () {\n this.$moveSelection(this.moveCursorWordLeft);\n };\n this.getWordRange = function (row, column) {\n if (typeof column == \"undefined\") {\n var cursor = row || this.lead;\n row = cursor.row;\n column = cursor.column;\n }\n return this.session.getWordRange(row, column);\n };\n this.selectWord = function () {\n this.setSelectionRange(this.getWordRange());\n };\n this.selectAWord = function () {\n var cursor = this.getCursor();\n var range = this.session.getAWordRange(cursor.row, cursor.column);\n this.setSelectionRange(range);\n };\n this.getLineRange = function (row, excludeLastChar) {\n var rowStart = typeof row == \"number\" ? row : this.lead.row;\n var rowEnd;\n var foldLine = this.session.getFoldLine(rowStart);\n if (foldLine) {\n rowStart = foldLine.start.row;\n rowEnd = foldLine.end.row;\n }\n else {\n rowEnd = rowStart;\n }\n if (excludeLastChar === true)\n return new Range(rowStart, 0, rowEnd, this.session.getLine(rowEnd).length);\n else\n return new Range(rowStart, 0, rowEnd + 1, 0);\n };\n this.selectLine = function () {\n this.setSelectionRange(this.getLineRange());\n };\n this.moveCursorUp = function () {\n this.moveCursorBy(-1, 0);\n };\n this.moveCursorDown = function () {\n this.moveCursorBy(1, 0);\n };\n this.wouldMoveIntoSoftTab = function (cursor, tabSize, direction) {\n var start = cursor.column;\n var end = cursor.column + tabSize;\n if (direction < 0) {\n start = cursor.column - tabSize;\n end = cursor.column;\n }\n return this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(start, end).split(\" \").length - 1 == tabSize;\n };\n this.moveCursorLeft = function () {\n var cursor = this.lead.getPosition(), fold;\n if (fold = this.session.getFoldAt(cursor.row, cursor.column, -1)) {\n this.moveCursorTo(fold.start.row, fold.start.column);\n }\n else if (cursor.column === 0) {\n if (cursor.row > 0) {\n this.moveCursorTo(cursor.row - 1, this.doc.getLine(cursor.row - 1).length);\n }\n }\n else {\n var tabSize = this.session.getTabSize();\n if (this.wouldMoveIntoSoftTab(cursor, tabSize, -1) && !this.session.getNavigateWithinSoftTabs()) {\n this.moveCursorBy(0, -tabSize);\n }\n else {\n this.moveCursorBy(0, -1);\n }\n }\n };\n this.moveCursorRight = function () {\n var cursor = this.lead.getPosition(), fold;\n if (fold = this.session.getFoldAt(cursor.row, cursor.column, 1)) {\n this.moveCursorTo(fold.end.row, fold.end.column);\n }\n else if (this.lead.column == this.doc.getLine(this.lead.row).length) {\n if (this.lead.row < this.doc.getLength() - 1) {\n this.moveCursorTo(this.lead.row + 1, 0);\n }\n }\n else {\n var tabSize = this.session.getTabSize();\n var cursor = this.lead;\n if (this.wouldMoveIntoSoftTab(cursor, tabSize, 1) && !this.session.getNavigateWithinSoftTabs()) {\n this.moveCursorBy(0, tabSize);\n }\n else {\n this.moveCursorBy(0, 1);\n }\n }\n };\n this.moveCursorLineStart = function () {\n var row = this.lead.row;\n var column = this.lead.column;\n var screenRow = this.session.documentToScreenRow(row, column);\n var firstColumnPosition = this.session.screenToDocumentPosition(screenRow, 0);\n var beforeCursor = this.session.getDisplayLine(row, null, firstColumnPosition.row, firstColumnPosition.column);\n var leadingSpace = beforeCursor.match(/^\\s*/);\n if (leadingSpace[0].length != column && !this.session.$useEmacsStyleLineStart)\n firstColumnPosition.column += leadingSpace[0].length;\n this.moveCursorToPosition(firstColumnPosition);\n };\n this.moveCursorLineEnd = function () {\n var lead = this.lead;\n var lineEnd = this.session.getDocumentLastRowColumnPosition(lead.row, lead.column);\n if (this.lead.column == lineEnd.column) {\n var line = this.session.getLine(lineEnd.row);\n if (lineEnd.column == line.length) {\n var textEnd = line.search(/\\s+$/);\n if (textEnd > 0)\n lineEnd.column = textEnd;\n }\n }\n this.moveCursorTo(lineEnd.row, lineEnd.column);\n };\n this.moveCursorFileEnd = function () {\n var row = this.doc.getLength() - 1;\n var column = this.doc.getLine(row).length;\n this.moveCursorTo(row, column);\n };\n this.moveCursorFileStart = function () {\n this.moveCursorTo(0, 0);\n };\n this.moveCursorLongWordRight = function () {\n var row = this.lead.row;\n var column = this.lead.column;\n var line = this.doc.getLine(row);\n var rightOfCursor = line.substring(column);\n this.session.nonTokenRe.lastIndex = 0;\n this.session.tokenRe.lastIndex = 0;\n var fold = this.session.getFoldAt(row, column, 1);\n if (fold) {\n this.moveCursorTo(fold.end.row, fold.end.column);\n return;\n }\n if (this.session.nonTokenRe.exec(rightOfCursor)) {\n column += this.session.nonTokenRe.lastIndex;\n this.session.nonTokenRe.lastIndex = 0;\n rightOfCursor = line.substring(column);\n }\n if (column >= line.length) {\n this.moveCursorTo(row, line.length);\n this.moveCursorRight();\n if (row < this.doc.getLength() - 1)\n this.moveCursorWordRight();\n return;\n }\n if (this.session.tokenRe.exec(rightOfCursor)) {\n column += this.session.tokenRe.lastIndex;\n this.session.tokenRe.lastIndex = 0;\n }\n this.moveCursorTo(row, column);\n };\n this.moveCursorLongWordLeft = function () {\n var row = this.lead.row;\n var column = this.lead.column;\n var fold;\n if (fold = this.session.getFoldAt(row, column, -1)) {\n this.moveCursorTo(fold.start.row, fold.start.column);\n return;\n }\n var str = this.session.getFoldStringAt(row, column, -1);\n if (str == null) {\n str = this.doc.getLine(row).substring(0, column);\n }\n var leftOfCursor = lang.stringReverse(str);\n this.session.nonTokenRe.lastIndex = 0;\n this.session.tokenRe.lastIndex = 0;\n if (this.session.nonTokenRe.exec(leftOfCursor)) {\n column -= this.session.nonTokenRe.lastIndex;\n leftOfCursor = leftOfCursor.slice(this.session.nonTokenRe.lastIndex);\n this.session.nonTokenRe.lastIndex = 0;\n }\n if (column <= 0) {\n this.moveCursorTo(row, 0);\n this.moveCursorLeft();\n if (row > 0)\n this.moveCursorWordLeft();\n return;\n }\n if (this.session.tokenRe.exec(leftOfCursor)) {\n column -= this.session.tokenRe.lastIndex;\n this.session.tokenRe.lastIndex = 0;\n }\n this.moveCursorTo(row, column);\n };\n this.$shortWordEndIndex = function (rightOfCursor) {\n var index = 0, ch;\n var whitespaceRe = /\\s/;\n var tokenRe = this.session.tokenRe;\n tokenRe.lastIndex = 0;\n if (this.session.tokenRe.exec(rightOfCursor)) {\n index = this.session.tokenRe.lastIndex;\n }\n else {\n while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch))\n index++;\n if (index < 1) {\n tokenRe.lastIndex = 0;\n while ((ch = rightOfCursor[index]) && !tokenRe.test(ch)) {\n tokenRe.lastIndex = 0;\n index++;\n if (whitespaceRe.test(ch)) {\n if (index > 2) {\n index--;\n break;\n }\n else {\n while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch))\n index++;\n if (index > 2)\n break;\n }\n }\n }\n }\n }\n tokenRe.lastIndex = 0;\n return index;\n };\n this.moveCursorShortWordRight = function () {\n var row = this.lead.row;\n var column = this.lead.column;\n var line = this.doc.getLine(row);\n var rightOfCursor = line.substring(column);\n var fold = this.session.getFoldAt(row, column, 1);\n if (fold)\n return this.moveCursorTo(fold.end.row, fold.end.column);\n if (column == line.length) {\n var l = this.doc.getLength();\n do {\n row++;\n rightOfCursor = this.doc.getLine(row);\n } while (row < l && /^\\s*$/.test(rightOfCursor));\n if (!/^\\s+/.test(rightOfCursor))\n rightOfCursor = \"\";\n column = 0;\n }\n var index = this.$shortWordEndIndex(rightOfCursor);\n this.moveCursorTo(row, column + index);\n };\n this.moveCursorShortWordLeft = function () {\n var row = this.lead.row;\n var column = this.lead.column;\n var fold;\n if (fold = this.session.getFoldAt(row, column, -1))\n return this.moveCursorTo(fold.start.row, fold.start.column);\n var line = this.session.getLine(row).substring(0, column);\n if (column === 0) {\n do {\n row--;\n line = this.doc.getLine(row);\n } while (row > 0 && /^\\s*$/.test(line));\n column = line.length;\n if (!/\\s+$/.test(line))\n line = \"\";\n }\n var leftOfCursor = lang.stringReverse(line);\n var index = this.$shortWordEndIndex(leftOfCursor);\n return this.moveCursorTo(row, column - index);\n };\n this.moveCursorWordRight = function () {\n if (this.session.$selectLongWords)\n this.moveCursorLongWordRight();\n else\n this.moveCursorShortWordRight();\n };\n this.moveCursorWordLeft = function () {\n if (this.session.$selectLongWords)\n this.moveCursorLongWordLeft();\n else\n this.moveCursorShortWordLeft();\n };\n this.moveCursorBy = function (rows, chars) {\n var screenPos = this.session.documentToScreenPosition(this.lead.row, this.lead.column);\n var offsetX;\n if (chars === 0) {\n if (rows !== 0) {\n if (this.session.$bidiHandler.isBidiRow(screenPos.row, this.lead.row)) {\n offsetX = this.session.$bidiHandler.getPosLeft(screenPos.column);\n screenPos.column = Math.round(offsetX / this.session.$bidiHandler.charWidths[0]);\n }\n else {\n offsetX = screenPos.column * this.session.$bidiHandler.charWidths[0];\n }\n }\n if (this.$desiredColumn)\n screenPos.column = this.$desiredColumn;\n else\n this.$desiredColumn = screenPos.column;\n }\n if (rows != 0 && this.session.lineWidgets && this.session.lineWidgets[this.lead.row]) {\n var widget = this.session.lineWidgets[this.lead.row];\n if (rows < 0)\n rows -= widget.rowsAbove || 0;\n else if (rows > 0)\n rows += widget.rowCount - (widget.rowsAbove || 0);\n }\n var docPos = this.session.screenToDocumentPosition(screenPos.row + rows, screenPos.column, offsetX);\n if (rows !== 0 && chars === 0 && docPos.row === this.lead.row && docPos.column === this.lead.column) {\n }\n this.moveCursorTo(docPos.row, docPos.column + chars, chars === 0);\n };\n this.moveCursorToPosition = function (position) {\n this.moveCursorTo(position.row, position.column);\n };\n this.moveCursorTo = function (row, column, keepDesiredColumn) {\n var fold = this.session.getFoldAt(row, column, 1);\n if (fold) {\n row = fold.start.row;\n column = fold.start.column;\n }\n this.$keepDesiredColumnOnChange = true;\n var line = this.session.getLine(row);\n if (/[\\uDC00-\\uDFFF]/.test(line.charAt(column)) && line.charAt(column - 1)) {\n if (this.lead.row == row && this.lead.column == column + 1)\n column = column - 1;\n else\n column = column + 1;\n }\n this.lead.setPosition(row, column);\n this.$keepDesiredColumnOnChange = false;\n if (!keepDesiredColumn)\n this.$desiredColumn = null;\n };\n this.moveCursorToScreen = function (row, column, keepDesiredColumn) {\n var pos = this.session.screenToDocumentPosition(row, column);\n this.moveCursorTo(pos.row, pos.column, keepDesiredColumn);\n };\n this.detach = function () {\n this.lead.detach();\n this.anchor.detach();\n };\n this.fromOrientedRange = function (range) {\n this.setSelectionRange(range, range.cursor == range.start);\n this.$desiredColumn = range.desiredColumn || this.$desiredColumn;\n };\n this.toOrientedRange = function (range) {\n var r = this.getRange();\n if (range) {\n range.start.column = r.start.column;\n range.start.row = r.start.row;\n range.end.column = r.end.column;\n range.end.row = r.end.row;\n }\n else {\n range = r;\n }\n range.cursor = this.isBackwards() ? range.start : range.end;\n range.desiredColumn = this.$desiredColumn;\n return range;\n };\n this.getRangeOfMovements = function (func) {\n var start = this.getCursor();\n try {\n func(this);\n var end = this.getCursor();\n return Range.fromPoints(start, end);\n }\n catch (e) {\n return Range.fromPoints(start, start);\n }\n finally {\n this.moveCursorToPosition(start);\n }\n };\n this.toJSON = function () {\n if (this.rangeCount) {\n var data = this.ranges.map(function (r) {\n var r1 = r.clone();\n r1.isBackwards = r.cursor == r.start;\n return r1;\n });\n }\n else {\n var data = this.getRange();\n data.isBackwards = this.isBackwards();\n }\n return data;\n };\n this.fromJSON = function (data) {\n if (data.start == undefined) {\n if (this.rangeList && data.length > 1) {\n this.toSingleRange(data[0]);\n for (var i = data.length; i--;) {\n var r = Range.fromPoints(data[i].start, data[i].end);\n if (data[i].isBackwards)\n r.cursor = r.start;\n this.addRange(r, true);\n }\n return;\n }\n else {\n data = data[0];\n }\n }\n if (this.rangeList)\n this.toSingleRange(data);\n this.setSelectionRange(data, data.isBackwards);\n };\n this.isEqual = function (data) {\n if ((data.length || this.rangeCount) && data.length != this.rangeCount)\n return false;\n if (!data.length || !this.ranges)\n return this.getRange().isEqual(data);\n for (var i = this.ranges.length; i--;) {\n if (!this.ranges[i].isEqual(data[i]))\n return false;\n }\n return true;\n };\n}).call(Selection.prototype);\nexports.Selection = Selection;\n\n});\n\nace.define(\"ace/tokenizer\",[\"require\",\"exports\",\"module\",\"ace/config\"], function(require, exports, module){\"use strict\";\nvar config = require(\"./config\");\nvar MAX_TOKEN_COUNT = 2000;\nvar Tokenizer = function (rules) {\n this.states = rules;\n this.regExps = {};\n this.matchMappings = {};\n for (var key in this.states) {\n var state = this.states[key];\n var ruleRegExps = [];\n var matchTotal = 0;\n var mapping = this.matchMappings[key] = { defaultToken: \"text\" };\n var flag = \"g\";\n var splitterRurles = [];\n for (var i = 0; i < state.length; i++) {\n var rule = state[i];\n if (rule.defaultToken)\n mapping.defaultToken = rule.defaultToken;\n if (rule.caseInsensitive && flag.indexOf(\"i\") === -1)\n flag += \"i\";\n if (rule.unicode && flag.indexOf(\"u\") === -1)\n flag += \"u\";\n if (rule.regex == null)\n continue;\n if (rule.regex instanceof RegExp)\n rule.regex = rule.regex.toString().slice(1, -1);\n var adjustedregex = rule.regex;\n var matchcount = new RegExp(\"(?:(\" + adjustedregex + \")|(.))\").exec(\"a\").length - 2;\n if (Array.isArray(rule.token)) {\n if (rule.token.length == 1 || matchcount == 1) {\n rule.token = rule.token[0];\n }\n else if (matchcount - 1 != rule.token.length) {\n this.reportError(\"number of classes and regexp groups doesn't match\", {\n rule: rule,\n groupCount: matchcount - 1\n });\n rule.token = rule.token[0];\n }\n else {\n rule.tokenArray = rule.token;\n rule.token = null;\n rule.onMatch = this.$arrayTokens;\n }\n }\n else if (typeof rule.token == \"function\" && !rule.onMatch) {\n if (matchcount > 1)\n rule.onMatch = this.$applyToken;\n else\n rule.onMatch = rule.token;\n }\n if (matchcount > 1) {\n if (/\\\\\\d/.test(rule.regex)) {\n adjustedregex = rule.regex.replace(/\\\\([0-9]+)/g, function (match, digit) {\n return \"\\\\\" + (parseInt(digit, 10) + matchTotal + 1);\n });\n }\n else {\n matchcount = 1;\n adjustedregex = this.removeCapturingGroups(rule.regex);\n }\n if (!rule.splitRegex && typeof rule.token != \"string\")\n splitterRurles.push(rule); // flag will be known only at the very end\n }\n mapping[matchTotal] = i;\n matchTotal += matchcount;\n ruleRegExps.push(adjustedregex);\n if (!rule.onMatch)\n rule.onMatch = null;\n }\n if (!ruleRegExps.length) {\n mapping[0] = 0;\n ruleRegExps.push(\"$\");\n }\n splitterRurles.forEach(function (rule) {\n rule.splitRegex = this.createSplitterRegexp(rule.regex, flag);\n }, this);\n this.regExps[key] = new RegExp(\"(\" + ruleRegExps.join(\")|(\") + \")|($)\", flag);\n }\n};\n(function () {\n this.$setMaxTokenCount = function (m) {\n MAX_TOKEN_COUNT = m | 0;\n };\n this.$applyToken = function (str) {\n var values = this.splitRegex.exec(str).slice(1);\n var types = this.token.apply(this, values);\n if (typeof types === \"string\")\n return [{ type: types, value: str }];\n var tokens = [];\n for (var i = 0, l = types.length; i < l; i++) {\n if (values[i])\n tokens[tokens.length] = {\n type: types[i],\n value: values[i]\n };\n }\n return tokens;\n };\n this.$arrayTokens = function (str) {\n if (!str)\n return [];\n var values = this.splitRegex.exec(str);\n if (!values)\n return \"text\";\n var tokens = [];\n var types = this.tokenArray;\n for (var i = 0, l = types.length; i < l; i++) {\n if (values[i + 1])\n tokens[tokens.length] = {\n type: types[i],\n value: values[i + 1]\n };\n }\n return tokens;\n };\n this.removeCapturingGroups = function (src) {\n var r = src.replace(/\\\\.|\\[(?:\\\\.|[^\\\\\\]])*|\\(\\?[:=!<]|(\\()/g, function (x, y) { return y ? \"(?:\" : x; });\n return r;\n };\n this.createSplitterRegexp = function (src, flag) {\n if (src.indexOf(\"(?=\") != -1) {\n var stack = 0;\n var inChClass = false;\n var lastCapture = {};\n src.replace(/(\\\\.)|(\\((?:\\?[=!])?)|(\\))|([\\[\\]])/g, function (m, esc, parenOpen, parenClose, square, index) {\n if (inChClass) {\n inChClass = square != \"]\";\n }\n else if (square) {\n inChClass = true;\n }\n else if (parenClose) {\n if (stack == lastCapture.stack) {\n lastCapture.end = index + 1;\n lastCapture.stack = -1;\n }\n stack--;\n }\n else if (parenOpen) {\n stack++;\n if (parenOpen.length != 1) {\n lastCapture.stack = stack;\n lastCapture.start = index;\n }\n }\n return m;\n });\n if (lastCapture.end != null && /^\\)*$/.test(src.substr(lastCapture.end)))\n src = src.substring(0, lastCapture.start) + src.substr(lastCapture.end);\n }\n if (src.charAt(0) != \"^\")\n src = \"^\" + src;\n if (src.charAt(src.length - 1) != \"$\")\n src += \"$\";\n return new RegExp(src, (flag || \"\").replace(\"g\", \"\"));\n };\n this.getLineTokens = function (line, startState) {\n if (startState && typeof startState != \"string\") {\n var stack = startState.slice(0);\n startState = stack[0];\n if (startState === \"#tmp\") {\n stack.shift();\n startState = stack.shift();\n }\n }\n else\n var stack = [];\n var currentState = startState || \"start\";\n var state = this.states[currentState];\n if (!state) {\n currentState = \"start\";\n state = this.states[currentState];\n }\n var mapping = this.matchMappings[currentState];\n var re = this.regExps[currentState];\n re.lastIndex = 0;\n var match, tokens = [];\n var lastIndex = 0;\n var matchAttempts = 0;\n var token = { type: null, value: \"\" };\n while (match = re.exec(line)) {\n var type = mapping.defaultToken;\n var rule = null;\n var value = match[0];\n var index = re.lastIndex;\n if (index - value.length > lastIndex) {\n var skipped = line.substring(lastIndex, index - value.length);\n if (token.type == type) {\n token.value += skipped;\n }\n else {\n if (token.type)\n tokens.push(token);\n token = { type: type, value: skipped };\n }\n }\n for (var i = 0; i < match.length - 2; i++) {\n if (match[i + 1] === undefined)\n continue;\n rule = state[mapping[i]];\n if (rule.onMatch)\n type = rule.onMatch(value, currentState, stack, line);\n else\n type = rule.token;\n if (rule.next) {\n if (typeof rule.next == \"string\") {\n currentState = rule.next;\n }\n else {\n currentState = rule.next(currentState, stack);\n }\n state = this.states[currentState];\n if (!state) {\n this.reportError(\"state doesn't exist\", currentState);\n currentState = \"start\";\n state = this.states[currentState];\n }\n mapping = this.matchMappings[currentState];\n lastIndex = index;\n re = this.regExps[currentState];\n re.lastIndex = index;\n }\n if (rule.consumeLineEnd)\n lastIndex = index;\n break;\n }\n if (value) {\n if (typeof type === \"string\") {\n if ((!rule || rule.merge !== false) && token.type === type) {\n token.value += value;\n }\n else {\n if (token.type)\n tokens.push(token);\n token = { type: type, value: value };\n }\n }\n else if (type) {\n if (token.type)\n tokens.push(token);\n token = { type: null, value: \"\" };\n for (var i = 0; i < type.length; i++)\n tokens.push(type[i]);\n }\n }\n if (lastIndex == line.length)\n break;\n lastIndex = index;\n if (matchAttempts++ > MAX_TOKEN_COUNT) {\n if (matchAttempts > 2 * line.length) {\n this.reportError(\"infinite loop with in ace tokenizer\", {\n startState: startState,\n line: line\n });\n }\n while (lastIndex < line.length) {\n if (token.type)\n tokens.push(token);\n token = {\n value: line.substring(lastIndex, lastIndex += 500),\n type: \"overflow\"\n };\n }\n currentState = \"start\";\n stack = [];\n break;\n }\n }\n if (token.type)\n tokens.push(token);\n if (stack.length > 1) {\n if (stack[0] !== currentState)\n stack.unshift(\"#tmp\", currentState);\n }\n return {\n tokens: tokens,\n state: stack.length ? stack : currentState\n };\n };\n this.reportError = config.reportError;\n}).call(Tokenizer.prototype);\nexports.Tokenizer = Tokenizer;\n\n});\n\nace.define(\"ace/mode/text_highlight_rules\",[\"require\",\"exports\",\"module\",\"ace/lib/lang\"], function(require, exports, module){\"use strict\";\nvar lang = require(\"../lib/lang\");\nvar TextHighlightRules = function () {\n this.$rules = {\n \"start\": [{\n token: \"empty_line\",\n regex: '^$'\n }, {\n defaultToken: \"text\"\n }]\n };\n};\n(function () {\n this.addRules = function (rules, prefix) {\n if (!prefix) {\n for (var key in rules)\n this.$rules[key] = rules[key];\n return;\n }\n for (var key in rules) {\n var state = rules[key];\n for (var i = 0; i < state.length; i++) {\n var rule = state[i];\n if (rule.next || rule.onMatch) {\n if (typeof rule.next == \"string\") {\n if (rule.next.indexOf(prefix) !== 0)\n rule.next = prefix + rule.next;\n }\n if (rule.nextState && rule.nextState.indexOf(prefix) !== 0)\n rule.nextState = prefix + rule.nextState;\n }\n }\n this.$rules[prefix + key] = state;\n }\n };\n this.getRules = function () {\n return this.$rules;\n };\n this.embedRules = function (HighlightRules, prefix, escapeRules, states, append) {\n var embedRules = typeof HighlightRules == \"function\"\n ? new HighlightRules().getRules()\n : HighlightRules;\n if (states) {\n for (var i = 0; i < states.length; i++)\n states[i] = prefix + states[i];\n }\n else {\n states = [];\n for (var key in embedRules)\n states.push(prefix + key);\n }\n this.addRules(embedRules, prefix);\n if (escapeRules) {\n var addRules = Array.prototype[append ? \"push\" : \"unshift\"];\n for (var i = 0; i < states.length; i++)\n addRules.apply(this.$rules[states[i]], lang.deepCopy(escapeRules));\n }\n if (!this.$embeds)\n this.$embeds = [];\n this.$embeds.push(prefix);\n };\n this.getEmbeds = function () {\n return this.$embeds;\n };\n var pushState = function (currentState, stack) {\n if (currentState != \"start\" || stack.length)\n stack.unshift(this.nextState, currentState);\n return this.nextState;\n };\n var popState = function (currentState, stack) {\n stack.shift();\n return stack.shift() || \"start\";\n };\n this.normalizeRules = function () {\n var id = 0;\n var rules = this.$rules;\n function processState(key) {\n var state = rules[key];\n state.processed = true;\n for (var i = 0; i < state.length; i++) {\n var rule = state[i];\n var toInsert = null;\n if (Array.isArray(rule)) {\n toInsert = rule;\n rule = {};\n }\n if (!rule.regex && rule.start) {\n rule.regex = rule.start;\n if (!rule.next)\n rule.next = [];\n rule.next.push({\n defaultToken: rule.token\n }, {\n token: rule.token + \".end\",\n regex: rule.end || rule.start,\n next: \"pop\"\n });\n rule.token = rule.token + \".start\";\n rule.push = true;\n }\n var next = rule.next || rule.push;\n if (next && Array.isArray(next)) {\n var stateName = rule.stateName;\n if (!stateName) {\n stateName = rule.token;\n if (typeof stateName != \"string\")\n stateName = stateName[0] || \"\";\n if (rules[stateName])\n stateName += id++;\n }\n rules[stateName] = next;\n rule.next = stateName;\n processState(stateName);\n }\n else if (next == \"pop\") {\n rule.next = popState;\n }\n if (rule.push) {\n rule.nextState = rule.next || rule.push;\n rule.next = pushState;\n delete rule.push;\n }\n if (rule.rules) {\n for (var r in rule.rules) {\n if (rules[r]) {\n if (rules[r].push)\n rules[r].push.apply(rules[r], rule.rules[r]);\n }\n else {\n rules[r] = rule.rules[r];\n }\n }\n }\n var includeName = typeof rule == \"string\" ? rule : rule.include;\n if (includeName) {\n if (Array.isArray(includeName))\n toInsert = includeName.map(function (x) { return rules[x]; });\n else\n toInsert = rules[includeName];\n }\n if (toInsert) {\n var args = [i, 1].concat(toInsert);\n if (rule.noEscape)\n args = args.filter(function (x) { return !x.next; });\n state.splice.apply(state, args);\n i--;\n }\n if (rule.keywordMap) {\n rule.token = this.createKeywordMapper(rule.keywordMap, rule.defaultToken || \"text\", rule.caseInsensitive);\n delete rule.defaultToken;\n }\n }\n }\n Object.keys(rules).forEach(processState, this);\n };\n this.createKeywordMapper = function (map, defaultToken, ignoreCase, splitChar) {\n var keywords = Object.create(null);\n this.$keywordList = [];\n Object.keys(map).forEach(function (className) {\n var a = map[className];\n var list = a.split(splitChar || \"|\");\n for (var i = list.length; i--;) {\n var word = list[i];\n this.$keywordList.push(word);\n if (ignoreCase)\n word = word.toLowerCase();\n keywords[word] = className;\n }\n }, this);\n map = null;\n return ignoreCase\n ? function (value) { return keywords[value.toLowerCase()] || defaultToken; }\n : function (value) { return keywords[value] || defaultToken; };\n };\n this.getKeywords = function () {\n return this.$keywords;\n };\n}).call(TextHighlightRules.prototype);\nexports.TextHighlightRules = TextHighlightRules;\n\n});\n\nace.define(\"ace/mode/behaviour\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nvar Behaviour = function () {\n this.$behaviours = {};\n};\n(function () {\n this.add = function (name, action, callback) {\n switch (undefined) {\n case this.$behaviours:\n this.$behaviours = {};\n case this.$behaviours[name]:\n this.$behaviours[name] = {};\n }\n this.$behaviours[name][action] = callback;\n };\n this.addBehaviours = function (behaviours) {\n for (var key in behaviours) {\n for (var action in behaviours[key]) {\n this.add(key, action, behaviours[key][action]);\n }\n }\n };\n this.remove = function (name) {\n if (this.$behaviours && this.$behaviours[name]) {\n delete this.$behaviours[name];\n }\n };\n this.inherit = function (mode, filter) {\n if (typeof mode === \"function\") {\n var behaviours = new mode().getBehaviours(filter);\n }\n else {\n var behaviours = mode.getBehaviours(filter);\n }\n this.addBehaviours(behaviours);\n };\n this.getBehaviours = function (filter) {\n if (!filter) {\n return this.$behaviours;\n }\n else {\n var ret = {};\n for (var i = 0; i < filter.length; i++) {\n if (this.$behaviours[filter[i]]) {\n ret[filter[i]] = this.$behaviours[filter[i]];\n }\n }\n return ret;\n }\n };\n}).call(Behaviour.prototype);\nexports.Behaviour = Behaviour;\n\n});\n\nace.define(\"ace/token_iterator\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"./range\").Range;\nvar TokenIterator = function (session, initialRow, initialColumn) {\n this.$session = session;\n this.$row = initialRow;\n this.$rowTokens = session.getTokens(initialRow);\n var token = session.getTokenAt(initialRow, initialColumn);\n this.$tokenIndex = token ? token.index : -1;\n};\n(function () {\n this.stepBackward = function () {\n this.$tokenIndex -= 1;\n while (this.$tokenIndex < 0) {\n this.$row -= 1;\n if (this.$row < 0) {\n this.$row = 0;\n return null;\n }\n this.$rowTokens = this.$session.getTokens(this.$row);\n this.$tokenIndex = this.$rowTokens.length - 1;\n }\n return this.$rowTokens[this.$tokenIndex];\n };\n this.stepForward = function () {\n this.$tokenIndex += 1;\n var rowCount;\n while (this.$tokenIndex >= this.$rowTokens.length) {\n this.$row += 1;\n if (!rowCount)\n rowCount = this.$session.getLength();\n if (this.$row >= rowCount) {\n this.$row = rowCount - 1;\n return null;\n }\n this.$rowTokens = this.$session.getTokens(this.$row);\n this.$tokenIndex = 0;\n }\n return this.$rowTokens[this.$tokenIndex];\n };\n this.getCurrentToken = function () {\n return this.$rowTokens[this.$tokenIndex];\n };\n this.getCurrentTokenRow = function () {\n return this.$row;\n };\n this.getCurrentTokenColumn = function () {\n var rowTokens = this.$rowTokens;\n var tokenIndex = this.$tokenIndex;\n var column = rowTokens[tokenIndex].start;\n if (column !== undefined)\n return column;\n column = 0;\n while (tokenIndex > 0) {\n tokenIndex -= 1;\n column += rowTokens[tokenIndex].value.length;\n }\n return column;\n };\n this.getCurrentTokenPosition = function () {\n return { row: this.$row, column: this.getCurrentTokenColumn() };\n };\n this.getCurrentTokenRange = function () {\n var token = this.$rowTokens[this.$tokenIndex];\n var column = this.getCurrentTokenColumn();\n return new Range(this.$row, column, this.$row, column + token.value.length);\n };\n}).call(TokenIterator.prototype);\nexports.TokenIterator = TokenIterator;\n\n});\n\nace.define(\"ace/mode/behaviour/cstyle\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/behaviour\",\"ace/token_iterator\",\"ace/lib/lang\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"../../lib/oop\");\nvar Behaviour = require(\"../behaviour\").Behaviour;\nvar TokenIterator = require(\"../../token_iterator\").TokenIterator;\nvar lang = require(\"../../lib/lang\");\nvar SAFE_INSERT_IN_TOKENS = [\"text\", \"paren.rparen\", \"rparen\", \"paren\", \"punctuation.operator\"];\nvar SAFE_INSERT_BEFORE_TOKENS = [\"text\", \"paren.rparen\", \"rparen\", \"paren\", \"punctuation.operator\", \"comment\"];\nvar context;\nvar contextCache = {};\nvar defaultQuotes = { '\"': '\"', \"'\": \"'\" };\nvar initContext = function (editor) {\n var id = -1;\n if (editor.multiSelect) {\n id = editor.selection.index;\n if (contextCache.rangeCount != editor.multiSelect.rangeCount)\n contextCache = { rangeCount: editor.multiSelect.rangeCount };\n }\n if (contextCache[id])\n return context = contextCache[id];\n context = contextCache[id] = {\n autoInsertedBrackets: 0,\n autoInsertedRow: -1,\n autoInsertedLineEnd: \"\",\n maybeInsertedBrackets: 0,\n maybeInsertedRow: -1,\n maybeInsertedLineStart: \"\",\n maybeInsertedLineEnd: \"\"\n };\n};\nvar getWrapped = function (selection, selected, opening, closing) {\n var rowDiff = selection.end.row - selection.start.row;\n return {\n text: opening + selected + closing,\n selection: [\n 0,\n selection.start.column + 1,\n rowDiff,\n selection.end.column + (rowDiff ? 0 : 1)\n ]\n };\n};\nvar CstyleBehaviour = function (options) {\n this.add(\"braces\", \"insertion\", function (state, action, editor, session, text) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n if (text == '{') {\n initContext(editor);\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && selected !== \"{\" && editor.getWrapBehavioursEnabled()) {\n return getWrapped(selection, selected, '{', '}');\n }\n else if (CstyleBehaviour.isSaneInsertion(editor, session)) {\n if (/[\\]\\}\\)]/.test(line[cursor.column]) || editor.inMultiSelectMode || options && options.braces) {\n CstyleBehaviour.recordAutoInsert(editor, session, \"}\");\n return {\n text: '{}',\n selection: [1, 1]\n };\n }\n else {\n CstyleBehaviour.recordMaybeInsert(editor, session, \"{\");\n return {\n text: '{',\n selection: [1, 1]\n };\n }\n }\n }\n else if (text == '}') {\n initContext(editor);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar == '}') {\n var matching = session.$findOpeningBracket('}', { column: cursor.column + 1, row: cursor.row });\n if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {\n CstyleBehaviour.popAutoInsertedClosing();\n return {\n text: '',\n selection: [1, 1]\n };\n }\n }\n }\n else if (text == \"\\n\" || text == \"\\r\\n\") {\n initContext(editor);\n var closing = \"\";\n if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {\n closing = lang.stringRepeat(\"}\", context.maybeInsertedBrackets);\n CstyleBehaviour.clearMaybeInsertedClosing();\n }\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar === '}') {\n var openBracePos = session.findMatchingBracket({ row: cursor.row, column: cursor.column + 1 }, '}');\n if (!openBracePos)\n return null;\n var next_indent = this.$getIndent(session.getLine(openBracePos.row));\n }\n else if (closing) {\n var next_indent = this.$getIndent(line);\n }\n else {\n CstyleBehaviour.clearMaybeInsertedClosing();\n return;\n }\n var indent = next_indent + session.getTabString();\n return {\n text: '\\n' + indent + '\\n' + next_indent + closing,\n selection: [1, indent.length, 1, indent.length]\n };\n }\n else {\n CstyleBehaviour.clearMaybeInsertedClosing();\n }\n });\n this.add(\"braces\", \"deletion\", function (state, action, editor, session, range) {\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && selected == '{') {\n initContext(editor);\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.end.column, range.end.column + 1);\n if (rightChar == '}') {\n range.end.column++;\n return range;\n }\n else {\n context.maybeInsertedBrackets--;\n }\n }\n });\n this.add(\"parens\", \"insertion\", function (state, action, editor, session, text) {\n if (text == '(') {\n initContext(editor);\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && editor.getWrapBehavioursEnabled()) {\n return getWrapped(selection, selected, '(', ')');\n }\n else if (CstyleBehaviour.isSaneInsertion(editor, session)) {\n CstyleBehaviour.recordAutoInsert(editor, session, \")\");\n return {\n text: '()',\n selection: [1, 1]\n };\n }\n }\n else if (text == ')') {\n initContext(editor);\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar == ')') {\n var matching = session.$findOpeningBracket(')', { column: cursor.column + 1, row: cursor.row });\n if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {\n CstyleBehaviour.popAutoInsertedClosing();\n return {\n text: '',\n selection: [1, 1]\n };\n }\n }\n }\n });\n this.add(\"parens\", \"deletion\", function (state, action, editor, session, range) {\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && selected == '(') {\n initContext(editor);\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.start.column + 1, range.start.column + 2);\n if (rightChar == ')') {\n range.end.column++;\n return range;\n }\n }\n });\n this.add(\"brackets\", \"insertion\", function (state, action, editor, session, text) {\n if (text == '[') {\n initContext(editor);\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && editor.getWrapBehavioursEnabled()) {\n return getWrapped(selection, selected, '[', ']');\n }\n else if (CstyleBehaviour.isSaneInsertion(editor, session)) {\n CstyleBehaviour.recordAutoInsert(editor, session, \"]\");\n return {\n text: '[]',\n selection: [1, 1]\n };\n }\n }\n else if (text == ']') {\n initContext(editor);\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar == ']') {\n var matching = session.$findOpeningBracket(']', { column: cursor.column + 1, row: cursor.row });\n if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {\n CstyleBehaviour.popAutoInsertedClosing();\n return {\n text: '',\n selection: [1, 1]\n };\n }\n }\n }\n });\n this.add(\"brackets\", \"deletion\", function (state, action, editor, session, range) {\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && selected == '[') {\n initContext(editor);\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.start.column + 1, range.start.column + 2);\n if (rightChar == ']') {\n range.end.column++;\n return range;\n }\n }\n });\n this.add(\"string_dquotes\", \"insertion\", function (state, action, editor, session, text) {\n var quotes = session.$mode.$quotes || defaultQuotes;\n if (text.length == 1 && quotes[text]) {\n if (this.lineCommentStart && this.lineCommentStart.indexOf(text) != -1)\n return;\n initContext(editor);\n var quote = text;\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && (selected.length != 1 || !quotes[selected]) && editor.getWrapBehavioursEnabled()) {\n return getWrapped(selection, selected, quote, quote);\n }\n else if (!selected) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n var leftChar = line.substring(cursor.column - 1, cursor.column);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n var token = session.getTokenAt(cursor.row, cursor.column);\n var rightToken = session.getTokenAt(cursor.row, cursor.column + 1);\n if (leftChar == \"\\\\\" && token && /escape/.test(token.type))\n return null;\n var stringBefore = token && /string|escape/.test(token.type);\n var stringAfter = !rightToken || /string|escape/.test(rightToken.type);\n var pair;\n if (rightChar == quote) {\n pair = stringBefore !== stringAfter;\n if (pair && /string\\.end/.test(rightToken.type))\n pair = false;\n }\n else {\n if (stringBefore && !stringAfter)\n return null; // wrap string with different quote\n if (stringBefore && stringAfter)\n return null; // do not pair quotes inside strings\n var wordRe = session.$mode.tokenRe;\n wordRe.lastIndex = 0;\n var isWordBefore = wordRe.test(leftChar);\n wordRe.lastIndex = 0;\n var isWordAfter = wordRe.test(leftChar);\n if (isWordBefore || isWordAfter)\n return null; // before or after alphanumeric\n if (rightChar && !/[\\s;,.})\\]\\\\]/.test(rightChar))\n return null; // there is rightChar and it isn't closing\n var charBefore = line[cursor.column - 2];\n if (leftChar == quote && (charBefore == quote || wordRe.test(charBefore)))\n return null;\n pair = true;\n }\n return {\n text: pair ? quote + quote : \"\",\n selection: [1, 1]\n };\n }\n }\n });\n this.add(\"string_dquotes\", \"deletion\", function (state, action, editor, session, range) {\n var quotes = session.$mode.$quotes || defaultQuotes;\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && quotes.hasOwnProperty(selected)) {\n initContext(editor);\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.start.column + 1, range.start.column + 2);\n if (rightChar == selected) {\n range.end.column++;\n return range;\n }\n }\n });\n};\nCstyleBehaviour.isSaneInsertion = function (editor, session) {\n var cursor = editor.getCursorPosition();\n var iterator = new TokenIterator(session, cursor.row, cursor.column);\n if (!this.$matchTokenType(iterator.getCurrentToken() || \"text\", SAFE_INSERT_IN_TOKENS)) {\n if (/[)}\\]]/.test(editor.session.getLine(cursor.row)[cursor.column]))\n return true;\n var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);\n if (!this.$matchTokenType(iterator2.getCurrentToken() || \"text\", SAFE_INSERT_IN_TOKENS))\n return false;\n }\n iterator.stepForward();\n return iterator.getCurrentTokenRow() !== cursor.row ||\n this.$matchTokenType(iterator.getCurrentToken() || \"text\", SAFE_INSERT_BEFORE_TOKENS);\n};\nCstyleBehaviour.$matchTokenType = function (token, types) {\n return types.indexOf(token.type || token) > -1;\n};\nCstyleBehaviour.recordAutoInsert = function (editor, session, bracket) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0]))\n context.autoInsertedBrackets = 0;\n context.autoInsertedRow = cursor.row;\n context.autoInsertedLineEnd = bracket + line.substr(cursor.column);\n context.autoInsertedBrackets++;\n};\nCstyleBehaviour.recordMaybeInsert = function (editor, session, bracket) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n if (!this.isMaybeInsertedClosing(cursor, line))\n context.maybeInsertedBrackets = 0;\n context.maybeInsertedRow = cursor.row;\n context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;\n context.maybeInsertedLineEnd = line.substr(cursor.column);\n context.maybeInsertedBrackets++;\n};\nCstyleBehaviour.isAutoInsertedClosing = function (cursor, line, bracket) {\n return context.autoInsertedBrackets > 0 &&\n cursor.row === context.autoInsertedRow &&\n bracket === context.autoInsertedLineEnd[0] &&\n line.substr(cursor.column) === context.autoInsertedLineEnd;\n};\nCstyleBehaviour.isMaybeInsertedClosing = function (cursor, line) {\n return context.maybeInsertedBrackets > 0 &&\n cursor.row === context.maybeInsertedRow &&\n line.substr(cursor.column) === context.maybeInsertedLineEnd &&\n line.substr(0, cursor.column) == context.maybeInsertedLineStart;\n};\nCstyleBehaviour.popAutoInsertedClosing = function () {\n context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1);\n context.autoInsertedBrackets--;\n};\nCstyleBehaviour.clearMaybeInsertedClosing = function () {\n if (context) {\n context.maybeInsertedBrackets = 0;\n context.maybeInsertedRow = -1;\n }\n};\noop.inherits(CstyleBehaviour, Behaviour);\nexports.CstyleBehaviour = CstyleBehaviour;\n\n});\n\nace.define(\"ace/unicode\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nvar wordChars = [48, 9, 8, 25, 5, 0, 2, 25, 48, 0, 11, 0, 5, 0, 6, 22, 2, 30, 2, 457, 5, 11, 15, 4, 8, 0, 2, 0, 18, 116, 2, 1, 3, 3, 9, 0, 2, 2, 2, 0, 2, 19, 2, 82, 2, 138, 2, 4, 3, 155, 12, 37, 3, 0, 8, 38, 10, 44, 2, 0, 2, 1, 2, 1, 2, 0, 9, 26, 6, 2, 30, 10, 7, 61, 2, 9, 5, 101, 2, 7, 3, 9, 2, 18, 3, 0, 17, 58, 3, 100, 15, 53, 5, 0, 6, 45, 211, 57, 3, 18, 2, 5, 3, 11, 3, 9, 2, 1, 7, 6, 2, 2, 2, 7, 3, 1, 3, 21, 2, 6, 2, 0, 4, 3, 3, 8, 3, 1, 3, 3, 9, 0, 5, 1, 2, 4, 3, 11, 16, 2, 2, 5, 5, 1, 3, 21, 2, 6, 2, 1, 2, 1, 2, 1, 3, 0, 2, 4, 5, 1, 3, 2, 4, 0, 8, 3, 2, 0, 8, 15, 12, 2, 2, 8, 2, 2, 2, 21, 2, 6, 2, 1, 2, 4, 3, 9, 2, 2, 2, 2, 3, 0, 16, 3, 3, 9, 18, 2, 2, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 3, 8, 3, 1, 3, 2, 9, 1, 5, 1, 2, 4, 3, 9, 2, 0, 17, 1, 2, 5, 4, 2, 2, 3, 4, 1, 2, 0, 2, 1, 4, 1, 4, 2, 4, 11, 5, 4, 4, 2, 2, 3, 3, 0, 7, 0, 15, 9, 18, 2, 2, 7, 2, 2, 2, 22, 2, 9, 2, 4, 4, 7, 2, 2, 2, 3, 8, 1, 2, 1, 7, 3, 3, 9, 19, 1, 2, 7, 2, 2, 2, 22, 2, 9, 2, 4, 3, 8, 2, 2, 2, 3, 8, 1, 8, 0, 2, 3, 3, 9, 19, 1, 2, 7, 2, 2, 2, 22, 2, 15, 4, 7, 2, 2, 2, 3, 10, 0, 9, 3, 3, 9, 11, 5, 3, 1, 2, 17, 4, 23, 2, 8, 2, 0, 3, 6, 4, 0, 5, 5, 2, 0, 2, 7, 19, 1, 14, 57, 6, 14, 2, 9, 40, 1, 2, 0, 3, 1, 2, 0, 3, 0, 7, 3, 2, 6, 2, 2, 2, 0, 2, 0, 3, 1, 2, 12, 2, 2, 3, 4, 2, 0, 2, 5, 3, 9, 3, 1, 35, 0, 24, 1, 7, 9, 12, 0, 2, 0, 2, 0, 5, 9, 2, 35, 5, 19, 2, 5, 5, 7, 2, 35, 10, 0, 58, 73, 7, 77, 3, 37, 11, 42, 2, 0, 4, 328, 2, 3, 3, 6, 2, 0, 2, 3, 3, 40, 2, 3, 3, 32, 2, 3, 3, 6, 2, 0, 2, 3, 3, 14, 2, 56, 2, 3, 3, 66, 5, 0, 33, 15, 17, 84, 13, 619, 3, 16, 2, 25, 6, 74, 22, 12, 2, 6, 12, 20, 12, 19, 13, 12, 2, 2, 2, 1, 13, 51, 3, 29, 4, 0, 5, 1, 3, 9, 34, 2, 3, 9, 7, 87, 9, 42, 6, 69, 11, 28, 4, 11, 5, 11, 11, 39, 3, 4, 12, 43, 5, 25, 7, 10, 38, 27, 5, 62, 2, 28, 3, 10, 7, 9, 14, 0, 89, 75, 5, 9, 18, 8, 13, 42, 4, 11, 71, 55, 9, 9, 4, 48, 83, 2, 2, 30, 14, 230, 23, 280, 3, 5, 3, 37, 3, 5, 3, 7, 2, 0, 2, 0, 2, 0, 2, 30, 3, 52, 2, 6, 2, 0, 4, 2, 2, 6, 4, 3, 3, 5, 5, 12, 6, 2, 2, 6, 67, 1, 20, 0, 29, 0, 14, 0, 17, 4, 60, 12, 5, 0, 4, 11, 18, 0, 5, 0, 3, 9, 2, 0, 4, 4, 7, 0, 2, 0, 2, 0, 2, 3, 2, 10, 3, 3, 6, 4, 5, 0, 53, 1, 2684, 46, 2, 46, 2, 132, 7, 6, 15, 37, 11, 53, 10, 0, 17, 22, 10, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 31, 48, 0, 470, 1, 36, 5, 2, 4, 6, 1, 5, 85, 3, 1, 3, 2, 2, 89, 2, 3, 6, 40, 4, 93, 18, 23, 57, 15, 513, 6581, 75, 20939, 53, 1164, 68, 45, 3, 268, 4, 27, 21, 31, 3, 13, 13, 1, 2, 24, 9, 69, 11, 1, 38, 8, 3, 102, 3, 1, 111, 44, 25, 51, 13, 68, 12, 9, 7, 23, 4, 0, 5, 45, 3, 35, 13, 28, 4, 64, 15, 10, 39, 54, 10, 13, 3, 9, 7, 22, 4, 1, 5, 66, 25, 2, 227, 42, 2, 1, 3, 9, 7, 11171, 13, 22, 5, 48, 8453, 301, 3, 61, 3, 105, 39, 6, 13, 4, 6, 11, 2, 12, 2, 4, 2, 0, 2, 1, 2, 1, 2, 107, 34, 362, 19, 63, 3, 53, 41, 11, 5, 15, 17, 6, 13, 1, 25, 2, 33, 4, 2, 134, 20, 9, 8, 25, 5, 0, 2, 25, 12, 88, 4, 5, 3, 5, 3, 5, 3, 2];\nvar code = 0;\nvar str = [];\nfor (var i = 0; i < wordChars.length; i += 2) {\n str.push(code += wordChars[i]);\n if (wordChars[i + 1])\n str.push(45, code += wordChars[i + 1]);\n}\nexports.wordChars = String.fromCharCode.apply(null, str);\n\n});\n\nace.define(\"ace/mode/text\",[\"require\",\"exports\",\"module\",\"ace/config\",\"ace/tokenizer\",\"ace/mode/text_highlight_rules\",\"ace/mode/behaviour/cstyle\",\"ace/unicode\",\"ace/lib/lang\",\"ace/token_iterator\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar config = require(\"../config\");\nvar Tokenizer = require(\"../tokenizer\").Tokenizer;\nvar TextHighlightRules = require(\"./text_highlight_rules\").TextHighlightRules;\nvar CstyleBehaviour = require(\"./behaviour/cstyle\").CstyleBehaviour;\nvar unicode = require(\"../unicode\");\nvar lang = require(\"../lib/lang\");\nvar TokenIterator = require(\"../token_iterator\").TokenIterator;\nvar Range = require(\"../range\").Range;\nvar Mode = function () {\n this.HighlightRules = TextHighlightRules;\n};\n(function () {\n this.$defaultBehaviour = new CstyleBehaviour();\n this.tokenRe = new RegExp(\"^[\" + unicode.wordChars + \"\\\\$_]+\", \"g\");\n this.nonTokenRe = new RegExp(\"^(?:[^\" + unicode.wordChars + \"\\\\$_]|\\\\s])+\", \"g\");\n this.getTokenizer = function () {\n if (!this.$tokenizer) {\n this.$highlightRules = this.$highlightRules || new this.HighlightRules(this.$highlightRuleConfig);\n this.$tokenizer = new Tokenizer(this.$highlightRules.getRules());\n }\n return this.$tokenizer;\n };\n this.lineCommentStart = \"\";\n this.blockComment = \"\";\n this.toggleCommentLines = function (state, session, startRow, endRow) {\n var doc = session.doc;\n var ignoreBlankLines = true;\n var shouldRemove = true;\n var minIndent = Infinity;\n var tabSize = session.getTabSize();\n var insertAtTabStop = false;\n if (!this.lineCommentStart) {\n if (!this.blockComment)\n return false;\n var lineCommentStart = this.blockComment.start;\n var lineCommentEnd = this.blockComment.end;\n var regexpStart = new RegExp(\"^(\\\\s*)(?:\" + lang.escapeRegExp(lineCommentStart) + \")\");\n var regexpEnd = new RegExp(\"(?:\" + lang.escapeRegExp(lineCommentEnd) + \")\\\\s*$\");\n var comment = function (line, i) {\n if (testRemove(line, i))\n return;\n if (!ignoreBlankLines || /\\S/.test(line)) {\n doc.insertInLine({ row: i, column: line.length }, lineCommentEnd);\n doc.insertInLine({ row: i, column: minIndent }, lineCommentStart);\n }\n };\n var uncomment = function (line, i) {\n var m;\n if (m = line.match(regexpEnd))\n doc.removeInLine(i, line.length - m[0].length, line.length);\n if (m = line.match(regexpStart))\n doc.removeInLine(i, m[1].length, m[0].length);\n };\n var testRemove = function (line, row) {\n if (regexpStart.test(line))\n return true;\n var tokens = session.getTokens(row);\n for (var i = 0; i < tokens.length; i++) {\n if (tokens[i].type === \"comment\")\n return true;\n }\n };\n }\n else {\n if (Array.isArray(this.lineCommentStart)) {\n var regexpStart = this.lineCommentStart.map(lang.escapeRegExp).join(\"|\");\n var lineCommentStart = this.lineCommentStart[0];\n }\n else {\n var regexpStart = lang.escapeRegExp(this.lineCommentStart);\n var lineCommentStart = this.lineCommentStart;\n }\n regexpStart = new RegExp(\"^(\\\\s*)(?:\" + regexpStart + \") ?\");\n insertAtTabStop = session.getUseSoftTabs();\n var uncomment = function (line, i) {\n var m = line.match(regexpStart);\n if (!m)\n return;\n var start = m[1].length, end = m[0].length;\n if (!shouldInsertSpace(line, start, end) && m[0][end - 1] == \" \")\n end--;\n doc.removeInLine(i, start, end);\n };\n var commentWithSpace = lineCommentStart + \" \";\n var comment = function (line, i) {\n if (!ignoreBlankLines || /\\S/.test(line)) {\n if (shouldInsertSpace(line, minIndent, minIndent))\n doc.insertInLine({ row: i, column: minIndent }, commentWithSpace);\n else\n doc.insertInLine({ row: i, column: minIndent }, lineCommentStart);\n }\n };\n var testRemove = function (line, i) {\n return regexpStart.test(line);\n };\n var shouldInsertSpace = function (line, before, after) {\n var spaces = 0;\n while (before-- && line.charAt(before) == \" \")\n spaces++;\n if (spaces % tabSize != 0)\n return false;\n var spaces = 0;\n while (line.charAt(after++) == \" \")\n spaces++;\n if (tabSize > 2)\n return spaces % tabSize != tabSize - 1;\n else\n return spaces % tabSize == 0;\n };\n }\n function iter(fun) {\n for (var i = startRow; i <= endRow; i++)\n fun(doc.getLine(i), i);\n }\n var minEmptyLength = Infinity;\n iter(function (line, i) {\n var indent = line.search(/\\S/);\n if (indent !== -1) {\n if (indent < minIndent)\n minIndent = indent;\n if (shouldRemove && !testRemove(line, i))\n shouldRemove = false;\n }\n else if (minEmptyLength > line.length) {\n minEmptyLength = line.length;\n }\n });\n if (minIndent == Infinity) {\n minIndent = minEmptyLength;\n ignoreBlankLines = false;\n shouldRemove = false;\n }\n if (insertAtTabStop && minIndent % tabSize != 0)\n minIndent = Math.floor(minIndent / tabSize) * tabSize;\n iter(shouldRemove ? uncomment : comment);\n };\n this.toggleBlockComment = function (state, session, range, cursor) {\n var comment = this.blockComment;\n if (!comment)\n return;\n if (!comment.start && comment[0])\n comment = comment[0];\n var iterator = new TokenIterator(session, cursor.row, cursor.column);\n var token = iterator.getCurrentToken();\n var sel = session.selection;\n var initialRange = session.selection.toOrientedRange();\n var startRow, colDiff;\n if (token && /comment/.test(token.type)) {\n var startRange, endRange;\n while (token && /comment/.test(token.type)) {\n var i = token.value.indexOf(comment.start);\n if (i != -1) {\n var row = iterator.getCurrentTokenRow();\n var column = iterator.getCurrentTokenColumn() + i;\n startRange = new Range(row, column, row, column + comment.start.length);\n break;\n }\n token = iterator.stepBackward();\n }\n var iterator = new TokenIterator(session, cursor.row, cursor.column);\n var token = iterator.getCurrentToken();\n while (token && /comment/.test(token.type)) {\n var i = token.value.indexOf(comment.end);\n if (i != -1) {\n var row = iterator.getCurrentTokenRow();\n var column = iterator.getCurrentTokenColumn() + i;\n endRange = new Range(row, column, row, column + comment.end.length);\n break;\n }\n token = iterator.stepForward();\n }\n if (endRange)\n session.remove(endRange);\n if (startRange) {\n session.remove(startRange);\n startRow = startRange.start.row;\n colDiff = -comment.start.length;\n }\n }\n else {\n colDiff = comment.start.length;\n startRow = range.start.row;\n session.insert(range.end, comment.end);\n session.insert(range.start, comment.start);\n }\n if (initialRange.start.row == startRow)\n initialRange.start.column += colDiff;\n if (initialRange.end.row == startRow)\n initialRange.end.column += colDiff;\n session.selection.fromOrientedRange(initialRange);\n };\n this.getNextLineIndent = function (state, line, tab) {\n return this.$getIndent(line);\n };\n this.checkOutdent = function (state, line, input) {\n return false;\n };\n this.autoOutdent = function (state, doc, row) {\n };\n this.$getIndent = function (line) {\n return line.match(/^\\s*/)[0];\n };\n this.createWorker = function (session) {\n return null;\n };\n this.createModeDelegates = function (mapping) {\n this.$embeds = [];\n this.$modes = {};\n for (var i in mapping) {\n if (mapping[i]) {\n var Mode = mapping[i];\n var id = Mode.prototype.$id;\n var mode = config.$modes[id];\n if (!mode)\n config.$modes[id] = mode = new Mode();\n if (!config.$modes[i])\n config.$modes[i] = mode;\n this.$embeds.push(i);\n this.$modes[i] = mode;\n }\n }\n var delegations = [\"toggleBlockComment\", \"toggleCommentLines\", \"getNextLineIndent\",\n \"checkOutdent\", \"autoOutdent\", \"transformAction\", \"getCompletions\"];\n for (var i = 0; i < delegations.length; i++) {\n (function (scope) {\n var functionName = delegations[i];\n var defaultHandler = scope[functionName];\n scope[delegations[i]] = function () {\n return this.$delegator(functionName, arguments, defaultHandler);\n };\n }(this));\n }\n };\n this.$delegator = function (method, args, defaultHandler) {\n var state = args[0] || \"start\";\n if (typeof state != \"string\") {\n if (Array.isArray(state[2])) {\n var language = state[2][state[2].length - 1];\n var mode = this.$modes[language];\n if (mode)\n return mode[method].apply(mode, [state[1]].concat([].slice.call(args, 1)));\n }\n state = state[0] || \"start\";\n }\n for (var i = 0; i < this.$embeds.length; i++) {\n if (!this.$modes[this.$embeds[i]])\n continue;\n var split = state.split(this.$embeds[i]);\n if (!split[0] && split[1]) {\n args[0] = split[1];\n var mode = this.$modes[this.$embeds[i]];\n return mode[method].apply(mode, args);\n }\n }\n var ret = defaultHandler.apply(this, args);\n return defaultHandler ? ret : undefined;\n };\n this.transformAction = function (state, action, editor, session, param) {\n if (this.$behaviour) {\n var behaviours = this.$behaviour.getBehaviours();\n for (var key in behaviours) {\n if (behaviours[key][action]) {\n var ret = behaviours[key][action].apply(this, arguments);\n if (ret) {\n return ret;\n }\n }\n }\n }\n };\n this.getKeywords = function (append) {\n if (!this.completionKeywords) {\n var rules = this.$tokenizer.rules;\n var completionKeywords = [];\n for (var rule in rules) {\n var ruleItr = rules[rule];\n for (var r = 0, l = ruleItr.length; r < l; r++) {\n if (typeof ruleItr[r].token === \"string\") {\n if (/keyword|support|storage/.test(ruleItr[r].token))\n completionKeywords.push(ruleItr[r].regex);\n }\n else if (typeof ruleItr[r].token === \"object\") {\n for (var a = 0, aLength = ruleItr[r].token.length; a < aLength; a++) {\n if (/keyword|support|storage/.test(ruleItr[r].token[a])) {\n var rule = ruleItr[r].regex.match(/\\(.+?\\)/g)[a];\n completionKeywords.push(rule.substr(1, rule.length - 2));\n }\n }\n }\n }\n }\n this.completionKeywords = completionKeywords;\n }\n if (!append)\n return this.$keywordList;\n return completionKeywords.concat(this.$keywordList || []);\n };\n this.$createKeywordList = function () {\n if (!this.$highlightRules)\n this.getTokenizer();\n return this.$keywordList = this.$highlightRules.$keywordList || [];\n };\n this.getCompletions = function (state, session, pos, prefix) {\n var keywords = this.$keywordList || this.$createKeywordList();\n return keywords.map(function (word) {\n return {\n name: word,\n value: word,\n score: 0,\n meta: \"keyword\"\n };\n });\n };\n this.$id = \"ace/mode/text\";\n}).call(Mode.prototype);\nexports.Mode = Mode;\n\n});\n\nace.define(\"ace/apply_delta\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nfunction throwDeltaError(delta, errorText) {\n console.log(\"Invalid Delta:\", delta);\n throw \"Invalid Delta: \" + errorText;\n}\nfunction positionInDocument(docLines, position) {\n return position.row >= 0 && position.row < docLines.length &&\n position.column >= 0 && position.column <= docLines[position.row].length;\n}\nfunction validateDelta(docLines, delta) {\n if (delta.action != \"insert\" && delta.action != \"remove\")\n throwDeltaError(delta, \"delta.action must be 'insert' or 'remove'\");\n if (!(delta.lines instanceof Array))\n throwDeltaError(delta, \"delta.lines must be an Array\");\n if (!delta.start || !delta.end)\n throwDeltaError(delta, \"delta.start/end must be an present\");\n var start = delta.start;\n if (!positionInDocument(docLines, delta.start))\n throwDeltaError(delta, \"delta.start must be contained in document\");\n var end = delta.end;\n if (delta.action == \"remove\" && !positionInDocument(docLines, end))\n throwDeltaError(delta, \"delta.end must contained in document for 'remove' actions\");\n var numRangeRows = end.row - start.row;\n var numRangeLastLineChars = (end.column - (numRangeRows == 0 ? start.column : 0));\n if (numRangeRows != delta.lines.length - 1 || delta.lines[numRangeRows].length != numRangeLastLineChars)\n throwDeltaError(delta, \"delta.range must match delta lines\");\n}\nexports.applyDelta = function (docLines, delta, doNotValidate) {\n var row = delta.start.row;\n var startColumn = delta.start.column;\n var line = docLines[row] || \"\";\n switch (delta.action) {\n case \"insert\":\n var lines = delta.lines;\n if (lines.length === 1) {\n docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn);\n }\n else {\n var args = [row, 1].concat(delta.lines);\n docLines.splice.apply(docLines, args);\n docLines[row] = line.substring(0, startColumn) + docLines[row];\n docLines[row + delta.lines.length - 1] += line.substring(startColumn);\n }\n break;\n case \"remove\":\n var endColumn = delta.end.column;\n var endRow = delta.end.row;\n if (row === endRow) {\n docLines[row] = line.substring(0, startColumn) + line.substring(endColumn);\n }\n else {\n docLines.splice(row, endRow - row + 1, line.substring(0, startColumn) + docLines[endRow].substring(endColumn));\n }\n break;\n }\n};\n\n});\n\nace.define(\"ace/anchor\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar Anchor = exports.Anchor = function (doc, row, column) {\n this.$onChange = this.onChange.bind(this);\n this.attach(doc);\n if (typeof column == \"undefined\")\n this.setPosition(row.row, row.column);\n else\n this.setPosition(row, column);\n};\n(function () {\n oop.implement(this, EventEmitter);\n this.getPosition = function () {\n return this.$clipPositionToDocument(this.row, this.column);\n };\n this.getDocument = function () {\n return this.document;\n };\n this.$insertRight = false;\n this.onChange = function (delta) {\n if (delta.start.row == delta.end.row && delta.start.row != this.row)\n return;\n if (delta.start.row > this.row)\n return;\n var point = $getTransformedPoint(delta, { row: this.row, column: this.column }, this.$insertRight);\n this.setPosition(point.row, point.column, true);\n };\n function $pointsInOrder(point1, point2, equalPointsInOrder) {\n var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column;\n return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter);\n }\n function $getTransformedPoint(delta, point, moveIfEqual) {\n var deltaIsInsert = delta.action == \"insert\";\n var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row);\n var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column);\n var deltaStart = delta.start;\n var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range.\n if ($pointsInOrder(point, deltaStart, moveIfEqual)) {\n return {\n row: point.row,\n column: point.column\n };\n }\n if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) {\n return {\n row: point.row + deltaRowShift,\n column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0)\n };\n }\n return {\n row: deltaStart.row,\n column: deltaStart.column\n };\n }\n this.setPosition = function (row, column, noClip) {\n var pos;\n if (noClip) {\n pos = {\n row: row,\n column: column\n };\n }\n else {\n pos = this.$clipPositionToDocument(row, column);\n }\n if (this.row == pos.row && this.column == pos.column)\n return;\n var old = {\n row: this.row,\n column: this.column\n };\n this.row = pos.row;\n this.column = pos.column;\n this._signal(\"change\", {\n old: old,\n value: pos\n });\n };\n this.detach = function () {\n this.document.off(\"change\", this.$onChange);\n };\n this.attach = function (doc) {\n this.document = doc || this.document;\n this.document.on(\"change\", this.$onChange);\n };\n this.$clipPositionToDocument = function (row, column) {\n var pos = {};\n if (row >= this.document.getLength()) {\n pos.row = Math.max(0, this.document.getLength() - 1);\n pos.column = this.document.getLine(pos.row).length;\n }\n else if (row < 0) {\n pos.row = 0;\n pos.column = 0;\n }\n else {\n pos.row = row;\n pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));\n }\n if (column < 0)\n pos.column = 0;\n return pos;\n };\n}).call(Anchor.prototype);\n\n});\n\nace.define(\"ace/document\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/apply_delta\",\"ace/lib/event_emitter\",\"ace/range\",\"ace/anchor\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar applyDelta = require(\"./apply_delta\").applyDelta;\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar Range = require(\"./range\").Range;\nvar Anchor = require(\"./anchor\").Anchor;\nvar Document = function (textOrLines) {\n this.$lines = [\"\"];\n if (textOrLines.length === 0) {\n this.$lines = [\"\"];\n }\n else if (Array.isArray(textOrLines)) {\n this.insertMergedLines({ row: 0, column: 0 }, textOrLines);\n }\n else {\n this.insert({ row: 0, column: 0 }, textOrLines);\n }\n};\n(function () {\n oop.implement(this, EventEmitter);\n this.setValue = function (text) {\n var len = this.getLength() - 1;\n this.remove(new Range(0, 0, len, this.getLine(len).length));\n this.insert({ row: 0, column: 0 }, text || \"\");\n };\n this.getValue = function () {\n return this.getAllLines().join(this.getNewLineCharacter());\n };\n this.createAnchor = function (row, column) {\n return new Anchor(this, row, column);\n };\n if (\"aaa\".split(/a/).length === 0) {\n this.$split = function (text) {\n return text.replace(/\\r\\n|\\r/g, \"\\n\").split(\"\\n\");\n };\n }\n else {\n this.$split = function (text) {\n return text.split(/\\r\\n|\\r|\\n/);\n };\n }\n this.$detectNewLine = function (text) {\n var match = text.match(/^.*?(\\r\\n|\\r|\\n)/m);\n this.$autoNewLine = match ? match[1] : \"\\n\";\n this._signal(\"changeNewLineMode\");\n };\n this.getNewLineCharacter = function () {\n switch (this.$newLineMode) {\n case \"windows\":\n return \"\\r\\n\";\n case \"unix\":\n return \"\\n\";\n default:\n return this.$autoNewLine || \"\\n\";\n }\n };\n this.$autoNewLine = \"\";\n this.$newLineMode = \"auto\";\n this.setNewLineMode = function (newLineMode) {\n if (this.$newLineMode === newLineMode)\n return;\n this.$newLineMode = newLineMode;\n this._signal(\"changeNewLineMode\");\n };\n this.getNewLineMode = function () {\n return this.$newLineMode;\n };\n this.isNewLine = function (text) {\n return (text == \"\\r\\n\" || text == \"\\r\" || text == \"\\n\");\n };\n this.getLine = function (row) {\n return this.$lines[row] || \"\";\n };\n this.getLines = function (firstRow, lastRow) {\n return this.$lines.slice(firstRow, lastRow + 1);\n };\n this.getAllLines = function () {\n return this.getLines(0, this.getLength());\n };\n this.getLength = function () {\n return this.$lines.length;\n };\n this.getTextRange = function (range) {\n return this.getLinesForRange(range).join(this.getNewLineCharacter());\n };\n this.getLinesForRange = function (range) {\n var lines;\n if (range.start.row === range.end.row) {\n lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)];\n }\n else {\n lines = this.getLines(range.start.row, range.end.row);\n lines[0] = (lines[0] || \"\").substring(range.start.column);\n var l = lines.length - 1;\n if (range.end.row - range.start.row == l)\n lines[l] = lines[l].substring(0, range.end.column);\n }\n return lines;\n };\n this.insertLines = function (row, lines) {\n console.warn(\"Use of document.insertLines is deprecated. Use the insertFullLines method instead.\");\n return this.insertFullLines(row, lines);\n };\n this.removeLines = function (firstRow, lastRow) {\n console.warn(\"Use of document.removeLines is deprecated. Use the removeFullLines method instead.\");\n return this.removeFullLines(firstRow, lastRow);\n };\n this.insertNewLine = function (position) {\n console.warn(\"Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.\");\n return this.insertMergedLines(position, [\"\", \"\"]);\n };\n this.insert = function (position, text) {\n if (this.getLength() <= 1)\n this.$detectNewLine(text);\n return this.insertMergedLines(position, this.$split(text));\n };\n this.insertInLine = function (position, text) {\n var start = this.clippedPos(position.row, position.column);\n var end = this.pos(position.row, position.column + text.length);\n this.applyDelta({\n start: start,\n end: end,\n action: \"insert\",\n lines: [text]\n }, true);\n return this.clonePos(end);\n };\n this.clippedPos = function (row, column) {\n var length = this.getLength();\n if (row === undefined) {\n row = length;\n }\n else if (row < 0) {\n row = 0;\n }\n else if (row >= length) {\n row = length - 1;\n column = undefined;\n }\n var line = this.getLine(row);\n if (column == undefined)\n column = line.length;\n column = Math.min(Math.max(column, 0), line.length);\n return { row: row, column: column };\n };\n this.clonePos = function (pos) {\n return { row: pos.row, column: pos.column };\n };\n this.pos = function (row, column) {\n return { row: row, column: column };\n };\n this.$clipPosition = function (position) {\n var length = this.getLength();\n if (position.row >= length) {\n position.row = Math.max(0, length - 1);\n position.column = this.getLine(length - 1).length;\n }\n else {\n position.row = Math.max(0, position.row);\n position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length);\n }\n return position;\n };\n this.insertFullLines = function (row, lines) {\n row = Math.min(Math.max(row, 0), this.getLength());\n var column = 0;\n if (row < this.getLength()) {\n lines = lines.concat([\"\"]);\n column = 0;\n }\n else {\n lines = [\"\"].concat(lines);\n row--;\n column = this.$lines[row].length;\n }\n this.insertMergedLines({ row: row, column: column }, lines);\n };\n this.insertMergedLines = function (position, lines) {\n var start = this.clippedPos(position.row, position.column);\n var end = {\n row: start.row + lines.length - 1,\n column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length\n };\n this.applyDelta({\n start: start,\n end: end,\n action: \"insert\",\n lines: lines\n });\n return this.clonePos(end);\n };\n this.remove = function (range) {\n var start = this.clippedPos(range.start.row, range.start.column);\n var end = this.clippedPos(range.end.row, range.end.column);\n this.applyDelta({\n start: start,\n end: end,\n action: \"remove\",\n lines: this.getLinesForRange({ start: start, end: end })\n });\n return this.clonePos(start);\n };\n this.removeInLine = function (row, startColumn, endColumn) {\n var start = this.clippedPos(row, startColumn);\n var end = this.clippedPos(row, endColumn);\n this.applyDelta({\n start: start,\n end: end,\n action: \"remove\",\n lines: this.getLinesForRange({ start: start, end: end })\n }, true);\n return this.clonePos(start);\n };\n this.removeFullLines = function (firstRow, lastRow) {\n firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1);\n lastRow = Math.min(Math.max(0, lastRow), this.getLength() - 1);\n var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0;\n var deleteLastNewLine = lastRow < this.getLength() - 1;\n var startRow = (deleteFirstNewLine ? firstRow - 1 : firstRow);\n var startCol = (deleteFirstNewLine ? this.getLine(startRow).length : 0);\n var endRow = (deleteLastNewLine ? lastRow + 1 : lastRow);\n var endCol = (deleteLastNewLine ? 0 : this.getLine(endRow).length);\n var range = new Range(startRow, startCol, endRow, endCol);\n var deletedLines = this.$lines.slice(firstRow, lastRow + 1);\n this.applyDelta({\n start: range.start,\n end: range.end,\n action: \"remove\",\n lines: this.getLinesForRange(range)\n });\n return deletedLines;\n };\n this.removeNewLine = function (row) {\n if (row < this.getLength() - 1 && row >= 0) {\n this.applyDelta({\n start: this.pos(row, this.getLine(row).length),\n end: this.pos(row + 1, 0),\n action: \"remove\",\n lines: [\"\", \"\"]\n });\n }\n };\n this.replace = function (range, text) {\n if (!(range instanceof Range))\n range = Range.fromPoints(range.start, range.end);\n if (text.length === 0 && range.isEmpty())\n return range.start;\n if (text == this.getTextRange(range))\n return range.end;\n this.remove(range);\n var end;\n if (text) {\n end = this.insert(range.start, text);\n }\n else {\n end = range.start;\n }\n return end;\n };\n this.applyDeltas = function (deltas) {\n for (var i = 0; i < deltas.length; i++) {\n this.applyDelta(deltas[i]);\n }\n };\n this.revertDeltas = function (deltas) {\n for (var i = deltas.length - 1; i >= 0; i--) {\n this.revertDelta(deltas[i]);\n }\n };\n this.applyDelta = function (delta, doNotValidate) {\n var isInsert = delta.action == \"insert\";\n if (isInsert ? delta.lines.length <= 1 && !delta.lines[0]\n : !Range.comparePoints(delta.start, delta.end)) {\n return;\n }\n if (isInsert && delta.lines.length > 20000) {\n this.$splitAndapplyLargeDelta(delta, 20000);\n }\n else {\n applyDelta(this.$lines, delta, doNotValidate);\n this._signal(\"change\", delta);\n }\n };\n this.$safeApplyDelta = function (delta) {\n var docLength = this.$lines.length;\n if (delta.action == \"remove\" && delta.start.row < docLength && delta.end.row < docLength\n || delta.action == \"insert\" && delta.start.row <= docLength) {\n this.applyDelta(delta);\n }\n };\n this.$splitAndapplyLargeDelta = function (delta, MAX) {\n var lines = delta.lines;\n var l = lines.length - MAX + 1;\n var row = delta.start.row;\n var column = delta.start.column;\n for (var from = 0, to = 0; from < l; from = to) {\n to += MAX - 1;\n var chunk = lines.slice(from, to);\n chunk.push(\"\");\n this.applyDelta({\n start: this.pos(row + from, column),\n end: this.pos(row + to, column = 0),\n action: delta.action,\n lines: chunk\n }, true);\n }\n delta.lines = lines.slice(from);\n delta.start.row = row + from;\n delta.start.column = column;\n this.applyDelta(delta, true);\n };\n this.revertDelta = function (delta) {\n this.$safeApplyDelta({\n start: this.clonePos(delta.start),\n end: this.clonePos(delta.end),\n action: (delta.action == \"insert\" ? \"remove\" : \"insert\"),\n lines: delta.lines.slice()\n });\n };\n this.indexToPosition = function (index, startRow) {\n var lines = this.$lines || this.getAllLines();\n var newlineLength = this.getNewLineCharacter().length;\n for (var i = startRow || 0, l = lines.length; i < l; i++) {\n index -= lines[i].length + newlineLength;\n if (index < 0)\n return { row: i, column: index + lines[i].length + newlineLength };\n }\n return { row: l - 1, column: index + lines[l - 1].length + newlineLength };\n };\n this.positionToIndex = function (pos, startRow) {\n var lines = this.$lines || this.getAllLines();\n var newlineLength = this.getNewLineCharacter().length;\n var index = 0;\n var row = Math.min(pos.row, lines.length);\n for (var i = startRow || 0; i < row; ++i)\n index += lines[i].length + newlineLength;\n return index + pos.column;\n };\n}).call(Document.prototype);\nexports.Document = Document;\n\n});\n\nace.define(\"ace/background_tokenizer\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar BackgroundTokenizer = function (tokenizer, editor) {\n this.running = false;\n this.lines = [];\n this.states = [];\n this.currentLine = 0;\n this.tokenizer = tokenizer;\n var self = this;\n this.$worker = function () {\n if (!self.running) {\n return;\n }\n var workerStart = new Date();\n var currentLine = self.currentLine;\n var endLine = -1;\n var doc = self.doc;\n var startLine = currentLine;\n while (self.lines[currentLine])\n currentLine++;\n var len = doc.getLength();\n var processedLines = 0;\n self.running = false;\n while (currentLine < len) {\n self.$tokenizeRow(currentLine);\n endLine = currentLine;\n do {\n currentLine++;\n } while (self.lines[currentLine]);\n processedLines++;\n if ((processedLines % 5 === 0) && (new Date() - workerStart) > 20) {\n self.running = setTimeout(self.$worker, 20);\n break;\n }\n }\n self.currentLine = currentLine;\n if (endLine == -1)\n endLine = currentLine;\n if (startLine <= endLine)\n self.fireUpdateEvent(startLine, endLine);\n };\n};\n(function () {\n oop.implement(this, EventEmitter);\n this.setTokenizer = function (tokenizer) {\n this.tokenizer = tokenizer;\n this.lines = [];\n this.states = [];\n this.start(0);\n };\n this.setDocument = function (doc) {\n this.doc = doc;\n this.lines = [];\n this.states = [];\n this.stop();\n };\n this.fireUpdateEvent = function (firstRow, lastRow) {\n var data = {\n first: firstRow,\n last: lastRow\n };\n this._signal(\"update\", { data: data });\n };\n this.start = function (startRow) {\n this.currentLine = Math.min(startRow || 0, this.currentLine, this.doc.getLength());\n this.lines.splice(this.currentLine, this.lines.length);\n this.states.splice(this.currentLine, this.states.length);\n this.stop();\n this.running = setTimeout(this.$worker, 700);\n };\n this.scheduleStart = function () {\n if (!this.running)\n this.running = setTimeout(this.$worker, 700);\n };\n this.$updateOnChange = function (delta) {\n var startRow = delta.start.row;\n var len = delta.end.row - startRow;\n if (len === 0) {\n this.lines[startRow] = null;\n }\n else if (delta.action == \"remove\") {\n this.lines.splice(startRow, len + 1, null);\n this.states.splice(startRow, len + 1, null);\n }\n else {\n var args = Array(len + 1);\n args.unshift(startRow, 1);\n this.lines.splice.apply(this.lines, args);\n this.states.splice.apply(this.states, args);\n }\n this.currentLine = Math.min(startRow, this.currentLine, this.doc.getLength());\n this.stop();\n };\n this.stop = function () {\n if (this.running)\n clearTimeout(this.running);\n this.running = false;\n };\n this.getTokens = function (row) {\n return this.lines[row] || this.$tokenizeRow(row);\n };\n this.getState = function (row) {\n if (this.currentLine == row)\n this.$tokenizeRow(row);\n return this.states[row] || \"start\";\n };\n this.$tokenizeRow = function (row) {\n var line = this.doc.getLine(row);\n var state = this.states[row - 1];\n var data = this.tokenizer.getLineTokens(line, state, row);\n if (this.states[row] + \"\" !== data.state + \"\") {\n this.states[row] = data.state;\n this.lines[row + 1] = null;\n if (this.currentLine > row + 1)\n this.currentLine = row + 1;\n }\n else if (this.currentLine == row) {\n this.currentLine = row + 1;\n }\n return this.lines[row] = data.tokens;\n };\n this.cleanup = function () {\n this.running = false;\n this.lines = [];\n this.states = [];\n this.currentLine = 0;\n this.removeAllListeners();\n };\n}).call(BackgroundTokenizer.prototype);\nexports.BackgroundTokenizer = BackgroundTokenizer;\n\n});\n\nace.define(\"ace/search_highlight\",[\"require\",\"exports\",\"module\",\"ace/lib/lang\",\"ace/lib/oop\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar lang = require(\"./lib/lang\");\nvar oop = require(\"./lib/oop\");\nvar Range = require(\"./range\").Range;\nvar SearchHighlight = function (regExp, clazz, type) {\n this.setRegexp(regExp);\n this.clazz = clazz;\n this.type = type || \"text\";\n};\n(function () {\n this.MAX_RANGES = 500;\n this.setRegexp = function (regExp) {\n if (this.regExp + \"\" == regExp + \"\")\n return;\n this.regExp = regExp;\n this.cache = [];\n };\n this.update = function (html, markerLayer, session, config) {\n if (!this.regExp)\n return;\n var start = config.firstRow, end = config.lastRow;\n var renderedMarkerRanges = {};\n for (var i = start; i <= end; i++) {\n var ranges = this.cache[i];\n if (ranges == null) {\n ranges = lang.getMatchOffsets(session.getLine(i), this.regExp);\n if (ranges.length > this.MAX_RANGES)\n ranges = ranges.slice(0, this.MAX_RANGES);\n ranges = ranges.map(function (match) {\n return new Range(i, match.offset, i, match.offset + match.length);\n });\n this.cache[i] = ranges.length ? ranges : \"\";\n }\n for (var j = ranges.length; j--;) {\n var rangeToAddMarkerTo = ranges[j].toScreenRange(session);\n var rangeAsString = rangeToAddMarkerTo.toString();\n if (renderedMarkerRanges[rangeAsString])\n continue;\n renderedMarkerRanges[rangeAsString] = true;\n markerLayer.drawSingleLineMarker(html, rangeToAddMarkerTo, this.clazz, config);\n }\n }\n };\n}).call(SearchHighlight.prototype);\nexports.SearchHighlight = SearchHighlight;\n\n});\n\nace.define(\"ace/edit_session/fold_line\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"../range\").Range;\nfunction FoldLine(foldData, folds) {\n this.foldData = foldData;\n if (Array.isArray(folds)) {\n this.folds = folds;\n }\n else {\n folds = this.folds = [folds];\n }\n var last = folds[folds.length - 1];\n this.range = new Range(folds[0].start.row, folds[0].start.column, last.end.row, last.end.column);\n this.start = this.range.start;\n this.end = this.range.end;\n this.folds.forEach(function (fold) {\n fold.setFoldLine(this);\n }, this);\n}\n(function () {\n this.shiftRow = function (shift) {\n this.start.row += shift;\n this.end.row += shift;\n this.folds.forEach(function (fold) {\n fold.start.row += shift;\n fold.end.row += shift;\n });\n };\n this.addFold = function (fold) {\n if (fold.sameRow) {\n if (fold.start.row < this.startRow || fold.endRow > this.endRow) {\n throw new Error(\"Can't add a fold to this FoldLine as it has no connection\");\n }\n this.folds.push(fold);\n this.folds.sort(function (a, b) {\n return -a.range.compareEnd(b.start.row, b.start.column);\n });\n if (this.range.compareEnd(fold.start.row, fold.start.column) > 0) {\n this.end.row = fold.end.row;\n this.end.column = fold.end.column;\n }\n else if (this.range.compareStart(fold.end.row, fold.end.column) < 0) {\n this.start.row = fold.start.row;\n this.start.column = fold.start.column;\n }\n }\n else if (fold.start.row == this.end.row) {\n this.folds.push(fold);\n this.end.row = fold.end.row;\n this.end.column = fold.end.column;\n }\n else if (fold.end.row == this.start.row) {\n this.folds.unshift(fold);\n this.start.row = fold.start.row;\n this.start.column = fold.start.column;\n }\n else {\n throw new Error(\"Trying to add fold to FoldRow that doesn't have a matching row\");\n }\n fold.foldLine = this;\n };\n this.containsRow = function (row) {\n return row >= this.start.row && row <= this.end.row;\n };\n this.walk = function (callback, endRow, endColumn) {\n var lastEnd = 0, folds = this.folds, fold, cmp, stop, isNewRow = true;\n if (endRow == null) {\n endRow = this.end.row;\n endColumn = this.end.column;\n }\n for (var i = 0; i < folds.length; i++) {\n fold = folds[i];\n cmp = fold.range.compareStart(endRow, endColumn);\n if (cmp == -1) {\n callback(null, endRow, endColumn, lastEnd, isNewRow);\n return;\n }\n stop = callback(null, fold.start.row, fold.start.column, lastEnd, isNewRow);\n stop = !stop && callback(fold.placeholder, fold.start.row, fold.start.column, lastEnd);\n if (stop || cmp === 0) {\n return;\n }\n isNewRow = !fold.sameRow;\n lastEnd = fold.end.column;\n }\n callback(null, endRow, endColumn, lastEnd, isNewRow);\n };\n this.getNextFoldTo = function (row, column) {\n var fold, cmp;\n for (var i = 0; i < this.folds.length; i++) {\n fold = this.folds[i];\n cmp = fold.range.compareEnd(row, column);\n if (cmp == -1) {\n return {\n fold: fold,\n kind: \"after\"\n };\n }\n else if (cmp === 0) {\n return {\n fold: fold,\n kind: \"inside\"\n };\n }\n }\n return null;\n };\n this.addRemoveChars = function (row, column, len) {\n var ret = this.getNextFoldTo(row, column), fold, folds;\n if (ret) {\n fold = ret.fold;\n if (ret.kind == \"inside\"\n && fold.start.column != column\n && fold.start.row != row) {\n window.console && window.console.log(row, column, fold);\n }\n else if (fold.start.row == row) {\n folds = this.folds;\n var i = folds.indexOf(fold);\n if (i === 0) {\n this.start.column += len;\n }\n for (i; i < folds.length; i++) {\n fold = folds[i];\n fold.start.column += len;\n if (!fold.sameRow) {\n return;\n }\n fold.end.column += len;\n }\n this.end.column += len;\n }\n }\n };\n this.split = function (row, column) {\n var pos = this.getNextFoldTo(row, column);\n if (!pos || pos.kind == \"inside\")\n return null;\n var fold = pos.fold;\n var folds = this.folds;\n var foldData = this.foldData;\n var i = folds.indexOf(fold);\n var foldBefore = folds[i - 1];\n this.end.row = foldBefore.end.row;\n this.end.column = foldBefore.end.column;\n folds = folds.splice(i, folds.length - i);\n var newFoldLine = new FoldLine(foldData, folds);\n foldData.splice(foldData.indexOf(this) + 1, 0, newFoldLine);\n return newFoldLine;\n };\n this.merge = function (foldLineNext) {\n var folds = foldLineNext.folds;\n for (var i = 0; i < folds.length; i++) {\n this.addFold(folds[i]);\n }\n var foldData = this.foldData;\n foldData.splice(foldData.indexOf(foldLineNext), 1);\n };\n this.toString = function () {\n var ret = [this.range.toString() + \": [\"];\n this.folds.forEach(function (fold) {\n ret.push(\" \" + fold.toString());\n });\n ret.push(\"]\");\n return ret.join(\"\\n\");\n };\n this.idxToPosition = function (idx) {\n var lastFoldEndColumn = 0;\n for (var i = 0; i < this.folds.length; i++) {\n var fold = this.folds[i];\n idx -= fold.start.column - lastFoldEndColumn;\n if (idx < 0) {\n return {\n row: fold.start.row,\n column: fold.start.column + idx\n };\n }\n idx -= fold.placeholder.length;\n if (idx < 0) {\n return fold.start;\n }\n lastFoldEndColumn = fold.end.column;\n }\n return {\n row: this.end.row,\n column: this.end.column + idx\n };\n };\n}).call(FoldLine.prototype);\nexports.FoldLine = FoldLine;\n\n});\n\nace.define(\"ace/range_list\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"./range\").Range;\nvar comparePoints = Range.comparePoints;\nvar RangeList = function () {\n this.ranges = [];\n this.$bias = 1;\n};\n(function () {\n this.comparePoints = comparePoints;\n this.pointIndex = function (pos, excludeEdges, startIndex) {\n var list = this.ranges;\n for (var i = startIndex || 0; i < list.length; i++) {\n var range = list[i];\n var cmpEnd = comparePoints(pos, range.end);\n if (cmpEnd > 0)\n continue;\n var cmpStart = comparePoints(pos, range.start);\n if (cmpEnd === 0)\n return excludeEdges && cmpStart !== 0 ? -i - 2 : i;\n if (cmpStart > 0 || (cmpStart === 0 && !excludeEdges))\n return i;\n return -i - 1;\n }\n return -i - 1;\n };\n this.add = function (range) {\n var excludeEdges = !range.isEmpty();\n var startIndex = this.pointIndex(range.start, excludeEdges);\n if (startIndex < 0)\n startIndex = -startIndex - 1;\n var endIndex = this.pointIndex(range.end, excludeEdges, startIndex);\n if (endIndex < 0)\n endIndex = -endIndex - 1;\n else\n endIndex++;\n return this.ranges.splice(startIndex, endIndex - startIndex, range);\n };\n this.addList = function (list) {\n var removed = [];\n for (var i = list.length; i--;) {\n removed.push.apply(removed, this.add(list[i]));\n }\n return removed;\n };\n this.substractPoint = function (pos) {\n var i = this.pointIndex(pos);\n if (i >= 0)\n return this.ranges.splice(i, 1);\n };\n this.merge = function () {\n var removed = [];\n var list = this.ranges;\n list = list.sort(function (a, b) {\n return comparePoints(a.start, b.start);\n });\n var next = list[0], range;\n for (var i = 1; i < list.length; i++) {\n range = next;\n next = list[i];\n var cmp = comparePoints(range.end, next.start);\n if (cmp < 0)\n continue;\n if (cmp == 0 && !range.isEmpty() && !next.isEmpty())\n continue;\n if (comparePoints(range.end, next.end) < 0) {\n range.end.row = next.end.row;\n range.end.column = next.end.column;\n }\n list.splice(i, 1);\n removed.push(next);\n next = range;\n i--;\n }\n this.ranges = list;\n return removed;\n };\n this.contains = function (row, column) {\n return this.pointIndex({ row: row, column: column }) >= 0;\n };\n this.containsPoint = function (pos) {\n return this.pointIndex(pos) >= 0;\n };\n this.rangeAtPoint = function (pos) {\n var i = this.pointIndex(pos);\n if (i >= 0)\n return this.ranges[i];\n };\n this.clipRows = function (startRow, endRow) {\n var list = this.ranges;\n if (list[0].start.row > endRow || list[list.length - 1].start.row < startRow)\n return [];\n var startIndex = this.pointIndex({ row: startRow, column: 0 });\n if (startIndex < 0)\n startIndex = -startIndex - 1;\n var endIndex = this.pointIndex({ row: endRow, column: 0 }, startIndex);\n if (endIndex < 0)\n endIndex = -endIndex - 1;\n var clipped = [];\n for (var i = startIndex; i < endIndex; i++) {\n clipped.push(list[i]);\n }\n return clipped;\n };\n this.removeAll = function () {\n return this.ranges.splice(0, this.ranges.length);\n };\n this.attach = function (session) {\n if (this.session)\n this.detach();\n this.session = session;\n this.onChange = this.$onChange.bind(this);\n this.session.on('change', this.onChange);\n };\n this.detach = function () {\n if (!this.session)\n return;\n this.session.removeListener('change', this.onChange);\n this.session = null;\n };\n this.$onChange = function (delta) {\n var start = delta.start;\n var end = delta.end;\n var startRow = start.row;\n var endRow = end.row;\n var ranges = this.ranges;\n for (var i = 0, n = ranges.length; i < n; i++) {\n var r = ranges[i];\n if (r.end.row >= startRow)\n break;\n }\n if (delta.action == \"insert\") {\n var lineDif = endRow - startRow;\n var colDiff = -start.column + end.column;\n for (; i < n; i++) {\n var r = ranges[i];\n if (r.start.row > startRow)\n break;\n if (r.start.row == startRow && r.start.column >= start.column) {\n if (r.start.column == start.column && this.$bias <= 0) {\n }\n else {\n r.start.column += colDiff;\n r.start.row += lineDif;\n }\n }\n if (r.end.row == startRow && r.end.column >= start.column) {\n if (r.end.column == start.column && this.$bias < 0) {\n continue;\n }\n if (r.end.column == start.column && colDiff > 0 && i < n - 1) {\n if (r.end.column > r.start.column && r.end.column == ranges[i + 1].start.column)\n r.end.column -= colDiff;\n }\n r.end.column += colDiff;\n r.end.row += lineDif;\n }\n }\n }\n else {\n var lineDif = startRow - endRow;\n var colDiff = start.column - end.column;\n for (; i < n; i++) {\n var r = ranges[i];\n if (r.start.row > endRow)\n break;\n if (r.end.row < endRow\n && (startRow < r.end.row\n || startRow == r.end.row && start.column < r.end.column)) {\n r.end.row = startRow;\n r.end.column = start.column;\n }\n else if (r.end.row == endRow) {\n if (r.end.column <= end.column) {\n if (lineDif || r.end.column > start.column) {\n r.end.column = start.column;\n r.end.row = start.row;\n }\n }\n else {\n r.end.column += colDiff;\n r.end.row += lineDif;\n }\n }\n else if (r.end.row > endRow) {\n r.end.row += lineDif;\n }\n if (r.start.row < endRow\n && (startRow < r.start.row\n || startRow == r.start.row && start.column < r.start.column)) {\n r.start.row = startRow;\n r.start.column = start.column;\n }\n else if (r.start.row == endRow) {\n if (r.start.column <= end.column) {\n if (lineDif || r.start.column > start.column) {\n r.start.column = start.column;\n r.start.row = start.row;\n }\n }\n else {\n r.start.column += colDiff;\n r.start.row += lineDif;\n }\n }\n else if (r.start.row > endRow) {\n r.start.row += lineDif;\n }\n }\n }\n if (lineDif != 0 && i < n) {\n for (; i < n; i++) {\n var r = ranges[i];\n r.start.row += lineDif;\n r.end.row += lineDif;\n }\n }\n };\n}).call(RangeList.prototype);\nexports.RangeList = RangeList;\n\n});\n\nace.define(\"ace/edit_session/fold\",[\"require\",\"exports\",\"module\",\"ace/range_list\",\"ace/lib/oop\"], function(require, exports, module){\"use strict\";\nvar RangeList = require(\"../range_list\").RangeList;\nvar oop = require(\"../lib/oop\");\nvar Fold = exports.Fold = function (range, placeholder) {\n this.foldLine = null;\n this.placeholder = placeholder;\n this.range = range;\n this.start = range.start;\n this.end = range.end;\n this.sameRow = range.start.row == range.end.row;\n this.subFolds = this.ranges = [];\n};\noop.inherits(Fold, RangeList);\n(function () {\n this.toString = function () {\n return '\"' + this.placeholder + '\" ' + this.range.toString();\n };\n this.setFoldLine = function (foldLine) {\n this.foldLine = foldLine;\n this.subFolds.forEach(function (fold) {\n fold.setFoldLine(foldLine);\n });\n };\n this.clone = function () {\n var range = this.range.clone();\n var fold = new Fold(range, this.placeholder);\n this.subFolds.forEach(function (subFold) {\n fold.subFolds.push(subFold.clone());\n });\n fold.collapseChildren = this.collapseChildren;\n return fold;\n };\n this.addSubFold = function (fold) {\n if (this.range.isEqual(fold))\n return;\n consumeRange(fold, this.start);\n var row = fold.start.row, column = fold.start.column;\n for (var i = 0, cmp = -1; i < this.subFolds.length; i++) {\n cmp = this.subFolds[i].range.compare(row, column);\n if (cmp != 1)\n break;\n }\n var afterStart = this.subFolds[i];\n var firstConsumed = 0;\n if (cmp == 0) {\n if (afterStart.range.containsRange(fold))\n return afterStart.addSubFold(fold);\n else\n firstConsumed = 1;\n }\n var row = fold.range.end.row, column = fold.range.end.column;\n for (var j = i, cmp = -1; j < this.subFolds.length; j++) {\n cmp = this.subFolds[j].range.compare(row, column);\n if (cmp != 1)\n break;\n }\n if (cmp == 0)\n j++;\n var consumedFolds = this.subFolds.splice(i, j - i, fold);\n var last = cmp == 0 ? consumedFolds.length - 1 : consumedFolds.length;\n for (var k = firstConsumed; k < last; k++) {\n fold.addSubFold(consumedFolds[k]);\n }\n fold.setFoldLine(this.foldLine);\n return fold;\n };\n this.restoreRange = function (range) {\n return restoreRange(range, this.start);\n };\n}).call(Fold.prototype);\nfunction consumePoint(point, anchor) {\n point.row -= anchor.row;\n if (point.row == 0)\n point.column -= anchor.column;\n}\nfunction consumeRange(range, anchor) {\n consumePoint(range.start, anchor);\n consumePoint(range.end, anchor);\n}\nfunction restorePoint(point, anchor) {\n if (point.row == 0)\n point.column += anchor.column;\n point.row += anchor.row;\n}\nfunction restoreRange(range, anchor) {\n restorePoint(range.start, anchor);\n restorePoint(range.end, anchor);\n}\n\n});\n\nace.define(\"ace/edit_session/folding\",[\"require\",\"exports\",\"module\",\"ace/range\",\"ace/edit_session/fold_line\",\"ace/edit_session/fold\",\"ace/token_iterator\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"../range\").Range;\nvar FoldLine = require(\"./fold_line\").FoldLine;\nvar Fold = require(\"./fold\").Fold;\nvar TokenIterator = require(\"../token_iterator\").TokenIterator;\nfunction Folding() {\n this.getFoldAt = function (row, column, side) {\n var foldLine = this.getFoldLine(row);\n if (!foldLine)\n return null;\n var folds = foldLine.folds;\n for (var i = 0; i < folds.length; i++) {\n var range = folds[i].range;\n if (range.contains(row, column)) {\n if (side == 1 && range.isEnd(row, column) && !range.isEmpty()) {\n continue;\n }\n else if (side == -1 && range.isStart(row, column) && !range.isEmpty()) {\n continue;\n }\n return folds[i];\n }\n }\n };\n this.getFoldsInRange = function (range) {\n var start = range.start;\n var end = range.end;\n var foldLines = this.$foldData;\n var foundFolds = [];\n start.column += 1;\n end.column -= 1;\n for (var i = 0; i < foldLines.length; i++) {\n var cmp = foldLines[i].range.compareRange(range);\n if (cmp == 2) {\n continue;\n }\n else if (cmp == -2) {\n break;\n }\n var folds = foldLines[i].folds;\n for (var j = 0; j < folds.length; j++) {\n var fold = folds[j];\n cmp = fold.range.compareRange(range);\n if (cmp == -2) {\n break;\n }\n else if (cmp == 2) {\n continue;\n }\n else \n if (cmp == 42) {\n break;\n }\n foundFolds.push(fold);\n }\n }\n start.column -= 1;\n end.column += 1;\n return foundFolds;\n };\n this.getFoldsInRangeList = function (ranges) {\n if (Array.isArray(ranges)) {\n var folds = [];\n ranges.forEach(function (range) {\n folds = folds.concat(this.getFoldsInRange(range));\n }, this);\n }\n else {\n var folds = this.getFoldsInRange(ranges);\n }\n return folds;\n };\n this.getAllFolds = function () {\n var folds = [];\n var foldLines = this.$foldData;\n for (var i = 0; i < foldLines.length; i++)\n for (var j = 0; j < foldLines[i].folds.length; j++)\n folds.push(foldLines[i].folds[j]);\n return folds;\n };\n this.getFoldStringAt = function (row, column, trim, foldLine) {\n foldLine = foldLine || this.getFoldLine(row);\n if (!foldLine)\n return null;\n var lastFold = {\n end: { column: 0 }\n };\n var str, fold;\n for (var i = 0; i < foldLine.folds.length; i++) {\n fold = foldLine.folds[i];\n var cmp = fold.range.compareEnd(row, column);\n if (cmp == -1) {\n str = this\n .getLine(fold.start.row)\n .substring(lastFold.end.column, fold.start.column);\n break;\n }\n else if (cmp === 0) {\n return null;\n }\n lastFold = fold;\n }\n if (!str)\n str = this.getLine(fold.start.row).substring(lastFold.end.column);\n if (trim == -1)\n return str.substring(0, column - lastFold.end.column);\n else if (trim == 1)\n return str.substring(column - lastFold.end.column);\n else\n return str;\n };\n this.getFoldLine = function (docRow, startFoldLine) {\n var foldData = this.$foldData;\n var i = 0;\n if (startFoldLine)\n i = foldData.indexOf(startFoldLine);\n if (i == -1)\n i = 0;\n for (i; i < foldData.length; i++) {\n var foldLine = foldData[i];\n if (foldLine.start.row <= docRow && foldLine.end.row >= docRow) {\n return foldLine;\n }\n else if (foldLine.end.row > docRow) {\n return null;\n }\n }\n return null;\n };\n this.getNextFoldLine = function (docRow, startFoldLine) {\n var foldData = this.$foldData;\n var i = 0;\n if (startFoldLine)\n i = foldData.indexOf(startFoldLine);\n if (i == -1)\n i = 0;\n for (i; i < foldData.length; i++) {\n var foldLine = foldData[i];\n if (foldLine.end.row >= docRow) {\n return foldLine;\n }\n }\n return null;\n };\n this.getFoldedRowCount = function (first, last) {\n var foldData = this.$foldData, rowCount = last - first + 1;\n for (var i = 0; i < foldData.length; i++) {\n var foldLine = foldData[i], end = foldLine.end.row, start = foldLine.start.row;\n if (end >= last) {\n if (start < last) {\n if (start >= first)\n rowCount -= last - start;\n else\n rowCount = 0; // in one fold\n }\n break;\n }\n else if (end >= first) {\n if (start >= first) // fold inside range\n rowCount -= end - start;\n else\n rowCount -= end - first + 1;\n }\n }\n return rowCount;\n };\n this.$addFoldLine = function (foldLine) {\n this.$foldData.push(foldLine);\n this.$foldData.sort(function (a, b) {\n return a.start.row - b.start.row;\n });\n return foldLine;\n };\n this.addFold = function (placeholder, range) {\n var foldData = this.$foldData;\n var added = false;\n var fold;\n if (placeholder instanceof Fold)\n fold = placeholder;\n else {\n fold = new Fold(range, placeholder);\n fold.collapseChildren = range.collapseChildren;\n }\n this.$clipRangeToDocument(fold.range);\n var startRow = fold.start.row;\n var startColumn = fold.start.column;\n var endRow = fold.end.row;\n var endColumn = fold.end.column;\n var startFold = this.getFoldAt(startRow, startColumn, 1);\n var endFold = this.getFoldAt(endRow, endColumn, -1);\n if (startFold && endFold == startFold)\n return startFold.addSubFold(fold);\n if (startFold && !startFold.range.isStart(startRow, startColumn))\n this.removeFold(startFold);\n if (endFold && !endFold.range.isEnd(endRow, endColumn))\n this.removeFold(endFold);\n var folds = this.getFoldsInRange(fold.range);\n if (folds.length > 0) {\n this.removeFolds(folds);\n if (!fold.collapseChildren) {\n folds.forEach(function (subFold) {\n fold.addSubFold(subFold);\n });\n }\n }\n for (var i = 0; i < foldData.length; i++) {\n var foldLine = foldData[i];\n if (endRow == foldLine.start.row) {\n foldLine.addFold(fold);\n added = true;\n break;\n }\n else if (startRow == foldLine.end.row) {\n foldLine.addFold(fold);\n added = true;\n if (!fold.sameRow) {\n var foldLineNext = foldData[i + 1];\n if (foldLineNext && foldLineNext.start.row == endRow) {\n foldLine.merge(foldLineNext);\n break;\n }\n }\n break;\n }\n else if (endRow <= foldLine.start.row) {\n break;\n }\n }\n if (!added)\n foldLine = this.$addFoldLine(new FoldLine(this.$foldData, fold));\n if (this.$useWrapMode)\n this.$updateWrapData(foldLine.start.row, foldLine.start.row);\n else\n this.$updateRowLengthCache(foldLine.start.row, foldLine.start.row);\n this.$modified = true;\n this._signal(\"changeFold\", { data: fold, action: \"add\" });\n return fold;\n };\n this.addFolds = function (folds) {\n folds.forEach(function (fold) {\n this.addFold(fold);\n }, this);\n };\n this.removeFold = function (fold) {\n var foldLine = fold.foldLine;\n var startRow = foldLine.start.row;\n var endRow = foldLine.end.row;\n var foldLines = this.$foldData;\n var folds = foldLine.folds;\n if (folds.length == 1) {\n foldLines.splice(foldLines.indexOf(foldLine), 1);\n }\n else \n if (foldLine.range.isEnd(fold.end.row, fold.end.column)) {\n folds.pop();\n foldLine.end.row = folds[folds.length - 1].end.row;\n foldLine.end.column = folds[folds.length - 1].end.column;\n }\n else \n if (foldLine.range.isStart(fold.start.row, fold.start.column)) {\n folds.shift();\n foldLine.start.row = folds[0].start.row;\n foldLine.start.column = folds[0].start.column;\n }\n else \n if (fold.sameRow) {\n folds.splice(folds.indexOf(fold), 1);\n }\n else \n {\n var newFoldLine = foldLine.split(fold.start.row, fold.start.column);\n folds = newFoldLine.folds;\n folds.shift();\n newFoldLine.start.row = folds[0].start.row;\n newFoldLine.start.column = folds[0].start.column;\n }\n if (!this.$updating) {\n if (this.$useWrapMode)\n this.$updateWrapData(startRow, endRow);\n else\n this.$updateRowLengthCache(startRow, endRow);\n }\n this.$modified = true;\n this._signal(\"changeFold\", { data: fold, action: \"remove\" });\n };\n this.removeFolds = function (folds) {\n var cloneFolds = [];\n for (var i = 0; i < folds.length; i++) {\n cloneFolds.push(folds[i]);\n }\n cloneFolds.forEach(function (fold) {\n this.removeFold(fold);\n }, this);\n this.$modified = true;\n };\n this.expandFold = function (fold) {\n this.removeFold(fold);\n fold.subFolds.forEach(function (subFold) {\n fold.restoreRange(subFold);\n this.addFold(subFold);\n }, this);\n if (fold.collapseChildren > 0) {\n this.foldAll(fold.start.row + 1, fold.end.row, fold.collapseChildren - 1);\n }\n fold.subFolds = [];\n };\n this.expandFolds = function (folds) {\n folds.forEach(function (fold) {\n this.expandFold(fold);\n }, this);\n };\n this.unfold = function (location, expandInner) {\n var range, folds;\n if (location == null) {\n range = new Range(0, 0, this.getLength(), 0);\n if (expandInner == null)\n expandInner = true;\n }\n else if (typeof location == \"number\") {\n range = new Range(location, 0, location, this.getLine(location).length);\n }\n else if (\"row\" in location) {\n range = Range.fromPoints(location, location);\n }\n else if (Array.isArray(location)) {\n folds = [];\n location.forEach(function (range) {\n folds = folds.concat(this.unfold(range));\n }, this);\n return folds;\n }\n else {\n range = location;\n }\n folds = this.getFoldsInRangeList(range);\n var outermostFolds = folds;\n while (folds.length == 1\n && Range.comparePoints(folds[0].start, range.start) < 0\n && Range.comparePoints(folds[0].end, range.end) > 0) {\n this.expandFolds(folds);\n folds = this.getFoldsInRangeList(range);\n }\n if (expandInner != false) {\n this.removeFolds(folds);\n }\n else {\n this.expandFolds(folds);\n }\n if (outermostFolds.length)\n return outermostFolds;\n };\n this.isRowFolded = function (docRow, startFoldRow) {\n return !!this.getFoldLine(docRow, startFoldRow);\n };\n this.getRowFoldEnd = function (docRow, startFoldRow) {\n var foldLine = this.getFoldLine(docRow, startFoldRow);\n return foldLine ? foldLine.end.row : docRow;\n };\n this.getRowFoldStart = function (docRow, startFoldRow) {\n var foldLine = this.getFoldLine(docRow, startFoldRow);\n return foldLine ? foldLine.start.row : docRow;\n };\n this.getFoldDisplayLine = function (foldLine, endRow, endColumn, startRow, startColumn) {\n if (startRow == null)\n startRow = foldLine.start.row;\n if (startColumn == null)\n startColumn = 0;\n if (endRow == null)\n endRow = foldLine.end.row;\n if (endColumn == null)\n endColumn = this.getLine(endRow).length;\n var doc = this.doc;\n var textLine = \"\";\n foldLine.walk(function (placeholder, row, column, lastColumn) {\n if (row < startRow)\n return;\n if (row == startRow) {\n if (column < startColumn)\n return;\n lastColumn = Math.max(startColumn, lastColumn);\n }\n if (placeholder != null) {\n textLine += placeholder;\n }\n else {\n textLine += doc.getLine(row).substring(lastColumn, column);\n }\n }, endRow, endColumn);\n return textLine;\n };\n this.getDisplayLine = function (row, endColumn, startRow, startColumn) {\n var foldLine = this.getFoldLine(row);\n if (!foldLine) {\n var line;\n line = this.doc.getLine(row);\n return line.substring(startColumn || 0, endColumn || line.length);\n }\n else {\n return this.getFoldDisplayLine(foldLine, row, endColumn, startRow, startColumn);\n }\n };\n this.$cloneFoldData = function () {\n var fd = [];\n fd = this.$foldData.map(function (foldLine) {\n var folds = foldLine.folds.map(function (fold) {\n return fold.clone();\n });\n return new FoldLine(fd, folds);\n });\n return fd;\n };\n this.toggleFold = function (tryToUnfold) {\n var selection = this.selection;\n var range = selection.getRange();\n var fold;\n var bracketPos;\n if (range.isEmpty()) {\n var cursor = range.start;\n fold = this.getFoldAt(cursor.row, cursor.column);\n if (fold) {\n this.expandFold(fold);\n return;\n }\n else if (bracketPos = this.findMatchingBracket(cursor)) {\n if (range.comparePoint(bracketPos) == 1) {\n range.end = bracketPos;\n }\n else {\n range.start = bracketPos;\n range.start.column++;\n range.end.column--;\n }\n }\n else if (bracketPos = this.findMatchingBracket({ row: cursor.row, column: cursor.column + 1 })) {\n if (range.comparePoint(bracketPos) == 1)\n range.end = bracketPos;\n else\n range.start = bracketPos;\n range.start.column++;\n }\n else {\n range = this.getCommentFoldRange(cursor.row, cursor.column) || range;\n }\n }\n else {\n var folds = this.getFoldsInRange(range);\n if (tryToUnfold && folds.length) {\n this.expandFolds(folds);\n return;\n }\n else if (folds.length == 1) {\n fold = folds[0];\n }\n }\n if (!fold)\n fold = this.getFoldAt(range.start.row, range.start.column);\n if (fold && fold.range.toString() == range.toString()) {\n this.expandFold(fold);\n return;\n }\n var placeholder = \"...\";\n if (!range.isMultiLine()) {\n placeholder = this.getTextRange(range);\n if (placeholder.length < 4)\n return;\n placeholder = placeholder.trim().substring(0, 2) + \"..\";\n }\n this.addFold(placeholder, range);\n };\n this.getCommentFoldRange = function (row, column, dir) {\n var iterator = new TokenIterator(this, row, column);\n var token = iterator.getCurrentToken();\n var type = token && token.type;\n if (token && /^comment|string/.test(type)) {\n type = type.match(/comment|string/)[0];\n if (type == \"comment\")\n type += \"|doc-start\";\n var re = new RegExp(type);\n var range = new Range();\n if (dir != 1) {\n do {\n token = iterator.stepBackward();\n } while (token && re.test(token.type) && !/^comment.end/.test(token.type));\n token = iterator.stepForward();\n }\n range.start.row = iterator.getCurrentTokenRow();\n range.start.column = iterator.getCurrentTokenColumn() + (/^comment.start/.test(token.type) ? token.value.length : 2);\n iterator = new TokenIterator(this, row, column);\n if (dir != -1) {\n var lastRow = -1;\n do {\n token = iterator.stepForward();\n if (lastRow == -1) {\n var state = this.getState(iterator.$row);\n if (!re.test(state))\n lastRow = iterator.$row;\n }\n else if (iterator.$row > lastRow) {\n break;\n }\n } while (token && re.test(token.type) && !/^comment.start/.test(token.type));\n token = iterator.stepBackward();\n }\n else\n token = iterator.getCurrentToken();\n range.end.row = iterator.getCurrentTokenRow();\n range.end.column = iterator.getCurrentTokenColumn();\n if (!/^comment.end/.test(token.type)) {\n range.end.column += token.value.length - 2;\n }\n return range;\n }\n };\n this.foldAll = function (startRow, endRow, depth, test) {\n if (depth == undefined)\n depth = 100000; // JSON.stringify doesn't hanle Infinity\n var foldWidgets = this.foldWidgets;\n if (!foldWidgets)\n return; // mode doesn't support folding\n endRow = endRow || this.getLength();\n startRow = startRow || 0;\n for (var row = startRow; row < endRow; row++) {\n if (foldWidgets[row] == null)\n foldWidgets[row] = this.getFoldWidget(row);\n if (foldWidgets[row] != \"start\")\n continue;\n if (test && !test(row))\n continue;\n var range = this.getFoldWidgetRange(row);\n if (range && range.isMultiLine()\n && range.end.row <= endRow\n && range.start.row >= startRow) {\n row = range.end.row;\n range.collapseChildren = depth;\n this.addFold(\"...\", range);\n }\n }\n };\n this.foldToLevel = function (level) {\n this.foldAll();\n while (level-- > 0)\n this.unfold(null, false);\n };\n this.foldAllComments = function () {\n var session = this;\n this.foldAll(null, null, null, function (row) {\n var tokens = session.getTokens(row);\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n if (token.type == \"text\" && /^\\s+$/.test(token.value))\n continue;\n if (/comment/.test(token.type))\n return true;\n return false;\n }\n });\n };\n this.$foldStyles = {\n \"manual\": 1,\n \"markbegin\": 1,\n \"markbeginend\": 1\n };\n this.$foldStyle = \"markbegin\";\n this.setFoldStyle = function (style) {\n if (!this.$foldStyles[style])\n throw new Error(\"invalid fold style: \" + style + \"[\" + Object.keys(this.$foldStyles).join(\", \") + \"]\");\n if (this.$foldStyle == style)\n return;\n this.$foldStyle = style;\n if (style == \"manual\")\n this.unfold();\n var mode = this.$foldMode;\n this.$setFolding(null);\n this.$setFolding(mode);\n };\n this.$setFolding = function (foldMode) {\n if (this.$foldMode == foldMode)\n return;\n this.$foldMode = foldMode;\n this.off('change', this.$updateFoldWidgets);\n this.off('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets);\n this._signal(\"changeAnnotation\");\n if (!foldMode || this.$foldStyle == \"manual\") {\n this.foldWidgets = null;\n return;\n }\n this.foldWidgets = [];\n this.getFoldWidget = foldMode.getFoldWidget.bind(foldMode, this, this.$foldStyle);\n this.getFoldWidgetRange = foldMode.getFoldWidgetRange.bind(foldMode, this, this.$foldStyle);\n this.$updateFoldWidgets = this.updateFoldWidgets.bind(this);\n this.$tokenizerUpdateFoldWidgets = this.tokenizerUpdateFoldWidgets.bind(this);\n this.on('change', this.$updateFoldWidgets);\n this.on('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets);\n };\n this.getParentFoldRangeData = function (row, ignoreCurrent) {\n var fw = this.foldWidgets;\n if (!fw || (ignoreCurrent && fw[row]))\n return {};\n var i = row - 1, firstRange;\n while (i >= 0) {\n var c = fw[i];\n if (c == null)\n c = fw[i] = this.getFoldWidget(i);\n if (c == \"start\") {\n var range = this.getFoldWidgetRange(i);\n if (!firstRange)\n firstRange = range;\n if (range && range.end.row >= row)\n break;\n }\n i--;\n }\n return {\n range: i !== -1 && range,\n firstRange: firstRange\n };\n };\n this.onFoldWidgetClick = function (row, e) {\n e = e.domEvent;\n var options = {\n children: e.shiftKey,\n all: e.ctrlKey || e.metaKey,\n siblings: e.altKey\n };\n var range = this.$toggleFoldWidget(row, options);\n if (!range) {\n var el = (e.target || e.srcElement);\n if (el && /ace_fold-widget/.test(el.className))\n el.className += \" ace_invalid\";\n }\n };\n this.$toggleFoldWidget = function (row, options) {\n if (!this.getFoldWidget)\n return;\n var type = this.getFoldWidget(row);\n var line = this.getLine(row);\n var dir = type === \"end\" ? -1 : 1;\n var fold = this.getFoldAt(row, dir === -1 ? 0 : line.length, dir);\n if (fold) {\n if (options.children || options.all)\n this.removeFold(fold);\n else\n this.expandFold(fold);\n return fold;\n }\n var range = this.getFoldWidgetRange(row, true);\n if (range && !range.isMultiLine()) {\n fold = this.getFoldAt(range.start.row, range.start.column, 1);\n if (fold && range.isEqual(fold.range)) {\n this.removeFold(fold);\n return fold;\n }\n }\n if (options.siblings) {\n var data = this.getParentFoldRangeData(row);\n if (data.range) {\n var startRow = data.range.start.row + 1;\n var endRow = data.range.end.row;\n }\n this.foldAll(startRow, endRow, options.all ? 10000 : 0);\n }\n else if (options.children) {\n endRow = range ? range.end.row : this.getLength();\n this.foldAll(row + 1, endRow, options.all ? 10000 : 0);\n }\n else if (range) {\n if (options.all)\n range.collapseChildren = 10000;\n this.addFold(\"...\", range);\n }\n return range;\n };\n this.toggleFoldWidget = function (toggleParent) {\n var row = this.selection.getCursor().row;\n row = this.getRowFoldStart(row);\n var range = this.$toggleFoldWidget(row, {});\n if (range)\n return;\n var data = this.getParentFoldRangeData(row, true);\n range = data.range || data.firstRange;\n if (range) {\n row = range.start.row;\n var fold = this.getFoldAt(row, this.getLine(row).length, 1);\n if (fold) {\n this.removeFold(fold);\n }\n else {\n this.addFold(\"...\", range);\n }\n }\n };\n this.updateFoldWidgets = function (delta) {\n var firstRow = delta.start.row;\n var len = delta.end.row - firstRow;\n if (len === 0) {\n this.foldWidgets[firstRow] = null;\n }\n else if (delta.action == 'remove') {\n this.foldWidgets.splice(firstRow, len + 1, null);\n }\n else {\n var args = Array(len + 1);\n args.unshift(firstRow, 1);\n this.foldWidgets.splice.apply(this.foldWidgets, args);\n }\n };\n this.tokenizerUpdateFoldWidgets = function (e) {\n var rows = e.data;\n if (rows.first != rows.last) {\n if (this.foldWidgets.length > rows.first)\n this.foldWidgets.splice(rows.first, this.foldWidgets.length);\n }\n };\n}\nexports.Folding = Folding;\n\n});\n\nace.define(\"ace/edit_session/bracket_match\",[\"require\",\"exports\",\"module\",\"ace/token_iterator\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar TokenIterator = require(\"../token_iterator\").TokenIterator;\nvar Range = require(\"../range\").Range;\nfunction BracketMatch() {\n this.findMatchingBracket = function (position, chr) {\n if (position.column == 0)\n return null;\n var charBeforeCursor = chr || this.getLine(position.row).charAt(position.column - 1);\n if (charBeforeCursor == \"\")\n return null;\n var match = charBeforeCursor.match(/([\\(\\[\\{])|([\\)\\]\\}])/);\n if (!match)\n return null;\n if (match[1])\n return this.$findClosingBracket(match[1], position);\n else\n return this.$findOpeningBracket(match[2], position);\n };\n this.getBracketRange = function (pos) {\n var line = this.getLine(pos.row);\n var before = true, range;\n var chr = line.charAt(pos.column - 1);\n var match = chr && chr.match(/([\\(\\[\\{])|([\\)\\]\\}])/);\n if (!match) {\n chr = line.charAt(pos.column);\n pos = { row: pos.row, column: pos.column + 1 };\n match = chr && chr.match(/([\\(\\[\\{])|([\\)\\]\\}])/);\n before = false;\n }\n if (!match)\n return null;\n if (match[1]) {\n var bracketPos = this.$findClosingBracket(match[1], pos);\n if (!bracketPos)\n return null;\n range = Range.fromPoints(pos, bracketPos);\n if (!before) {\n range.end.column++;\n range.start.column--;\n }\n range.cursor = range.end;\n }\n else {\n var bracketPos = this.$findOpeningBracket(match[2], pos);\n if (!bracketPos)\n return null;\n range = Range.fromPoints(bracketPos, pos);\n if (!before) {\n range.start.column++;\n range.end.column--;\n }\n range.cursor = range.start;\n }\n return range;\n };\n this.getMatchingBracketRanges = function (pos, isBackwards) {\n var line = this.getLine(pos.row);\n var bracketsRegExp = /([\\(\\[\\{])|([\\)\\]\\}])/;\n var chr = !isBackwards && line.charAt(pos.column - 1);\n var match = chr && chr.match(bracketsRegExp);\n if (!match) {\n chr = (isBackwards === undefined || isBackwards) && line.charAt(pos.column);\n pos = {\n row: pos.row,\n column: pos.column + 1\n };\n match = chr && chr.match(bracketsRegExp);\n }\n if (!match)\n return null;\n var startRange = new Range(pos.row, pos.column - 1, pos.row, pos.column);\n var bracketPos = match[1] ? this.$findClosingBracket(match[1], pos)\n : this.$findOpeningBracket(match[2], pos);\n if (!bracketPos)\n return [startRange];\n var endRange = new Range(bracketPos.row, bracketPos.column, bracketPos.row, bracketPos.column + 1);\n return [startRange, endRange];\n };\n this.$brackets = {\n \")\": \"(\",\n \"(\": \")\",\n \"]\": \"[\",\n \"[\": \"]\",\n \"{\": \"}\",\n \"}\": \"{\",\n \"<\": \">\",\n \">\": \"<\"\n };\n this.$findOpeningBracket = function (bracket, position, typeRe) {\n var openBracket = this.$brackets[bracket];\n var depth = 1;\n var iterator = new TokenIterator(this, position.row, position.column);\n var token = iterator.getCurrentToken();\n if (!token)\n token = iterator.stepForward();\n if (!token)\n return;\n if (!typeRe) {\n typeRe = new RegExp(\"(\\\\.?\" +\n token.type.replace(\".\", \"\\\\.\").replace(\"rparen\", \".paren\")\n .replace(/\\b(?:end)\\b/, \"(?:start|begin|end)\")\n + \")+\");\n }\n var valueIndex = position.column - iterator.getCurrentTokenColumn() - 2;\n var value = token.value;\n while (true) {\n while (valueIndex >= 0) {\n var chr = value.charAt(valueIndex);\n if (chr == openBracket) {\n depth -= 1;\n if (depth == 0) {\n return { row: iterator.getCurrentTokenRow(),\n column: valueIndex + iterator.getCurrentTokenColumn() };\n }\n }\n else if (chr == bracket) {\n depth += 1;\n }\n valueIndex -= 1;\n }\n do {\n token = iterator.stepBackward();\n } while (token && !typeRe.test(token.type));\n if (token == null)\n break;\n value = token.value;\n valueIndex = value.length - 1;\n }\n return null;\n };\n this.$findClosingBracket = function (bracket, position, typeRe) {\n var closingBracket = this.$brackets[bracket];\n var depth = 1;\n var iterator = new TokenIterator(this, position.row, position.column);\n var token = iterator.getCurrentToken();\n if (!token)\n token = iterator.stepForward();\n if (!token)\n return;\n if (!typeRe) {\n typeRe = new RegExp(\"(\\\\.?\" +\n token.type.replace(\".\", \"\\\\.\").replace(\"lparen\", \".paren\")\n .replace(/\\b(?:start|begin)\\b/, \"(?:start|begin|end)\")\n + \")+\");\n }\n var valueIndex = position.column - iterator.getCurrentTokenColumn();\n while (true) {\n var value = token.value;\n var valueLength = value.length;\n while (valueIndex < valueLength) {\n var chr = value.charAt(valueIndex);\n if (chr == closingBracket) {\n depth -= 1;\n if (depth == 0) {\n return { row: iterator.getCurrentTokenRow(),\n column: valueIndex + iterator.getCurrentTokenColumn() };\n }\n }\n else if (chr == bracket) {\n depth += 1;\n }\n valueIndex += 1;\n }\n do {\n token = iterator.stepForward();\n } while (token && !typeRe.test(token.type));\n if (token == null)\n break;\n valueIndex = 0;\n }\n return null;\n };\n this.getMatchingTags = function (pos) {\n var iterator = new TokenIterator(this, pos.row, pos.column);\n var token = this.$findTagName(iterator);\n if (!token)\n return;\n var prevToken = iterator.stepBackward();\n if (prevToken.value === '<') {\n return this.$findClosingTag(iterator, token);\n }\n else {\n return this.$findOpeningTag(iterator, token);\n }\n };\n this.$findTagName = function (iterator) {\n var token = iterator.getCurrentToken();\n var found = false;\n var backward = false;\n if (token && token.type.indexOf('tag-name') === -1) {\n do {\n if (backward)\n token = iterator.stepBackward();\n else\n token = iterator.stepForward();\n if (token) {\n if (token.value === \"/>\") {\n backward = true;\n }\n else if (token.type.indexOf('tag-name') !== -1) {\n found = true;\n }\n }\n } while (token && !found);\n }\n return token;\n };\n this.$findClosingTag = function (iterator, token) {\n var prevToken;\n var currentTag = token.value;\n var tag = token.value;\n var depth = 0;\n var openTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1);\n token = iterator.stepForward();\n var openTagName = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + token.value.length);\n var foundOpenTagEnd = false;\n do {\n prevToken = token;\n token = iterator.stepForward();\n if (token) {\n if (token.value === '>' && !foundOpenTagEnd) {\n var openTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for `>`\n foundOpenTagEnd = true;\n }\n if (token.type.indexOf('tag-name') !== -1) {\n currentTag = token.value;\n if (tag === currentTag) {\n if (prevToken.value === '<') {\n depth++;\n }\n else if (prevToken.value === '') {\n var closeTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for >\n }\n else {\n return;\n }\n }\n }\n }\n }\n else if (tag === currentTag && token.value === '/>') { // self-closing tag\n depth--;\n if (depth < 0) { //found self-closing tag end\n var closeTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 2);\n var closeTagName = closeTagStart;\n var closeTagEnd = closeTagName;\n var openTagEnd = new Range(openTagName.end.row, openTagName.end.column, openTagName.end.row, openTagName.end.column + 1);\n }\n }\n }\n } while (token && depth >= 0);\n if (openTagStart && openTagEnd && closeTagStart && closeTagEnd && openTagName && closeTagName) {\n return {\n openTag: new Range(openTagStart.start.row, openTagStart.start.column, openTagEnd.end.row, openTagEnd.end.column),\n closeTag: new Range(closeTagStart.start.row, closeTagStart.start.column, closeTagEnd.end.row, closeTagEnd.end.column),\n openTagName: openTagName,\n closeTagName: closeTagName\n };\n }\n };\n this.$findOpeningTag = function (iterator, token) {\n var prevToken = iterator.getCurrentToken();\n var tag = token.value;\n var depth = 0;\n var startRow = iterator.getCurrentTokenRow();\n var startColumn = iterator.getCurrentTokenColumn();\n var endColumn = startColumn + 2;\n var closeTagStart = new Range(startRow, startColumn, startRow, endColumn); //Range for \")\n return;\n var closeTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for >\n iterator.stepBackward();\n iterator.stepBackward();\n do {\n token = prevToken;\n startRow = iterator.getCurrentTokenRow();\n startColumn = iterator.getCurrentTokenColumn();\n endColumn = startColumn + token.value.length;\n prevToken = iterator.stepBackward();\n if (token) {\n if (token.type.indexOf('tag-name') !== -1) {\n if (tag === token.value) {\n if (prevToken.value === '<') {\n depth++;\n if (depth > 0) { //found opening tag\n var openTagName = new Range(startRow, startColumn, startRow, endColumn);\n var openTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for <\n do {\n token = iterator.stepForward();\n } while (token && token.value !== '>');\n var openTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for >\n }\n }\n else if (prevToken.value === '') { // self-closing tag\n var stepCount = 0;\n var tmpToken = prevToken;\n while (tmpToken) {\n if (tmpToken.type.indexOf('tag-name') !== -1 && tmpToken.value === tag) {\n depth--;\n break;\n }\n else if (tmpToken.value === '<') {\n break;\n }\n tmpToken = iterator.stepBackward();\n stepCount++;\n }\n for (var i = 0; i < stepCount; i++) {\n iterator.stepForward();\n }\n }\n }\n } while (prevToken && depth <= 0);\n if (openTagStart && openTagEnd && closeTagStart && closeTagEnd && openTagName && closeTagName) {\n return {\n openTag: new Range(openTagStart.start.row, openTagStart.start.column, openTagEnd.end.row, openTagEnd.end.column),\n closeTag: new Range(closeTagStart.start.row, closeTagStart.start.column, closeTagEnd.end.row, closeTagEnd.end.column),\n openTagName: openTagName,\n closeTagName: closeTagName\n };\n }\n };\n}\nexports.BracketMatch = BracketMatch;\n\n});\n\nace.define(\"ace/edit_session\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/lang\",\"ace/bidihandler\",\"ace/config\",\"ace/lib/event_emitter\",\"ace/selection\",\"ace/mode/text\",\"ace/range\",\"ace/document\",\"ace/background_tokenizer\",\"ace/search_highlight\",\"ace/edit_session/folding\",\"ace/edit_session/bracket_match\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar lang = require(\"./lib/lang\");\nvar BidiHandler = require(\"./bidihandler\").BidiHandler;\nvar config = require(\"./config\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar Selection = require(\"./selection\").Selection;\nvar TextMode = require(\"./mode/text\").Mode;\nvar Range = require(\"./range\").Range;\nvar Document = require(\"./document\").Document;\nvar BackgroundTokenizer = require(\"./background_tokenizer\").BackgroundTokenizer;\nvar SearchHighlight = require(\"./search_highlight\").SearchHighlight;\nvar EditSession = function (text, mode) {\n this.$breakpoints = [];\n this.$decorations = [];\n this.$frontMarkers = {};\n this.$backMarkers = {};\n this.$markerId = 1;\n this.$undoSelect = true;\n this.$foldData = [];\n this.id = \"session\" + (++EditSession.$uid);\n this.$foldData.toString = function () {\n return this.join(\"\\n\");\n };\n this.bgTokenizer = new BackgroundTokenizer((new TextMode()).getTokenizer(), this);\n var _self = this;\n this.bgTokenizer.on(\"update\", function (e) {\n _self._signal(\"tokenizerUpdate\", e);\n });\n this.on(\"changeFold\", this.onChangeFold.bind(this));\n this.$onChange = this.onChange.bind(this);\n if (typeof text != \"object\" || !text.getLine)\n text = new Document(text);\n this.setDocument(text);\n this.selection = new Selection(this);\n this.$bidiHandler = new BidiHandler(this);\n config.resetOptions(this);\n this.setMode(mode);\n config._signal(\"session\", this);\n this.destroyed = false;\n};\nEditSession.$uid = 0;\n(function () {\n oop.implement(this, EventEmitter);\n this.setDocument = function (doc) {\n if (this.doc)\n this.doc.off(\"change\", this.$onChange);\n this.doc = doc;\n doc.on(\"change\", this.$onChange, true);\n this.bgTokenizer.setDocument(this.getDocument());\n this.resetCaches();\n };\n this.getDocument = function () {\n return this.doc;\n };\n this.$resetRowCache = function (docRow) {\n if (!docRow) {\n this.$docRowCache = [];\n this.$screenRowCache = [];\n return;\n }\n var l = this.$docRowCache.length;\n var i = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1;\n if (l > i) {\n this.$docRowCache.splice(i, l);\n this.$screenRowCache.splice(i, l);\n }\n };\n this.$getRowCacheIndex = function (cacheArray, val) {\n var low = 0;\n var hi = cacheArray.length - 1;\n while (low <= hi) {\n var mid = (low + hi) >> 1;\n var c = cacheArray[mid];\n if (val > c)\n low = mid + 1;\n else if (val < c)\n hi = mid - 1;\n else\n return mid;\n }\n return low - 1;\n };\n this.resetCaches = function () {\n this.$modified = true;\n this.$wrapData = [];\n this.$rowLengthCache = [];\n this.$resetRowCache(0);\n if (!this.destroyed)\n this.bgTokenizer.start(0);\n };\n this.onChangeFold = function (e) {\n var fold = e.data;\n this.$resetRowCache(fold.start.row);\n };\n this.onChange = function (delta) {\n this.$modified = true;\n this.$bidiHandler.onChange(delta);\n this.$resetRowCache(delta.start.row);\n var removedFolds = this.$updateInternalDataOnChange(delta);\n if (!this.$fromUndo && this.$undoManager) {\n if (removedFolds && removedFolds.length) {\n this.$undoManager.add({\n action: \"removeFolds\",\n folds: removedFolds\n }, this.mergeUndoDeltas);\n this.mergeUndoDeltas = true;\n }\n this.$undoManager.add(delta, this.mergeUndoDeltas);\n this.mergeUndoDeltas = true;\n this.$informUndoManager.schedule();\n }\n this.bgTokenizer.$updateOnChange(delta);\n this._signal(\"change\", delta);\n };\n this.setValue = function (text) {\n this.doc.setValue(text);\n this.selection.moveTo(0, 0);\n this.$resetRowCache(0);\n this.setUndoManager(this.$undoManager);\n this.getUndoManager().reset();\n };\n this.getValue =\n this.toString = function () {\n return this.doc.getValue();\n };\n this.getSelection = function () {\n return this.selection;\n };\n this.getState = function (row) {\n return this.bgTokenizer.getState(row);\n };\n this.getTokens = function (row) {\n return this.bgTokenizer.getTokens(row);\n };\n this.getTokenAt = function (row, column) {\n var tokens = this.bgTokenizer.getTokens(row);\n var token, c = 0;\n if (column == null) {\n var i = tokens.length - 1;\n c = this.getLine(row).length;\n }\n else {\n for (var i = 0; i < tokens.length; i++) {\n c += tokens[i].value.length;\n if (c >= column)\n break;\n }\n }\n token = tokens[i];\n if (!token)\n return null;\n token.index = i;\n token.start = c - token.value.length;\n return token;\n };\n this.setUndoManager = function (undoManager) {\n this.$undoManager = undoManager;\n if (this.$informUndoManager)\n this.$informUndoManager.cancel();\n if (undoManager) {\n var self = this;\n undoManager.addSession(this);\n this.$syncInformUndoManager = function () {\n self.$informUndoManager.cancel();\n self.mergeUndoDeltas = false;\n };\n this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager);\n }\n else {\n this.$syncInformUndoManager = function () { };\n }\n };\n this.markUndoGroup = function () {\n if (this.$syncInformUndoManager)\n this.$syncInformUndoManager();\n };\n this.$defaultUndoManager = {\n undo: function () { },\n redo: function () { },\n hasUndo: function () { },\n hasRedo: function () { },\n reset: function () { },\n add: function () { },\n addSelection: function () { },\n startNewGroup: function () { },\n addSession: function () { }\n };\n this.getUndoManager = function () {\n return this.$undoManager || this.$defaultUndoManager;\n };\n this.getTabString = function () {\n if (this.getUseSoftTabs()) {\n return lang.stringRepeat(\" \", this.getTabSize());\n }\n else {\n return \"\\t\";\n }\n };\n this.setUseSoftTabs = function (val) {\n this.setOption(\"useSoftTabs\", val);\n };\n this.getUseSoftTabs = function () {\n return this.$useSoftTabs && !this.$mode.$indentWithTabs;\n };\n this.setTabSize = function (tabSize) {\n this.setOption(\"tabSize\", tabSize);\n };\n this.getTabSize = function () {\n return this.$tabSize;\n };\n this.isTabStop = function (position) {\n return this.$useSoftTabs && (position.column % this.$tabSize === 0);\n };\n this.setNavigateWithinSoftTabs = function (navigateWithinSoftTabs) {\n this.setOption(\"navigateWithinSoftTabs\", navigateWithinSoftTabs);\n };\n this.getNavigateWithinSoftTabs = function () {\n return this.$navigateWithinSoftTabs;\n };\n this.$overwrite = false;\n this.setOverwrite = function (overwrite) {\n this.setOption(\"overwrite\", overwrite);\n };\n this.getOverwrite = function () {\n return this.$overwrite;\n };\n this.toggleOverwrite = function () {\n this.setOverwrite(!this.$overwrite);\n };\n this.addGutterDecoration = function (row, className) {\n if (!this.$decorations[row])\n this.$decorations[row] = \"\";\n this.$decorations[row] += \" \" + className;\n this._signal(\"changeBreakpoint\", {});\n };\n this.removeGutterDecoration = function (row, className) {\n this.$decorations[row] = (this.$decorations[row] || \"\").replace(\" \" + className, \"\");\n this._signal(\"changeBreakpoint\", {});\n };\n this.getBreakpoints = function () {\n return this.$breakpoints;\n };\n this.setBreakpoints = function (rows) {\n this.$breakpoints = [];\n for (var i = 0; i < rows.length; i++) {\n this.$breakpoints[rows[i]] = \"ace_breakpoint\";\n }\n this._signal(\"changeBreakpoint\", {});\n };\n this.clearBreakpoints = function () {\n this.$breakpoints = [];\n this._signal(\"changeBreakpoint\", {});\n };\n this.setBreakpoint = function (row, className) {\n if (className === undefined)\n className = \"ace_breakpoint\";\n if (className)\n this.$breakpoints[row] = className;\n else\n delete this.$breakpoints[row];\n this._signal(\"changeBreakpoint\", {});\n };\n this.clearBreakpoint = function (row) {\n delete this.$breakpoints[row];\n this._signal(\"changeBreakpoint\", {});\n };\n this.addMarker = function (range, clazz, type, inFront) {\n var id = this.$markerId++;\n var marker = {\n range: range,\n type: type || \"line\",\n renderer: typeof type == \"function\" ? type : null,\n clazz: clazz,\n inFront: !!inFront,\n id: id\n };\n if (inFront) {\n this.$frontMarkers[id] = marker;\n this._signal(\"changeFrontMarker\");\n }\n else {\n this.$backMarkers[id] = marker;\n this._signal(\"changeBackMarker\");\n }\n return id;\n };\n this.addDynamicMarker = function (marker, inFront) {\n if (!marker.update)\n return;\n var id = this.$markerId++;\n marker.id = id;\n marker.inFront = !!inFront;\n if (inFront) {\n this.$frontMarkers[id] = marker;\n this._signal(\"changeFrontMarker\");\n }\n else {\n this.$backMarkers[id] = marker;\n this._signal(\"changeBackMarker\");\n }\n return marker;\n };\n this.removeMarker = function (markerId) {\n var marker = this.$frontMarkers[markerId] || this.$backMarkers[markerId];\n if (!marker)\n return;\n var markers = marker.inFront ? this.$frontMarkers : this.$backMarkers;\n delete (markers[markerId]);\n this._signal(marker.inFront ? \"changeFrontMarker\" : \"changeBackMarker\");\n };\n this.getMarkers = function (inFront) {\n return inFront ? this.$frontMarkers : this.$backMarkers;\n };\n this.highlight = function (re) {\n if (!this.$searchHighlight) {\n var highlight = new SearchHighlight(null, \"ace_selected-word\", \"text\");\n this.$searchHighlight = this.addDynamicMarker(highlight);\n }\n this.$searchHighlight.setRegexp(re);\n };\n this.highlightLines = function (startRow, endRow, clazz, inFront) {\n if (typeof endRow != \"number\") {\n clazz = endRow;\n endRow = startRow;\n }\n if (!clazz)\n clazz = \"ace_step\";\n var range = new Range(startRow, 0, endRow, Infinity);\n range.id = this.addMarker(range, clazz, \"fullLine\", inFront);\n return range;\n };\n this.setAnnotations = function (annotations) {\n this.$annotations = annotations;\n this._signal(\"changeAnnotation\", {});\n };\n this.getAnnotations = function () {\n return this.$annotations || [];\n };\n this.clearAnnotations = function () {\n this.setAnnotations([]);\n };\n this.$detectNewLine = function (text) {\n var match = text.match(/^.*?(\\r?\\n)/m);\n if (match) {\n this.$autoNewLine = match[1];\n }\n else {\n this.$autoNewLine = \"\\n\";\n }\n };\n this.getWordRange = function (row, column) {\n var line = this.getLine(row);\n var inToken = false;\n if (column > 0)\n inToken = !!line.charAt(column - 1).match(this.tokenRe);\n if (!inToken)\n inToken = !!line.charAt(column).match(this.tokenRe);\n if (inToken)\n var re = this.tokenRe;\n else if (/^\\s+$/.test(line.slice(column - 1, column + 1)))\n var re = /\\s/;\n else\n var re = this.nonTokenRe;\n var start = column;\n if (start > 0) {\n do {\n start--;\n } while (start >= 0 && line.charAt(start).match(re));\n start++;\n }\n var end = column;\n while (end < line.length && line.charAt(end).match(re)) {\n end++;\n }\n return new Range(row, start, row, end);\n };\n this.getAWordRange = function (row, column) {\n var wordRange = this.getWordRange(row, column);\n var line = this.getLine(wordRange.end.row);\n while (line.charAt(wordRange.end.column).match(/[ \\t]/)) {\n wordRange.end.column += 1;\n }\n return wordRange;\n };\n this.setNewLineMode = function (newLineMode) {\n this.doc.setNewLineMode(newLineMode);\n };\n this.getNewLineMode = function () {\n return this.doc.getNewLineMode();\n };\n this.setUseWorker = function (useWorker) { this.setOption(\"useWorker\", useWorker); };\n this.getUseWorker = function () { return this.$useWorker; };\n this.onReloadTokenizer = function (e) {\n var rows = e.data;\n this.bgTokenizer.start(rows.first);\n this._signal(\"tokenizerUpdate\", e);\n };\n this.$modes = config.$modes;\n this.$mode = null;\n this.$modeId = null;\n this.setMode = function (mode, cb) {\n if (mode && typeof mode === \"object\") {\n if (mode.getTokenizer)\n return this.$onChangeMode(mode);\n var options = mode;\n var path = options.path;\n }\n else {\n path = mode || \"ace/mode/text\";\n }\n if (!this.$modes[\"ace/mode/text\"])\n this.$modes[\"ace/mode/text\"] = new TextMode();\n if (this.$modes[path] && !options) {\n this.$onChangeMode(this.$modes[path]);\n cb && cb();\n return;\n }\n this.$modeId = path;\n config.loadModule([\"mode\", path], function (m) {\n if (this.$modeId !== path)\n return cb && cb();\n if (this.$modes[path] && !options) {\n this.$onChangeMode(this.$modes[path]);\n }\n else if (m && m.Mode) {\n m = new m.Mode(options);\n if (!options) {\n this.$modes[path] = m;\n m.$id = path;\n }\n this.$onChangeMode(m);\n }\n cb && cb();\n }.bind(this));\n if (!this.$mode)\n this.$onChangeMode(this.$modes[\"ace/mode/text\"], true);\n };\n this.$onChangeMode = function (mode, $isPlaceholder) {\n if (!$isPlaceholder)\n this.$modeId = mode.$id;\n if (this.$mode === mode)\n return;\n var oldMode = this.$mode;\n this.$mode = mode;\n this.$stopWorker();\n if (this.$useWorker)\n this.$startWorker();\n var tokenizer = mode.getTokenizer();\n if (tokenizer.on !== undefined) {\n var onReloadTokenizer = this.onReloadTokenizer.bind(this);\n tokenizer.on(\"update\", onReloadTokenizer);\n }\n this.bgTokenizer.setTokenizer(tokenizer);\n this.bgTokenizer.setDocument(this.getDocument());\n this.tokenRe = mode.tokenRe;\n this.nonTokenRe = mode.nonTokenRe;\n if (!$isPlaceholder) {\n if (mode.attachToSession)\n mode.attachToSession(this);\n this.$options.wrapMethod.set.call(this, this.$wrapMethod);\n this.$setFolding(mode.foldingRules);\n this.bgTokenizer.start(0);\n this._emit(\"changeMode\", { oldMode: oldMode, mode: mode });\n }\n };\n this.$stopWorker = function () {\n if (this.$worker) {\n this.$worker.terminate();\n this.$worker = null;\n }\n };\n this.$startWorker = function () {\n try {\n this.$worker = this.$mode.createWorker(this);\n }\n catch (e) {\n config.warn(\"Could not load worker\", e);\n this.$worker = null;\n }\n };\n this.getMode = function () {\n return this.$mode;\n };\n this.$scrollTop = 0;\n this.setScrollTop = function (scrollTop) {\n if (this.$scrollTop === scrollTop || isNaN(scrollTop))\n return;\n this.$scrollTop = scrollTop;\n this._signal(\"changeScrollTop\", scrollTop);\n };\n this.getScrollTop = function () {\n return this.$scrollTop;\n };\n this.$scrollLeft = 0;\n this.setScrollLeft = function (scrollLeft) {\n if (this.$scrollLeft === scrollLeft || isNaN(scrollLeft))\n return;\n this.$scrollLeft = scrollLeft;\n this._signal(\"changeScrollLeft\", scrollLeft);\n };\n this.getScrollLeft = function () {\n return this.$scrollLeft;\n };\n this.getScreenWidth = function () {\n this.$computeWidth();\n if (this.lineWidgets)\n return Math.max(this.getLineWidgetMaxWidth(), this.screenWidth);\n return this.screenWidth;\n };\n this.getLineWidgetMaxWidth = function () {\n if (this.lineWidgetsWidth != null)\n return this.lineWidgetsWidth;\n var width = 0;\n this.lineWidgets.forEach(function (w) {\n if (w && w.screenWidth > width)\n width = w.screenWidth;\n });\n return this.lineWidgetWidth = width;\n };\n this.$computeWidth = function (force) {\n if (this.$modified || force) {\n this.$modified = false;\n if (this.$useWrapMode)\n return this.screenWidth = this.$wrapLimit;\n var lines = this.doc.getAllLines();\n var cache = this.$rowLengthCache;\n var longestScreenLine = 0;\n var foldIndex = 0;\n var foldLine = this.$foldData[foldIndex];\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n var len = lines.length;\n for (var i = 0; i < len; i++) {\n if (i > foldStart) {\n i = foldLine.end.row + 1;\n if (i >= len)\n break;\n foldLine = this.$foldData[foldIndex++];\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n if (cache[i] == null)\n cache[i] = this.$getStringScreenWidth(lines[i])[0];\n if (cache[i] > longestScreenLine)\n longestScreenLine = cache[i];\n }\n this.screenWidth = longestScreenLine;\n }\n };\n this.getLine = function (row) {\n return this.doc.getLine(row);\n };\n this.getLines = function (firstRow, lastRow) {\n return this.doc.getLines(firstRow, lastRow);\n };\n this.getLength = function () {\n return this.doc.getLength();\n };\n this.getTextRange = function (range) {\n return this.doc.getTextRange(range || this.selection.getRange());\n };\n this.insert = function (position, text) {\n return this.doc.insert(position, text);\n };\n this.remove = function (range) {\n return this.doc.remove(range);\n };\n this.removeFullLines = function (firstRow, lastRow) {\n return this.doc.removeFullLines(firstRow, lastRow);\n };\n this.undoChanges = function (deltas, dontSelect) {\n if (!deltas.length)\n return;\n this.$fromUndo = true;\n for (var i = deltas.length - 1; i != -1; i--) {\n var delta = deltas[i];\n if (delta.action == \"insert\" || delta.action == \"remove\") {\n this.doc.revertDelta(delta);\n }\n else if (delta.folds) {\n this.addFolds(delta.folds);\n }\n }\n if (!dontSelect && this.$undoSelect) {\n if (deltas.selectionBefore)\n this.selection.fromJSON(deltas.selectionBefore);\n else\n this.selection.setRange(this.$getUndoSelection(deltas, true));\n }\n this.$fromUndo = false;\n };\n this.redoChanges = function (deltas, dontSelect) {\n if (!deltas.length)\n return;\n this.$fromUndo = true;\n for (var i = 0; i < deltas.length; i++) {\n var delta = deltas[i];\n if (delta.action == \"insert\" || delta.action == \"remove\") {\n this.doc.$safeApplyDelta(delta);\n }\n }\n if (!dontSelect && this.$undoSelect) {\n if (deltas.selectionAfter)\n this.selection.fromJSON(deltas.selectionAfter);\n else\n this.selection.setRange(this.$getUndoSelection(deltas, false));\n }\n this.$fromUndo = false;\n };\n this.setUndoSelect = function (enable) {\n this.$undoSelect = enable;\n };\n this.$getUndoSelection = function (deltas, isUndo) {\n function isInsert(delta) {\n return isUndo ? delta.action !== \"insert\" : delta.action === \"insert\";\n }\n var range, point;\n for (var i = 0; i < deltas.length; i++) {\n var delta = deltas[i];\n if (!delta.start)\n continue; // skip folds\n if (!range) {\n if (isInsert(delta)) {\n range = Range.fromPoints(delta.start, delta.end);\n }\n else {\n range = Range.fromPoints(delta.start, delta.start);\n }\n continue;\n }\n if (isInsert(delta)) {\n point = delta.start;\n if (range.compare(point.row, point.column) == -1) {\n range.setStart(point);\n }\n point = delta.end;\n if (range.compare(point.row, point.column) == 1) {\n range.setEnd(point);\n }\n }\n else {\n point = delta.start;\n if (range.compare(point.row, point.column) == -1) {\n range = Range.fromPoints(delta.start, delta.start);\n }\n }\n }\n return range;\n };\n this.replace = function (range, text) {\n return this.doc.replace(range, text);\n };\n this.moveText = function (fromRange, toPosition, copy) {\n var text = this.getTextRange(fromRange);\n var folds = this.getFoldsInRange(fromRange);\n var toRange = Range.fromPoints(toPosition, toPosition);\n if (!copy) {\n this.remove(fromRange);\n var rowDiff = fromRange.start.row - fromRange.end.row;\n var collDiff = rowDiff ? -fromRange.end.column : fromRange.start.column - fromRange.end.column;\n if (collDiff) {\n if (toRange.start.row == fromRange.end.row && toRange.start.column > fromRange.end.column)\n toRange.start.column += collDiff;\n if (toRange.end.row == fromRange.end.row && toRange.end.column > fromRange.end.column)\n toRange.end.column += collDiff;\n }\n if (rowDiff && toRange.start.row >= fromRange.end.row) {\n toRange.start.row += rowDiff;\n toRange.end.row += rowDiff;\n }\n }\n toRange.end = this.insert(toRange.start, text);\n if (folds.length) {\n var oldStart = fromRange.start;\n var newStart = toRange.start;\n var rowDiff = newStart.row - oldStart.row;\n var collDiff = newStart.column - oldStart.column;\n this.addFolds(folds.map(function (x) {\n x = x.clone();\n if (x.start.row == oldStart.row)\n x.start.column += collDiff;\n if (x.end.row == oldStart.row)\n x.end.column += collDiff;\n x.start.row += rowDiff;\n x.end.row += rowDiff;\n return x;\n }));\n }\n return toRange;\n };\n this.indentRows = function (startRow, endRow, indentString) {\n indentString = indentString.replace(/\\t/g, this.getTabString());\n for (var row = startRow; row <= endRow; row++)\n this.doc.insertInLine({ row: row, column: 0 }, indentString);\n };\n this.outdentRows = function (range) {\n var rowRange = range.collapseRows();\n var deleteRange = new Range(0, 0, 0, 0);\n var size = this.getTabSize();\n for (var i = rowRange.start.row; i <= rowRange.end.row; ++i) {\n var line = this.getLine(i);\n deleteRange.start.row = i;\n deleteRange.end.row = i;\n for (var j = 0; j < size; ++j)\n if (line.charAt(j) != ' ')\n break;\n if (j < size && line.charAt(j) == '\\t') {\n deleteRange.start.column = j;\n deleteRange.end.column = j + 1;\n }\n else {\n deleteRange.start.column = 0;\n deleteRange.end.column = j;\n }\n this.remove(deleteRange);\n }\n };\n this.$moveLines = function (firstRow, lastRow, dir) {\n firstRow = this.getRowFoldStart(firstRow);\n lastRow = this.getRowFoldEnd(lastRow);\n if (dir < 0) {\n var row = this.getRowFoldStart(firstRow + dir);\n if (row < 0)\n return 0;\n var diff = row - firstRow;\n }\n else if (dir > 0) {\n var row = this.getRowFoldEnd(lastRow + dir);\n if (row > this.doc.getLength() - 1)\n return 0;\n var diff = row - lastRow;\n }\n else {\n firstRow = this.$clipRowToDocument(firstRow);\n lastRow = this.$clipRowToDocument(lastRow);\n var diff = lastRow - firstRow + 1;\n }\n var range = new Range(firstRow, 0, lastRow, Number.MAX_VALUE);\n var folds = this.getFoldsInRange(range).map(function (x) {\n x = x.clone();\n x.start.row += diff;\n x.end.row += diff;\n return x;\n });\n var lines = dir == 0\n ? this.doc.getLines(firstRow, lastRow)\n : this.doc.removeFullLines(firstRow, lastRow);\n this.doc.insertFullLines(firstRow + diff, lines);\n folds.length && this.addFolds(folds);\n return diff;\n };\n this.moveLinesUp = function (firstRow, lastRow) {\n return this.$moveLines(firstRow, lastRow, -1);\n };\n this.moveLinesDown = function (firstRow, lastRow) {\n return this.$moveLines(firstRow, lastRow, 1);\n };\n this.duplicateLines = function (firstRow, lastRow) {\n return this.$moveLines(firstRow, lastRow, 0);\n };\n this.$clipRowToDocument = function (row) {\n return Math.max(0, Math.min(row, this.doc.getLength() - 1));\n };\n this.$clipColumnToRow = function (row, column) {\n if (column < 0)\n return 0;\n return Math.min(this.doc.getLine(row).length, column);\n };\n this.$clipPositionToDocument = function (row, column) {\n column = Math.max(0, column);\n if (row < 0) {\n row = 0;\n column = 0;\n }\n else {\n var len = this.doc.getLength();\n if (row >= len) {\n row = len - 1;\n column = this.doc.getLine(len - 1).length;\n }\n else {\n column = Math.min(this.doc.getLine(row).length, column);\n }\n }\n return {\n row: row,\n column: column\n };\n };\n this.$clipRangeToDocument = function (range) {\n if (range.start.row < 0) {\n range.start.row = 0;\n range.start.column = 0;\n }\n else {\n range.start.column = this.$clipColumnToRow(range.start.row, range.start.column);\n }\n var len = this.doc.getLength() - 1;\n if (range.end.row > len) {\n range.end.row = len;\n range.end.column = this.doc.getLine(len).length;\n }\n else {\n range.end.column = this.$clipColumnToRow(range.end.row, range.end.column);\n }\n return range;\n };\n this.$wrapLimit = 80;\n this.$useWrapMode = false;\n this.$wrapLimitRange = {\n min: null,\n max: null\n };\n this.setUseWrapMode = function (useWrapMode) {\n if (useWrapMode != this.$useWrapMode) {\n this.$useWrapMode = useWrapMode;\n this.$modified = true;\n this.$resetRowCache(0);\n if (useWrapMode) {\n var len = this.getLength();\n this.$wrapData = Array(len);\n this.$updateWrapData(0, len - 1);\n }\n this._signal(\"changeWrapMode\");\n }\n };\n this.getUseWrapMode = function () {\n return this.$useWrapMode;\n };\n this.setWrapLimitRange = function (min, max) {\n if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) {\n this.$wrapLimitRange = { min: min, max: max };\n this.$modified = true;\n this.$bidiHandler.markAsDirty();\n if (this.$useWrapMode)\n this._signal(\"changeWrapMode\");\n }\n };\n this.adjustWrapLimit = function (desiredLimit, $printMargin) {\n var limits = this.$wrapLimitRange;\n if (limits.max < 0)\n limits = { min: $printMargin, max: $printMargin };\n var wrapLimit = this.$constrainWrapLimit(desiredLimit, limits.min, limits.max);\n if (wrapLimit != this.$wrapLimit && wrapLimit > 1) {\n this.$wrapLimit = wrapLimit;\n this.$modified = true;\n if (this.$useWrapMode) {\n this.$updateWrapData(0, this.getLength() - 1);\n this.$resetRowCache(0);\n this._signal(\"changeWrapLimit\");\n }\n return true;\n }\n return false;\n };\n this.$constrainWrapLimit = function (wrapLimit, min, max) {\n if (min)\n wrapLimit = Math.max(min, wrapLimit);\n if (max)\n wrapLimit = Math.min(max, wrapLimit);\n return wrapLimit;\n };\n this.getWrapLimit = function () {\n return this.$wrapLimit;\n };\n this.setWrapLimit = function (limit) {\n this.setWrapLimitRange(limit, limit);\n };\n this.getWrapLimitRange = function () {\n return {\n min: this.$wrapLimitRange.min,\n max: this.$wrapLimitRange.max\n };\n };\n this.$updateInternalDataOnChange = function (delta) {\n var useWrapMode = this.$useWrapMode;\n var action = delta.action;\n var start = delta.start;\n var end = delta.end;\n var firstRow = start.row;\n var lastRow = end.row;\n var len = lastRow - firstRow;\n var removedFolds = null;\n this.$updating = true;\n if (len != 0) {\n if (action === \"remove\") {\n this[useWrapMode ? \"$wrapData\" : \"$rowLengthCache\"].splice(firstRow, len);\n var foldLines = this.$foldData;\n removedFolds = this.getFoldsInRange(delta);\n this.removeFolds(removedFolds);\n var foldLine = this.getFoldLine(end.row);\n var idx = 0;\n if (foldLine) {\n foldLine.addRemoveChars(end.row, end.column, start.column - end.column);\n foldLine.shiftRow(-len);\n var foldLineBefore = this.getFoldLine(firstRow);\n if (foldLineBefore && foldLineBefore !== foldLine) {\n foldLineBefore.merge(foldLine);\n foldLine = foldLineBefore;\n }\n idx = foldLines.indexOf(foldLine) + 1;\n }\n for (idx; idx < foldLines.length; idx++) {\n var foldLine = foldLines[idx];\n if (foldLine.start.row >= end.row) {\n foldLine.shiftRow(-len);\n }\n }\n lastRow = firstRow;\n }\n else {\n var args = Array(len);\n args.unshift(firstRow, 0);\n var arr = useWrapMode ? this.$wrapData : this.$rowLengthCache;\n arr.splice.apply(arr, args);\n var foldLines = this.$foldData;\n var foldLine = this.getFoldLine(firstRow);\n var idx = 0;\n if (foldLine) {\n var cmp = foldLine.range.compareInside(start.row, start.column);\n if (cmp == 0) {\n foldLine = foldLine.split(start.row, start.column);\n if (foldLine) {\n foldLine.shiftRow(len);\n foldLine.addRemoveChars(lastRow, 0, end.column - start.column);\n }\n }\n else \n if (cmp == -1) {\n foldLine.addRemoveChars(firstRow, 0, end.column - start.column);\n foldLine.shiftRow(len);\n }\n idx = foldLines.indexOf(foldLine) + 1;\n }\n for (idx; idx < foldLines.length; idx++) {\n var foldLine = foldLines[idx];\n if (foldLine.start.row >= firstRow) {\n foldLine.shiftRow(len);\n }\n }\n }\n }\n else {\n len = Math.abs(delta.start.column - delta.end.column);\n if (action === \"remove\") {\n removedFolds = this.getFoldsInRange(delta);\n this.removeFolds(removedFolds);\n len = -len;\n }\n var foldLine = this.getFoldLine(firstRow);\n if (foldLine) {\n foldLine.addRemoveChars(firstRow, start.column, len);\n }\n }\n if (useWrapMode && this.$wrapData.length != this.doc.getLength()) {\n console.error(\"doc.getLength() and $wrapData.length have to be the same!\");\n }\n this.$updating = false;\n if (useWrapMode)\n this.$updateWrapData(firstRow, lastRow);\n else\n this.$updateRowLengthCache(firstRow, lastRow);\n return removedFolds;\n };\n this.$updateRowLengthCache = function (firstRow, lastRow, b) {\n this.$rowLengthCache[firstRow] = null;\n this.$rowLengthCache[lastRow] = null;\n };\n this.$updateWrapData = function (firstRow, lastRow) {\n var lines = this.doc.getAllLines();\n var tabSize = this.getTabSize();\n var wrapData = this.$wrapData;\n var wrapLimit = this.$wrapLimit;\n var tokens;\n var foldLine;\n var row = firstRow;\n lastRow = Math.min(lastRow, lines.length - 1);\n while (row <= lastRow) {\n foldLine = this.getFoldLine(row, foldLine);\n if (!foldLine) {\n tokens = this.$getDisplayTokens(lines[row]);\n wrapData[row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);\n row++;\n }\n else {\n tokens = [];\n foldLine.walk(function (placeholder, row, column, lastColumn) {\n var walkTokens;\n if (placeholder != null) {\n walkTokens = this.$getDisplayTokens(placeholder, tokens.length);\n walkTokens[0] = PLACEHOLDER_START;\n for (var i = 1; i < walkTokens.length; i++) {\n walkTokens[i] = PLACEHOLDER_BODY;\n }\n }\n else {\n walkTokens = this.$getDisplayTokens(lines[row].substring(lastColumn, column), tokens.length);\n }\n tokens = tokens.concat(walkTokens);\n }.bind(this), foldLine.end.row, lines[foldLine.end.row].length + 1);\n wrapData[foldLine.start.row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);\n row = foldLine.end.row + 1;\n }\n }\n };\n var CHAR = 1, CHAR_EXT = 2, PLACEHOLDER_START = 3, PLACEHOLDER_BODY = 4, PUNCTUATION = 9, SPACE = 10, TAB = 11, TAB_SPACE = 12;\n this.$computeWrapSplits = function (tokens, wrapLimit, tabSize) {\n if (tokens.length == 0) {\n return [];\n }\n var splits = [];\n var displayLength = tokens.length;\n var lastSplit = 0, lastDocSplit = 0;\n var isCode = this.$wrapAsCode;\n var indentedSoftWrap = this.$indentedSoftWrap;\n var maxIndent = wrapLimit <= Math.max(2 * tabSize, 8)\n || indentedSoftWrap === false ? 0 : Math.floor(wrapLimit / 2);\n function getWrapIndent() {\n var indentation = 0;\n if (maxIndent === 0)\n return indentation;\n if (indentedSoftWrap) {\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n if (token == SPACE)\n indentation += 1;\n else if (token == TAB)\n indentation += tabSize;\n else if (token == TAB_SPACE)\n continue;\n else\n break;\n }\n }\n if (isCode && indentedSoftWrap !== false)\n indentation += tabSize;\n return Math.min(indentation, maxIndent);\n }\n function addSplit(screenPos) {\n var len = screenPos - lastSplit;\n for (var i = lastSplit; i < screenPos; i++) {\n var ch = tokens[i];\n if (ch === 12 || ch === 2)\n len -= 1;\n }\n if (!splits.length) {\n indent = getWrapIndent();\n splits.indent = indent;\n }\n lastDocSplit += len;\n splits.push(lastDocSplit);\n lastSplit = screenPos;\n }\n var indent = 0;\n while (displayLength - lastSplit > wrapLimit - indent) {\n var split = lastSplit + wrapLimit - indent;\n if (tokens[split - 1] >= SPACE && tokens[split] >= SPACE) {\n addSplit(split);\n continue;\n }\n if (tokens[split] == PLACEHOLDER_START || tokens[split] == PLACEHOLDER_BODY) {\n for (split; split != lastSplit - 1; split--) {\n if (tokens[split] == PLACEHOLDER_START) {\n break;\n }\n }\n if (split > lastSplit) {\n addSplit(split);\n continue;\n }\n split = lastSplit + wrapLimit;\n for (split; split < tokens.length; split++) {\n if (tokens[split] != PLACEHOLDER_BODY) {\n break;\n }\n }\n if (split == tokens.length) {\n break; // Breaks the while-loop.\n }\n addSplit(split);\n continue;\n }\n var minSplit = Math.max(split - (wrapLimit - (wrapLimit >> 2)), lastSplit - 1);\n while (split > minSplit && tokens[split] < PLACEHOLDER_START) {\n split--;\n }\n if (isCode) {\n while (split > minSplit && tokens[split] < PLACEHOLDER_START) {\n split--;\n }\n while (split > minSplit && tokens[split] == PUNCTUATION) {\n split--;\n }\n }\n else {\n while (split > minSplit && tokens[split] < SPACE) {\n split--;\n }\n }\n if (split > minSplit) {\n addSplit(++split);\n continue;\n }\n split = lastSplit + wrapLimit;\n if (tokens[split] == CHAR_EXT)\n split--;\n addSplit(split - indent);\n }\n return splits;\n };\n this.$getDisplayTokens = function (str, offset) {\n var arr = [];\n var tabSize;\n offset = offset || 0;\n for (var i = 0; i < str.length; i++) {\n var c = str.charCodeAt(i);\n if (c == 9) {\n tabSize = this.getScreenTabSize(arr.length + offset);\n arr.push(TAB);\n for (var n = 1; n < tabSize; n++) {\n arr.push(TAB_SPACE);\n }\n }\n else if (c == 32) {\n arr.push(SPACE);\n }\n else if ((c > 39 && c < 48) || (c > 57 && c < 64)) {\n arr.push(PUNCTUATION);\n }\n else if (c >= 0x1100 && isFullWidth(c)) {\n arr.push(CHAR, CHAR_EXT);\n }\n else {\n arr.push(CHAR);\n }\n }\n return arr;\n };\n this.$getStringScreenWidth = function (str, maxScreenColumn, screenColumn) {\n if (maxScreenColumn == 0)\n return [0, 0];\n if (maxScreenColumn == null)\n maxScreenColumn = Infinity;\n screenColumn = screenColumn || 0;\n var c, column;\n for (column = 0; column < str.length; column++) {\n c = str.charCodeAt(column);\n if (c == 9) {\n screenColumn += this.getScreenTabSize(screenColumn);\n }\n else if (c >= 0x1100 && isFullWidth(c)) {\n screenColumn += 2;\n }\n else {\n screenColumn += 1;\n }\n if (screenColumn > maxScreenColumn) {\n break;\n }\n }\n return [screenColumn, column];\n };\n this.lineWidgets = null;\n this.getRowLength = function (row) {\n var h = 1;\n if (this.lineWidgets)\n h += this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0;\n if (!this.$useWrapMode || !this.$wrapData[row])\n return h;\n else\n return this.$wrapData[row].length + h;\n };\n this.getRowLineCount = function (row) {\n if (!this.$useWrapMode || !this.$wrapData[row]) {\n return 1;\n }\n else {\n return this.$wrapData[row].length + 1;\n }\n };\n this.getRowWrapIndent = function (screenRow) {\n if (this.$useWrapMode) {\n var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);\n var splits = this.$wrapData[pos.row];\n return splits.length && splits[0] < pos.column ? splits.indent : 0;\n }\n else {\n return 0;\n }\n };\n this.getScreenLastRowColumn = function (screenRow) {\n var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);\n return this.documentToScreenColumn(pos.row, pos.column);\n };\n this.getDocumentLastRowColumn = function (docRow, docColumn) {\n var screenRow = this.documentToScreenRow(docRow, docColumn);\n return this.getScreenLastRowColumn(screenRow);\n };\n this.getDocumentLastRowColumnPosition = function (docRow, docColumn) {\n var screenRow = this.documentToScreenRow(docRow, docColumn);\n return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10);\n };\n this.getRowSplitData = function (row) {\n if (!this.$useWrapMode) {\n return undefined;\n }\n else {\n return this.$wrapData[row];\n }\n };\n this.getScreenTabSize = function (screenColumn) {\n return this.$tabSize - (screenColumn % this.$tabSize | 0);\n };\n this.screenToDocumentRow = function (screenRow, screenColumn) {\n return this.screenToDocumentPosition(screenRow, screenColumn).row;\n };\n this.screenToDocumentColumn = function (screenRow, screenColumn) {\n return this.screenToDocumentPosition(screenRow, screenColumn).column;\n };\n this.screenToDocumentPosition = function (screenRow, screenColumn, offsetX) {\n if (screenRow < 0)\n return { row: 0, column: 0 };\n var line;\n var docRow = 0;\n var docColumn = 0;\n var column;\n var row = 0;\n var rowLength = 0;\n var rowCache = this.$screenRowCache;\n var i = this.$getRowCacheIndex(rowCache, screenRow);\n var l = rowCache.length;\n if (l && i >= 0) {\n var row = rowCache[i];\n var docRow = this.$docRowCache[i];\n var doCache = screenRow > rowCache[l - 1];\n }\n else {\n var doCache = !l;\n }\n var maxRow = this.getLength() - 1;\n var foldLine = this.getNextFoldLine(docRow);\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n while (row <= screenRow) {\n rowLength = this.getRowLength(docRow);\n if (row + rowLength > screenRow || docRow >= maxRow) {\n break;\n }\n else {\n row += rowLength;\n docRow++;\n if (docRow > foldStart) {\n docRow = foldLine.end.row + 1;\n foldLine = this.getNextFoldLine(docRow, foldLine);\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n }\n if (doCache) {\n this.$docRowCache.push(docRow);\n this.$screenRowCache.push(row);\n }\n }\n if (foldLine && foldLine.start.row <= docRow) {\n line = this.getFoldDisplayLine(foldLine);\n docRow = foldLine.start.row;\n }\n else if (row + rowLength <= screenRow || docRow > maxRow) {\n return {\n row: maxRow,\n column: this.getLine(maxRow).length\n };\n }\n else {\n line = this.getLine(docRow);\n foldLine = null;\n }\n var wrapIndent = 0, splitIndex = Math.floor(screenRow - row);\n if (this.$useWrapMode) {\n var splits = this.$wrapData[docRow];\n if (splits) {\n column = splits[splitIndex];\n if (splitIndex > 0 && splits.length) {\n wrapIndent = splits.indent;\n docColumn = splits[splitIndex - 1] || splits[splits.length - 1];\n line = line.substring(docColumn);\n }\n }\n }\n if (offsetX !== undefined && this.$bidiHandler.isBidiRow(row + splitIndex, docRow, splitIndex))\n screenColumn = this.$bidiHandler.offsetToCol(offsetX);\n docColumn += this.$getStringScreenWidth(line, screenColumn - wrapIndent)[1];\n if (this.$useWrapMode && docColumn >= column)\n docColumn = column - 1;\n if (foldLine)\n return foldLine.idxToPosition(docColumn);\n return { row: docRow, column: docColumn };\n };\n this.documentToScreenPosition = function (docRow, docColumn) {\n if (typeof docColumn === \"undefined\")\n var pos = this.$clipPositionToDocument(docRow.row, docRow.column);\n else\n pos = this.$clipPositionToDocument(docRow, docColumn);\n docRow = pos.row;\n docColumn = pos.column;\n var screenRow = 0;\n var foldStartRow = null;\n var fold = null;\n fold = this.getFoldAt(docRow, docColumn, 1);\n if (fold) {\n docRow = fold.start.row;\n docColumn = fold.start.column;\n }\n var rowEnd, row = 0;\n var rowCache = this.$docRowCache;\n var i = this.$getRowCacheIndex(rowCache, docRow);\n var l = rowCache.length;\n if (l && i >= 0) {\n var row = rowCache[i];\n var screenRow = this.$screenRowCache[i];\n var doCache = docRow > rowCache[l - 1];\n }\n else {\n var doCache = !l;\n }\n var foldLine = this.getNextFoldLine(row);\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n while (row < docRow) {\n if (row >= foldStart) {\n rowEnd = foldLine.end.row + 1;\n if (rowEnd > docRow)\n break;\n foldLine = this.getNextFoldLine(rowEnd, foldLine);\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n else {\n rowEnd = row + 1;\n }\n screenRow += this.getRowLength(row);\n row = rowEnd;\n if (doCache) {\n this.$docRowCache.push(row);\n this.$screenRowCache.push(screenRow);\n }\n }\n var textLine = \"\";\n if (foldLine && row >= foldStart) {\n textLine = this.getFoldDisplayLine(foldLine, docRow, docColumn);\n foldStartRow = foldLine.start.row;\n }\n else {\n textLine = this.getLine(docRow).substring(0, docColumn);\n foldStartRow = docRow;\n }\n var wrapIndent = 0;\n if (this.$useWrapMode) {\n var wrapRow = this.$wrapData[foldStartRow];\n if (wrapRow) {\n var screenRowOffset = 0;\n while (textLine.length >= wrapRow[screenRowOffset]) {\n screenRow++;\n screenRowOffset++;\n }\n textLine = textLine.substring(wrapRow[screenRowOffset - 1] || 0, textLine.length);\n wrapIndent = screenRowOffset > 0 ? wrapRow.indent : 0;\n }\n }\n if (this.lineWidgets && this.lineWidgets[row] && this.lineWidgets[row].rowsAbove)\n screenRow += this.lineWidgets[row].rowsAbove;\n return {\n row: screenRow,\n column: wrapIndent + this.$getStringScreenWidth(textLine)[0]\n };\n };\n this.documentToScreenColumn = function (row, docColumn) {\n return this.documentToScreenPosition(row, docColumn).column;\n };\n this.documentToScreenRow = function (docRow, docColumn) {\n return this.documentToScreenPosition(docRow, docColumn).row;\n };\n this.getScreenLength = function () {\n var screenRows = 0;\n var fold = null;\n if (!this.$useWrapMode) {\n screenRows = this.getLength();\n var foldData = this.$foldData;\n for (var i = 0; i < foldData.length; i++) {\n fold = foldData[i];\n screenRows -= fold.end.row - fold.start.row;\n }\n }\n else {\n var lastRow = this.$wrapData.length;\n var row = 0, i = 0;\n var fold = this.$foldData[i++];\n var foldStart = fold ? fold.start.row : Infinity;\n while (row < lastRow) {\n var splits = this.$wrapData[row];\n screenRows += splits ? splits.length + 1 : 1;\n row++;\n if (row > foldStart) {\n row = fold.end.row + 1;\n fold = this.$foldData[i++];\n foldStart = fold ? fold.start.row : Infinity;\n }\n }\n }\n if (this.lineWidgets)\n screenRows += this.$getWidgetScreenLength();\n return screenRows;\n };\n this.$setFontMetrics = function (fm) {\n if (!this.$enableVarChar)\n return;\n this.$getStringScreenWidth = function (str, maxScreenColumn, screenColumn) {\n if (maxScreenColumn === 0)\n return [0, 0];\n if (!maxScreenColumn)\n maxScreenColumn = Infinity;\n screenColumn = screenColumn || 0;\n var c, column;\n for (column = 0; column < str.length; column++) {\n c = str.charAt(column);\n if (c === \"\\t\") {\n screenColumn += this.getScreenTabSize(screenColumn);\n }\n else {\n screenColumn += fm.getCharacterWidth(c);\n }\n if (screenColumn > maxScreenColumn) {\n break;\n }\n }\n return [screenColumn, column];\n };\n };\n this.destroy = function () {\n if (!this.destroyed) {\n this.bgTokenizer.setDocument(null);\n this.bgTokenizer.cleanup();\n this.destroyed = true;\n }\n this.$stopWorker();\n this.removeAllListeners();\n if (this.doc) {\n this.doc.off(\"change\", this.$onChange);\n }\n this.selection.detach();\n };\n this.isFullWidth = isFullWidth;\n function isFullWidth(c) {\n if (c < 0x1100)\n return false;\n return c >= 0x1100 && c <= 0x115F ||\n c >= 0x11A3 && c <= 0x11A7 ||\n c >= 0x11FA && c <= 0x11FF ||\n c >= 0x2329 && c <= 0x232A ||\n c >= 0x2E80 && c <= 0x2E99 ||\n c >= 0x2E9B && c <= 0x2EF3 ||\n c >= 0x2F00 && c <= 0x2FD5 ||\n c >= 0x2FF0 && c <= 0x2FFB ||\n c >= 0x3000 && c <= 0x303E ||\n c >= 0x3041 && c <= 0x3096 ||\n c >= 0x3099 && c <= 0x30FF ||\n c >= 0x3105 && c <= 0x312D ||\n c >= 0x3131 && c <= 0x318E ||\n c >= 0x3190 && c <= 0x31BA ||\n c >= 0x31C0 && c <= 0x31E3 ||\n c >= 0x31F0 && c <= 0x321E ||\n c >= 0x3220 && c <= 0x3247 ||\n c >= 0x3250 && c <= 0x32FE ||\n c >= 0x3300 && c <= 0x4DBF ||\n c >= 0x4E00 && c <= 0xA48C ||\n c >= 0xA490 && c <= 0xA4C6 ||\n c >= 0xA960 && c <= 0xA97C ||\n c >= 0xAC00 && c <= 0xD7A3 ||\n c >= 0xD7B0 && c <= 0xD7C6 ||\n c >= 0xD7CB && c <= 0xD7FB ||\n c >= 0xF900 && c <= 0xFAFF ||\n c >= 0xFE10 && c <= 0xFE19 ||\n c >= 0xFE30 && c <= 0xFE52 ||\n c >= 0xFE54 && c <= 0xFE66 ||\n c >= 0xFE68 && c <= 0xFE6B ||\n c >= 0xFF01 && c <= 0xFF60 ||\n c >= 0xFFE0 && c <= 0xFFE6;\n }\n}).call(EditSession.prototype);\nrequire(\"./edit_session/folding\").Folding.call(EditSession.prototype);\nrequire(\"./edit_session/bracket_match\").BracketMatch.call(EditSession.prototype);\nconfig.defineOptions(EditSession.prototype, \"session\", {\n wrap: {\n set: function (value) {\n if (!value || value == \"off\")\n value = false;\n else if (value == \"free\")\n value = true;\n else if (value == \"printMargin\")\n value = -1;\n else if (typeof value == \"string\")\n value = parseInt(value, 10) || false;\n if (this.$wrap == value)\n return;\n this.$wrap = value;\n if (!value) {\n this.setUseWrapMode(false);\n }\n else {\n var col = typeof value == \"number\" ? value : null;\n this.setWrapLimitRange(col, col);\n this.setUseWrapMode(true);\n }\n },\n get: function () {\n if (this.getUseWrapMode()) {\n if (this.$wrap == -1)\n return \"printMargin\";\n if (!this.getWrapLimitRange().min)\n return \"free\";\n return this.$wrap;\n }\n return \"off\";\n },\n handlesSet: true\n },\n wrapMethod: {\n set: function (val) {\n val = val == \"auto\"\n ? this.$mode.type != \"text\"\n : val != \"text\";\n if (val != this.$wrapAsCode) {\n this.$wrapAsCode = val;\n if (this.$useWrapMode) {\n this.$useWrapMode = false;\n this.setUseWrapMode(true);\n }\n }\n },\n initialValue: \"auto\"\n },\n indentedSoftWrap: {\n set: function () {\n if (this.$useWrapMode) {\n this.$useWrapMode = false;\n this.setUseWrapMode(true);\n }\n },\n initialValue: true\n },\n firstLineNumber: {\n set: function () { this._signal(\"changeBreakpoint\"); },\n initialValue: 1\n },\n useWorker: {\n set: function (useWorker) {\n this.$useWorker = useWorker;\n this.$stopWorker();\n if (useWorker)\n this.$startWorker();\n },\n initialValue: true\n },\n useSoftTabs: { initialValue: true },\n tabSize: {\n set: function (tabSize) {\n tabSize = parseInt(tabSize);\n if (tabSize > 0 && this.$tabSize !== tabSize) {\n this.$modified = true;\n this.$rowLengthCache = [];\n this.$tabSize = tabSize;\n this._signal(\"changeTabSize\");\n }\n },\n initialValue: 4,\n handlesSet: true\n },\n navigateWithinSoftTabs: { initialValue: false },\n foldStyle: {\n set: function (val) { this.setFoldStyle(val); },\n handlesSet: true\n },\n overwrite: {\n set: function (val) { this._signal(\"changeOverwrite\"); },\n initialValue: false\n },\n newLineMode: {\n set: function (val) { this.doc.setNewLineMode(val); },\n get: function () { return this.doc.getNewLineMode(); },\n handlesSet: true\n },\n mode: {\n set: function (val) { this.setMode(val); },\n get: function () { return this.$modeId; },\n handlesSet: true\n }\n});\nexports.EditSession = EditSession;\n\n});\n\nace.define(\"ace/search\",[\"require\",\"exports\",\"module\",\"ace/lib/lang\",\"ace/lib/oop\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar lang = require(\"./lib/lang\");\nvar oop = require(\"./lib/oop\");\nvar Range = require(\"./range\").Range;\nvar Search = function () {\n this.$options = {};\n};\n(function () {\n this.set = function (options) {\n oop.mixin(this.$options, options);\n return this;\n };\n this.getOptions = function () {\n return lang.copyObject(this.$options);\n };\n this.setOptions = function (options) {\n this.$options = options;\n };\n this.find = function (session) {\n var options = this.$options;\n var iterator = this.$matchIterator(session, options);\n if (!iterator)\n return false;\n var firstRange = null;\n iterator.forEach(function (sr, sc, er, ec) {\n firstRange = new Range(sr, sc, er, ec);\n if (sc == ec && options.start && options.start.start\n && options.skipCurrent != false && firstRange.isEqual(options.start)) {\n firstRange = null;\n return false;\n }\n return true;\n });\n return firstRange;\n };\n this.findAll = function (session) {\n var options = this.$options;\n if (!options.needle)\n return [];\n this.$assembleRegExp(options);\n var range = options.range;\n var lines = range\n ? session.getLines(range.start.row, range.end.row)\n : session.doc.getAllLines();\n var ranges = [];\n var re = options.re;\n if (options.$isMultiLine) {\n var len = re.length;\n var maxRow = lines.length - len;\n var prevRange;\n outer: for (var row = re.offset || 0; row <= maxRow; row++) {\n for (var j = 0; j < len; j++)\n if (lines[row + j].search(re[j]) == -1)\n continue outer;\n var startLine = lines[row];\n var line = lines[row + len - 1];\n var startIndex = startLine.length - startLine.match(re[0])[0].length;\n var endIndex = line.match(re[len - 1])[0].length;\n if (prevRange && prevRange.end.row === row &&\n prevRange.end.column > startIndex) {\n continue;\n }\n ranges.push(prevRange = new Range(row, startIndex, row + len - 1, endIndex));\n if (len > 2)\n row = row + len - 2;\n }\n }\n else {\n for (var i = 0; i < lines.length; i++) {\n var matches = lang.getMatchOffsets(lines[i], re);\n for (var j = 0; j < matches.length; j++) {\n var match = matches[j];\n ranges.push(new Range(i, match.offset, i, match.offset + match.length));\n }\n }\n }\n if (range) {\n var startColumn = range.start.column;\n var endColumn = range.end.column;\n var i = 0, j = ranges.length - 1;\n while (i < j && ranges[i].start.column < startColumn && ranges[i].start.row == 0)\n i++;\n var endRow = range.end.row - range.start.row;\n while (i < j && ranges[j].end.column > endColumn && ranges[j].end.row == endRow)\n j--;\n ranges = ranges.slice(i, j + 1);\n for (i = 0, j = ranges.length; i < j; i++) {\n ranges[i].start.row += range.start.row;\n ranges[i].end.row += range.start.row;\n }\n }\n return ranges;\n };\n this.replace = function (input, replacement) {\n var options = this.$options;\n var re = this.$assembleRegExp(options);\n if (options.$isMultiLine)\n return replacement;\n if (!re)\n return;\n var match = re.exec(input);\n if (!match || match[0].length != input.length)\n return null;\n replacement = input.replace(re, replacement);\n if (options.preserveCase) {\n replacement = replacement.split(\"\");\n for (var i = Math.min(input.length, input.length); i--;) {\n var ch = input[i];\n if (ch && ch.toLowerCase() != ch)\n replacement[i] = replacement[i].toUpperCase();\n else\n replacement[i] = replacement[i].toLowerCase();\n }\n replacement = replacement.join(\"\");\n }\n return replacement;\n };\n this.$assembleRegExp = function (options, $disableFakeMultiline) {\n if (options.needle instanceof RegExp)\n return options.re = options.needle;\n var needle = options.needle;\n if (!options.needle)\n return options.re = false;\n if (!options.regExp)\n needle = lang.escapeRegExp(needle);\n if (options.wholeWord)\n needle = addWordBoundary(needle, options);\n var modifier = options.caseSensitive ? \"gm\" : \"gmi\";\n options.$isMultiLine = !$disableFakeMultiline && /[\\n\\r]/.test(needle);\n if (options.$isMultiLine)\n return options.re = this.$assembleMultilineRegExp(needle, modifier);\n try {\n var re = new RegExp(needle, modifier);\n }\n catch (e) {\n re = false;\n }\n return options.re = re;\n };\n this.$assembleMultilineRegExp = function (needle, modifier) {\n var parts = needle.replace(/\\r\\n|\\r|\\n/g, \"$\\n^\").split(\"\\n\");\n var re = [];\n for (var i = 0; i < parts.length; i++)\n try {\n re.push(new RegExp(parts[i], modifier));\n }\n catch (e) {\n return false;\n }\n return re;\n };\n this.$matchIterator = function (session, options) {\n var re = this.$assembleRegExp(options);\n if (!re)\n return false;\n var backwards = options.backwards == true;\n var skipCurrent = options.skipCurrent != false;\n var range = options.range;\n var start = options.start;\n if (!start)\n start = range ? range[backwards ? \"end\" : \"start\"] : session.selection.getRange();\n if (start.start)\n start = start[skipCurrent != backwards ? \"end\" : \"start\"];\n var firstRow = range ? range.start.row : 0;\n var lastRow = range ? range.end.row : session.getLength() - 1;\n if (backwards) {\n var forEach = function (callback) {\n var row = start.row;\n if (forEachInLine(row, start.column, callback))\n return;\n for (row--; row >= firstRow; row--)\n if (forEachInLine(row, Number.MAX_VALUE, callback))\n return;\n if (options.wrap == false)\n return;\n for (row = lastRow, firstRow = start.row; row >= firstRow; row--)\n if (forEachInLine(row, Number.MAX_VALUE, callback))\n return;\n };\n }\n else {\n var forEach = function (callback) {\n var row = start.row;\n if (forEachInLine(row, start.column, callback))\n return;\n for (row = row + 1; row <= lastRow; row++)\n if (forEachInLine(row, 0, callback))\n return;\n if (options.wrap == false)\n return;\n for (row = firstRow, lastRow = start.row; row <= lastRow; row++)\n if (forEachInLine(row, 0, callback))\n return;\n };\n }\n if (options.$isMultiLine) {\n var len = re.length;\n var forEachInLine = function (row, offset, callback) {\n var startRow = backwards ? row - len + 1 : row;\n if (startRow < 0 || startRow + len > session.getLength())\n return;\n var line = session.getLine(startRow);\n var startIndex = line.search(re[0]);\n if (!backwards && startIndex < offset || startIndex === -1)\n return;\n for (var i = 1; i < len; i++) {\n line = session.getLine(startRow + i);\n if (line.search(re[i]) == -1)\n return;\n }\n var endIndex = line.match(re[len - 1])[0].length;\n if (backwards && endIndex > offset)\n return;\n if (callback(startRow, startIndex, startRow + len - 1, endIndex))\n return true;\n };\n }\n else if (backwards) {\n var forEachInLine = function (row, endIndex, callback) {\n var line = session.getLine(row);\n var matches = [];\n var m, last = 0;\n re.lastIndex = 0;\n while ((m = re.exec(line))) {\n var length = m[0].length;\n last = m.index;\n if (!length) {\n if (last >= line.length)\n break;\n re.lastIndex = last += 1;\n }\n if (m.index + length > endIndex)\n break;\n matches.push(m.index, length);\n }\n for (var i = matches.length - 1; i >= 0; i -= 2) {\n var column = matches[i - 1];\n var length = matches[i];\n if (callback(row, column, row, column + length))\n return true;\n }\n };\n }\n else {\n var forEachInLine = function (row, startIndex, callback) {\n var line = session.getLine(row);\n var last;\n var m;\n re.lastIndex = startIndex;\n while ((m = re.exec(line))) {\n var length = m[0].length;\n last = m.index;\n if (callback(row, last, row, last + length))\n return true;\n if (!length) {\n re.lastIndex = last += 1;\n if (last >= line.length)\n return false;\n }\n }\n };\n }\n return { forEach: forEach };\n };\n}).call(Search.prototype);\nfunction addWordBoundary(needle, options) {\n function wordBoundary(c) {\n if (/\\w/.test(c) || options.regExp)\n return \"\\\\b\";\n return \"\";\n }\n return wordBoundary(needle[0]) + needle\n + wordBoundary(needle[needle.length - 1]);\n}\nexports.Search = Search;\n\n});\n\nace.define(\"ace/keyboard/hash_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/keys\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar keyUtil = require(\"../lib/keys\");\nvar useragent = require(\"../lib/useragent\");\nvar KEY_MODS = keyUtil.KEY_MODS;\nfunction HashHandler(config, platform) {\n this.platform = platform || (useragent.isMac ? \"mac\" : \"win\");\n this.commands = {};\n this.commandKeyBinding = {};\n this.addCommands(config);\n this.$singleCommand = true;\n}\nfunction MultiHashHandler(config, platform) {\n HashHandler.call(this, config, platform);\n this.$singleCommand = false;\n}\nMultiHashHandler.prototype = HashHandler.prototype;\n(function () {\n this.addCommand = function (command) {\n if (this.commands[command.name])\n this.removeCommand(command);\n this.commands[command.name] = command;\n if (command.bindKey)\n this._buildKeyHash(command);\n };\n this.removeCommand = function (command, keepCommand) {\n var name = command && (typeof command === 'string' ? command : command.name);\n command = this.commands[name];\n if (!keepCommand)\n delete this.commands[name];\n var ckb = this.commandKeyBinding;\n for (var keyId in ckb) {\n var cmdGroup = ckb[keyId];\n if (cmdGroup == command) {\n delete ckb[keyId];\n }\n else if (Array.isArray(cmdGroup)) {\n var i = cmdGroup.indexOf(command);\n if (i != -1) {\n cmdGroup.splice(i, 1);\n if (cmdGroup.length == 1)\n ckb[keyId] = cmdGroup[0];\n }\n }\n }\n };\n this.bindKey = function (key, command, position) {\n if (typeof key == \"object\" && key) {\n if (position == undefined)\n position = key.position;\n key = key[this.platform];\n }\n if (!key)\n return;\n if (typeof command == \"function\")\n return this.addCommand({ exec: command, bindKey: key, name: command.name || key });\n key.split(\"|\").forEach(function (keyPart) {\n var chain = \"\";\n if (keyPart.indexOf(\" \") != -1) {\n var parts = keyPart.split(/\\s+/);\n keyPart = parts.pop();\n parts.forEach(function (keyPart) {\n var binding = this.parseKeys(keyPart);\n var id = KEY_MODS[binding.hashId] + binding.key;\n chain += (chain ? \" \" : \"\") + id;\n this._addCommandToBinding(chain, \"chainKeys\");\n }, this);\n chain += \" \";\n }\n var binding = this.parseKeys(keyPart);\n var id = KEY_MODS[binding.hashId] + binding.key;\n this._addCommandToBinding(chain + id, command, position);\n }, this);\n };\n function getPosition(command) {\n return typeof command == \"object\" && command.bindKey\n && command.bindKey.position\n || (command.isDefault ? -100 : 0);\n }\n this._addCommandToBinding = function (keyId, command, position) {\n var ckb = this.commandKeyBinding, i;\n if (!command) {\n delete ckb[keyId];\n }\n else if (!ckb[keyId] || this.$singleCommand) {\n ckb[keyId] = command;\n }\n else {\n if (!Array.isArray(ckb[keyId])) {\n ckb[keyId] = [ckb[keyId]];\n }\n else if ((i = ckb[keyId].indexOf(command)) != -1) {\n ckb[keyId].splice(i, 1);\n }\n if (typeof position != \"number\") {\n position = getPosition(command);\n }\n var commands = ckb[keyId];\n for (i = 0; i < commands.length; i++) {\n var other = commands[i];\n var otherPos = getPosition(other);\n if (otherPos > position)\n break;\n }\n commands.splice(i, 0, command);\n }\n };\n this.addCommands = function (commands) {\n commands && Object.keys(commands).forEach(function (name) {\n var command = commands[name];\n if (!command)\n return;\n if (typeof command === \"string\")\n return this.bindKey(command, name);\n if (typeof command === \"function\")\n command = { exec: command };\n if (typeof command !== \"object\")\n return;\n if (!command.name)\n command.name = name;\n this.addCommand(command);\n }, this);\n };\n this.removeCommands = function (commands) {\n Object.keys(commands).forEach(function (name) {\n this.removeCommand(commands[name]);\n }, this);\n };\n this.bindKeys = function (keyList) {\n Object.keys(keyList).forEach(function (key) {\n this.bindKey(key, keyList[key]);\n }, this);\n };\n this._buildKeyHash = function (command) {\n this.bindKey(command.bindKey, command);\n };\n this.parseKeys = function (keys) {\n var parts = keys.toLowerCase().split(/[\\-\\+]([\\-\\+])?/).filter(function (x) { return x; });\n var key = parts.pop();\n var keyCode = keyUtil[key];\n if (keyUtil.FUNCTION_KEYS[keyCode])\n key = keyUtil.FUNCTION_KEYS[keyCode].toLowerCase();\n else if (!parts.length)\n return { key: key, hashId: -1 };\n else if (parts.length == 1 && parts[0] == \"shift\")\n return { key: key.toUpperCase(), hashId: -1 };\n var hashId = 0;\n for (var i = parts.length; i--;) {\n var modifier = keyUtil.KEY_MODS[parts[i]];\n if (modifier == null) {\n if (typeof console != \"undefined\")\n console.error(\"invalid modifier \" + parts[i] + \" in \" + keys);\n return false;\n }\n hashId |= modifier;\n }\n return { key: key, hashId: hashId };\n };\n this.findKeyCommand = function findKeyCommand(hashId, keyString) {\n var key = KEY_MODS[hashId] + keyString;\n return this.commandKeyBinding[key];\n };\n this.handleKeyboard = function (data, hashId, keyString, keyCode) {\n if (keyCode < 0)\n return;\n var key = KEY_MODS[hashId] + keyString;\n var command = this.commandKeyBinding[key];\n if (data.$keyChain) {\n data.$keyChain += \" \" + key;\n command = this.commandKeyBinding[data.$keyChain] || command;\n }\n if (command) {\n if (command == \"chainKeys\" || command[command.length - 1] == \"chainKeys\") {\n data.$keyChain = data.$keyChain || key;\n return { command: \"null\" };\n }\n }\n if (data.$keyChain) {\n if ((!hashId || hashId == 4) && keyString.length == 1)\n data.$keyChain = data.$keyChain.slice(0, -key.length - 1); // wait for input\n else if (hashId == -1 || keyCode > 0)\n data.$keyChain = \"\"; // reset keyChain\n }\n return { command: command };\n };\n this.getStatusText = function (editor, data) {\n return data.$keyChain || \"\";\n };\n}).call(HashHandler.prototype);\nexports.HashHandler = HashHandler;\nexports.MultiHashHandler = MultiHashHandler;\n\n});\n\nace.define(\"ace/commands/command_manager\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/keyboard/hash_handler\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"../lib/oop\");\nvar MultiHashHandler = require(\"../keyboard/hash_handler\").MultiHashHandler;\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar CommandManager = function (platform, commands) {\n MultiHashHandler.call(this, commands, platform);\n this.byName = this.commands;\n this.setDefaultHandler(\"exec\", function (e) {\n if (!e.args) {\n return e.command.exec(e.editor, {}, e.event, true);\n }\n return e.command.exec(e.editor, e.args, e.event, false);\n });\n};\noop.inherits(CommandManager, MultiHashHandler);\n(function () {\n oop.implement(this, EventEmitter);\n this.exec = function (command, editor, args) {\n if (Array.isArray(command)) {\n for (var i = command.length; i--;) {\n if (this.exec(command[i], editor, args))\n return true;\n }\n return false;\n }\n if (typeof command === \"string\")\n command = this.commands[command];\n if (!command)\n return false;\n if (editor && editor.$readOnly && !command.readOnly)\n return false;\n if (this.$checkCommandState != false && command.isAvailable && !command.isAvailable(editor))\n return false;\n var e = { editor: editor, command: command, args: args };\n e.returnValue = this._emit(\"exec\", e);\n this._signal(\"afterExec\", e);\n return e.returnValue === false ? false : true;\n };\n this.toggleRecording = function (editor) {\n if (this.$inReplay)\n return;\n editor && editor._emit(\"changeStatus\");\n if (this.recording) {\n this.macro.pop();\n this.off(\"exec\", this.$addCommandToMacro);\n if (!this.macro.length)\n this.macro = this.oldMacro;\n return this.recording = false;\n }\n if (!this.$addCommandToMacro) {\n this.$addCommandToMacro = function (e) {\n this.macro.push([e.command, e.args]);\n }.bind(this);\n }\n this.oldMacro = this.macro;\n this.macro = [];\n this.on(\"exec\", this.$addCommandToMacro);\n return this.recording = true;\n };\n this.replay = function (editor) {\n if (this.$inReplay || !this.macro)\n return;\n if (this.recording)\n return this.toggleRecording(editor);\n try {\n this.$inReplay = true;\n this.macro.forEach(function (x) {\n if (typeof x == \"string\")\n this.exec(x, editor);\n else\n this.exec(x[0], editor, x[1]);\n }, this);\n }\n finally {\n this.$inReplay = false;\n }\n };\n this.trimMacro = function (m) {\n return m.map(function (x) {\n if (typeof x[0] != \"string\")\n x[0] = x[0].name;\n if (!x[1])\n x = x[0];\n return x;\n });\n };\n}).call(CommandManager.prototype);\nexports.CommandManager = CommandManager;\n\n});\n\nace.define(\"ace/commands/default_commands\",[\"require\",\"exports\",\"module\",\"ace/lib/lang\",\"ace/config\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar lang = require(\"../lib/lang\");\nvar config = require(\"../config\");\nvar Range = require(\"../range\").Range;\nfunction bindKey(win, mac) {\n return { win: win, mac: mac };\n}\nexports.commands = [{\n name: \"showSettingsMenu\",\n description: \"Show settings menu\",\n bindKey: bindKey(\"Ctrl-,\", \"Command-,\"),\n exec: function (editor) {\n config.loadModule(\"ace/ext/settings_menu\", function (module) {\n module.init(editor);\n editor.showSettingsMenu();\n });\n },\n readOnly: true\n }, {\n name: \"goToNextError\",\n description: \"Go to next error\",\n bindKey: bindKey(\"Alt-E\", \"F4\"),\n exec: function (editor) {\n config.loadModule(\"./ext/error_marker\", function (module) {\n module.showErrorMarker(editor, 1);\n });\n },\n scrollIntoView: \"animate\",\n readOnly: true\n }, {\n name: \"goToPreviousError\",\n description: \"Go to previous error\",\n bindKey: bindKey(\"Alt-Shift-E\", \"Shift-F4\"),\n exec: function (editor) {\n config.loadModule(\"./ext/error_marker\", function (module) {\n module.showErrorMarker(editor, -1);\n });\n },\n scrollIntoView: \"animate\",\n readOnly: true\n }, {\n name: \"selectall\",\n description: \"Select all\",\n bindKey: bindKey(\"Ctrl-A\", \"Command-A\"),\n exec: function (editor) { editor.selectAll(); },\n readOnly: true\n }, {\n name: \"centerselection\",\n description: \"Center selection\",\n bindKey: bindKey(null, \"Ctrl-L\"),\n exec: function (editor) { editor.centerSelection(); },\n readOnly: true\n }, {\n name: \"gotoline\",\n description: \"Go to line...\",\n bindKey: bindKey(\"Ctrl-L\", \"Command-L\"),\n exec: function (editor, line) {\n if (typeof line === \"number\" && !isNaN(line))\n editor.gotoLine(line);\n editor.prompt({ $type: \"gotoLine\" });\n },\n readOnly: true\n }, {\n name: \"fold\",\n bindKey: bindKey(\"Alt-L|Ctrl-F1\", \"Command-Alt-L|Command-F1\"),\n exec: function (editor) { editor.session.toggleFold(false); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"unfold\",\n bindKey: bindKey(\"Alt-Shift-L|Ctrl-Shift-F1\", \"Command-Alt-Shift-L|Command-Shift-F1\"),\n exec: function (editor) { editor.session.toggleFold(true); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"toggleFoldWidget\",\n description: \"Toggle fold widget\",\n bindKey: bindKey(\"F2\", \"F2\"),\n exec: function (editor) { editor.session.toggleFoldWidget(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"toggleParentFoldWidget\",\n description: \"Toggle parent fold widget\",\n bindKey: bindKey(\"Alt-F2\", \"Alt-F2\"),\n exec: function (editor) { editor.session.toggleFoldWidget(true); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"foldall\",\n description: \"Fold all\",\n bindKey: bindKey(null, \"Ctrl-Command-Option-0\"),\n exec: function (editor) { editor.session.foldAll(); },\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"foldAllComments\",\n description: \"Fold all comments\",\n bindKey: bindKey(null, \"Ctrl-Command-Option-0\"),\n exec: function (editor) { editor.session.foldAllComments(); },\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"foldOther\",\n description: \"Fold other\",\n bindKey: bindKey(\"Alt-0\", \"Command-Option-0\"),\n exec: function (editor) {\n editor.session.foldAll();\n editor.session.unfold(editor.selection.getAllRanges());\n },\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"unfoldall\",\n description: \"Unfold all\",\n bindKey: bindKey(\"Alt-Shift-0\", \"Command-Option-Shift-0\"),\n exec: function (editor) { editor.session.unfold(); },\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"findnext\",\n description: \"Find next\",\n bindKey: bindKey(\"Ctrl-K\", \"Command-G\"),\n exec: function (editor) { editor.findNext(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"findprevious\",\n description: \"Find previous\",\n bindKey: bindKey(\"Ctrl-Shift-K\", \"Command-Shift-G\"),\n exec: function (editor) { editor.findPrevious(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"selectOrFindNext\",\n description: \"Select or find next\",\n bindKey: bindKey(\"Alt-K\", \"Ctrl-G\"),\n exec: function (editor) {\n if (editor.selection.isEmpty())\n editor.selection.selectWord();\n else\n editor.findNext();\n },\n readOnly: true\n }, {\n name: \"selectOrFindPrevious\",\n description: \"Select or find previous\",\n bindKey: bindKey(\"Alt-Shift-K\", \"Ctrl-Shift-G\"),\n exec: function (editor) {\n if (editor.selection.isEmpty())\n editor.selection.selectWord();\n else\n editor.findPrevious();\n },\n readOnly: true\n }, {\n name: \"find\",\n description: \"Find\",\n bindKey: bindKey(\"Ctrl-F\", \"Command-F\"),\n exec: function (editor) {\n config.loadModule(\"ace/ext/searchbox\", function (e) { e.Search(editor); });\n },\n readOnly: true\n }, {\n name: \"overwrite\",\n description: \"Overwrite\",\n bindKey: \"Insert\",\n exec: function (editor) { editor.toggleOverwrite(); },\n readOnly: true\n }, {\n name: \"selecttostart\",\n description: \"Select to start\",\n bindKey: bindKey(\"Ctrl-Shift-Home\", \"Command-Shift-Home|Command-Shift-Up\"),\n exec: function (editor) { editor.getSelection().selectFileStart(); },\n multiSelectAction: \"forEach\",\n readOnly: true,\n scrollIntoView: \"animate\",\n aceCommandGroup: \"fileJump\"\n }, {\n name: \"gotostart\",\n description: \"Go to start\",\n bindKey: bindKey(\"Ctrl-Home\", \"Command-Home|Command-Up\"),\n exec: function (editor) { editor.navigateFileStart(); },\n multiSelectAction: \"forEach\",\n readOnly: true,\n scrollIntoView: \"animate\",\n aceCommandGroup: \"fileJump\"\n }, {\n name: \"selectup\",\n description: \"Select up\",\n bindKey: bindKey(\"Shift-Up\", \"Shift-Up|Ctrl-Shift-P\"),\n exec: function (editor) { editor.getSelection().selectUp(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"golineup\",\n description: \"Go line up\",\n bindKey: bindKey(\"Up\", \"Up|Ctrl-P\"),\n exec: function (editor, args) { editor.navigateUp(args.times); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selecttoend\",\n description: \"Select to end\",\n bindKey: bindKey(\"Ctrl-Shift-End\", \"Command-Shift-End|Command-Shift-Down\"),\n exec: function (editor) { editor.getSelection().selectFileEnd(); },\n multiSelectAction: \"forEach\",\n readOnly: true,\n scrollIntoView: \"animate\",\n aceCommandGroup: \"fileJump\"\n }, {\n name: \"gotoend\",\n description: \"Go to end\",\n bindKey: bindKey(\"Ctrl-End\", \"Command-End|Command-Down\"),\n exec: function (editor) { editor.navigateFileEnd(); },\n multiSelectAction: \"forEach\",\n readOnly: true,\n scrollIntoView: \"animate\",\n aceCommandGroup: \"fileJump\"\n }, {\n name: \"selectdown\",\n description: \"Select down\",\n bindKey: bindKey(\"Shift-Down\", \"Shift-Down|Ctrl-Shift-N\"),\n exec: function (editor) { editor.getSelection().selectDown(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"golinedown\",\n description: \"Go line down\",\n bindKey: bindKey(\"Down\", \"Down|Ctrl-N\"),\n exec: function (editor, args) { editor.navigateDown(args.times); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectwordleft\",\n description: \"Select word left\",\n bindKey: bindKey(\"Ctrl-Shift-Left\", \"Option-Shift-Left\"),\n exec: function (editor) { editor.getSelection().selectWordLeft(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotowordleft\",\n description: \"Go to word left\",\n bindKey: bindKey(\"Ctrl-Left\", \"Option-Left\"),\n exec: function (editor) { editor.navigateWordLeft(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selecttolinestart\",\n description: \"Select to line start\",\n bindKey: bindKey(\"Alt-Shift-Left\", \"Command-Shift-Left|Ctrl-Shift-A\"),\n exec: function (editor) { editor.getSelection().selectLineStart(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotolinestart\",\n description: \"Go to line start\",\n bindKey: bindKey(\"Alt-Left|Home\", \"Command-Left|Home|Ctrl-A\"),\n exec: function (editor) { editor.navigateLineStart(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectleft\",\n description: \"Select left\",\n bindKey: bindKey(\"Shift-Left\", \"Shift-Left|Ctrl-Shift-B\"),\n exec: function (editor) { editor.getSelection().selectLeft(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotoleft\",\n description: \"Go to left\",\n bindKey: bindKey(\"Left\", \"Left|Ctrl-B\"),\n exec: function (editor, args) { editor.navigateLeft(args.times); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectwordright\",\n description: \"Select word right\",\n bindKey: bindKey(\"Ctrl-Shift-Right\", \"Option-Shift-Right\"),\n exec: function (editor) { editor.getSelection().selectWordRight(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotowordright\",\n description: \"Go to word right\",\n bindKey: bindKey(\"Ctrl-Right\", \"Option-Right\"),\n exec: function (editor) { editor.navigateWordRight(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selecttolineend\",\n description: \"Select to line end\",\n bindKey: bindKey(\"Alt-Shift-Right\", \"Command-Shift-Right|Shift-End|Ctrl-Shift-E\"),\n exec: function (editor) { editor.getSelection().selectLineEnd(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotolineend\",\n description: \"Go to line end\",\n bindKey: bindKey(\"Alt-Right|End\", \"Command-Right|End|Ctrl-E\"),\n exec: function (editor) { editor.navigateLineEnd(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectright\",\n description: \"Select right\",\n bindKey: bindKey(\"Shift-Right\", \"Shift-Right\"),\n exec: function (editor) { editor.getSelection().selectRight(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotoright\",\n description: \"Go to right\",\n bindKey: bindKey(\"Right\", \"Right|Ctrl-F\"),\n exec: function (editor, args) { editor.navigateRight(args.times); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectpagedown\",\n description: \"Select page down\",\n bindKey: \"Shift-PageDown\",\n exec: function (editor) { editor.selectPageDown(); },\n readOnly: true\n }, {\n name: \"pagedown\",\n description: \"Page down\",\n bindKey: bindKey(null, \"Option-PageDown\"),\n exec: function (editor) { editor.scrollPageDown(); },\n readOnly: true\n }, {\n name: \"gotopagedown\",\n description: \"Go to page down\",\n bindKey: bindKey(\"PageDown\", \"PageDown|Ctrl-V\"),\n exec: function (editor) { editor.gotoPageDown(); },\n readOnly: true\n }, {\n name: \"selectpageup\",\n description: \"Select page up\",\n bindKey: \"Shift-PageUp\",\n exec: function (editor) { editor.selectPageUp(); },\n readOnly: true\n }, {\n name: \"pageup\",\n description: \"Page up\",\n bindKey: bindKey(null, \"Option-PageUp\"),\n exec: function (editor) { editor.scrollPageUp(); },\n readOnly: true\n }, {\n name: \"gotopageup\",\n description: \"Go to page up\",\n bindKey: \"PageUp\",\n exec: function (editor) { editor.gotoPageUp(); },\n readOnly: true\n }, {\n name: \"scrollup\",\n description: \"Scroll up\",\n bindKey: bindKey(\"Ctrl-Up\", null),\n exec: function (e) { e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight); },\n readOnly: true\n }, {\n name: \"scrolldown\",\n description: \"Scroll down\",\n bindKey: bindKey(\"Ctrl-Down\", null),\n exec: function (e) { e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight); },\n readOnly: true\n }, {\n name: \"selectlinestart\",\n description: \"Select line start\",\n bindKey: \"Shift-Home\",\n exec: function (editor) { editor.getSelection().selectLineStart(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectlineend\",\n description: \"Select line end\",\n bindKey: \"Shift-End\",\n exec: function (editor) { editor.getSelection().selectLineEnd(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"togglerecording\",\n description: \"Toggle recording\",\n bindKey: bindKey(\"Ctrl-Alt-E\", \"Command-Option-E\"),\n exec: function (editor) { editor.commands.toggleRecording(editor); },\n readOnly: true\n }, {\n name: \"replaymacro\",\n description: \"Replay macro\",\n bindKey: bindKey(\"Ctrl-Shift-E\", \"Command-Shift-E\"),\n exec: function (editor) { editor.commands.replay(editor); },\n readOnly: true\n }, {\n name: \"jumptomatching\",\n description: \"Jump to matching\",\n bindKey: bindKey(\"Ctrl-\\\\|Ctrl-P\", \"Command-\\\\\"),\n exec: function (editor) { editor.jumpToMatching(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"animate\",\n readOnly: true\n }, {\n name: \"selecttomatching\",\n description: \"Select to matching\",\n bindKey: bindKey(\"Ctrl-Shift-\\\\|Ctrl-Shift-P\", \"Command-Shift-\\\\\"),\n exec: function (editor) { editor.jumpToMatching(true); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"animate\",\n readOnly: true\n }, {\n name: \"expandToMatching\",\n description: \"Expand to matching\",\n bindKey: bindKey(\"Ctrl-Shift-M\", \"Ctrl-Shift-M\"),\n exec: function (editor) { editor.jumpToMatching(true, true); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"animate\",\n readOnly: true\n }, {\n name: \"passKeysToBrowser\",\n description: \"Pass keys to browser\",\n bindKey: bindKey(null, null),\n exec: function () { },\n passEvent: true,\n readOnly: true\n }, {\n name: \"copy\",\n description: \"Copy\",\n exec: function (editor) {\n },\n readOnly: true\n },\n {\n name: \"cut\",\n description: \"Cut\",\n exec: function (editor) {\n var cutLine = editor.$copyWithEmptySelection && editor.selection.isEmpty();\n var range = cutLine ? editor.selection.getLineRange() : editor.selection.getRange();\n editor._emit(\"cut\", range);\n if (!range.isEmpty())\n editor.session.remove(range);\n editor.clearSelection();\n },\n scrollIntoView: \"cursor\",\n multiSelectAction: \"forEach\"\n }, {\n name: \"paste\",\n description: \"Paste\",\n exec: function (editor, args) {\n editor.$handlePaste(args);\n },\n scrollIntoView: \"cursor\"\n }, {\n name: \"removeline\",\n description: \"Remove line\",\n bindKey: bindKey(\"Ctrl-D\", \"Command-D\"),\n exec: function (editor) { editor.removeLines(); },\n scrollIntoView: \"cursor\",\n multiSelectAction: \"forEachLine\"\n }, {\n name: \"duplicateSelection\",\n description: \"Duplicate selection\",\n bindKey: bindKey(\"Ctrl-Shift-D\", \"Command-Shift-D\"),\n exec: function (editor) { editor.duplicateSelection(); },\n scrollIntoView: \"cursor\",\n multiSelectAction: \"forEach\"\n }, {\n name: \"sortlines\",\n description: \"Sort lines\",\n bindKey: bindKey(\"Ctrl-Alt-S\", \"Command-Alt-S\"),\n exec: function (editor) { editor.sortLines(); },\n scrollIntoView: \"selection\",\n multiSelectAction: \"forEachLine\"\n }, {\n name: \"togglecomment\",\n description: \"Toggle comment\",\n bindKey: bindKey(\"Ctrl-/\", \"Command-/\"),\n exec: function (editor) { editor.toggleCommentLines(); },\n multiSelectAction: \"forEachLine\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"toggleBlockComment\",\n description: \"Toggle block comment\",\n bindKey: bindKey(\"Ctrl-Shift-/\", \"Command-Shift-/\"),\n exec: function (editor) { editor.toggleBlockComment(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"modifyNumberUp\",\n description: \"Modify number up\",\n bindKey: bindKey(\"Ctrl-Shift-Up\", \"Alt-Shift-Up\"),\n exec: function (editor) { editor.modifyNumber(1); },\n scrollIntoView: \"cursor\",\n multiSelectAction: \"forEach\"\n }, {\n name: \"modifyNumberDown\",\n description: \"Modify number down\",\n bindKey: bindKey(\"Ctrl-Shift-Down\", \"Alt-Shift-Down\"),\n exec: function (editor) { editor.modifyNumber(-1); },\n scrollIntoView: \"cursor\",\n multiSelectAction: \"forEach\"\n }, {\n name: \"replace\",\n description: \"Replace\",\n bindKey: bindKey(\"Ctrl-H\", \"Command-Option-F\"),\n exec: function (editor) {\n config.loadModule(\"ace/ext/searchbox\", function (e) { e.Search(editor, true); });\n }\n }, {\n name: \"undo\",\n description: \"Undo\",\n bindKey: bindKey(\"Ctrl-Z\", \"Command-Z\"),\n exec: function (editor) { editor.undo(); }\n }, {\n name: \"redo\",\n description: \"Redo\",\n bindKey: bindKey(\"Ctrl-Shift-Z|Ctrl-Y\", \"Command-Shift-Z|Command-Y\"),\n exec: function (editor) { editor.redo(); }\n }, {\n name: \"copylinesup\",\n description: \"Copy lines up\",\n bindKey: bindKey(\"Alt-Shift-Up\", \"Command-Option-Up\"),\n exec: function (editor) { editor.copyLinesUp(); },\n scrollIntoView: \"cursor\"\n }, {\n name: \"movelinesup\",\n description: \"Move lines up\",\n bindKey: bindKey(\"Alt-Up\", \"Option-Up\"),\n exec: function (editor) { editor.moveLinesUp(); },\n scrollIntoView: \"cursor\"\n }, {\n name: \"copylinesdown\",\n description: \"Copy lines down\",\n bindKey: bindKey(\"Alt-Shift-Down\", \"Command-Option-Down\"),\n exec: function (editor) { editor.copyLinesDown(); },\n scrollIntoView: \"cursor\"\n }, {\n name: \"movelinesdown\",\n description: \"Move lines down\",\n bindKey: bindKey(\"Alt-Down\", \"Option-Down\"),\n exec: function (editor) { editor.moveLinesDown(); },\n scrollIntoView: \"cursor\"\n }, {\n name: \"del\",\n description: \"Delete\",\n bindKey: bindKey(\"Delete\", \"Delete|Ctrl-D|Shift-Delete\"),\n exec: function (editor) { editor.remove(\"right\"); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"backspace\",\n description: \"Backspace\",\n bindKey: bindKey(\"Shift-Backspace|Backspace\", \"Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H\"),\n exec: function (editor) { editor.remove(\"left\"); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"cut_or_delete\",\n description: \"Cut or delete\",\n bindKey: bindKey(\"Shift-Delete\", null),\n exec: function (editor) {\n if (editor.selection.isEmpty()) {\n editor.remove(\"left\");\n }\n else {\n return false;\n }\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removetolinestart\",\n description: \"Remove to line start\",\n bindKey: bindKey(\"Alt-Backspace\", \"Command-Backspace\"),\n exec: function (editor) { editor.removeToLineStart(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removetolineend\",\n description: \"Remove to line end\",\n bindKey: bindKey(\"Alt-Delete\", \"Ctrl-K|Command-Delete\"),\n exec: function (editor) { editor.removeToLineEnd(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removetolinestarthard\",\n description: \"Remove to line start hard\",\n bindKey: bindKey(\"Ctrl-Shift-Backspace\", null),\n exec: function (editor) {\n var range = editor.selection.getRange();\n range.start.column = 0;\n editor.session.remove(range);\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removetolineendhard\",\n description: \"Remove to line end hard\",\n bindKey: bindKey(\"Ctrl-Shift-Delete\", null),\n exec: function (editor) {\n var range = editor.selection.getRange();\n range.end.column = Number.MAX_VALUE;\n editor.session.remove(range);\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removewordleft\",\n description: \"Remove word left\",\n bindKey: bindKey(\"Ctrl-Backspace\", \"Alt-Backspace|Ctrl-Alt-Backspace\"),\n exec: function (editor) { editor.removeWordLeft(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removewordright\",\n description: \"Remove word right\",\n bindKey: bindKey(\"Ctrl-Delete\", \"Alt-Delete\"),\n exec: function (editor) { editor.removeWordRight(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"outdent\",\n description: \"Outdent\",\n bindKey: bindKey(\"Shift-Tab\", \"Shift-Tab\"),\n exec: function (editor) { editor.blockOutdent(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"indent\",\n description: \"Indent\",\n bindKey: bindKey(\"Tab\", \"Tab\"),\n exec: function (editor) { editor.indent(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"blockoutdent\",\n description: \"Block outdent\",\n bindKey: bindKey(\"Ctrl-[\", \"Ctrl-[\"),\n exec: function (editor) { editor.blockOutdent(); },\n multiSelectAction: \"forEachLine\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"blockindent\",\n description: \"Block indent\",\n bindKey: bindKey(\"Ctrl-]\", \"Ctrl-]\"),\n exec: function (editor) { editor.blockIndent(); },\n multiSelectAction: \"forEachLine\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"insertstring\",\n description: \"Insert string\",\n exec: function (editor, str) { editor.insert(str); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"inserttext\",\n description: \"Insert text\",\n exec: function (editor, args) {\n editor.insert(lang.stringRepeat(args.text || \"\", args.times || 1));\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"splitline\",\n description: \"Split line\",\n bindKey: bindKey(null, \"Ctrl-O\"),\n exec: function (editor) { editor.splitLine(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"transposeletters\",\n description: \"Transpose letters\",\n bindKey: bindKey(\"Alt-Shift-X\", \"Ctrl-T\"),\n exec: function (editor) { editor.transposeLetters(); },\n multiSelectAction: function (editor) { editor.transposeSelections(1); },\n scrollIntoView: \"cursor\"\n }, {\n name: \"touppercase\",\n description: \"To uppercase\",\n bindKey: bindKey(\"Ctrl-U\", \"Ctrl-U\"),\n exec: function (editor) { editor.toUpperCase(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"tolowercase\",\n description: \"To lowercase\",\n bindKey: bindKey(\"Ctrl-Shift-U\", \"Ctrl-Shift-U\"),\n exec: function (editor) { editor.toLowerCase(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"autoindent\",\n description: \"Auto Indent\",\n bindKey: bindKey(null, null),\n exec: function (editor) { editor.autoIndent(); },\n multiSelectAction: \"forEachLine\",\n scrollIntoView: \"animate\"\n }, {\n name: \"expandtoline\",\n description: \"Expand to line\",\n bindKey: bindKey(\"Ctrl-Shift-L\", \"Command-Shift-L\"),\n exec: function (editor) {\n var range = editor.selection.getRange();\n range.start.column = range.end.column = 0;\n range.end.row++;\n editor.selection.setRange(range, false);\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"openlink\",\n bindKey: bindKey(\"Ctrl+F3\", \"F3\"),\n exec: function (editor) { editor.openLink(); }\n }, {\n name: \"joinlines\",\n description: \"Join lines\",\n bindKey: bindKey(null, null),\n exec: function (editor) {\n var isBackwards = editor.selection.isBackwards();\n var selectionStart = isBackwards ? editor.selection.getSelectionLead() : editor.selection.getSelectionAnchor();\n var selectionEnd = isBackwards ? editor.selection.getSelectionAnchor() : editor.selection.getSelectionLead();\n var firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length;\n var selectedText = editor.session.doc.getTextRange(editor.selection.getRange());\n var selectedCount = selectedText.replace(/\\n\\s*/, \" \").length;\n var insertLine = editor.session.doc.getLine(selectionStart.row);\n for (var i = selectionStart.row + 1; i <= selectionEnd.row + 1; i++) {\n var curLine = lang.stringTrimLeft(lang.stringTrimRight(editor.session.doc.getLine(i)));\n if (curLine.length !== 0) {\n curLine = \" \" + curLine;\n }\n insertLine += curLine;\n }\n if (selectionEnd.row + 1 < (editor.session.doc.getLength() - 1)) {\n insertLine += editor.session.doc.getNewLineCharacter();\n }\n editor.clearSelection();\n editor.session.doc.replace(new Range(selectionStart.row, 0, selectionEnd.row + 2, 0), insertLine);\n if (selectedCount > 0) {\n editor.selection.moveCursorTo(selectionStart.row, selectionStart.column);\n editor.selection.selectTo(selectionStart.row, selectionStart.column + selectedCount);\n }\n else {\n firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length > firstLineEndCol ? (firstLineEndCol + 1) : firstLineEndCol;\n editor.selection.moveCursorTo(selectionStart.row, firstLineEndCol);\n }\n },\n multiSelectAction: \"forEach\",\n readOnly: true\n }, {\n name: \"invertSelection\",\n description: \"Invert selection\",\n bindKey: bindKey(null, null),\n exec: function (editor) {\n var endRow = editor.session.doc.getLength() - 1;\n var endCol = editor.session.doc.getLine(endRow).length;\n var ranges = editor.selection.rangeList.ranges;\n var newRanges = [];\n if (ranges.length < 1) {\n ranges = [editor.selection.getRange()];\n }\n for (var i = 0; i < ranges.length; i++) {\n if (i == (ranges.length - 1)) {\n if (!(ranges[i].end.row === endRow && ranges[i].end.column === endCol)) {\n newRanges.push(new Range(ranges[i].end.row, ranges[i].end.column, endRow, endCol));\n }\n }\n if (i === 0) {\n if (!(ranges[i].start.row === 0 && ranges[i].start.column === 0)) {\n newRanges.push(new Range(0, 0, ranges[i].start.row, ranges[i].start.column));\n }\n }\n else {\n newRanges.push(new Range(ranges[i - 1].end.row, ranges[i - 1].end.column, ranges[i].start.row, ranges[i].start.column));\n }\n }\n editor.exitMultiSelectMode();\n editor.clearSelection();\n for (var i = 0; i < newRanges.length; i++) {\n editor.selection.addRange(newRanges[i], false);\n }\n },\n readOnly: true,\n scrollIntoView: \"none\"\n }, {\n name: \"addLineAfter\",\n description: \"Add new line after the current line\",\n exec: function (editor) {\n editor.selection.clearSelection();\n editor.navigateLineEnd();\n editor.insert(\"\\n\");\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"addLineBefore\",\n description: \"Add new line before the current line\",\n exec: function (editor) {\n editor.selection.clearSelection();\n var cursor = editor.getCursorPosition();\n editor.selection.moveTo(cursor.row - 1, Number.MAX_VALUE);\n editor.insert(\"\\n\");\n if (cursor.row === 0)\n editor.navigateUp();\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"openCommandPallete\",\n description: \"Open command palette\",\n bindKey: bindKey(\"F1\", \"F1\"),\n exec: function (editor) {\n editor.prompt({ $type: \"commands\" });\n },\n readOnly: true\n }, {\n name: \"modeSelect\",\n description: \"Change language mode...\",\n bindKey: bindKey(null, null),\n exec: function (editor) {\n editor.prompt({ $type: \"modes\" });\n },\n readOnly: true\n }];\nfor (var i = 1; i < 9; i++) {\n exports.commands.push({\n name: \"foldToLevel\" + i,\n description: \"Fold To Level \" + i,\n level: i,\n exec: function (editor) { editor.session.foldToLevel(this.level); },\n scrollIntoView: \"center\",\n readOnly: true\n });\n}\n\n});\n\nace.define(\"ace/editor\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/lang\",\"ace/lib/useragent\",\"ace/keyboard/textinput\",\"ace/mouse/mouse_handler\",\"ace/mouse/fold_handler\",\"ace/keyboard/keybinding\",\"ace/edit_session\",\"ace/search\",\"ace/range\",\"ace/lib/event_emitter\",\"ace/commands/command_manager\",\"ace/commands/default_commands\",\"ace/config\",\"ace/token_iterator\",\"ace/clipboard\"], function(require, exports, module){\"use strict\";\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar oop = require(\"./lib/oop\");\nvar dom = require(\"./lib/dom\");\nvar lang = require(\"./lib/lang\");\nvar useragent = require(\"./lib/useragent\");\nvar TextInput = require(\"./keyboard/textinput\").TextInput;\nvar MouseHandler = require(\"./mouse/mouse_handler\").MouseHandler;\nvar FoldHandler = require(\"./mouse/fold_handler\").FoldHandler;\nvar KeyBinding = require(\"./keyboard/keybinding\").KeyBinding;\nvar EditSession = require(\"./edit_session\").EditSession;\nvar Search = require(\"./search\").Search;\nvar Range = require(\"./range\").Range;\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar CommandManager = require(\"./commands/command_manager\").CommandManager;\nvar defaultCommands = require(\"./commands/default_commands\").commands;\nvar config = require(\"./config\");\nvar TokenIterator = require(\"./token_iterator\").TokenIterator;\nvar clipboard = require(\"./clipboard\");\nvar Editor = function (renderer, session, options) {\n this.$toDestroy = [];\n var container = renderer.getContainerElement();\n this.container = container;\n this.renderer = renderer;\n this.id = \"editor\" + (++Editor.$uid);\n this.commands = new CommandManager(useragent.isMac ? \"mac\" : \"win\", defaultCommands);\n if (typeof document == \"object\") {\n this.textInput = new TextInput(renderer.getTextAreaContainer(), this);\n this.renderer.textarea = this.textInput.getElement();\n this.$mouseHandler = new MouseHandler(this);\n new FoldHandler(this);\n }\n this.keyBinding = new KeyBinding(this);\n this.$search = new Search().set({\n wrap: true\n });\n this.$historyTracker = this.$historyTracker.bind(this);\n this.commands.on(\"exec\", this.$historyTracker);\n this.$initOperationListeners();\n this._$emitInputEvent = lang.delayedCall(function () {\n this._signal(\"input\", {});\n if (this.session && !this.session.destroyed)\n this.session.bgTokenizer.scheduleStart();\n }.bind(this));\n this.on(\"change\", function (_, _self) {\n _self._$emitInputEvent.schedule(31);\n });\n this.setSession(session || options && options.session || new EditSession(\"\"));\n config.resetOptions(this);\n if (options)\n this.setOptions(options);\n config._signal(\"editor\", this);\n};\nEditor.$uid = 0;\n(function () {\n oop.implement(this, EventEmitter);\n this.$initOperationListeners = function () {\n this.commands.on(\"exec\", this.startOperation.bind(this), true);\n this.commands.on(\"afterExec\", this.endOperation.bind(this), true);\n this.$opResetTimer = lang.delayedCall(this.endOperation.bind(this, true));\n this.on(\"change\", function () {\n if (!this.curOp) {\n this.startOperation();\n this.curOp.selectionBefore = this.$lastSel;\n }\n this.curOp.docChanged = true;\n }.bind(this), true);\n this.on(\"changeSelection\", function () {\n if (!this.curOp) {\n this.startOperation();\n this.curOp.selectionBefore = this.$lastSel;\n }\n this.curOp.selectionChanged = true;\n }.bind(this), true);\n };\n this.curOp = null;\n this.prevOp = {};\n this.startOperation = function (commandEvent) {\n if (this.curOp) {\n if (!commandEvent || this.curOp.command)\n return;\n this.prevOp = this.curOp;\n }\n if (!commandEvent) {\n this.previousCommand = null;\n commandEvent = {};\n }\n this.$opResetTimer.schedule();\n this.curOp = this.session.curOp = {\n command: commandEvent.command || {},\n args: commandEvent.args,\n scrollTop: this.renderer.scrollTop\n };\n this.curOp.selectionBefore = this.selection.toJSON();\n };\n this.endOperation = function (e) {\n if (this.curOp && this.session) {\n if (e && e.returnValue === false || !this.session)\n return (this.curOp = null);\n if (e == true && this.curOp.command && this.curOp.command.name == \"mouse\")\n return;\n this._signal(\"beforeEndOperation\");\n if (!this.curOp)\n return;\n var command = this.curOp.command;\n var scrollIntoView = command && command.scrollIntoView;\n if (scrollIntoView) {\n switch (scrollIntoView) {\n case \"center-animate\":\n scrollIntoView = \"animate\";\n case \"center\":\n this.renderer.scrollCursorIntoView(null, 0.5);\n break;\n case \"animate\":\n case \"cursor\":\n this.renderer.scrollCursorIntoView();\n break;\n case \"selectionPart\":\n var range = this.selection.getRange();\n var config = this.renderer.layerConfig;\n if (range.start.row >= config.lastRow || range.end.row <= config.firstRow) {\n this.renderer.scrollSelectionIntoView(this.selection.anchor, this.selection.lead);\n }\n break;\n default:\n break;\n }\n if (scrollIntoView == \"animate\")\n this.renderer.animateScrolling(this.curOp.scrollTop);\n }\n var sel = this.selection.toJSON();\n this.curOp.selectionAfter = sel;\n this.$lastSel = this.selection.toJSON();\n this.session.getUndoManager().addSelection(sel);\n this.prevOp = this.curOp;\n this.curOp = null;\n }\n };\n this.$mergeableCommands = [\"backspace\", \"del\", \"insertstring\"];\n this.$historyTracker = function (e) {\n if (!this.$mergeUndoDeltas)\n return;\n var prev = this.prevOp;\n var mergeableCommands = this.$mergeableCommands;\n var shouldMerge = prev.command && (e.command.name == prev.command.name);\n if (e.command.name == \"insertstring\") {\n var text = e.args;\n if (this.mergeNextCommand === undefined)\n this.mergeNextCommand = true;\n shouldMerge = shouldMerge\n && this.mergeNextCommand // previous command allows to coalesce with\n && (!/\\s/.test(text) || /\\s/.test(prev.args)); // previous insertion was of same type\n this.mergeNextCommand = true;\n }\n else {\n shouldMerge = shouldMerge\n && mergeableCommands.indexOf(e.command.name) !== -1; // the command is mergeable\n }\n if (this.$mergeUndoDeltas != \"always\"\n && Date.now() - this.sequenceStartTime > 2000) {\n shouldMerge = false; // the sequence is too long\n }\n if (shouldMerge)\n this.session.mergeUndoDeltas = true;\n else if (mergeableCommands.indexOf(e.command.name) !== -1)\n this.sequenceStartTime = Date.now();\n };\n this.setKeyboardHandler = function (keyboardHandler, cb) {\n if (keyboardHandler && typeof keyboardHandler === \"string\" && keyboardHandler != \"ace\") {\n this.$keybindingId = keyboardHandler;\n var _self = this;\n config.loadModule([\"keybinding\", keyboardHandler], function (module) {\n if (_self.$keybindingId == keyboardHandler)\n _self.keyBinding.setKeyboardHandler(module && module.handler);\n cb && cb();\n });\n }\n else {\n this.$keybindingId = null;\n this.keyBinding.setKeyboardHandler(keyboardHandler);\n cb && cb();\n }\n };\n this.getKeyboardHandler = function () {\n return this.keyBinding.getKeyboardHandler();\n };\n this.setSession = function (session) {\n if (this.session == session)\n return;\n if (this.curOp)\n this.endOperation();\n this.curOp = {};\n var oldSession = this.session;\n if (oldSession) {\n this.session.off(\"change\", this.$onDocumentChange);\n this.session.off(\"changeMode\", this.$onChangeMode);\n this.session.off(\"tokenizerUpdate\", this.$onTokenizerUpdate);\n this.session.off(\"changeTabSize\", this.$onChangeTabSize);\n this.session.off(\"changeWrapLimit\", this.$onChangeWrapLimit);\n this.session.off(\"changeWrapMode\", this.$onChangeWrapMode);\n this.session.off(\"changeFold\", this.$onChangeFold);\n this.session.off(\"changeFrontMarker\", this.$onChangeFrontMarker);\n this.session.off(\"changeBackMarker\", this.$onChangeBackMarker);\n this.session.off(\"changeBreakpoint\", this.$onChangeBreakpoint);\n this.session.off(\"changeAnnotation\", this.$onChangeAnnotation);\n this.session.off(\"changeOverwrite\", this.$onCursorChange);\n this.session.off(\"changeScrollTop\", this.$onScrollTopChange);\n this.session.off(\"changeScrollLeft\", this.$onScrollLeftChange);\n var selection = this.session.getSelection();\n selection.off(\"changeCursor\", this.$onCursorChange);\n selection.off(\"changeSelection\", this.$onSelectionChange);\n }\n this.session = session;\n if (session) {\n this.$onDocumentChange = this.onDocumentChange.bind(this);\n session.on(\"change\", this.$onDocumentChange);\n this.renderer.setSession(session);\n this.$onChangeMode = this.onChangeMode.bind(this);\n session.on(\"changeMode\", this.$onChangeMode);\n this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this);\n session.on(\"tokenizerUpdate\", this.$onTokenizerUpdate);\n this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer);\n session.on(\"changeTabSize\", this.$onChangeTabSize);\n this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this);\n session.on(\"changeWrapLimit\", this.$onChangeWrapLimit);\n this.$onChangeWrapMode = this.onChangeWrapMode.bind(this);\n session.on(\"changeWrapMode\", this.$onChangeWrapMode);\n this.$onChangeFold = this.onChangeFold.bind(this);\n session.on(\"changeFold\", this.$onChangeFold);\n this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this);\n this.session.on(\"changeFrontMarker\", this.$onChangeFrontMarker);\n this.$onChangeBackMarker = this.onChangeBackMarker.bind(this);\n this.session.on(\"changeBackMarker\", this.$onChangeBackMarker);\n this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this);\n this.session.on(\"changeBreakpoint\", this.$onChangeBreakpoint);\n this.$onChangeAnnotation = this.onChangeAnnotation.bind(this);\n this.session.on(\"changeAnnotation\", this.$onChangeAnnotation);\n this.$onCursorChange = this.onCursorChange.bind(this);\n this.session.on(\"changeOverwrite\", this.$onCursorChange);\n this.$onScrollTopChange = this.onScrollTopChange.bind(this);\n this.session.on(\"changeScrollTop\", this.$onScrollTopChange);\n this.$onScrollLeftChange = this.onScrollLeftChange.bind(this);\n this.session.on(\"changeScrollLeft\", this.$onScrollLeftChange);\n this.selection = session.getSelection();\n this.selection.on(\"changeCursor\", this.$onCursorChange);\n this.$onSelectionChange = this.onSelectionChange.bind(this);\n this.selection.on(\"changeSelection\", this.$onSelectionChange);\n this.onChangeMode();\n this.onCursorChange();\n this.onScrollTopChange();\n this.onScrollLeftChange();\n this.onSelectionChange();\n this.onChangeFrontMarker();\n this.onChangeBackMarker();\n this.onChangeBreakpoint();\n this.onChangeAnnotation();\n this.session.getUseWrapMode() && this.renderer.adjustWrapLimit();\n this.renderer.updateFull();\n }\n else {\n this.selection = null;\n this.renderer.setSession(session);\n }\n this._signal(\"changeSession\", {\n session: session,\n oldSession: oldSession\n });\n this.curOp = null;\n oldSession && oldSession._signal(\"changeEditor\", { oldEditor: this });\n session && session._signal(\"changeEditor\", { editor: this });\n if (session && !session.destroyed)\n session.bgTokenizer.scheduleStart();\n };\n this.getSession = function () {\n return this.session;\n };\n this.setValue = function (val, cursorPos) {\n this.session.doc.setValue(val);\n if (!cursorPos)\n this.selectAll();\n else if (cursorPos == 1)\n this.navigateFileEnd();\n else if (cursorPos == -1)\n this.navigateFileStart();\n return val;\n };\n this.getValue = function () {\n return this.session.getValue();\n };\n this.getSelection = function () {\n return this.selection;\n };\n this.resize = function (force) {\n this.renderer.onResize(force);\n };\n this.setTheme = function (theme, cb) {\n this.renderer.setTheme(theme, cb);\n };\n this.getTheme = function () {\n return this.renderer.getTheme();\n };\n this.setStyle = function (style) {\n this.renderer.setStyle(style);\n };\n this.unsetStyle = function (style) {\n this.renderer.unsetStyle(style);\n };\n this.getFontSize = function () {\n return this.getOption(\"fontSize\") ||\n dom.computedStyle(this.container).fontSize;\n };\n this.setFontSize = function (size) {\n this.setOption(\"fontSize\", size);\n };\n this.$highlightBrackets = function () {\n if (this.$highlightPending) {\n return;\n }\n var self = this;\n this.$highlightPending = true;\n setTimeout(function () {\n self.$highlightPending = false;\n var session = self.session;\n if (!session || session.destroyed)\n return;\n if (session.$bracketHighlight) {\n session.$bracketHighlight.markerIds.forEach(function (id) {\n session.removeMarker(id);\n });\n session.$bracketHighlight = null;\n }\n var pos = self.getCursorPosition();\n var handler = self.getKeyboardHandler();\n var isBackwards = handler && handler.$getDirectionForHighlight && handler.$getDirectionForHighlight(self);\n var ranges = session.getMatchingBracketRanges(pos, isBackwards);\n if (!ranges) {\n var iterator = new TokenIterator(session, pos.row, pos.column);\n var token = iterator.getCurrentToken();\n if (token && /\\b(?:tag-open|tag-name)/.test(token.type)) {\n var tagNamesRanges = session.getMatchingTags(pos);\n if (tagNamesRanges)\n ranges = [tagNamesRanges.openTagName, tagNamesRanges.closeTagName];\n }\n }\n if (!ranges && session.$mode.getMatching)\n ranges = session.$mode.getMatching(self.session);\n if (!ranges) {\n if (self.getHighlightIndentGuides())\n self.renderer.$textLayer.$highlightIndentGuide();\n return;\n }\n var markerType = \"ace_bracket\";\n if (!Array.isArray(ranges)) {\n ranges = [ranges];\n }\n else if (ranges.length == 1) {\n markerType = \"ace_error_bracket\";\n }\n if (ranges.length == 2) {\n if (Range.comparePoints(ranges[0].end, ranges[1].start) == 0)\n ranges = [Range.fromPoints(ranges[0].start, ranges[1].end)];\n else if (Range.comparePoints(ranges[0].start, ranges[1].end) == 0)\n ranges = [Range.fromPoints(ranges[1].start, ranges[0].end)];\n }\n session.$bracketHighlight = {\n ranges: ranges,\n markerIds: ranges.map(function (range) {\n return session.addMarker(range, markerType, \"text\");\n })\n };\n if (self.getHighlightIndentGuides())\n self.renderer.$textLayer.$highlightIndentGuide();\n }, 50);\n };\n this.focus = function () {\n this.textInput.focus();\n };\n this.isFocused = function () {\n return this.textInput.isFocused();\n };\n this.blur = function () {\n this.textInput.blur();\n };\n this.onFocus = function (e) {\n if (this.$isFocused)\n return;\n this.$isFocused = true;\n this.renderer.showCursor();\n this.renderer.visualizeFocus();\n this._emit(\"focus\", e);\n };\n this.onBlur = function (e) {\n if (!this.$isFocused)\n return;\n this.$isFocused = false;\n this.renderer.hideCursor();\n this.renderer.visualizeBlur();\n this._emit(\"blur\", e);\n };\n this.$cursorChange = function () {\n this.renderer.updateCursor();\n this.$highlightBrackets();\n this.$updateHighlightActiveLine();\n };\n this.onDocumentChange = function (delta) {\n var wrap = this.session.$useWrapMode;\n var lastRow = (delta.start.row == delta.end.row ? delta.end.row : Infinity);\n this.renderer.updateLines(delta.start.row, lastRow, wrap);\n this._signal(\"change\", delta);\n this.$cursorChange();\n };\n this.onTokenizerUpdate = function (e) {\n var rows = e.data;\n this.renderer.updateLines(rows.first, rows.last);\n };\n this.onScrollTopChange = function () {\n this.renderer.scrollToY(this.session.getScrollTop());\n };\n this.onScrollLeftChange = function () {\n this.renderer.scrollToX(this.session.getScrollLeft());\n };\n this.onCursorChange = function () {\n this.$cursorChange();\n this._signal(\"changeSelection\");\n };\n this.$updateHighlightActiveLine = function () {\n var session = this.getSession();\n var highlight;\n if (this.$highlightActiveLine) {\n if (this.$selectionStyle != \"line\" || !this.selection.isMultiLine())\n highlight = this.getCursorPosition();\n if (this.renderer.theme && this.renderer.theme.$selectionColorConflict && !this.selection.isEmpty())\n highlight = false;\n if (this.renderer.$maxLines && this.session.getLength() === 1 && !(this.renderer.$minLines > 1))\n highlight = false;\n }\n if (session.$highlightLineMarker && !highlight) {\n session.removeMarker(session.$highlightLineMarker.id);\n session.$highlightLineMarker = null;\n }\n else if (!session.$highlightLineMarker && highlight) {\n var range = new Range(highlight.row, highlight.column, highlight.row, Infinity);\n range.id = session.addMarker(range, \"ace_active-line\", \"screenLine\");\n session.$highlightLineMarker = range;\n }\n else if (highlight) {\n session.$highlightLineMarker.start.row = highlight.row;\n session.$highlightLineMarker.end.row = highlight.row;\n session.$highlightLineMarker.start.column = highlight.column;\n session._signal(\"changeBackMarker\");\n }\n };\n this.onSelectionChange = function (e) {\n var session = this.session;\n if (session.$selectionMarker) {\n session.removeMarker(session.$selectionMarker);\n }\n session.$selectionMarker = null;\n if (!this.selection.isEmpty()) {\n var range = this.selection.getRange();\n var style = this.getSelectionStyle();\n session.$selectionMarker = session.addMarker(range, \"ace_selection\", style);\n }\n else {\n this.$updateHighlightActiveLine();\n }\n var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp();\n this.session.highlight(re);\n this._signal(\"changeSelection\");\n };\n this.$getSelectionHighLightRegexp = function () {\n var session = this.session;\n var selection = this.getSelectionRange();\n if (selection.isEmpty() || selection.isMultiLine())\n return;\n var startColumn = selection.start.column;\n var endColumn = selection.end.column;\n var line = session.getLine(selection.start.row);\n var needle = line.substring(startColumn, endColumn);\n if (needle.length > 5000 || !/[\\w\\d]/.test(needle))\n return;\n var re = this.$search.$assembleRegExp({\n wholeWord: true,\n caseSensitive: true,\n needle: needle\n });\n var wordWithBoundary = line.substring(startColumn - 1, endColumn + 1);\n if (!re.test(wordWithBoundary))\n return;\n return re;\n };\n this.onChangeFrontMarker = function () {\n this.renderer.updateFrontMarkers();\n };\n this.onChangeBackMarker = function () {\n this.renderer.updateBackMarkers();\n };\n this.onChangeBreakpoint = function () {\n this.renderer.updateBreakpoints();\n };\n this.onChangeAnnotation = function () {\n this.renderer.setAnnotations(this.session.getAnnotations());\n };\n this.onChangeMode = function (e) {\n this.renderer.updateText();\n this._emit(\"changeMode\", e);\n };\n this.onChangeWrapLimit = function () {\n this.renderer.updateFull();\n };\n this.onChangeWrapMode = function () {\n this.renderer.onResize(true);\n };\n this.onChangeFold = function () {\n this.$updateHighlightActiveLine();\n this.renderer.updateFull();\n };\n this.getSelectedText = function () {\n return this.session.getTextRange(this.getSelectionRange());\n };\n this.getCopyText = function () {\n var text = this.getSelectedText();\n var nl = this.session.doc.getNewLineCharacter();\n var copyLine = false;\n if (!text && this.$copyWithEmptySelection) {\n copyLine = true;\n var ranges = this.selection.getAllRanges();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (i && ranges[i - 1].start.row == range.start.row)\n continue;\n text += this.session.getLine(range.start.row) + nl;\n }\n }\n var e = { text: text };\n this._signal(\"copy\", e);\n clipboard.lineMode = copyLine ? e.text : false;\n return e.text;\n };\n this.onCopy = function () {\n this.commands.exec(\"copy\", this);\n };\n this.onCut = function () {\n this.commands.exec(\"cut\", this);\n };\n this.onPaste = function (text, event) {\n var e = { text: text, event: event };\n this.commands.exec(\"paste\", this, e);\n };\n this.$handlePaste = function (e) {\n if (typeof e == \"string\")\n e = { text: e };\n this._signal(\"paste\", e);\n var text = e.text;\n var lineMode = text === clipboard.lineMode;\n var session = this.session;\n if (!this.inMultiSelectMode || this.inVirtualSelectionMode) {\n if (lineMode)\n session.insert({ row: this.selection.lead.row, column: 0 }, text);\n else\n this.insert(text);\n }\n else if (lineMode) {\n this.selection.rangeList.ranges.forEach(function (range) {\n session.insert({ row: range.start.row, column: 0 }, text);\n });\n }\n else {\n var lines = text.split(/\\r\\n|\\r|\\n/);\n var ranges = this.selection.rangeList.ranges;\n var isFullLine = lines.length == 2 && (!lines[0] || !lines[1]);\n if (lines.length != ranges.length || isFullLine)\n return this.commands.exec(\"insertstring\", this, text);\n for (var i = ranges.length; i--;) {\n var range = ranges[i];\n if (!range.isEmpty())\n session.remove(range);\n session.insert(range.start, lines[i]);\n }\n }\n };\n this.execCommand = function (command, args) {\n return this.commands.exec(command, this, args);\n };\n this.insert = function (text, pasted) {\n var session = this.session;\n var mode = session.getMode();\n var cursor = this.getCursorPosition();\n if (this.getBehavioursEnabled() && !pasted) {\n var transform = mode.transformAction(session.getState(cursor.row), 'insertion', this, session, text);\n if (transform) {\n if (text !== transform.text) {\n if (!this.inVirtualSelectionMode) {\n this.session.mergeUndoDeltas = false;\n this.mergeNextCommand = false;\n }\n }\n text = transform.text;\n }\n }\n if (text == \"\\t\")\n text = this.session.getTabString();\n if (!this.selection.isEmpty()) {\n var range = this.getSelectionRange();\n cursor = this.session.remove(range);\n this.clearSelection();\n }\n else if (this.session.getOverwrite() && text.indexOf(\"\\n\") == -1) {\n var range = new Range.fromPoints(cursor, cursor);\n range.end.column += text.length;\n this.session.remove(range);\n }\n if (text == \"\\n\" || text == \"\\r\\n\") {\n var line = session.getLine(cursor.row);\n if (cursor.column > line.search(/\\S|$/)) {\n var d = line.substr(cursor.column).search(/\\S|$/);\n session.doc.removeInLine(cursor.row, cursor.column, cursor.column + d);\n }\n }\n this.clearSelection();\n var start = cursor.column;\n var lineState = session.getState(cursor.row);\n var line = session.getLine(cursor.row);\n var shouldOutdent = mode.checkOutdent(lineState, line, text);\n session.insert(cursor, text);\n if (transform && transform.selection) {\n if (transform.selection.length == 2) { // Transform relative to the current column\n this.selection.setSelectionRange(new Range(cursor.row, start + transform.selection[0], cursor.row, start + transform.selection[1]));\n }\n else { // Transform relative to the current row.\n this.selection.setSelectionRange(new Range(cursor.row + transform.selection[0], transform.selection[1], cursor.row + transform.selection[2], transform.selection[3]));\n }\n }\n if (this.$enableAutoIndent) {\n if (session.getDocument().isNewLine(text)) {\n var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString());\n session.insert({ row: cursor.row + 1, column: 0 }, lineIndent);\n }\n if (shouldOutdent)\n mode.autoOutdent(lineState, session, cursor.row);\n }\n };\n this.autoIndent = function () {\n var session = this.session;\n var mode = session.getMode();\n var startRow, endRow;\n if (this.selection.isEmpty()) {\n startRow = 0;\n endRow = session.doc.getLength() - 1;\n }\n else {\n var selectedRange = this.getSelectionRange();\n startRow = selectedRange.start.row;\n endRow = selectedRange.end.row;\n }\n var prevLineState = \"\";\n var prevLine = \"\";\n var lineIndent = \"\";\n var line, currIndent, range;\n var tab = session.getTabString();\n for (var row = startRow; row <= endRow; row++) {\n if (row > 0) {\n prevLineState = session.getState(row - 1);\n prevLine = session.getLine(row - 1);\n lineIndent = mode.getNextLineIndent(prevLineState, prevLine, tab);\n }\n line = session.getLine(row);\n currIndent = mode.$getIndent(line);\n if (lineIndent !== currIndent) {\n if (currIndent.length > 0) {\n range = new Range(row, 0, row, currIndent.length);\n session.remove(range);\n }\n if (lineIndent.length > 0) {\n session.insert({ row: row, column: 0 }, lineIndent);\n }\n }\n mode.autoOutdent(prevLineState, session, row);\n }\n };\n this.onTextInput = function (text, composition) {\n if (!composition)\n return this.keyBinding.onTextInput(text);\n this.startOperation({ command: { name: \"insertstring\" } });\n var applyComposition = this.applyComposition.bind(this, text, composition);\n if (this.selection.rangeCount)\n this.forEachSelection(applyComposition);\n else\n applyComposition();\n this.endOperation();\n };\n this.applyComposition = function (text, composition) {\n if (composition.extendLeft || composition.extendRight) {\n var r = this.selection.getRange();\n r.start.column -= composition.extendLeft;\n r.end.column += composition.extendRight;\n if (r.start.column < 0) {\n r.start.row--;\n r.start.column += this.session.getLine(r.start.row).length + 1;\n }\n this.selection.setRange(r);\n if (!text && !r.isEmpty())\n this.remove();\n }\n if (text || !this.selection.isEmpty())\n this.insert(text, true);\n if (composition.restoreStart || composition.restoreEnd) {\n var r = this.selection.getRange();\n r.start.column -= composition.restoreStart;\n r.end.column -= composition.restoreEnd;\n this.selection.setRange(r);\n }\n };\n this.onCommandKey = function (e, hashId, keyCode) {\n return this.keyBinding.onCommandKey(e, hashId, keyCode);\n };\n this.setOverwrite = function (overwrite) {\n this.session.setOverwrite(overwrite);\n };\n this.getOverwrite = function () {\n return this.session.getOverwrite();\n };\n this.toggleOverwrite = function () {\n this.session.toggleOverwrite();\n };\n this.setScrollSpeed = function (speed) {\n this.setOption(\"scrollSpeed\", speed);\n };\n this.getScrollSpeed = function () {\n return this.getOption(\"scrollSpeed\");\n };\n this.setDragDelay = function (dragDelay) {\n this.setOption(\"dragDelay\", dragDelay);\n };\n this.getDragDelay = function () {\n return this.getOption(\"dragDelay\");\n };\n this.setSelectionStyle = function (val) {\n this.setOption(\"selectionStyle\", val);\n };\n this.getSelectionStyle = function () {\n return this.getOption(\"selectionStyle\");\n };\n this.setHighlightActiveLine = function (shouldHighlight) {\n this.setOption(\"highlightActiveLine\", shouldHighlight);\n };\n this.getHighlightActiveLine = function () {\n return this.getOption(\"highlightActiveLine\");\n };\n this.setHighlightGutterLine = function (shouldHighlight) {\n this.setOption(\"highlightGutterLine\", shouldHighlight);\n };\n this.getHighlightGutterLine = function () {\n return this.getOption(\"highlightGutterLine\");\n };\n this.setHighlightSelectedWord = function (shouldHighlight) {\n this.setOption(\"highlightSelectedWord\", shouldHighlight);\n };\n this.getHighlightSelectedWord = function () {\n return this.$highlightSelectedWord;\n };\n this.setAnimatedScroll = function (shouldAnimate) {\n this.renderer.setAnimatedScroll(shouldAnimate);\n };\n this.getAnimatedScroll = function () {\n return this.renderer.getAnimatedScroll();\n };\n this.setShowInvisibles = function (showInvisibles) {\n this.renderer.setShowInvisibles(showInvisibles);\n };\n this.getShowInvisibles = function () {\n return this.renderer.getShowInvisibles();\n };\n this.setDisplayIndentGuides = function (display) {\n this.renderer.setDisplayIndentGuides(display);\n };\n this.getDisplayIndentGuides = function () {\n return this.renderer.getDisplayIndentGuides();\n };\n this.setHighlightIndentGuides = function (highlight) {\n this.renderer.setHighlightIndentGuides(highlight);\n };\n this.getHighlightIndentGuides = function () {\n return this.renderer.getHighlightIndentGuides();\n };\n this.setShowPrintMargin = function (showPrintMargin) {\n this.renderer.setShowPrintMargin(showPrintMargin);\n };\n this.getShowPrintMargin = function () {\n return this.renderer.getShowPrintMargin();\n };\n this.setPrintMarginColumn = function (showPrintMargin) {\n this.renderer.setPrintMarginColumn(showPrintMargin);\n };\n this.getPrintMarginColumn = function () {\n return this.renderer.getPrintMarginColumn();\n };\n this.setReadOnly = function (readOnly) {\n this.setOption(\"readOnly\", readOnly);\n };\n this.getReadOnly = function () {\n return this.getOption(\"readOnly\");\n };\n this.setBehavioursEnabled = function (enabled) {\n this.setOption(\"behavioursEnabled\", enabled);\n };\n this.getBehavioursEnabled = function () {\n return this.getOption(\"behavioursEnabled\");\n };\n this.setWrapBehavioursEnabled = function (enabled) {\n this.setOption(\"wrapBehavioursEnabled\", enabled);\n };\n this.getWrapBehavioursEnabled = function () {\n return this.getOption(\"wrapBehavioursEnabled\");\n };\n this.setShowFoldWidgets = function (show) {\n this.setOption(\"showFoldWidgets\", show);\n };\n this.getShowFoldWidgets = function () {\n return this.getOption(\"showFoldWidgets\");\n };\n this.setFadeFoldWidgets = function (fade) {\n this.setOption(\"fadeFoldWidgets\", fade);\n };\n this.getFadeFoldWidgets = function () {\n return this.getOption(\"fadeFoldWidgets\");\n };\n this.remove = function (dir) {\n if (this.selection.isEmpty()) {\n if (dir == \"left\")\n this.selection.selectLeft();\n else\n this.selection.selectRight();\n }\n var range = this.getSelectionRange();\n if (this.getBehavioursEnabled()) {\n var session = this.session;\n var state = session.getState(range.start.row);\n var new_range = session.getMode().transformAction(state, 'deletion', this, session, range);\n if (range.end.column === 0) {\n var text = session.getTextRange(range);\n if (text[text.length - 1] == \"\\n\") {\n var line = session.getLine(range.end.row);\n if (/^\\s+$/.test(line)) {\n range.end.column = line.length;\n }\n }\n }\n if (new_range)\n range = new_range;\n }\n this.session.remove(range);\n this.clearSelection();\n };\n this.removeWordRight = function () {\n if (this.selection.isEmpty())\n this.selection.selectWordRight();\n this.session.remove(this.getSelectionRange());\n this.clearSelection();\n };\n this.removeWordLeft = function () {\n if (this.selection.isEmpty())\n this.selection.selectWordLeft();\n this.session.remove(this.getSelectionRange());\n this.clearSelection();\n };\n this.removeToLineStart = function () {\n if (this.selection.isEmpty())\n this.selection.selectLineStart();\n if (this.selection.isEmpty())\n this.selection.selectLeft();\n this.session.remove(this.getSelectionRange());\n this.clearSelection();\n };\n this.removeToLineEnd = function () {\n if (this.selection.isEmpty())\n this.selection.selectLineEnd();\n var range = this.getSelectionRange();\n if (range.start.column == range.end.column && range.start.row == range.end.row) {\n range.end.column = 0;\n range.end.row++;\n }\n this.session.remove(range);\n this.clearSelection();\n };\n this.splitLine = function () {\n if (!this.selection.isEmpty()) {\n this.session.remove(this.getSelectionRange());\n this.clearSelection();\n }\n var cursor = this.getCursorPosition();\n this.insert(\"\\n\");\n this.moveCursorToPosition(cursor);\n };\n this.transposeLetters = function () {\n if (!this.selection.isEmpty()) {\n return;\n }\n var cursor = this.getCursorPosition();\n var column = cursor.column;\n if (column === 0)\n return;\n var line = this.session.getLine(cursor.row);\n var swap, range;\n if (column < line.length) {\n swap = line.charAt(column) + line.charAt(column - 1);\n range = new Range(cursor.row, column - 1, cursor.row, column + 1);\n }\n else {\n swap = line.charAt(column - 1) + line.charAt(column - 2);\n range = new Range(cursor.row, column - 2, cursor.row, column);\n }\n this.session.replace(range, swap);\n this.session.selection.moveToPosition(range.end);\n };\n this.toLowerCase = function () {\n var originalRange = this.getSelectionRange();\n if (this.selection.isEmpty()) {\n this.selection.selectWord();\n }\n var range = this.getSelectionRange();\n var text = this.session.getTextRange(range);\n this.session.replace(range, text.toLowerCase());\n this.selection.setSelectionRange(originalRange);\n };\n this.toUpperCase = function () {\n var originalRange = this.getSelectionRange();\n if (this.selection.isEmpty()) {\n this.selection.selectWord();\n }\n var range = this.getSelectionRange();\n var text = this.session.getTextRange(range);\n this.session.replace(range, text.toUpperCase());\n this.selection.setSelectionRange(originalRange);\n };\n this.indent = function () {\n var session = this.session;\n var range = this.getSelectionRange();\n if (range.start.row < range.end.row) {\n var rows = this.$getSelectedRows();\n session.indentRows(rows.first, rows.last, \"\\t\");\n return;\n }\n else if (range.start.column < range.end.column) {\n var text = session.getTextRange(range);\n if (!/^\\s+$/.test(text)) {\n var rows = this.$getSelectedRows();\n session.indentRows(rows.first, rows.last, \"\\t\");\n return;\n }\n }\n var line = session.getLine(range.start.row);\n var position = range.start;\n var size = session.getTabSize();\n var column = session.documentToScreenColumn(position.row, position.column);\n if (this.session.getUseSoftTabs()) {\n var count = (size - column % size);\n var indentString = lang.stringRepeat(\" \", count);\n }\n else {\n var count = column % size;\n while (line[range.start.column - 1] == \" \" && count) {\n range.start.column--;\n count--;\n }\n this.selection.setSelectionRange(range);\n indentString = \"\\t\";\n }\n return this.insert(indentString);\n };\n this.blockIndent = function () {\n var rows = this.$getSelectedRows();\n this.session.indentRows(rows.first, rows.last, \"\\t\");\n };\n this.blockOutdent = function () {\n var selection = this.session.getSelection();\n this.session.outdentRows(selection.getRange());\n };\n this.sortLines = function () {\n var rows = this.$getSelectedRows();\n var session = this.session;\n var lines = [];\n for (var i = rows.first; i <= rows.last; i++)\n lines.push(session.getLine(i));\n lines.sort(function (a, b) {\n if (a.toLowerCase() < b.toLowerCase())\n return -1;\n if (a.toLowerCase() > b.toLowerCase())\n return 1;\n return 0;\n });\n var deleteRange = new Range(0, 0, 0, 0);\n for (var i = rows.first; i <= rows.last; i++) {\n var line = session.getLine(i);\n deleteRange.start.row = i;\n deleteRange.end.row = i;\n deleteRange.end.column = line.length;\n session.replace(deleteRange, lines[i - rows.first]);\n }\n };\n this.toggleCommentLines = function () {\n var state = this.session.getState(this.getCursorPosition().row);\n var rows = this.$getSelectedRows();\n this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last);\n };\n this.toggleBlockComment = function () {\n var cursor = this.getCursorPosition();\n var state = this.session.getState(cursor.row);\n var range = this.getSelectionRange();\n this.session.getMode().toggleBlockComment(state, this.session, range, cursor);\n };\n this.getNumberAt = function (row, column) {\n var _numberRx = /[\\-]?[0-9]+(?:\\.[0-9]+)?/g;\n _numberRx.lastIndex = 0;\n var s = this.session.getLine(row);\n while (_numberRx.lastIndex < column) {\n var m = _numberRx.exec(s);\n if (m.index <= column && m.index + m[0].length >= column) {\n var number = {\n value: m[0],\n start: m.index,\n end: m.index + m[0].length\n };\n return number;\n }\n }\n return null;\n };\n this.modifyNumber = function (amount) {\n var row = this.selection.getCursor().row;\n var column = this.selection.getCursor().column;\n var charRange = new Range(row, column - 1, row, column);\n var c = this.session.getTextRange(charRange);\n if (!isNaN(parseFloat(c)) && isFinite(c)) {\n var nr = this.getNumberAt(row, column);\n if (nr) {\n var fp = nr.value.indexOf(\".\") >= 0 ? nr.start + nr.value.indexOf(\".\") + 1 : nr.end;\n var decimals = nr.start + nr.value.length - fp;\n var t = parseFloat(nr.value);\n t *= Math.pow(10, decimals);\n if (fp !== nr.end && column < fp) {\n amount *= Math.pow(10, nr.end - column - 1);\n }\n else {\n amount *= Math.pow(10, nr.end - column);\n }\n t += amount;\n t /= Math.pow(10, decimals);\n var nnr = t.toFixed(decimals);\n var replaceRange = new Range(row, nr.start, row, nr.end);\n this.session.replace(replaceRange, nnr);\n this.moveCursorTo(row, Math.max(nr.start + 1, column + nnr.length - nr.value.length));\n }\n }\n else {\n this.toggleWord();\n }\n };\n this.$toggleWordPairs = [\n [\"first\", \"last\"],\n [\"true\", \"false\"],\n [\"yes\", \"no\"],\n [\"width\", \"height\"],\n [\"top\", \"bottom\"],\n [\"right\", \"left\"],\n [\"on\", \"off\"],\n [\"x\", \"y\"],\n [\"get\", \"set\"],\n [\"max\", \"min\"],\n [\"horizontal\", \"vertical\"],\n [\"show\", \"hide\"],\n [\"add\", \"remove\"],\n [\"up\", \"down\"],\n [\"before\", \"after\"],\n [\"even\", \"odd\"],\n [\"in\", \"out\"],\n [\"inside\", \"outside\"],\n [\"next\", \"previous\"],\n [\"increase\", \"decrease\"],\n [\"attach\", \"detach\"],\n [\"&&\", \"||\"],\n [\"==\", \"!=\"]\n ];\n this.toggleWord = function () {\n var row = this.selection.getCursor().row;\n var column = this.selection.getCursor().column;\n this.selection.selectWord();\n var currentState = this.getSelectedText();\n var currWordStart = this.selection.getWordRange().start.column;\n var wordParts = currentState.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g, '$1 ').split(/\\s/);\n var delta = column - currWordStart - 1;\n if (delta < 0)\n delta = 0;\n var curLength = 0, itLength = 0;\n var that = this;\n if (currentState.match(/[A-Za-z0-9_]+/)) {\n wordParts.forEach(function (item, i) {\n itLength = curLength + item.length;\n if (delta >= curLength && delta <= itLength) {\n currentState = item;\n that.selection.clearSelection();\n that.moveCursorTo(row, curLength + currWordStart);\n that.selection.selectTo(row, itLength + currWordStart);\n }\n curLength = itLength;\n });\n }\n var wordPairs = this.$toggleWordPairs;\n var reg;\n for (var i = 0; i < wordPairs.length; i++) {\n var item = wordPairs[i];\n for (var j = 0; j <= 1; j++) {\n var negate = +!j;\n var firstCondition = currentState.match(new RegExp('^\\\\s?_?(' + lang.escapeRegExp(item[j]) + ')\\\\s?$', 'i'));\n if (firstCondition) {\n var secondCondition = currentState.match(new RegExp('([_]|^|\\\\s)(' + lang.escapeRegExp(firstCondition[1]) + ')($|\\\\s)', 'g'));\n if (secondCondition) {\n reg = currentState.replace(new RegExp(lang.escapeRegExp(item[j]), 'i'), function (result) {\n var res = item[negate];\n if (result.toUpperCase() == result) {\n res = res.toUpperCase();\n }\n else if (result.charAt(0).toUpperCase() == result.charAt(0)) {\n res = res.substr(0, 0) + item[negate].charAt(0).toUpperCase() + res.substr(1);\n }\n return res;\n });\n this.insert(reg);\n reg = \"\";\n }\n }\n }\n }\n };\n this.findLinkAt = function (row, column) {\n var e_1, _a;\n var line = this.session.getLine(row);\n var wordParts = line.split(/((?:https?|ftp):\\/\\/[\\S]+)/);\n var columnPosition = column;\n if (columnPosition < 0)\n columnPosition = 0;\n var previousPosition = 0, currentPosition = 0, match;\n try {\n for (var wordParts_1 = __values(wordParts), wordParts_1_1 = wordParts_1.next(); !wordParts_1_1.done; wordParts_1_1 = wordParts_1.next()) {\n var item = wordParts_1_1.value;\n currentPosition = previousPosition + item.length;\n if (columnPosition >= previousPosition && columnPosition <= currentPosition) {\n if (item.match(/((?:https?|ftp):\\/\\/[\\S]+)/)) {\n match = item.replace(/[\\s:.,'\";}\\]]+$/, \"\");\n break;\n }\n }\n previousPosition = currentPosition;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (wordParts_1_1 && !wordParts_1_1.done && (_a = wordParts_1.return)) _a.call(wordParts_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return match;\n };\n this.openLink = function () {\n var cursor = this.selection.getCursor();\n var url = this.findLinkAt(cursor.row, cursor.column);\n if (url)\n window.open(url, '_blank');\n return url != null;\n };\n this.removeLines = function () {\n var rows = this.$getSelectedRows();\n this.session.removeFullLines(rows.first, rows.last);\n this.clearSelection();\n };\n this.duplicateSelection = function () {\n var sel = this.selection;\n var doc = this.session;\n var range = sel.getRange();\n var reverse = sel.isBackwards();\n if (range.isEmpty()) {\n var row = range.start.row;\n doc.duplicateLines(row, row);\n }\n else {\n var point = reverse ? range.start : range.end;\n var endPoint = doc.insert(point, doc.getTextRange(range), false);\n range.start = point;\n range.end = endPoint;\n sel.setSelectionRange(range, reverse);\n }\n };\n this.moveLinesDown = function () {\n this.$moveLines(1, false);\n };\n this.moveLinesUp = function () {\n this.$moveLines(-1, false);\n };\n this.moveText = function (range, toPosition, copy) {\n return this.session.moveText(range, toPosition, copy);\n };\n this.copyLinesUp = function () {\n this.$moveLines(-1, true);\n };\n this.copyLinesDown = function () {\n this.$moveLines(1, true);\n };\n this.$moveLines = function (dir, copy) {\n var rows, moved;\n var selection = this.selection;\n if (!selection.inMultiSelectMode || this.inVirtualSelectionMode) {\n var range = selection.toOrientedRange();\n rows = this.$getSelectedRows(range);\n moved = this.session.$moveLines(rows.first, rows.last, copy ? 0 : dir);\n if (copy && dir == -1)\n moved = 0;\n range.moveBy(moved, 0);\n selection.fromOrientedRange(range);\n }\n else {\n var ranges = selection.rangeList.ranges;\n selection.rangeList.detach(this.session);\n this.inVirtualSelectionMode = true;\n var diff = 0;\n var totalDiff = 0;\n var l = ranges.length;\n for (var i = 0; i < l; i++) {\n var rangeIndex = i;\n ranges[i].moveBy(diff, 0);\n rows = this.$getSelectedRows(ranges[i]);\n var first = rows.first;\n var last = rows.last;\n while (++i < l) {\n if (totalDiff)\n ranges[i].moveBy(totalDiff, 0);\n var subRows = this.$getSelectedRows(ranges[i]);\n if (copy && subRows.first != last)\n break;\n else if (!copy && subRows.first > last + 1)\n break;\n last = subRows.last;\n }\n i--;\n diff = this.session.$moveLines(first, last, copy ? 0 : dir);\n if (copy && dir == -1)\n rangeIndex = i + 1;\n while (rangeIndex <= i) {\n ranges[rangeIndex].moveBy(diff, 0);\n rangeIndex++;\n }\n if (!copy)\n diff = 0;\n totalDiff += diff;\n }\n selection.fromOrientedRange(selection.ranges[0]);\n selection.rangeList.attach(this.session);\n this.inVirtualSelectionMode = false;\n }\n };\n this.$getSelectedRows = function (range) {\n range = (range || this.getSelectionRange()).collapseRows();\n return {\n first: this.session.getRowFoldStart(range.start.row),\n last: this.session.getRowFoldEnd(range.end.row)\n };\n };\n this.onCompositionStart = function (compositionState) {\n this.renderer.showComposition(compositionState);\n };\n this.onCompositionUpdate = function (text) {\n this.renderer.setCompositionText(text);\n };\n this.onCompositionEnd = function () {\n this.renderer.hideComposition();\n };\n this.getFirstVisibleRow = function () {\n return this.renderer.getFirstVisibleRow();\n };\n this.getLastVisibleRow = function () {\n return this.renderer.getLastVisibleRow();\n };\n this.isRowVisible = function (row) {\n return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow());\n };\n this.isRowFullyVisible = function (row) {\n return (row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow());\n };\n this.$getVisibleRowCount = function () {\n return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;\n };\n this.$moveByPage = function (dir, select) {\n var renderer = this.renderer;\n var config = this.renderer.layerConfig;\n var rows = dir * Math.floor(config.height / config.lineHeight);\n if (select === true) {\n this.selection.$moveSelection(function () {\n this.moveCursorBy(rows, 0);\n });\n }\n else if (select === false) {\n this.selection.moveCursorBy(rows, 0);\n this.selection.clearSelection();\n }\n var scrollTop = renderer.scrollTop;\n renderer.scrollBy(0, rows * config.lineHeight);\n if (select != null)\n renderer.scrollCursorIntoView(null, 0.5);\n renderer.animateScrolling(scrollTop);\n };\n this.selectPageDown = function () {\n this.$moveByPage(1, true);\n };\n this.selectPageUp = function () {\n this.$moveByPage(-1, true);\n };\n this.gotoPageDown = function () {\n this.$moveByPage(1, false);\n };\n this.gotoPageUp = function () {\n this.$moveByPage(-1, false);\n };\n this.scrollPageDown = function () {\n this.$moveByPage(1);\n };\n this.scrollPageUp = function () {\n this.$moveByPage(-1);\n };\n this.scrollToRow = function (row) {\n this.renderer.scrollToRow(row);\n };\n this.scrollToLine = function (line, center, animate, callback) {\n this.renderer.scrollToLine(line, center, animate, callback);\n };\n this.centerSelection = function () {\n var range = this.getSelectionRange();\n var pos = {\n row: Math.floor(range.start.row + (range.end.row - range.start.row) / 2),\n column: Math.floor(range.start.column + (range.end.column - range.start.column) / 2)\n };\n this.renderer.alignCursor(pos, 0.5);\n };\n this.getCursorPosition = function () {\n return this.selection.getCursor();\n };\n this.getCursorPositionScreen = function () {\n return this.session.documentToScreenPosition(this.getCursorPosition());\n };\n this.getSelectionRange = function () {\n return this.selection.getRange();\n };\n this.selectAll = function () {\n this.selection.selectAll();\n };\n this.clearSelection = function () {\n this.selection.clearSelection();\n };\n this.moveCursorTo = function (row, column) {\n this.selection.moveCursorTo(row, column);\n };\n this.moveCursorToPosition = function (pos) {\n this.selection.moveCursorToPosition(pos);\n };\n this.jumpToMatching = function (select, expand) {\n var cursor = this.getCursorPosition();\n var iterator = new TokenIterator(this.session, cursor.row, cursor.column);\n var prevToken = iterator.getCurrentToken();\n var tokenCount = 0;\n if (prevToken && prevToken.type.indexOf('tag-name') !== -1) {\n prevToken = iterator.stepBackward();\n }\n var token = prevToken || iterator.stepForward();\n if (!token)\n return;\n var matchType;\n var found = false;\n var depth = {};\n var i = cursor.column - token.start;\n var bracketType;\n var brackets = {\n \")\": \"(\",\n \"(\": \"(\",\n \"]\": \"[\",\n \"[\": \"[\",\n \"{\": \"{\",\n \"}\": \"{\"\n };\n do {\n if (token.value.match(/[{}()\\[\\]]/g)) {\n for (; i < token.value.length && !found; i++) {\n if (!brackets[token.value[i]]) {\n continue;\n }\n bracketType = brackets[token.value[i]] + '.' + token.type.replace(\"rparen\", \"lparen\");\n if (isNaN(depth[bracketType])) {\n depth[bracketType] = 0;\n }\n switch (token.value[i]) {\n case '(':\n case '[':\n case '{':\n depth[bracketType]++;\n break;\n case ')':\n case ']':\n case '}':\n depth[bracketType]--;\n if (depth[bracketType] === -1) {\n matchType = 'bracket';\n found = true;\n }\n break;\n }\n }\n }\n else if (token.type.indexOf('tag-name') !== -1) {\n if (isNaN(depth[token.value])) {\n depth[token.value] = 0;\n }\n if (prevToken.value === '<' && tokenCount > 1) {\n depth[token.value]++;\n }\n else if (prevToken.value === '= 0; --i) {\n if (this.$tryReplace(ranges[i], replacement)) {\n replaced++;\n }\n }\n this.selection.setSelectionRange(selection);\n return replaced;\n };\n this.$tryReplace = function (range, replacement) {\n var input = this.session.getTextRange(range);\n replacement = this.$search.replace(input, replacement);\n if (replacement !== null) {\n range.end = this.session.replace(range, replacement);\n return range;\n }\n else {\n return null;\n }\n };\n this.getLastSearchOptions = function () {\n return this.$search.getOptions();\n };\n this.find = function (needle, options, animate) {\n if (!options)\n options = {};\n if (typeof needle == \"string\" || needle instanceof RegExp)\n options.needle = needle;\n else if (typeof needle == \"object\")\n oop.mixin(options, needle);\n var range = this.selection.getRange();\n if (options.needle == null) {\n needle = this.session.getTextRange(range)\n || this.$search.$options.needle;\n if (!needle) {\n range = this.session.getWordRange(range.start.row, range.start.column);\n needle = this.session.getTextRange(range);\n }\n this.$search.set({ needle: needle });\n }\n this.$search.set(options);\n if (!options.start)\n this.$search.set({ start: range });\n var newRange = this.$search.find(this.session);\n if (options.preventScroll)\n return newRange;\n if (newRange) {\n this.revealRange(newRange, animate);\n return newRange;\n }\n if (options.backwards)\n range.start = range.end;\n else\n range.end = range.start;\n this.selection.setRange(range);\n };\n this.findNext = function (options, animate) {\n this.find({ skipCurrent: true, backwards: false }, options, animate);\n };\n this.findPrevious = function (options, animate) {\n this.find(options, { skipCurrent: true, backwards: true }, animate);\n };\n this.revealRange = function (range, animate) {\n this.session.unfold(range);\n this.selection.setSelectionRange(range);\n var scrollTop = this.renderer.scrollTop;\n this.renderer.scrollSelectionIntoView(range.start, range.end, 0.5);\n if (animate !== false)\n this.renderer.animateScrolling(scrollTop);\n };\n this.undo = function () {\n this.session.getUndoManager().undo(this.session);\n this.renderer.scrollCursorIntoView(null, 0.5);\n };\n this.redo = function () {\n this.session.getUndoManager().redo(this.session);\n this.renderer.scrollCursorIntoView(null, 0.5);\n };\n this.destroy = function () {\n if (this.$toDestroy) {\n this.$toDestroy.forEach(function (el) {\n el.destroy();\n });\n this.$toDestroy = null;\n }\n if (this.$mouseHandler)\n this.$mouseHandler.destroy();\n this.renderer.destroy();\n this._signal(\"destroy\", this);\n if (this.session)\n this.session.destroy();\n if (this._$emitInputEvent)\n this._$emitInputEvent.cancel();\n this.removeAllListeners();\n };\n this.setAutoScrollEditorIntoView = function (enable) {\n if (!enable)\n return;\n var rect;\n var self = this;\n var shouldScroll = false;\n if (!this.$scrollAnchor)\n this.$scrollAnchor = document.createElement(\"div\");\n var scrollAnchor = this.$scrollAnchor;\n scrollAnchor.style.cssText = \"position:absolute\";\n this.container.insertBefore(scrollAnchor, this.container.firstChild);\n var onChangeSelection = this.on(\"changeSelection\", function () {\n shouldScroll = true;\n });\n var onBeforeRender = this.renderer.on(\"beforeRender\", function () {\n if (shouldScroll)\n rect = self.renderer.container.getBoundingClientRect();\n });\n var onAfterRender = this.renderer.on(\"afterRender\", function () {\n if (shouldScroll && rect && (self.isFocused()\n || self.searchBox && self.searchBox.isFocused())) {\n var renderer = self.renderer;\n var pos = renderer.$cursorLayer.$pixelPos;\n var config = renderer.layerConfig;\n var top = pos.top - config.offset;\n if (pos.top >= 0 && top + rect.top < 0) {\n shouldScroll = true;\n }\n else if (pos.top < config.height &&\n pos.top + rect.top + config.lineHeight > window.innerHeight) {\n shouldScroll = false;\n }\n else {\n shouldScroll = null;\n }\n if (shouldScroll != null) {\n scrollAnchor.style.top = top + \"px\";\n scrollAnchor.style.left = pos.left + \"px\";\n scrollAnchor.style.height = config.lineHeight + \"px\";\n scrollAnchor.scrollIntoView(shouldScroll);\n }\n shouldScroll = rect = null;\n }\n });\n this.setAutoScrollEditorIntoView = function (enable) {\n if (enable)\n return;\n delete this.setAutoScrollEditorIntoView;\n this.off(\"changeSelection\", onChangeSelection);\n this.renderer.off(\"afterRender\", onAfterRender);\n this.renderer.off(\"beforeRender\", onBeforeRender);\n };\n };\n this.$resetCursorStyle = function () {\n var style = this.$cursorStyle || \"ace\";\n var cursorLayer = this.renderer.$cursorLayer;\n if (!cursorLayer)\n return;\n cursorLayer.setSmoothBlinking(/smooth/.test(style));\n cursorLayer.isBlinking = !this.$readOnly && style != \"wide\";\n dom.setCssClass(cursorLayer.element, \"ace_slim-cursors\", /slim/.test(style));\n };\n this.prompt = function (message, options, callback) {\n var editor = this;\n config.loadModule(\"./ext/prompt\", function (module) {\n module.prompt(editor, message, options, callback);\n });\n };\n}).call(Editor.prototype);\nconfig.defineOptions(Editor.prototype, \"editor\", {\n selectionStyle: {\n set: function (style) {\n this.onSelectionChange();\n this._signal(\"changeSelectionStyle\", { data: style });\n },\n initialValue: \"line\"\n },\n highlightActiveLine: {\n set: function () { this.$updateHighlightActiveLine(); },\n initialValue: true\n },\n highlightSelectedWord: {\n set: function (shouldHighlight) { this.$onSelectionChange(); },\n initialValue: true\n },\n readOnly: {\n set: function (readOnly) {\n this.textInput.setReadOnly(readOnly);\n this.$resetCursorStyle();\n },\n initialValue: false\n },\n copyWithEmptySelection: {\n set: function (value) {\n this.textInput.setCopyWithEmptySelection(value);\n },\n initialValue: false\n },\n cursorStyle: {\n set: function (val) { this.$resetCursorStyle(); },\n values: [\"ace\", \"slim\", \"smooth\", \"wide\"],\n initialValue: \"ace\"\n },\n mergeUndoDeltas: {\n values: [false, true, \"always\"],\n initialValue: true\n },\n behavioursEnabled: { initialValue: true },\n wrapBehavioursEnabled: { initialValue: true },\n enableAutoIndent: { initialValue: true },\n autoScrollEditorIntoView: {\n set: function (val) { this.setAutoScrollEditorIntoView(val); }\n },\n keyboardHandler: {\n set: function (val) { this.setKeyboardHandler(val); },\n get: function () { return this.$keybindingId; },\n handlesSet: true\n },\n value: {\n set: function (val) { this.session.setValue(val); },\n get: function () { return this.getValue(); },\n handlesSet: true,\n hidden: true\n },\n session: {\n set: function (val) { this.setSession(val); },\n get: function () { return this.session; },\n handlesSet: true,\n hidden: true\n },\n showLineNumbers: {\n set: function (show) {\n this.renderer.$gutterLayer.setShowLineNumbers(show);\n this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER);\n if (show && this.$relativeLineNumbers)\n relativeNumberRenderer.attach(this);\n else\n relativeNumberRenderer.detach(this);\n },\n initialValue: true\n },\n relativeLineNumbers: {\n set: function (value) {\n if (this.$showLineNumbers && value)\n relativeNumberRenderer.attach(this);\n else\n relativeNumberRenderer.detach(this);\n }\n },\n placeholder: {\n set: function (message) {\n if (!this.$updatePlaceholder) {\n this.$updatePlaceholder = function () {\n var value = this.session && (this.renderer.$composition || this.getValue());\n if (value && this.renderer.placeholderNode) {\n this.renderer.off(\"afterRender\", this.$updatePlaceholder);\n dom.removeCssClass(this.container, \"ace_hasPlaceholder\");\n this.renderer.placeholderNode.remove();\n this.renderer.placeholderNode = null;\n }\n else if (!value && !this.renderer.placeholderNode) {\n this.renderer.on(\"afterRender\", this.$updatePlaceholder);\n dom.addCssClass(this.container, \"ace_hasPlaceholder\");\n var el = dom.createElement(\"div\");\n el.className = \"ace_placeholder\";\n el.textContent = this.$placeholder || \"\";\n this.renderer.placeholderNode = el;\n this.renderer.content.appendChild(this.renderer.placeholderNode);\n }\n else if (!value && this.renderer.placeholderNode) {\n this.renderer.placeholderNode.textContent = this.$placeholder || \"\";\n }\n }.bind(this);\n this.on(\"input\", this.$updatePlaceholder);\n }\n this.$updatePlaceholder();\n }\n },\n customScrollbar: \"renderer\",\n hScrollBarAlwaysVisible: \"renderer\",\n vScrollBarAlwaysVisible: \"renderer\",\n highlightGutterLine: \"renderer\",\n animatedScroll: \"renderer\",\n showInvisibles: \"renderer\",\n showPrintMargin: \"renderer\",\n printMarginColumn: \"renderer\",\n printMargin: \"renderer\",\n fadeFoldWidgets: \"renderer\",\n showFoldWidgets: \"renderer\",\n displayIndentGuides: \"renderer\",\n highlightIndentGuides: \"renderer\",\n showGutter: \"renderer\",\n fontSize: \"renderer\",\n fontFamily: \"renderer\",\n maxLines: \"renderer\",\n minLines: \"renderer\",\n scrollPastEnd: \"renderer\",\n fixedWidthGutter: \"renderer\",\n theme: \"renderer\",\n hasCssTransforms: \"renderer\",\n maxPixelHeight: \"renderer\",\n useTextareaForIME: \"renderer\",\n scrollSpeed: \"$mouseHandler\",\n dragDelay: \"$mouseHandler\",\n dragEnabled: \"$mouseHandler\",\n focusTimeout: \"$mouseHandler\",\n tooltipFollowsMouse: \"$mouseHandler\",\n firstLineNumber: \"session\",\n overwrite: \"session\",\n newLineMode: \"session\",\n useWorker: \"session\",\n useSoftTabs: \"session\",\n navigateWithinSoftTabs: \"session\",\n tabSize: \"session\",\n wrap: \"session\",\n indentedSoftWrap: \"session\",\n foldStyle: \"session\",\n mode: \"session\"\n});\nvar relativeNumberRenderer = {\n getText: function (session, row) {\n return (Math.abs(session.selection.lead.row - row) || (row + 1 + (row < 9 ? \"\\xb7\" : \"\"))) + \"\";\n },\n getWidth: function (session, lastLineNumber, config) {\n return Math.max(lastLineNumber.toString().length, (config.lastRow + 1).toString().length, 2) * config.characterWidth;\n },\n update: function (e, editor) {\n editor.renderer.$loop.schedule(editor.renderer.CHANGE_GUTTER);\n },\n attach: function (editor) {\n editor.renderer.$gutterLayer.$renderer = this;\n editor.on(\"changeSelection\", this.update);\n this.update(null, editor);\n },\n detach: function (editor) {\n if (editor.renderer.$gutterLayer.$renderer == this)\n editor.renderer.$gutterLayer.$renderer = null;\n editor.off(\"changeSelection\", this.update);\n this.update(null, editor);\n }\n};\nexports.Editor = Editor;\n\n});\n\nace.define(\"ace/undomanager\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar UndoManager = function () {\n this.$maxRev = 0;\n this.$fromUndo = false;\n this.$undoDepth = Infinity;\n this.reset();\n};\n(function () {\n this.addSession = function (session) {\n this.$session = session;\n };\n this.add = function (delta, allowMerge, session) {\n if (this.$fromUndo)\n return;\n if (delta == this.$lastDelta)\n return;\n if (!this.$keepRedoStack)\n this.$redoStack.length = 0;\n if (allowMerge === false || !this.lastDeltas) {\n this.lastDeltas = [];\n var undoStackLength = this.$undoStack.length;\n if (undoStackLength > this.$undoDepth - 1) {\n this.$undoStack.splice(0, undoStackLength - this.$undoDepth + 1);\n }\n this.$undoStack.push(this.lastDeltas);\n delta.id = this.$rev = ++this.$maxRev;\n }\n if (delta.action == \"remove\" || delta.action == \"insert\")\n this.$lastDelta = delta;\n this.lastDeltas.push(delta);\n };\n this.addSelection = function (selection, rev) {\n this.selections.push({\n value: selection,\n rev: rev || this.$rev\n });\n };\n this.startNewGroup = function () {\n this.lastDeltas = null;\n return this.$rev;\n };\n this.markIgnored = function (from, to) {\n if (to == null)\n to = this.$rev + 1;\n var stack = this.$undoStack;\n for (var i = stack.length; i--;) {\n var delta = stack[i][0];\n if (delta.id <= from)\n break;\n if (delta.id < to)\n delta.ignore = true;\n }\n this.lastDeltas = null;\n };\n this.getSelection = function (rev, after) {\n var stack = this.selections;\n for (var i = stack.length; i--;) {\n var selection = stack[i];\n if (selection.rev < rev) {\n if (after)\n selection = stack[i + 1];\n return selection;\n }\n }\n };\n this.getRevision = function () {\n return this.$rev;\n };\n this.getDeltas = function (from, to) {\n if (to == null)\n to = this.$rev + 1;\n var stack = this.$undoStack;\n var end = null, start = 0;\n for (var i = stack.length; i--;) {\n var delta = stack[i][0];\n if (delta.id < to && !end)\n end = i + 1;\n if (delta.id <= from) {\n start = i + 1;\n break;\n }\n }\n return stack.slice(start, end);\n };\n this.getChangedRanges = function (from, to) {\n if (to == null)\n to = this.$rev + 1;\n };\n this.getChangedLines = function (from, to) {\n if (to == null)\n to = this.$rev + 1;\n };\n this.undo = function (session, dontSelect) {\n this.lastDeltas = null;\n var stack = this.$undoStack;\n if (!rearrangeUndoStack(stack, stack.length))\n return;\n if (!session)\n session = this.$session;\n if (this.$redoStackBaseRev !== this.$rev && this.$redoStack.length)\n this.$redoStack = [];\n this.$fromUndo = true;\n var deltaSet = stack.pop();\n var undoSelectionRange = null;\n if (deltaSet) {\n undoSelectionRange = session.undoChanges(deltaSet, dontSelect);\n this.$redoStack.push(deltaSet);\n this.$syncRev();\n }\n this.$fromUndo = false;\n return undoSelectionRange;\n };\n this.redo = function (session, dontSelect) {\n this.lastDeltas = null;\n if (!session)\n session = this.$session;\n this.$fromUndo = true;\n if (this.$redoStackBaseRev != this.$rev) {\n var diff = this.getDeltas(this.$redoStackBaseRev, this.$rev + 1);\n rebaseRedoStack(this.$redoStack, diff);\n this.$redoStackBaseRev = this.$rev;\n this.$redoStack.forEach(function (x) {\n x[0].id = ++this.$maxRev;\n }, this);\n }\n var deltaSet = this.$redoStack.pop();\n var redoSelectionRange = null;\n if (deltaSet) {\n redoSelectionRange = session.redoChanges(deltaSet, dontSelect);\n this.$undoStack.push(deltaSet);\n this.$syncRev();\n }\n this.$fromUndo = false;\n return redoSelectionRange;\n };\n this.$syncRev = function () {\n var stack = this.$undoStack;\n var nextDelta = stack[stack.length - 1];\n var id = nextDelta && nextDelta[0].id || 0;\n this.$redoStackBaseRev = id;\n this.$rev = id;\n };\n this.reset = function () {\n this.lastDeltas = null;\n this.$lastDelta = null;\n this.$undoStack = [];\n this.$redoStack = [];\n this.$rev = 0;\n this.mark = 0;\n this.$redoStackBaseRev = this.$rev;\n this.selections = [];\n };\n this.canUndo = function () {\n return this.$undoStack.length > 0;\n };\n this.canRedo = function () {\n return this.$redoStack.length > 0;\n };\n this.bookmark = function (rev) {\n if (rev == undefined)\n rev = this.$rev;\n this.mark = rev;\n };\n this.isAtBookmark = function () {\n return this.$rev === this.mark;\n };\n this.toJSON = function () {\n };\n this.fromJSON = function () {\n };\n this.hasUndo = this.canUndo;\n this.hasRedo = this.canRedo;\n this.isClean = this.isAtBookmark;\n this.markClean = this.bookmark;\n this.$prettyPrint = function (delta) {\n if (delta)\n return stringifyDelta(delta);\n return stringifyDelta(this.$undoStack) + \"\\n---\\n\" + stringifyDelta(this.$redoStack);\n };\n}).call(UndoManager.prototype);\nfunction rearrangeUndoStack(stack, pos) {\n for (var i = pos; i--;) {\n var deltaSet = stack[i];\n if (deltaSet && !deltaSet[0].ignore) {\n while (i < pos - 1) {\n var swapped = swapGroups(stack[i], stack[i + 1]);\n stack[i] = swapped[0];\n stack[i + 1] = swapped[1];\n i++;\n }\n return true;\n }\n }\n}\nvar Range = require(\"./range\").Range;\nvar cmp = Range.comparePoints;\nvar comparePoints = Range.comparePoints;\nfunction $updateMarkers(delta) {\n var isInsert = delta.action == \"insert\";\n var start = delta.start;\n var end = delta.end;\n var rowShift = (end.row - start.row) * (isInsert ? 1 : -1);\n var colShift = (end.column - start.column) * (isInsert ? 1 : -1);\n if (isInsert)\n end = start;\n for (var i in this.marks) {\n var point = this.marks[i];\n var cmp = comparePoints(point, start);\n if (cmp < 0) {\n continue; // delta starts after the range\n }\n if (cmp === 0) {\n if (isInsert) {\n if (point.bias == 1) {\n cmp = 1;\n }\n else {\n point.bias == -1;\n continue;\n }\n }\n }\n var cmp2 = isInsert ? cmp : comparePoints(point, end);\n if (cmp2 > 0) {\n point.row += rowShift;\n point.column += point.row == end.row ? colShift : 0;\n continue;\n }\n if (!isInsert && cmp2 <= 0) {\n point.row = start.row;\n point.column = start.column;\n if (cmp2 === 0)\n point.bias = 1;\n }\n }\n}\nfunction clonePos(pos) {\n return { row: pos.row, column: pos.column };\n}\nfunction cloneDelta(d) {\n return {\n start: clonePos(d.start),\n end: clonePos(d.end),\n action: d.action,\n lines: d.lines.slice()\n };\n}\nfunction stringifyDelta(d) {\n d = d || this;\n if (Array.isArray(d)) {\n return d.map(stringifyDelta).join(\"\\n\");\n }\n var type = \"\";\n if (d.action) {\n type = d.action == \"insert\" ? \"+\" : \"-\";\n type += \"[\" + d.lines + \"]\";\n }\n else if (d.value) {\n if (Array.isArray(d.value)) {\n type = d.value.map(stringifyRange).join(\"\\n\");\n }\n else {\n type = stringifyRange(d.value);\n }\n }\n if (d.start) {\n type += stringifyRange(d);\n }\n if (d.id || d.rev) {\n type += \"\\t(\" + (d.id || d.rev) + \")\";\n }\n return type;\n}\nfunction stringifyRange(r) {\n return r.start.row + \":\" + r.start.column\n + \"=>\" + r.end.row + \":\" + r.end.column;\n}\nfunction swap(d1, d2) {\n var i1 = d1.action == \"insert\";\n var i2 = d2.action == \"insert\";\n if (i1 && i2) {\n if (cmp(d2.start, d1.end) >= 0) {\n shift(d2, d1, -1);\n }\n else if (cmp(d2.start, d1.start) <= 0) {\n shift(d1, d2, +1);\n }\n else {\n return null;\n }\n }\n else if (i1 && !i2) {\n if (cmp(d2.start, d1.end) >= 0) {\n shift(d2, d1, -1);\n }\n else if (cmp(d2.end, d1.start) <= 0) {\n shift(d1, d2, -1);\n }\n else {\n return null;\n }\n }\n else if (!i1 && i2) {\n if (cmp(d2.start, d1.start) >= 0) {\n shift(d2, d1, +1);\n }\n else if (cmp(d2.start, d1.start) <= 0) {\n shift(d1, d2, +1);\n }\n else {\n return null;\n }\n }\n else if (!i1 && !i2) {\n if (cmp(d2.start, d1.start) >= 0) {\n shift(d2, d1, +1);\n }\n else if (cmp(d2.end, d1.start) <= 0) {\n shift(d1, d2, -1);\n }\n else {\n return null;\n }\n }\n return [d2, d1];\n}\nfunction swapGroups(ds1, ds2) {\n for (var i = ds1.length; i--;) {\n for (var j = 0; j < ds2.length; j++) {\n if (!swap(ds1[i], ds2[j])) {\n while (i < ds1.length) {\n while (j--) {\n swap(ds2[j], ds1[i]);\n }\n j = ds2.length;\n i++;\n }\n return [ds1, ds2];\n }\n }\n }\n ds1.selectionBefore = ds2.selectionBefore =\n ds1.selectionAfter = ds2.selectionAfter = null;\n return [ds2, ds1];\n}\nfunction xform(d1, c1) {\n var i1 = d1.action == \"insert\";\n var i2 = c1.action == \"insert\";\n if (i1 && i2) {\n if (cmp(d1.start, c1.start) < 0) {\n shift(c1, d1, 1);\n }\n else {\n shift(d1, c1, 1);\n }\n }\n else if (i1 && !i2) {\n if (cmp(d1.start, c1.end) >= 0) {\n shift(d1, c1, -1);\n }\n else if (cmp(d1.start, c1.start) <= 0) {\n shift(c1, d1, +1);\n }\n else {\n shift(d1, Range.fromPoints(c1.start, d1.start), -1);\n shift(c1, d1, +1);\n }\n }\n else if (!i1 && i2) {\n if (cmp(c1.start, d1.end) >= 0) {\n shift(c1, d1, -1);\n }\n else if (cmp(c1.start, d1.start) <= 0) {\n shift(d1, c1, +1);\n }\n else {\n shift(c1, Range.fromPoints(d1.start, c1.start), -1);\n shift(d1, c1, +1);\n }\n }\n else if (!i1 && !i2) {\n if (cmp(c1.start, d1.end) >= 0) {\n shift(c1, d1, -1);\n }\n else if (cmp(c1.end, d1.start) <= 0) {\n shift(d1, c1, -1);\n }\n else {\n var before, after;\n if (cmp(d1.start, c1.start) < 0) {\n before = d1;\n d1 = splitDelta(d1, c1.start);\n }\n if (cmp(d1.end, c1.end) > 0) {\n after = splitDelta(d1, c1.end);\n }\n shiftPos(c1.end, d1.start, d1.end, -1);\n if (after && !before) {\n d1.lines = after.lines;\n d1.start = after.start;\n d1.end = after.end;\n after = d1;\n }\n return [c1, before, after].filter(Boolean);\n }\n }\n return [c1, d1];\n}\nfunction shift(d1, d2, dir) {\n shiftPos(d1.start, d2.start, d2.end, dir);\n shiftPos(d1.end, d2.start, d2.end, dir);\n}\nfunction shiftPos(pos, start, end, dir) {\n if (pos.row == (dir == 1 ? start : end).row) {\n pos.column += dir * (end.column - start.column);\n }\n pos.row += dir * (end.row - start.row);\n}\nfunction splitDelta(c, pos) {\n var lines = c.lines;\n var end = c.end;\n c.end = clonePos(pos);\n var rowsBefore = c.end.row - c.start.row;\n var otherLines = lines.splice(rowsBefore, lines.length);\n var col = rowsBefore ? pos.column : pos.column - c.start.column;\n lines.push(otherLines[0].substring(0, col));\n otherLines[0] = otherLines[0].substr(col);\n var rest = {\n start: clonePos(pos),\n end: end,\n lines: otherLines,\n action: c.action\n };\n return rest;\n}\nfunction moveDeltasByOne(redoStack, d) {\n d = cloneDelta(d);\n for (var j = redoStack.length; j--;) {\n var deltaSet = redoStack[j];\n for (var i = 0; i < deltaSet.length; i++) {\n var x = deltaSet[i];\n var xformed = xform(x, d);\n d = xformed[0];\n if (xformed.length != 2) {\n if (xformed[2]) {\n deltaSet.splice(i + 1, 1, xformed[1], xformed[2]);\n i++;\n }\n else if (!xformed[1]) {\n deltaSet.splice(i, 1);\n i--;\n }\n }\n }\n if (!deltaSet.length) {\n redoStack.splice(j, 1);\n }\n }\n return redoStack;\n}\nfunction rebaseRedoStack(redoStack, deltaSets) {\n for (var i = 0; i < deltaSets.length; i++) {\n var deltas = deltaSets[i];\n for (var j = 0; j < deltas.length; j++) {\n moveDeltasByOne(redoStack, deltas[j]);\n }\n }\n}\nexports.UndoManager = UndoManager;\n\n});\n\nace.define(\"ace/layer/lines\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar Lines = function (element, canvasHeight) {\n this.element = element;\n this.canvasHeight = canvasHeight || 500000;\n this.element.style.height = (this.canvasHeight * 2) + \"px\";\n this.cells = [];\n this.cellCache = [];\n this.$offsetCoefficient = 0;\n};\n(function () {\n this.moveContainer = function (config) {\n dom.translate(this.element, 0, -((config.firstRowScreen * config.lineHeight) % this.canvasHeight) - config.offset * this.$offsetCoefficient);\n };\n this.pageChanged = function (oldConfig, newConfig) {\n return (Math.floor((oldConfig.firstRowScreen * oldConfig.lineHeight) / this.canvasHeight) !==\n Math.floor((newConfig.firstRowScreen * newConfig.lineHeight) / this.canvasHeight));\n };\n this.computeLineTop = function (row, config, session) {\n var screenTop = config.firstRowScreen * config.lineHeight;\n var screenPage = Math.floor(screenTop / this.canvasHeight);\n var lineTop = session.documentToScreenRow(row, 0) * config.lineHeight;\n return lineTop - (screenPage * this.canvasHeight);\n };\n this.computeLineHeight = function (row, config, session) {\n return config.lineHeight * session.getRowLineCount(row);\n };\n this.getLength = function () {\n return this.cells.length;\n };\n this.get = function (index) {\n return this.cells[index];\n };\n this.shift = function () {\n this.$cacheCell(this.cells.shift());\n };\n this.pop = function () {\n this.$cacheCell(this.cells.pop());\n };\n this.push = function (cell) {\n if (Array.isArray(cell)) {\n this.cells.push.apply(this.cells, cell);\n var fragment = dom.createFragment(this.element);\n for (var i = 0; i < cell.length; i++) {\n fragment.appendChild(cell[i].element);\n }\n this.element.appendChild(fragment);\n }\n else {\n this.cells.push(cell);\n this.element.appendChild(cell.element);\n }\n };\n this.unshift = function (cell) {\n if (Array.isArray(cell)) {\n this.cells.unshift.apply(this.cells, cell);\n var fragment = dom.createFragment(this.element);\n for (var i = 0; i < cell.length; i++) {\n fragment.appendChild(cell[i].element);\n }\n if (this.element.firstChild)\n this.element.insertBefore(fragment, this.element.firstChild);\n else\n this.element.appendChild(fragment);\n }\n else {\n this.cells.unshift(cell);\n this.element.insertAdjacentElement(\"afterbegin\", cell.element);\n }\n };\n this.last = function () {\n if (this.cells.length)\n return this.cells[this.cells.length - 1];\n else\n return null;\n };\n this.$cacheCell = function (cell) {\n if (!cell)\n return;\n cell.element.remove();\n this.cellCache.push(cell);\n };\n this.createCell = function (row, config, session, initElement) {\n var cell = this.cellCache.pop();\n if (!cell) {\n var element = dom.createElement(\"div\");\n if (initElement)\n initElement(element);\n this.element.appendChild(element);\n cell = {\n element: element,\n text: \"\",\n row: row\n };\n }\n cell.row = row;\n return cell;\n };\n}).call(Lines.prototype);\nexports.Lines = Lines;\n\n});\n\nace.define(\"ace/layer/gutter\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/lib/oop\",\"ace/lib/lang\",\"ace/lib/event_emitter\",\"ace/layer/lines\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar oop = require(\"../lib/oop\");\nvar lang = require(\"../lib/lang\");\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar Lines = require(\"./lines\").Lines;\nvar Gutter = function (parentEl) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_layer ace_gutter-layer\";\n parentEl.appendChild(this.element);\n this.setShowFoldWidgets(this.$showFoldWidgets);\n this.gutterWidth = 0;\n this.$annotations = [];\n this.$updateAnnotations = this.$updateAnnotations.bind(this);\n this.$lines = new Lines(this.element);\n this.$lines.$offsetCoefficient = 1;\n};\n(function () {\n oop.implement(this, EventEmitter);\n this.setSession = function (session) {\n if (this.session)\n this.session.off(\"change\", this.$updateAnnotations);\n this.session = session;\n if (session)\n session.on(\"change\", this.$updateAnnotations);\n };\n this.addGutterDecoration = function (row, className) {\n if (window.console)\n console.warn && console.warn(\"deprecated use session.addGutterDecoration\");\n this.session.addGutterDecoration(row, className);\n };\n this.removeGutterDecoration = function (row, className) {\n if (window.console)\n console.warn && console.warn(\"deprecated use session.removeGutterDecoration\");\n this.session.removeGutterDecoration(row, className);\n };\n this.setAnnotations = function (annotations) {\n this.$annotations = [];\n for (var i = 0; i < annotations.length; i++) {\n var annotation = annotations[i];\n var row = annotation.row;\n var rowInfo = this.$annotations[row];\n if (!rowInfo)\n rowInfo = this.$annotations[row] = { text: [] };\n var annoText = annotation.text;\n annoText = annoText ? lang.escapeHTML(annoText) : annotation.html || \"\";\n if (rowInfo.text.indexOf(annoText) === -1)\n rowInfo.text.push(annoText);\n var type = annotation.type;\n var className = annotation.className;\n if (className)\n rowInfo.className = className;\n else if (type == \"error\")\n rowInfo.className = \" ace_error\";\n else if (type == \"warning\" && rowInfo.className != \" ace_error\")\n rowInfo.className = \" ace_warning\";\n else if (type == \"info\" && (!rowInfo.className))\n rowInfo.className = \" ace_info\";\n }\n };\n this.$updateAnnotations = function (delta) {\n if (!this.$annotations.length)\n return;\n var firstRow = delta.start.row;\n var len = delta.end.row - firstRow;\n if (len === 0) {\n }\n else if (delta.action == 'remove') {\n this.$annotations.splice(firstRow, len + 1, null);\n }\n else {\n var args = new Array(len + 1);\n args.unshift(firstRow, 1);\n this.$annotations.splice.apply(this.$annotations, args);\n }\n };\n this.update = function (config) {\n this.config = config;\n var session = this.session;\n var firstRow = config.firstRow;\n var lastRow = Math.min(config.lastRow + config.gutterOffset, // needed to compensate for hor scollbar\n session.getLength() - 1);\n this.oldLastRow = lastRow;\n this.config = config;\n this.$lines.moveContainer(config);\n this.$updateCursorRow();\n var fold = session.getNextFoldLine(firstRow);\n var foldStart = fold ? fold.start.row : Infinity;\n var cell = null;\n var index = -1;\n var row = firstRow;\n while (true) {\n if (row > foldStart) {\n row = fold.end.row + 1;\n fold = session.getNextFoldLine(row, fold);\n foldStart = fold ? fold.start.row : Infinity;\n }\n if (row > lastRow) {\n while (this.$lines.getLength() > index + 1)\n this.$lines.pop();\n break;\n }\n cell = this.$lines.get(++index);\n if (cell) {\n cell.row = row;\n }\n else {\n cell = this.$lines.createCell(row, config, this.session, onCreateCell);\n this.$lines.push(cell);\n }\n this.$renderCell(cell, config, fold, row);\n row++;\n }\n this._signal(\"afterRender\");\n this.$updateGutterWidth(config);\n };\n this.$updateGutterWidth = function (config) {\n var session = this.session;\n var gutterRenderer = session.gutterRenderer || this.$renderer;\n var firstLineNumber = session.$firstLineNumber;\n var lastLineText = this.$lines.last() ? this.$lines.last().text : \"\";\n if (this.$fixedWidth || session.$useWrapMode)\n lastLineText = session.getLength() + firstLineNumber - 1;\n var gutterWidth = gutterRenderer\n ? gutterRenderer.getWidth(session, lastLineText, config)\n : lastLineText.toString().length * config.characterWidth;\n var padding = this.$padding || this.$computePadding();\n gutterWidth += padding.left + padding.right;\n if (gutterWidth !== this.gutterWidth && !isNaN(gutterWidth)) {\n this.gutterWidth = gutterWidth;\n this.element.parentNode.style.width =\n this.element.style.width = Math.ceil(this.gutterWidth) + \"px\";\n this._signal(\"changeGutterWidth\", gutterWidth);\n }\n };\n this.$updateCursorRow = function () {\n if (!this.$highlightGutterLine)\n return;\n var position = this.session.selection.getCursor();\n if (this.$cursorRow === position.row)\n return;\n this.$cursorRow = position.row;\n };\n this.updateLineHighlight = function () {\n if (!this.$highlightGutterLine)\n return;\n var row = this.session.selection.cursor.row;\n this.$cursorRow = row;\n if (this.$cursorCell && this.$cursorCell.row == row)\n return;\n if (this.$cursorCell)\n this.$cursorCell.element.className = this.$cursorCell.element.className.replace(\"ace_gutter-active-line \", \"\");\n var cells = this.$lines.cells;\n this.$cursorCell = null;\n for (var i = 0; i < cells.length; i++) {\n var cell = cells[i];\n if (cell.row >= this.$cursorRow) {\n if (cell.row > this.$cursorRow) {\n var fold = this.session.getFoldLine(this.$cursorRow);\n if (i > 0 && fold && fold.start.row == cells[i - 1].row)\n cell = cells[i - 1];\n else\n break;\n }\n cell.element.className = \"ace_gutter-active-line \" + cell.element.className;\n this.$cursorCell = cell;\n break;\n }\n }\n };\n this.scrollLines = function (config) {\n var oldConfig = this.config;\n this.config = config;\n this.$updateCursorRow();\n if (this.$lines.pageChanged(oldConfig, config))\n return this.update(config);\n this.$lines.moveContainer(config);\n var lastRow = Math.min(config.lastRow + config.gutterOffset, // needed to compensate for hor scollbar\n this.session.getLength() - 1);\n var oldLastRow = this.oldLastRow;\n this.oldLastRow = lastRow;\n if (!oldConfig || oldLastRow < config.firstRow)\n return this.update(config);\n if (lastRow < oldConfig.firstRow)\n return this.update(config);\n if (oldConfig.firstRow < config.firstRow)\n for (var row = this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row > 0; row--)\n this.$lines.shift();\n if (oldLastRow > lastRow)\n for (var row = this.session.getFoldedRowCount(lastRow + 1, oldLastRow); row > 0; row--)\n this.$lines.pop();\n if (config.firstRow < oldConfig.firstRow) {\n this.$lines.unshift(this.$renderLines(config, config.firstRow, oldConfig.firstRow - 1));\n }\n if (lastRow > oldLastRow) {\n this.$lines.push(this.$renderLines(config, oldLastRow + 1, lastRow));\n }\n this.updateLineHighlight();\n this._signal(\"afterRender\");\n this.$updateGutterWidth(config);\n };\n this.$renderLines = function (config, firstRow, lastRow) {\n var fragment = [];\n var row = firstRow;\n var foldLine = this.session.getNextFoldLine(row);\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n while (true) {\n if (row > foldStart) {\n row = foldLine.end.row + 1;\n foldLine = this.session.getNextFoldLine(row, foldLine);\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n if (row > lastRow)\n break;\n var cell = this.$lines.createCell(row, config, this.session, onCreateCell);\n this.$renderCell(cell, config, foldLine, row);\n fragment.push(cell);\n row++;\n }\n return fragment;\n };\n this.$renderCell = function (cell, config, fold, row) {\n var element = cell.element;\n var session = this.session;\n var textNode = element.childNodes[0];\n var foldWidget = element.childNodes[1];\n var firstLineNumber = session.$firstLineNumber;\n var breakpoints = session.$breakpoints;\n var decorations = session.$decorations;\n var gutterRenderer = session.gutterRenderer || this.$renderer;\n var foldWidgets = this.$showFoldWidgets && session.foldWidgets;\n var foldStart = fold ? fold.start.row : Number.MAX_VALUE;\n var className = \"ace_gutter-cell \";\n if (this.$highlightGutterLine) {\n if (row == this.$cursorRow || (fold && row < this.$cursorRow && row >= foldStart && this.$cursorRow <= fold.end.row)) {\n className += \"ace_gutter-active-line \";\n if (this.$cursorCell != cell) {\n if (this.$cursorCell)\n this.$cursorCell.element.className = this.$cursorCell.element.className.replace(\"ace_gutter-active-line \", \"\");\n this.$cursorCell = cell;\n }\n }\n }\n if (breakpoints[row])\n className += breakpoints[row];\n if (decorations[row])\n className += decorations[row];\n if (this.$annotations[row])\n className += this.$annotations[row].className;\n if (element.className != className)\n element.className = className;\n if (foldWidgets) {\n var c = foldWidgets[row];\n if (c == null)\n c = foldWidgets[row] = session.getFoldWidget(row);\n }\n if (c) {\n var className = \"ace_fold-widget ace_\" + c;\n if (c == \"start\" && row == foldStart && row < fold.end.row)\n className += \" ace_closed\";\n else\n className += \" ace_open\";\n if (foldWidget.className != className)\n foldWidget.className = className;\n var foldHeight = config.lineHeight + \"px\";\n dom.setStyle(foldWidget.style, \"height\", foldHeight);\n dom.setStyle(foldWidget.style, \"display\", \"inline-block\");\n }\n else {\n if (foldWidget) {\n dom.setStyle(foldWidget.style, \"display\", \"none\");\n }\n }\n var text = (gutterRenderer\n ? gutterRenderer.getText(session, row)\n : row + firstLineNumber).toString();\n if (text !== textNode.data) {\n textNode.data = text;\n }\n dom.setStyle(cell.element.style, \"height\", this.$lines.computeLineHeight(row, config, session) + \"px\");\n dom.setStyle(cell.element.style, \"top\", this.$lines.computeLineTop(row, config, session) + \"px\");\n cell.text = text;\n return cell;\n };\n this.$fixedWidth = false;\n this.$highlightGutterLine = true;\n this.$renderer = \"\";\n this.setHighlightGutterLine = function (highlightGutterLine) {\n this.$highlightGutterLine = highlightGutterLine;\n };\n this.$showLineNumbers = true;\n this.$renderer = \"\";\n this.setShowLineNumbers = function (show) {\n this.$renderer = !show && {\n getWidth: function () { return 0; },\n getText: function () { return \"\"; }\n };\n };\n this.getShowLineNumbers = function () {\n return this.$showLineNumbers;\n };\n this.$showFoldWidgets = true;\n this.setShowFoldWidgets = function (show) {\n if (show)\n dom.addCssClass(this.element, \"ace_folding-enabled\");\n else\n dom.removeCssClass(this.element, \"ace_folding-enabled\");\n this.$showFoldWidgets = show;\n this.$padding = null;\n };\n this.getShowFoldWidgets = function () {\n return this.$showFoldWidgets;\n };\n this.$computePadding = function () {\n if (!this.element.firstChild)\n return { left: 0, right: 0 };\n var style = dom.computedStyle(this.element.firstChild);\n this.$padding = {};\n this.$padding.left = (parseInt(style.borderLeftWidth) || 0)\n + (parseInt(style.paddingLeft) || 0) + 1;\n this.$padding.right = (parseInt(style.borderRightWidth) || 0)\n + (parseInt(style.paddingRight) || 0);\n return this.$padding;\n };\n this.getRegion = function (point) {\n var padding = this.$padding || this.$computePadding();\n var rect = this.element.getBoundingClientRect();\n if (point.x < padding.left + rect.left)\n return \"markers\";\n if (this.$showFoldWidgets && point.x > rect.right - padding.right)\n return \"foldWidgets\";\n };\n}).call(Gutter.prototype);\nfunction onCreateCell(element) {\n var textNode = document.createTextNode('');\n element.appendChild(textNode);\n var foldWidget = dom.createElement(\"span\");\n element.appendChild(foldWidget);\n return element;\n}\nexports.Gutter = Gutter;\n\n});\n\nace.define(\"ace/layer/marker\",[\"require\",\"exports\",\"module\",\"ace/range\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"../range\").Range;\nvar dom = require(\"../lib/dom\");\nvar Marker = function (parentEl) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_layer ace_marker-layer\";\n parentEl.appendChild(this.element);\n};\n(function () {\n this.$padding = 0;\n this.setPadding = function (padding) {\n this.$padding = padding;\n };\n this.setSession = function (session) {\n this.session = session;\n };\n this.setMarkers = function (markers) {\n this.markers = markers;\n };\n this.elt = function (className, css) {\n var x = this.i != -1 && this.element.childNodes[this.i];\n if (!x) {\n x = document.createElement(\"div\");\n this.element.appendChild(x);\n this.i = -1;\n }\n else {\n this.i++;\n }\n x.style.cssText = css;\n x.className = className;\n };\n this.update = function (config) {\n if (!config)\n return;\n this.config = config;\n this.i = 0;\n var html;\n for (var key in this.markers) {\n var marker = this.markers[key];\n if (!marker.range) {\n marker.update(html, this, this.session, config);\n continue;\n }\n var range = marker.range.clipRows(config.firstRow, config.lastRow);\n if (range.isEmpty())\n continue;\n range = range.toScreenRange(this.session);\n if (marker.renderer) {\n var top = this.$getTop(range.start.row, config);\n var left = this.$padding + range.start.column * config.characterWidth;\n marker.renderer(html, range, left, top, config);\n }\n else if (marker.type == \"fullLine\") {\n this.drawFullLineMarker(html, range, marker.clazz, config);\n }\n else if (marker.type == \"screenLine\") {\n this.drawScreenLineMarker(html, range, marker.clazz, config);\n }\n else if (range.isMultiLine()) {\n if (marker.type == \"text\")\n this.drawTextMarker(html, range, marker.clazz, config);\n else\n this.drawMultiLineMarker(html, range, marker.clazz, config);\n }\n else {\n this.drawSingleLineMarker(html, range, marker.clazz + \" ace_start\" + \" ace_br15\", config);\n }\n }\n if (this.i != -1) {\n while (this.i < this.element.childElementCount)\n this.element.removeChild(this.element.lastChild);\n }\n };\n this.$getTop = function (row, layerConfig) {\n return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight;\n };\n function getBorderClass(tl, tr, br, bl) {\n return (tl ? 1 : 0) | (tr ? 2 : 0) | (br ? 4 : 0) | (bl ? 8 : 0);\n }\n this.drawTextMarker = function (stringBuilder, range, clazz, layerConfig, extraStyle) {\n var session = this.session;\n var start = range.start.row;\n var end = range.end.row;\n var row = start;\n var prev = 0;\n var curr = 0;\n var next = session.getScreenLastRowColumn(row);\n var lineRange = new Range(row, range.start.column, row, curr);\n for (; row <= end; row++) {\n lineRange.start.row = lineRange.end.row = row;\n lineRange.start.column = row == start ? range.start.column : session.getRowWrapIndent(row);\n lineRange.end.column = next;\n prev = curr;\n curr = next;\n next = row + 1 < end ? session.getScreenLastRowColumn(row + 1) : row == end ? 0 : range.end.column;\n this.drawSingleLineMarker(stringBuilder, lineRange, clazz + (row == start ? \" ace_start\" : \"\") + \" ace_br\"\n + getBorderClass(row == start || row == start + 1 && range.start.column, prev < curr, curr > next, row == end), layerConfig, row == end ? 0 : 1, extraStyle);\n }\n };\n this.drawMultiLineMarker = function (stringBuilder, range, clazz, config, extraStyle) {\n var padding = this.$padding;\n var height = config.lineHeight;\n var top = this.$getTop(range.start.row, config);\n var left = padding + range.start.column * config.characterWidth;\n extraStyle = extraStyle || \"\";\n if (this.session.$bidiHandler.isBidiRow(range.start.row)) {\n var range1 = range.clone();\n range1.end.row = range1.start.row;\n range1.end.column = this.session.getLine(range1.start.row).length;\n this.drawBidiSingleLineMarker(stringBuilder, range1, clazz + \" ace_br1 ace_start\", config, null, extraStyle);\n }\n else {\n this.elt(clazz + \" ace_br1 ace_start\", \"height:\" + height + \"px;\" + \"right:0;\" + \"top:\" + top + \"px;left:\" + left + \"px;\" + (extraStyle || \"\"));\n }\n if (this.session.$bidiHandler.isBidiRow(range.end.row)) {\n var range1 = range.clone();\n range1.start.row = range1.end.row;\n range1.start.column = 0;\n this.drawBidiSingleLineMarker(stringBuilder, range1, clazz + \" ace_br12\", config, null, extraStyle);\n }\n else {\n top = this.$getTop(range.end.row, config);\n var width = range.end.column * config.characterWidth;\n this.elt(clazz + \" ace_br12\", \"height:\" + height + \"px;\" +\n \"width:\" + width + \"px;\" +\n \"top:\" + top + \"px;\" +\n \"left:\" + padding + \"px;\" + (extraStyle || \"\"));\n }\n height = (range.end.row - range.start.row - 1) * config.lineHeight;\n if (height <= 0)\n return;\n top = this.$getTop(range.start.row + 1, config);\n var radiusClass = (range.start.column ? 1 : 0) | (range.end.column ? 0 : 8);\n this.elt(clazz + (radiusClass ? \" ace_br\" + radiusClass : \"\"), \"height:\" + height + \"px;\" +\n \"right:0;\" +\n \"top:\" + top + \"px;\" +\n \"left:\" + padding + \"px;\" + (extraStyle || \"\"));\n };\n this.drawSingleLineMarker = function (stringBuilder, range, clazz, config, extraLength, extraStyle) {\n if (this.session.$bidiHandler.isBidiRow(range.start.row))\n return this.drawBidiSingleLineMarker(stringBuilder, range, clazz, config, extraLength, extraStyle);\n var height = config.lineHeight;\n var width = (range.end.column + (extraLength || 0) - range.start.column) * config.characterWidth;\n var top = this.$getTop(range.start.row, config);\n var left = this.$padding + range.start.column * config.characterWidth;\n this.elt(clazz, \"height:\" + height + \"px;\" +\n \"width:\" + width + \"px;\" +\n \"top:\" + top + \"px;\" +\n \"left:\" + left + \"px;\" + (extraStyle || \"\"));\n };\n this.drawBidiSingleLineMarker = function (stringBuilder, range, clazz, config, extraLength, extraStyle) {\n var height = config.lineHeight, top = this.$getTop(range.start.row, config), padding = this.$padding;\n var selections = this.session.$bidiHandler.getSelections(range.start.column, range.end.column);\n selections.forEach(function (selection) {\n this.elt(clazz, \"height:\" + height + \"px;\" +\n \"width:\" + (selection.width + (extraLength || 0)) + \"px;\" +\n \"top:\" + top + \"px;\" +\n \"left:\" + (padding + selection.left) + \"px;\" + (extraStyle || \"\"));\n }, this);\n };\n this.drawFullLineMarker = function (stringBuilder, range, clazz, config, extraStyle) {\n var top = this.$getTop(range.start.row, config);\n var height = config.lineHeight;\n if (range.start.row != range.end.row)\n height += this.$getTop(range.end.row, config) - top;\n this.elt(clazz, \"height:\" + height + \"px;\" +\n \"top:\" + top + \"px;\" +\n \"left:0;right:0;\" + (extraStyle || \"\"));\n };\n this.drawScreenLineMarker = function (stringBuilder, range, clazz, config, extraStyle) {\n var top = this.$getTop(range.start.row, config);\n var height = config.lineHeight;\n this.elt(clazz, \"height:\" + height + \"px;\" +\n \"top:\" + top + \"px;\" +\n \"left:0;right:0;\" + (extraStyle || \"\"));\n };\n}).call(Marker.prototype);\nexports.Marker = Marker;\n\n});\n\nace.define(\"ace/layer/text\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/lang\",\"ace/layer/lines\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"../lib/oop\");\nvar dom = require(\"../lib/dom\");\nvar lang = require(\"../lib/lang\");\nvar Lines = require(\"./lines\").Lines;\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar Text = function (parentEl) {\n this.dom = dom;\n this.element = this.dom.createElement(\"div\");\n this.element.className = \"ace_layer ace_text-layer\";\n parentEl.appendChild(this.element);\n this.$updateEolChar = this.$updateEolChar.bind(this);\n this.$lines = new Lines(this.element);\n};\n(function () {\n oop.implement(this, EventEmitter);\n this.EOF_CHAR = \"\\xB6\";\n this.EOL_CHAR_LF = \"\\xAC\";\n this.EOL_CHAR_CRLF = \"\\xa4\";\n this.EOL_CHAR = this.EOL_CHAR_LF;\n this.TAB_CHAR = \"\\u2014\"; //\"\\u21E5\";\n this.SPACE_CHAR = \"\\xB7\";\n this.$padding = 0;\n this.MAX_LINE_LENGTH = 10000;\n this.MAX_CHUNK_LENGTH = 250;\n this.$updateEolChar = function () {\n var doc = this.session.doc;\n var unixMode = doc.getNewLineCharacter() == \"\\n\" && doc.getNewLineMode() != \"windows\";\n var EOL_CHAR = unixMode ? this.EOL_CHAR_LF : this.EOL_CHAR_CRLF;\n if (this.EOL_CHAR != EOL_CHAR) {\n this.EOL_CHAR = EOL_CHAR;\n return true;\n }\n };\n this.setPadding = function (padding) {\n this.$padding = padding;\n this.element.style.margin = \"0 \" + padding + \"px\";\n };\n this.getLineHeight = function () {\n return this.$fontMetrics.$characterSize.height || 0;\n };\n this.getCharacterWidth = function () {\n return this.$fontMetrics.$characterSize.width || 0;\n };\n this.$setFontMetrics = function (measure) {\n this.$fontMetrics = measure;\n this.$fontMetrics.on(\"changeCharacterSize\", function (e) {\n this._signal(\"changeCharacterSize\", e);\n }.bind(this));\n this.$pollSizeChanges();\n };\n this.checkForSizeChanges = function () {\n this.$fontMetrics.checkForSizeChanges();\n };\n this.$pollSizeChanges = function () {\n return this.$pollSizeChangesTimer = this.$fontMetrics.$pollSizeChanges();\n };\n this.setSession = function (session) {\n this.session = session;\n if (session)\n this.$computeTabString();\n };\n this.showInvisibles = false;\n this.showSpaces = false;\n this.showTabs = false;\n this.showEOL = false;\n this.setShowInvisibles = function (showInvisibles) {\n if (this.showInvisibles == showInvisibles)\n return false;\n this.showInvisibles = showInvisibles;\n if (typeof showInvisibles == \"string\") {\n this.showSpaces = /tab/i.test(showInvisibles);\n this.showTabs = /space/i.test(showInvisibles);\n this.showEOL = /eol/i.test(showInvisibles);\n }\n else {\n this.showSpaces = this.showTabs = this.showEOL = showInvisibles;\n }\n this.$computeTabString();\n return true;\n };\n this.displayIndentGuides = true;\n this.setDisplayIndentGuides = function (display) {\n if (this.displayIndentGuides == display)\n return false;\n this.displayIndentGuides = display;\n this.$computeTabString();\n return true;\n };\n this.$highlightIndentGuides = true;\n this.setHighlightIndentGuides = function (highlight) {\n if (this.$highlightIndentGuides === highlight)\n return false;\n this.$highlightIndentGuides = highlight;\n return highlight;\n };\n this.$tabStrings = [];\n this.onChangeTabSize =\n this.$computeTabString = function () {\n var tabSize = this.session.getTabSize();\n this.tabSize = tabSize;\n var tabStr = this.$tabStrings = [0];\n for (var i = 1; i < tabSize + 1; i++) {\n if (this.showTabs) {\n var span = this.dom.createElement(\"span\");\n span.className = \"ace_invisible ace_invisible_tab\";\n span.textContent = lang.stringRepeat(this.TAB_CHAR, i);\n tabStr.push(span);\n }\n else {\n tabStr.push(this.dom.createTextNode(lang.stringRepeat(\" \", i), this.element));\n }\n }\n if (this.displayIndentGuides) {\n this.$indentGuideRe = /\\s\\S| \\t|\\t |\\s$/;\n var className = \"ace_indent-guide\";\n var spaceClass = this.showSpaces ? \" ace_invisible ace_invisible_space\" : \"\";\n var spaceContent = this.showSpaces\n ? lang.stringRepeat(this.SPACE_CHAR, this.tabSize)\n : lang.stringRepeat(\" \", this.tabSize);\n var tabClass = this.showTabs ? \" ace_invisible ace_invisible_tab\" : \"\";\n var tabContent = this.showTabs\n ? lang.stringRepeat(this.TAB_CHAR, this.tabSize)\n : spaceContent;\n var span = this.dom.createElement(\"span\");\n span.className = className + spaceClass;\n span.textContent = spaceContent;\n this.$tabStrings[\" \"] = span;\n var span = this.dom.createElement(\"span\");\n span.className = className + tabClass;\n span.textContent = tabContent;\n this.$tabStrings[\"\\t\"] = span;\n }\n };\n this.updateLines = function (config, firstRow, lastRow) {\n if (this.config.lastRow != config.lastRow ||\n this.config.firstRow != config.firstRow) {\n return this.update(config);\n }\n this.config = config;\n var first = Math.max(firstRow, config.firstRow);\n var last = Math.min(lastRow, config.lastRow);\n var lineElements = this.element.childNodes;\n var lineElementsIdx = 0;\n for (var row = config.firstRow; row < first; row++) {\n var foldLine = this.session.getFoldLine(row);\n if (foldLine) {\n if (foldLine.containsRow(first)) {\n first = foldLine.start.row;\n break;\n }\n else {\n row = foldLine.end.row;\n }\n }\n lineElementsIdx++;\n }\n var heightChanged = false;\n var row = first;\n var foldLine = this.session.getNextFoldLine(row);\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n while (true) {\n if (row > foldStart) {\n row = foldLine.end.row + 1;\n foldLine = this.session.getNextFoldLine(row, foldLine);\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n if (row > last)\n break;\n var lineElement = lineElements[lineElementsIdx++];\n if (lineElement) {\n this.dom.removeChildren(lineElement);\n this.$renderLine(lineElement, row, row == foldStart ? foldLine : false);\n if (heightChanged)\n lineElement.style.top = this.$lines.computeLineTop(row, config, this.session) + \"px\";\n var height = (config.lineHeight * this.session.getRowLength(row)) + \"px\";\n if (lineElement.style.height != height) {\n heightChanged = true;\n lineElement.style.height = height;\n }\n }\n row++;\n }\n if (heightChanged) {\n while (lineElementsIdx < this.$lines.cells.length) {\n var cell = this.$lines.cells[lineElementsIdx++];\n cell.element.style.top = this.$lines.computeLineTop(cell.row, config, this.session) + \"px\";\n }\n }\n };\n this.scrollLines = function (config) {\n var oldConfig = this.config;\n this.config = config;\n if (this.$lines.pageChanged(oldConfig, config))\n return this.update(config);\n this.$lines.moveContainer(config);\n var lastRow = config.lastRow;\n var oldLastRow = oldConfig ? oldConfig.lastRow : -1;\n if (!oldConfig || oldLastRow < config.firstRow)\n return this.update(config);\n if (lastRow < oldConfig.firstRow)\n return this.update(config);\n if (!oldConfig || oldConfig.lastRow < config.firstRow)\n return this.update(config);\n if (config.lastRow < oldConfig.firstRow)\n return this.update(config);\n if (oldConfig.firstRow < config.firstRow)\n for (var row = this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row > 0; row--)\n this.$lines.shift();\n if (oldConfig.lastRow > config.lastRow)\n for (var row = this.session.getFoldedRowCount(config.lastRow + 1, oldConfig.lastRow); row > 0; row--)\n this.$lines.pop();\n if (config.firstRow < oldConfig.firstRow) {\n this.$lines.unshift(this.$renderLinesFragment(config, config.firstRow, oldConfig.firstRow - 1));\n }\n if (config.lastRow > oldConfig.lastRow) {\n this.$lines.push(this.$renderLinesFragment(config, oldConfig.lastRow + 1, config.lastRow));\n }\n this.$highlightIndentGuide();\n };\n this.$renderLinesFragment = function (config, firstRow, lastRow) {\n var fragment = [];\n var row = firstRow;\n var foldLine = this.session.getNextFoldLine(row);\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n while (true) {\n if (row > foldStart) {\n row = foldLine.end.row + 1;\n foldLine = this.session.getNextFoldLine(row, foldLine);\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n if (row > lastRow)\n break;\n var line = this.$lines.createCell(row, config, this.session);\n var lineEl = line.element;\n this.dom.removeChildren(lineEl);\n dom.setStyle(lineEl.style, \"height\", this.$lines.computeLineHeight(row, config, this.session) + \"px\");\n dom.setStyle(lineEl.style, \"top\", this.$lines.computeLineTop(row, config, this.session) + \"px\");\n this.$renderLine(lineEl, row, row == foldStart ? foldLine : false);\n if (this.$useLineGroups()) {\n lineEl.className = \"ace_line_group\";\n }\n else {\n lineEl.className = \"ace_line\";\n lineEl.setAttribute(\"role\", \"option\");\n }\n fragment.push(line);\n row++;\n }\n return fragment;\n };\n this.update = function (config) {\n this.$lines.moveContainer(config);\n this.config = config;\n var firstRow = config.firstRow;\n var lastRow = config.lastRow;\n var lines = this.$lines;\n while (lines.getLength())\n lines.pop();\n lines.push(this.$renderLinesFragment(config, firstRow, lastRow));\n };\n this.$textToken = {\n \"text\": true,\n \"rparen\": true,\n \"lparen\": true\n };\n this.$renderTokenInChunks = function (parent, screenColumn, token, value) {\n var newScreenColumn;\n for (var i = 0; i < value.length; i += this.MAX_CHUNK_LENGTH) {\n var valueChunk = value.substring(i, i + this.MAX_CHUNK_LENGTH);\n var tokenChunk = {\n type: token.type,\n value: valueChunk\n };\n newScreenColumn = this.$renderToken(parent, screenColumn + i, tokenChunk, valueChunk);\n }\n return newScreenColumn;\n };\n this.$renderToken = function (parent, screenColumn, token, value) {\n var self = this;\n var re = /(\\t)|( +)|([\\x00-\\x1f\\x80-\\xa0\\xad\\u1680\\u180E\\u2000-\\u200f\\u2028\\u2029\\u202F\\u205F\\uFEFF\\uFFF9-\\uFFFC\\u2066\\u2067\\u2068\\u202A\\u202B\\u202D\\u202E\\u202C\\u2069]+)|(\\u3000)|([\\u1100-\\u115F\\u11A3-\\u11A7\\u11FA-\\u11FF\\u2329-\\u232A\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFB\\u3001-\\u303E\\u3041-\\u3096\\u3099-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u3190-\\u31BA\\u31C0-\\u31E3\\u31F0-\\u321E\\u3220-\\u3247\\u3250-\\u32FE\\u3300-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uA960-\\uA97C\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFAFF\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE66\\uFE68-\\uFE6B\\uFF01-\\uFF60\\uFFE0-\\uFFE6]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])/g;\n var valueFragment = this.dom.createFragment(this.element);\n var m;\n var i = 0;\n while (m = re.exec(value)) {\n var tab = m[1];\n var simpleSpace = m[2];\n var controlCharacter = m[3];\n var cjkSpace = m[4];\n var cjk = m[5];\n if (!self.showSpaces && simpleSpace)\n continue;\n var before = i != m.index ? value.slice(i, m.index) : \"\";\n i = m.index + m[0].length;\n if (before) {\n valueFragment.appendChild(this.dom.createTextNode(before, this.element));\n }\n if (tab) {\n var tabSize = self.session.getScreenTabSize(screenColumn + m.index);\n valueFragment.appendChild(self.$tabStrings[tabSize].cloneNode(true));\n screenColumn += tabSize - 1;\n }\n else if (simpleSpace) {\n if (self.showSpaces) {\n var span = this.dom.createElement(\"span\");\n span.className = \"ace_invisible ace_invisible_space\";\n span.textContent = lang.stringRepeat(self.SPACE_CHAR, simpleSpace.length);\n valueFragment.appendChild(span);\n }\n else {\n valueFragment.appendChild(this.com.createTextNode(simpleSpace, this.element));\n }\n }\n else if (controlCharacter) {\n var span = this.dom.createElement(\"span\");\n span.className = \"ace_invisible ace_invisible_space ace_invalid\";\n span.textContent = lang.stringRepeat(self.SPACE_CHAR, controlCharacter.length);\n valueFragment.appendChild(span);\n }\n else if (cjkSpace) {\n screenColumn += 1;\n var span = this.dom.createElement(\"span\");\n span.style.width = (self.config.characterWidth * 2) + \"px\";\n span.className = self.showSpaces ? \"ace_cjk ace_invisible ace_invisible_space\" : \"ace_cjk\";\n span.textContent = self.showSpaces ? self.SPACE_CHAR : cjkSpace;\n valueFragment.appendChild(span);\n }\n else if (cjk) {\n screenColumn += 1;\n var span = this.dom.createElement(\"span\");\n span.style.width = (self.config.characterWidth * 2) + \"px\";\n span.className = \"ace_cjk\";\n span.textContent = cjk;\n valueFragment.appendChild(span);\n }\n }\n valueFragment.appendChild(this.dom.createTextNode(i ? value.slice(i) : value, this.element));\n var span = this.dom.createElement(\"span\");\n if (!this.$textToken[token.type]) {\n var classes = \"ace_\" + token.type.replace(/\\./g, \" ace_\");\n if (token.type == \"fold\")\n span.style.width = (token.value.length * this.config.characterWidth) + \"px\";\n span.className = classes;\n }\n span.appendChild(valueFragment);\n parent.appendChild(span);\n return screenColumn + value.length;\n };\n this.renderIndentGuide = function (parent, value, max) {\n var cols = value.search(this.$indentGuideRe);\n if (cols <= 0 || cols >= max)\n return value;\n if (value[0] == \" \") {\n cols -= cols % this.tabSize;\n var count = cols / this.tabSize;\n for (var i = 0; i < count; i++) {\n parent.appendChild(this.$tabStrings[\" \"].cloneNode(true));\n }\n this.$highlightIndentGuide();\n return value.substr(cols);\n }\n else if (value[0] == \"\\t\") {\n for (var i = 0; i < cols; i++) {\n parent.appendChild(this.$tabStrings[\"\\t\"].cloneNode(true));\n }\n this.$highlightIndentGuide();\n return value.substr(cols);\n }\n this.$highlightIndentGuide();\n return value;\n };\n this.$highlightIndentGuide = function () {\n if (!this.$highlightIndentGuides || !this.displayIndentGuides)\n return;\n this.$highlightIndentGuideMarker = {\n indentLevel: undefined,\n start: undefined,\n end: undefined,\n dir: undefined\n };\n var lines = this.session.doc.$lines;\n if (!lines)\n return;\n var cursor = this.session.selection.getCursor();\n var initialIndent = /^\\s*/.exec(this.session.doc.getLine(cursor.row))[0].length;\n var elementIndentLevel = Math.floor(initialIndent / this.tabSize);\n this.$highlightIndentGuideMarker = {\n indentLevel: elementIndentLevel,\n start: cursor.row\n };\n var bracketHighlight = this.session.$bracketHighlight;\n if (bracketHighlight) {\n var ranges = this.session.$bracketHighlight.ranges;\n for (var i = 0; i < ranges.length; i++) {\n if (cursor.row !== ranges[i].start.row) {\n this.$highlightIndentGuideMarker.end = ranges[i].start.row;\n if (cursor.row > ranges[i].start.row) {\n this.$highlightIndentGuideMarker.dir = -1;\n }\n else {\n this.$highlightIndentGuideMarker.dir = 1;\n }\n break;\n }\n }\n }\n if (!this.$highlightIndentGuideMarker.end) {\n if (lines[cursor.row] !== '' && cursor.column === lines[cursor.row].length) {\n this.$highlightIndentGuideMarker.dir = 1;\n for (var i = cursor.row + 1; i < lines.length; i++) {\n var line = lines[i];\n var currentIndent = /^\\s*/.exec(line)[0].length;\n if (line !== '') {\n this.$highlightIndentGuideMarker.end = i;\n if (currentIndent <= initialIndent)\n break;\n }\n }\n }\n }\n this.$renderHighlightIndentGuide();\n };\n this.$clearActiveIndentGuide = function () {\n var cells = this.$lines.cells;\n for (var i = 0; i < cells.length; i++) {\n var cell = cells[i];\n var childNodes = cell.element.childNodes;\n if (childNodes.length > 0) {\n for (var j = 0; j < childNodes.length; j++) {\n if (childNodes[j].classList && childNodes[j].classList.contains(\"ace_indent-guide-active\")) {\n childNodes[j].classList.remove(\"ace_indent-guide-active\");\n break;\n }\n }\n }\n }\n };\n this.$setIndentGuideActive = function (cell, indentLevel) {\n var line = this.session.doc.getLine(cell.row);\n if (line !== \"\") {\n var childNodes = cell.element.childNodes;\n if (childNodes) {\n var node = childNodes[indentLevel - 1];\n if (node && node.classList && node.classList.contains(\"ace_indent-guide\"))\n node.classList.add(\"ace_indent-guide-active\");\n }\n }\n };\n this.$renderHighlightIndentGuide = function () {\n if (!this.$lines)\n return;\n var cells = this.$lines.cells;\n this.$clearActiveIndentGuide();\n var indentLevel = this.$highlightIndentGuideMarker.indentLevel;\n if (indentLevel !== 0) {\n if (this.$highlightIndentGuideMarker.dir === 1) {\n for (var i = 0; i < cells.length; i++) {\n var cell = cells[i];\n if (this.$highlightIndentGuideMarker.end && cell.row >= this.$highlightIndentGuideMarker.start\n + 1) {\n if (cell.row >= this.$highlightIndentGuideMarker.end)\n break;\n this.$setIndentGuideActive(cell, indentLevel);\n }\n }\n }\n else {\n for (var i = cells.length - 1; i >= 0; i--) {\n var cell = cells[i];\n if (this.$highlightIndentGuideMarker.end && cell.row < this.$highlightIndentGuideMarker.start) {\n if (cell.row <= this.$highlightIndentGuideMarker.end)\n break;\n this.$setIndentGuideActive(cell, indentLevel);\n }\n }\n }\n }\n };\n this.$createLineElement = function (parent) {\n var lineEl = this.dom.createElement(\"div\");\n lineEl.className = \"ace_line\";\n lineEl.style.height = this.config.lineHeight + \"px\";\n return lineEl;\n };\n this.$renderWrappedLine = function (parent, tokens, splits) {\n var chars = 0;\n var split = 0;\n var splitChars = splits[0];\n var screenColumn = 0;\n var lineEl = this.$createLineElement();\n parent.appendChild(lineEl);\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n var value = token.value;\n if (i == 0 && this.displayIndentGuides) {\n chars = value.length;\n value = this.renderIndentGuide(lineEl, value, splitChars);\n if (!value)\n continue;\n chars -= value.length;\n }\n if (chars + value.length < splitChars) {\n screenColumn = this.$renderTokenInChunks(lineEl, screenColumn, token, value);\n chars += value.length;\n }\n else {\n while (chars + value.length >= splitChars) {\n screenColumn = this.$renderTokenInChunks(lineEl, screenColumn, token, value.substring(0, splitChars - chars));\n value = value.substring(splitChars - chars);\n chars = splitChars;\n lineEl = this.$createLineElement();\n parent.appendChild(lineEl);\n lineEl.appendChild(this.dom.createTextNode(lang.stringRepeat(\"\\xa0\", splits.indent), this.element));\n split++;\n screenColumn = 0;\n splitChars = splits[split] || Number.MAX_VALUE;\n }\n if (value.length != 0) {\n chars += value.length;\n screenColumn = this.$renderTokenInChunks(lineEl, screenColumn, token, value);\n }\n }\n }\n if (splits[splits.length - 1] > this.MAX_LINE_LENGTH)\n this.$renderOverflowMessage(lineEl, screenColumn, null, \"\", true);\n };\n this.$renderSimpleLine = function (parent, tokens) {\n var screenColumn = 0;\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n var value = token.value;\n if (i == 0 && this.displayIndentGuides) {\n value = this.renderIndentGuide(parent, value);\n if (!value)\n continue;\n }\n if (screenColumn + value.length > this.MAX_LINE_LENGTH) {\n this.$renderOverflowMessage(parent, screenColumn, token, value);\n return;\n }\n screenColumn = this.$renderTokenInChunks(parent, screenColumn, token, value);\n }\n };\n this.$renderOverflowMessage = function (parent, screenColumn, token, value, hide) {\n if (token) {\n this.$renderTokenInChunks(parent, screenColumn, token, value.slice(0, this.MAX_LINE_LENGTH - screenColumn));\n }\n var overflowEl = this.dom.createElement(\"span\");\n overflowEl.className = \"ace_inline_button ace_keyword ace_toggle_wrap\";\n overflowEl.textContent = hide ? \"\" : \"\";\n parent.appendChild(overflowEl);\n };\n this.$renderLine = function (parent, row, foldLine) {\n if (!foldLine && foldLine != false)\n foldLine = this.session.getFoldLine(row);\n if (foldLine)\n var tokens = this.$getFoldLineTokens(row, foldLine);\n else\n var tokens = this.session.getTokens(row);\n var lastLineEl = parent;\n if (tokens.length) {\n var splits = this.session.getRowSplitData(row);\n if (splits && splits.length) {\n this.$renderWrappedLine(parent, tokens, splits);\n var lastLineEl = parent.lastChild;\n }\n else {\n var lastLineEl = parent;\n if (this.$useLineGroups()) {\n lastLineEl = this.$createLineElement();\n parent.appendChild(lastLineEl);\n }\n this.$renderSimpleLine(lastLineEl, tokens);\n }\n }\n else if (this.$useLineGroups()) {\n lastLineEl = this.$createLineElement();\n parent.appendChild(lastLineEl);\n }\n if (this.showEOL && lastLineEl) {\n if (foldLine)\n row = foldLine.end.row;\n var invisibleEl = this.dom.createElement(\"span\");\n invisibleEl.className = \"ace_invisible ace_invisible_eol\";\n invisibleEl.textContent = row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR;\n lastLineEl.appendChild(invisibleEl);\n }\n };\n this.$getFoldLineTokens = function (row, foldLine) {\n var session = this.session;\n var renderTokens = [];\n function addTokens(tokens, from, to) {\n var idx = 0, col = 0;\n while ((col + tokens[idx].value.length) < from) {\n col += tokens[idx].value.length;\n idx++;\n if (idx == tokens.length)\n return;\n }\n if (col != from) {\n var value = tokens[idx].value.substring(from - col);\n if (value.length > (to - from))\n value = value.substring(0, to - from);\n renderTokens.push({\n type: tokens[idx].type,\n value: value\n });\n col = from + value.length;\n idx += 1;\n }\n while (col < to && idx < tokens.length) {\n var value = tokens[idx].value;\n if (value.length + col > to) {\n renderTokens.push({\n type: tokens[idx].type,\n value: value.substring(0, to - col)\n });\n }\n else\n renderTokens.push(tokens[idx]);\n col += value.length;\n idx += 1;\n }\n }\n var tokens = session.getTokens(row);\n foldLine.walk(function (placeholder, row, column, lastColumn, isNewRow) {\n if (placeholder != null) {\n renderTokens.push({\n type: \"fold\",\n value: placeholder\n });\n }\n else {\n if (isNewRow)\n tokens = session.getTokens(row);\n if (tokens.length)\n addTokens(tokens, lastColumn, column);\n }\n }, foldLine.end.row, this.session.getLine(foldLine.end.row).length);\n return renderTokens;\n };\n this.$useLineGroups = function () {\n return this.session.getUseWrapMode();\n };\n this.destroy = function () { };\n}).call(Text.prototype);\nexports.Text = Text;\n\n});\n\nace.define(\"ace/layer/cursor\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar Cursor = function (parentEl) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_layer ace_cursor-layer\";\n parentEl.appendChild(this.element);\n this.isVisible = false;\n this.isBlinking = true;\n this.blinkInterval = 1000;\n this.smoothBlinking = false;\n this.cursors = [];\n this.cursor = this.addCursor();\n dom.addCssClass(this.element, \"ace_hidden-cursors\");\n this.$updateCursors = this.$updateOpacity.bind(this);\n};\n(function () {\n this.$updateOpacity = function (val) {\n var cursors = this.cursors;\n for (var i = cursors.length; i--;)\n dom.setStyle(cursors[i].style, \"opacity\", val ? \"\" : \"0\");\n };\n this.$startCssAnimation = function () {\n var cursors = this.cursors;\n for (var i = cursors.length; i--;)\n cursors[i].style.animationDuration = this.blinkInterval + \"ms\";\n this.$isAnimating = true;\n setTimeout(function () {\n if (this.$isAnimating) {\n dom.addCssClass(this.element, \"ace_animate-blinking\");\n }\n }.bind(this));\n };\n this.$stopCssAnimation = function () {\n this.$isAnimating = false;\n dom.removeCssClass(this.element, \"ace_animate-blinking\");\n };\n this.$padding = 0;\n this.setPadding = function (padding) {\n this.$padding = padding;\n };\n this.setSession = function (session) {\n this.session = session;\n };\n this.setBlinking = function (blinking) {\n if (blinking != this.isBlinking) {\n this.isBlinking = blinking;\n this.restartTimer();\n }\n };\n this.setBlinkInterval = function (blinkInterval) {\n if (blinkInterval != this.blinkInterval) {\n this.blinkInterval = blinkInterval;\n this.restartTimer();\n }\n };\n this.setSmoothBlinking = function (smoothBlinking) {\n if (smoothBlinking != this.smoothBlinking) {\n this.smoothBlinking = smoothBlinking;\n dom.setCssClass(this.element, \"ace_smooth-blinking\", smoothBlinking);\n this.$updateCursors(true);\n this.restartTimer();\n }\n };\n this.addCursor = function () {\n var el = dom.createElement(\"div\");\n el.className = \"ace_cursor\";\n this.element.appendChild(el);\n this.cursors.push(el);\n return el;\n };\n this.removeCursor = function () {\n if (this.cursors.length > 1) {\n var el = this.cursors.pop();\n el.parentNode.removeChild(el);\n return el;\n }\n };\n this.hideCursor = function () {\n this.isVisible = false;\n dom.addCssClass(this.element, \"ace_hidden-cursors\");\n this.restartTimer();\n };\n this.showCursor = function () {\n this.isVisible = true;\n dom.removeCssClass(this.element, \"ace_hidden-cursors\");\n this.restartTimer();\n };\n this.restartTimer = function () {\n var update = this.$updateCursors;\n clearInterval(this.intervalId);\n clearTimeout(this.timeoutId);\n this.$stopCssAnimation();\n if (this.smoothBlinking) {\n this.$isSmoothBlinking = false;\n dom.removeCssClass(this.element, \"ace_smooth-blinking\");\n }\n update(true);\n if (!this.isBlinking || !this.blinkInterval || !this.isVisible) {\n this.$stopCssAnimation();\n return;\n }\n if (this.smoothBlinking) {\n this.$isSmoothBlinking = true;\n setTimeout(function () {\n if (this.$isSmoothBlinking) {\n dom.addCssClass(this.element, \"ace_smooth-blinking\");\n }\n }.bind(this));\n }\n if (dom.HAS_CSS_ANIMATION) {\n this.$startCssAnimation();\n }\n else {\n var blink = function () {\n this.timeoutId = setTimeout(function () {\n update(false);\n }, 0.6 * this.blinkInterval);\n }.bind(this);\n this.intervalId = setInterval(function () {\n update(true);\n blink();\n }, this.blinkInterval);\n blink();\n }\n };\n this.getPixelPosition = function (position, onScreen) {\n if (!this.config || !this.session)\n return { left: 0, top: 0 };\n if (!position)\n position = this.session.selection.getCursor();\n var pos = this.session.documentToScreenPosition(position);\n var cursorLeft = this.$padding + (this.session.$bidiHandler.isBidiRow(pos.row, position.row)\n ? this.session.$bidiHandler.getPosLeft(pos.column)\n : pos.column * this.config.characterWidth);\n var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) *\n this.config.lineHeight;\n return { left: cursorLeft, top: cursorTop };\n };\n this.isCursorInView = function (pixelPos, config) {\n return pixelPos.top >= 0 && pixelPos.top < config.maxHeight;\n };\n this.update = function (config) {\n this.config = config;\n var selections = this.session.$selectionMarkers;\n var i = 0, cursorIndex = 0;\n if (selections === undefined || selections.length === 0) {\n selections = [{ cursor: null }];\n }\n for (var i = 0, n = selections.length; i < n; i++) {\n var pixelPos = this.getPixelPosition(selections[i].cursor, true);\n if ((pixelPos.top > config.height + config.offset ||\n pixelPos.top < 0) && i > 1) {\n continue;\n }\n var element = this.cursors[cursorIndex++] || this.addCursor();\n var style = element.style;\n if (!this.drawCursor) {\n if (!this.isCursorInView(pixelPos, config)) {\n dom.setStyle(style, \"display\", \"none\");\n }\n else {\n dom.setStyle(style, \"display\", \"block\");\n dom.translate(element, pixelPos.left, pixelPos.top);\n dom.setStyle(style, \"width\", Math.round(config.characterWidth) + \"px\");\n dom.setStyle(style, \"height\", config.lineHeight + \"px\");\n }\n }\n else {\n this.drawCursor(element, pixelPos, config, selections[i], this.session);\n }\n }\n while (this.cursors.length > cursorIndex)\n this.removeCursor();\n var overwrite = this.session.getOverwrite();\n this.$setOverwrite(overwrite);\n this.$pixelPos = pixelPos;\n this.restartTimer();\n };\n this.drawCursor = null;\n this.$setOverwrite = function (overwrite) {\n if (overwrite != this.overwrite) {\n this.overwrite = overwrite;\n if (overwrite)\n dom.addCssClass(this.element, \"ace_overwrite-cursors\");\n else\n dom.removeCssClass(this.element, \"ace_overwrite-cursors\");\n }\n };\n this.destroy = function () {\n clearInterval(this.intervalId);\n clearTimeout(this.timeoutId);\n };\n}).call(Cursor.prototype);\nexports.Cursor = Cursor;\n\n});\n\nace.define(\"ace/scrollbar\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/event\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar dom = require(\"./lib/dom\");\nvar event = require(\"./lib/event\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar MAX_SCROLL_H = 0x8000;\nvar ScrollBar = function (parent) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_scrollbar ace_scrollbar\" + this.classSuffix;\n this.inner = dom.createElement(\"div\");\n this.inner.className = \"ace_scrollbar-inner\";\n this.inner.textContent = \"\\xa0\";\n this.element.appendChild(this.inner);\n parent.appendChild(this.element);\n this.setVisible(false);\n this.skipEvent = false;\n event.addListener(this.element, \"scroll\", this.onScroll.bind(this));\n event.addListener(this.element, \"mousedown\", event.preventDefault);\n};\n(function () {\n oop.implement(this, EventEmitter);\n this.setVisible = function (isVisible) {\n this.element.style.display = isVisible ? \"\" : \"none\";\n this.isVisible = isVisible;\n this.coeff = 1;\n };\n}).call(ScrollBar.prototype);\nvar VScrollBar = function (parent, renderer) {\n ScrollBar.call(this, parent);\n this.scrollTop = 0;\n this.scrollHeight = 0;\n renderer.$scrollbarWidth =\n this.width = dom.scrollbarWidth(parent.ownerDocument);\n this.inner.style.width =\n this.element.style.width = (this.width || 15) + 5 + \"px\";\n this.$minWidth = 0;\n};\noop.inherits(VScrollBar, ScrollBar);\n(function () {\n this.classSuffix = '-v';\n this.onScroll = function () {\n if (!this.skipEvent) {\n this.scrollTop = this.element.scrollTop;\n if (this.coeff != 1) {\n var h = this.element.clientHeight / this.scrollHeight;\n this.scrollTop = this.scrollTop * (1 - h) / (this.coeff - h);\n }\n this._emit(\"scroll\", { data: this.scrollTop });\n }\n this.skipEvent = false;\n };\n this.getWidth = function () {\n return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0);\n };\n this.setHeight = function (height) {\n this.element.style.height = height + \"px\";\n };\n this.setInnerHeight =\n this.setScrollHeight = function (height) {\n this.scrollHeight = height;\n if (height > MAX_SCROLL_H) {\n this.coeff = MAX_SCROLL_H / height;\n height = MAX_SCROLL_H;\n }\n else if (this.coeff != 1) {\n this.coeff = 1;\n }\n this.inner.style.height = height + \"px\";\n };\n this.setScrollTop = function (scrollTop) {\n if (this.scrollTop != scrollTop) {\n this.skipEvent = true;\n this.scrollTop = scrollTop;\n this.element.scrollTop = scrollTop * this.coeff;\n }\n };\n}).call(VScrollBar.prototype);\nvar HScrollBar = function (parent, renderer) {\n ScrollBar.call(this, parent);\n this.scrollLeft = 0;\n this.height = renderer.$scrollbarWidth;\n this.inner.style.height =\n this.element.style.height = (this.height || 15) + 5 + \"px\";\n};\noop.inherits(HScrollBar, ScrollBar);\n(function () {\n this.classSuffix = '-h';\n this.onScroll = function () {\n if (!this.skipEvent) {\n this.scrollLeft = this.element.scrollLeft;\n this._emit(\"scroll\", { data: this.scrollLeft });\n }\n this.skipEvent = false;\n };\n this.getHeight = function () {\n return this.isVisible ? this.height : 0;\n };\n this.setWidth = function (width) {\n this.element.style.width = width + \"px\";\n };\n this.setInnerWidth = function (width) {\n this.inner.style.width = width + \"px\";\n };\n this.setScrollWidth = function (width) {\n this.inner.style.width = width + \"px\";\n };\n this.setScrollLeft = function (scrollLeft) {\n if (this.scrollLeft != scrollLeft) {\n this.skipEvent = true;\n this.scrollLeft = this.element.scrollLeft = scrollLeft;\n }\n };\n}).call(HScrollBar.prototype);\nexports.ScrollBar = VScrollBar; // backward compatibility\nexports.ScrollBarV = VScrollBar; // backward compatibility\nexports.ScrollBarH = HScrollBar; // backward compatibility\nexports.VScrollBar = VScrollBar;\nexports.HScrollBar = HScrollBar;\n\n});\n\nace.define(\"ace/scrollbar_custom\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/event\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar dom = require(\"./lib/dom\");\nvar event = require(\"./lib/event\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\ndom.importCssString(\".ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{\\n position: absolute;\\n background: rgba(128, 128, 128, 0.6);\\n -moz-box-sizing: border-box;\\n box-sizing: border-box;\\n border: 1px solid #bbb;\\n border-radius: 2px;\\n z-index: 8;\\n}\\n.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {\\n position: absolute;\\n z-index: 6;\\n background: none;\\n overflow: hidden!important;\\n}\\n.ace_editor>.ace_sb-v {\\n z-index: 6;\\n right: 0;\\n top: 0;\\n width: 12px;\\n}\\n.ace_editor>.ace_sb-v div {\\n z-index: 8;\\n right: 0;\\n width: 100%;\\n}\\n.ace_editor>.ace_sb-h {\\n bottom: 0;\\n left: 0;\\n height: 12px;\\n}\\n.ace_editor>.ace_sb-h div {\\n bottom: 0;\\n height: 100%;\\n}\\n.ace_editor>.ace_sb_grabbed {\\n z-index: 8;\\n background: #000;\\n}\", \"ace_scrollbar.css\", false);\nvar ScrollBar = function (parent) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_sb\" + this.classSuffix;\n this.inner = dom.createElement(\"div\");\n this.inner.className = \"\";\n this.element.appendChild(this.inner);\n this.VScrollWidth = 12;\n this.HScrollHeight = 12;\n parent.appendChild(this.element);\n this.setVisible(false);\n this.skipEvent = false;\n event.addMultiMouseDownListener(this.element, [500, 300, 300], this, \"onMouseDown\");\n};\n(function () {\n oop.implement(this, EventEmitter);\n this.setVisible = function (isVisible) {\n this.element.style.display = isVisible ? \"\" : \"none\";\n this.isVisible = isVisible;\n this.coeff = 1;\n };\n}).call(ScrollBar.prototype);\nvar VScrollBar = function (parent, renderer) {\n ScrollBar.call(this, parent);\n this.scrollTop = 0;\n this.scrollHeight = 0;\n this.parent = parent;\n this.width = this.VScrollWidth;\n this.renderer = renderer;\n this.inner.style.width = this.element.style.width = (this.width || 15) + \"px\";\n this.$minWidth = 0;\n};\noop.inherits(VScrollBar, ScrollBar);\n(function () {\n this.classSuffix = '-v';\n oop.implement(this, EventEmitter);\n this.onMouseDown = function (eType, e) {\n if (eType !== \"mousedown\")\n return;\n if (event.getButton(e) !== 0 || e.detail === 2) {\n return;\n }\n if (e.target === this.inner) {\n var self = this;\n var mousePageY = e.clientY;\n var onMouseMove = function (e) {\n mousePageY = e.clientY;\n };\n var onMouseUp = function () {\n clearInterval(timerId);\n };\n var startY = e.clientY;\n var startTop = this.thumbTop;\n var onScrollInterval = function () {\n if (mousePageY === undefined)\n return;\n var scrollTop = self.scrollTopFromThumbTop(startTop + mousePageY - startY);\n if (scrollTop === self.scrollTop)\n return;\n self._emit(\"scroll\", { data: scrollTop });\n };\n event.capture(this.inner, onMouseMove, onMouseUp);\n var timerId = setInterval(onScrollInterval, 20);\n return event.preventDefault(e);\n }\n var top = e.clientY - this.element.getBoundingClientRect().top - this.thumbHeight / 2;\n this._emit(\"scroll\", { data: this.scrollTopFromThumbTop(top) });\n return event.preventDefault(e);\n };\n this.getHeight = function () {\n return this.height;\n };\n this.scrollTopFromThumbTop = function (thumbTop) {\n var scrollTop = thumbTop * (this.pageHeight - this.viewHeight) / (this.slideHeight - this.thumbHeight);\n scrollTop = scrollTop >> 0;\n if (scrollTop < 0) {\n scrollTop = 0;\n }\n else if (scrollTop > this.pageHeight - this.viewHeight) {\n scrollTop = this.pageHeight - this.viewHeight;\n }\n return scrollTop;\n };\n this.getWidth = function () {\n return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0);\n };\n this.setHeight = function (height) {\n this.height = Math.max(0, height);\n this.slideHeight = this.height;\n this.viewHeight = this.height;\n this.setScrollHeight(this.pageHeight, true);\n };\n this.setInnerHeight = this.setScrollHeight = function (height, force) {\n if (this.pageHeight === height && !force)\n return;\n this.pageHeight = height;\n this.thumbHeight = this.slideHeight * this.viewHeight / this.pageHeight;\n if (this.thumbHeight > this.slideHeight)\n this.thumbHeight = this.slideHeight;\n if (this.thumbHeight < 15)\n this.thumbHeight = 15;\n this.inner.style.height = this.thumbHeight + \"px\";\n if (this.scrollTop > (this.pageHeight - this.viewHeight)) {\n this.scrollTop = (this.pageHeight - this.viewHeight);\n if (this.scrollTop < 0)\n this.scrollTop = 0;\n this._emit(\"scroll\", { data: this.scrollTop });\n }\n };\n this.setScrollTop = function (scrollTop) {\n this.scrollTop = scrollTop;\n if (scrollTop < 0)\n scrollTop = 0;\n this.thumbTop = scrollTop * (this.slideHeight - this.thumbHeight) / (this.pageHeight - this.viewHeight);\n this.inner.style.top = this.thumbTop + \"px\";\n };\n}).call(VScrollBar.prototype);\nvar HScrollBar = function (parent, renderer) {\n ScrollBar.call(this, parent);\n this.scrollLeft = 0;\n this.scrollWidth = 0;\n this.height = this.HScrollHeight;\n this.inner.style.height = this.element.style.height = (this.height || 12) + \"px\";\n this.renderer = renderer;\n};\noop.inherits(HScrollBar, ScrollBar);\n(function () {\n this.classSuffix = '-h';\n oop.implement(this, EventEmitter);\n this.onMouseDown = function (eType, e) {\n if (eType !== \"mousedown\")\n return;\n if (event.getButton(e) !== 0 || e.detail === 2) {\n return;\n }\n if (e.target === this.inner) {\n var self = this;\n var mousePageX = e.clientX;\n var onMouseMove = function (e) {\n mousePageX = e.clientX;\n };\n var onMouseUp = function () {\n clearInterval(timerId);\n };\n var startX = e.clientX;\n var startLeft = this.thumbLeft;\n var onScrollInterval = function () {\n if (mousePageX === undefined)\n return;\n var scrollLeft = self.scrollLeftFromThumbLeft(startLeft + mousePageX - startX);\n if (scrollLeft === self.scrollLeft)\n return;\n self._emit(\"scroll\", { data: scrollLeft });\n };\n event.capture(this.inner, onMouseMove, onMouseUp);\n var timerId = setInterval(onScrollInterval, 20);\n return event.preventDefault(e);\n }\n var left = e.clientX - this.element.getBoundingClientRect().left - this.thumbWidth / 2;\n this._emit(\"scroll\", { data: this.scrollLeftFromThumbLeft(left) });\n return event.preventDefault(e);\n };\n this.getHeight = function () {\n return this.isVisible ? this.height : 0;\n };\n this.scrollLeftFromThumbLeft = function (thumbLeft) {\n var scrollLeft = thumbLeft * (this.pageWidth - this.viewWidth) / (this.slideWidth - this.thumbWidth);\n scrollLeft = scrollLeft >> 0;\n if (scrollLeft < 0) {\n scrollLeft = 0;\n }\n else if (scrollLeft > this.pageWidth - this.viewWidth) {\n scrollLeft = this.pageWidth - this.viewWidth;\n }\n return scrollLeft;\n };\n this.setWidth = function (width) {\n this.width = Math.max(0, width);\n this.element.style.width = this.width + \"px\";\n this.slideWidth = this.width;\n this.viewWidth = this.width;\n this.setScrollWidth(this.pageWidth, true);\n };\n this.setInnerWidth = this.setScrollWidth = function (width, force) {\n if (this.pageWidth === width && !force)\n return;\n this.pageWidth = width;\n this.thumbWidth = this.slideWidth * this.viewWidth / this.pageWidth;\n if (this.thumbWidth > this.slideWidth)\n this.thumbWidth = this.slideWidth;\n if (this.thumbWidth < 15)\n this.thumbWidth = 15;\n this.inner.style.width = this.thumbWidth + \"px\";\n if (this.scrollLeft > (this.pageWidth - this.viewWidth)) {\n this.scrollLeft = (this.pageWidth - this.viewWidth);\n if (this.scrollLeft < 0)\n this.scrollLeft = 0;\n this._emit(\"scroll\", { data: this.scrollLeft });\n }\n };\n this.setScrollLeft = function (scrollLeft) {\n this.scrollLeft = scrollLeft;\n if (scrollLeft < 0)\n scrollLeft = 0;\n this.thumbLeft = scrollLeft * (this.slideWidth - this.thumbWidth) / (this.pageWidth - this.viewWidth);\n this.inner.style.left = (this.thumbLeft) + \"px\";\n };\n}).call(HScrollBar.prototype);\nexports.ScrollBar = VScrollBar; // backward compatibility\nexports.ScrollBarV = VScrollBar; // backward compatibility\nexports.ScrollBarH = HScrollBar; // backward compatibility\nexports.VScrollBar = VScrollBar;\nexports.HScrollBar = HScrollBar;\n\n});\n\nace.define(\"ace/renderloop\",[\"require\",\"exports\",\"module\",\"ace/lib/event\"], function(require, exports, module){\"use strict\";\nvar event = require(\"./lib/event\");\nvar RenderLoop = function (onRender, win) {\n this.onRender = onRender;\n this.pending = false;\n this.changes = 0;\n this.$recursionLimit = 2;\n this.window = win || window;\n var _self = this;\n this._flush = function (ts) {\n _self.pending = false;\n var changes = _self.changes;\n if (changes) {\n event.blockIdle(100);\n _self.changes = 0;\n _self.onRender(changes);\n }\n if (_self.changes) {\n if (_self.$recursionLimit-- < 0)\n return;\n _self.schedule();\n }\n else {\n _self.$recursionLimit = 2;\n }\n };\n};\n(function () {\n this.schedule = function (change) {\n this.changes = this.changes | change;\n if (this.changes && !this.pending) {\n event.nextFrame(this._flush);\n this.pending = true;\n }\n };\n this.clear = function (change) {\n var changes = this.changes;\n this.changes = 0;\n return changes;\n };\n}).call(RenderLoop.prototype);\nexports.RenderLoop = RenderLoop;\n\n});\n\nace.define(\"ace/layer/font_metrics\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/lang\",\"ace/lib/event\",\"ace/lib/useragent\",\"ace/lib/event_emitter\"], function(require, exports, module){var oop = require(\"../lib/oop\");\nvar dom = require(\"../lib/dom\");\nvar lang = require(\"../lib/lang\");\nvar event = require(\"../lib/event\");\nvar useragent = require(\"../lib/useragent\");\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar DEFAULT_CHAR_COUNT = 250;\nvar USE_OBSERVER = typeof ResizeObserver == \"function\";\nvar L = 200;\nvar FontMetrics = exports.FontMetrics = function (parentEl, charCount) {\n this.charCount = charCount || DEFAULT_CHAR_COUNT;\n this.el = dom.createElement(\"div\");\n this.$setMeasureNodeStyles(this.el.style, true);\n this.$main = dom.createElement(\"div\");\n this.$setMeasureNodeStyles(this.$main.style);\n this.$measureNode = dom.createElement(\"div\");\n this.$setMeasureNodeStyles(this.$measureNode.style);\n this.el.appendChild(this.$main);\n this.el.appendChild(this.$measureNode);\n parentEl.appendChild(this.el);\n this.$measureNode.textContent = lang.stringRepeat(\"X\", this.charCount);\n this.$characterSize = { width: 0, height: 0 };\n if (USE_OBSERVER)\n this.$addObserver();\n else\n this.checkForSizeChanges();\n};\n(function () {\n oop.implement(this, EventEmitter);\n this.$characterSize = { width: 0, height: 0 };\n this.$setMeasureNodeStyles = function (style, isRoot) {\n style.width = style.height = \"auto\";\n style.left = style.top = \"0px\";\n style.visibility = \"hidden\";\n style.position = \"absolute\";\n style.whiteSpace = \"pre\";\n if (useragent.isIE < 8) {\n style[\"font-family\"] = \"inherit\";\n }\n else {\n style.font = \"inherit\";\n }\n style.overflow = isRoot ? \"hidden\" : \"visible\";\n };\n this.checkForSizeChanges = function (size) {\n if (size === undefined)\n size = this.$measureSizes();\n if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) {\n this.$measureNode.style.fontWeight = \"bold\";\n var boldSize = this.$measureSizes();\n this.$measureNode.style.fontWeight = \"\";\n this.$characterSize = size;\n this.charSizes = Object.create(null);\n this.allowBoldFonts = boldSize && boldSize.width === size.width && boldSize.height === size.height;\n this._emit(\"changeCharacterSize\", { data: size });\n }\n };\n this.$addObserver = function () {\n var self = this;\n this.$observer = new window.ResizeObserver(function (e) {\n self.checkForSizeChanges();\n });\n this.$observer.observe(this.$measureNode);\n };\n this.$pollSizeChanges = function () {\n if (this.$pollSizeChangesTimer || this.$observer)\n return this.$pollSizeChangesTimer;\n var self = this;\n return this.$pollSizeChangesTimer = event.onIdle(function cb() {\n self.checkForSizeChanges();\n event.onIdle(cb, 500);\n }, 500);\n };\n this.setPolling = function (val) {\n if (val) {\n this.$pollSizeChanges();\n }\n else if (this.$pollSizeChangesTimer) {\n clearInterval(this.$pollSizeChangesTimer);\n this.$pollSizeChangesTimer = 0;\n }\n };\n this.$measureSizes = function (node) {\n node = node || this.$measureNode;\n var rect = node.getBoundingClientRect();\n var charSize = {\n height: rect.height,\n width: rect.width / this.charCount\n };\n if (charSize.width === 0 || charSize.height === 0)\n return null;\n return charSize;\n };\n this.$measureCharWidth = function (ch) {\n this.$main.textContent = lang.stringRepeat(ch, this.charCount);\n var rect = this.$main.getBoundingClientRect();\n return rect.width / this.charCount;\n };\n this.getCharacterWidth = function (ch) {\n var w = this.charSizes[ch];\n if (w === undefined) {\n w = this.charSizes[ch] = this.$measureCharWidth(ch) / this.$characterSize.width;\n }\n return w;\n };\n this.destroy = function () {\n clearInterval(this.$pollSizeChangesTimer);\n if (this.$observer)\n this.$observer.disconnect();\n if (this.el && this.el.parentNode)\n this.el.parentNode.removeChild(this.el);\n };\n this.$getZoom = function getZoom(element) {\n if (!element || !element.parentElement)\n return 1;\n return (window.getComputedStyle(element).zoom || 1) * getZoom(element.parentElement);\n };\n this.$initTransformMeasureNodes = function () {\n var t = function (t, l) {\n return [\"div\", {\n style: \"position: absolute;top:\" + t + \"px;left:\" + l + \"px;\"\n }];\n };\n this.els = dom.buildDom([t(0, 0), t(L, 0), t(0, L), t(L, L)], this.el);\n };\n this.transformCoordinates = function (clientPos, elPos) {\n if (clientPos) {\n var zoom = this.$getZoom(this.el);\n clientPos = mul(1 / zoom, clientPos);\n }\n function solve(l1, l2, r) {\n var det = l1[1] * l2[0] - l1[0] * l2[1];\n return [\n (-l2[1] * r[0] + l2[0] * r[1]) / det,\n (+l1[1] * r[0] - l1[0] * r[1]) / det\n ];\n }\n function sub(a, b) { return [a[0] - b[0], a[1] - b[1]]; }\n function add(a, b) { return [a[0] + b[0], a[1] + b[1]]; }\n function mul(a, b) { return [a * b[0], a * b[1]]; }\n if (!this.els)\n this.$initTransformMeasureNodes();\n function p(el) {\n var r = el.getBoundingClientRect();\n return [r.left, r.top];\n }\n var a = p(this.els[0]);\n var b = p(this.els[1]);\n var c = p(this.els[2]);\n var d = p(this.els[3]);\n var h = solve(sub(d, b), sub(d, c), sub(add(b, c), add(d, a)));\n var m1 = mul(1 + h[0], sub(b, a));\n var m2 = mul(1 + h[1], sub(c, a));\n if (elPos) {\n var x = elPos;\n var k = h[0] * x[0] / L + h[1] * x[1] / L + 1;\n var ut = add(mul(x[0], m1), mul(x[1], m2));\n return add(mul(1 / k / L, ut), a);\n }\n var u = sub(clientPos, a);\n var f = solve(sub(m1, mul(h[0], u)), sub(m2, mul(h[1], u)), u);\n return mul(L, f);\n };\n}).call(FontMetrics.prototype);\n\n});\n\nace.define(\"ace/css/editor.css\",[\"require\",\"exports\",\"module\"], function(require, exports, module){module.exports = \"/*\\nstyles = []\\nfor (var i = 1; i < 16; i++) {\\n styles.push(\\\".ace_br\\\" + i + \\\"{\\\" + (\\n [\\\"top-left\\\", \\\"top-right\\\", \\\"bottom-right\\\", \\\"bottom-left\\\"]\\n ).map(function(x, j) {\\n return i & (1< .ace_line, .ace_text-layer > .ace_line_group {\\n contain: style size layout;\\n position: absolute;\\n top: 0;\\n left: 0;\\n right: 0;\\n}\\n\\n.ace_hidpi .ace_text-layer,\\n.ace_hidpi .ace_gutter-layer,\\n.ace_hidpi .ace_content,\\n.ace_hidpi .ace_gutter {\\n contain: strict;\\n will-change: transform;\\n}\\n.ace_hidpi .ace_text-layer > .ace_line, \\n.ace_hidpi .ace_text-layer > .ace_line_group {\\n contain: strict;\\n}\\n\\n.ace_cjk {\\n display: inline-block;\\n text-align: center;\\n}\\n\\n.ace_cursor-layer {\\n z-index: 4;\\n}\\n\\n.ace_cursor {\\n z-index: 4;\\n position: absolute;\\n box-sizing: border-box;\\n border-left: 2px solid;\\n /* workaround for smooth cursor repaintng whole screen in chrome */\\n transform: translatez(0);\\n}\\n\\n.ace_multiselect .ace_cursor {\\n border-left-width: 1px;\\n}\\n\\n.ace_slim-cursors .ace_cursor {\\n border-left-width: 1px;\\n}\\n\\n.ace_overwrite-cursors .ace_cursor {\\n border-left-width: 0;\\n border-bottom: 1px solid;\\n}\\n\\n.ace_hidden-cursors .ace_cursor {\\n opacity: 0.2;\\n}\\n\\n.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\\n opacity: 0;\\n}\\n\\n.ace_smooth-blinking .ace_cursor {\\n transition: opacity 0.18s;\\n}\\n\\n.ace_animate-blinking .ace_cursor {\\n animation-duration: 1000ms;\\n animation-timing-function: step-end;\\n animation-name: blink-ace-animate;\\n animation-iteration-count: infinite;\\n}\\n\\n.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\\n animation-duration: 1000ms;\\n animation-timing-function: ease-in-out;\\n animation-name: blink-ace-animate-smooth;\\n}\\n \\n@keyframes blink-ace-animate {\\n from, to { opacity: 1; }\\n 60% { opacity: 0; }\\n}\\n\\n@keyframes blink-ace-animate-smooth {\\n from, to { opacity: 1; }\\n 45% { opacity: 1; }\\n 60% { opacity: 0; }\\n 85% { opacity: 0; }\\n}\\n\\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\\n position: absolute;\\n z-index: 3;\\n}\\n\\n.ace_marker-layer .ace_selection {\\n position: absolute;\\n z-index: 5;\\n}\\n\\n.ace_marker-layer .ace_bracket {\\n position: absolute;\\n z-index: 6;\\n}\\n\\n.ace_marker-layer .ace_error_bracket {\\n position: absolute;\\n border-bottom: 1px solid #DE5555;\\n border-radius: 0;\\n}\\n\\n.ace_marker-layer .ace_active-line {\\n position: absolute;\\n z-index: 2;\\n}\\n\\n.ace_marker-layer .ace_selected-word {\\n position: absolute;\\n z-index: 4;\\n box-sizing: border-box;\\n}\\n\\n.ace_line .ace_fold {\\n box-sizing: border-box;\\n\\n display: inline-block;\\n height: 11px;\\n margin-top: -2px;\\n vertical-align: middle;\\n\\n background-image:\\n url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\\\"),\\n url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=\\\");\\n background-repeat: no-repeat, repeat-x;\\n background-position: center center, top left;\\n color: transparent;\\n\\n border: 1px solid black;\\n border-radius: 2px;\\n\\n cursor: pointer;\\n pointer-events: auto;\\n}\\n\\n.ace_dark .ace_fold {\\n}\\n\\n.ace_fold:hover{\\n background-image:\\n url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\\\"),\\n url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC\\\");\\n}\\n\\n.ace_tooltip {\\n background-color: #FFF;\\n background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));\\n border: 1px solid gray;\\n border-radius: 1px;\\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\\n color: black;\\n max-width: 100%;\\n padding: 3px 4px;\\n position: fixed;\\n z-index: 999999;\\n box-sizing: border-box;\\n cursor: default;\\n white-space: pre;\\n word-wrap: break-word;\\n line-height: normal;\\n font-style: normal;\\n font-weight: normal;\\n letter-spacing: normal;\\n pointer-events: none;\\n}\\n\\n.ace_folding-enabled > .ace_gutter-cell {\\n padding-right: 13px;\\n}\\n\\n.ace_fold-widget {\\n box-sizing: border-box;\\n\\n margin: 0 -12px 0 1px;\\n display: none;\\n width: 11px;\\n vertical-align: top;\\n\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==\\\");\\n background-repeat: no-repeat;\\n background-position: center;\\n\\n border-radius: 3px;\\n \\n border: 1px solid transparent;\\n cursor: pointer;\\n}\\n\\n.ace_folding-enabled .ace_fold-widget {\\n display: inline-block; \\n}\\n\\n.ace_fold-widget.ace_end {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==\\\");\\n}\\n\\n.ace_fold-widget.ace_closed {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==\\\");\\n}\\n\\n.ace_fold-widget:hover {\\n border: 1px solid rgba(0, 0, 0, 0.3);\\n background-color: rgba(255, 255, 255, 0.2);\\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\\n}\\n\\n.ace_fold-widget:active {\\n border: 1px solid rgba(0, 0, 0, 0.4);\\n background-color: rgba(0, 0, 0, 0.05);\\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\\n}\\n/**\\n * Dark version for fold widgets\\n */\\n.ace_dark .ace_fold-widget {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\\\");\\n}\\n.ace_dark .ace_fold-widget.ace_end {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\\\");\\n}\\n.ace_dark .ace_fold-widget.ace_closed {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\\\");\\n}\\n.ace_dark .ace_fold-widget:hover {\\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\\n background-color: rgba(255, 255, 255, 0.1);\\n}\\n.ace_dark .ace_fold-widget:active {\\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\\n}\\n\\n.ace_inline_button {\\n border: 1px solid lightgray;\\n display: inline-block;\\n margin: -1px 8px;\\n padding: 0 5px;\\n pointer-events: auto;\\n cursor: pointer;\\n}\\n.ace_inline_button:hover {\\n border-color: gray;\\n background: rgba(200,200,200,0.2);\\n display: inline-block;\\n pointer-events: auto;\\n}\\n\\n.ace_fold-widget.ace_invalid {\\n background-color: #FFB4B4;\\n border-color: #DE5555;\\n}\\n\\n.ace_fade-fold-widgets .ace_fold-widget {\\n transition: opacity 0.4s ease 0.05s;\\n opacity: 0;\\n}\\n\\n.ace_fade-fold-widgets:hover .ace_fold-widget {\\n transition: opacity 0.05s ease 0.05s;\\n opacity:1;\\n}\\n\\n.ace_underline {\\n text-decoration: underline;\\n}\\n\\n.ace_bold {\\n font-weight: bold;\\n}\\n\\n.ace_nobold .ace_bold {\\n font-weight: normal;\\n}\\n\\n.ace_italic {\\n font-style: italic;\\n}\\n\\n\\n.ace_error-marker {\\n background-color: rgba(255, 0, 0,0.2);\\n position: absolute;\\n z-index: 9;\\n}\\n\\n.ace_highlight-marker {\\n background-color: rgba(255, 255, 0,0.2);\\n position: absolute;\\n z-index: 8;\\n}\\n\\n.ace_mobile-menu {\\n position: absolute;\\n line-height: 1.5;\\n border-radius: 4px;\\n -ms-user-select: none;\\n -moz-user-select: none;\\n -webkit-user-select: none;\\n user-select: none;\\n background: white;\\n box-shadow: 1px 3px 2px grey;\\n border: 1px solid #dcdcdc;\\n color: black;\\n}\\n.ace_dark > .ace_mobile-menu {\\n background: #333;\\n color: #ccc;\\n box-shadow: 1px 3px 2px grey;\\n border: 1px solid #444;\\n\\n}\\n.ace_mobile-button {\\n padding: 2px;\\n cursor: pointer;\\n overflow: hidden;\\n}\\n.ace_mobile-button:hover {\\n background-color: #eee;\\n opacity:1;\\n}\\n.ace_mobile-button:active {\\n background-color: #ddd;\\n}\\n\\n.ace_placeholder {\\n font-family: arial;\\n transform: scale(0.9);\\n transform-origin: left;\\n white-space: pre;\\n opacity: 0.7;\\n margin: 0 10px;\\n}\";\n\n});\n\nace.define(\"ace/layer/decorators\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/lib/oop\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar oop = require(\"../lib/oop\");\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar Decorator = function (parent, renderer) {\n this.canvas = dom.createElement(\"canvas\");\n this.renderer = renderer;\n this.pixelRatio = 1;\n this.maxHeight = renderer.layerConfig.maxHeight;\n this.lineHeight = renderer.layerConfig.lineHeight;\n this.canvasHeight = parent.parent.scrollHeight;\n this.heightRatio = this.canvasHeight / this.maxHeight;\n this.canvasWidth = parent.width;\n this.minDecorationHeight = (2 * this.pixelRatio) | 0;\n this.halfMinDecorationHeight = (this.minDecorationHeight / 2) | 0;\n this.canvas.width = this.canvasWidth;\n this.canvas.height = this.canvasHeight;\n this.canvas.style.top = 0 + \"px\";\n this.canvas.style.right = 0 + \"px\";\n this.canvas.style.zIndex = 7 + \"px\";\n this.canvas.style.position = \"absolute\";\n this.colors = {};\n this.colors.dark = {\n \"error\": \"rgba(255, 18, 18, 1)\",\n \"warning\": \"rgba(18, 136, 18, 1)\",\n \"info\": \"rgba(18, 18, 136, 1)\"\n };\n this.colors.light = {\n \"error\": \"rgb(255,51,51)\",\n \"warning\": \"rgb(32,133,72)\",\n \"info\": \"rgb(35,68,138)\"\n };\n parent.element.appendChild(this.canvas);\n};\n(function () {\n oop.implement(this, EventEmitter);\n this.$updateDecorators = function (config) {\n var colors = (this.renderer.theme.isDark === true) ? this.colors.dark : this.colors.light;\n if (config) {\n this.maxHeight = config.maxHeight;\n this.lineHeight = config.lineHeight;\n this.canvasHeight = config.height;\n var allLineHeight = (config.lastRow + 1) * this.lineHeight;\n if (allLineHeight < this.canvasHeight) {\n this.heightRatio = 1;\n }\n else {\n this.heightRatio = this.canvasHeight / this.maxHeight;\n }\n }\n var ctx = this.canvas.getContext(\"2d\");\n function compare(a, b) {\n if (a.priority < b.priority)\n return -1;\n if (a.priority > b.priority)\n return 1;\n return 0;\n }\n var annotations = this.renderer.session.$annotations;\n ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n if (annotations) {\n var priorities = {\n \"info\": 1,\n \"warning\": 2,\n \"error\": 3\n };\n annotations.forEach(function (item) {\n item.priority = priorities[item.type] || null;\n });\n annotations = annotations.sort(compare);\n var foldData = this.renderer.session.$foldData;\n for (var i = 0; i < annotations.length; i++) {\n var row = annotations[i].row;\n var compensateFold = this.compensateFoldRows(row, foldData);\n var currentY = Math.round((row - compensateFold) * this.lineHeight * this.heightRatio);\n var y1 = Math.round(((row - compensateFold) * this.lineHeight * this.heightRatio));\n var y2 = Math.round((((row - compensateFold) * this.lineHeight + this.lineHeight) * this.heightRatio));\n var height = y2 - y1;\n if (height < this.minDecorationHeight) {\n var yCenter = ((y1 + y2) / 2) | 0;\n if (yCenter < this.halfMinDecorationHeight) {\n yCenter = this.halfMinDecorationHeight;\n }\n else if (yCenter + this.halfMinDecorationHeight > this.canvasHeight) {\n yCenter = this.canvasHeight - this.halfMinDecorationHeight;\n }\n y1 = Math.round(yCenter - this.halfMinDecorationHeight);\n y2 = Math.round(yCenter + this.halfMinDecorationHeight);\n }\n ctx.fillStyle = colors[annotations[i].type] || null;\n ctx.fillRect(0, currentY, this.canvasWidth, y2 - y1);\n }\n }\n var cursor = this.renderer.session.selection.getCursor();\n if (cursor) {\n var compensateFold = this.compensateFoldRows(cursor.row, foldData);\n var currentY = Math.round((cursor.row - compensateFold) * this.lineHeight * this.heightRatio);\n ctx.fillStyle = \"rgba(0, 0, 0, 0.5)\";\n ctx.fillRect(0, currentY, this.canvasWidth, 2);\n }\n };\n this.compensateFoldRows = function (row, foldData) {\n var compensateFold = 0;\n if (foldData && foldData.length > 0) {\n for (var j = 0; j < foldData.length; j++) {\n if (row > foldData[j].start.row && row < foldData[j].end.row) {\n compensateFold += row - foldData[j].start.row;\n }\n else if (row >= foldData[j].end.row) {\n compensateFold += foldData[j].end.row - foldData[j].start.row;\n }\n }\n }\n return compensateFold;\n };\n}.call(Decorator.prototype));\nexports.Decorator = Decorator;\n\n});\n\nace.define(\"ace/virtual_renderer\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/config\",\"ace/layer/gutter\",\"ace/layer/marker\",\"ace/layer/text\",\"ace/layer/cursor\",\"ace/scrollbar\",\"ace/scrollbar\",\"ace/scrollbar_custom\",\"ace/scrollbar_custom\",\"ace/renderloop\",\"ace/layer/font_metrics\",\"ace/lib/event_emitter\",\"ace/css/editor.css\",\"ace/layer/decorators\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar dom = require(\"./lib/dom\");\nvar config = require(\"./config\");\nvar GutterLayer = require(\"./layer/gutter\").Gutter;\nvar MarkerLayer = require(\"./layer/marker\").Marker;\nvar TextLayer = require(\"./layer/text\").Text;\nvar CursorLayer = require(\"./layer/cursor\").Cursor;\nvar HScrollBar = require(\"./scrollbar\").HScrollBar;\nvar VScrollBar = require(\"./scrollbar\").VScrollBar;\nvar HScrollBarCustom = require(\"./scrollbar_custom\").HScrollBar;\nvar VScrollBarCustom = require(\"./scrollbar_custom\").VScrollBar;\nvar RenderLoop = require(\"./renderloop\").RenderLoop;\nvar FontMetrics = require(\"./layer/font_metrics\").FontMetrics;\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar editorCss = require(\"./css/editor.css\");\nvar Decorator = require(\"./layer/decorators\").Decorator;\nvar useragent = require(\"./lib/useragent\");\nvar HIDE_TEXTAREA = useragent.isIE;\ndom.importCssString(editorCss, \"ace_editor.css\", false);\nvar VirtualRenderer = function (container, theme) {\n var _self = this;\n this.container = container || dom.createElement(\"div\");\n dom.addCssClass(this.container, \"ace_editor\");\n if (dom.HI_DPI)\n dom.addCssClass(this.container, \"ace_hidpi\");\n this.setTheme(theme);\n if (config.get(\"useStrictCSP\") == null)\n config.set(\"useStrictCSP\", false);\n this.$gutter = dom.createElement(\"div\");\n this.$gutter.className = \"ace_gutter\";\n this.container.appendChild(this.$gutter);\n this.$gutter.setAttribute(\"aria-hidden\", true);\n this.scroller = dom.createElement(\"div\");\n this.scroller.className = \"ace_scroller\";\n this.container.appendChild(this.scroller);\n this.content = dom.createElement(\"div\");\n this.content.className = \"ace_content\";\n this.scroller.appendChild(this.content);\n this.$gutterLayer = new GutterLayer(this.$gutter);\n this.$gutterLayer.on(\"changeGutterWidth\", this.onGutterResize.bind(this));\n this.$markerBack = new MarkerLayer(this.content);\n var textLayer = this.$textLayer = new TextLayer(this.content);\n this.canvas = textLayer.element;\n this.$markerFront = new MarkerLayer(this.content);\n this.$cursorLayer = new CursorLayer(this.content);\n this.$horizScroll = false;\n this.$vScroll = false;\n this.scrollBar =\n this.scrollBarV = new VScrollBar(this.container, this);\n this.scrollBarH = new HScrollBar(this.container, this);\n this.scrollBarV.on(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollTop(e.data - _self.scrollMargin.top);\n });\n this.scrollBarH.on(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollLeft(e.data - _self.scrollMargin.left);\n });\n this.scrollTop = 0;\n this.scrollLeft = 0;\n this.cursorPos = {\n row: 0,\n column: 0\n };\n this.$fontMetrics = new FontMetrics(this.container, this.$textLayer.MAX_CHUNK_LENGTH);\n this.$textLayer.$setFontMetrics(this.$fontMetrics);\n this.$textLayer.on(\"changeCharacterSize\", function (e) {\n _self.updateCharacterSize();\n _self.onResize(true, _self.gutterWidth, _self.$size.width, _self.$size.height);\n _self._signal(\"changeCharacterSize\", e);\n });\n this.$size = {\n width: 0,\n height: 0,\n scrollerHeight: 0,\n scrollerWidth: 0,\n $dirty: true\n };\n this.layerConfig = {\n width: 1,\n padding: 0,\n firstRow: 0,\n firstRowScreen: 0,\n lastRow: 0,\n lineHeight: 0,\n characterWidth: 0,\n minHeight: 1,\n maxHeight: 1,\n offset: 0,\n height: 1,\n gutterOffset: 1\n };\n this.scrollMargin = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n v: 0,\n h: 0\n };\n this.margin = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n v: 0,\n h: 0\n };\n this.$keepTextAreaAtCursor = !useragent.isIOS;\n this.$loop = new RenderLoop(this.$renderChanges.bind(this), this.container.ownerDocument.defaultView);\n this.$loop.schedule(this.CHANGE_FULL);\n this.updateCharacterSize();\n this.setPadding(4);\n config.resetOptions(this);\n config._signal(\"renderer\", this);\n};\n(function () {\n this.CHANGE_CURSOR = 1;\n this.CHANGE_MARKER = 2;\n this.CHANGE_GUTTER = 4;\n this.CHANGE_SCROLL = 8;\n this.CHANGE_LINES = 16;\n this.CHANGE_TEXT = 32;\n this.CHANGE_SIZE = 64;\n this.CHANGE_MARKER_BACK = 128;\n this.CHANGE_MARKER_FRONT = 256;\n this.CHANGE_FULL = 512;\n this.CHANGE_H_SCROLL = 1024;\n oop.implement(this, EventEmitter);\n this.updateCharacterSize = function () {\n if (this.$textLayer.allowBoldFonts != this.$allowBoldFonts) {\n this.$allowBoldFonts = this.$textLayer.allowBoldFonts;\n this.setStyle(\"ace_nobold\", !this.$allowBoldFonts);\n }\n this.layerConfig.characterWidth =\n this.characterWidth = this.$textLayer.getCharacterWidth();\n this.layerConfig.lineHeight =\n this.lineHeight = this.$textLayer.getLineHeight();\n this.$updatePrintMargin();\n dom.setStyle(this.scroller.style, \"line-height\", this.lineHeight + \"px\");\n };\n this.setSession = function (session) {\n if (this.session)\n this.session.doc.off(\"changeNewLineMode\", this.onChangeNewLineMode);\n this.session = session;\n if (session && this.scrollMargin.top && session.getScrollTop() <= 0)\n session.setScrollTop(-this.scrollMargin.top);\n this.$cursorLayer.setSession(session);\n this.$markerBack.setSession(session);\n this.$markerFront.setSession(session);\n this.$gutterLayer.setSession(session);\n this.$textLayer.setSession(session);\n if (!session)\n return;\n this.$loop.schedule(this.CHANGE_FULL);\n this.session.$setFontMetrics(this.$fontMetrics);\n this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null;\n this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this);\n this.onChangeNewLineMode();\n this.session.doc.on(\"changeNewLineMode\", this.onChangeNewLineMode);\n };\n this.updateLines = function (firstRow, lastRow, force) {\n if (lastRow === undefined)\n lastRow = Infinity;\n if (!this.$changedLines) {\n this.$changedLines = {\n firstRow: firstRow,\n lastRow: lastRow\n };\n }\n else {\n if (this.$changedLines.firstRow > firstRow)\n this.$changedLines.firstRow = firstRow;\n if (this.$changedLines.lastRow < lastRow)\n this.$changedLines.lastRow = lastRow;\n }\n if (this.$changedLines.lastRow < this.layerConfig.firstRow) {\n if (force)\n this.$changedLines.lastRow = this.layerConfig.lastRow;\n else\n return;\n }\n if (this.$changedLines.firstRow > this.layerConfig.lastRow)\n return;\n this.$loop.schedule(this.CHANGE_LINES);\n };\n this.onChangeNewLineMode = function () {\n this.$loop.schedule(this.CHANGE_TEXT);\n this.$textLayer.$updateEolChar();\n this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR);\n };\n this.onChangeTabSize = function () {\n this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER);\n this.$textLayer.onChangeTabSize();\n };\n this.updateText = function () {\n this.$loop.schedule(this.CHANGE_TEXT);\n };\n this.updateFull = function (force) {\n if (force)\n this.$renderChanges(this.CHANGE_FULL, true);\n else\n this.$loop.schedule(this.CHANGE_FULL);\n };\n this.updateFontSize = function () {\n this.$textLayer.checkForSizeChanges();\n };\n this.$changes = 0;\n this.$updateSizeAsync = function () {\n if (this.$loop.pending)\n this.$size.$dirty = true;\n else\n this.onResize();\n };\n this.onResize = function (force, gutterWidth, width, height) {\n if (this.resizing > 2)\n return;\n else if (this.resizing > 0)\n this.resizing++;\n else\n this.resizing = force ? 1 : 0;\n var el = this.container;\n if (!height)\n height = el.clientHeight || el.scrollHeight;\n if (!width)\n width = el.clientWidth || el.scrollWidth;\n var changes = this.$updateCachedSize(force, gutterWidth, width, height);\n if (!this.$size.scrollerHeight || (!width && !height))\n return this.resizing = 0;\n if (force)\n this.$gutterLayer.$padding = null;\n if (force)\n this.$renderChanges(changes | this.$changes, true);\n else\n this.$loop.schedule(changes | this.$changes);\n if (this.resizing)\n this.resizing = 0;\n this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null;\n if (this.$customScrollbar) {\n this.$updateCustomScrollbar(true);\n }\n };\n this.$updateCachedSize = function (force, gutterWidth, width, height) {\n height -= (this.$extraHeight || 0);\n var changes = 0;\n var size = this.$size;\n var oldSize = {\n width: size.width,\n height: size.height,\n scrollerHeight: size.scrollerHeight,\n scrollerWidth: size.scrollerWidth\n };\n if (height && (force || size.height != height)) {\n size.height = height;\n changes |= this.CHANGE_SIZE;\n size.scrollerHeight = size.height;\n if (this.$horizScroll)\n size.scrollerHeight -= this.scrollBarH.getHeight();\n this.scrollBarV.setHeight(size.scrollerHeight);\n this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + \"px\";\n changes = changes | this.CHANGE_SCROLL;\n }\n if (width && (force || size.width != width)) {\n changes |= this.CHANGE_SIZE;\n size.width = width;\n if (gutterWidth == null)\n gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0;\n this.gutterWidth = gutterWidth;\n dom.setStyle(this.scrollBarH.element.style, \"left\", gutterWidth + \"px\");\n dom.setStyle(this.scroller.style, \"left\", gutterWidth + this.margin.left + \"px\");\n size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBarV.getWidth() - this.margin.h);\n dom.setStyle(this.$gutter.style, \"left\", this.margin.left + \"px\");\n var right = this.scrollBarV.getWidth() + \"px\";\n dom.setStyle(this.scrollBarH.element.style, \"right\", right);\n dom.setStyle(this.scroller.style, \"right\", right);\n dom.setStyle(this.scroller.style, \"bottom\", this.scrollBarH.getHeight());\n this.scrollBarH.setWidth(size.scrollerWidth);\n if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || force) {\n changes |= this.CHANGE_FULL;\n }\n }\n size.$dirty = !width || !height;\n if (changes)\n this._signal(\"resize\", oldSize);\n return changes;\n };\n this.onGutterResize = function (width) {\n var gutterWidth = this.$showGutter ? width : 0;\n if (gutterWidth != this.gutterWidth)\n this.$changes |= this.$updateCachedSize(true, gutterWidth, this.$size.width, this.$size.height);\n if (this.session.getUseWrapMode() && this.adjustWrapLimit()) {\n this.$loop.schedule(this.CHANGE_FULL);\n }\n else if (this.$size.$dirty) {\n this.$loop.schedule(this.CHANGE_FULL);\n }\n else {\n this.$computeLayerConfig();\n }\n };\n this.adjustWrapLimit = function () {\n var availableWidth = this.$size.scrollerWidth - this.$padding * 2;\n var limit = Math.floor(availableWidth / this.characterWidth);\n return this.session.adjustWrapLimit(limit, this.$showPrintMargin && this.$printMarginColumn);\n };\n this.setAnimatedScroll = function (shouldAnimate) {\n this.setOption(\"animatedScroll\", shouldAnimate);\n };\n this.getAnimatedScroll = function () {\n return this.$animatedScroll;\n };\n this.setShowInvisibles = function (showInvisibles) {\n this.setOption(\"showInvisibles\", showInvisibles);\n this.session.$bidiHandler.setShowInvisibles(showInvisibles);\n };\n this.getShowInvisibles = function () {\n return this.getOption(\"showInvisibles\");\n };\n this.getDisplayIndentGuides = function () {\n return this.getOption(\"displayIndentGuides\");\n };\n this.setDisplayIndentGuides = function (display) {\n this.setOption(\"displayIndentGuides\", display);\n };\n this.getHighlightIndentGuides = function () {\n return this.getOption(\"highlightIndentGuides\");\n };\n this.setHighlightIndentGuides = function (highlight) {\n this.setOption(\"highlightIndentGuides\", highlight);\n };\n this.setShowPrintMargin = function (showPrintMargin) {\n this.setOption(\"showPrintMargin\", showPrintMargin);\n };\n this.getShowPrintMargin = function () {\n return this.getOption(\"showPrintMargin\");\n };\n this.setPrintMarginColumn = function (showPrintMargin) {\n this.setOption(\"printMarginColumn\", showPrintMargin);\n };\n this.getPrintMarginColumn = function () {\n return this.getOption(\"printMarginColumn\");\n };\n this.getShowGutter = function () {\n return this.getOption(\"showGutter\");\n };\n this.setShowGutter = function (show) {\n return this.setOption(\"showGutter\", show);\n };\n this.getFadeFoldWidgets = function () {\n return this.getOption(\"fadeFoldWidgets\");\n };\n this.setFadeFoldWidgets = function (show) {\n this.setOption(\"fadeFoldWidgets\", show);\n };\n this.setHighlightGutterLine = function (shouldHighlight) {\n this.setOption(\"highlightGutterLine\", shouldHighlight);\n };\n this.getHighlightGutterLine = function () {\n return this.getOption(\"highlightGutterLine\");\n };\n this.$updatePrintMargin = function () {\n if (!this.$showPrintMargin && !this.$printMarginEl)\n return;\n if (!this.$printMarginEl) {\n var containerEl = dom.createElement(\"div\");\n containerEl.className = \"ace_layer ace_print-margin-layer\";\n this.$printMarginEl = dom.createElement(\"div\");\n this.$printMarginEl.className = \"ace_print-margin\";\n containerEl.appendChild(this.$printMarginEl);\n this.content.insertBefore(containerEl, this.content.firstChild);\n }\n var style = this.$printMarginEl.style;\n style.left = Math.round(this.characterWidth * this.$printMarginColumn + this.$padding) + \"px\";\n style.visibility = this.$showPrintMargin ? \"visible\" : \"hidden\";\n if (this.session && this.session.$wrap == -1)\n this.adjustWrapLimit();\n };\n this.getContainerElement = function () {\n return this.container;\n };\n this.getMouseEventTarget = function () {\n return this.scroller;\n };\n this.getTextAreaContainer = function () {\n return this.container;\n };\n this.$moveTextAreaToCursor = function () {\n if (this.$isMousePressed)\n return;\n var style = this.textarea.style;\n var composition = this.$composition;\n if (!this.$keepTextAreaAtCursor && !composition) {\n dom.translate(this.textarea, -100, 0);\n return;\n }\n var pixelPos = this.$cursorLayer.$pixelPos;\n if (!pixelPos)\n return;\n if (composition && composition.markerRange)\n pixelPos = this.$cursorLayer.getPixelPosition(composition.markerRange.start, true);\n var config = this.layerConfig;\n var posTop = pixelPos.top;\n var posLeft = pixelPos.left;\n posTop -= config.offset;\n var h = composition && composition.useTextareaForIME ? this.lineHeight : HIDE_TEXTAREA ? 0 : 1;\n if (posTop < 0 || posTop > config.height - h) {\n dom.translate(this.textarea, 0, 0);\n return;\n }\n var w = 1;\n var maxTop = this.$size.height - h;\n if (!composition) {\n posTop += this.lineHeight;\n }\n else {\n if (composition.useTextareaForIME) {\n var val = this.textarea.value;\n w = this.characterWidth * (this.session.$getStringScreenWidth(val)[0]);\n }\n else {\n posTop += this.lineHeight + 2;\n }\n }\n posLeft -= this.scrollLeft;\n if (posLeft > this.$size.scrollerWidth - w)\n posLeft = this.$size.scrollerWidth - w;\n posLeft += this.gutterWidth + this.margin.left;\n dom.setStyle(style, \"height\", h + \"px\");\n dom.setStyle(style, \"width\", w + \"px\");\n dom.translate(this.textarea, Math.min(posLeft, this.$size.scrollerWidth - w), Math.min(posTop, maxTop));\n };\n this.getFirstVisibleRow = function () {\n return this.layerConfig.firstRow;\n };\n this.getFirstFullyVisibleRow = function () {\n return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1);\n };\n this.getLastFullyVisibleRow = function () {\n var config = this.layerConfig;\n var lastRow = config.lastRow;\n var top = this.session.documentToScreenRow(lastRow, 0) * config.lineHeight;\n if (top - this.session.getScrollTop() > config.height - config.lineHeight)\n return lastRow - 1;\n return lastRow;\n };\n this.getLastVisibleRow = function () {\n return this.layerConfig.lastRow;\n };\n this.$padding = null;\n this.setPadding = function (padding) {\n this.$padding = padding;\n this.$textLayer.setPadding(padding);\n this.$cursorLayer.setPadding(padding);\n this.$markerFront.setPadding(padding);\n this.$markerBack.setPadding(padding);\n this.$loop.schedule(this.CHANGE_FULL);\n this.$updatePrintMargin();\n };\n this.setScrollMargin = function (top, bottom, left, right) {\n var sm = this.scrollMargin;\n sm.top = top | 0;\n sm.bottom = bottom | 0;\n sm.right = right | 0;\n sm.left = left | 0;\n sm.v = sm.top + sm.bottom;\n sm.h = sm.left + sm.right;\n if (sm.top && this.scrollTop <= 0 && this.session)\n this.session.setScrollTop(-sm.top);\n this.updateFull();\n };\n this.setMargin = function (top, bottom, left, right) {\n var sm = this.margin;\n sm.top = top | 0;\n sm.bottom = bottom | 0;\n sm.right = right | 0;\n sm.left = left | 0;\n sm.v = sm.top + sm.bottom;\n sm.h = sm.left + sm.right;\n this.$updateCachedSize(true, this.gutterWidth, this.$size.width, this.$size.height);\n this.updateFull();\n };\n this.getHScrollBarAlwaysVisible = function () {\n return this.$hScrollBarAlwaysVisible;\n };\n this.setHScrollBarAlwaysVisible = function (alwaysVisible) {\n this.setOption(\"hScrollBarAlwaysVisible\", alwaysVisible);\n };\n this.getVScrollBarAlwaysVisible = function () {\n return this.$vScrollBarAlwaysVisible;\n };\n this.setVScrollBarAlwaysVisible = function (alwaysVisible) {\n this.setOption(\"vScrollBarAlwaysVisible\", alwaysVisible);\n };\n this.$updateScrollBarV = function () {\n var scrollHeight = this.layerConfig.maxHeight;\n var scrollerHeight = this.$size.scrollerHeight;\n if (!this.$maxLines && this.$scrollPastEnd) {\n scrollHeight -= (scrollerHeight - this.lineHeight) * this.$scrollPastEnd;\n if (this.scrollTop > scrollHeight - scrollerHeight) {\n scrollHeight = this.scrollTop + scrollerHeight;\n this.scrollBarV.scrollTop = null;\n }\n }\n this.scrollBarV.setScrollHeight(scrollHeight + this.scrollMargin.v);\n this.scrollBarV.setScrollTop(this.scrollTop + this.scrollMargin.top);\n };\n this.$updateScrollBarH = function () {\n this.scrollBarH.setScrollWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h);\n this.scrollBarH.setScrollLeft(this.scrollLeft + this.scrollMargin.left);\n };\n this.$frozen = false;\n this.freeze = function () {\n this.$frozen = true;\n };\n this.unfreeze = function () {\n this.$frozen = false;\n };\n this.$renderChanges = function (changes, force) {\n if (this.$changes) {\n changes |= this.$changes;\n this.$changes = 0;\n }\n if ((!this.session || !this.container.offsetWidth || this.$frozen) || (!changes && !force)) {\n this.$changes |= changes;\n return;\n }\n if (this.$size.$dirty) {\n this.$changes |= changes;\n return this.onResize(true);\n }\n if (!this.lineHeight) {\n this.$textLayer.checkForSizeChanges();\n }\n this._signal(\"beforeRender\", changes);\n if (this.session && this.session.$bidiHandler)\n this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);\n var config = this.layerConfig;\n if (changes & this.CHANGE_FULL ||\n changes & this.CHANGE_SIZE ||\n changes & this.CHANGE_TEXT ||\n changes & this.CHANGE_LINES ||\n changes & this.CHANGE_SCROLL ||\n changes & this.CHANGE_H_SCROLL) {\n changes |= this.$computeLayerConfig() | this.$loop.clear();\n if (config.firstRow != this.layerConfig.firstRow && config.firstRowScreen == this.layerConfig.firstRowScreen) {\n var st = this.scrollTop + (config.firstRow - this.layerConfig.firstRow) * this.lineHeight;\n if (st > 0) {\n this.scrollTop = st;\n changes = changes | this.CHANGE_SCROLL;\n changes |= this.$computeLayerConfig() | this.$loop.clear();\n }\n }\n config = this.layerConfig;\n this.$updateScrollBarV();\n if (changes & this.CHANGE_H_SCROLL)\n this.$updateScrollBarH();\n dom.translate(this.content, -this.scrollLeft, -config.offset);\n var width = config.width + 2 * this.$padding + \"px\";\n var height = config.minHeight + \"px\";\n dom.setStyle(this.content.style, \"width\", width);\n dom.setStyle(this.content.style, \"height\", height);\n }\n if (changes & this.CHANGE_H_SCROLL) {\n dom.translate(this.content, -this.scrollLeft, -config.offset);\n this.scroller.className = this.scrollLeft <= 0 ? \"ace_scroller\" : \"ace_scroller ace_scroll-left\";\n }\n if (changes & this.CHANGE_FULL) {\n this.$changedLines = null;\n this.$textLayer.update(config);\n if (this.$showGutter)\n this.$gutterLayer.update(config);\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n this.$markerBack.update(config);\n this.$markerFront.update(config);\n this.$cursorLayer.update(config);\n this.$moveTextAreaToCursor();\n this._signal(\"afterRender\", changes);\n return;\n }\n if (changes & this.CHANGE_SCROLL) {\n this.$changedLines = null;\n if (changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES)\n this.$textLayer.update(config);\n else\n this.$textLayer.scrollLines(config);\n if (this.$showGutter) {\n if (changes & this.CHANGE_GUTTER || changes & this.CHANGE_LINES)\n this.$gutterLayer.update(config);\n else\n this.$gutterLayer.scrollLines(config);\n }\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n this.$markerBack.update(config);\n this.$markerFront.update(config);\n this.$cursorLayer.update(config);\n this.$moveTextAreaToCursor();\n this._signal(\"afterRender\", changes);\n return;\n }\n if (changes & this.CHANGE_TEXT) {\n this.$changedLines = null;\n this.$textLayer.update(config);\n if (this.$showGutter)\n this.$gutterLayer.update(config);\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n }\n else if (changes & this.CHANGE_LINES) {\n if (this.$updateLines() || (changes & this.CHANGE_GUTTER) && this.$showGutter)\n this.$gutterLayer.update(config);\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n }\n else if (changes & this.CHANGE_TEXT || changes & this.CHANGE_GUTTER) {\n if (this.$showGutter)\n this.$gutterLayer.update(config);\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n }\n else if (changes & this.CHANGE_CURSOR) {\n if (this.$highlightGutterLine)\n this.$gutterLayer.updateLineHighlight(config);\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n }\n if (changes & this.CHANGE_CURSOR) {\n this.$cursorLayer.update(config);\n this.$moveTextAreaToCursor();\n }\n if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) {\n this.$markerFront.update(config);\n }\n if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK)) {\n this.$markerBack.update(config);\n }\n this._signal(\"afterRender\", changes);\n };\n this.$autosize = function () {\n var height = this.session.getScreenLength() * this.lineHeight;\n var maxHeight = this.$maxLines * this.lineHeight;\n var desiredHeight = Math.min(maxHeight, Math.max((this.$minLines || 1) * this.lineHeight, height)) + this.scrollMargin.v + (this.$extraHeight || 0);\n if (this.$horizScroll)\n desiredHeight += this.scrollBarH.getHeight();\n if (this.$maxPixelHeight && desiredHeight > this.$maxPixelHeight)\n desiredHeight = this.$maxPixelHeight;\n var hideScrollbars = desiredHeight <= 2 * this.lineHeight;\n var vScroll = !hideScrollbars && height > maxHeight;\n if (desiredHeight != this.desiredHeight ||\n this.$size.height != this.desiredHeight || vScroll != this.$vScroll) {\n if (vScroll != this.$vScroll) {\n this.$vScroll = vScroll;\n this.scrollBarV.setVisible(vScroll);\n }\n var w = this.container.clientWidth;\n this.container.style.height = desiredHeight + \"px\";\n this.$updateCachedSize(true, this.$gutterWidth, w, desiredHeight);\n this.desiredHeight = desiredHeight;\n this._signal(\"autosize\");\n }\n };\n this.$computeLayerConfig = function () {\n var session = this.session;\n var size = this.$size;\n var hideScrollbars = size.height <= 2 * this.lineHeight;\n var screenLines = this.session.getScreenLength();\n var maxHeight = screenLines * this.lineHeight;\n var longestLine = this.$getLongestLine();\n var horizScroll = !hideScrollbars && (this.$hScrollBarAlwaysVisible ||\n size.scrollerWidth - longestLine - 2 * this.$padding < 0);\n var hScrollChanged = this.$horizScroll !== horizScroll;\n if (hScrollChanged) {\n this.$horizScroll = horizScroll;\n this.scrollBarH.setVisible(horizScroll);\n }\n var vScrollBefore = this.$vScroll; // autosize can change vscroll value in which case we need to update longestLine\n if (this.$maxLines && this.lineHeight > 1)\n this.$autosize();\n var minHeight = size.scrollerHeight + this.lineHeight;\n var scrollPastEnd = !this.$maxLines && this.$scrollPastEnd\n ? (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd\n : 0;\n maxHeight += scrollPastEnd;\n var sm = this.scrollMargin;\n this.session.setScrollTop(Math.max(-sm.top, Math.min(this.scrollTop, maxHeight - size.scrollerHeight + sm.bottom)));\n this.session.setScrollLeft(Math.max(-sm.left, Math.min(this.scrollLeft, longestLine + 2 * this.$padding - size.scrollerWidth + sm.right)));\n var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible ||\n size.scrollerHeight - maxHeight + scrollPastEnd < 0 || this.scrollTop > sm.top);\n var vScrollChanged = vScrollBefore !== vScroll;\n if (vScrollChanged) {\n this.$vScroll = vScroll;\n this.scrollBarV.setVisible(vScroll);\n }\n var offset = this.scrollTop % this.lineHeight;\n var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;\n var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight));\n var lastRow = firstRow + lineCount;\n var firstRowScreen, firstRowHeight;\n var lineHeight = this.lineHeight;\n firstRow = session.screenToDocumentRow(firstRow, 0);\n var foldLine = session.getFoldLine(firstRow);\n if (foldLine) {\n firstRow = foldLine.start.row;\n }\n firstRowScreen = session.documentToScreenRow(firstRow, 0);\n firstRowHeight = session.getRowLength(firstRow) * lineHeight;\n lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1);\n minHeight = size.scrollerHeight + session.getRowLength(lastRow) * lineHeight +\n firstRowHeight;\n offset = this.scrollTop - firstRowScreen * lineHeight;\n var changes = 0;\n if (this.layerConfig.width != longestLine || hScrollChanged)\n changes = this.CHANGE_H_SCROLL;\n if (hScrollChanged || vScrollChanged) {\n changes |= this.$updateCachedSize(true, this.gutterWidth, size.width, size.height);\n this._signal(\"scrollbarVisibilityChanged\");\n if (vScrollChanged)\n longestLine = this.$getLongestLine();\n }\n this.layerConfig = {\n width: longestLine,\n padding: this.$padding,\n firstRow: firstRow,\n firstRowScreen: firstRowScreen,\n lastRow: lastRow,\n lineHeight: lineHeight,\n characterWidth: this.characterWidth,\n minHeight: minHeight,\n maxHeight: maxHeight,\n offset: offset,\n gutterOffset: lineHeight ? Math.max(0, Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight)) : 0,\n height: this.$size.scrollerHeight\n };\n if (this.session.$bidiHandler)\n this.session.$bidiHandler.setContentWidth(longestLine - this.$padding);\n return changes;\n };\n this.$updateLines = function () {\n if (!this.$changedLines)\n return;\n var firstRow = this.$changedLines.firstRow;\n var lastRow = this.$changedLines.lastRow;\n this.$changedLines = null;\n var layerConfig = this.layerConfig;\n if (firstRow > layerConfig.lastRow + 1) {\n return;\n }\n if (lastRow < layerConfig.firstRow) {\n return;\n }\n if (lastRow === Infinity) {\n if (this.$showGutter)\n this.$gutterLayer.update(layerConfig);\n this.$textLayer.update(layerConfig);\n return;\n }\n this.$textLayer.updateLines(layerConfig, firstRow, lastRow);\n return true;\n };\n this.$getLongestLine = function () {\n var charCount = this.session.getScreenWidth();\n if (this.showInvisibles && !this.session.$useWrapMode)\n charCount += 1;\n if (this.$textLayer && charCount > this.$textLayer.MAX_LINE_LENGTH)\n charCount = this.$textLayer.MAX_LINE_LENGTH + 30;\n return Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(charCount * this.characterWidth));\n };\n this.updateFrontMarkers = function () {\n this.$markerFront.setMarkers(this.session.getMarkers(true));\n this.$loop.schedule(this.CHANGE_MARKER_FRONT);\n };\n this.updateBackMarkers = function () {\n this.$markerBack.setMarkers(this.session.getMarkers());\n this.$loop.schedule(this.CHANGE_MARKER_BACK);\n };\n this.addGutterDecoration = function (row, className) {\n this.$gutterLayer.addGutterDecoration(row, className);\n };\n this.removeGutterDecoration = function (row, className) {\n this.$gutterLayer.removeGutterDecoration(row, className);\n };\n this.updateBreakpoints = function (rows) {\n this.$loop.schedule(this.CHANGE_GUTTER);\n };\n this.setAnnotations = function (annotations) {\n this.$gutterLayer.setAnnotations(annotations);\n this.$loop.schedule(this.CHANGE_GUTTER);\n };\n this.updateCursor = function () {\n this.$loop.schedule(this.CHANGE_CURSOR);\n };\n this.hideCursor = function () {\n this.$cursorLayer.hideCursor();\n };\n this.showCursor = function () {\n this.$cursorLayer.showCursor();\n };\n this.scrollSelectionIntoView = function (anchor, lead, offset) {\n this.scrollCursorIntoView(anchor, offset);\n this.scrollCursorIntoView(lead, offset);\n };\n this.scrollCursorIntoView = function (cursor, offset, $viewMargin) {\n if (this.$size.scrollerHeight === 0)\n return;\n var pos = this.$cursorLayer.getPixelPosition(cursor);\n var newLeft = pos.left;\n var newTop = pos.top;\n var topMargin = $viewMargin && $viewMargin.top || 0;\n var bottomMargin = $viewMargin && $viewMargin.bottom || 0;\n if (this.$scrollAnimation) {\n this.$stopAnimation = true;\n }\n var currentTop = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop;\n if (currentTop + topMargin > newTop) {\n if (offset && currentTop + topMargin > newTop + this.lineHeight)\n newTop -= offset * this.$size.scrollerHeight;\n if (newTop === 0)\n newTop = -this.scrollMargin.top;\n this.session.setScrollTop(newTop);\n }\n else if (currentTop + this.$size.scrollerHeight - bottomMargin < newTop + this.lineHeight) {\n if (offset && currentTop + this.$size.scrollerHeight - bottomMargin < newTop - this.lineHeight)\n newTop += offset * this.$size.scrollerHeight;\n this.session.setScrollTop(newTop + this.lineHeight + bottomMargin - this.$size.scrollerHeight);\n }\n var currentLeft = this.scrollLeft;\n var twoCharsWidth = 2 * this.layerConfig.characterWidth;\n if (newLeft - twoCharsWidth < currentLeft) {\n newLeft -= twoCharsWidth;\n if (newLeft < this.$padding + twoCharsWidth) {\n newLeft = -this.scrollMargin.left;\n }\n this.session.setScrollLeft(newLeft);\n }\n else {\n newLeft += twoCharsWidth;\n if (currentLeft + this.$size.scrollerWidth < newLeft + this.characterWidth) {\n this.session.setScrollLeft(Math.round(newLeft + this.characterWidth - this.$size.scrollerWidth));\n }\n else if (currentLeft <= this.$padding && newLeft - currentLeft < this.characterWidth) {\n this.session.setScrollLeft(0);\n }\n }\n };\n this.getScrollTop = function () {\n return this.session.getScrollTop();\n };\n this.getScrollLeft = function () {\n return this.session.getScrollLeft();\n };\n this.getScrollTopRow = function () {\n return this.scrollTop / this.lineHeight;\n };\n this.getScrollBottomRow = function () {\n return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1);\n };\n this.scrollToRow = function (row) {\n this.session.setScrollTop(row * this.lineHeight);\n };\n this.alignCursor = function (cursor, alignment) {\n if (typeof cursor == \"number\")\n cursor = { row: cursor, column: 0 };\n var pos = this.$cursorLayer.getPixelPosition(cursor);\n var h = this.$size.scrollerHeight - this.lineHeight;\n var offset = pos.top - h * (alignment || 0);\n this.session.setScrollTop(offset);\n return offset;\n };\n this.STEPS = 8;\n this.$calcSteps = function (fromValue, toValue) {\n var i = 0;\n var l = this.STEPS;\n var steps = [];\n var func = function (t, x_min, dx) {\n return dx * (Math.pow(t - 1, 3) + 1) + x_min;\n };\n for (i = 0; i < l; ++i)\n steps.push(func(i / this.STEPS, fromValue, toValue - fromValue));\n return steps;\n };\n this.scrollToLine = function (line, center, animate, callback) {\n var pos = this.$cursorLayer.getPixelPosition({ row: line, column: 0 });\n var offset = pos.top;\n if (center)\n offset -= this.$size.scrollerHeight / 2;\n var initialScroll = this.scrollTop;\n this.session.setScrollTop(offset);\n if (animate !== false)\n this.animateScrolling(initialScroll, callback);\n };\n this.animateScrolling = function (fromValue, callback) {\n var toValue = this.scrollTop;\n if (!this.$animatedScroll)\n return;\n var _self = this;\n if (fromValue == toValue)\n return;\n if (this.$scrollAnimation) {\n var oldSteps = this.$scrollAnimation.steps;\n if (oldSteps.length) {\n fromValue = oldSteps[0];\n if (fromValue == toValue)\n return;\n }\n }\n var steps = _self.$calcSteps(fromValue, toValue);\n this.$scrollAnimation = { from: fromValue, to: toValue, steps: steps };\n clearInterval(this.$timer);\n _self.session.setScrollTop(steps.shift());\n _self.session.$scrollTop = toValue;\n function endAnimation() {\n _self.$timer = clearInterval(_self.$timer);\n _self.$scrollAnimation = null;\n _self.$stopAnimation = false;\n callback && callback();\n }\n this.$timer = setInterval(function () {\n if (_self.$stopAnimation) {\n endAnimation();\n return;\n }\n if (!_self.session)\n return clearInterval(_self.$timer);\n if (steps.length) {\n _self.session.setScrollTop(steps.shift());\n _self.session.$scrollTop = toValue;\n }\n else if (toValue != null) {\n _self.session.$scrollTop = -1;\n _self.session.setScrollTop(toValue);\n toValue = null;\n }\n else {\n endAnimation();\n }\n }, 10);\n };\n this.scrollToY = function (scrollTop) {\n if (this.scrollTop !== scrollTop) {\n this.$loop.schedule(this.CHANGE_SCROLL);\n this.scrollTop = scrollTop;\n }\n };\n this.scrollToX = function (scrollLeft) {\n if (this.scrollLeft !== scrollLeft)\n this.scrollLeft = scrollLeft;\n this.$loop.schedule(this.CHANGE_H_SCROLL);\n };\n this.scrollTo = function (x, y) {\n this.session.setScrollTop(y);\n this.session.setScrollLeft(x);\n };\n this.scrollBy = function (deltaX, deltaY) {\n deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY);\n deltaX && this.session.setScrollLeft(this.session.getScrollLeft() + deltaX);\n };\n this.isScrollableBy = function (deltaX, deltaY) {\n if (deltaY < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top)\n return true;\n if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight\n - this.layerConfig.maxHeight < -1 + this.scrollMargin.bottom)\n return true;\n if (deltaX < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left)\n return true;\n if (deltaX > 0 && this.session.getScrollLeft() + this.$size.scrollerWidth\n - this.layerConfig.width < -1 + this.scrollMargin.right)\n return true;\n };\n this.pixelToScreenCoordinates = function (x, y) {\n var canvasPos;\n if (this.$hasCssTransforms) {\n canvasPos = { top: 0, left: 0 };\n var p = this.$fontMetrics.transformCoordinates([x, y]);\n x = p[1] - this.gutterWidth - this.margin.left;\n y = p[0];\n }\n else {\n canvasPos = this.scroller.getBoundingClientRect();\n }\n var offsetX = x + this.scrollLeft - canvasPos.left - this.$padding;\n var offset = offsetX / this.characterWidth;\n var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight);\n var col = this.$blockCursor ? Math.floor(offset) : Math.round(offset);\n return { row: row, column: col, side: offset - col > 0 ? 1 : -1, offsetX: offsetX };\n };\n this.screenToTextCoordinates = function (x, y) {\n var canvasPos;\n if (this.$hasCssTransforms) {\n canvasPos = { top: 0, left: 0 };\n var p = this.$fontMetrics.transformCoordinates([x, y]);\n x = p[1] - this.gutterWidth - this.margin.left;\n y = p[0];\n }\n else {\n canvasPos = this.scroller.getBoundingClientRect();\n }\n var offsetX = x + this.scrollLeft - canvasPos.left - this.$padding;\n var offset = offsetX / this.characterWidth;\n var col = this.$blockCursor ? Math.floor(offset) : Math.round(offset);\n var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight);\n return this.session.screenToDocumentPosition(row, Math.max(col, 0), offsetX);\n };\n this.textToScreenCoordinates = function (row, column) {\n var canvasPos = this.scroller.getBoundingClientRect();\n var pos = this.session.documentToScreenPosition(row, column);\n var x = this.$padding + (this.session.$bidiHandler.isBidiRow(pos.row, row)\n ? this.session.$bidiHandler.getPosLeft(pos.column)\n : Math.round(pos.column * this.characterWidth));\n var y = pos.row * this.lineHeight;\n return {\n pageX: canvasPos.left + x - this.scrollLeft,\n pageY: canvasPos.top + y - this.scrollTop\n };\n };\n this.visualizeFocus = function () {\n dom.addCssClass(this.container, \"ace_focus\");\n };\n this.visualizeBlur = function () {\n dom.removeCssClass(this.container, \"ace_focus\");\n };\n this.showComposition = function (composition) {\n this.$composition = composition;\n if (!composition.cssText) {\n composition.cssText = this.textarea.style.cssText;\n }\n if (composition.useTextareaForIME == undefined)\n composition.useTextareaForIME = this.$useTextareaForIME;\n if (this.$useTextareaForIME) {\n dom.addCssClass(this.textarea, \"ace_composition\");\n this.textarea.style.cssText = \"\";\n this.$moveTextAreaToCursor();\n this.$cursorLayer.element.style.display = \"none\";\n }\n else {\n composition.markerId = this.session.addMarker(composition.markerRange, \"ace_composition_marker\", \"text\");\n }\n };\n this.setCompositionText = function (text) {\n var cursor = this.session.selection.cursor;\n this.addToken(text, \"composition_placeholder\", cursor.row, cursor.column);\n this.$moveTextAreaToCursor();\n };\n this.hideComposition = function () {\n if (!this.$composition)\n return;\n if (this.$composition.markerId)\n this.session.removeMarker(this.$composition.markerId);\n dom.removeCssClass(this.textarea, \"ace_composition\");\n this.textarea.style.cssText = this.$composition.cssText;\n var cursor = this.session.selection.cursor;\n this.removeExtraToken(cursor.row, cursor.column);\n this.$composition = null;\n this.$cursorLayer.element.style.display = \"\";\n };\n this.addToken = function (text, type, row, column) {\n var session = this.session;\n session.bgTokenizer.lines[row] = null;\n var newToken = { type: type, value: text };\n var tokens = session.getTokens(row);\n if (column == null) {\n tokens.push(newToken);\n }\n else {\n var l = 0;\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n l += token.value.length;\n if (column <= l) {\n var diff = token.value.length - (l - column);\n var before = token.value.slice(0, diff);\n var after = token.value.slice(diff);\n tokens.splice(i, 1, { type: token.type, value: before }, newToken, { type: token.type, value: after });\n break;\n }\n }\n }\n this.updateLines(row, row);\n };\n this.removeExtraToken = function (row, column) {\n this.updateLines(row, row);\n };\n this.setTheme = function (theme, cb) {\n var _self = this;\n this.$themeId = theme;\n _self._dispatchEvent('themeChange', { theme: theme });\n if (!theme || typeof theme == \"string\") {\n var moduleName = theme || this.$options.theme.initialValue;\n config.loadModule([\"theme\", moduleName], afterLoad);\n }\n else {\n afterLoad(theme);\n }\n function afterLoad(module) {\n if (_self.$themeId != theme)\n return cb && cb();\n if (!module || !module.cssClass)\n throw new Error(\"couldn't load module \" + theme + \" or it didn't call define\");\n if (module.$id)\n _self.$themeId = module.$id;\n dom.importCssString(module.cssText, module.cssClass, _self.container);\n if (_self.theme)\n dom.removeCssClass(_self.container, _self.theme.cssClass);\n var padding = \"padding\" in module ? module.padding\n : \"padding\" in (_self.theme || {}) ? 4 : _self.$padding;\n if (_self.$padding && padding != _self.$padding)\n _self.setPadding(padding);\n _self.$theme = module.cssClass;\n _self.theme = module;\n dom.addCssClass(_self.container, module.cssClass);\n dom.setCssClass(_self.container, \"ace_dark\", module.isDark);\n if (_self.$size) {\n _self.$size.width = 0;\n _self.$updateSizeAsync();\n }\n _self._dispatchEvent('themeLoaded', { theme: module });\n cb && cb();\n }\n };\n this.getTheme = function () {\n return this.$themeId;\n };\n this.setStyle = function (style, include) {\n dom.setCssClass(this.container, style, include !== false);\n };\n this.unsetStyle = function (style) {\n dom.removeCssClass(this.container, style);\n };\n this.setCursorStyle = function (style) {\n dom.setStyle(this.scroller.style, \"cursor\", style);\n };\n this.setMouseCursor = function (cursorStyle) {\n dom.setStyle(this.scroller.style, \"cursor\", cursorStyle);\n };\n this.attachToShadowRoot = function () {\n dom.importCssString(editorCss, \"ace_editor.css\", this.container);\n };\n this.destroy = function () {\n this.freeze();\n this.$fontMetrics.destroy();\n this.$cursorLayer.destroy();\n this.removeAllListeners();\n this.container.textContent = \"\";\n };\n this.$updateCustomScrollbar = function (val) {\n var _self = this;\n this.$horizScroll = this.$vScroll = null;\n this.scrollBarV.element.remove();\n this.scrollBarH.element.remove();\n if (this.$scrollDecorator) {\n delete this.$scrollDecorator;\n }\n if (val === true) {\n this.scrollBarV = new VScrollBarCustom(this.container, this);\n this.scrollBarH = new HScrollBarCustom(this.container, this);\n this.scrollBarV.setHeight(this.$size.scrollerHeight);\n this.scrollBarH.setWidth(this.$size.scrollerWidth);\n this.scrollBarV.addEventListener(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollTop(e.data - _self.scrollMargin.top);\n });\n this.scrollBarH.addEventListener(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollLeft(e.data - _self.scrollMargin.left);\n });\n this.$scrollDecorator = new Decorator(this.scrollBarV, this);\n this.$scrollDecorator.$updateDecorators();\n }\n else {\n this.scrollBarV = new VScrollBar(this.container, this);\n this.scrollBarH = new HScrollBar(this.container, this);\n this.scrollBarV.addEventListener(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollTop(e.data - _self.scrollMargin.top);\n });\n this.scrollBarH.addEventListener(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollLeft(e.data - _self.scrollMargin.left);\n });\n }\n };\n}).call(VirtualRenderer.prototype);\nconfig.defineOptions(VirtualRenderer.prototype, \"renderer\", {\n animatedScroll: { initialValue: false },\n showInvisibles: {\n set: function (value) {\n if (this.$textLayer.setShowInvisibles(value))\n this.$loop.schedule(this.CHANGE_TEXT);\n },\n initialValue: false\n },\n showPrintMargin: {\n set: function () { this.$updatePrintMargin(); },\n initialValue: true\n },\n printMarginColumn: {\n set: function () { this.$updatePrintMargin(); },\n initialValue: 80\n },\n printMargin: {\n set: function (val) {\n if (typeof val == \"number\")\n this.$printMarginColumn = val;\n this.$showPrintMargin = !!val;\n this.$updatePrintMargin();\n },\n get: function () {\n return this.$showPrintMargin && this.$printMarginColumn;\n }\n },\n showGutter: {\n set: function (show) {\n this.$gutter.style.display = show ? \"block\" : \"none\";\n this.$loop.schedule(this.CHANGE_FULL);\n this.onGutterResize();\n },\n initialValue: true\n },\n fadeFoldWidgets: {\n set: function (show) {\n dom.setCssClass(this.$gutter, \"ace_fade-fold-widgets\", show);\n },\n initialValue: false\n },\n showFoldWidgets: {\n set: function (show) {\n this.$gutterLayer.setShowFoldWidgets(show);\n this.$loop.schedule(this.CHANGE_GUTTER);\n },\n initialValue: true\n },\n displayIndentGuides: {\n set: function (show) {\n if (this.$textLayer.setDisplayIndentGuides(show))\n this.$loop.schedule(this.CHANGE_TEXT);\n },\n initialValue: true\n },\n highlightIndentGuides: {\n set: function (show) {\n if (this.$textLayer.setHighlightIndentGuides(show) == true) {\n this.$textLayer.$highlightIndentGuide();\n }\n else {\n this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells);\n }\n },\n initialValue: true\n },\n highlightGutterLine: {\n set: function (shouldHighlight) {\n this.$gutterLayer.setHighlightGutterLine(shouldHighlight);\n this.$loop.schedule(this.CHANGE_GUTTER);\n },\n initialValue: true\n },\n hScrollBarAlwaysVisible: {\n set: function (val) {\n if (!this.$hScrollBarAlwaysVisible || !this.$horizScroll)\n this.$loop.schedule(this.CHANGE_SCROLL);\n },\n initialValue: false\n },\n vScrollBarAlwaysVisible: {\n set: function (val) {\n if (!this.$vScrollBarAlwaysVisible || !this.$vScroll)\n this.$loop.schedule(this.CHANGE_SCROLL);\n },\n initialValue: false\n },\n fontSize: {\n set: function (size) {\n if (typeof size == \"number\")\n size = size + \"px\";\n this.container.style.fontSize = size;\n this.updateFontSize();\n },\n initialValue: 12\n },\n fontFamily: {\n set: function (name) {\n this.container.style.fontFamily = name;\n this.updateFontSize();\n }\n },\n maxLines: {\n set: function (val) {\n this.updateFull();\n }\n },\n minLines: {\n set: function (val) {\n if (!(this.$minLines < 0x1ffffffffffff))\n this.$minLines = 0;\n this.updateFull();\n }\n },\n maxPixelHeight: {\n set: function (val) {\n this.updateFull();\n },\n initialValue: 0\n },\n scrollPastEnd: {\n set: function (val) {\n val = +val || 0;\n if (this.$scrollPastEnd == val)\n return;\n this.$scrollPastEnd = val;\n this.$loop.schedule(this.CHANGE_SCROLL);\n },\n initialValue: 0,\n handlesSet: true\n },\n fixedWidthGutter: {\n set: function (val) {\n this.$gutterLayer.$fixedWidth = !!val;\n this.$loop.schedule(this.CHANGE_GUTTER);\n }\n },\n customScrollbar: {\n set: function (val) {\n this.$updateCustomScrollbar(val);\n },\n initialValue: false\n },\n theme: {\n set: function (val) { this.setTheme(val); },\n get: function () { return this.$themeId || this.theme; },\n initialValue: \"./theme/textmate\",\n handlesSet: true\n },\n hasCssTransforms: {},\n useTextareaForIME: {\n initialValue: !useragent.isMobile && !useragent.isIE\n }\n});\nexports.VirtualRenderer = VirtualRenderer;\n\n});\n\nace.define(\"ace/worker/worker_client\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/net\",\"ace/lib/event_emitter\",\"ace/config\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../lib/oop\");\nvar net = require(\"../lib/net\");\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar config = require(\"../config\");\n\nfunction $workerBlob(workerUrl) {\n var script = \"importScripts('\" + net.qualifyURL(workerUrl) + \"');\";\n try {\n return new Blob([script], {\"type\": \"application/javascript\"});\n } catch (e) { // Backwards-compatibility\n var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;\n var blobBuilder = new BlobBuilder();\n blobBuilder.append(script);\n return blobBuilder.getBlob(\"application/javascript\");\n }\n}\n\nfunction createWorker(workerUrl) {\n if (typeof Worker == \"undefined\")\n return { postMessage: function() {}, terminate: function() {} };\n if (config.get(\"loadWorkerFromBlob\")) {\n var blob = $workerBlob(workerUrl);\n var URL = window.URL || window.webkitURL;\n var blobURL = URL.createObjectURL(blob);\n return new Worker(blobURL);\n }\n return new Worker(workerUrl);\n}\n\nvar WorkerClient = function(worker) {\n if (!worker.postMessage)\n worker = this.$createWorkerFromOldConfig.apply(this, arguments);\n\n this.$worker = worker;\n this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this);\n this.changeListener = this.changeListener.bind(this);\n this.onMessage = this.onMessage.bind(this);\n\n this.callbackId = 1;\n this.callbacks = {};\n\n this.$worker.onmessage = this.onMessage;\n};\n\n(function(){\n\n oop.implement(this, EventEmitter);\n\n this.$createWorkerFromOldConfig = function(topLevelNamespaces, mod, classname, workerUrl, importScripts) {\n if (require.nameToUrl && !require.toUrl)\n require.toUrl = require.nameToUrl;\n\n if (config.get(\"packaged\") || !require.toUrl) {\n workerUrl = workerUrl || config.moduleUrl(mod, \"worker\");\n } else {\n var normalizePath = this.$normalizePath;\n workerUrl = workerUrl || normalizePath(require.toUrl(\"ace/worker/worker.js\", null, \"_\"));\n\n var tlns = {};\n topLevelNamespaces.forEach(function(ns) {\n tlns[ns] = normalizePath(require.toUrl(ns, null, \"_\").replace(/(\\.js)?(\\?.*)?$/, \"\"));\n });\n }\n\n this.$worker = createWorker(workerUrl);\n if (importScripts) {\n this.send(\"importScripts\", importScripts);\n }\n this.$worker.postMessage({\n init : true,\n tlns : tlns,\n module : mod,\n classname : classname\n });\n return this.$worker;\n };\n\n this.onMessage = function(e) {\n var msg = e.data;\n switch (msg.type) {\n case \"event\":\n this._signal(msg.name, {data: msg.data});\n break;\n case \"call\":\n var callback = this.callbacks[msg.id];\n if (callback) {\n callback(msg.data);\n delete this.callbacks[msg.id];\n }\n break;\n case \"error\":\n this.reportError(msg.data);\n break;\n case \"log\":\n window.console && console.log && console.log.apply(console, msg.data);\n break;\n }\n };\n \n this.reportError = function(err) {\n window.console && console.error && console.error(err);\n };\n\n this.$normalizePath = function(path) {\n return net.qualifyURL(path);\n };\n\n this.terminate = function() {\n this._signal(\"terminate\", {});\n this.deltaQueue = null;\n this.$worker.terminate();\n this.$worker = null;\n if (this.$doc)\n this.$doc.off(\"change\", this.changeListener);\n this.$doc = null;\n };\n\n this.send = function(cmd, args) {\n this.$worker.postMessage({command: cmd, args: args});\n };\n\n this.call = function(cmd, args, callback) {\n if (callback) {\n var id = this.callbackId++;\n this.callbacks[id] = callback;\n args.push(id);\n }\n this.send(cmd, args);\n };\n\n this.emit = function(event, data) {\n try {\n if (data.data && data.data.err)\n data.data.err = {message: data.data.err.message, stack: data.data.err.stack, code: data.data.err.code};\n this.$worker && this.$worker.postMessage({event: event, data: {data: data.data}});\n }\n catch(ex) {\n console.error(ex.stack);\n }\n };\n\n this.attachToDocument = function(doc) {\n if (this.$doc)\n this.terminate();\n\n this.$doc = doc;\n this.call(\"setValue\", [doc.getValue()]);\n doc.on(\"change\", this.changeListener, true);\n };\n\n this.changeListener = function(delta) {\n if (!this.deltaQueue) {\n this.deltaQueue = [];\n setTimeout(this.$sendDeltaQueue, 0);\n }\n if (delta.action == \"insert\")\n this.deltaQueue.push(delta.start, delta.lines);\n else\n this.deltaQueue.push(delta.start, delta.end);\n };\n\n this.$sendDeltaQueue = function() {\n var q = this.deltaQueue;\n if (!q) return;\n this.deltaQueue = null;\n if (q.length > 50 && q.length > this.$doc.getLength() >> 1) {\n this.call(\"setValue\", [this.$doc.getValue()]);\n } else\n this.emit(\"change\", {data: q});\n };\n\n}).call(WorkerClient.prototype);\n\n\nvar UIWorkerClient = function(topLevelNamespaces, mod, classname) {\n var main = null;\n var emitSync = false;\n var sender = Object.create(EventEmitter);\n\n var messageBuffer = [];\n var workerClient = new WorkerClient({\n messageBuffer: messageBuffer,\n terminate: function() {},\n postMessage: function(e) {\n messageBuffer.push(e);\n if (!main) return;\n if (emitSync)\n setTimeout(processNext);\n else\n processNext();\n }\n });\n\n workerClient.setEmitSync = function(val) { emitSync = val; };\n\n var processNext = function() {\n var msg = messageBuffer.shift();\n if (msg.command)\n main[msg.command].apply(main, msg.args);\n else if (msg.event)\n sender._signal(msg.event, msg.data);\n };\n\n sender.postMessage = function(msg) {\n workerClient.onMessage({data: msg});\n };\n sender.callback = function(data, callbackId) {\n this.postMessage({type: \"call\", id: callbackId, data: data});\n };\n sender.emit = function(name, data) {\n this.postMessage({type: \"event\", name: name, data: data});\n };\n\n config.loadModule([\"worker\", mod], function(Main) {\n main = new Main[classname](sender);\n while (messageBuffer.length)\n processNext();\n });\n\n return workerClient;\n};\n\nexports.UIWorkerClient = UIWorkerClient;\nexports.WorkerClient = WorkerClient;\nexports.createWorker = createWorker;\n\n\n});\n\nace.define(\"ace/placeholder\",[\"require\",\"exports\",\"module\",\"ace/range\",\"ace/lib/event_emitter\",\"ace/lib/oop\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"./range\").Range;\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar oop = require(\"./lib/oop\");\nvar PlaceHolder = function (session, length, pos, others, mainClass, othersClass) {\n var _self = this;\n this.length = length;\n this.session = session;\n this.doc = session.getDocument();\n this.mainClass = mainClass;\n this.othersClass = othersClass;\n this.$onUpdate = this.onUpdate.bind(this);\n this.doc.on(\"change\", this.$onUpdate, true);\n this.$others = others;\n this.$onCursorChange = function () {\n setTimeout(function () {\n _self.onCursorChange();\n });\n };\n this.$pos = pos;\n var undoStack = session.getUndoManager().$undoStack || session.getUndoManager().$undostack || { length: -1 };\n this.$undoStackDepth = undoStack.length;\n this.setup();\n session.selection.on(\"changeCursor\", this.$onCursorChange);\n};\n(function () {\n oop.implement(this, EventEmitter);\n this.setup = function () {\n var _self = this;\n var doc = this.doc;\n var session = this.session;\n this.selectionBefore = session.selection.toJSON();\n if (session.selection.inMultiSelectMode)\n session.selection.toSingleRange();\n this.pos = doc.createAnchor(this.$pos.row, this.$pos.column);\n var pos = this.pos;\n pos.$insertRight = true;\n pos.detach();\n pos.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column + this.length), this.mainClass, null, false);\n this.others = [];\n this.$others.forEach(function (other) {\n var anchor = doc.createAnchor(other.row, other.column);\n anchor.$insertRight = true;\n anchor.detach();\n _self.others.push(anchor);\n });\n session.setUndoSelect(false);\n };\n this.showOtherMarkers = function () {\n if (this.othersActive)\n return;\n var session = this.session;\n var _self = this;\n this.othersActive = true;\n this.others.forEach(function (anchor) {\n anchor.markerId = session.addMarker(new Range(anchor.row, anchor.column, anchor.row, anchor.column + _self.length), _self.othersClass, null, false);\n });\n };\n this.hideOtherMarkers = function () {\n if (!this.othersActive)\n return;\n this.othersActive = false;\n for (var i = 0; i < this.others.length; i++) {\n this.session.removeMarker(this.others[i].markerId);\n }\n };\n this.onUpdate = function (delta) {\n if (this.$updating)\n return this.updateAnchors(delta);\n var range = delta;\n if (range.start.row !== range.end.row)\n return;\n if (range.start.row !== this.pos.row)\n return;\n this.$updating = true;\n var lengthDiff = delta.action === \"insert\" ? range.end.column - range.start.column : range.start.column - range.end.column;\n var inMainRange = range.start.column >= this.pos.column && range.start.column <= this.pos.column + this.length + 1;\n var distanceFromStart = range.start.column - this.pos.column;\n this.updateAnchors(delta);\n if (inMainRange)\n this.length += lengthDiff;\n if (inMainRange && !this.session.$fromUndo) {\n if (delta.action === 'insert') {\n for (var i = this.others.length - 1; i >= 0; i--) {\n var otherPos = this.others[i];\n var newPos = { row: otherPos.row, column: otherPos.column + distanceFromStart };\n this.doc.insertMergedLines(newPos, delta.lines);\n }\n }\n else if (delta.action === 'remove') {\n for (var i = this.others.length - 1; i >= 0; i--) {\n var otherPos = this.others[i];\n var newPos = { row: otherPos.row, column: otherPos.column + distanceFromStart };\n this.doc.remove(new Range(newPos.row, newPos.column, newPos.row, newPos.column - lengthDiff));\n }\n }\n }\n this.$updating = false;\n this.updateMarkers();\n };\n this.updateAnchors = function (delta) {\n this.pos.onChange(delta);\n for (var i = this.others.length; i--;)\n this.others[i].onChange(delta);\n this.updateMarkers();\n };\n this.updateMarkers = function () {\n if (this.$updating)\n return;\n var _self = this;\n var session = this.session;\n var updateMarker = function (pos, className) {\n session.removeMarker(pos.markerId);\n pos.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column + _self.length), className, null, false);\n };\n updateMarker(this.pos, this.mainClass);\n for (var i = this.others.length; i--;)\n updateMarker(this.others[i], this.othersClass);\n };\n this.onCursorChange = function (event) {\n if (this.$updating || !this.session)\n return;\n var pos = this.session.selection.getCursor();\n if (pos.row === this.pos.row && pos.column >= this.pos.column && pos.column <= this.pos.column + this.length) {\n this.showOtherMarkers();\n this._emit(\"cursorEnter\", event);\n }\n else {\n this.hideOtherMarkers();\n this._emit(\"cursorLeave\", event);\n }\n };\n this.detach = function () {\n this.session.removeMarker(this.pos && this.pos.markerId);\n this.hideOtherMarkers();\n this.doc.off(\"change\", this.$onUpdate);\n this.session.selection.off(\"changeCursor\", this.$onCursorChange);\n this.session.setUndoSelect(true);\n this.session = null;\n };\n this.cancel = function () {\n if (this.$undoStackDepth === -1)\n return;\n var undoManager = this.session.getUndoManager();\n var undosRequired = (undoManager.$undoStack || undoManager.$undostack).length - this.$undoStackDepth;\n for (var i = 0; i < undosRequired; i++) {\n undoManager.undo(this.session, true);\n }\n if (this.selectionBefore)\n this.session.selection.fromJSON(this.selectionBefore);\n };\n}).call(PlaceHolder.prototype);\nexports.PlaceHolder = PlaceHolder;\n\n});\n\nace.define(\"ace/mouse/multi_select_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/event\",\"ace/lib/useragent\"], function(require, exports, module){var event = require(\"../lib/event\");\nvar useragent = require(\"../lib/useragent\");\nfunction isSamePoint(p1, p2) {\n return p1.row == p2.row && p1.column == p2.column;\n}\nfunction onMouseDown(e) {\n var ev = e.domEvent;\n var alt = ev.altKey;\n var shift = ev.shiftKey;\n var ctrl = ev.ctrlKey;\n var accel = e.getAccelKey();\n var button = e.getButton();\n if (ctrl && useragent.isMac)\n button = ev.button;\n if (e.editor.inMultiSelectMode && button == 2) {\n e.editor.textInput.onContextMenu(e.domEvent);\n return;\n }\n if (!ctrl && !alt && !accel) {\n if (button === 0 && e.editor.inMultiSelectMode)\n e.editor.exitMultiSelectMode();\n return;\n }\n if (button !== 0)\n return;\n var editor = e.editor;\n var selection = editor.selection;\n var isMultiSelect = editor.inMultiSelectMode;\n var pos = e.getDocumentPosition();\n var cursor = selection.getCursor();\n var inSelection = e.inSelection() || (selection.isEmpty() && isSamePoint(pos, cursor));\n var mouseX = e.x, mouseY = e.y;\n var onMouseSelection = function (e) {\n mouseX = e.clientX;\n mouseY = e.clientY;\n };\n var session = editor.session;\n var screenAnchor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY);\n var screenCursor = screenAnchor;\n var selectionMode;\n if (editor.$mouseHandler.$enableJumpToDef) {\n if (ctrl && alt || accel && alt)\n selectionMode = shift ? \"block\" : \"add\";\n else if (alt && editor.$blockSelectEnabled)\n selectionMode = \"block\";\n }\n else {\n if (accel && !alt) {\n selectionMode = \"add\";\n if (!isMultiSelect && shift)\n return;\n }\n else if (alt && editor.$blockSelectEnabled) {\n selectionMode = \"block\";\n }\n }\n if (selectionMode && useragent.isMac && ev.ctrlKey) {\n editor.$mouseHandler.cancelContextMenu();\n }\n if (selectionMode == \"add\") {\n if (!isMultiSelect && inSelection)\n return; // dragging\n if (!isMultiSelect) {\n var range = selection.toOrientedRange();\n editor.addSelectionMarker(range);\n }\n var oldRange = selection.rangeList.rangeAtPoint(pos);\n editor.inVirtualSelectionMode = true;\n if (shift) {\n oldRange = null;\n range = selection.ranges[0] || range;\n editor.removeSelectionMarker(range);\n }\n editor.once(\"mouseup\", function () {\n var tmpSel = selection.toOrientedRange();\n if (oldRange && tmpSel.isEmpty() && isSamePoint(oldRange.cursor, tmpSel.cursor))\n selection.substractPoint(tmpSel.cursor);\n else {\n if (shift) {\n selection.substractPoint(range.cursor);\n }\n else if (range) {\n editor.removeSelectionMarker(range);\n selection.addRange(range);\n }\n selection.addRange(tmpSel);\n }\n editor.inVirtualSelectionMode = false;\n });\n }\n else if (selectionMode == \"block\") {\n e.stop();\n editor.inVirtualSelectionMode = true;\n var initialRange;\n var rectSel = [];\n var blockSelect = function () {\n var newCursor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY);\n var cursor = session.screenToDocumentPosition(newCursor.row, newCursor.column, newCursor.offsetX);\n if (isSamePoint(screenCursor, newCursor) && isSamePoint(cursor, selection.lead))\n return;\n screenCursor = newCursor;\n editor.selection.moveToPosition(cursor);\n editor.renderer.scrollCursorIntoView();\n editor.removeSelectionMarkers(rectSel);\n rectSel = selection.rectangularRangeBlock(screenCursor, screenAnchor);\n if (editor.$mouseHandler.$clickSelection && rectSel.length == 1 && rectSel[0].isEmpty())\n rectSel[0] = editor.$mouseHandler.$clickSelection.clone();\n rectSel.forEach(editor.addSelectionMarker, editor);\n editor.updateSelectionMarkers();\n };\n if (isMultiSelect && !accel) {\n selection.toSingleRange();\n }\n else if (!isMultiSelect && accel) {\n initialRange = selection.toOrientedRange();\n editor.addSelectionMarker(initialRange);\n }\n if (shift)\n screenAnchor = session.documentToScreenPosition(selection.lead);\n else\n selection.moveToPosition(pos);\n screenCursor = { row: -1, column: -1 };\n var onMouseSelectionEnd = function (e) {\n blockSelect();\n clearInterval(timerId);\n editor.removeSelectionMarkers(rectSel);\n if (!rectSel.length)\n rectSel = [selection.toOrientedRange()];\n if (initialRange) {\n editor.removeSelectionMarker(initialRange);\n selection.toSingleRange(initialRange);\n }\n for (var i = 0; i < rectSel.length; i++)\n selection.addRange(rectSel[i]);\n editor.inVirtualSelectionMode = false;\n editor.$mouseHandler.$clickSelection = null;\n };\n var onSelectionInterval = blockSelect;\n event.capture(editor.container, onMouseSelection, onMouseSelectionEnd);\n var timerId = setInterval(function () { onSelectionInterval(); }, 20);\n return e.preventDefault();\n }\n}\nexports.onMouseDown = onMouseDown;\n\n});\n\nace.define(\"ace/commands/multi_select_commands\",[\"require\",\"exports\",\"module\",\"ace/keyboard/hash_handler\"], function(require, exports, module){// commands to enter multiselect mode\nexports.defaultCommands = [{\n name: \"addCursorAbove\",\n description: \"Add cursor above\",\n exec: function (editor) { editor.selectMoreLines(-1); },\n bindKey: { win: \"Ctrl-Alt-Up\", mac: \"Ctrl-Alt-Up\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"addCursorBelow\",\n description: \"Add cursor below\",\n exec: function (editor) { editor.selectMoreLines(1); },\n bindKey: { win: \"Ctrl-Alt-Down\", mac: \"Ctrl-Alt-Down\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"addCursorAboveSkipCurrent\",\n description: \"Add cursor above (skip current)\",\n exec: function (editor) { editor.selectMoreLines(-1, true); },\n bindKey: { win: \"Ctrl-Alt-Shift-Up\", mac: \"Ctrl-Alt-Shift-Up\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"addCursorBelowSkipCurrent\",\n description: \"Add cursor below (skip current)\",\n exec: function (editor) { editor.selectMoreLines(1, true); },\n bindKey: { win: \"Ctrl-Alt-Shift-Down\", mac: \"Ctrl-Alt-Shift-Down\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectMoreBefore\",\n description: \"Select more before\",\n exec: function (editor) { editor.selectMore(-1); },\n bindKey: { win: \"Ctrl-Alt-Left\", mac: \"Ctrl-Alt-Left\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectMoreAfter\",\n description: \"Select more after\",\n exec: function (editor) { editor.selectMore(1); },\n bindKey: { win: \"Ctrl-Alt-Right\", mac: \"Ctrl-Alt-Right\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectNextBefore\",\n description: \"Select next before\",\n exec: function (editor) { editor.selectMore(-1, true); },\n bindKey: { win: \"Ctrl-Alt-Shift-Left\", mac: \"Ctrl-Alt-Shift-Left\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectNextAfter\",\n description: \"Select next after\",\n exec: function (editor) { editor.selectMore(1, true); },\n bindKey: { win: \"Ctrl-Alt-Shift-Right\", mac: \"Ctrl-Alt-Shift-Right\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"toggleSplitSelectionIntoLines\",\n description: \"Split into lines\",\n exec: function (editor) {\n if (editor.multiSelect.rangeCount > 1)\n editor.multiSelect.joinSelections();\n else\n editor.multiSelect.splitIntoLines();\n },\n bindKey: { win: \"Ctrl-Alt-L\", mac: \"Ctrl-Alt-L\" },\n readOnly: true\n }, {\n name: \"splitSelectionIntoLines\",\n description: \"Split into lines\",\n exec: function (editor) { editor.multiSelect.splitIntoLines(); },\n readOnly: true\n }, {\n name: \"alignCursors\",\n description: \"Align cursors\",\n exec: function (editor) { editor.alignCursors(); },\n bindKey: { win: \"Ctrl-Alt-A\", mac: \"Ctrl-Alt-A\" },\n scrollIntoView: \"cursor\"\n }, {\n name: \"findAll\",\n description: \"Find all\",\n exec: function (editor) { editor.findAll(); },\n bindKey: { win: \"Ctrl-Alt-K\", mac: \"Ctrl-Alt-G\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }];\nexports.multiSelectCommands = [{\n name: \"singleSelection\",\n description: \"Single selection\",\n bindKey: \"esc\",\n exec: function (editor) { editor.exitMultiSelectMode(); },\n scrollIntoView: \"cursor\",\n readOnly: true,\n isAvailable: function (editor) { return editor && editor.inMultiSelectMode; }\n }];\nvar HashHandler = require(\"../keyboard/hash_handler\").HashHandler;\nexports.keyboardHandler = new HashHandler(exports.multiSelectCommands);\n\n});\n\nace.define(\"ace/multi_select\",[\"require\",\"exports\",\"module\",\"ace/range_list\",\"ace/range\",\"ace/selection\",\"ace/mouse/multi_select_handler\",\"ace/lib/event\",\"ace/lib/lang\",\"ace/commands/multi_select_commands\",\"ace/search\",\"ace/edit_session\",\"ace/editor\",\"ace/config\"], function(require, exports, module){var RangeList = require(\"./range_list\").RangeList;\nvar Range = require(\"./range\").Range;\nvar Selection = require(\"./selection\").Selection;\nvar onMouseDown = require(\"./mouse/multi_select_handler\").onMouseDown;\nvar event = require(\"./lib/event\");\nvar lang = require(\"./lib/lang\");\nvar commands = require(\"./commands/multi_select_commands\");\nexports.commands = commands.defaultCommands.concat(commands.multiSelectCommands);\nvar Search = require(\"./search\").Search;\nvar search = new Search();\nfunction find(session, needle, dir) {\n search.$options.wrap = true;\n search.$options.needle = needle;\n search.$options.backwards = dir == -1;\n return search.find(session);\n}\nvar EditSession = require(\"./edit_session\").EditSession;\n(function () {\n this.getSelectionMarkers = function () {\n return this.$selectionMarkers;\n };\n}).call(EditSession.prototype);\n(function () {\n this.ranges = null;\n this.rangeList = null;\n this.addRange = function (range, $blockChangeEvents) {\n if (!range)\n return;\n if (!this.inMultiSelectMode && this.rangeCount === 0) {\n var oldRange = this.toOrientedRange();\n this.rangeList.add(oldRange);\n this.rangeList.add(range);\n if (this.rangeList.ranges.length != 2) {\n this.rangeList.removeAll();\n return $blockChangeEvents || this.fromOrientedRange(range);\n }\n this.rangeList.removeAll();\n this.rangeList.add(oldRange);\n this.$onAddRange(oldRange);\n }\n if (!range.cursor)\n range.cursor = range.end;\n var removed = this.rangeList.add(range);\n this.$onAddRange(range);\n if (removed.length)\n this.$onRemoveRange(removed);\n if (this.rangeCount > 1 && !this.inMultiSelectMode) {\n this._signal(\"multiSelect\");\n this.inMultiSelectMode = true;\n this.session.$undoSelect = false;\n this.rangeList.attach(this.session);\n }\n return $blockChangeEvents || this.fromOrientedRange(range);\n };\n this.toSingleRange = function (range) {\n range = range || this.ranges[0];\n var removed = this.rangeList.removeAll();\n if (removed.length)\n this.$onRemoveRange(removed);\n range && this.fromOrientedRange(range);\n };\n this.substractPoint = function (pos) {\n var removed = this.rangeList.substractPoint(pos);\n if (removed) {\n this.$onRemoveRange(removed);\n return removed[0];\n }\n };\n this.mergeOverlappingRanges = function () {\n var removed = this.rangeList.merge();\n if (removed.length)\n this.$onRemoveRange(removed);\n };\n this.$onAddRange = function (range) {\n this.rangeCount = this.rangeList.ranges.length;\n this.ranges.unshift(range);\n this._signal(\"addRange\", { range: range });\n };\n this.$onRemoveRange = function (removed) {\n this.rangeCount = this.rangeList.ranges.length;\n if (this.rangeCount == 1 && this.inMultiSelectMode) {\n var lastRange = this.rangeList.ranges.pop();\n removed.push(lastRange);\n this.rangeCount = 0;\n }\n for (var i = removed.length; i--;) {\n var index = this.ranges.indexOf(removed[i]);\n this.ranges.splice(index, 1);\n }\n this._signal(\"removeRange\", { ranges: removed });\n if (this.rangeCount === 0 && this.inMultiSelectMode) {\n this.inMultiSelectMode = false;\n this._signal(\"singleSelect\");\n this.session.$undoSelect = true;\n this.rangeList.detach(this.session);\n }\n lastRange = lastRange || this.ranges[0];\n if (lastRange && !lastRange.isEqual(this.getRange()))\n this.fromOrientedRange(lastRange);\n };\n this.$initRangeList = function () {\n if (this.rangeList)\n return;\n this.rangeList = new RangeList();\n this.ranges = [];\n this.rangeCount = 0;\n };\n this.getAllRanges = function () {\n return this.rangeCount ? this.rangeList.ranges.concat() : [this.getRange()];\n };\n this.splitIntoLines = function () {\n var ranges = this.ranges.length ? this.ranges : [this.getRange()];\n var newRanges = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n var row = range.start.row;\n var endRow = range.end.row;\n if (row === endRow) {\n newRanges.push(range.clone());\n }\n else {\n newRanges.push(new Range(row, range.start.column, row, this.session.getLine(row).length));\n while (++row < endRow)\n newRanges.push(this.getLineRange(row, true));\n newRanges.push(new Range(endRow, 0, endRow, range.end.column));\n }\n if (i == 0 && !this.isBackwards())\n newRanges = newRanges.reverse();\n }\n this.toSingleRange();\n for (var i = newRanges.length; i--;)\n this.addRange(newRanges[i]);\n };\n this.joinSelections = function () {\n var ranges = this.rangeList.ranges;\n var lastRange = ranges[ranges.length - 1];\n var range = Range.fromPoints(ranges[0].start, lastRange.end);\n this.toSingleRange();\n this.setSelectionRange(range, lastRange.cursor == lastRange.start);\n };\n this.toggleBlockSelection = function () {\n if (this.rangeCount > 1) {\n var ranges = this.rangeList.ranges;\n var lastRange = ranges[ranges.length - 1];\n var range = Range.fromPoints(ranges[0].start, lastRange.end);\n this.toSingleRange();\n this.setSelectionRange(range, lastRange.cursor == lastRange.start);\n }\n else {\n var cursor = this.session.documentToScreenPosition(this.cursor);\n var anchor = this.session.documentToScreenPosition(this.anchor);\n var rectSel = this.rectangularRangeBlock(cursor, anchor);\n rectSel.forEach(this.addRange, this);\n }\n };\n this.rectangularRangeBlock = function (screenCursor, screenAnchor, includeEmptyLines) {\n var rectSel = [];\n var xBackwards = screenCursor.column < screenAnchor.column;\n if (xBackwards) {\n var startColumn = screenCursor.column;\n var endColumn = screenAnchor.column;\n var startOffsetX = screenCursor.offsetX;\n var endOffsetX = screenAnchor.offsetX;\n }\n else {\n var startColumn = screenAnchor.column;\n var endColumn = screenCursor.column;\n var startOffsetX = screenAnchor.offsetX;\n var endOffsetX = screenCursor.offsetX;\n }\n var yBackwards = screenCursor.row < screenAnchor.row;\n if (yBackwards) {\n var startRow = screenCursor.row;\n var endRow = screenAnchor.row;\n }\n else {\n var startRow = screenAnchor.row;\n var endRow = screenCursor.row;\n }\n if (startColumn < 0)\n startColumn = 0;\n if (startRow < 0)\n startRow = 0;\n if (startRow == endRow)\n includeEmptyLines = true;\n var docEnd;\n for (var row = startRow; row <= endRow; row++) {\n var range = Range.fromPoints(this.session.screenToDocumentPosition(row, startColumn, startOffsetX), this.session.screenToDocumentPosition(row, endColumn, endOffsetX));\n if (range.isEmpty()) {\n if (docEnd && isSamePoint(range.end, docEnd))\n break;\n docEnd = range.end;\n }\n range.cursor = xBackwards ? range.start : range.end;\n rectSel.push(range);\n }\n if (yBackwards)\n rectSel.reverse();\n if (!includeEmptyLines) {\n var end = rectSel.length - 1;\n while (rectSel[end].isEmpty() && end > 0)\n end--;\n if (end > 0) {\n var start = 0;\n while (rectSel[start].isEmpty())\n start++;\n }\n for (var i = end; i >= start; i--) {\n if (rectSel[i].isEmpty())\n rectSel.splice(i, 1);\n }\n }\n return rectSel;\n };\n}).call(Selection.prototype);\nvar Editor = require(\"./editor\").Editor;\n(function () {\n this.updateSelectionMarkers = function () {\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n };\n this.addSelectionMarker = function (orientedRange) {\n if (!orientedRange.cursor)\n orientedRange.cursor = orientedRange.end;\n var style = this.getSelectionStyle();\n orientedRange.marker = this.session.addMarker(orientedRange, \"ace_selection\", style);\n this.session.$selectionMarkers.push(orientedRange);\n this.session.selectionMarkerCount = this.session.$selectionMarkers.length;\n return orientedRange;\n };\n this.removeSelectionMarker = function (range) {\n if (!range.marker)\n return;\n this.session.removeMarker(range.marker);\n var index = this.session.$selectionMarkers.indexOf(range);\n if (index != -1)\n this.session.$selectionMarkers.splice(index, 1);\n this.session.selectionMarkerCount = this.session.$selectionMarkers.length;\n };\n this.removeSelectionMarkers = function (ranges) {\n var markerList = this.session.$selectionMarkers;\n for (var i = ranges.length; i--;) {\n var range = ranges[i];\n if (!range.marker)\n continue;\n this.session.removeMarker(range.marker);\n var index = markerList.indexOf(range);\n if (index != -1)\n markerList.splice(index, 1);\n }\n this.session.selectionMarkerCount = markerList.length;\n };\n this.$onAddRange = function (e) {\n this.addSelectionMarker(e.range);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n };\n this.$onRemoveRange = function (e) {\n this.removeSelectionMarkers(e.ranges);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n };\n this.$onMultiSelect = function (e) {\n if (this.inMultiSelectMode)\n return;\n this.inMultiSelectMode = true;\n this.setStyle(\"ace_multiselect\");\n this.keyBinding.addKeyboardHandler(commands.keyboardHandler);\n this.commands.setDefaultHandler(\"exec\", this.$onMultiSelectExec);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n };\n this.$onSingleSelect = function (e) {\n if (this.session.multiSelect.inVirtualMode)\n return;\n this.inMultiSelectMode = false;\n this.unsetStyle(\"ace_multiselect\");\n this.keyBinding.removeKeyboardHandler(commands.keyboardHandler);\n this.commands.removeDefaultHandler(\"exec\", this.$onMultiSelectExec);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n this._emit(\"changeSelection\");\n };\n this.$onMultiSelectExec = function (e) {\n var command = e.command;\n var editor = e.editor;\n if (!editor.multiSelect)\n return;\n if (!command.multiSelectAction) {\n var result = command.exec(editor, e.args || {});\n editor.multiSelect.addRange(editor.multiSelect.toOrientedRange());\n editor.multiSelect.mergeOverlappingRanges();\n }\n else if (command.multiSelectAction == \"forEach\") {\n result = editor.forEachSelection(command, e.args);\n }\n else if (command.multiSelectAction == \"forEachLine\") {\n result = editor.forEachSelection(command, e.args, true);\n }\n else if (command.multiSelectAction == \"single\") {\n editor.exitMultiSelectMode();\n result = command.exec(editor, e.args || {});\n }\n else {\n result = command.multiSelectAction(editor, e.args || {});\n }\n return result;\n };\n this.forEachSelection = function (cmd, args, options) {\n if (this.inVirtualSelectionMode)\n return;\n var keepOrder = options && options.keepOrder;\n var $byLines = options == true || options && options.$byLines;\n var session = this.session;\n var selection = this.selection;\n var rangeList = selection.rangeList;\n var ranges = (keepOrder ? selection : rangeList).ranges;\n var result;\n if (!ranges.length)\n return cmd.exec ? cmd.exec(this, args || {}) : cmd(this, args || {});\n var reg = selection._eventRegistry;\n selection._eventRegistry = {};\n var tmpSel = new Selection(session);\n this.inVirtualSelectionMode = true;\n for (var i = ranges.length; i--;) {\n if ($byLines) {\n while (i > 0 && ranges[i].start.row == ranges[i - 1].end.row)\n i--;\n }\n tmpSel.fromOrientedRange(ranges[i]);\n tmpSel.index = i;\n this.selection = session.selection = tmpSel;\n var cmdResult = cmd.exec ? cmd.exec(this, args || {}) : cmd(this, args || {});\n if (!result && cmdResult !== undefined)\n result = cmdResult;\n tmpSel.toOrientedRange(ranges[i]);\n }\n tmpSel.detach();\n this.selection = session.selection = selection;\n this.inVirtualSelectionMode = false;\n selection._eventRegistry = reg;\n selection.mergeOverlappingRanges();\n if (selection.ranges[0])\n selection.fromOrientedRange(selection.ranges[0]);\n var anim = this.renderer.$scrollAnimation;\n this.onCursorChange();\n this.onSelectionChange();\n if (anim && anim.from == anim.to)\n this.renderer.animateScrolling(anim.from);\n return result;\n };\n this.exitMultiSelectMode = function () {\n if (!this.inMultiSelectMode || this.inVirtualSelectionMode)\n return;\n this.multiSelect.toSingleRange();\n };\n this.getSelectedText = function () {\n var text = \"\";\n if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {\n var ranges = this.multiSelect.rangeList.ranges;\n var buf = [];\n for (var i = 0; i < ranges.length; i++) {\n buf.push(this.session.getTextRange(ranges[i]));\n }\n var nl = this.session.getDocument().getNewLineCharacter();\n text = buf.join(nl);\n if (text.length == (buf.length - 1) * nl.length)\n text = \"\";\n }\n else if (!this.selection.isEmpty()) {\n text = this.session.getTextRange(this.getSelectionRange());\n }\n return text;\n };\n this.$checkMultiselectChange = function (e, anchor) {\n if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {\n var range = this.multiSelect.ranges[0];\n if (this.multiSelect.isEmpty() && anchor == this.multiSelect.anchor)\n return;\n var pos = anchor == this.multiSelect.anchor\n ? range.cursor == range.start ? range.end : range.start\n : range.cursor;\n if (pos.row != anchor.row\n || this.session.$clipPositionToDocument(pos.row, pos.column).column != anchor.column)\n this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange());\n else\n this.multiSelect.mergeOverlappingRanges();\n }\n };\n this.findAll = function (needle, options, additive) {\n options = options || {};\n options.needle = needle || options.needle;\n if (options.needle == undefined) {\n var range = this.selection.isEmpty()\n ? this.selection.getWordRange()\n : this.selection.getRange();\n options.needle = this.session.getTextRange(range);\n }\n this.$search.set(options);\n var ranges = this.$search.findAll(this.session);\n if (!ranges.length)\n return 0;\n var selection = this.multiSelect;\n if (!additive)\n selection.toSingleRange(ranges[0]);\n for (var i = ranges.length; i--;)\n selection.addRange(ranges[i], true);\n if (range && selection.rangeList.rangeAtPoint(range.start))\n selection.addRange(range, true);\n return ranges.length;\n };\n this.selectMoreLines = function (dir, skip) {\n var range = this.selection.toOrientedRange();\n var isBackwards = range.cursor == range.end;\n var screenLead = this.session.documentToScreenPosition(range.cursor);\n if (this.selection.$desiredColumn)\n screenLead.column = this.selection.$desiredColumn;\n var lead = this.session.screenToDocumentPosition(screenLead.row + dir, screenLead.column);\n if (!range.isEmpty()) {\n var screenAnchor = this.session.documentToScreenPosition(isBackwards ? range.end : range.start);\n var anchor = this.session.screenToDocumentPosition(screenAnchor.row + dir, screenAnchor.column);\n }\n else {\n var anchor = lead;\n }\n if (isBackwards) {\n var newRange = Range.fromPoints(lead, anchor);\n newRange.cursor = newRange.start;\n }\n else {\n var newRange = Range.fromPoints(anchor, lead);\n newRange.cursor = newRange.end;\n }\n newRange.desiredColumn = screenLead.column;\n if (!this.selection.inMultiSelectMode) {\n this.selection.addRange(range);\n }\n else {\n if (skip)\n var toRemove = range.cursor;\n }\n this.selection.addRange(newRange);\n if (toRemove)\n this.selection.substractPoint(toRemove);\n };\n this.transposeSelections = function (dir) {\n var session = this.session;\n var sel = session.multiSelect;\n var all = sel.ranges;\n for (var i = all.length; i--;) {\n var range = all[i];\n if (range.isEmpty()) {\n var tmp = session.getWordRange(range.start.row, range.start.column);\n range.start.row = tmp.start.row;\n range.start.column = tmp.start.column;\n range.end.row = tmp.end.row;\n range.end.column = tmp.end.column;\n }\n }\n sel.mergeOverlappingRanges();\n var words = [];\n for (var i = all.length; i--;) {\n var range = all[i];\n words.unshift(session.getTextRange(range));\n }\n if (dir < 0)\n words.unshift(words.pop());\n else\n words.push(words.shift());\n for (var i = all.length; i--;) {\n var range = all[i];\n var tmp = range.clone();\n session.replace(range, words[i]);\n range.start.row = tmp.start.row;\n range.start.column = tmp.start.column;\n }\n sel.fromOrientedRange(sel.ranges[0]);\n };\n this.selectMore = function (dir, skip, stopAtFirst) {\n var session = this.session;\n var sel = session.multiSelect;\n var range = sel.toOrientedRange();\n if (range.isEmpty()) {\n range = session.getWordRange(range.start.row, range.start.column);\n range.cursor = dir == -1 ? range.start : range.end;\n this.multiSelect.addRange(range);\n if (stopAtFirst)\n return;\n }\n var needle = session.getTextRange(range);\n var newRange = find(session, needle, dir);\n if (newRange) {\n newRange.cursor = dir == -1 ? newRange.start : newRange.end;\n this.session.unfold(newRange);\n this.multiSelect.addRange(newRange);\n this.renderer.scrollCursorIntoView(null, 0.5);\n }\n if (skip)\n this.multiSelect.substractPoint(range.cursor);\n };\n this.alignCursors = function () {\n var session = this.session;\n var sel = session.multiSelect;\n var ranges = sel.ranges;\n var row = -1;\n var sameRowRanges = ranges.filter(function (r) {\n if (r.cursor.row == row)\n return true;\n row = r.cursor.row;\n });\n if (!ranges.length || sameRowRanges.length == ranges.length - 1) {\n var range = this.selection.getRange();\n var fr = range.start.row, lr = range.end.row;\n var guessRange = fr == lr;\n if (guessRange) {\n var max = this.session.getLength();\n var line;\n do {\n line = this.session.getLine(lr);\n } while (/[=:]/.test(line) && ++lr < max);\n do {\n line = this.session.getLine(fr);\n } while (/[=:]/.test(line) && --fr > 0);\n if (fr < 0)\n fr = 0;\n if (lr >= max)\n lr = max - 1;\n }\n var lines = this.session.removeFullLines(fr, lr);\n lines = this.$reAlignText(lines, guessRange);\n this.session.insert({ row: fr, column: 0 }, lines.join(\"\\n\") + \"\\n\");\n if (!guessRange) {\n range.start.column = 0;\n range.end.column = lines[lines.length - 1].length;\n }\n this.selection.setRange(range);\n }\n else {\n sameRowRanges.forEach(function (r) {\n sel.substractPoint(r.cursor);\n });\n var maxCol = 0;\n var minSpace = Infinity;\n var spaceOffsets = ranges.map(function (r) {\n var p = r.cursor;\n var line = session.getLine(p.row);\n var spaceOffset = line.substr(p.column).search(/\\S/g);\n if (spaceOffset == -1)\n spaceOffset = 0;\n if (p.column > maxCol)\n maxCol = p.column;\n if (spaceOffset < minSpace)\n minSpace = spaceOffset;\n return spaceOffset;\n });\n ranges.forEach(function (r, i) {\n var p = r.cursor;\n var l = maxCol - p.column;\n var d = spaceOffsets[i] - minSpace;\n if (l > d)\n session.insert(p, lang.stringRepeat(\" \", l - d));\n else\n session.remove(new Range(p.row, p.column, p.row, p.column - l + d));\n r.start.column = r.end.column = maxCol;\n r.start.row = r.end.row = p.row;\n r.cursor = r.end;\n });\n sel.fromOrientedRange(ranges[0]);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n }\n };\n this.$reAlignText = function (lines, forceLeft) {\n var isLeftAligned = true, isRightAligned = true;\n var startW, textW, endW;\n return lines.map(function (line) {\n var m = line.match(/(\\s*)(.*?)(\\s*)([=:].*)/);\n if (!m)\n return [line];\n if (startW == null) {\n startW = m[1].length;\n textW = m[2].length;\n endW = m[3].length;\n return m;\n }\n if (startW + textW + endW != m[1].length + m[2].length + m[3].length)\n isRightAligned = false;\n if (startW != m[1].length)\n isLeftAligned = false;\n if (startW > m[1].length)\n startW = m[1].length;\n if (textW < m[2].length)\n textW = m[2].length;\n if (endW > m[3].length)\n endW = m[3].length;\n return m;\n }).map(forceLeft ? alignLeft :\n isLeftAligned ? isRightAligned ? alignRight : alignLeft : unAlign);\n function spaces(n) {\n return lang.stringRepeat(\" \", n);\n }\n function alignLeft(m) {\n return !m[2] ? m[0] : spaces(startW) + m[2]\n + spaces(textW - m[2].length + endW)\n + m[4].replace(/^([=:])\\s+/, \"$1 \");\n }\n function alignRight(m) {\n return !m[2] ? m[0] : spaces(startW + textW - m[2].length) + m[2]\n + spaces(endW)\n + m[4].replace(/^([=:])\\s+/, \"$1 \");\n }\n function unAlign(m) {\n return !m[2] ? m[0] : spaces(startW) + m[2]\n + spaces(endW)\n + m[4].replace(/^([=:])\\s+/, \"$1 \");\n }\n };\n}).call(Editor.prototype);\nfunction isSamePoint(p1, p2) {\n return p1.row == p2.row && p1.column == p2.column;\n}\nexports.onSessionChange = function (e) {\n var session = e.session;\n if (session && !session.multiSelect) {\n session.$selectionMarkers = [];\n session.selection.$initRangeList();\n session.multiSelect = session.selection;\n }\n this.multiSelect = session && session.multiSelect;\n var oldSession = e.oldSession;\n if (oldSession) {\n oldSession.multiSelect.off(\"addRange\", this.$onAddRange);\n oldSession.multiSelect.off(\"removeRange\", this.$onRemoveRange);\n oldSession.multiSelect.off(\"multiSelect\", this.$onMultiSelect);\n oldSession.multiSelect.off(\"singleSelect\", this.$onSingleSelect);\n oldSession.multiSelect.lead.off(\"change\", this.$checkMultiselectChange);\n oldSession.multiSelect.anchor.off(\"change\", this.$checkMultiselectChange);\n }\n if (session) {\n session.multiSelect.on(\"addRange\", this.$onAddRange);\n session.multiSelect.on(\"removeRange\", this.$onRemoveRange);\n session.multiSelect.on(\"multiSelect\", this.$onMultiSelect);\n session.multiSelect.on(\"singleSelect\", this.$onSingleSelect);\n session.multiSelect.lead.on(\"change\", this.$checkMultiselectChange);\n session.multiSelect.anchor.on(\"change\", this.$checkMultiselectChange);\n }\n if (session && this.inMultiSelectMode != session.selection.inMultiSelectMode) {\n if (session.selection.inMultiSelectMode)\n this.$onMultiSelect();\n else\n this.$onSingleSelect();\n }\n};\nfunction MultiSelect(editor) {\n if (editor.$multiselectOnSessionChange)\n return;\n editor.$onAddRange = editor.$onAddRange.bind(editor);\n editor.$onRemoveRange = editor.$onRemoveRange.bind(editor);\n editor.$onMultiSelect = editor.$onMultiSelect.bind(editor);\n editor.$onSingleSelect = editor.$onSingleSelect.bind(editor);\n editor.$multiselectOnSessionChange = exports.onSessionChange.bind(editor);\n editor.$checkMultiselectChange = editor.$checkMultiselectChange.bind(editor);\n editor.$multiselectOnSessionChange(editor);\n editor.on(\"changeSession\", editor.$multiselectOnSessionChange);\n editor.on(\"mousedown\", onMouseDown);\n editor.commands.addCommands(commands.defaultCommands);\n addAltCursorListeners(editor);\n}\nfunction addAltCursorListeners(editor) {\n if (!editor.textInput)\n return;\n var el = editor.textInput.getElement();\n var altCursor = false;\n event.addListener(el, \"keydown\", function (e) {\n var altDown = e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey);\n if (editor.$blockSelectEnabled && altDown) {\n if (!altCursor) {\n editor.renderer.setMouseCursor(\"crosshair\");\n altCursor = true;\n }\n }\n else if (altCursor) {\n reset();\n }\n }, editor);\n event.addListener(el, \"keyup\", reset, editor);\n event.addListener(el, \"blur\", reset, editor);\n function reset(e) {\n if (altCursor) {\n editor.renderer.setMouseCursor(\"\");\n altCursor = false;\n }\n }\n}\nexports.MultiSelect = MultiSelect;\nrequire(\"./config\").defineOptions(Editor.prototype, \"editor\", {\n enableMultiselect: {\n set: function (val) {\n MultiSelect(this);\n if (val) {\n this.on(\"changeSession\", this.$multiselectOnSessionChange);\n this.on(\"mousedown\", onMouseDown);\n }\n else {\n this.off(\"changeSession\", this.$multiselectOnSessionChange);\n this.off(\"mousedown\", onMouseDown);\n }\n },\n value: true\n },\n enableBlockSelect: {\n set: function (val) {\n this.$blockSelectEnabled = val;\n },\n value: true\n }\n});\n\n});\n\nace.define(\"ace/mode/folding/fold_mode\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"../../range\").Range;\nvar FoldMode = exports.FoldMode = function () { };\n(function () {\n this.foldingStartMarker = null;\n this.foldingStopMarker = null;\n this.getFoldWidget = function (session, foldStyle, row) {\n var line = session.getLine(row);\n if (this.foldingStartMarker.test(line))\n return \"start\";\n if (foldStyle == \"markbeginend\"\n && this.foldingStopMarker\n && this.foldingStopMarker.test(line))\n return \"end\";\n return \"\";\n };\n this.getFoldWidgetRange = function (session, foldStyle, row) {\n return null;\n };\n this.indentationBlock = function (session, row, column) {\n var re = /\\S/;\n var line = session.getLine(row);\n var startLevel = line.search(re);\n if (startLevel == -1)\n return;\n var startColumn = column || line.length;\n var maxRow = session.getLength();\n var startRow = row;\n var endRow = row;\n while (++row < maxRow) {\n var level = session.getLine(row).search(re);\n if (level == -1)\n continue;\n if (level <= startLevel) {\n var token = session.getTokenAt(row, 0);\n if (!token || token.type !== \"string\")\n break;\n }\n endRow = row;\n }\n if (endRow > startRow) {\n var endColumn = session.getLine(endRow).length;\n return new Range(startRow, startColumn, endRow, endColumn);\n }\n };\n this.openingBracketBlock = function (session, bracket, row, column, typeRe) {\n var start = { row: row, column: column + 1 };\n var end = session.$findClosingBracket(bracket, start, typeRe);\n if (!end)\n return;\n var fw = session.foldWidgets[end.row];\n if (fw == null)\n fw = session.getFoldWidget(end.row);\n if (fw == \"start\" && end.row > start.row) {\n end.row--;\n end.column = session.getLine(end.row).length;\n }\n return Range.fromPoints(start, end);\n };\n this.closingBracketBlock = function (session, bracket, row, column, typeRe) {\n var end = { row: row, column: column };\n var start = session.$findOpeningBracket(bracket, end);\n if (!start)\n return;\n start.column++;\n end.column--;\n return Range.fromPoints(start, end);\n };\n}).call(FoldMode.prototype);\n\n});\n\nace.define(\"ace/line_widgets\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"./lib/dom\");\nfunction LineWidgets(session) {\n this.session = session;\n this.session.widgetManager = this;\n this.session.getRowLength = this.getRowLength;\n this.session.$getWidgetScreenLength = this.$getWidgetScreenLength;\n this.updateOnChange = this.updateOnChange.bind(this);\n this.renderWidgets = this.renderWidgets.bind(this);\n this.measureWidgets = this.measureWidgets.bind(this);\n this.session._changedWidgets = [];\n this.$onChangeEditor = this.$onChangeEditor.bind(this);\n this.session.on(\"change\", this.updateOnChange);\n this.session.on(\"changeFold\", this.updateOnFold);\n this.session.on(\"changeEditor\", this.$onChangeEditor);\n}\n(function () {\n this.getRowLength = function (row) {\n var h;\n if (this.lineWidgets)\n h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0;\n else\n h = 0;\n if (!this.$useWrapMode || !this.$wrapData[row]) {\n return 1 + h;\n }\n else {\n return this.$wrapData[row].length + 1 + h;\n }\n };\n this.$getWidgetScreenLength = function () {\n var screenRows = 0;\n this.lineWidgets.forEach(function (w) {\n if (w && w.rowCount && !w.hidden)\n screenRows += w.rowCount;\n });\n return screenRows;\n };\n this.$onChangeEditor = function (e) {\n this.attach(e.editor);\n };\n this.attach = function (editor) {\n if (editor && editor.widgetManager && editor.widgetManager != this)\n editor.widgetManager.detach();\n if (this.editor == editor)\n return;\n this.detach();\n this.editor = editor;\n if (editor) {\n editor.widgetManager = this;\n editor.renderer.on(\"beforeRender\", this.measureWidgets);\n editor.renderer.on(\"afterRender\", this.renderWidgets);\n }\n };\n this.detach = function (e) {\n var editor = this.editor;\n if (!editor)\n return;\n this.editor = null;\n editor.widgetManager = null;\n editor.renderer.off(\"beforeRender\", this.measureWidgets);\n editor.renderer.off(\"afterRender\", this.renderWidgets);\n var lineWidgets = this.session.lineWidgets;\n lineWidgets && lineWidgets.forEach(function (w) {\n if (w && w.el && w.el.parentNode) {\n w._inDocument = false;\n w.el.parentNode.removeChild(w.el);\n }\n });\n };\n this.updateOnFold = function (e, session) {\n var lineWidgets = session.lineWidgets;\n if (!lineWidgets || !e.action)\n return;\n var fold = e.data;\n var start = fold.start.row;\n var end = fold.end.row;\n var hide = e.action == \"add\";\n for (var i = start + 1; i < end; i++) {\n if (lineWidgets[i])\n lineWidgets[i].hidden = hide;\n }\n if (lineWidgets[end]) {\n if (hide) {\n if (!lineWidgets[start])\n lineWidgets[start] = lineWidgets[end];\n else\n lineWidgets[end].hidden = hide;\n }\n else {\n if (lineWidgets[start] == lineWidgets[end])\n lineWidgets[start] = undefined;\n lineWidgets[end].hidden = hide;\n }\n }\n };\n this.updateOnChange = function (delta) {\n var lineWidgets = this.session.lineWidgets;\n if (!lineWidgets)\n return;\n var startRow = delta.start.row;\n var len = delta.end.row - startRow;\n if (len === 0) {\n }\n else if (delta.action == \"remove\") {\n var removed = lineWidgets.splice(startRow + 1, len);\n if (!lineWidgets[startRow] && removed[removed.length - 1]) {\n lineWidgets[startRow] = removed.pop();\n }\n removed.forEach(function (w) {\n w && this.removeLineWidget(w);\n }, this);\n this.$updateRows();\n }\n else {\n var args = new Array(len);\n if (lineWidgets[startRow] && lineWidgets[startRow].column != null) {\n if (delta.start.column > lineWidgets[startRow].column)\n startRow++;\n }\n args.unshift(startRow, 0);\n lineWidgets.splice.apply(lineWidgets, args);\n this.$updateRows();\n }\n };\n this.$updateRows = function () {\n var lineWidgets = this.session.lineWidgets;\n if (!lineWidgets)\n return;\n var noWidgets = true;\n lineWidgets.forEach(function (w, i) {\n if (w) {\n noWidgets = false;\n w.row = i;\n while (w.$oldWidget) {\n w.$oldWidget.row = i;\n w = w.$oldWidget;\n }\n }\n });\n if (noWidgets)\n this.session.lineWidgets = null;\n };\n this.$registerLineWidget = function (w) {\n if (!this.session.lineWidgets)\n this.session.lineWidgets = new Array(this.session.getLength());\n var old = this.session.lineWidgets[w.row];\n if (old) {\n w.$oldWidget = old;\n if (old.el && old.el.parentNode) {\n old.el.parentNode.removeChild(old.el);\n old._inDocument = false;\n }\n }\n this.session.lineWidgets[w.row] = w;\n return w;\n };\n this.addLineWidget = function (w) {\n this.$registerLineWidget(w);\n w.session = this.session;\n if (!this.editor)\n return w;\n var renderer = this.editor.renderer;\n if (w.html && !w.el) {\n w.el = dom.createElement(\"div\");\n w.el.innerHTML = w.html;\n }\n if (w.el) {\n dom.addCssClass(w.el, \"ace_lineWidgetContainer\");\n w.el.style.position = \"absolute\";\n w.el.style.zIndex = 5;\n renderer.container.appendChild(w.el);\n w._inDocument = true;\n if (!w.coverGutter) {\n w.el.style.zIndex = 3;\n }\n if (w.pixelHeight == null) {\n w.pixelHeight = w.el.offsetHeight;\n }\n }\n if (w.rowCount == null) {\n w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight;\n }\n var fold = this.session.getFoldAt(w.row, 0);\n w.$fold = fold;\n if (fold) {\n var lineWidgets = this.session.lineWidgets;\n if (w.row == fold.end.row && !lineWidgets[fold.start.row])\n lineWidgets[fold.start.row] = w;\n else\n w.hidden = true;\n }\n this.session._emit(\"changeFold\", { data: { start: { row: w.row } } });\n this.$updateRows();\n this.renderWidgets(null, renderer);\n this.onWidgetChanged(w);\n return w;\n };\n this.removeLineWidget = function (w) {\n w._inDocument = false;\n w.session = null;\n if (w.el && w.el.parentNode)\n w.el.parentNode.removeChild(w.el);\n if (w.editor && w.editor.destroy)\n try {\n w.editor.destroy();\n }\n catch (e) { }\n if (this.session.lineWidgets) {\n var w1 = this.session.lineWidgets[w.row];\n if (w1 == w) {\n this.session.lineWidgets[w.row] = w.$oldWidget;\n if (w.$oldWidget)\n this.onWidgetChanged(w.$oldWidget);\n }\n else {\n while (w1) {\n if (w1.$oldWidget == w) {\n w1.$oldWidget = w.$oldWidget;\n break;\n }\n w1 = w1.$oldWidget;\n }\n }\n }\n this.session._emit(\"changeFold\", { data: { start: { row: w.row } } });\n this.$updateRows();\n };\n this.getWidgetsAtRow = function (row) {\n var lineWidgets = this.session.lineWidgets;\n var w = lineWidgets && lineWidgets[row];\n var list = [];\n while (w) {\n list.push(w);\n w = w.$oldWidget;\n }\n return list;\n };\n this.onWidgetChanged = function (w) {\n this.session._changedWidgets.push(w);\n this.editor && this.editor.renderer.updateFull();\n };\n this.measureWidgets = function (e, renderer) {\n var changedWidgets = this.session._changedWidgets;\n var config = renderer.layerConfig;\n if (!changedWidgets || !changedWidgets.length)\n return;\n var min = Infinity;\n for (var i = 0; i < changedWidgets.length; i++) {\n var w = changedWidgets[i];\n if (!w || !w.el)\n continue;\n if (w.session != this.session)\n continue;\n if (!w._inDocument) {\n if (this.session.lineWidgets[w.row] != w)\n continue;\n w._inDocument = true;\n renderer.container.appendChild(w.el);\n }\n w.h = w.el.offsetHeight;\n if (!w.fixedWidth) {\n w.w = w.el.offsetWidth;\n w.screenWidth = Math.ceil(w.w / config.characterWidth);\n }\n var rowCount = w.h / config.lineHeight;\n if (w.coverLine) {\n rowCount -= this.session.getRowLineCount(w.row);\n if (rowCount < 0)\n rowCount = 0;\n }\n if (w.rowCount != rowCount) {\n w.rowCount = rowCount;\n if (w.row < min)\n min = w.row;\n }\n }\n if (min != Infinity) {\n this.session._emit(\"changeFold\", { data: { start: { row: min } } });\n this.session.lineWidgetWidth = null;\n }\n this.session._changedWidgets = [];\n };\n this.renderWidgets = function (e, renderer) {\n var config = renderer.layerConfig;\n var lineWidgets = this.session.lineWidgets;\n if (!lineWidgets)\n return;\n var first = Math.min(this.firstRow, config.firstRow);\n var last = Math.max(this.lastRow, config.lastRow, lineWidgets.length);\n while (first > 0 && !lineWidgets[first])\n first--;\n this.firstRow = config.firstRow;\n this.lastRow = config.lastRow;\n renderer.$cursorLayer.config = config;\n for (var i = first; i <= last; i++) {\n var w = lineWidgets[i];\n if (!w || !w.el)\n continue;\n if (w.hidden) {\n w.el.style.top = -100 - (w.pixelHeight || 0) + \"px\";\n continue;\n }\n if (!w._inDocument) {\n w._inDocument = true;\n renderer.container.appendChild(w.el);\n }\n var top = renderer.$cursorLayer.getPixelPosition({ row: i, column: 0 }, true).top;\n if (!w.coverLine)\n top += config.lineHeight * this.session.getRowLineCount(w.row);\n w.el.style.top = top - config.offset + \"px\";\n var left = w.coverGutter ? 0 : renderer.gutterWidth;\n if (!w.fixedWidth)\n left -= renderer.scrollLeft;\n w.el.style.left = left + \"px\";\n if (w.fullWidth && w.screenWidth) {\n w.el.style.minWidth = config.width + 2 * config.padding + \"px\";\n }\n if (w.fixedWidth) {\n w.el.style.right = renderer.scrollBar.getWidth() + \"px\";\n }\n else {\n w.el.style.right = \"\";\n }\n }\n };\n}).call(LineWidgets.prototype);\nexports.LineWidgets = LineWidgets;\n\n});\n\nace.define(\"ace/ext/error_marker\",[\"require\",\"exports\",\"module\",\"ace/line_widgets\",\"ace/lib/dom\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar LineWidgets = require(\"../line_widgets\").LineWidgets;\nvar dom = require(\"../lib/dom\");\nvar Range = require(\"../range\").Range;\nfunction binarySearch(array, needle, comparator) {\n var first = 0;\n var last = array.length - 1;\n while (first <= last) {\n var mid = (first + last) >> 1;\n var c = comparator(needle, array[mid]);\n if (c > 0)\n first = mid + 1;\n else if (c < 0)\n last = mid - 1;\n else\n return mid;\n }\n return -(first + 1);\n}\nfunction findAnnotations(session, row, dir) {\n var annotations = session.getAnnotations().sort(Range.comparePoints);\n if (!annotations.length)\n return;\n var i = binarySearch(annotations, { row: row, column: -1 }, Range.comparePoints);\n if (i < 0)\n i = -i - 1;\n if (i >= annotations.length)\n i = dir > 0 ? 0 : annotations.length - 1;\n else if (i === 0 && dir < 0)\n i = annotations.length - 1;\n var annotation = annotations[i];\n if (!annotation || !dir)\n return;\n if (annotation.row === row) {\n do {\n annotation = annotations[i += dir];\n } while (annotation && annotation.row === row);\n if (!annotation)\n return annotations.slice();\n }\n var matched = [];\n row = annotation.row;\n do {\n matched[dir < 0 ? \"unshift\" : \"push\"](annotation);\n annotation = annotations[i += dir];\n } while (annotation && annotation.row == row);\n return matched.length && matched;\n}\nexports.showErrorMarker = function (editor, dir) {\n var session = editor.session;\n if (!session.widgetManager) {\n session.widgetManager = new LineWidgets(session);\n session.widgetManager.attach(editor);\n }\n var pos = editor.getCursorPosition();\n var row = pos.row;\n var oldWidget = session.widgetManager.getWidgetsAtRow(row).filter(function (w) {\n return w.type == \"errorMarker\";\n })[0];\n if (oldWidget) {\n oldWidget.destroy();\n }\n else {\n row -= dir;\n }\n var annotations = findAnnotations(session, row, dir);\n var gutterAnno;\n if (annotations) {\n var annotation = annotations[0];\n pos.column = (annotation.pos && typeof annotation.column != \"number\"\n ? annotation.pos.sc\n : annotation.column) || 0;\n pos.row = annotation.row;\n gutterAnno = editor.renderer.$gutterLayer.$annotations[pos.row];\n }\n else if (oldWidget) {\n return;\n }\n else {\n gutterAnno = {\n text: [\"Looks good!\"],\n className: \"ace_ok\"\n };\n }\n editor.session.unfold(pos.row);\n editor.selection.moveToPosition(pos);\n var w = {\n row: pos.row,\n fixedWidth: true,\n coverGutter: true,\n el: dom.createElement(\"div\"),\n type: \"errorMarker\"\n };\n var el = w.el.appendChild(dom.createElement(\"div\"));\n var arrow = w.el.appendChild(dom.createElement(\"div\"));\n arrow.className = \"error_widget_arrow \" + gutterAnno.className;\n var left = editor.renderer.$cursorLayer\n .getPixelPosition(pos).left;\n arrow.style.left = left + editor.renderer.gutterWidth - 5 + \"px\";\n w.el.className = \"error_widget_wrapper\";\n el.className = \"error_widget \" + gutterAnno.className;\n el.innerHTML = gutterAnno.text.join(\"
\");\n el.appendChild(dom.createElement(\"div\"));\n var kb = function (_, hashId, keyString) {\n if (hashId === 0 && (keyString === \"esc\" || keyString === \"return\")) {\n w.destroy();\n return { command: \"null\" };\n }\n };\n w.destroy = function () {\n if (editor.$mouseHandler.isMousePressed)\n return;\n editor.keyBinding.removeKeyboardHandler(kb);\n session.widgetManager.removeLineWidget(w);\n editor.off(\"changeSelection\", w.destroy);\n editor.off(\"changeSession\", w.destroy);\n editor.off(\"mouseup\", w.destroy);\n editor.off(\"change\", w.destroy);\n };\n editor.keyBinding.addKeyboardHandler(kb);\n editor.on(\"changeSelection\", w.destroy);\n editor.on(\"changeSession\", w.destroy);\n editor.on(\"mouseup\", w.destroy);\n editor.on(\"change\", w.destroy);\n editor.session.widgetManager.addLineWidget(w);\n w.el.onmousedown = editor.focus.bind(editor);\n editor.renderer.scrollCursorIntoView(null, 0.5, { bottom: w.el.offsetHeight });\n};\ndom.importCssString(\"\\n .error_widget_wrapper {\\n background: inherit;\\n color: inherit;\\n border:none\\n }\\n .error_widget {\\n border-top: solid 2px;\\n border-bottom: solid 2px;\\n margin: 5px 0;\\n padding: 10px 40px;\\n white-space: pre-wrap;\\n }\\n .error_widget.ace_error, .error_widget_arrow.ace_error{\\n border-color: #ff5a5a\\n }\\n .error_widget.ace_warning, .error_widget_arrow.ace_warning{\\n border-color: #F1D817\\n }\\n .error_widget.ace_info, .error_widget_arrow.ace_info{\\n border-color: #5a5a5a\\n }\\n .error_widget.ace_ok, .error_widget_arrow.ace_ok{\\n border-color: #5aaa5a\\n }\\n .error_widget_arrow {\\n position: absolute;\\n border: solid 5px;\\n border-top-color: transparent!important;\\n border-right-color: transparent!important;\\n border-left-color: transparent!important;\\n top: -5px;\\n }\\n\", \"error_marker.css\", false);\n\n});\n\nace.define(\"ace/ace\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/lib/event\",\"ace/range\",\"ace/editor\",\"ace/edit_session\",\"ace/undomanager\",\"ace/virtual_renderer\",\"ace/worker/worker_client\",\"ace/keyboard/hash_handler\",\"ace/placeholder\",\"ace/multi_select\",\"ace/mode/folding/fold_mode\",\"ace/theme/textmate\",\"ace/ext/error_marker\",\"ace/config\",\"ace/loader_build\"], function(require, exports, module){/**\n * The main class required to set up an Ace instance in the browser.\n *\n * @class Ace\n **/\n\"use strict\";\nrequire(\"./loader_build\")(exports)\nvar dom = require(\"./lib/dom\");\nvar event = require(\"./lib/event\");\nvar Range = require(\"./range\").Range;\nvar Editor = require(\"./editor\").Editor;\nvar EditSession = require(\"./edit_session\").EditSession;\nvar UndoManager = require(\"./undomanager\").UndoManager;\nvar Renderer = require(\"./virtual_renderer\").VirtualRenderer;\nrequire(\"./worker/worker_client\");\nrequire(\"./keyboard/hash_handler\");\nrequire(\"./placeholder\");\nrequire(\"./multi_select\");\nrequire(\"./mode/folding/fold_mode\");\nrequire(\"./theme/textmate\");\nrequire(\"./ext/error_marker\");\nexports.config = require(\"./config\");\nexports.edit = function (el, options) {\n if (typeof el == \"string\") {\n var _id = el;\n el = document.getElementById(_id);\n if (!el)\n throw new Error(\"ace.edit can't find div #\" + _id);\n }\n if (el && el.env && el.env.editor instanceof Editor)\n return el.env.editor;\n var value = \"\";\n if (el && /input|textarea/i.test(el.tagName)) {\n var oldNode = el;\n value = oldNode.value;\n el = dom.createElement(\"pre\");\n oldNode.parentNode.replaceChild(el, oldNode);\n }\n else if (el) {\n value = el.textContent;\n el.innerHTML = \"\";\n }\n var doc = exports.createEditSession(value);\n var editor = new Editor(new Renderer(el), doc, options);\n var env = {\n document: doc,\n editor: editor,\n onResize: editor.resize.bind(editor, null)\n };\n if (oldNode)\n env.textarea = oldNode;\n event.addListener(window, \"resize\", env.onResize);\n editor.on(\"destroy\", function () {\n event.removeListener(window, \"resize\", env.onResize);\n env.editor.container.env = null; // prevent memory leak on old ie\n });\n editor.container.env = editor.env = env;\n return editor;\n};\nexports.createEditSession = function (text, mode) {\n var doc = new EditSession(text, mode);\n doc.setUndoManager(new UndoManager());\n return doc;\n};\nexports.Range = Range;\nexports.Editor = Editor;\nexports.EditSession = EditSession;\nexports.UndoManager = UndoManager;\nexports.VirtualRenderer = Renderer;\nexports.version = exports.config.version;\n\n}); (function() {\n ace.require([\"ace/ace\"], function(a) {\n if (a) {\n a.config.init(true);\n a.define = ace.define;\n }\n if (!window.ace)\n window.ace = a;\n for (var key in a) if (a.hasOwnProperty(key))\n window.ace[key] = a[key];\n window.ace[\"default\"] = window.ace;\n if (typeof module == \"object\" && typeof exports == \"object\" && module) {\n module.exports = window.ace;\n }\n });\n })();\n ","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","/** @license React v16.13.1\n * react-is.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\n// (unstable) APIs that have been removed. Can we remove the symbols?\n\nvar REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\nvar REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;\n\nfunction isValidElementType(type) {\n return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);\n}\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_ASYNC_MODE_TYPE:\n case REACT_CONCURRENT_MODE_TYPE:\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n return type;\n\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n\n default:\n return $$typeof;\n }\n\n }\n\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n} // AsyncMode is deprecated along with isAsyncMode\n\nvar AsyncMode = REACT_ASYNC_MODE_TYPE;\nvar ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\nvar hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated\n\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n 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.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}\nfunction isConcurrentMode(object) {\n return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\n\nexports.AsyncMode = AsyncMode;\nexports.ConcurrentMode = ConcurrentMode;\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\nexports.isValidElementType = isValidElementType;\nexports.typeOf = typeOf;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","module.exports = Function.call.bind(Object.prototype.hasOwnProperty);\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n var has = require('./lib/has');\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) { /**/ }\n };\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +\n 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n 'shape all require an argument).'\n );\n }\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n if (process.env.NODE_ENV !== 'production') {\n loggedTypeFailures = {};\n }\n}\n\nmodule.exports = checkPropTypes;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactIs = require('react-is');\nvar assign = require('object-assign');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar has = require('./lib/has');\nvar checkPropTypes = require('./checkPropTypes');\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\nfunction emptyFunctionThatReturnsNull() {\n return null;\n}\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bigint: createPrimitiveTypeChecker('bigint'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n elementType: createElementTypeTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message, data) {\n this.message = message;\n this.data = data && typeof data === 'object' ? data: {};\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n printWarning(\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),\n {expectedType: expectedType}\n );\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunctionThatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!ReactIs.isValidElementType(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n if (process.env.NODE_ENV !== 'production') {\n if (arguments.length > 1) {\n printWarning(\n 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +\n 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'\n );\n } else {\n printWarning('Invalid argument supplied to oneOf, expected an array.');\n }\n }\n return emptyFunctionThatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {\n var type = getPreciseType(value);\n if (type === 'symbol') {\n return String(value);\n }\n return value;\n });\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (has(propValue, key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunctionThatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n printWarning(\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'\n );\n return emptyFunctionThatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var expectedTypes = [];\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);\n if (checkerResult == null) {\n return null;\n }\n if (checkerResult.data && has(checkerResult.data, 'expectedType')) {\n expectedTypes.push(checkerResult.data.expectedType);\n }\n }\n var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function invalidValidatorError(componentName, location, propFullName, key, type) {\n return new PropTypeError(\n (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'\n );\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (typeof checker !== 'function') {\n return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (has(shapeTypes, key) && typeof checker !== 'function') {\n return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));\n }\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // falsy value can't be a Symbol\n if (!propValue) {\n return false;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getAceInstance = exports.debounce = exports.editorEvents = exports.editorOptions = void 0;\nvar editorOptions = [\n \"minLines\",\n \"maxLines\",\n \"readOnly\",\n \"highlightActiveLine\",\n \"tabSize\",\n \"enableBasicAutocompletion\",\n \"enableLiveAutocompletion\",\n \"enableSnippets\"\n];\nexports.editorOptions = editorOptions;\nvar editorEvents = [\n \"onChange\",\n \"onFocus\",\n \"onInput\",\n \"onBlur\",\n \"onCopy\",\n \"onPaste\",\n \"onSelectionChange\",\n \"onCursorChange\",\n \"onScroll\",\n \"handleOptions\",\n \"updateRef\"\n];\nexports.editorEvents = editorEvents;\nvar getAceInstance = function () {\n var ace;\n if (typeof window === \"undefined\") {\n // ace-builds just needs some window object to attach ace to.\n // During SSR even just an empty object will work.\n global.window = {};\n ace = require(\"ace-builds\");\n // And it can be discarded immediately afterward to avoid confusing\n // other libraries that might detect SSR the same way we did.\n delete global.window;\n }\n else if (window.ace) {\n // Fallback for ace.require when vanilla ACE is hosted over a CDN\n ace = window.ace;\n ace.acequire = window.ace.require || window.ace.acequire;\n }\n else {\n ace = require(\"ace-builds\");\n }\n return ace;\n};\nexports.getAceInstance = getAceInstance;\nvar debounce = function (fn, delay) {\n var timer = null;\n // tslint:disable-next-line\n return function () {\n var context = this;\n var args = arguments;\n clearTimeout(timer);\n timer = setTimeout(function () {\n fn.apply(context, args);\n }, delay);\n };\n};\nexports.debounce = debounce;\n//# sourceMappingURL=editorOptions.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ace_builds_1 = require(\"ace-builds\");\nvar PropTypes = require(\"prop-types\");\nvar React = require(\"react\");\nvar isEqual = require(\"lodash.isequal\");\nvar editorOptions_1 = require(\"./editorOptions\");\nvar ace = (0, editorOptions_1.getAceInstance)();\nvar ReactAce = /** @class */ (function (_super) {\n __extends(ReactAce, _super);\n function ReactAce(props) {\n var _this = _super.call(this, props) || this;\n editorOptions_1.editorEvents.forEach(function (method) {\n _this[method] = _this[method].bind(_this);\n });\n _this.debounce = editorOptions_1.debounce;\n return _this;\n }\n ReactAce.prototype.isInShadow = function (node) {\n var parent = node && node.parentNode;\n while (parent) {\n if (parent.toString() === \"[object ShadowRoot]\") {\n return true;\n }\n parent = parent.parentNode;\n }\n return false;\n };\n ReactAce.prototype.componentDidMount = function () {\n var _this = this;\n var _a = this.props, className = _a.className, onBeforeLoad = _a.onBeforeLoad, onValidate = _a.onValidate, mode = _a.mode, focus = _a.focus, theme = _a.theme, fontSize = _a.fontSize, value = _a.value, defaultValue = _a.defaultValue, showGutter = _a.showGutter, wrapEnabled = _a.wrapEnabled, showPrintMargin = _a.showPrintMargin, _b = _a.scrollMargin, scrollMargin = _b === void 0 ? [0, 0, 0, 0] : _b, keyboardHandler = _a.keyboardHandler, onLoad = _a.onLoad, commands = _a.commands, annotations = _a.annotations, markers = _a.markers, placeholder = _a.placeholder;\n this.editor = ace.edit(this.refEditor);\n if (onBeforeLoad) {\n onBeforeLoad(ace);\n }\n var editorProps = Object.keys(this.props.editorProps);\n for (var i = 0; i < editorProps.length; i++) {\n this.editor[editorProps[i]] = this.props.editorProps[editorProps[i]];\n }\n if (this.props.debounceChangePeriod) {\n this.onChange = this.debounce(this.onChange, this.props.debounceChangePeriod);\n }\n this.editor.renderer.setScrollMargin(scrollMargin[0], scrollMargin[1], scrollMargin[2], scrollMargin[3]);\n if (this.isInShadow(this.refEditor)) {\n this.editor.renderer.attachToShadowRoot();\n }\n this.editor\n .getSession()\n .setMode(typeof mode === \"string\" ? \"ace/mode/\".concat(mode) : mode);\n if (theme && theme !== \"\")\n this.editor.setTheme(\"ace/theme/\".concat(theme));\n this.editor.setFontSize(typeof fontSize === \"number\" ? \"\".concat(fontSize, \"px\") : fontSize);\n this.editor\n .getSession()\n .setValue(!defaultValue ? value || \"\" : defaultValue);\n if (this.props.navigateToFileEnd) {\n this.editor.navigateFileEnd();\n }\n this.editor.renderer.setShowGutter(showGutter);\n this.editor.getSession().setUseWrapMode(wrapEnabled);\n this.editor.setShowPrintMargin(showPrintMargin);\n this.editor.on(\"focus\", this.onFocus);\n this.editor.on(\"blur\", this.onBlur);\n this.editor.on(\"copy\", this.onCopy);\n this.editor.on(\"paste\", this.onPaste);\n this.editor.on(\"change\", this.onChange);\n this.editor.on(\"input\", this.onInput);\n if (placeholder) {\n this.updatePlaceholder();\n }\n this.editor\n .getSession()\n .selection.on(\"changeSelection\", this.onSelectionChange);\n this.editor.getSession().selection.on(\"changeCursor\", this.onCursorChange);\n if (onValidate) {\n // @ts-ignore types don't include\n this.editor.getSession().on(\"changeAnnotation\", function () {\n // tslint:disable-next-line:no-shadowed-variable\n var annotations = _this.editor.getSession().getAnnotations();\n _this.props.onValidate(annotations);\n });\n }\n this.editor.session.on(\"changeScrollTop\", this.onScroll);\n this.editor.getSession().setAnnotations(annotations || []);\n if (markers && markers.length > 0) {\n this.handleMarkers(markers);\n }\n // get a list of possible options to avoid 'misspelled option errors'\n var availableOptions = this.editor.$options;\n editorOptions_1.editorOptions.forEach(function (option) {\n if (availableOptions.hasOwnProperty(option)) {\n // @ts-ignore\n _this.editor.setOption(option, _this.props[option]);\n }\n else if (_this.props[option]) {\n console.warn(\"ReactAce: editor option \".concat(option, \" was activated but not found. Did you need to import a related tool or did you possibly mispell the option?\"));\n }\n });\n this.handleOptions(this.props);\n if (Array.isArray(commands)) {\n commands.forEach(function (command) {\n if (typeof command.exec === \"string\") {\n _this.editor.commands.bindKey(command.bindKey, command.exec);\n }\n else {\n _this.editor.commands.addCommand(command);\n }\n });\n }\n if (keyboardHandler) {\n this.editor.setKeyboardHandler(\"ace/keyboard/\" + keyboardHandler);\n }\n if (className) {\n this.refEditor.className += \" \" + className;\n }\n if (onLoad) {\n onLoad(this.editor);\n }\n this.editor.resize();\n if (focus) {\n this.editor.focus();\n }\n };\n ReactAce.prototype.componentDidUpdate = function (prevProps) {\n var oldProps = prevProps;\n var nextProps = this.props;\n for (var i = 0; i < editorOptions_1.editorOptions.length; i++) {\n var option = editorOptions_1.editorOptions[i];\n if (nextProps[option] !== oldProps[option]) {\n // @ts-ignore\n this.editor.setOption(option, nextProps[option]);\n }\n }\n if (nextProps.className !== oldProps.className) {\n var appliedClasses = this.refEditor.className;\n var appliedClassesArray_1 = appliedClasses.trim().split(\" \");\n var oldClassesArray = oldProps.className.trim().split(\" \");\n oldClassesArray.forEach(function (oldClass) {\n var index = appliedClassesArray_1.indexOf(oldClass);\n appliedClassesArray_1.splice(index, 1);\n });\n this.refEditor.className =\n \" \" + nextProps.className + \" \" + appliedClassesArray_1.join(\" \");\n }\n // First process editor value, as it may create a new session (see issue #300)\n var valueChanged = this.editor &&\n nextProps.value != null &&\n this.editor.getValue() !== nextProps.value;\n if (valueChanged) {\n // editor.setValue is a synchronous function call, change event is emitted before setValue return.\n this.silent = true;\n var pos = this.editor.session.selection.toJSON();\n this.editor.setValue(nextProps.value, nextProps.cursorStart);\n this.editor.session.selection.fromJSON(pos);\n this.silent = false;\n }\n if (nextProps.placeholder !== oldProps.placeholder) {\n this.updatePlaceholder();\n }\n if (nextProps.mode !== oldProps.mode) {\n this.editor\n .getSession()\n .setMode(typeof nextProps.mode === \"string\"\n ? \"ace/mode/\".concat(nextProps.mode)\n : nextProps.mode);\n }\n if (nextProps.theme !== oldProps.theme) {\n this.editor.setTheme(\"ace/theme/\" + nextProps.theme);\n }\n if (nextProps.keyboardHandler !== oldProps.keyboardHandler) {\n if (nextProps.keyboardHandler) {\n this.editor.setKeyboardHandler(\"ace/keyboard/\" + nextProps.keyboardHandler);\n }\n else {\n this.editor.setKeyboardHandler(null);\n }\n }\n if (nextProps.fontSize !== oldProps.fontSize) {\n this.editor.setFontSize(typeof nextProps.fontSize === \"number\"\n ? \"\".concat(nextProps.fontSize, \"px\")\n : nextProps.fontSize);\n }\n if (nextProps.wrapEnabled !== oldProps.wrapEnabled) {\n this.editor.getSession().setUseWrapMode(nextProps.wrapEnabled);\n }\n if (nextProps.showPrintMargin !== oldProps.showPrintMargin) {\n this.editor.setShowPrintMargin(nextProps.showPrintMargin);\n }\n if (nextProps.showGutter !== oldProps.showGutter) {\n this.editor.renderer.setShowGutter(nextProps.showGutter);\n }\n if (!isEqual(nextProps.setOptions, oldProps.setOptions)) {\n this.handleOptions(nextProps);\n }\n // if the value or annotations changed, set the annotations\n // changing the value may create create a new session which will require annotations to be re-set\n if (valueChanged || !isEqual(nextProps.annotations, oldProps.annotations)) {\n this.editor.getSession().setAnnotations(nextProps.annotations || []);\n }\n if (!isEqual(nextProps.markers, oldProps.markers) &&\n Array.isArray(nextProps.markers)) {\n this.handleMarkers(nextProps.markers);\n }\n // this doesn't look like it works at all....\n if (!isEqual(nextProps.scrollMargin, oldProps.scrollMargin)) {\n this.handleScrollMargins(nextProps.scrollMargin);\n }\n if (prevProps.height !== this.props.height ||\n prevProps.width !== this.props.width) {\n this.editor.resize();\n }\n if (this.props.focus && !prevProps.focus) {\n this.editor.focus();\n }\n };\n ReactAce.prototype.handleScrollMargins = function (margins) {\n if (margins === void 0) { margins = [0, 0, 0, 0]; }\n this.editor.renderer.setScrollMargin(margins[0], margins[1], margins[2], margins[3]);\n };\n ReactAce.prototype.componentWillUnmount = function () {\n if (this.editor) {\n this.editor.destroy();\n this.editor = null;\n }\n };\n ReactAce.prototype.onChange = function (event) {\n if (this.props.onChange && !this.silent) {\n var value = this.editor.getValue();\n this.props.onChange(value, event);\n }\n };\n ReactAce.prototype.onSelectionChange = function (event) {\n if (this.props.onSelectionChange) {\n var value = this.editor.getSelection();\n this.props.onSelectionChange(value, event);\n }\n };\n ReactAce.prototype.onCursorChange = function (event) {\n if (this.props.onCursorChange) {\n var value = this.editor.getSelection();\n this.props.onCursorChange(value, event);\n }\n };\n ReactAce.prototype.onInput = function (event) {\n if (this.props.onInput) {\n this.props.onInput(event);\n }\n if (this.props.placeholder) {\n this.updatePlaceholder();\n }\n };\n ReactAce.prototype.onFocus = function (event) {\n if (this.props.onFocus) {\n this.props.onFocus(event, this.editor);\n }\n };\n ReactAce.prototype.onBlur = function (event) {\n if (this.props.onBlur) {\n this.props.onBlur(event, this.editor);\n }\n };\n ReactAce.prototype.onCopy = function (_a) {\n var text = _a.text;\n if (this.props.onCopy) {\n this.props.onCopy(text);\n }\n };\n ReactAce.prototype.onPaste = function (_a) {\n var text = _a.text;\n if (this.props.onPaste) {\n this.props.onPaste(text);\n }\n };\n ReactAce.prototype.onScroll = function () {\n if (this.props.onScroll) {\n this.props.onScroll(this.editor);\n }\n };\n ReactAce.prototype.handleOptions = function (props) {\n var setOptions = Object.keys(props.setOptions);\n for (var y = 0; y < setOptions.length; y++) {\n // @ts-ignore\n this.editor.setOption(setOptions[y], props.setOptions[setOptions[y]]);\n }\n };\n ReactAce.prototype.handleMarkers = function (markers) {\n var _this = this;\n // remove foreground markers\n var currentMarkers = this.editor.getSession().getMarkers(true);\n for (var i in currentMarkers) {\n if (currentMarkers.hasOwnProperty(i)) {\n this.editor.getSession().removeMarker(currentMarkers[i].id);\n }\n }\n // remove background markers except active line marker and selected word marker\n currentMarkers = this.editor.getSession().getMarkers(false);\n for (var i in currentMarkers) {\n if (currentMarkers.hasOwnProperty(i) &&\n currentMarkers[i].clazz !== \"ace_active-line\" &&\n currentMarkers[i].clazz !== \"ace_selected-word\") {\n this.editor.getSession().removeMarker(currentMarkers[i].id);\n }\n }\n // add new markers\n markers.forEach(function (_a) {\n var startRow = _a.startRow, startCol = _a.startCol, endRow = _a.endRow, endCol = _a.endCol, className = _a.className, type = _a.type, _b = _a.inFront, inFront = _b === void 0 ? false : _b;\n var range = new ace_builds_1.Range(startRow, startCol, endRow, endCol);\n _this.editor.getSession().addMarker(range, className, type, inFront);\n });\n };\n ReactAce.prototype.updatePlaceholder = function () {\n // Adapted from https://stackoverflow.com/questions/26695708/how-can-i-add-placeholder-text-when-the-editor-is-empty\n var editor = this.editor;\n var placeholder = this.props.placeholder;\n var showPlaceholder = !editor.session.getValue().length;\n var node = editor.renderer.placeholderNode;\n if (!showPlaceholder && node) {\n editor.renderer.scroller.removeChild(editor.renderer.placeholderNode);\n editor.renderer.placeholderNode = null;\n }\n else if (showPlaceholder && !node) {\n node = editor.renderer.placeholderNode = document.createElement(\"div\");\n node.textContent = placeholder || \"\";\n node.className = \"ace_comment ace_placeholder\";\n node.style.padding = \"0 9px\";\n node.style.position = \"absolute\";\n node.style.zIndex = \"3\";\n editor.renderer.scroller.appendChild(node);\n }\n else if (showPlaceholder && node) {\n node.textContent = placeholder;\n }\n };\n ReactAce.prototype.updateRef = function (item) {\n this.refEditor = item;\n };\n ReactAce.prototype.render = function () {\n var _a = this.props, name = _a.name, width = _a.width, height = _a.height, style = _a.style;\n var divStyle = __assign({ width: width, height: height }, style);\n return React.createElement(\"div\", { ref: this.updateRef, id: name, style: divStyle });\n };\n ReactAce.propTypes = {\n mode: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n focus: PropTypes.bool,\n theme: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n height: PropTypes.string,\n width: PropTypes.string,\n fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n showGutter: PropTypes.bool,\n onChange: PropTypes.func,\n onCopy: PropTypes.func,\n onPaste: PropTypes.func,\n onFocus: PropTypes.func,\n onInput: PropTypes.func,\n onBlur: PropTypes.func,\n onScroll: PropTypes.func,\n value: PropTypes.string,\n defaultValue: PropTypes.string,\n onLoad: PropTypes.func,\n onSelectionChange: PropTypes.func,\n onCursorChange: PropTypes.func,\n onBeforeLoad: PropTypes.func,\n onValidate: PropTypes.func,\n minLines: PropTypes.number,\n maxLines: PropTypes.number,\n readOnly: PropTypes.bool,\n highlightActiveLine: PropTypes.bool,\n tabSize: PropTypes.number,\n showPrintMargin: PropTypes.bool,\n cursorStart: PropTypes.number,\n debounceChangePeriod: PropTypes.number,\n editorProps: PropTypes.object,\n setOptions: PropTypes.object,\n style: PropTypes.object,\n scrollMargin: PropTypes.array,\n annotations: PropTypes.array,\n markers: PropTypes.array,\n keyboardHandler: PropTypes.string,\n wrapEnabled: PropTypes.bool,\n enableSnippets: PropTypes.bool,\n enableBasicAutocompletion: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.array\n ]),\n enableLiveAutocompletion: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.array\n ]),\n navigateToFileEnd: PropTypes.bool,\n commands: PropTypes.array,\n placeholder: PropTypes.string\n };\n ReactAce.defaultProps = {\n name: \"ace-editor\",\n focus: false,\n mode: \"\",\n theme: \"\",\n height: \"500px\",\n width: \"500px\",\n fontSize: 12,\n enableSnippets: false,\n showGutter: true,\n onChange: null,\n onPaste: null,\n onLoad: null,\n onScroll: null,\n minLines: null,\n maxLines: null,\n readOnly: false,\n highlightActiveLine: true,\n showPrintMargin: true,\n tabSize: 4,\n cursorStart: 1,\n editorProps: {},\n style: {},\n scrollMargin: [0, 0, 0, 0],\n setOptions: {},\n wrapEnabled: false,\n enableBasicAutocompletion: false,\n enableLiveAutocompletion: false,\n placeholder: null,\n navigateToFileEnd: true\n };\n return ReactAce;\n}(React.Component));\nexports.default = ReactAce;\n//# sourceMappingURL=ace.js.map","ace.define(\"ace/split\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/lang\",\"ace/lib/event_emitter\",\"ace/editor\",\"ace/virtual_renderer\",\"ace/edit_session\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar lang = require(\"./lib/lang\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar Editor = require(\"./editor\").Editor;\nvar Renderer = require(\"./virtual_renderer\").VirtualRenderer;\nvar EditSession = require(\"./edit_session\").EditSession;\nvar Split = function (container, theme, splits) {\n this.BELOW = 1;\n this.BESIDE = 0;\n this.$container = container;\n this.$theme = theme;\n this.$splits = 0;\n this.$editorCSS = \"\";\n this.$editors = [];\n this.$orientation = this.BESIDE;\n this.setSplits(splits || 1);\n this.$cEditor = this.$editors[0];\n this.on(\"focus\", function (editor) {\n this.$cEditor = editor;\n }.bind(this));\n};\n(function () {\n oop.implement(this, EventEmitter);\n this.$createEditor = function () {\n var el = document.createElement(\"div\");\n el.className = this.$editorCSS;\n el.style.cssText = \"position: absolute; top:0px; bottom:0px\";\n this.$container.appendChild(el);\n var editor = new Editor(new Renderer(el, this.$theme));\n editor.on(\"focus\", function () {\n this._emit(\"focus\", editor);\n }.bind(this));\n this.$editors.push(editor);\n editor.setFontSize(this.$fontSize);\n return editor;\n };\n this.setSplits = function (splits) {\n var editor;\n if (splits < 1) {\n throw \"The number of splits have to be > 0!\";\n }\n if (splits == this.$splits) {\n return;\n }\n else if (splits > this.$splits) {\n while (this.$splits < this.$editors.length && this.$splits < splits) {\n editor = this.$editors[this.$splits];\n this.$container.appendChild(editor.container);\n editor.setFontSize(this.$fontSize);\n this.$splits++;\n }\n while (this.$splits < splits) {\n this.$createEditor();\n this.$splits++;\n }\n }\n else {\n while (this.$splits > splits) {\n editor = this.$editors[this.$splits - 1];\n this.$container.removeChild(editor.container);\n this.$splits--;\n }\n }\n this.resize();\n };\n this.getSplits = function () {\n return this.$splits;\n };\n this.getEditor = function (idx) {\n return this.$editors[idx];\n };\n this.getCurrentEditor = function () {\n return this.$cEditor;\n };\n this.focus = function () {\n this.$cEditor.focus();\n };\n this.blur = function () {\n this.$cEditor.blur();\n };\n this.setTheme = function (theme) {\n this.$editors.forEach(function (editor) {\n editor.setTheme(theme);\n });\n };\n this.setKeyboardHandler = function (keybinding) {\n this.$editors.forEach(function (editor) {\n editor.setKeyboardHandler(keybinding);\n });\n };\n this.forEach = function (callback, scope) {\n this.$editors.forEach(callback, scope);\n };\n this.$fontSize = \"\";\n this.setFontSize = function (size) {\n this.$fontSize = size;\n this.forEach(function (editor) {\n editor.setFontSize(size);\n });\n };\n this.$cloneSession = function (session) {\n var s = new EditSession(session.getDocument(), session.getMode());\n var undoManager = session.getUndoManager();\n s.setUndoManager(undoManager);\n s.setTabSize(session.getTabSize());\n s.setUseSoftTabs(session.getUseSoftTabs());\n s.setOverwrite(session.getOverwrite());\n s.setBreakpoints(session.getBreakpoints());\n s.setUseWrapMode(session.getUseWrapMode());\n s.setUseWorker(session.getUseWorker());\n s.setWrapLimitRange(session.$wrapLimitRange.min, session.$wrapLimitRange.max);\n s.$foldData = session.$cloneFoldData();\n return s;\n };\n this.setSession = function (session, idx) {\n var editor;\n if (idx == null) {\n editor = this.$cEditor;\n }\n else {\n editor = this.$editors[idx];\n }\n var isUsed = this.$editors.some(function (editor) {\n return editor.session === session;\n });\n if (isUsed) {\n session = this.$cloneSession(session);\n }\n editor.setSession(session);\n return session;\n };\n this.getOrientation = function () {\n return this.$orientation;\n };\n this.setOrientation = function (orientation) {\n if (this.$orientation == orientation) {\n return;\n }\n this.$orientation = orientation;\n this.resize();\n };\n this.resize = function () {\n var width = this.$container.clientWidth;\n var height = this.$container.clientHeight;\n var editor;\n if (this.$orientation == this.BESIDE) {\n var editorWidth = width / this.$splits;\n for (var i = 0; i < this.$splits; i++) {\n editor = this.$editors[i];\n editor.container.style.width = editorWidth + \"px\";\n editor.container.style.top = \"0px\";\n editor.container.style.left = i * editorWidth + \"px\";\n editor.container.style.height = height + \"px\";\n editor.resize();\n }\n }\n else {\n var editorHeight = height / this.$splits;\n for (var i = 0; i < this.$splits; i++) {\n editor = this.$editors[i];\n editor.container.style.width = width + \"px\";\n editor.container.style.top = i * editorHeight + \"px\";\n editor.container.style.left = \"0px\";\n editor.container.style.height = editorHeight + \"px\";\n editor.resize();\n }\n }\n };\n}).call(Split.prototype);\nexports.Split = Split;\n\n});\n\nace.define(\"ace/ext/split\",[\"require\",\"exports\",\"module\",\"ace/split\"], function(require, exports, module){\"use strict\";\nmodule.exports = require(\"../split\");\n\n}); (function() {\n ace.require([\"ace/ext/split\"], function(m) {\n if (typeof module == \"object\" && typeof exports == \"object\" && module) {\n module.exports = m;\n }\n });\n })();\n ","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n symbolTag = '[object Symbol]';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n reLeadingDot = /^\\./,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n splice = arrayProto.splice;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = isKey(path, object) ? [path] : castPath(path);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n return isArray(value) ? value : stringToPath(value);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoize(function(string) {\n string = toString(string);\n\n var result = [];\n if (reLeadingDot.test(string)) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result);\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar editorOptions_1 = require(\"./editorOptions\");\nvar ace = (0, editorOptions_1.getAceInstance)();\nvar ace_builds_1 = require(\"ace-builds\");\nvar ext_split_1 = require(\"ace-builds/src-noconflict/ext-split\");\nvar PropTypes = require(\"prop-types\");\nvar React = require(\"react\");\nvar isEqual = require(\"lodash.isequal\");\nvar get = require(\"lodash.get\");\nvar SplitComponent = /** @class */ (function (_super) {\n __extends(SplitComponent, _super);\n function SplitComponent(props) {\n var _this = _super.call(this, props) || this;\n editorOptions_1.editorEvents.forEach(function (method) {\n _this[method] = _this[method].bind(_this);\n });\n _this.debounce = editorOptions_1.debounce;\n return _this;\n }\n SplitComponent.prototype.isInShadow = function (node) {\n var parent = node && node.parentNode;\n while (parent) {\n if (parent.toString() === \"[object ShadowRoot]\") {\n return true;\n }\n parent = parent.parentNode;\n }\n return false;\n };\n SplitComponent.prototype.componentDidMount = function () {\n var _this = this;\n var _a = this.props, className = _a.className, onBeforeLoad = _a.onBeforeLoad, mode = _a.mode, focus = _a.focus, theme = _a.theme, fontSize = _a.fontSize, value = _a.value, defaultValue = _a.defaultValue, cursorStart = _a.cursorStart, showGutter = _a.showGutter, wrapEnabled = _a.wrapEnabled, showPrintMargin = _a.showPrintMargin, _b = _a.scrollMargin, scrollMargin = _b === void 0 ? [0, 0, 0, 0] : _b, keyboardHandler = _a.keyboardHandler, onLoad = _a.onLoad, commands = _a.commands, annotations = _a.annotations, markers = _a.markers, splits = _a.splits;\n this.editor = ace.edit(this.refEditor);\n if (this.isInShadow(this.refEditor)) {\n this.editor.renderer.attachToShadowRoot();\n }\n this.editor.setTheme(\"ace/theme/\".concat(theme));\n if (onBeforeLoad) {\n onBeforeLoad(ace);\n }\n var editorProps = Object.keys(this.props.editorProps);\n var split = new ext_split_1.Split(this.editor.container, \"ace/theme/\".concat(theme), splits);\n this.editor.env.split = split;\n this.splitEditor = split.getEditor(0);\n this.split = split;\n // in a split scenario we don't want a print margin for the entire application\n this.editor.setShowPrintMargin(false);\n this.editor.renderer.setShowGutter(false);\n // get a list of possible options to avoid 'misspelled option errors'\n var availableOptions = this.splitEditor.$options;\n if (this.props.debounceChangePeriod) {\n this.onChange = this.debounce(this.onChange, this.props.debounceChangePeriod);\n }\n split.forEach(function (editor, index) {\n for (var i = 0; i < editorProps.length; i++) {\n editor[editorProps[i]] = _this.props.editorProps[editorProps[i]];\n }\n var defaultValueForEditor = get(defaultValue, index);\n var valueForEditor = get(value, index, \"\");\n editor.session.setUndoManager(new ace.UndoManager());\n editor.setTheme(\"ace/theme/\".concat(theme));\n editor.renderer.setScrollMargin(scrollMargin[0], scrollMargin[1], scrollMargin[2], scrollMargin[3]);\n editor.getSession().setMode(\"ace/mode/\".concat(mode));\n editor.setFontSize(fontSize);\n editor.renderer.setShowGutter(showGutter);\n editor.getSession().setUseWrapMode(wrapEnabled);\n editor.setShowPrintMargin(showPrintMargin);\n editor.on(\"focus\", _this.onFocus);\n editor.on(\"blur\", _this.onBlur);\n editor.on(\"input\", _this.onInput);\n editor.on(\"copy\", _this.onCopy);\n editor.on(\"paste\", _this.onPaste);\n editor.on(\"change\", _this.onChange);\n editor\n .getSession()\n .selection.on(\"changeSelection\", _this.onSelectionChange);\n editor.getSession().selection.on(\"changeCursor\", _this.onCursorChange);\n editor.session.on(\"changeScrollTop\", _this.onScroll);\n editor.setValue(defaultValueForEditor === undefined\n ? valueForEditor\n : defaultValueForEditor, cursorStart);\n var newAnnotations = get(annotations, index, []);\n var newMarkers = get(markers, index, []);\n editor.getSession().setAnnotations(newAnnotations);\n if (newMarkers && newMarkers.length > 0) {\n _this.handleMarkers(newMarkers, editor);\n }\n for (var i = 0; i < editorOptions_1.editorOptions.length; i++) {\n var option = editorOptions_1.editorOptions[i];\n if (availableOptions.hasOwnProperty(option)) {\n editor.setOption(option, _this.props[option]);\n }\n else if (_this.props[option]) {\n console.warn(\"ReaceAce: editor option \".concat(option, \" was activated but not found. Did you need to import a related tool or did you possibly mispell the option?\"));\n }\n }\n _this.handleOptions(_this.props, editor);\n if (Array.isArray(commands)) {\n commands.forEach(function (command) {\n if (typeof command.exec === \"string\") {\n editor.commands.bindKey(command.bindKey, command.exec);\n }\n else {\n editor.commands.addCommand(command);\n }\n });\n }\n if (keyboardHandler) {\n editor.setKeyboardHandler(\"ace/keyboard/\" + keyboardHandler);\n }\n });\n if (className) {\n this.refEditor.className += \" \" + className;\n }\n if (focus) {\n this.splitEditor.focus();\n }\n var sp = this.editor.env.split;\n sp.setOrientation(this.props.orientation === \"below\" ? sp.BELOW : sp.BESIDE);\n sp.resize(true);\n if (onLoad) {\n onLoad(sp);\n }\n };\n SplitComponent.prototype.componentDidUpdate = function (prevProps) {\n var _this = this;\n var oldProps = prevProps;\n var nextProps = this.props;\n var split = this.editor.env.split;\n if (nextProps.splits !== oldProps.splits) {\n split.setSplits(nextProps.splits);\n }\n if (nextProps.orientation !== oldProps.orientation) {\n split.setOrientation(nextProps.orientation === \"below\" ? split.BELOW : split.BESIDE);\n }\n split.forEach(function (editor, index) {\n if (nextProps.mode !== oldProps.mode) {\n editor.getSession().setMode(\"ace/mode/\" + nextProps.mode);\n }\n if (nextProps.keyboardHandler !== oldProps.keyboardHandler) {\n if (nextProps.keyboardHandler) {\n editor.setKeyboardHandler(\"ace/keyboard/\" + nextProps.keyboardHandler);\n }\n else {\n editor.setKeyboardHandler(null);\n }\n }\n if (nextProps.fontSize !== oldProps.fontSize) {\n editor.setFontSize(nextProps.fontSize);\n }\n if (nextProps.wrapEnabled !== oldProps.wrapEnabled) {\n editor.getSession().setUseWrapMode(nextProps.wrapEnabled);\n }\n if (nextProps.showPrintMargin !== oldProps.showPrintMargin) {\n editor.setShowPrintMargin(nextProps.showPrintMargin);\n }\n if (nextProps.showGutter !== oldProps.showGutter) {\n editor.renderer.setShowGutter(nextProps.showGutter);\n }\n for (var i = 0; i < editorOptions_1.editorOptions.length; i++) {\n var option = editorOptions_1.editorOptions[i];\n if (nextProps[option] !== oldProps[option]) {\n editor.setOption(option, nextProps[option]);\n }\n }\n if (!isEqual(nextProps.setOptions, oldProps.setOptions)) {\n _this.handleOptions(nextProps, editor);\n }\n var nextValue = get(nextProps.value, index, \"\");\n if (editor.getValue() !== nextValue) {\n // editor.setValue is a synchronous function call, change event is emitted before setValue return.\n _this.silent = true;\n var pos = editor.session.selection.toJSON();\n editor.setValue(nextValue, nextProps.cursorStart);\n editor.session.selection.fromJSON(pos);\n _this.silent = false;\n }\n var newAnnotations = get(nextProps.annotations, index, []);\n var oldAnnotations = get(oldProps.annotations, index, []);\n if (!isEqual(newAnnotations, oldAnnotations)) {\n editor.getSession().setAnnotations(newAnnotations);\n }\n var newMarkers = get(nextProps.markers, index, []);\n var oldMarkers = get(oldProps.markers, index, []);\n if (!isEqual(newMarkers, oldMarkers) && Array.isArray(newMarkers)) {\n _this.handleMarkers(newMarkers, editor);\n }\n });\n if (nextProps.className !== oldProps.className) {\n var appliedClasses = this.refEditor.className;\n var appliedClassesArray_1 = appliedClasses.trim().split(\" \");\n var oldClassesArray = oldProps.className.trim().split(\" \");\n oldClassesArray.forEach(function (oldClass) {\n var index = appliedClassesArray_1.indexOf(oldClass);\n appliedClassesArray_1.splice(index, 1);\n });\n this.refEditor.className =\n \" \" + nextProps.className + \" \" + appliedClassesArray_1.join(\" \");\n }\n if (nextProps.theme !== oldProps.theme) {\n split.setTheme(\"ace/theme/\" + nextProps.theme);\n }\n if (nextProps.focus && !oldProps.focus) {\n this.splitEditor.focus();\n }\n if (nextProps.height !== this.props.height ||\n nextProps.width !== this.props.width) {\n this.editor.resize();\n }\n };\n SplitComponent.prototype.componentWillUnmount = function () {\n this.editor.destroy();\n this.editor = null;\n };\n SplitComponent.prototype.onChange = function (event) {\n if (this.props.onChange && !this.silent) {\n var value_1 = [];\n this.editor.env.split.forEach(function (editor) {\n value_1.push(editor.getValue());\n });\n this.props.onChange(value_1, event);\n }\n };\n SplitComponent.prototype.onSelectionChange = function (event) {\n if (this.props.onSelectionChange) {\n var value_2 = [];\n this.editor.env.split.forEach(function (editor) {\n value_2.push(editor.getSelection());\n });\n this.props.onSelectionChange(value_2, event);\n }\n };\n SplitComponent.prototype.onCursorChange = function (event) {\n if (this.props.onCursorChange) {\n var value_3 = [];\n this.editor.env.split.forEach(function (editor) {\n value_3.push(editor.getSelection());\n });\n this.props.onCursorChange(value_3, event);\n }\n };\n SplitComponent.prototype.onFocus = function (event) {\n if (this.props.onFocus) {\n this.props.onFocus(event);\n }\n };\n SplitComponent.prototype.onInput = function (event) {\n if (this.props.onInput) {\n this.props.onInput(event);\n }\n };\n SplitComponent.prototype.onBlur = function (event) {\n if (this.props.onBlur) {\n this.props.onBlur(event);\n }\n };\n SplitComponent.prototype.onCopy = function (text) {\n if (this.props.onCopy) {\n this.props.onCopy(text);\n }\n };\n SplitComponent.prototype.onPaste = function (text) {\n if (this.props.onPaste) {\n this.props.onPaste(text);\n }\n };\n SplitComponent.prototype.onScroll = function () {\n if (this.props.onScroll) {\n this.props.onScroll(this.editor);\n }\n };\n SplitComponent.prototype.handleOptions = function (props, editor) {\n var setOptions = Object.keys(props.setOptions);\n for (var y = 0; y < setOptions.length; y++) {\n editor.setOption(setOptions[y], props.setOptions[setOptions[y]]);\n }\n };\n SplitComponent.prototype.handleMarkers = function (markers, editor) {\n // remove foreground markers\n var currentMarkers = editor.getSession().getMarkers(true);\n for (var i in currentMarkers) {\n if (currentMarkers.hasOwnProperty(i)) {\n editor.getSession().removeMarker(currentMarkers[i].id);\n }\n }\n // remove background markers\n currentMarkers = editor.getSession().getMarkers(false);\n for (var i in currentMarkers) {\n if (currentMarkers.hasOwnProperty(i)) {\n editor.getSession().removeMarker(currentMarkers[i].id);\n }\n }\n // add new markers\n markers.forEach(function (_a) {\n var startRow = _a.startRow, startCol = _a.startCol, endRow = _a.endRow, endCol = _a.endCol, className = _a.className, type = _a.type, _b = _a.inFront, inFront = _b === void 0 ? false : _b;\n var range = new ace_builds_1.Range(startRow, startCol, endRow, endCol);\n editor\n .getSession()\n .addMarker(range, className, type, inFront);\n });\n };\n SplitComponent.prototype.updateRef = function (item) {\n this.refEditor = item;\n };\n SplitComponent.prototype.render = function () {\n var _a = this.props, name = _a.name, width = _a.width, height = _a.height, style = _a.style;\n var divStyle = __assign({ width: width, height: height }, style);\n return React.createElement(\"div\", { ref: this.updateRef, id: name, style: divStyle });\n };\n SplitComponent.propTypes = {\n className: PropTypes.string,\n debounceChangePeriod: PropTypes.number,\n defaultValue: PropTypes.arrayOf(PropTypes.string),\n focus: PropTypes.bool,\n fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n height: PropTypes.string,\n mode: PropTypes.string,\n name: PropTypes.string,\n onBlur: PropTypes.func,\n onChange: PropTypes.func,\n onCopy: PropTypes.func,\n onFocus: PropTypes.func,\n onInput: PropTypes.func,\n onLoad: PropTypes.func,\n onPaste: PropTypes.func,\n onScroll: PropTypes.func,\n orientation: PropTypes.string,\n showGutter: PropTypes.bool,\n splits: PropTypes.number,\n theme: PropTypes.string,\n value: PropTypes.arrayOf(PropTypes.string),\n width: PropTypes.string,\n onSelectionChange: PropTypes.func,\n onCursorChange: PropTypes.func,\n onBeforeLoad: PropTypes.func,\n minLines: PropTypes.number,\n maxLines: PropTypes.number,\n readOnly: PropTypes.bool,\n highlightActiveLine: PropTypes.bool,\n tabSize: PropTypes.number,\n showPrintMargin: PropTypes.bool,\n cursorStart: PropTypes.number,\n editorProps: PropTypes.object,\n setOptions: PropTypes.object,\n style: PropTypes.object,\n scrollMargin: PropTypes.array,\n annotations: PropTypes.array,\n markers: PropTypes.array,\n keyboardHandler: PropTypes.string,\n wrapEnabled: PropTypes.bool,\n enableBasicAutocompletion: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.array\n ]),\n enableLiveAutocompletion: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.array\n ]),\n commands: PropTypes.array\n };\n SplitComponent.defaultProps = {\n name: \"ace-editor\",\n focus: false,\n orientation: \"beside\",\n splits: 2,\n mode: \"\",\n theme: \"\",\n height: \"500px\",\n width: \"500px\",\n value: [],\n fontSize: 12,\n showGutter: true,\n onChange: null,\n onPaste: null,\n onLoad: null,\n onScroll: null,\n minLines: null,\n maxLines: null,\n readOnly: false,\n highlightActiveLine: true,\n showPrintMargin: true,\n tabSize: 4,\n cursorStart: 1,\n editorProps: {},\n style: {},\n scrollMargin: [0, 0, 0, 0],\n setOptions: {},\n wrapEnabled: false,\n enableBasicAutocompletion: false,\n enableLiveAutocompletion: false\n };\n return SplitComponent;\n}(React.Component));\nexports.default = SplitComponent;\n//# sourceMappingURL=split.js.map","/**\n * Diff Match and Patch\n * Copyright 2018 The diff-match-patch Authors.\n * https://github.com/google/diff-match-patch\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Computes the difference between two texts to create a patch.\n * Applies the patch onto another text, allowing for errors.\n * @author fraser@google.com (Neil Fraser)\n */\n\n/**\n * Class containing the diff, match and patch methods.\n * @constructor\n */\nvar diff_match_patch = function() {\n\n // Defaults.\n // Redefine these in your program to override the defaults.\n\n // Number of seconds to map a diff before giving up (0 for infinity).\n this.Diff_Timeout = 1.0;\n // Cost of an empty edit operation in terms of edit characters.\n this.Diff_EditCost = 4;\n // At what point is no match declared (0.0 = perfection, 1.0 = very loose).\n this.Match_Threshold = 0.5;\n // How far to search for a match (0 = exact location, 1000+ = broad match).\n // A match this many characters away from the expected location will add\n // 1.0 to the score (0.0 is a perfect match).\n this.Match_Distance = 1000;\n // When deleting a large block of text (over ~64 characters), how close do\n // the contents have to be to match the expected contents. (0.0 = perfection,\n // 1.0 = very loose). Note that Match_Threshold controls how closely the\n // end points of a delete need to match.\n this.Patch_DeleteThreshold = 0.5;\n // Chunk size for context length.\n this.Patch_Margin = 4;\n\n // The number of bits in an int.\n this.Match_MaxBits = 32;\n};\n\n\n// DIFF FUNCTIONS\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n/**\n * Class representing one diff tuple.\n * ~Attempts to look like a two-element array (which is what this used to be).~\n * Constructor returns an actual two-element array, to allow destructing @JackuB\n * See https://github.com/JackuB/diff-match-patch/issues/14 for details\n * @param {number} op Operation, one of: DIFF_DELETE, DIFF_INSERT, DIFF_EQUAL.\n * @param {string} text Text to be deleted, inserted, or retained.\n * @constructor\n */\ndiff_match_patch.Diff = function(op, text) {\n return [op, text];\n};\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {boolean=} opt_checklines Optional speedup flag. If present and false,\n * then don't run a line-level diff first to identify the changed areas.\n * Defaults to true, which does a faster, slightly less optimal diff.\n * @param {number=} opt_deadline Optional time when the diff should be complete\n * by. Used internally for recursive calls. Users should set DiffTimeout\n * instead.\n * @return {!Array.} Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_main = function(text1, text2, opt_checklines,\n opt_deadline) {\n // Set a deadline by which time the diff must be complete.\n if (typeof opt_deadline == 'undefined') {\n if (this.Diff_Timeout <= 0) {\n opt_deadline = Number.MAX_VALUE;\n } else {\n opt_deadline = (new Date).getTime() + this.Diff_Timeout * 1000;\n }\n }\n var deadline = opt_deadline;\n\n // Check for null inputs.\n if (text1 == null || text2 == null) {\n throw new Error('Null input. (diff_main)');\n }\n\n // Check for equality (speedup).\n if (text1 == text2) {\n if (text1) {\n return [new diff_match_patch.Diff(DIFF_EQUAL, text1)];\n }\n return [];\n }\n\n if (typeof opt_checklines == 'undefined') {\n opt_checklines = true;\n }\n var checklines = opt_checklines;\n\n // Trim off common prefix (speedup).\n var commonlength = this.diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = this.diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = this.diff_compute_(text1, text2, checklines, deadline);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift(new diff_match_patch.Diff(DIFF_EQUAL, commonprefix));\n }\n if (commonsuffix) {\n diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, commonsuffix));\n }\n this.diff_cleanupMerge(diffs);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {boolean} checklines Speedup flag. If false, then don't run a\n * line-level diff first to identify the changed areas.\n * If true, then run a faster, slightly less optimal diff.\n * @param {number} deadline Time when the diff should be complete by.\n * @return {!Array.} Array of diff tuples.\n * @private\n */\ndiff_match_patch.prototype.diff_compute_ = function(text1, text2, checklines,\n deadline) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [new diff_match_patch.Diff(DIFF_INSERT, text2)];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [new diff_match_patch.Diff(DIFF_DELETE, text1)];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i != -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [new diff_match_patch.Diff(DIFF_INSERT, longtext.substring(0, i)),\n new diff_match_patch.Diff(DIFF_EQUAL, shorttext),\n new diff_match_patch.Diff(DIFF_INSERT,\n longtext.substring(i + shorttext.length))];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length == 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [new diff_match_patch.Diff(DIFF_DELETE, text1),\n new diff_match_patch.Diff(DIFF_INSERT, text2)];\n }\n\n // Check to see if the problem can be split in two.\n var hm = this.diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = this.diff_main(text1_a, text2_a, checklines, deadline);\n var diffs_b = this.diff_main(text1_b, text2_b, checklines, deadline);\n // Merge the results.\n return diffs_a.concat([new diff_match_patch.Diff(DIFF_EQUAL, mid_common)],\n diffs_b);\n }\n\n if (checklines && text1.length > 100 && text2.length > 100) {\n return this.diff_lineMode_(text1, text2, deadline);\n }\n\n return this.diff_bisect_(text1, text2, deadline);\n};\n\n\n/**\n * Do a quick line-level diff on both strings, then rediff the parts for\n * greater accuracy.\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} deadline Time when the diff should be complete by.\n * @return {!Array.} Array of diff tuples.\n * @private\n */\ndiff_match_patch.prototype.diff_lineMode_ = function(text1, text2, deadline) {\n // Scan the text on a line-by-line basis first.\n var a = this.diff_linesToChars_(text1, text2);\n text1 = a.chars1;\n text2 = a.chars2;\n var linearray = a.lineArray;\n\n var diffs = this.diff_main(text1, text2, false, deadline);\n\n // Convert the diff back to original text.\n this.diff_charsToLines_(diffs, linearray);\n // Eliminate freak matches (e.g. blank lines)\n this.diff_cleanupSemantic(diffs);\n\n // Rediff any replacement blocks, this time character-by-character.\n // Add a dummy entry at the end.\n diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, ''));\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete >= 1 && count_insert >= 1) {\n // Delete the offending records and add the merged ones.\n diffs.splice(pointer - count_delete - count_insert,\n count_delete + count_insert);\n pointer = pointer - count_delete - count_insert;\n var subDiff =\n this.diff_main(text_delete, text_insert, false, deadline);\n for (var j = subDiff.length - 1; j >= 0; j--) {\n diffs.splice(pointer, 0, subDiff[j]);\n }\n pointer = pointer + subDiff.length;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n pointer++;\n }\n diffs.pop(); // Remove the dummy entry at the end.\n\n return diffs;\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} deadline Time at which to bail if not yet complete.\n * @return {!Array.} Array of diff tuples.\n * @private\n */\ndiff_match_patch.prototype.diff_bisect_ = function(text1, text2, deadline) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 != 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Bail out if deadline is reached.\n if ((new Date()).getTime() > deadline) {\n break;\n }\n\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) == text2.charAt(y1)) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ==\n text2.charAt(text2_length - y2 - 1)) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [new diff_match_patch.Diff(DIFF_DELETE, text1),\n new diff_match_patch.Diff(DIFF_INSERT, text2)];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @param {number} deadline Time at which to bail if not yet complete.\n * @return {!Array.} Array of diff tuples.\n * @private\n */\ndiff_match_patch.prototype.diff_bisectSplit_ = function(text1, text2, x, y,\n deadline) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = this.diff_main(text1a, text2a, false, deadline);\n var diffsb = this.diff_main(text1b, text2b, false, deadline);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Split two texts into an array of strings. Reduce the texts to a string of\n * hashes where each Unicode character represents one line.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {{chars1: string, chars2: string, lineArray: !Array.}}\n * An object containing the encoded text1, the encoded text2 and\n * the array of unique strings.\n * The zeroth element of the array of unique strings is intentionally blank.\n * @private\n */\ndiff_match_patch.prototype.diff_linesToChars_ = function(text1, text2) {\n var lineArray = []; // e.g. lineArray[4] == 'Hello\\n'\n var lineHash = {}; // e.g. lineHash['Hello\\n'] == 4\n\n // '\\x00' is a valid character, but various debuggers don't like it.\n // So we'll insert a junk entry to avoid generating a null character.\n lineArray[0] = '';\n\n /**\n * Split a text into an array of strings. Reduce the texts to a string of\n * hashes where each Unicode character represents one line.\n * Modifies linearray and linehash through being a closure.\n * @param {string} text String to encode.\n * @return {string} Encoded string.\n * @private\n */\n function diff_linesToCharsMunge_(text) {\n var chars = '';\n // Walk the text, pulling out a substring for each line.\n // text.split('\\n') would would temporarily double our memory footprint.\n // Modifying text would create many large strings to garbage collect.\n var lineStart = 0;\n var lineEnd = -1;\n // Keeping our own length variable is faster than looking it up.\n var lineArrayLength = lineArray.length;\n while (lineEnd < text.length - 1) {\n lineEnd = text.indexOf('\\n', lineStart);\n if (lineEnd == -1) {\n lineEnd = text.length - 1;\n }\n var line = text.substring(lineStart, lineEnd + 1);\n\n if (lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) :\n (lineHash[line] !== undefined)) {\n chars += String.fromCharCode(lineHash[line]);\n } else {\n if (lineArrayLength == maxLines) {\n // Bail out at 65535 because\n // String.fromCharCode(65536) == String.fromCharCode(0)\n line = text.substring(lineStart);\n lineEnd = text.length;\n }\n chars += String.fromCharCode(lineArrayLength);\n lineHash[line] = lineArrayLength;\n lineArray[lineArrayLength++] = line;\n }\n lineStart = lineEnd + 1;\n }\n return chars;\n }\n // Allocate 2/3rds of the space for text1, the rest for text2.\n var maxLines = 40000;\n var chars1 = diff_linesToCharsMunge_(text1);\n maxLines = 65535;\n var chars2 = diff_linesToCharsMunge_(text2);\n return {chars1: chars1, chars2: chars2, lineArray: lineArray};\n};\n\n\n/**\n * Rehydrate the text in a diff from a string of line hashes to real lines of\n * text.\n * @param {!Array.} diffs Array of diff tuples.\n * @param {!Array.} lineArray Array of unique strings.\n * @private\n */\ndiff_match_patch.prototype.diff_charsToLines_ = function(diffs, lineArray) {\n for (var i = 0; i < diffs.length; i++) {\n var chars = diffs[i][1];\n var text = [];\n for (var j = 0; j < chars.length; j++) {\n text[j] = lineArray[chars.charCodeAt(j)];\n }\n diffs[i][1] = text.join('');\n }\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\ndiff_match_patch.prototype.diff_commonPrefix = function(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: https://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\ndiff_match_patch.prototype.diff_commonSuffix = function(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 ||\n text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: https://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine if the suffix of one string is the prefix of another.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of the first\n * string and the start of the second string.\n * @private\n */\ndiff_match_patch.prototype.diff_commonOverlap_ = function(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n // Eliminate the null case.\n if (text1_length == 0 || text2_length == 0) {\n return 0;\n }\n // Truncate the longer string.\n if (text1_length > text2_length) {\n text1 = text1.substring(text1_length - text2_length);\n } else if (text1_length < text2_length) {\n text2 = text2.substring(0, text1_length);\n }\n var text_length = Math.min(text1_length, text2_length);\n // Quick check for the worst case.\n if (text1 == text2) {\n return text_length;\n }\n\n // Start by looking for a single character match\n // and increase length until no match is found.\n // Performance analysis: https://neil.fraser.name/news/2010/11/04/\n var best = 0;\n var length = 1;\n while (true) {\n var pattern = text1.substring(text_length - length);\n var found = text2.indexOf(pattern);\n if (found == -1) {\n return best;\n }\n length += found;\n if (found == 0 || text1.substring(text_length - length) ==\n text2.substring(0, length)) {\n best = length;\n length++;\n }\n }\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n * @private\n */\ndiff_match_patch.prototype.diff_halfMatch_ = function(text1, text2) {\n if (this.Diff_Timeout <= 0) {\n // Don't risk returning a non-optimal diff if we have unlimited time.\n return null;\n }\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n var dmp = this; // 'this' becomes 'window' in a closure.\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) != -1) {\n var prefixLength = dmp.diff_commonPrefix(longtext.substring(i),\n shorttext.substring(j));\n var suffixLength = dmp.diff_commonSuffix(longtext.substring(0, i),\n shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reduce the number of edits by eliminating semantically trivial equalities.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupSemantic = function(diffs) {\n var changes = false;\n var equalities = []; // Stack of indices where equalities are found.\n var equalitiesLength = 0; // Keeping our own length var is faster in JS.\n /** @type {?string} */\n var lastEquality = null;\n // Always equal to diffs[equalities[equalitiesLength - 1]][1]\n var pointer = 0; // Index of current position.\n // Number of characters that changed prior to the equality.\n var length_insertions1 = 0;\n var length_deletions1 = 0;\n // Number of characters that changed after the equality.\n var length_insertions2 = 0;\n var length_deletions2 = 0;\n while (pointer < diffs.length) {\n if (diffs[pointer][0] == DIFF_EQUAL) { // Equality found.\n equalities[equalitiesLength++] = pointer;\n length_insertions1 = length_insertions2;\n length_deletions1 = length_deletions2;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastEquality = diffs[pointer][1];\n } else { // An insertion or deletion.\n if (diffs[pointer][0] == DIFF_INSERT) {\n length_insertions2 += diffs[pointer][1].length;\n } else {\n length_deletions2 += diffs[pointer][1].length;\n }\n // Eliminate an equality that is smaller or equal to the edits on both\n // sides of it.\n if (lastEquality && (lastEquality.length <=\n Math.max(length_insertions1, length_deletions1)) &&\n (lastEquality.length <= Math.max(length_insertions2,\n length_deletions2))) {\n // Duplicate record.\n diffs.splice(equalities[equalitiesLength - 1], 0,\n new diff_match_patch.Diff(DIFF_DELETE, lastEquality));\n // Change second copy to insert.\n diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;\n // Throw away the equality we just deleted.\n equalitiesLength--;\n // Throw away the previous equality (it needs to be reevaluated).\n equalitiesLength--;\n pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;\n length_insertions1 = 0; // Reset the counters.\n length_deletions1 = 0;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastEquality = null;\n changes = true;\n }\n }\n pointer++;\n }\n\n // Normalize the diff.\n if (changes) {\n this.diff_cleanupMerge(diffs);\n }\n this.diff_cleanupSemanticLossless(diffs);\n\n // Find any overlaps between deletions and insertions.\n // e.g: abcxxxxxxdef\n // -> abcxxxdef\n // e.g: xxxabcdefxxx\n // -> defxxxabc\n // Only extract an overlap if it is as big as the edit ahead or behind it.\n pointer = 1;\n while (pointer < diffs.length) {\n if (diffs[pointer - 1][0] == DIFF_DELETE &&\n diffs[pointer][0] == DIFF_INSERT) {\n var deletion = diffs[pointer - 1][1];\n var insertion = diffs[pointer][1];\n var overlap_length1 = this.diff_commonOverlap_(deletion, insertion);\n var overlap_length2 = this.diff_commonOverlap_(insertion, deletion);\n if (overlap_length1 >= overlap_length2) {\n if (overlap_length1 >= deletion.length / 2 ||\n overlap_length1 >= insertion.length / 2) {\n // Overlap found. Insert an equality and trim the surrounding edits.\n diffs.splice(pointer, 0, new diff_match_patch.Diff(DIFF_EQUAL,\n insertion.substring(0, overlap_length1)));\n diffs[pointer - 1][1] =\n deletion.substring(0, deletion.length - overlap_length1);\n diffs[pointer + 1][1] = insertion.substring(overlap_length1);\n pointer++;\n }\n } else {\n if (overlap_length2 >= deletion.length / 2 ||\n overlap_length2 >= insertion.length / 2) {\n // Reverse overlap found.\n // Insert an equality and swap and trim the surrounding edits.\n diffs.splice(pointer, 0, new diff_match_patch.Diff(DIFF_EQUAL,\n deletion.substring(0, overlap_length2)));\n diffs[pointer - 1][0] = DIFF_INSERT;\n diffs[pointer - 1][1] =\n insertion.substring(0, insertion.length - overlap_length2);\n diffs[pointer + 1][0] = DIFF_DELETE;\n diffs[pointer + 1][1] =\n deletion.substring(overlap_length2);\n pointer++;\n }\n }\n pointer++;\n }\n pointer++;\n }\n};\n\n\n/**\n * Look for single edits surrounded on both sides by equalities\n * which can be shifted sideways to align the edit to a word boundary.\n * e.g: The cat came. -> The cat came.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupSemanticLossless = function(diffs) {\n /**\n * Given two strings, compute a score representing whether the internal\n * boundary falls on logical boundaries.\n * Scores range from 6 (best) to 0 (worst).\n * Closure, but does not reference any external variables.\n * @param {string} one First string.\n * @param {string} two Second string.\n * @return {number} The score.\n * @private\n */\n function diff_cleanupSemanticScore_(one, two) {\n if (!one || !two) {\n // Edges are the best.\n return 6;\n }\n\n // Each port of this function behaves slightly differently due to\n // subtle differences in each language's definition of things like\n // 'whitespace'. Since this function's purpose is largely cosmetic,\n // the choice has been made to use each language's native features\n // rather than force total conformity.\n var char1 = one.charAt(one.length - 1);\n var char2 = two.charAt(0);\n var nonAlphaNumeric1 = char1.match(diff_match_patch.nonAlphaNumericRegex_);\n var nonAlphaNumeric2 = char2.match(diff_match_patch.nonAlphaNumericRegex_);\n var whitespace1 = nonAlphaNumeric1 &&\n char1.match(diff_match_patch.whitespaceRegex_);\n var whitespace2 = nonAlphaNumeric2 &&\n char2.match(diff_match_patch.whitespaceRegex_);\n var lineBreak1 = whitespace1 &&\n char1.match(diff_match_patch.linebreakRegex_);\n var lineBreak2 = whitespace2 &&\n char2.match(diff_match_patch.linebreakRegex_);\n var blankLine1 = lineBreak1 &&\n one.match(diff_match_patch.blanklineEndRegex_);\n var blankLine2 = lineBreak2 &&\n two.match(diff_match_patch.blanklineStartRegex_);\n\n if (blankLine1 || blankLine2) {\n // Five points for blank lines.\n return 5;\n } else if (lineBreak1 || lineBreak2) {\n // Four points for line breaks.\n return 4;\n } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {\n // Three points for end of sentences.\n return 3;\n } else if (whitespace1 || whitespace2) {\n // Two points for whitespace.\n return 2;\n } else if (nonAlphaNumeric1 || nonAlphaNumeric2) {\n // One point for non-alphanumeric.\n return 1;\n }\n return 0;\n }\n\n var pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n var equality1 = diffs[pointer - 1][1];\n var edit = diffs[pointer][1];\n var equality2 = diffs[pointer + 1][1];\n\n // First, shift the edit as far left as possible.\n var commonOffset = this.diff_commonSuffix(equality1, edit);\n if (commonOffset) {\n var commonString = edit.substring(edit.length - commonOffset);\n equality1 = equality1.substring(0, equality1.length - commonOffset);\n edit = commonString + edit.substring(0, edit.length - commonOffset);\n equality2 = commonString + equality2;\n }\n\n // Second, step character by character right, looking for the best fit.\n var bestEquality1 = equality1;\n var bestEdit = edit;\n var bestEquality2 = equality2;\n var bestScore = diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n while (edit.charAt(0) === equality2.charAt(0)) {\n equality1 += edit.charAt(0);\n edit = edit.substring(1) + equality2.charAt(0);\n equality2 = equality2.substring(1);\n var score = diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n // The >= encourages trailing rather than leading whitespace on edits.\n if (score >= bestScore) {\n bestScore = score;\n bestEquality1 = equality1;\n bestEdit = edit;\n bestEquality2 = equality2;\n }\n }\n\n if (diffs[pointer - 1][1] != bestEquality1) {\n // We have an improvement, save it back to the diff.\n if (bestEquality1) {\n diffs[pointer - 1][1] = bestEquality1;\n } else {\n diffs.splice(pointer - 1, 1);\n pointer--;\n }\n diffs[pointer][1] = bestEdit;\n if (bestEquality2) {\n diffs[pointer + 1][1] = bestEquality2;\n } else {\n diffs.splice(pointer + 1, 1);\n pointer--;\n }\n }\n }\n pointer++;\n }\n};\n\n// Define some regex patterns for matching boundaries.\ndiff_match_patch.nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/;\ndiff_match_patch.whitespaceRegex_ = /\\s/;\ndiff_match_patch.linebreakRegex_ = /[\\r\\n]/;\ndiff_match_patch.blanklineEndRegex_ = /\\n\\r?\\n$/;\ndiff_match_patch.blanklineStartRegex_ = /^\\r?\\n\\r?\\n/;\n\n/**\n * Reduce the number of edits by eliminating operationally trivial equalities.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupEfficiency = function(diffs) {\n var changes = false;\n var equalities = []; // Stack of indices where equalities are found.\n var equalitiesLength = 0; // Keeping our own length var is faster in JS.\n /** @type {?string} */\n var lastEquality = null;\n // Always equal to diffs[equalities[equalitiesLength - 1]][1]\n var pointer = 0; // Index of current position.\n // Is there an insertion operation before the last equality.\n var pre_ins = false;\n // Is there a deletion operation before the last equality.\n var pre_del = false;\n // Is there an insertion operation after the last equality.\n var post_ins = false;\n // Is there a deletion operation after the last equality.\n var post_del = false;\n while (pointer < diffs.length) {\n if (diffs[pointer][0] == DIFF_EQUAL) { // Equality found.\n if (diffs[pointer][1].length < this.Diff_EditCost &&\n (post_ins || post_del)) {\n // Candidate found.\n equalities[equalitiesLength++] = pointer;\n pre_ins = post_ins;\n pre_del = post_del;\n lastEquality = diffs[pointer][1];\n } else {\n // Not a candidate, and can never become one.\n equalitiesLength = 0;\n lastEquality = null;\n }\n post_ins = post_del = false;\n } else { // An insertion or deletion.\n if (diffs[pointer][0] == DIFF_DELETE) {\n post_del = true;\n } else {\n post_ins = true;\n }\n /*\n * Five types to be split:\n * ABXYCD\n * AXCD\n * ABXC\n * AXCD\n * ABXC\n */\n if (lastEquality && ((pre_ins && pre_del && post_ins && post_del) ||\n ((lastEquality.length < this.Diff_EditCost / 2) &&\n (pre_ins + pre_del + post_ins + post_del) == 3))) {\n // Duplicate record.\n diffs.splice(equalities[equalitiesLength - 1], 0,\n new diff_match_patch.Diff(DIFF_DELETE, lastEquality));\n // Change second copy to insert.\n diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;\n equalitiesLength--; // Throw away the equality we just deleted;\n lastEquality = null;\n if (pre_ins && pre_del) {\n // No changes made which could affect previous entry, keep going.\n post_ins = post_del = true;\n equalitiesLength = 0;\n } else {\n equalitiesLength--; // Throw away the previous equality.\n pointer = equalitiesLength > 0 ?\n equalities[equalitiesLength - 1] : -1;\n post_ins = post_del = false;\n }\n changes = true;\n }\n }\n pointer++;\n }\n\n if (changes) {\n this.diff_cleanupMerge(diffs);\n }\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupMerge = function(diffs) {\n // Add a dummy entry at the end.\n diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, ''));\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete + count_insert > 1) {\n if (count_delete !== 0 && count_insert !== 0) {\n // Factor out any common prefixies.\n commonlength = this.diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if ((pointer - count_delete - count_insert) > 0 &&\n diffs[pointer - count_delete - count_insert - 1][0] ==\n DIFF_EQUAL) {\n diffs[pointer - count_delete - count_insert - 1][1] +=\n text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, new diff_match_patch.Diff(DIFF_EQUAL,\n text_insert.substring(0, commonlength)));\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixies.\n commonlength = this.diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] = text_insert.substring(text_insert.length -\n commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length -\n commonlength);\n text_delete = text_delete.substring(0, text_delete.length -\n commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n pointer -= count_delete + count_insert;\n diffs.splice(pointer, count_delete + count_insert);\n if (text_delete.length) {\n diffs.splice(pointer, 0,\n new diff_match_patch.Diff(DIFF_DELETE, text_delete));\n pointer++;\n }\n if (text_insert.length) {\n diffs.splice(pointer, 0,\n new diff_match_patch.Diff(DIFF_INSERT, text_insert));\n pointer++;\n }\n pointer++;\n } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n this.diff_cleanupMerge(diffs);\n }\n};\n\n\n/**\n * loc is a location in text1, compute and return the equivalent location in\n * text2.\n * e.g. 'The cat' vs 'The big cat', 1->1, 5->8\n * @param {!Array.} diffs Array of diff tuples.\n * @param {number} loc Location within text1.\n * @return {number} Location within text2.\n */\ndiff_match_patch.prototype.diff_xIndex = function(diffs, loc) {\n var chars1 = 0;\n var chars2 = 0;\n var last_chars1 = 0;\n var last_chars2 = 0;\n var x;\n for (x = 0; x < diffs.length; x++) {\n if (diffs[x][0] !== DIFF_INSERT) { // Equality or deletion.\n chars1 += diffs[x][1].length;\n }\n if (diffs[x][0] !== DIFF_DELETE) { // Equality or insertion.\n chars2 += diffs[x][1].length;\n }\n if (chars1 > loc) { // Overshot the location.\n break;\n }\n last_chars1 = chars1;\n last_chars2 = chars2;\n }\n // Was the location was deleted?\n if (diffs.length != x && diffs[x][0] === DIFF_DELETE) {\n return last_chars2;\n }\n // Add the remaining character length.\n return last_chars2 + (loc - last_chars1);\n};\n\n\n/**\n * Convert a diff array into a pretty HTML report.\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} HTML representation.\n */\ndiff_match_patch.prototype.diff_prettyHtml = function(diffs) {\n var html = [];\n var pattern_amp = /&/g;\n var pattern_lt = //g;\n var pattern_para = /\\n/g;\n for (var x = 0; x < diffs.length; x++) {\n var op = diffs[x][0]; // Operation (insert, delete, equal)\n var data = diffs[x][1]; // Text of change.\n var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<')\n .replace(pattern_gt, '>').replace(pattern_para, '¶
');\n switch (op) {\n case DIFF_INSERT:\n html[x] = '' + text + '';\n break;\n case DIFF_DELETE:\n html[x] = '' + text + '';\n break;\n case DIFF_EQUAL:\n html[x] = '' + text + '';\n break;\n }\n }\n return html.join('');\n};\n\n\n/**\n * Compute and return the source text (all equalities and deletions).\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} Source text.\n */\ndiff_match_patch.prototype.diff_text1 = function(diffs) {\n var text = [];\n for (var x = 0; x < diffs.length; x++) {\n if (diffs[x][0] !== DIFF_INSERT) {\n text[x] = diffs[x][1];\n }\n }\n return text.join('');\n};\n\n\n/**\n * Compute and return the destination text (all equalities and insertions).\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} Destination text.\n */\ndiff_match_patch.prototype.diff_text2 = function(diffs) {\n var text = [];\n for (var x = 0; x < diffs.length; x++) {\n if (diffs[x][0] !== DIFF_DELETE) {\n text[x] = diffs[x][1];\n }\n }\n return text.join('');\n};\n\n\n/**\n * Compute the Levenshtein distance; the number of inserted, deleted or\n * substituted characters.\n * @param {!Array.} diffs Array of diff tuples.\n * @return {number} Number of changes.\n */\ndiff_match_patch.prototype.diff_levenshtein = function(diffs) {\n var levenshtein = 0;\n var insertions = 0;\n var deletions = 0;\n for (var x = 0; x < diffs.length; x++) {\n var op = diffs[x][0];\n var data = diffs[x][1];\n switch (op) {\n case DIFF_INSERT:\n insertions += data.length;\n break;\n case DIFF_DELETE:\n deletions += data.length;\n break;\n case DIFF_EQUAL:\n // A deletion and an insertion is one substitution.\n levenshtein += Math.max(insertions, deletions);\n insertions = 0;\n deletions = 0;\n break;\n }\n }\n levenshtein += Math.max(insertions, deletions);\n return levenshtein;\n};\n\n\n/**\n * Crush the diff into an encoded string which describes the operations\n * required to transform text1 into text2.\n * E.g. =3\\t-2\\t+ing -> Keep 3 chars, delete 2 chars, insert 'ing'.\n * Operations are tab-separated. Inserted text is escaped using %xx notation.\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} Delta text.\n */\ndiff_match_patch.prototype.diff_toDelta = function(diffs) {\n var text = [];\n for (var x = 0; x < diffs.length; x++) {\n switch (diffs[x][0]) {\n case DIFF_INSERT:\n text[x] = '+' + encodeURI(diffs[x][1]);\n break;\n case DIFF_DELETE:\n text[x] = '-' + diffs[x][1].length;\n break;\n case DIFF_EQUAL:\n text[x] = '=' + diffs[x][1].length;\n break;\n }\n }\n return text.join('\\t').replace(/%20/g, ' ');\n};\n\n\n/**\n * Given the original text1, and an encoded string which describes the\n * operations required to transform text1 into text2, compute the full diff.\n * @param {string} text1 Source string for the diff.\n * @param {string} delta Delta text.\n * @return {!Array.} Array of diff tuples.\n * @throws {!Error} If invalid input.\n */\ndiff_match_patch.prototype.diff_fromDelta = function(text1, delta) {\n var diffs = [];\n var diffsLength = 0; // Keeping our own length var is faster in JS.\n var pointer = 0; // Cursor in text1\n var tokens = delta.split(/\\t/g);\n for (var x = 0; x < tokens.length; x++) {\n // Each token begins with a one character parameter which specifies the\n // operation of this token (delete, insert, equality).\n var param = tokens[x].substring(1);\n switch (tokens[x].charAt(0)) {\n case '+':\n try {\n diffs[diffsLength++] =\n new diff_match_patch.Diff(DIFF_INSERT, decodeURI(param));\n } catch (ex) {\n // Malformed URI sequence.\n throw new Error('Illegal escape in diff_fromDelta: ' + param);\n }\n break;\n case '-':\n // Fall through.\n case '=':\n var n = parseInt(param, 10);\n if (isNaN(n) || n < 0) {\n throw new Error('Invalid number in diff_fromDelta: ' + param);\n }\n var text = text1.substring(pointer, pointer += n);\n if (tokens[x].charAt(0) == '=') {\n diffs[diffsLength++] = new diff_match_patch.Diff(DIFF_EQUAL, text);\n } else {\n diffs[diffsLength++] = new diff_match_patch.Diff(DIFF_DELETE, text);\n }\n break;\n default:\n // Blank tokens are ok (from a trailing \\t).\n // Anything else is an error.\n if (tokens[x]) {\n throw new Error('Invalid diff operation in diff_fromDelta: ' +\n tokens[x]);\n }\n }\n }\n if (pointer != text1.length) {\n throw new Error('Delta length (' + pointer +\n ') does not equal source text length (' + text1.length + ').');\n }\n return diffs;\n};\n\n\n// MATCH FUNCTIONS\n\n\n/**\n * Locate the best instance of 'pattern' in 'text' near 'loc'.\n * @param {string} text The text to search.\n * @param {string} pattern The pattern to search for.\n * @param {number} loc The location to search around.\n * @return {number} Best match index or -1.\n */\ndiff_match_patch.prototype.match_main = function(text, pattern, loc) {\n // Check for null inputs.\n if (text == null || pattern == null || loc == null) {\n throw new Error('Null input. (match_main)');\n }\n\n loc = Math.max(0, Math.min(loc, text.length));\n if (text == pattern) {\n // Shortcut (potentially not guaranteed by the algorithm)\n return 0;\n } else if (!text.length) {\n // Nothing to match.\n return -1;\n } else if (text.substring(loc, loc + pattern.length) == pattern) {\n // Perfect match at the perfect spot! (Includes case of null pattern)\n return loc;\n } else {\n // Do a fuzzy compare.\n return this.match_bitap_(text, pattern, loc);\n }\n};\n\n\n/**\n * Locate the best instance of 'pattern' in 'text' near 'loc' using the\n * Bitap algorithm.\n * @param {string} text The text to search.\n * @param {string} pattern The pattern to search for.\n * @param {number} loc The location to search around.\n * @return {number} Best match index or -1.\n * @private\n */\ndiff_match_patch.prototype.match_bitap_ = function(text, pattern, loc) {\n if (pattern.length > this.Match_MaxBits) {\n throw new Error('Pattern too long for this browser.');\n }\n\n // Initialise the alphabet.\n var s = this.match_alphabet_(pattern);\n\n var dmp = this; // 'this' becomes 'window' in a closure.\n\n /**\n * Compute and return the score for a match with e errors and x location.\n * Accesses loc and pattern through being a closure.\n * @param {number} e Number of errors in match.\n * @param {number} x Location of match.\n * @return {number} Overall score for match (0.0 = good, 1.0 = bad).\n * @private\n */\n function match_bitapScore_(e, x) {\n var accuracy = e / pattern.length;\n var proximity = Math.abs(loc - x);\n if (!dmp.Match_Distance) {\n // Dodge divide by zero error.\n return proximity ? 1.0 : accuracy;\n }\n return accuracy + (proximity / dmp.Match_Distance);\n }\n\n // Highest score beyond which we give up.\n var score_threshold = this.Match_Threshold;\n // Is there a nearby exact match? (speedup)\n var best_loc = text.indexOf(pattern, loc);\n if (best_loc != -1) {\n score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold);\n // What about in the other direction? (speedup)\n best_loc = text.lastIndexOf(pattern, loc + pattern.length);\n if (best_loc != -1) {\n score_threshold =\n Math.min(match_bitapScore_(0, best_loc), score_threshold);\n }\n }\n\n // Initialise the bit arrays.\n var matchmask = 1 << (pattern.length - 1);\n best_loc = -1;\n\n var bin_min, bin_mid;\n var bin_max = pattern.length + text.length;\n var last_rd;\n for (var d = 0; d < pattern.length; d++) {\n // Scan for the best match; each iteration allows for one more error.\n // Run a binary search to determine how far from 'loc' we can stray at this\n // error level.\n bin_min = 0;\n bin_mid = bin_max;\n while (bin_min < bin_mid) {\n if (match_bitapScore_(d, loc + bin_mid) <= score_threshold) {\n bin_min = bin_mid;\n } else {\n bin_max = bin_mid;\n }\n bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min);\n }\n // Use the result from this iteration as the maximum for the next.\n bin_max = bin_mid;\n var start = Math.max(1, loc - bin_mid + 1);\n var finish = Math.min(loc + bin_mid, text.length) + pattern.length;\n\n var rd = Array(finish + 2);\n rd[finish + 1] = (1 << d) - 1;\n for (var j = finish; j >= start; j--) {\n // The alphabet (s) is a sparse hash, so the following line generates\n // warnings.\n var charMatch = s[text.charAt(j - 1)];\n if (d === 0) { // First pass: exact match.\n rd[j] = ((rd[j + 1] << 1) | 1) & charMatch;\n } else { // Subsequent passes: fuzzy match.\n rd[j] = (((rd[j + 1] << 1) | 1) & charMatch) |\n (((last_rd[j + 1] | last_rd[j]) << 1) | 1) |\n last_rd[j + 1];\n }\n if (rd[j] & matchmask) {\n var score = match_bitapScore_(d, j - 1);\n // This match will almost certainly be better than any existing match.\n // But check anyway.\n if (score <= score_threshold) {\n // Told you so.\n score_threshold = score;\n best_loc = j - 1;\n if (best_loc > loc) {\n // When passing loc, don't exceed our current distance from loc.\n start = Math.max(1, 2 * loc - best_loc);\n } else {\n // Already passed loc, downhill from here on in.\n break;\n }\n }\n }\n }\n // No hope for a (better) match at greater error levels.\n if (match_bitapScore_(d + 1, loc) > score_threshold) {\n break;\n }\n last_rd = rd;\n }\n return best_loc;\n};\n\n\n/**\n * Initialise the alphabet for the Bitap algorithm.\n * @param {string} pattern The text to encode.\n * @return {!Object} Hash of character locations.\n * @private\n */\ndiff_match_patch.prototype.match_alphabet_ = function(pattern) {\n var s = {};\n for (var i = 0; i < pattern.length; i++) {\n s[pattern.charAt(i)] = 0;\n }\n for (var i = 0; i < pattern.length; i++) {\n s[pattern.charAt(i)] |= 1 << (pattern.length - i - 1);\n }\n return s;\n};\n\n\n// PATCH FUNCTIONS\n\n\n/**\n * Increase the context until it is unique,\n * but don't let the pattern expand beyond Match_MaxBits.\n * @param {!diff_match_patch.patch_obj} patch The patch to grow.\n * @param {string} text Source text.\n * @private\n */\ndiff_match_patch.prototype.patch_addContext_ = function(patch, text) {\n if (text.length == 0) {\n return;\n }\n if (patch.start2 === null) {\n throw Error('patch not initialized');\n }\n var pattern = text.substring(patch.start2, patch.start2 + patch.length1);\n var padding = 0;\n\n // Look for the first and last matches of pattern in text. If two different\n // matches are found, increase the pattern length.\n while (text.indexOf(pattern) != text.lastIndexOf(pattern) &&\n pattern.length < this.Match_MaxBits - this.Patch_Margin -\n this.Patch_Margin) {\n padding += this.Patch_Margin;\n pattern = text.substring(patch.start2 - padding,\n patch.start2 + patch.length1 + padding);\n }\n // Add one chunk for good luck.\n padding += this.Patch_Margin;\n\n // Add the prefix.\n var prefix = text.substring(patch.start2 - padding, patch.start2);\n if (prefix) {\n patch.diffs.unshift(new diff_match_patch.Diff(DIFF_EQUAL, prefix));\n }\n // Add the suffix.\n var suffix = text.substring(patch.start2 + patch.length1,\n patch.start2 + patch.length1 + padding);\n if (suffix) {\n patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, suffix));\n }\n\n // Roll back the start points.\n patch.start1 -= prefix.length;\n patch.start2 -= prefix.length;\n // Extend the lengths.\n patch.length1 += prefix.length + suffix.length;\n patch.length2 += prefix.length + suffix.length;\n};\n\n\n/**\n * Compute a list of patches to turn text1 into text2.\n * Use diffs if provided, otherwise compute it ourselves.\n * There are four ways to call this function, depending on what data is\n * available to the caller:\n * Method 1:\n * a = text1, b = text2\n * Method 2:\n * a = diffs\n * Method 3 (optimal):\n * a = text1, b = diffs\n * Method 4 (deprecated, use method 3):\n * a = text1, b = text2, c = diffs\n *\n * @param {string|!Array.} a text1 (methods 1,3,4) or\n * Array of diff tuples for text1 to text2 (method 2).\n * @param {string|!Array.=} opt_b text2 (methods 1,4) or\n * Array of diff tuples for text1 to text2 (method 3) or undefined (method 2).\n * @param {string|!Array.=} opt_c Array of diff tuples\n * for text1 to text2 (method 4) or undefined (methods 1,2,3).\n * @return {!Array.} Array of Patch objects.\n */\ndiff_match_patch.prototype.patch_make = function(a, opt_b, opt_c) {\n var text1, diffs;\n if (typeof a == 'string' && typeof opt_b == 'string' &&\n typeof opt_c == 'undefined') {\n // Method 1: text1, text2\n // Compute diffs from text1 and text2.\n text1 = /** @type {string} */(a);\n diffs = this.diff_main(text1, /** @type {string} */(opt_b), true);\n if (diffs.length > 2) {\n this.diff_cleanupSemantic(diffs);\n this.diff_cleanupEfficiency(diffs);\n }\n } else if (a && typeof a == 'object' && typeof opt_b == 'undefined' &&\n typeof opt_c == 'undefined') {\n // Method 2: diffs\n // Compute text1 from diffs.\n diffs = /** @type {!Array.} */(a);\n text1 = this.diff_text1(diffs);\n } else if (typeof a == 'string' && opt_b && typeof opt_b == 'object' &&\n typeof opt_c == 'undefined') {\n // Method 3: text1, diffs\n text1 = /** @type {string} */(a);\n diffs = /** @type {!Array.} */(opt_b);\n } else if (typeof a == 'string' && typeof opt_b == 'string' &&\n opt_c && typeof opt_c == 'object') {\n // Method 4: text1, text2, diffs\n // text2 is not used.\n text1 = /** @type {string} */(a);\n diffs = /** @type {!Array.} */(opt_c);\n } else {\n throw new Error('Unknown call format to patch_make.');\n }\n\n if (diffs.length === 0) {\n return []; // Get rid of the null case.\n }\n var patches = [];\n var patch = new diff_match_patch.patch_obj();\n var patchDiffLength = 0; // Keeping our own length var is faster in JS.\n var char_count1 = 0; // Number of characters into the text1 string.\n var char_count2 = 0; // Number of characters into the text2 string.\n // Start with text1 (prepatch_text) and apply the diffs until we arrive at\n // text2 (postpatch_text). We recreate the patches one by one to determine\n // context info.\n var prepatch_text = text1;\n var postpatch_text = text1;\n for (var x = 0; x < diffs.length; x++) {\n var diff_type = diffs[x][0];\n var diff_text = diffs[x][1];\n\n if (!patchDiffLength && diff_type !== DIFF_EQUAL) {\n // A new patch starts here.\n patch.start1 = char_count1;\n patch.start2 = char_count2;\n }\n\n switch (diff_type) {\n case DIFF_INSERT:\n patch.diffs[patchDiffLength++] = diffs[x];\n patch.length2 += diff_text.length;\n postpatch_text = postpatch_text.substring(0, char_count2) + diff_text +\n postpatch_text.substring(char_count2);\n break;\n case DIFF_DELETE:\n patch.length1 += diff_text.length;\n patch.diffs[patchDiffLength++] = diffs[x];\n postpatch_text = postpatch_text.substring(0, char_count2) +\n postpatch_text.substring(char_count2 +\n diff_text.length);\n break;\n case DIFF_EQUAL:\n if (diff_text.length <= 2 * this.Patch_Margin &&\n patchDiffLength && diffs.length != x + 1) {\n // Small equality inside a patch.\n patch.diffs[patchDiffLength++] = diffs[x];\n patch.length1 += diff_text.length;\n patch.length2 += diff_text.length;\n } else if (diff_text.length >= 2 * this.Patch_Margin) {\n // Time for a new patch.\n if (patchDiffLength) {\n this.patch_addContext_(patch, prepatch_text);\n patches.push(patch);\n patch = new diff_match_patch.patch_obj();\n patchDiffLength = 0;\n // Unlike Unidiff, our patch lists have a rolling context.\n // https://github.com/google/diff-match-patch/wiki/Unidiff\n // Update prepatch text & pos to reflect the application of the\n // just completed patch.\n prepatch_text = postpatch_text;\n char_count1 = char_count2;\n }\n }\n break;\n }\n\n // Update the current character count.\n if (diff_type !== DIFF_INSERT) {\n char_count1 += diff_text.length;\n }\n if (diff_type !== DIFF_DELETE) {\n char_count2 += diff_text.length;\n }\n }\n // Pick up the leftover patch if not empty.\n if (patchDiffLength) {\n this.patch_addContext_(patch, prepatch_text);\n patches.push(patch);\n }\n\n return patches;\n};\n\n\n/**\n * Given an array of patches, return another array that is identical.\n * @param {!Array.} patches Array of Patch objects.\n * @return {!Array.} Array of Patch objects.\n */\ndiff_match_patch.prototype.patch_deepCopy = function(patches) {\n // Making deep copies is hard in JavaScript.\n var patchesCopy = [];\n for (var x = 0; x < patches.length; x++) {\n var patch = patches[x];\n var patchCopy = new diff_match_patch.patch_obj();\n patchCopy.diffs = [];\n for (var y = 0; y < patch.diffs.length; y++) {\n patchCopy.diffs[y] =\n new diff_match_patch.Diff(patch.diffs[y][0], patch.diffs[y][1]);\n }\n patchCopy.start1 = patch.start1;\n patchCopy.start2 = patch.start2;\n patchCopy.length1 = patch.length1;\n patchCopy.length2 = patch.length2;\n patchesCopy[x] = patchCopy;\n }\n return patchesCopy;\n};\n\n\n/**\n * Merge a set of patches onto the text. Return a patched text, as well\n * as a list of true/false values indicating which patches were applied.\n * @param {!Array.} patches Array of Patch objects.\n * @param {string} text Old text.\n * @return {!Array.>} Two element Array, containing the\n * new text and an array of boolean values.\n */\ndiff_match_patch.prototype.patch_apply = function(patches, text) {\n if (patches.length == 0) {\n return [text, []];\n }\n\n // Deep copy the patches so that no changes are made to originals.\n patches = this.patch_deepCopy(patches);\n\n var nullPadding = this.patch_addPadding(patches);\n text = nullPadding + text + nullPadding;\n\n this.patch_splitMax(patches);\n // delta keeps track of the offset between the expected and actual location\n // of the previous patch. If there are patches expected at positions 10 and\n // 20, but the first patch was found at 12, delta is 2 and the second patch\n // has an effective expected position of 22.\n var delta = 0;\n var results = [];\n for (var x = 0; x < patches.length; x++) {\n var expected_loc = patches[x].start2 + delta;\n var text1 = this.diff_text1(patches[x].diffs);\n var start_loc;\n var end_loc = -1;\n if (text1.length > this.Match_MaxBits) {\n // patch_splitMax will only provide an oversized pattern in the case of\n // a monster delete.\n start_loc = this.match_main(text, text1.substring(0, this.Match_MaxBits),\n expected_loc);\n if (start_loc != -1) {\n end_loc = this.match_main(text,\n text1.substring(text1.length - this.Match_MaxBits),\n expected_loc + text1.length - this.Match_MaxBits);\n if (end_loc == -1 || start_loc >= end_loc) {\n // Can't find valid trailing context. Drop this patch.\n start_loc = -1;\n }\n }\n } else {\n start_loc = this.match_main(text, text1, expected_loc);\n }\n if (start_loc == -1) {\n // No match found. :(\n results[x] = false;\n // Subtract the delta for this failed patch from subsequent patches.\n delta -= patches[x].length2 - patches[x].length1;\n } else {\n // Found a match. :)\n results[x] = true;\n delta = start_loc - expected_loc;\n var text2;\n if (end_loc == -1) {\n text2 = text.substring(start_loc, start_loc + text1.length);\n } else {\n text2 = text.substring(start_loc, end_loc + this.Match_MaxBits);\n }\n if (text1 == text2) {\n // Perfect match, just shove the replacement text in.\n text = text.substring(0, start_loc) +\n this.diff_text2(patches[x].diffs) +\n text.substring(start_loc + text1.length);\n } else {\n // Imperfect match. Run a diff to get a framework of equivalent\n // indices.\n var diffs = this.diff_main(text1, text2, false);\n if (text1.length > this.Match_MaxBits &&\n this.diff_levenshtein(diffs) / text1.length >\n this.Patch_DeleteThreshold) {\n // The end points match, but the content is unacceptably bad.\n results[x] = false;\n } else {\n this.diff_cleanupSemanticLossless(diffs);\n var index1 = 0;\n var index2;\n for (var y = 0; y < patches[x].diffs.length; y++) {\n var mod = patches[x].diffs[y];\n if (mod[0] !== DIFF_EQUAL) {\n index2 = this.diff_xIndex(diffs, index1);\n }\n if (mod[0] === DIFF_INSERT) { // Insertion\n text = text.substring(0, start_loc + index2) + mod[1] +\n text.substring(start_loc + index2);\n } else if (mod[0] === DIFF_DELETE) { // Deletion\n text = text.substring(0, start_loc + index2) +\n text.substring(start_loc + this.diff_xIndex(diffs,\n index1 + mod[1].length));\n }\n if (mod[0] !== DIFF_DELETE) {\n index1 += mod[1].length;\n }\n }\n }\n }\n }\n }\n // Strip the padding off.\n text = text.substring(nullPadding.length, text.length - nullPadding.length);\n return [text, results];\n};\n\n\n/**\n * Add some padding on text start and end so that edges can match something.\n * Intended to be called only from within patch_apply.\n * @param {!Array.} patches Array of Patch objects.\n * @return {string} The padding string added to each side.\n */\ndiff_match_patch.prototype.patch_addPadding = function(patches) {\n var paddingLength = this.Patch_Margin;\n var nullPadding = '';\n for (var x = 1; x <= paddingLength; x++) {\n nullPadding += String.fromCharCode(x);\n }\n\n // Bump all the patches forward.\n for (var x = 0; x < patches.length; x++) {\n patches[x].start1 += paddingLength;\n patches[x].start2 += paddingLength;\n }\n\n // Add some padding on start of first diff.\n var patch = patches[0];\n var diffs = patch.diffs;\n if (diffs.length == 0 || diffs[0][0] != DIFF_EQUAL) {\n // Add nullPadding equality.\n diffs.unshift(new diff_match_patch.Diff(DIFF_EQUAL, nullPadding));\n patch.start1 -= paddingLength; // Should be 0.\n patch.start2 -= paddingLength; // Should be 0.\n patch.length1 += paddingLength;\n patch.length2 += paddingLength;\n } else if (paddingLength > diffs[0][1].length) {\n // Grow first equality.\n var extraLength = paddingLength - diffs[0][1].length;\n diffs[0][1] = nullPadding.substring(diffs[0][1].length) + diffs[0][1];\n patch.start1 -= extraLength;\n patch.start2 -= extraLength;\n patch.length1 += extraLength;\n patch.length2 += extraLength;\n }\n\n // Add some padding on end of last diff.\n patch = patches[patches.length - 1];\n diffs = patch.diffs;\n if (diffs.length == 0 || diffs[diffs.length - 1][0] != DIFF_EQUAL) {\n // Add nullPadding equality.\n diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, nullPadding));\n patch.length1 += paddingLength;\n patch.length2 += paddingLength;\n } else if (paddingLength > diffs[diffs.length - 1][1].length) {\n // Grow last equality.\n var extraLength = paddingLength - diffs[diffs.length - 1][1].length;\n diffs[diffs.length - 1][1] += nullPadding.substring(0, extraLength);\n patch.length1 += extraLength;\n patch.length2 += extraLength;\n }\n\n return nullPadding;\n};\n\n\n/**\n * Look through the patches and break up any which are longer than the maximum\n * limit of the match algorithm.\n * Intended to be called only from within patch_apply.\n * @param {!Array.} patches Array of Patch objects.\n */\ndiff_match_patch.prototype.patch_splitMax = function(patches) {\n var patch_size = this.Match_MaxBits;\n for (var x = 0; x < patches.length; x++) {\n if (patches[x].length1 <= patch_size) {\n continue;\n }\n var bigpatch = patches[x];\n // Remove the big old patch.\n patches.splice(x--, 1);\n var start1 = bigpatch.start1;\n var start2 = bigpatch.start2;\n var precontext = '';\n while (bigpatch.diffs.length !== 0) {\n // Create one of several smaller patches.\n var patch = new diff_match_patch.patch_obj();\n var empty = true;\n patch.start1 = start1 - precontext.length;\n patch.start2 = start2 - precontext.length;\n if (precontext !== '') {\n patch.length1 = patch.length2 = precontext.length;\n patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, precontext));\n }\n while (bigpatch.diffs.length !== 0 &&\n patch.length1 < patch_size - this.Patch_Margin) {\n var diff_type = bigpatch.diffs[0][0];\n var diff_text = bigpatch.diffs[0][1];\n if (diff_type === DIFF_INSERT) {\n // Insertions are harmless.\n patch.length2 += diff_text.length;\n start2 += diff_text.length;\n patch.diffs.push(bigpatch.diffs.shift());\n empty = false;\n } else if (diff_type === DIFF_DELETE && patch.diffs.length == 1 &&\n patch.diffs[0][0] == DIFF_EQUAL &&\n diff_text.length > 2 * patch_size) {\n // This is a large deletion. Let it pass in one chunk.\n patch.length1 += diff_text.length;\n start1 += diff_text.length;\n empty = false;\n patch.diffs.push(new diff_match_patch.Diff(diff_type, diff_text));\n bigpatch.diffs.shift();\n } else {\n // Deletion or equality. Only take as much as we can stomach.\n diff_text = diff_text.substring(0,\n patch_size - patch.length1 - this.Patch_Margin);\n patch.length1 += diff_text.length;\n start1 += diff_text.length;\n if (diff_type === DIFF_EQUAL) {\n patch.length2 += diff_text.length;\n start2 += diff_text.length;\n } else {\n empty = false;\n }\n patch.diffs.push(new diff_match_patch.Diff(diff_type, diff_text));\n if (diff_text == bigpatch.diffs[0][1]) {\n bigpatch.diffs.shift();\n } else {\n bigpatch.diffs[0][1] =\n bigpatch.diffs[0][1].substring(diff_text.length);\n }\n }\n }\n // Compute the head context for the next patch.\n precontext = this.diff_text2(patch.diffs);\n precontext =\n precontext.substring(precontext.length - this.Patch_Margin);\n // Append the end context for this patch.\n var postcontext = this.diff_text1(bigpatch.diffs)\n .substring(0, this.Patch_Margin);\n if (postcontext !== '') {\n patch.length1 += postcontext.length;\n patch.length2 += postcontext.length;\n if (patch.diffs.length !== 0 &&\n patch.diffs[patch.diffs.length - 1][0] === DIFF_EQUAL) {\n patch.diffs[patch.diffs.length - 1][1] += postcontext;\n } else {\n patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, postcontext));\n }\n }\n if (!empty) {\n patches.splice(++x, 0, patch);\n }\n }\n }\n};\n\n\n/**\n * Take a list of patches and return a textual representation.\n * @param {!Array.} patches Array of Patch objects.\n * @return {string} Text representation of patches.\n */\ndiff_match_patch.prototype.patch_toText = function(patches) {\n var text = [];\n for (var x = 0; x < patches.length; x++) {\n text[x] = patches[x];\n }\n return text.join('');\n};\n\n\n/**\n * Parse a textual representation of patches and return a list of Patch objects.\n * @param {string} textline Text representation of patches.\n * @return {!Array.} Array of Patch objects.\n * @throws {!Error} If invalid input.\n */\ndiff_match_patch.prototype.patch_fromText = function(textline) {\n var patches = [];\n if (!textline) {\n return patches;\n }\n var text = textline.split('\\n');\n var textPointer = 0;\n var patchHeader = /^@@ -(\\d+),?(\\d*) \\+(\\d+),?(\\d*) @@$/;\n while (textPointer < text.length) {\n var m = text[textPointer].match(patchHeader);\n if (!m) {\n throw new Error('Invalid patch string: ' + text[textPointer]);\n }\n var patch = new diff_match_patch.patch_obj();\n patches.push(patch);\n patch.start1 = parseInt(m[1], 10);\n if (m[2] === '') {\n patch.start1--;\n patch.length1 = 1;\n } else if (m[2] == '0') {\n patch.length1 = 0;\n } else {\n patch.start1--;\n patch.length1 = parseInt(m[2], 10);\n }\n\n patch.start2 = parseInt(m[3], 10);\n if (m[4] === '') {\n patch.start2--;\n patch.length2 = 1;\n } else if (m[4] == '0') {\n patch.length2 = 0;\n } else {\n patch.start2--;\n patch.length2 = parseInt(m[4], 10);\n }\n textPointer++;\n\n while (textPointer < text.length) {\n var sign = text[textPointer].charAt(0);\n try {\n var line = decodeURI(text[textPointer].substring(1));\n } catch (ex) {\n // Malformed URI sequence.\n throw new Error('Illegal escape in patch_fromText: ' + line);\n }\n if (sign == '-') {\n // Deletion.\n patch.diffs.push(new diff_match_patch.Diff(DIFF_DELETE, line));\n } else if (sign == '+') {\n // Insertion.\n patch.diffs.push(new diff_match_patch.Diff(DIFF_INSERT, line));\n } else if (sign == ' ') {\n // Minor equality.\n patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, line));\n } else if (sign == '@') {\n // Start of next patch.\n break;\n } else if (sign === '') {\n // Blank line? Whatever.\n } else {\n // WTF?\n throw new Error('Invalid patch mode \"' + sign + '\" in: ' + line);\n }\n textPointer++;\n }\n }\n return patches;\n};\n\n\n/**\n * Class representing one patch operation.\n * @constructor\n */\ndiff_match_patch.patch_obj = function() {\n /** @type {!Array.} */\n this.diffs = [];\n /** @type {?number} */\n this.start1 = null;\n /** @type {?number} */\n this.start2 = null;\n /** @type {number} */\n this.length1 = 0;\n /** @type {number} */\n this.length2 = 0;\n};\n\n\n/**\n * Emulate GNU diff's format.\n * Header: @@ -382,8 +481,9 @@\n * Indices are printed as 1-based, not 0-based.\n * @return {string} The GNU diff string.\n */\ndiff_match_patch.patch_obj.prototype.toString = function() {\n var coords1, coords2;\n if (this.length1 === 0) {\n coords1 = this.start1 + ',0';\n } else if (this.length1 == 1) {\n coords1 = this.start1 + 1;\n } else {\n coords1 = (this.start1 + 1) + ',' + this.length1;\n }\n if (this.length2 === 0) {\n coords2 = this.start2 + ',0';\n } else if (this.length2 == 1) {\n coords2 = this.start2 + 1;\n } else {\n coords2 = (this.start2 + 1) + ',' + this.length2;\n }\n var text = ['@@ -' + coords1 + ' +' + coords2 + ' @@\\n'];\n var op;\n // Escape the body of the patch with %xx notation.\n for (var x = 0; x < this.diffs.length; x++) {\n switch (this.diffs[x][0]) {\n case DIFF_INSERT:\n op = '+';\n break;\n case DIFF_DELETE:\n op = '-';\n break;\n case DIFF_EQUAL:\n op = ' ';\n break;\n }\n text[x + 1] = op + encodeURI(this.diffs[x][1]) + '\\n';\n }\n return text.join('').replace(/%20/g, ' ');\n};\n\n\n// The following export code was added by @ForbesLindesay\nmodule.exports = diff_match_patch;\nmodule.exports['diff_match_patch'] = diff_match_patch;\nmodule.exports['DIFF_DELETE'] = DIFF_DELETE;\nmodule.exports['DIFF_INSERT'] = DIFF_INSERT;\nmodule.exports['DIFF_EQUAL'] = DIFF_EQUAL;","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar PropTypes = require(\"prop-types\");\nvar React = require(\"react\");\nvar split_1 = require(\"./split\");\nvar DiffMatchPatch = require(\"diff-match-patch\");\nvar DiffComponent = /** @class */ (function (_super) {\n __extends(DiffComponent, _super);\n function DiffComponent(props) {\n var _this = _super.call(this, props) || this;\n _this.state = {\n value: _this.props.value\n };\n _this.onChange = _this.onChange.bind(_this);\n _this.diff = _this.diff.bind(_this);\n return _this;\n }\n DiffComponent.prototype.componentDidUpdate = function () {\n var value = this.props.value;\n if (value !== this.state.value) {\n this.setState({ value: value });\n }\n };\n DiffComponent.prototype.onChange = function (value) {\n this.setState({\n value: value\n });\n if (this.props.onChange) {\n this.props.onChange(value);\n }\n };\n DiffComponent.prototype.diff = function () {\n var dmp = new DiffMatchPatch();\n var lhString = this.state.value[0];\n var rhString = this.state.value[1];\n if (lhString.length === 0 && rhString.length === 0) {\n return [];\n }\n var diff = dmp.diff_main(lhString, rhString);\n dmp.diff_cleanupSemantic(diff);\n var diffedLines = this.generateDiffedLines(diff);\n var codeEditorSettings = this.setCodeMarkers(diffedLines);\n return codeEditorSettings;\n };\n DiffComponent.prototype.generateDiffedLines = function (diff) {\n var C = {\n DIFF_EQUAL: 0,\n DIFF_DELETE: -1,\n DIFF_INSERT: 1\n };\n var diffedLines = {\n left: [],\n right: []\n };\n var cursor = {\n left: 1,\n right: 1\n };\n diff.forEach(function (chunk) {\n var chunkType = chunk[0];\n var text = chunk[1];\n var lines = text.split(\"\\n\").length - 1;\n // diff-match-patch sometimes returns empty strings at random\n if (text.length === 0) {\n return;\n }\n var firstChar = text[0];\n var lastChar = text[text.length - 1];\n var linesToHighlight = 0;\n switch (chunkType) {\n case C.DIFF_EQUAL:\n cursor.left += lines;\n cursor.right += lines;\n break;\n case C.DIFF_DELETE:\n // If the deletion starts with a newline, push the cursor down to that line\n if (firstChar === \"\\n\") {\n cursor.left++;\n lines--;\n }\n linesToHighlight = lines;\n // If the deletion does not include a newline, highlight the same line on the right\n if (linesToHighlight === 0) {\n diffedLines.right.push({\n startLine: cursor.right,\n endLine: cursor.right\n });\n }\n // If the last character is a newline, we don't want to highlight that line\n if (lastChar === \"\\n\") {\n linesToHighlight -= 1;\n }\n diffedLines.left.push({\n startLine: cursor.left,\n endLine: cursor.left + linesToHighlight\n });\n cursor.left += lines;\n break;\n case C.DIFF_INSERT:\n // If the insertion starts with a newline, push the cursor down to that line\n if (firstChar === \"\\n\") {\n cursor.right++;\n lines--;\n }\n linesToHighlight = lines;\n // If the insertion does not include a newline, highlight the same line on the left\n if (linesToHighlight === 0) {\n diffedLines.left.push({\n startLine: cursor.left,\n endLine: cursor.left\n });\n }\n // If the last character is a newline, we don't want to highlight that line\n if (lastChar === \"\\n\") {\n linesToHighlight -= 1;\n }\n diffedLines.right.push({\n startLine: cursor.right,\n endLine: cursor.right + linesToHighlight\n });\n cursor.right += lines;\n break;\n default:\n throw new Error(\"Diff type was not defined.\");\n }\n });\n return diffedLines;\n };\n // Receives a collection of line numbers and iterates through them to highlight appropriately\n // Returns an object that tells the render() method how to display the code editors\n DiffComponent.prototype.setCodeMarkers = function (diffedLines) {\n if (diffedLines === void 0) { diffedLines = { left: [], right: [] }; }\n var codeEditorSettings = [];\n var newMarkerSet = {\n left: [],\n right: []\n };\n for (var i = 0; i < diffedLines.left.length; i++) {\n var markerObj = {\n startRow: diffedLines.left[i].startLine - 1,\n endRow: diffedLines.left[i].endLine,\n type: \"text\",\n className: \"codeMarker\"\n };\n newMarkerSet.left.push(markerObj);\n }\n for (var i = 0; i < diffedLines.right.length; i++) {\n var markerObj = {\n startRow: diffedLines.right[i].startLine - 1,\n endRow: diffedLines.right[i].endLine,\n type: \"text\",\n className: \"codeMarker\"\n };\n newMarkerSet.right.push(markerObj);\n }\n codeEditorSettings[0] = newMarkerSet.left;\n codeEditorSettings[1] = newMarkerSet.right;\n return codeEditorSettings;\n };\n DiffComponent.prototype.render = function () {\n var markers = this.diff();\n return (React.createElement(split_1.default, { name: this.props.name, className: this.props.className, focus: this.props.focus, orientation: this.props.orientation, splits: this.props.splits, mode: this.props.mode, theme: this.props.theme, height: this.props.height, width: this.props.width, fontSize: this.props.fontSize, showGutter: this.props.showGutter, onChange: this.onChange, onPaste: this.props.onPaste, onLoad: this.props.onLoad, onScroll: this.props.onScroll, minLines: this.props.minLines, maxLines: this.props.maxLines, readOnly: this.props.readOnly, highlightActiveLine: this.props.highlightActiveLine, showPrintMargin: this.props.showPrintMargin, tabSize: this.props.tabSize, cursorStart: this.props.cursorStart, editorProps: this.props.editorProps, style: this.props.style, scrollMargin: this.props.scrollMargin, setOptions: this.props.setOptions, wrapEnabled: this.props.wrapEnabled, enableBasicAutocompletion: this.props.enableBasicAutocompletion, enableLiveAutocompletion: this.props.enableLiveAutocompletion, value: this.state.value, markers: markers }));\n };\n DiffComponent.propTypes = {\n cursorStart: PropTypes.number,\n editorProps: PropTypes.object,\n enableBasicAutocompletion: PropTypes.bool,\n enableLiveAutocompletion: PropTypes.bool,\n focus: PropTypes.bool,\n fontSize: PropTypes.number,\n height: PropTypes.string,\n highlightActiveLine: PropTypes.bool,\n maxLines: PropTypes.number,\n minLines: PropTypes.number,\n mode: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n onLoad: PropTypes.func,\n onPaste: PropTypes.func,\n onScroll: PropTypes.func,\n onChange: PropTypes.func,\n orientation: PropTypes.string,\n readOnly: PropTypes.bool,\n scrollMargin: PropTypes.array,\n setOptions: PropTypes.object,\n showGutter: PropTypes.bool,\n showPrintMargin: PropTypes.bool,\n splits: PropTypes.number,\n style: PropTypes.object,\n tabSize: PropTypes.number,\n theme: PropTypes.string,\n value: PropTypes.array,\n width: PropTypes.string,\n wrapEnabled: PropTypes.bool\n };\n DiffComponent.defaultProps = {\n cursorStart: 1,\n editorProps: {},\n enableBasicAutocompletion: false,\n enableLiveAutocompletion: false,\n focus: false,\n fontSize: 12,\n height: \"500px\",\n highlightActiveLine: true,\n maxLines: null,\n minLines: null,\n mode: \"\",\n name: \"ace-editor\",\n onLoad: null,\n onScroll: null,\n onPaste: null,\n onChange: null,\n orientation: \"beside\",\n readOnly: false,\n scrollMargin: [0, 0, 0, 0],\n setOptions: {},\n showGutter: true,\n showPrintMargin: true,\n splits: 2,\n style: {},\n tabSize: 4,\n theme: \"github\",\n value: [\"\", \"\"],\n width: \"500px\",\n wrapEnabled: true\n };\n return DiffComponent;\n}(React.Component));\nexports.default = DiffComponent;\n//# sourceMappingURL=diff.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.diff = exports.split = void 0;\nvar ace_1 = require(\"./ace\");\nvar diff_1 = require(\"./diff\");\nexports.diff = diff_1.default;\nvar split_1 = require(\"./split\");\nexports.split = split_1.default;\nexports.default = ace_1.default;\n//# sourceMappingURL=index.js.map",null,null,null,null,"ace.define(\"ace/mode/json_highlight_rules\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text_highlight_rules\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"../lib/oop\");\nvar TextHighlightRules = require(\"./text_highlight_rules\").TextHighlightRules;\nvar JsonHighlightRules = function () {\n this.$rules = {\n \"start\": [\n {\n token: \"variable\",\n regex: '[\"](?:(?:\\\\\\\\.)|(?:[^\"\\\\\\\\]))*?[\"]\\\\s*(?=:)'\n }, {\n token: \"string\",\n regex: '\"',\n next: \"string\"\n }, {\n token: \"constant.numeric\",\n regex: \"0[xX][0-9a-fA-F]+\\\\b\"\n }, {\n token: \"constant.numeric\",\n regex: \"[+-]?\\\\d+(?:(?:\\\\.\\\\d*)?(?:[eE][+-]?\\\\d+)?)?\\\\b\"\n }, {\n token: \"constant.language.boolean\",\n regex: \"(?:true|false)\\\\b\"\n }, {\n token: \"text\",\n regex: \"['](?:(?:\\\\\\\\.)|(?:[^'\\\\\\\\]))*?[']\"\n }, {\n token: \"comment\",\n regex: \"\\\\/\\\\/.*$\"\n }, {\n token: \"comment.start\",\n regex: \"\\\\/\\\\*\",\n next: \"comment\"\n }, {\n token: \"paren.lparen\",\n regex: \"[[({]\"\n }, {\n token: \"paren.rparen\",\n regex: \"[\\\\])}]\"\n }, {\n token: \"punctuation.operator\",\n regex: /[,]/\n }, {\n token: \"text\",\n regex: \"\\\\s+\"\n }\n ],\n \"string\": [\n {\n token: \"constant.language.escape\",\n regex: /\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[\"\\\\\\/bfnrt])/\n }, {\n token: \"string\",\n regex: '\"|$',\n next: \"start\"\n }, {\n defaultToken: \"string\"\n }\n ],\n \"comment\": [\n {\n token: \"comment.end\",\n regex: \"\\\\*\\\\/\",\n next: \"start\"\n }, {\n defaultToken: \"comment\"\n }\n ]\n };\n};\noop.inherits(JsonHighlightRules, TextHighlightRules);\nexports.JsonHighlightRules = JsonHighlightRules;\n\n});\n\nace.define(\"ace/mode/matching_brace_outdent\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"../range\").Range;\nvar MatchingBraceOutdent = function () { };\n(function () {\n this.checkOutdent = function (line, input) {\n if (!/^\\s+$/.test(line))\n return false;\n return /^\\s*\\}/.test(input);\n };\n this.autoOutdent = function (doc, row) {\n var line = doc.getLine(row);\n var match = line.match(/^(\\s*\\})/);\n if (!match)\n return 0;\n var column = match[1].length;\n var openBracePos = doc.findMatchingBracket({ row: row, column: column });\n if (!openBracePos || openBracePos.row == row)\n return 0;\n var indent = this.$getIndent(doc.getLine(openBracePos.row));\n doc.replace(new Range(row, 0, row, column - 1), indent);\n };\n this.$getIndent = function (line) {\n return line.match(/^\\s*/)[0];\n };\n}).call(MatchingBraceOutdent.prototype);\nexports.MatchingBraceOutdent = MatchingBraceOutdent;\n\n});\n\nace.define(\"ace/mode/folding/cstyle\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/range\",\"ace/mode/folding/fold_mode\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"../../lib/oop\");\nvar Range = require(\"../../range\").Range;\nvar BaseFoldMode = require(\"./fold_mode\").FoldMode;\nvar FoldMode = exports.FoldMode = function (commentRegex) {\n if (commentRegex) {\n this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\\|[^|]*?$/, \"|\" + commentRegex.start));\n this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\\|[^|]*?$/, \"|\" + commentRegex.end));\n }\n};\noop.inherits(FoldMode, BaseFoldMode);\n(function () {\n this.foldingStartMarker = /([\\{\\[\\(])[^\\}\\]\\)]*$|^\\s*(\\/\\*)/;\n this.foldingStopMarker = /^[^\\[\\{\\(]*([\\}\\]\\)])|^[\\s\\*]*(\\*\\/)/;\n this.singleLineBlockCommentRe = /^\\s*(\\/\\*).*\\*\\/\\s*$/;\n this.tripleStarBlockCommentRe = /^\\s*(\\/\\*\\*\\*).*\\*\\/\\s*$/;\n this.startRegionRe = /^\\s*(\\/\\*|\\/\\/)#?region\\b/;\n this._getFoldWidgetBase = this.getFoldWidget;\n this.getFoldWidget = function (session, foldStyle, row) {\n var line = session.getLine(row);\n if (this.singleLineBlockCommentRe.test(line)) {\n if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))\n return \"\";\n }\n var fw = this._getFoldWidgetBase(session, foldStyle, row);\n if (!fw && this.startRegionRe.test(line))\n return \"start\"; // lineCommentRegionStart\n return fw;\n };\n this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {\n var line = session.getLine(row);\n if (this.startRegionRe.test(line))\n return this.getCommentRegionBlock(session, line, row);\n var match = line.match(this.foldingStartMarker);\n if (match) {\n var i = match.index;\n if (match[1])\n return this.openingBracketBlock(session, match[1], row, i);\n var range = session.getCommentFoldRange(row, i + match[0].length, 1);\n if (range && !range.isMultiLine()) {\n if (forceMultiline) {\n range = this.getSectionRange(session, row);\n }\n else if (foldStyle != \"all\")\n range = null;\n }\n return range;\n }\n if (foldStyle === \"markbegin\")\n return;\n var match = line.match(this.foldingStopMarker);\n if (match) {\n var i = match.index + match[0].length;\n if (match[1])\n return this.closingBracketBlock(session, match[1], row, i);\n return session.getCommentFoldRange(row, i, -1);\n }\n };\n this.getSectionRange = function (session, row) {\n var line = session.getLine(row);\n var startIndent = line.search(/\\S/);\n var startRow = row;\n var startColumn = line.length;\n row = row + 1;\n var endRow = row;\n var maxRow = session.getLength();\n while (++row < maxRow) {\n line = session.getLine(row);\n var indent = line.search(/\\S/);\n if (indent === -1)\n continue;\n if (startIndent > indent)\n break;\n var subRange = this.getFoldWidgetRange(session, \"all\", row);\n if (subRange) {\n if (subRange.start.row <= startRow) {\n break;\n }\n else if (subRange.isMultiLine()) {\n row = subRange.end.row;\n }\n else if (startIndent == indent) {\n break;\n }\n }\n endRow = row;\n }\n return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);\n };\n this.getCommentRegionBlock = function (session, line, row) {\n var startColumn = line.search(/\\s*$/);\n var maxRow = session.getLength();\n var startRow = row;\n var re = /^\\s*(?:\\/\\*|\\/\\/|--)#?(end)?region\\b/;\n var depth = 1;\n while (++row < maxRow) {\n line = session.getLine(row);\n var m = re.exec(line);\n if (!m)\n continue;\n if (m[1])\n depth--;\n else\n depth++;\n if (!depth)\n break;\n }\n var endRow = row;\n if (endRow > startRow) {\n return new Range(startRow, startColumn, endRow, line.length);\n }\n };\n}).call(FoldMode.prototype);\n\n});\n\nace.define(\"ace/mode/json\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text\",\"ace/mode/json_highlight_rules\",\"ace/mode/matching_brace_outdent\",\"ace/mode/behaviour/cstyle\",\"ace/mode/folding/cstyle\",\"ace/worker/worker_client\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"../lib/oop\");\nvar TextMode = require(\"./text\").Mode;\nvar HighlightRules = require(\"./json_highlight_rules\").JsonHighlightRules;\nvar MatchingBraceOutdent = require(\"./matching_brace_outdent\").MatchingBraceOutdent;\nvar CstyleBehaviour = require(\"./behaviour/cstyle\").CstyleBehaviour;\nvar CStyleFoldMode = require(\"./folding/cstyle\").FoldMode;\nvar WorkerClient = require(\"../worker/worker_client\").WorkerClient;\nvar Mode = function () {\n this.HighlightRules = HighlightRules;\n this.$outdent = new MatchingBraceOutdent();\n this.$behaviour = new CstyleBehaviour();\n this.foldingRules = new CStyleFoldMode();\n};\noop.inherits(Mode, TextMode);\n(function () {\n this.lineCommentStart = \"//\";\n this.blockComment = { start: \"/*\", end: \"*/\" };\n this.getNextLineIndent = function (state, line, tab) {\n var indent = this.$getIndent(line);\n if (state == \"start\") {\n var match = line.match(/^.*[\\{\\(\\[]\\s*$/);\n if (match) {\n indent += tab;\n }\n }\n return indent;\n };\n this.checkOutdent = function (state, line, input) {\n return this.$outdent.checkOutdent(line, input);\n };\n this.autoOutdent = function (state, doc, row) {\n this.$outdent.autoOutdent(doc, row);\n };\n this.createWorker = function (session) {\n var worker = new WorkerClient([\"ace\"], \"ace/mode/json_worker\", \"JsonWorker\");\n worker.attachToDocument(session.getDocument());\n worker.on(\"annotate\", function (e) {\n session.setAnnotations(e.data);\n });\n worker.on(\"terminate\", function () {\n session.clearAnnotations();\n });\n return worker;\n };\n this.$id = \"ace/mode/json\";\n}).call(Mode.prototype);\nexports.Mode = Mode;\n\n}); (function() {\n ace.require([\"ace/mode/json\"], function(m) {\n if (typeof module == \"object\" && typeof exports == \"object\" && module) {\n module.exports = m;\n }\n });\n })();\n ","ace.define(\"ace/ext/searchbox.css\",[\"require\",\"exports\",\"module\"],function(e,t,n){n.exports='\\n\\n/* ------------------------------------------------------------------------------------------\\n * Editor Search Form\\n * --------------------------------------------------------------------------------------- */\\n.ace_search {\\n background-color: #ddd;\\n color: #666;\\n border: 1px solid #cbcbcb;\\n border-top: 0 none;\\n overflow: hidden;\\n margin: 0;\\n padding: 4px 6px 0 4px;\\n position: absolute;\\n top: 0;\\n z-index: 99;\\n white-space: normal;\\n}\\n.ace_search.left {\\n border-left: 0 none;\\n border-radius: 0px 0px 5px 0px;\\n left: 0;\\n}\\n.ace_search.right {\\n border-radius: 0px 0px 0px 5px;\\n border-right: 0 none;\\n right: 0;\\n}\\n\\n.ace_search_form, .ace_replace_form {\\n margin: 0 20px 4px 0;\\n overflow: hidden;\\n line-height: 1.9;\\n}\\n.ace_replace_form {\\n margin-right: 0;\\n}\\n.ace_search_form.ace_nomatch {\\n outline: 1px solid red;\\n}\\n\\n.ace_search_field {\\n border-radius: 3px 0 0 3px;\\n background-color: white;\\n color: black;\\n border: 1px solid #cbcbcb;\\n border-right: 0 none;\\n outline: 0;\\n padding: 0;\\n font-size: inherit;\\n margin: 0;\\n line-height: inherit;\\n padding: 0 6px;\\n min-width: 17em;\\n vertical-align: top;\\n min-height: 1.8em;\\n box-sizing: content-box;\\n}\\n.ace_searchbtn {\\n border: 1px solid #cbcbcb;\\n line-height: inherit;\\n display: inline-block;\\n padding: 0 6px;\\n background: #fff;\\n border-right: 0 none;\\n border-left: 1px solid #dcdcdc;\\n cursor: pointer;\\n margin: 0;\\n position: relative;\\n color: #666;\\n}\\n.ace_searchbtn:last-child {\\n border-radius: 0 3px 3px 0;\\n border-right: 1px solid #cbcbcb;\\n}\\n.ace_searchbtn:disabled {\\n background: none;\\n cursor: default;\\n}\\n.ace_searchbtn:hover {\\n background-color: #eef1f6;\\n}\\n.ace_searchbtn.prev, .ace_searchbtn.next {\\n padding: 0px 0.7em\\n}\\n.ace_searchbtn.prev:after, .ace_searchbtn.next:after {\\n content: \"\";\\n border: solid 2px #888;\\n width: 0.5em;\\n height: 0.5em;\\n border-width: 2px 0 0 2px;\\n display:inline-block;\\n transform: rotate(-45deg);\\n}\\n.ace_searchbtn.next:after {\\n border-width: 0 2px 2px 0 ;\\n}\\n.ace_searchbtn_close {\\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\\n border-radius: 50%;\\n border: 0 none;\\n color: #656565;\\n cursor: pointer;\\n font: 16px/16px Arial;\\n padding: 0;\\n height: 14px;\\n width: 14px;\\n top: 9px;\\n right: 7px;\\n position: absolute;\\n}\\n.ace_searchbtn_close:hover {\\n background-color: #656565;\\n background-position: 50% 100%;\\n color: white;\\n}\\n\\n.ace_button {\\n margin-left: 2px;\\n cursor: pointer;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -o-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n overflow: hidden;\\n opacity: 0.7;\\n border: 1px solid rgba(100,100,100,0.23);\\n padding: 1px;\\n box-sizing: border-box!important;\\n color: black;\\n}\\n\\n.ace_button:hover {\\n background-color: #eee;\\n opacity:1;\\n}\\n.ace_button:active {\\n background-color: #ddd;\\n}\\n\\n.ace_button.checked {\\n border-color: #3399ff;\\n opacity:1;\\n}\\n\\n.ace_search_options{\\n margin-bottom: 3px;\\n text-align: right;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -o-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n clear: both;\\n}\\n\\n.ace_search_counter {\\n float: left;\\n font-family: arial;\\n padding: 0 8px;\\n}'}),ace.define(\"ace/ext/searchbox\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/lib/lang\",\"ace/lib/event\",\"ace/ext/searchbox.css\",\"ace/keyboard/hash_handler\",\"ace/lib/keys\"],function(e,t,n){\"use strict\";var r=e(\"../lib/dom\"),i=e(\"../lib/lang\"),s=e(\"../lib/event\"),o=e(\"./searchbox.css\"),u=e(\"../keyboard/hash_handler\").HashHandler,a=e(\"../lib/keys\"),f=999;r.importCssString(o,\"ace_searchbox\",!1);var l=function(e,t,n){var i=r.createElement(\"div\");r.buildDom([\"div\",{\"class\":\"ace_search right\"},[\"span\",{action:\"hide\",\"class\":\"ace_searchbtn_close\"}],[\"div\",{\"class\":\"ace_search_form\"},[\"input\",{\"class\":\"ace_search_field\",placeholder:\"Search for\",spellcheck:\"false\"}],[\"span\",{action:\"findPrev\",\"class\":\"ace_searchbtn prev\"},\"\\u200b\"],[\"span\",{action:\"findNext\",\"class\":\"ace_searchbtn next\"},\"\\u200b\"],[\"span\",{action:\"findAll\",\"class\":\"ace_searchbtn\",title:\"Alt-Enter\"},\"All\"]],[\"div\",{\"class\":\"ace_replace_form\"},[\"input\",{\"class\":\"ace_search_field\",placeholder:\"Replace with\",spellcheck:\"false\"}],[\"span\",{action:\"replaceAndFindNext\",\"class\":\"ace_searchbtn\"},\"Replace\"],[\"span\",{action:\"replaceAll\",\"class\":\"ace_searchbtn\"},\"All\"]],[\"div\",{\"class\":\"ace_search_options\"},[\"span\",{action:\"toggleReplace\",\"class\":\"ace_button\",title:\"Toggle Replace mode\",style:\"float:left;margin-top:-2px;padding:0 5px;\"},\"+\"],[\"span\",{\"class\":\"ace_search_counter\"}],[\"span\",{action:\"toggleRegexpMode\",\"class\":\"ace_button\",title:\"RegExp Search\"},\".*\"],[\"span\",{action:\"toggleCaseSensitive\",\"class\":\"ace_button\",title:\"CaseSensitive Search\"},\"Aa\"],[\"span\",{action:\"toggleWholeWords\",\"class\":\"ace_button\",title:\"Whole Word Search\"},\"\\\\b\"],[\"span\",{action:\"searchInSelection\",\"class\":\"ace_button\",title:\"Search In Selection\"},\"S\"]]],i),this.element=i.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),r.importCssString(o,\"ace_searchbox\",e.container)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(\".ace_search_form\"),this.replaceBox=e.querySelector(\".ace_replace_form\"),this.searchOption=e.querySelector(\"[action=searchInSelection]\"),this.replaceOption=e.querySelector(\"[action=toggleReplace]\"),this.regExpOption=e.querySelector(\"[action=toggleRegexpMode]\"),this.caseSensitiveOption=e.querySelector(\"[action=toggleCaseSensitive]\"),this.wholeWordOption=e.querySelector(\"[action=toggleWholeWords]\"),this.searchInput=this.searchBox.querySelector(\".ace_search_field\"),this.replaceInput=this.replaceBox.querySelector(\".ace_search_field\"),this.searchCounter=e.querySelector(\".ace_search_counter\")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;s.addListener(e,\"mousedown\",function(e){setTimeout(function(){t.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,\"click\",function(e){var n=e.target||e.srcElement,r=n.getAttribute(\"action\");r&&t[r]?t[r]():t.$searchBarKb.commands[r]&&t.$searchBarKb.commands[r].exec(t),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,n,r){var i=a.keyCodeToString(r),o=t.$searchBarKb.findKeyCommand(n,i);o&&o.exec&&(o.exec(t),s.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),s.addListener(this.searchInput,\"input\",function(){t.$onChange.schedule(20)}),s.addListener(this.searchInput,\"focus\",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),s.addListener(this.replaceInput,\"focus\",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new u([{bindKey:\"Esc\",name:\"closeSearchBar\",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new u,this.$searchBarKb.bindKeys({\"Ctrl-f|Command-f\":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?\"\":\"none\",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},\"Ctrl-H|Command-Option-F\":function(e){if(e.editor.getReadOnly())return;e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus()},\"Ctrl-G|Command-G\":function(e){e.findNext()},\"Ctrl-Shift-G|Command-Shift-G\":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},\"Shift-Return\":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},\"Alt-Return\":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:\"toggleRegexpMode\",bindKey:{win:\"Alt-R|Alt-/\",mac:\"Ctrl-Alt-R|Ctrl-Alt-/\"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:\"toggleCaseSensitive\",bindKey:{win:\"Alt-C|Alt-I\",mac:\"Ctrl-Alt-R|Ctrl-Alt-I\"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:\"toggleWholeWords\",bindKey:{win:\"Alt-B|Alt-W\",mac:\"Ctrl-Alt-B|Ctrl-Alt-W\"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:\"toggleReplace\",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:\"searchInSelection\",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){this.searchRange=e,e?this.searchRangeMarker=this.editor.session.addMarker(e,\"ace_active-line\"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){r.setCssClass(this.replaceOption,\"checked\",this.searchRange),r.setCssClass(this.searchOption,\"checked\",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?\"-\":\"+\",r.setCssClass(this.regExpOption,\"checked\",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,\"checked\",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,\"checked\",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?\"none\":\"\",this.replaceBox.style.display=this.replaceOption.checked&&!t?\"\":\"none\",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var i=this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange}),s=!i&&this.searchInput.value;r.setCssClass(this.searchBox,\"ace_nomatch\",s),this.editor._emit(\"findSearchBox\",{match:!s}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,r=0;if(t){var i=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),s=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(s-=e.session.doc.positionToIndex(this.searchRange.start));var o=t.lastIndex=0,u;while(u=t.exec(i)){n++,o=u.index,o<=s&&r++;if(n>f)break;if(!u[0]){t.lastIndex=o+=1;if(o>=i.length)break}}}this.searchCounter.textContent=r+\" of \"+(n>f?f+\"+\":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked}),t=!e&&this.searchInput.value;r.setCssClass(this.searchBox,\"ace_nomatch\",t),this.editor._emit(\"findSearchBox\",{match:!t}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off(\"changeSession\",this.setSession),this.element.style.display=\"none\",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on(\"changeSession\",this.setSession),this.element.style.display=\"\",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(l.prototype),t.SearchBox=l,t.Search=function(e,t){var n=e.searchBox||new l(e);n.show(e.session.getTextRange(),t)}}); (function() {\n ace.require([\"ace/ext/searchbox\"], function(m) {\n if (typeof module == \"object\" && typeof exports == \"object\" && module) {\n module.exports = m;\n }\n });\n })();\n ",null,null,null,null,null,null,null,"/**\n * react-virtual\n *\n * Copyright (c) TanStack\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\nexport { _extends as extends };\n//# sourceMappingURL=_rollupPluginBabelHelpers.mjs.map\n","/**\n * virtual-core\n *\n * Copyright (c) TanStack\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\nexport { _extends as extends };\n//# sourceMappingURL=_rollupPluginBabelHelpers.mjs.map\n","/**\n * virtual-core\n *\n * Copyright (c) TanStack\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nfunction memo(getDeps, fn, opts) {\n var _opts$initialDeps;\n var deps = (_opts$initialDeps = opts.initialDeps) != null ? _opts$initialDeps : [];\n var result;\n return function () {\n var depTime;\n if (opts.key && opts.debug != null && opts.debug()) depTime = Date.now();\n var newDeps = getDeps();\n var depsChanged = newDeps.length !== deps.length || newDeps.some(function (dep, index) {\n return deps[index] !== dep;\n });\n if (!depsChanged) {\n return result;\n }\n deps = newDeps;\n var resultTime;\n if (opts.key && opts.debug != null && opts.debug()) resultTime = Date.now();\n result = fn.apply(void 0, newDeps);\n if (opts.key && opts.debug != null && opts.debug()) {\n var depEndTime = Math.round((Date.now() - depTime) * 100) / 100;\n var resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;\n var resultFpsPercentage = resultEndTime / 16;\n var pad = function pad(str, num) {\n str = String(str);\n while (str.length < num) {\n str = ' ' + str;\n }\n return str;\n };\n console.info(\"%c\\u23F1 \" + pad(resultEndTime, 5) + \" /\" + pad(depEndTime, 5) + \" ms\", \"\\n font-size: .6rem;\\n font-weight: bold;\\n color: hsl(\" + Math.max(0, Math.min(120 - 120 * resultFpsPercentage, 120)) + \"deg 100% 31%);\", opts == null ? void 0 : opts.key);\n }\n opts == null ? void 0 : opts.onChange == null ? void 0 : opts.onChange(result);\n return result;\n };\n}\nfunction notUndefined(value, msg) {\n if (value === undefined) {\n throw new Error(\"Unexpected undefined\" + (msg ? \": \" + msg : ''));\n } else {\n return value;\n }\n}\nvar approxEqual = function approxEqual(a, b) {\n return Math.abs(a - b) < 1;\n};\n\nexport { approxEqual, memo, notUndefined };\n//# sourceMappingURL=utils.mjs.map\n","/**\n * virtual-core\n *\n * Copyright (c) TanStack\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport { extends as _extends } from './_virtual/_rollupPluginBabelHelpers.mjs';\nimport { memo, notUndefined, approxEqual } from './utils.mjs';\nexport { approxEqual, memo, notUndefined } from './utils.mjs';\n\n//\n\n//\n\nvar defaultKeyExtractor = function defaultKeyExtractor(index) {\n return index;\n};\nvar defaultRangeExtractor = function defaultRangeExtractor(range) {\n var start = Math.max(range.startIndex - range.overscan, 0);\n var end = Math.min(range.endIndex + range.overscan, range.count - 1);\n var arr = [];\n for (var _i = start; _i <= end; _i++) {\n arr.push(_i);\n }\n return arr;\n};\nvar observeElementRect = function observeElementRect(instance, cb) {\n var element = instance.scrollElement;\n if (!element) {\n return;\n }\n var handler = function handler(rect) {\n var width = rect.width,\n height = rect.height;\n cb({\n width: Math.round(width),\n height: Math.round(height)\n });\n };\n handler(element.getBoundingClientRect());\n var observer = new ResizeObserver(function (entries) {\n var entry = entries[0];\n if (entry != null && entry.borderBoxSize) {\n var box = entry.borderBoxSize[0];\n if (box) {\n handler({\n width: box.inlineSize,\n height: box.blockSize\n });\n return;\n }\n }\n handler(element.getBoundingClientRect());\n });\n observer.observe(element, {\n box: 'border-box'\n });\n return function () {\n observer.unobserve(element);\n };\n};\nvar observeWindowRect = function observeWindowRect(instance, cb) {\n var element = instance.scrollElement;\n if (!element) {\n return;\n }\n var handler = function handler() {\n cb({\n width: element.innerWidth,\n height: element.innerHeight\n });\n };\n handler();\n element.addEventListener('resize', handler, {\n passive: true\n });\n return function () {\n element.removeEventListener('resize', handler);\n };\n};\nvar observeElementOffset = function observeElementOffset(instance, cb) {\n var element = instance.scrollElement;\n if (!element) {\n return;\n }\n var handler = function handler() {\n cb(element[instance.options.horizontal ? 'scrollLeft' : 'scrollTop']);\n };\n handler();\n element.addEventListener('scroll', handler, {\n passive: true\n });\n return function () {\n element.removeEventListener('scroll', handler);\n };\n};\nvar observeWindowOffset = function observeWindowOffset(instance, cb) {\n var element = instance.scrollElement;\n if (!element) {\n return;\n }\n var handler = function handler() {\n cb(element[instance.options.horizontal ? 'scrollX' : 'scrollY']);\n };\n handler();\n element.addEventListener('scroll', handler, {\n passive: true\n });\n return function () {\n element.removeEventListener('scroll', handler);\n };\n};\nvar measureElement = function measureElement(element, entry, instance) {\n if (entry != null && entry.borderBoxSize) {\n var box = entry.borderBoxSize[0];\n if (box) {\n var size = Math.round(box[instance.options.horizontal ? 'inlineSize' : 'blockSize']);\n return size;\n }\n }\n return Math.round(element.getBoundingClientRect()[instance.options.horizontal ? 'width' : 'height']);\n};\nvar windowScroll = function windowScroll(offset, _ref, instance) {\n var _instance$scrollEleme, _instance$scrollEleme2;\n var _ref$adjustments = _ref.adjustments,\n adjustments = _ref$adjustments === void 0 ? window.scrollY : _ref$adjustments,\n behavior = _ref.behavior;\n var toOffset = offset + adjustments;\n (_instance$scrollEleme = instance.scrollElement) == null ? void 0 : _instance$scrollEleme.scrollTo == null ? void 0 : _instance$scrollEleme.scrollTo((_instance$scrollEleme2 = {}, _instance$scrollEleme2[instance.options.horizontal ? 'left' : 'top'] = toOffset, _instance$scrollEleme2.behavior = behavior, _instance$scrollEleme2));\n};\nvar elementScroll = function elementScroll(offset, _ref2, instance) {\n var _instance$scrollEleme3, _instance$scrollEleme4;\n var _ref2$adjustments = _ref2.adjustments,\n adjustments = _ref2$adjustments === void 0 ? 0 : _ref2$adjustments,\n behavior = _ref2.behavior;\n var toOffset = offset + adjustments;\n (_instance$scrollEleme3 = instance.scrollElement) == null ? void 0 : _instance$scrollEleme3.scrollTo == null ? void 0 : _instance$scrollEleme3.scrollTo((_instance$scrollEleme4 = {}, _instance$scrollEleme4[instance.options.horizontal ? 'left' : 'top'] = toOffset, _instance$scrollEleme4.behavior = behavior, _instance$scrollEleme4));\n};\nvar Virtualizer = function Virtualizer(_opts) {\n var _this = this;\n this.unsubs = [];\n this.scrollElement = null;\n this.isScrolling = false;\n this.isScrollingTimeoutId = null;\n this.scrollToIndexTimeoutId = null;\n this.measurementsCache = [];\n this.itemSizeCache = new Map();\n this.pendingMeasuredCacheIndexes = [];\n this.scrollDirection = null;\n this.scrollAdjustments = 0;\n this.measureElementCache = new Map();\n this.observer = function () {\n var _ro = null;\n var get = function get() {\n if (_ro) {\n return _ro;\n } else if (typeof ResizeObserver !== 'undefined') {\n return _ro = new ResizeObserver(function (entries) {\n entries.forEach(function (entry) {\n _this._measureElement(entry.target, entry);\n });\n });\n } else {\n return null;\n }\n };\n return {\n disconnect: function disconnect() {\n var _get;\n return (_get = get()) == null ? void 0 : _get.disconnect();\n },\n observe: function observe(target) {\n var _get2;\n return (_get2 = get()) == null ? void 0 : _get2.observe(target, {\n box: 'border-box'\n });\n },\n unobserve: function unobserve(target) {\n var _get3;\n return (_get3 = get()) == null ? void 0 : _get3.unobserve(target);\n }\n };\n }();\n this.range = {\n startIndex: 0,\n endIndex: 0\n };\n this.setOptions = function (opts) {\n Object.entries(opts).forEach(function (_ref3) {\n var key = _ref3[0],\n value = _ref3[1];\n if (typeof value === 'undefined') delete opts[key];\n });\n _this.options = _extends({\n debug: false,\n initialOffset: 0,\n overscan: 1,\n paddingStart: 0,\n paddingEnd: 0,\n scrollPaddingStart: 0,\n scrollPaddingEnd: 0,\n horizontal: false,\n getItemKey: defaultKeyExtractor,\n rangeExtractor: defaultRangeExtractor,\n onChange: function onChange() {},\n measureElement: measureElement,\n initialRect: {\n width: 0,\n height: 0\n },\n scrollMargin: 0,\n scrollingDelay: 150,\n indexAttribute: 'data-index',\n initialMeasurementsCache: [],\n lanes: 1\n }, opts);\n };\n this.notify = function () {\n _this.options.onChange == null ? void 0 : _this.options.onChange(_this);\n };\n this.cleanup = function () {\n _this.unsubs.filter(Boolean).forEach(function (d) {\n return d();\n });\n _this.unsubs = [];\n _this.scrollElement = null;\n };\n this._didMount = function () {\n _this.measureElementCache.forEach(_this.observer.observe);\n return function () {\n _this.observer.disconnect();\n _this.cleanup();\n };\n };\n this._willUpdate = function () {\n var scrollElement = _this.options.getScrollElement();\n if (_this.scrollElement !== scrollElement) {\n _this.cleanup();\n _this.scrollElement = scrollElement;\n _this._scrollToOffset(_this.scrollOffset, {\n adjustments: undefined,\n behavior: undefined\n });\n _this.unsubs.push(_this.options.observeElementRect(_this, function (rect) {\n var prev = _this.scrollRect;\n _this.scrollRect = rect;\n if (_this.options.horizontal ? rect.width !== prev.width : rect.height !== prev.height) {\n _this.maybeNotify();\n }\n }));\n _this.unsubs.push(_this.options.observeElementOffset(_this, function (offset) {\n _this.scrollAdjustments = 0;\n if (_this.scrollOffset === offset) {\n return;\n }\n if (_this.isScrollingTimeoutId !== null) {\n clearTimeout(_this.isScrollingTimeoutId);\n _this.isScrollingTimeoutId = null;\n }\n _this.isScrolling = true;\n _this.scrollDirection = _this.scrollOffset < offset ? 'forward' : 'backward';\n _this.scrollOffset = offset;\n _this.maybeNotify();\n _this.isScrollingTimeoutId = setTimeout(function () {\n _this.isScrollingTimeoutId = null;\n _this.isScrolling = false;\n _this.scrollDirection = null;\n _this.maybeNotify();\n }, _this.options.scrollingDelay);\n }));\n }\n };\n this.getSize = function () {\n return _this.scrollRect[_this.options.horizontal ? 'width' : 'height'];\n };\n this.memoOptions = memo(function () {\n return [_this.options.count, _this.options.paddingStart, _this.options.scrollMargin, _this.options.getItemKey];\n }, function (count, paddingStart, scrollMargin, getItemKey) {\n _this.pendingMeasuredCacheIndexes = [];\n return {\n count: count,\n paddingStart: paddingStart,\n scrollMargin: scrollMargin,\n getItemKey: getItemKey\n };\n }, {\n key: false\n });\n this.getFurthestMeasurement = function (measurements, index) {\n var furthestMeasurementsFound = new Map();\n var furthestMeasurements = new Map();\n for (var m = index - 1; m >= 0; m--) {\n var measurement = measurements[m];\n if (furthestMeasurementsFound.has(measurement.lane)) {\n continue;\n }\n var previousFurthestMeasurement = furthestMeasurements.get(measurement.lane);\n if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) {\n furthestMeasurements.set(measurement.lane, measurement);\n } else if (measurement.end < previousFurthestMeasurement.end) {\n furthestMeasurementsFound.set(measurement.lane, true);\n }\n if (furthestMeasurementsFound.size === _this.options.lanes) {\n break;\n }\n }\n return furthestMeasurements.size === _this.options.lanes ? Array.from(furthestMeasurements.values()).sort(function (a, b) {\n return a.end - b.end;\n })[0] : undefined;\n };\n this.getMeasurements = memo(function () {\n return [_this.memoOptions(), _this.itemSizeCache];\n }, function (_ref4, itemSizeCache) {\n var count = _ref4.count,\n paddingStart = _ref4.paddingStart,\n scrollMargin = _ref4.scrollMargin,\n getItemKey = _ref4.getItemKey;\n var min = _this.pendingMeasuredCacheIndexes.length > 0 ? Math.min.apply(Math, _this.pendingMeasuredCacheIndexes) : 0;\n _this.pendingMeasuredCacheIndexes = [];\n var measurements = _this.measurementsCache.slice(0, min);\n for (var _i2 = min; _i2 < count; _i2++) {\n var key = getItemKey(_i2);\n var furthestMeasurement = _this.options.lanes === 1 ? measurements[_i2 - 1] : _this.getFurthestMeasurement(measurements, _i2);\n var start = furthestMeasurement ? furthestMeasurement.end : paddingStart + scrollMargin;\n var measuredSize = itemSizeCache.get(key);\n var size = typeof measuredSize === 'number' ? measuredSize : _this.options.estimateSize(_i2);\n var end = start + size;\n var lane = furthestMeasurement ? furthestMeasurement.lane : _i2 % _this.options.lanes;\n measurements[_i2] = {\n index: _i2,\n start: start,\n size: size,\n end: end,\n key: key,\n lane: lane\n };\n }\n _this.measurementsCache = measurements;\n return measurements;\n }, {\n key: process.env.NODE_ENV !== 'production' && 'getMeasurements',\n debug: function debug() {\n return _this.options.debug;\n }\n });\n this.calculateRange = memo(function () {\n return [_this.getMeasurements(), _this.getSize(), _this.scrollOffset];\n }, function (measurements, outerSize, scrollOffset) {\n return _this.range = calculateRange({\n measurements: measurements,\n outerSize: outerSize,\n scrollOffset: scrollOffset\n });\n }, {\n key: process.env.NODE_ENV !== 'production' && 'calculateRange',\n debug: function debug() {\n return _this.options.debug;\n }\n });\n this.maybeNotify = memo(function () {\n var range = _this.calculateRange();\n return [range.startIndex, range.endIndex, _this.isScrolling];\n }, function () {\n _this.notify();\n }, {\n key: process.env.NODE_ENV !== 'production' && 'maybeNotify',\n debug: function debug() {\n return _this.options.debug;\n },\n initialDeps: [this.range.startIndex, this.range.endIndex, this.isScrolling]\n });\n this.getIndexes = memo(function () {\n return [_this.options.rangeExtractor, _this.calculateRange(), _this.options.overscan, _this.options.count];\n }, function (rangeExtractor, range, overscan, count) {\n return rangeExtractor(_extends({}, range, {\n overscan: overscan,\n count: count\n }));\n }, {\n key: process.env.NODE_ENV !== 'production' && 'getIndexes',\n debug: function debug() {\n return _this.options.debug;\n }\n });\n this.indexFromElement = function (node) {\n var attributeName = _this.options.indexAttribute;\n var indexStr = node.getAttribute(attributeName);\n if (!indexStr) {\n console.warn(\"Missing attribute name '\" + attributeName + \"={index}' on measured element.\");\n return -1;\n }\n return parseInt(indexStr, 10);\n };\n this._measureElement = function (node, entry) {\n var item = _this.measurementsCache[_this.indexFromElement(node)];\n if (!item) {\n _this.measureElementCache.forEach(function (cached, key) {\n if (cached === node) {\n _this.observer.unobserve(node);\n _this.measureElementCache[\"delete\"](key);\n }\n });\n return;\n }\n var prevNode = _this.measureElementCache.get(item.key);\n if (!node.isConnected) {\n if (prevNode) {\n _this.observer.unobserve(prevNode);\n _this.measureElementCache[\"delete\"](item.key);\n }\n return;\n }\n if (prevNode !== node) {\n if (prevNode) {\n _this.observer.unobserve(prevNode);\n }\n _this.observer.observe(node);\n _this.measureElementCache.set(item.key, node);\n }\n var measuredItemSize = _this.options.measureElement(node, entry, _this);\n _this.resizeItem(item, measuredItemSize);\n };\n this.resizeItem = function (item, size) {\n var _this$itemSizeCache$g;\n var itemSize = (_this$itemSizeCache$g = _this.itemSizeCache.get(item.key)) != null ? _this$itemSizeCache$g : item.size;\n var delta = size - itemSize;\n if (delta !== 0) {\n if (item.start < _this.scrollOffset) {\n if (process.env.NODE_ENV !== 'production' && _this.options.debug) {\n console.info('correction', delta);\n }\n _this._scrollToOffset(_this.scrollOffset, {\n adjustments: _this.scrollAdjustments += delta,\n behavior: undefined\n });\n }\n _this.pendingMeasuredCacheIndexes.push(item.index);\n _this.itemSizeCache = new Map(_this.itemSizeCache.set(item.key, size));\n _this.notify();\n }\n };\n this.measureElement = function (node) {\n if (!node) {\n return;\n }\n _this._measureElement(node, undefined);\n };\n this.getVirtualItems = memo(function () {\n return [_this.getIndexes(), _this.getMeasurements()];\n }, function (indexes, measurements) {\n var virtualItems = [];\n for (var k = 0, len = indexes.length; k < len; k++) {\n var _i3 = indexes[k];\n var measurement = measurements[_i3];\n virtualItems.push(measurement);\n }\n return virtualItems;\n }, {\n key: process.env.NODE_ENV !== 'production' && 'getIndexes',\n debug: function debug() {\n return _this.options.debug;\n }\n });\n this.getVirtualItemForOffset = function (offset) {\n var measurements = _this.getMeasurements();\n return notUndefined(measurements[findNearestBinarySearch(0, measurements.length - 1, function (index) {\n return notUndefined(measurements[index]).start;\n }, offset)]);\n };\n this.getOffsetForAlignment = function (toOffset, align) {\n var size = _this.getSize();\n if (align === 'auto') {\n if (toOffset <= _this.scrollOffset) {\n align = 'start';\n } else if (toOffset >= _this.scrollOffset + size) {\n align = 'end';\n } else {\n align = 'start';\n }\n }\n if (align === 'start') {\n toOffset = toOffset;\n } else if (align === 'end') {\n toOffset = toOffset - size;\n } else if (align === 'center') {\n toOffset = toOffset - size / 2;\n }\n var scrollSizeProp = _this.options.horizontal ? 'scrollWidth' : 'scrollHeight';\n var scrollSize = _this.scrollElement ? 'document' in _this.scrollElement ? _this.scrollElement.document.documentElement[scrollSizeProp] : _this.scrollElement[scrollSizeProp] : 0;\n var maxOffset = scrollSize - _this.getSize();\n return Math.max(Math.min(maxOffset, toOffset), 0);\n };\n this.getOffsetForIndex = function (index, align) {\n if (align === void 0) {\n align = 'auto';\n }\n index = Math.max(0, Math.min(index, _this.options.count - 1));\n var measurement = notUndefined(_this.getMeasurements()[index]);\n if (align === 'auto') {\n if (measurement.end >= _this.scrollOffset + _this.getSize() - _this.options.scrollPaddingEnd) {\n align = 'end';\n } else if (measurement.start <= _this.scrollOffset + _this.options.scrollPaddingStart) {\n align = 'start';\n } else {\n return [_this.scrollOffset, align];\n }\n }\n var toOffset = align === 'end' ? measurement.end + _this.options.scrollPaddingEnd : measurement.start - _this.options.scrollPaddingStart;\n return [_this.getOffsetForAlignment(toOffset, align), align];\n };\n this.isDynamicMode = function () {\n return _this.measureElementCache.size > 0;\n };\n this.cancelScrollToIndex = function () {\n if (_this.scrollToIndexTimeoutId !== null) {\n clearTimeout(_this.scrollToIndexTimeoutId);\n _this.scrollToIndexTimeoutId = null;\n }\n };\n this.scrollToOffset = function (toOffset, _temp) {\n var _ref5 = _temp === void 0 ? {} : _temp,\n _ref5$align = _ref5.align,\n align = _ref5$align === void 0 ? 'start' : _ref5$align,\n behavior = _ref5.behavior;\n _this.cancelScrollToIndex();\n if (behavior === 'smooth' && _this.isDynamicMode()) {\n console.warn('The `smooth` scroll behavior is not fully supported with dynamic size.');\n }\n _this._scrollToOffset(_this.getOffsetForAlignment(toOffset, align), {\n adjustments: undefined,\n behavior: behavior\n });\n };\n this.scrollToIndex = function (index, _temp2) {\n var _ref6 = _temp2 === void 0 ? {} : _temp2,\n _ref6$align = _ref6.align,\n initialAlign = _ref6$align === void 0 ? 'auto' : _ref6$align,\n behavior = _ref6.behavior;\n index = Math.max(0, Math.min(index, _this.options.count - 1));\n _this.cancelScrollToIndex();\n if (behavior === 'smooth' && _this.isDynamicMode()) {\n console.warn('The `smooth` scroll behavior is not fully supported with dynamic size.');\n }\n var _this$getOffsetForInd = _this.getOffsetForIndex(index, initialAlign),\n toOffset = _this$getOffsetForInd[0],\n align = _this$getOffsetForInd[1];\n _this._scrollToOffset(toOffset, {\n adjustments: undefined,\n behavior: behavior\n });\n if (behavior !== 'smooth' && _this.isDynamicMode()) {\n _this.scrollToIndexTimeoutId = setTimeout(function () {\n _this.scrollToIndexTimeoutId = null;\n var elementInDOM = _this.measureElementCache.has(_this.options.getItemKey(index));\n if (elementInDOM) {\n var _this$getOffsetForInd2 = _this.getOffsetForIndex(index, align),\n _toOffset = _this$getOffsetForInd2[0];\n if (!approxEqual(_toOffset, _this.scrollOffset)) {\n _this.scrollToIndex(index, {\n align: align,\n behavior: behavior\n });\n }\n } else {\n _this.scrollToIndex(index, {\n align: align,\n behavior: behavior\n });\n }\n });\n }\n };\n this.scrollBy = function (delta, _temp3) {\n var _ref7 = _temp3 === void 0 ? {} : _temp3,\n behavior = _ref7.behavior;\n _this.cancelScrollToIndex();\n if (behavior === 'smooth' && _this.isDynamicMode()) {\n console.warn('The `smooth` scroll behavior is not fully supported with dynamic size.');\n }\n _this._scrollToOffset(_this.scrollOffset + delta, {\n adjustments: undefined,\n behavior: behavior\n });\n };\n this.getTotalSize = function () {\n var _this$getMeasurements;\n return (((_this$getMeasurements = _this.getMeasurements()[_this.options.count - 1]) == null ? void 0 : _this$getMeasurements.end) || _this.options.paddingStart) - _this.options.scrollMargin + _this.options.paddingEnd;\n };\n this._scrollToOffset = function (offset, _ref8) {\n var adjustments = _ref8.adjustments,\n behavior = _ref8.behavior;\n _this.options.scrollToFn(offset, {\n behavior: behavior,\n adjustments: adjustments\n }, _this);\n };\n this.measure = function () {\n _this.itemSizeCache = new Map();\n _this.notify();\n };\n this.setOptions(_opts);\n this.scrollRect = this.options.initialRect;\n this.scrollOffset = this.options.initialOffset;\n this.measurementsCache = this.options.initialMeasurementsCache;\n this.measurementsCache.forEach(function (item) {\n _this.itemSizeCache.set(item.key, item.size);\n });\n this.maybeNotify();\n};\nvar findNearestBinarySearch = function findNearestBinarySearch(low, high, getCurrentValue, value) {\n while (low <= high) {\n var middle = (low + high) / 2 | 0;\n var currentValue = getCurrentValue(middle);\n if (currentValue < value) {\n low = middle + 1;\n } else if (currentValue > value) {\n high = middle - 1;\n } else {\n return middle;\n }\n }\n if (low > 0) {\n return low - 1;\n } else {\n return 0;\n }\n};\nfunction calculateRange(_ref9) {\n var measurements = _ref9.measurements,\n outerSize = _ref9.outerSize,\n scrollOffset = _ref9.scrollOffset;\n var count = measurements.length - 1;\n var getOffset = function getOffset(index) {\n return measurements[index].start;\n };\n var startIndex = findNearestBinarySearch(0, count, getOffset, scrollOffset);\n var endIndex = startIndex;\n while (endIndex < count && measurements[endIndex].end < scrollOffset + outerSize) {\n endIndex++;\n }\n return {\n startIndex: startIndex,\n endIndex: endIndex\n };\n}\n\nexport { Virtualizer, defaultKeyExtractor, defaultRangeExtractor, elementScroll, measureElement, observeElementOffset, observeElementRect, observeWindowOffset, observeWindowRect, windowScroll };\n//# sourceMappingURL=index.mjs.map\n","/**\n * react-virtual\n *\n * Copyright (c) TanStack\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport { extends as _extends } from './_virtual/_rollupPluginBabelHelpers.mjs';\nimport * as React from 'react';\nimport { observeElementRect, observeElementOffset, elementScroll, observeWindowRect, observeWindowOffset, windowScroll, Virtualizer } from '@tanstack/virtual-core';\nexport * from '@tanstack/virtual-core';\n\n//\n\nvar useIsomorphicLayoutEffect = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nfunction useVirtualizerBase(options) {\n var rerender = React.useReducer(function () {\n return {};\n }, {})[1];\n var resolvedOptions = _extends({}, options, {\n onChange: function onChange(instance) {\n rerender();\n options.onChange == null ? void 0 : options.onChange(instance);\n }\n });\n var _React$useState = React.useState(function () {\n return new Virtualizer(resolvedOptions);\n }),\n instance = _React$useState[0];\n instance.setOptions(resolvedOptions);\n React.useEffect(function () {\n return instance._didMount();\n }, []);\n useIsomorphicLayoutEffect(function () {\n return instance._willUpdate();\n });\n return instance;\n}\nfunction useVirtualizer(options) {\n return useVirtualizerBase(_extends({\n observeElementRect: observeElementRect,\n observeElementOffset: observeElementOffset,\n scrollToFn: elementScroll\n }, options));\n}\nfunction useWindowVirtualizer(options) {\n return useVirtualizerBase(_extends({\n getScrollElement: function getScrollElement() {\n return typeof document !== 'undefined' ? window : null;\n },\n observeElementRect: observeWindowRect,\n observeElementOffset: observeWindowOffset,\n scrollToFn: windowScroll\n }, options));\n}\n\nexport { useVirtualizer, useWindowVirtualizer };\n//# sourceMappingURL=index.mjs.map\n","/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.21';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function',\n INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading whitespace. */\n var reTrimStart = /^\\s+/;\n\n /** Used to match a single whitespace character. */\n var reWhitespace = /\\s/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\n var reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\n function baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\n function trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '

' + func(text) + '

';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => '

fred, barney, & pebbles

'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': '