@abtnode/webapp 1.8.63-beta-a36b5e1a → 1.8.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.yml +6 -3
- package/build/asset-manifest.json +93 -0
- package/build/favicon.ico +0 -0
- package/build/icons/css/all.css +5919 -0
- package/build/icons/css/brands.css +14 -0
- package/build/icons/css/brands.min.css +12 -0
- package/build/icons/css/fontawesome.css +7816 -0
- package/build/icons/css/fontawesome.min.css +5864 -0
- package/build/icons/css/light.css +15 -0
- package/build/icons/css/light.min.css +13 -0
- package/build/icons/webfonts/fa-brands-400.eot +0 -0
- package/build/icons/webfonts/fa-brands-400.svg +1256 -0
- package/build/icons/webfonts/fa-brands-400.ttf +0 -0
- package/build/icons/webfonts/fa-brands-400.woff +0 -0
- package/build/icons/webfonts/fa-brands-400.woff2 +0 -0
- package/build/icons/webfonts/fa-light-300.eot +0 -0
- package/build/icons/webfonts/fa-light-300.svg +4445 -0
- package/build/icons/webfonts/fa-light-300.ttf +0 -0
- package/build/icons/webfonts/fa-light-300.woff +0 -0
- package/build/icons/webfonts/fa-light-300.woff2 +0 -0
- package/build/images/blocklet.png +0 -0
- package/build/images/blocklets-00c2c4.png +0 -0
- package/build/images/blocklets-222222.png +0 -0
- package/build/images/celebrate.png +0 -0
- package/build/images/community.svg +6 -0
- package/build/images/console-00c2c4.png +0 -0
- package/build/images/console-222222.png +0 -0
- package/build/images/dashboard-00c2c4.png +0 -0
- package/build/images/dashboard-222222.png +0 -0
- package/build/images/doc-222222.png +0 -0
- package/build/images/hourglass-222222.png +0 -0
- package/build/images/https-certificate-icon.png +0 -0
- package/build/images/labs-00c2c4.png +0 -0
- package/build/images/labs-222222.png +0 -0
- package/build/images/log-00c2c4.png +0 -0
- package/build/images/log-222222.png +0 -0
- package/build/images/member-222222.png +0 -0
- package/build/images/node.png +0 -0
- package/build/images/official.svg +1 -0
- package/build/images/private-222222.png +0 -0
- package/build/images/public-222222.png +0 -0
- package/build/images/public_avatar.png +0 -0
- package/build/images/router-00c2c4.png +0 -0
- package/build/images/router-222222.png +0 -0
- package/build/images/settings-00c2c4.png +0 -0
- package/build/images/settings-222222.png +0 -0
- package/build/images/slack.png +0 -0
- package/build/images/storage-222222.png +0 -0
- package/build/images/store-00c2c4.png +0 -0
- package/build/images/store-222222.png +0 -0
- package/build/images/team-00c2c4.png +0 -0
- package/build/images/team-222222.png +0 -0
- package/build/images/time-222222.png +0 -0
- package/build/images/upgrade.png +0 -0
- package/build/index.html +1 -0
- package/build/manifest.json +15 -0
- package/build/static/css/4381.5ade355d.chunk.css +1 -0
- package/build/static/css/4691.56c2f951.chunk.css +1 -0
- package/build/static/css/5245.5d6e9197.chunk.css +1 -0
- package/build/static/css/8213.f696fdbf.chunk.css +1 -0
- package/build/static/css/9779.f696fdbf.chunk.css +1 -0
- package/build/static/css/main.c9e90622.css +1 -0
- package/build/static/images/logo.png +0 -0
- package/build/static/js/1057.8280393f.chunk.js +1 -0
- package/build/static/js/1361.85e46159.chunk.js +1 -0
- package/build/static/js/1366.2f174c9b.chunk.js +2 -0
- package/build/static/js/1366.2f174c9b.chunk.js.LICENSE.txt +37 -0
- package/build/static/js/154.94956824.chunk.js +1 -0
- package/build/static/js/1826.07c285de.chunk.js +1 -0
- package/build/static/js/2129.120e36ae.chunk.js +1 -0
- package/build/static/js/2308.b65bc299.chunk.js +1 -0
- package/build/static/js/2564.eef717f3.chunk.js +1 -0
- package/build/static/js/2657.d3c62d57.chunk.js +1 -0
- package/build/static/js/2720.26eb1788.chunk.js +1 -0
- package/build/static/js/2828.4f318970.chunk.js +1 -0
- package/build/static/js/2878.5626558d.chunk.js +1 -0
- package/build/static/js/3111.84e02823.chunk.js +1 -0
- package/build/static/js/3476.c0b3411b.chunk.js +1 -0
- package/build/static/js/3633.8c7cf02d.chunk.js +1 -0
- package/build/static/js/3732.f5d8b39b.chunk.js +1 -0
- package/build/static/js/3776.1490b0f7.chunk.js +1 -0
- package/build/static/js/3829.b6d6cf45.chunk.js +1 -0
- package/build/static/js/4074.19db40ec.chunk.js +1 -0
- package/build/static/js/4104.b47ae0e1.chunk.js +1 -0
- package/build/static/js/4241.83e4f741.chunk.js +1 -0
- package/build/static/js/4274.e18ffddd.chunk.js +1 -0
- package/build/static/js/4349.7c2f6507.chunk.js +1 -0
- package/build/static/js/4381.631ef61d.chunk.js +2 -0
- package/build/static/js/4381.631ef61d.chunk.js.LICENSE.txt +22 -0
- package/build/static/js/4557.3907550e.chunk.js +1 -0
- package/build/static/js/4590.5a14012c.chunk.js +1 -0
- package/build/static/js/4633.9f946ed5.chunk.js +1 -0
- package/build/static/js/4691.550fcb40.chunk.js +2 -0
- package/build/static/js/4691.550fcb40.chunk.js.LICENSE.txt +8 -0
- package/build/static/js/5074.9ea094a9.chunk.js +1 -0
- package/build/static/js/5082.18d16cb9.chunk.js +1 -0
- package/build/static/js/519.adae6e43.chunk.js +1 -0
- package/build/static/js/556.381dcbd8.chunk.js +1 -0
- package/build/static/js/5984.25af6288.chunk.js +1 -0
- package/build/static/js/6158.8a43296d.chunk.js +1 -0
- package/build/static/js/6189.d6d74d14.chunk.js +1 -0
- package/build/static/js/6239.5a873a03.chunk.js +2 -0
- package/build/static/js/6239.5a873a03.chunk.js.LICENSE.txt +14 -0
- package/build/static/js/629.1a7f2553.chunk.js +1 -0
- package/build/static/js/6413.ab4a8e01.chunk.js +1 -0
- package/build/static/js/6602.c417a217.chunk.js +1 -0
- package/build/static/js/6780.64314507.chunk.js +1 -0
- package/build/static/js/6830.88b993a0.chunk.js +1 -0
- package/build/static/js/6866.2131ea60.chunk.js +2 -0
- package/build/static/js/6866.2131ea60.chunk.js.LICENSE.txt +8 -0
- package/build/static/js/6898.6fe0c32d.chunk.js +2 -0
- package/build/static/js/6898.6fe0c32d.chunk.js.LICENSE.txt +5 -0
- package/build/static/js/7016.835958ef.chunk.js +1 -0
- package/build/static/js/7298.a7286c09.chunk.js +1 -0
- package/build/static/js/7327.56a5e016.chunk.js +1 -0
- package/build/static/js/744.8b656dd2.chunk.js +1 -0
- package/build/static/js/7652.722b9180.chunk.js +1 -0
- package/build/static/js/8034.c4dcdeff.chunk.js +1 -0
- package/build/static/js/8058.0b2d4727.chunk.js +1 -0
- package/build/static/js/8213.09f25083.chunk.js +1 -0
- package/build/static/js/8235.add24931.chunk.js +1 -0
- package/build/static/js/8249.63c55b3a.chunk.js +1 -0
- package/build/static/js/8262.869cc799.chunk.js +1 -0
- package/build/static/js/8352.b57b0e44.chunk.js +1 -0
- package/build/static/js/8464.b4b82828.chunk.js +1 -0
- package/build/static/js/8606.66db67e2.chunk.js +1 -0
- package/build/static/js/9038.2908c176.chunk.js +1 -0
- package/build/static/js/9076.c77366bc.chunk.js +1 -0
- package/build/static/js/9301.a65db324.chunk.js +2 -0
- package/build/static/js/9301.a65db324.chunk.js.LICENSE.txt +8 -0
- package/build/static/js/9575.36f3de5b.chunk.js +2 -0
- package/build/static/js/9575.36f3de5b.chunk.js.LICENSE.txt +194 -0
- package/build/static/js/9779.bbf0dd81.chunk.js +1 -0
- package/build/static/js/main.cb5d8d67.js +2 -0
- package/build/static/js/main.cb5d8d67.js.LICENSE.txt +159 -0
- package/build/static/media/iconify.32b54549e843e448ee9b.cjs +2 -0
- package/build/static/media/iconify.32b54549e843e448ee9b.cjs.LICENSE.txt +13 -0
- package/build/static/media/lato-all-400-normal.3dc1eff492ab1f598560.woff +0 -0
- package/build/static/media/lato-all-700-normal.1e7707c9ec98d9b97e7f.woff +0 -0
- package/build/static/media/lato-latin-400-normal.be36596da218e1eec01c.woff2 +0 -0
- package/build/static/media/lato-latin-700-normal.8f28e0e1fdb195149f1c.woff2 +0 -0
- package/build/static/media/lato-latin-ext-400-normal.361f3dbb9db6a5980326.woff2 +0 -0
- package/build/static/media/lato-latin-ext-700-normal.9c8812eaec45956201e1.woff2 +0 -0
- package/build/static/media/logo.60f66bbe1ce9674a4df4e374c9d97fc4.svg +16 -0
- package/build/static/media/ubuntu-mono-all-400-normal.c879328bc62e9c68268f.woff +0 -0
- package/build/static/media/ubuntu-mono-cyrillic-400-normal.c367f416832eb8f1b846.woff2 +0 -0
- package/build/static/media/ubuntu-mono-cyrillic-ext-400-normal.eda1c4946b1f7bf58386.woff2 +0 -0
- package/build/static/media/ubuntu-mono-greek-400-normal.22f3bfc91f79c342bdf4.woff2 +0 -0
- package/build/static/media/ubuntu-mono-greek-ext-400-normal.b3459900ea8a25d1f7c2.woff2 +0 -0
- package/build/static/media/ubuntu-mono-latin-400-normal.18e32d9d743af28f913e.woff2 +0 -0
- package/build/static/media/ubuntu-mono-latin-ext-400-normal.b56e2315611d10838ad5.woff2 +0 -0
- package/package.json +1 -1
- package/api/gql/config.js +0 -392
- package/api/gql/index.js +0 -102
- package/api/gql/middlewares/create-audit-log.js +0 -3
- package/api/gql/middlewares/get-blocklet-list.js +0 -14
- package/api/gql/middlewares/install-blocklet.js +0 -13
- package/api/gql/middlewares/verify-blocklet.js +0 -21
- package/api/gql/middlewares/verify-team.js +0 -9
- package/api/index.js +0 -249
- package/api/libs/auth.js +0 -78
- package/api/libs/env.js +0 -3
- package/api/libs/login.js +0 -212
- package/api/libs/security.js +0 -90
- package/api/libs/storage.js +0 -69
- package/api/middlewares/mutate-blocklet-permission.js +0 -18
- package/api/routes/auth/accept-server.js +0 -28
- package/api/routes/auth/connect-owner.js +0 -143
- package/api/routes/auth/delegate-transfer-owner-nft.js +0 -86
- package/api/routes/auth/invite.js +0 -93
- package/api/routes/auth/issue-passport.js +0 -61
- package/api/routes/auth/launch-free-blocklet-by-nft.js +0 -9
- package/api/routes/auth/launch-free-blocklet.js +0 -9
- package/api/routes/auth/launch-paid-blocklet-by-nft.js +0 -9
- package/api/routes/auth/launch-paid-blocklet.js +0 -9
- package/api/routes/auth/login.js +0 -63
- package/api/routes/auth/lost-passport-issue.js +0 -5
- package/api/routes/auth/lost-passport-list.js +0 -5
- package/api/routes/auth/switch-passport.js +0 -47
- package/api/routes/auth/switch-profile.js +0 -69
- package/api/routes/auth/util.js +0 -135
- package/api/routes/auth/verify-owner.js +0 -39
- package/api/routes/auth/verify-purchase.js +0 -185
- package/api/routes/blocklet-info.js +0 -246
- package/api/routes/blocklet-preference.js +0 -161
- package/api/routes/blocklet-proxy.js +0 -220
- package/api/routes/did-resolver.js +0 -38
- package/api/routes/dns-resolver.js +0 -73
- package/api/routes/log.js +0 -31
- package/api/routes/passport.js +0 -19
- package/api/routes/session.js +0 -61
- package/api/routes/user.js +0 -38
- package/api/util/find-routing-rule.js +0 -95
- package/api/util/get-configs.js +0 -31
- package/api/util/index.js +0 -5
- package/api/util/navigation.js +0 -84
- package/api/webpack.blocklet.js +0 -43
- package/api/ws/index.js +0 -146
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[8235],{28235:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return H}});var i,r=n(71171),a=n(33028),o=n(32723),s=n(34795),l=n(96234),c=n(5057),u=n(33518),p=n(85493),f=n(10458),d=n.n(f),v=n(6352),h=n.n(v),x=n(54725),m=n.n(x),g=n(78038),C=n.n(g),b=n(26796),w=n(67654),y=n(45459),_=n(57090),j=n(52118),O=n(34519),k=n(25339),P=n(60411),L=n(74094),M=n(96266),Z=n(55227).Buffer,S=function(e){return Z.from(e).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")};function N(e){var t=(0,k.Tt)(),n=t.api,i=t.session,r=(0,P.h6)().info,u=(0,p.TH)(),f=(0,p.s0)(),v=(0,j.useLocaleContext)(),x=v.t,g=v.locale,Z=C().box.keyPair(),N=(0,w.default)("__encKey",S(Z.publicKey)),H=(0,l.Z)(N,1)[0];(0,w.default)("__decKey",S(Z.secretKey));var R=(0,c.useState)(!1),D=(0,l.Z)(R,2),z=D[0],U=D[1],T=(0,c.useMemo)((function(){return new URLSearchParams(u.search).get("inviteId")}),[u]),I=(0,b.default)((0,s.Z)((0,o.Z)().mark((function e(){var t,i,a,s,l,c,u;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T){e.next=2;break}return e.abrupt("return",null);case 2:return e.next=4,n.get("/api/invitation",{params:{inviteId:T}});case 4:if(i=e.sent,a=i.data,!(s=!!m()(r,"ownerNft.did")&&"owner"===a.role.name)){e.next=17;break}return(l=new URL(window.location.href)).pathname=h()((0,L.Y5)(),"/api/did/invite/token"),l.searchParams.set("_ek_",H),l.searchParams.set("inviteId",T),e.next=14,n.get(l.href);case 14:c=e.sent,u=c.data,t=u;case 17:return e.abrupt("return",{invitation:a,nextWorkflow:t,needReceiveNFT:s});case 18:case"end":return e.stop()}}),e)})))),V=(0,c.useCallback)((function(){U(!0)}),[]),B=(0,c.useCallback)((0,s.Z)((0,o.Z)().mark((function e(){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!I.error){e.next=2;break}throw I.error;case 2:return e.abrupt("return",I.value.invitation);case 3:case"end":return e.stop()}}),e)}))),[I]),A=(0,c.useCallback)(function(){var e=(0,s.Z)((0,o.Z)().mark((function e(t,n){var r,a;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return localStorage.setItem("__sst",n(t.sessionToken)),(r=new URLSearchParams(u.search)).delete("inviteId"),a=r.toString(),e.next=6,i.refresh();case 6:f("/".concat(a?"?".concat(a):a),{replace:!0});case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),[u,f,i]);if(I.loading)return(0,M.jsx)(O.default,{});return(0,M.jsxs)(F,{className:"page-invite",children:[m()(I,"value.needReceiveNFT")&&(0,M.jsx)(_.default,{action:"login",popup:!0,className:"connect",open:z,locale:g,baseUrl:r.launcher.url,checkFn:d().create({baseURL:r.launcher.url}).get,onSuccess:function(e,t){var r=new URL(window.location.href);r.pathname=h()((0,L.Y5)(),"/api/did/invite/status"),r.searchParams.set("_t_",I.value.nextWorkflow.token),r.searchParams.set("locale",g);var a=setInterval((0,s.Z)((0,o.Z)().mark((function e(){var s,l;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.get(r.href);case 2:s=e.sent,"succeed"===(l=s.data).status&&(clearInterval(a),i.updateConnectedInfo(l),A(l,H?t:function(){}));case 5:case"end":return e.stop()}}),e)}))),2e3)},onClose:function(){U(!1)},checkTimeout:3e5,webWalletUrl:(0,L.yP)(r),extraParams:{nw:m()(I,"value.nextWorkflow.url")},messages:{title:x("invite.transferNFTDialog.title",{name:r.name}),scan:x("invite.transferNFTDialog.scan"),confirm:x("invite.transferNFTDialog.confirm"),success:x("invite.transferNFTDialog.success")},prefix:"/.well-known/service/api/did"}),(0,M.jsx)(y.Z,(0,a.Z)((0,a.Z)({},e),{},{getDataFn:B,checkFn:n.get,onLoginSuccess:A,passportColor:"default",onReceive:m()(I,"value.needReceiveNFT")?V:null}))]})}var F=u.default.div(i||(i=(0,r.Z)(["\n width: 100vw;\n height: 100%;\n min-height: 100vh;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: #f6f8fa;\n overflow: auto;\n padding: 20px;\n"])));function H(){return(0,P.h6)().loading?(0,M.jsx)(O.default,{}):(0,M.jsx)(N,{})}},49777:function(e,t,n){var i=n(6377),r=i.getNftBGColor,a=i.DEFAULT_COLOR,o=i.getNftBGColorFromDid;e.exports=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.issuer,i=void 0===n?"":n,s=t.title,l=void 0===s?"":s,c=t.issuerDid,u=void 0===c?"":c,p=t.ownerName,f=void 0===p?"":p,d=t.preferredColor,v=void 0===d?"default":d,h=t.ownerAvatarUrl,x=void 0===h?"":h,m=t.revoked,g=t.isDataUrl,C=t.width,b=void 0===C?"100%":C,w=t.height,y=void 0===w?"100%":w;e="default"===v?a:"auto"===v?o(u):r(v);var _='<svg width="'.concat(b,'" height="').concat(y,'" viewBox="0 0 424 564" fill="none" xmlns="http://www.w3.org/2000/svg">\n<rect x="1" y="1" width="422" height="562" rx="21" fill="url(#paint0_linear_6_342)"/>\n<text x="360" y="65" fill="white" xml:space="preserve" font-family="Roboto,Helvetica" font-size="').concat(l.length>=12?12:l.length>=10?14:l.length>=8?18:l.length>=6?24:28,'" letter-spacing="0px" style="dominant-baseline:middle;text-anchor:middle;">').concat(l.toUpperCase(),'</text>\n<text opacity="0.4" fill="white" xml:space="preserve" style="white-space: pre" font-family="Roboto,Helvetica" font-size="16" font-weight="500" letter-spacing="0px"><tspan x="319" y="40.9688">PASSPORT</tspan></text>\n<text fill="white" xml:space="preserve" style="white-space: pre" font-family="Roboto,Helvetica" font-size="').concat(i.length>15?20:24,'" font-weight="500" letter-spacing="0px"><tspan x="26" y="60.2031">').concat(i,'</tspan></text>\n<rect x="2" y="102" width="420" height="168" fill="black" fill-opacity="0.3"/>\n<circle cx="212" cy="250" r="60" fill="#FBFBFB"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M212.224 247.722C218.932 247.722 224.37 242.284 224.37 235.575C224.37 228.867 218.932 223.429 212.224 223.429C205.515 223.429 200.077 228.867 200.077 235.575C200.077 242.284 205.515 247.722 212.224 247.722ZM188.857 272.018C188.857 274.573 190.929 276.645 193.484 276.645H230.962C231.28 276.645 231.597 276.612 231.908 276.547C234.41 276.025 236.014 273.574 235.492 271.072L234.335 265.533C232.991 259.099 227.319 254.489 220.746 254.489H203.7C197.127 254.489 191.455 259.099 190.112 265.533L188.955 271.072C188.89 271.383 188.857 271.7 188.857 272.018Z" fill="#FBFBFB" />\n<path d="M231.908 276.547L232.215 278.016L231.908 276.547ZM235.492 271.072L236.96 270.765H236.96L235.492 271.072ZM234.335 265.533L232.866 265.839L234.335 265.533ZM190.112 265.533L191.58 265.839L190.112 265.533ZM188.955 271.072L187.487 270.765H187.487L188.955 271.072ZM222.87 235.575C222.87 241.455 218.104 246.222 212.224 246.222V249.222C219.761 249.222 225.87 243.112 225.87 235.575H222.87ZM212.224 224.929C218.104 224.929 222.87 229.695 222.87 235.575H225.87C225.87 228.038 219.761 221.929 212.224 221.929V224.929ZM201.577 235.575C201.577 229.695 206.344 224.929 212.224 224.929V221.929C204.687 221.929 198.577 228.038 198.577 235.575H201.577ZM212.224 246.222C206.344 246.222 201.577 241.455 201.577 235.575H198.577C198.577 243.112 204.687 249.222 212.224 249.222V246.222ZM193.484 275.145C191.757 275.145 190.357 273.745 190.357 272.018H187.357C187.357 275.402 190.1 278.145 193.484 278.145V275.145ZM230.962 275.145H193.484V278.145H230.962V275.145ZM231.601 275.079C231.391 275.123 231.177 275.145 230.962 275.145V278.145C231.383 278.145 231.803 278.102 232.215 278.016L231.601 275.079ZM234.023 271.379C234.376 273.069 233.292 274.726 231.601 275.079L232.215 278.016C235.527 277.324 237.652 274.078 236.96 270.765L234.023 271.379ZM232.866 265.839L234.023 271.379L236.96 270.765L235.803 265.226L232.866 265.839ZM220.746 255.989C226.609 255.989 231.668 260.1 232.866 265.839L235.803 265.226C234.314 258.097 228.029 252.989 220.746 252.989V255.989ZM203.7 255.989H220.746V252.989H203.7V255.989ZM191.58 265.839C192.779 260.1 197.838 255.989 203.7 255.989V252.989C196.417 252.989 190.132 258.097 188.643 265.226L191.58 265.839ZM190.423 271.379L191.58 265.839L188.643 265.226L187.487 270.765L190.423 271.379ZM190.357 272.018C190.357 271.803 190.379 271.589 190.423 271.379L187.487 270.765C187.401 271.177 187.357 271.597 187.357 272.018H190.357Z" fill="#BFBFBF" />\n<circle cx="212" cy="250" r="60" fill="url(#raduisImage)"/>\n<defs>\n<pattern id="raduisImage" patternUnits="userSpaceOnUse" width="424" height="564">\n<image x="152" y="190" href="').concat(x,'" width="120" height="120" />\n</pattern>\n</defs>\n<text x="215" y="350" fill="white" xml:space="preserve" style="dominant-baseline:middle;text-anchor:middle;" font-family="Roboto,Helvetica" font-size="28" font-weight="500" letter-spacing="0px">').concat(f,'</text>\n<text opacity="0.4" fill="white" xml:space="preserve" style="white-space: pre" font-family="Roboto,Helvetica" font-size="18" font-weight="500" letter-spacing="0px"><tspan x="26" y="407.652">ISSUER DID</tspan></text>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M28.6722 423.313H45.3819C46.4294 423.313 47.2787 424.162 47.2787 425.21V433.79C47.2787 434.838 46.4294 435.687 45.3819 435.687H28.6722C27.9517 435.687 27.3249 435.285 27.0039 434.694H26.1167C26.4887 435.746 27.4924 436.5 28.6722 436.5H45.3819C46.8784 436.5 48.0916 435.287 48.0916 433.79V425.21C48.0916 423.713 46.8784 422.5 45.3819 422.5H28.6722C27.3296 422.5 26.215 423.477 26 424.758H26.8295C27.0321 423.929 27.7803 423.313 28.6722 423.313ZM27.8801 432.096C27.7831 432.089 27.6966 432.082 27.6204 432.075V427.526C27.7243 427.512 27.8351 427.505 27.9528 427.505C28.0705 427.498 28.1848 427.494 28.2955 427.494C29.1057 427.494 29.6978 427.688 30.0717 428.076C30.4457 428.464 30.6326 429.035 30.6326 429.79C30.6326 430.51 30.4353 431.074 30.0406 431.483C29.6528 431.892 29.0538 432.096 28.2436 432.096H27.8801ZM32.0141 431.421C32.208 430.957 32.305 430.413 32.305 429.79C32.305 429.139 32.208 428.582 32.0141 428.118C31.8202 427.654 31.5432 427.273 31.1832 426.975C30.8231 426.677 30.3903 426.459 29.8848 426.321C29.3862 426.182 28.8288 426.113 28.2125 426.113C27.9216 426.113 27.5719 426.127 27.1634 426.154C26.7617 426.175 26.3739 426.22 26 426.29V433.301C26.3739 433.377 26.7548 433.425 27.1426 433.446C27.5304 433.474 27.8697 433.488 28.1605 433.488C28.7976 433.488 29.3723 433.412 29.8848 433.259C30.3972 433.107 30.83 432.878 31.1832 432.574C31.5432 432.269 31.8202 431.885 32.0141 431.421ZM35.2788 426.196H33.6585V433.394H35.2788V426.196ZM38.5654 432.075C38.6416 432.082 38.7281 432.089 38.8251 432.096H39.1886C39.9988 432.096 40.5978 431.892 40.9856 431.483C41.3803 431.074 41.5776 430.51 41.5776 429.79C41.5776 429.035 41.3907 428.464 41.0167 428.076C40.6428 427.688 40.0507 427.494 39.2405 427.494C39.1298 427.494 39.0155 427.498 38.8978 427.505C38.7801 427.505 38.6693 427.512 38.5654 427.526V432.075ZM43.25 429.79C43.25 430.413 43.153 430.957 42.9591 431.421C42.7652 431.885 42.4882 432.269 42.1282 432.574C41.775 432.878 41.3422 433.107 40.8298 433.259C40.3173 433.412 39.7426 433.488 39.1055 433.488C38.8147 433.488 38.4754 433.474 38.0876 433.446C37.6998 433.425 37.3189 433.377 36.945 433.301V426.29C37.3189 426.22 37.7067 426.175 38.1084 426.154C38.5169 426.127 38.8666 426.113 39.1574 426.113C39.7738 426.113 40.3312 426.182 40.8298 426.321C41.3353 426.459 41.7681 426.677 42.1282 426.975C42.4882 427.273 42.7652 427.654 42.9591 428.118C43.153 428.582 43.25 429.139 43.25 429.79ZM45.1907 428.355C44.8209 428.355 44.5161 428.055 44.5161 427.686C44.5161 427.316 44.8209 427.016 45.1907 427.016C45.5604 427.016 45.8652 427.316 45.8652 427.686C45.8652 428.055 45.5604 428.355 45.1907 428.355ZM45.1907 431.855C44.8209 431.855 44.5161 431.555 44.5161 431.185C44.5161 430.815 44.8209 430.516 45.1907 430.516C45.5604 430.516 45.8652 430.815 45.8652 431.185C45.8652 431.555 45.5604 431.855 45.1907 431.855Z" fill="white"/>\n<text fill="white" xml:space="preserve" style="white-space: pre" font-family="Roboto,Helvetica" font-size="15" font-weight="500" letter-spacing="0px"><tspan x="54.0916" y="434.969">').concat(u,'</tspan></text>\n<rect x="1" y="1" width="422" height="562" rx="21" stroke="#F0F0F0" stroke-width="2"/>\n<defs>\n<linearGradient id="paint0_linear_6_342" x1="414.5" y1="562" x2="-116.166" y2="156.726" gradientUnits="userSpaceOnUse">\n<stop stop-color="').concat(e.startColor,'"/>\n<stop offset="1" stop-color="').concat(e.endColor,'"/>\n</linearGradient>\n</defs>\n').concat(m?'<circle cx="210" cy="250" r="120" stroke="rgba(255,0,0,0.5)" stroke-width="25" /><line x1="132" y1="168" x2="296" y2="323" stroke="rgba(255,0,0,0.5)" stroke-width="25" />':"","\n</svg>");return g?"data:image/svg+xml;utf8,".concat(encodeURIComponent(_)):_}},6377:function(e,t,n){var i=n(49394).toHex,r=n(18033).Hasher,a=function(e){if(e){var t=function(e){var t,n,i=e.replace("#",""),r=parseInt(i.slice(0,2),16)/255,a=parseInt(i.slice(2,4),16)/255,o=parseInt(i.slice(4,6),16)/255,s=Math.max(r,a,o),l=Math.min(r,a,o),c=(s+l)/2;if(s===l)t=0,n=0;else{var u=s-l;switch(n=c>.5?u/(2-s-l):u/(s+l),s){case r:t=(a-o)/u+(a<o?6:0);break;case a:t=(o-r)/u+2;break;case o:t=(r-a)/u+4}t/=6}return[t,n,c]}(e),n=[t[0]];t[1]>.7?n.push(.7):n.push(t[1]),t[2]>.6?n.push(.6):t[2]<.3?n.push(.3):n.push(t[2]);var i=[n[0],n[1],n[2]-.1],r=s.apply(void 0,n);return{startColor:s.apply(void 0,i),endColor:r}}return{startColor:"#2B3845",endColor:"#5A7A8A"}};function o(e){return"#".concat(i(r.SHA3.hash224(e)).slice(-6))}function s(e,t,n){var i,r,a;if(0===t)i=n,r=n,a=n;else{var o=function(e,t,n){var i=n;return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e},s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=o(l,s,e+1/3),r=o(l,s,e),a=o(l,s,e-1/3)}return"#".concat([Math.round(255*i),Math.round(255*r),Math.round(255*a)].map((function(e){return e.toString(16).padStart(2,0)})).join(""))}e.exports={getNftBGColor:a,getNftBGColorFromDid:function(e){return a(o(e))},DEFAULT_COLOR:{startColor:"#2B3845",endColor:"#5A7A8A"},getPassportColorFromDid:o}},53317:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=c(n(55898)),a=c(n(33518)),o=c(n(34916)),s=n(96266),l=["invitation"];function c(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(e,t,n){return(t=function(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))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function v(e){var t=e.invitation,n=d(e,l);return(0,s.jsxs)(m,p(p({},n),{},{children:[(0,s.jsx)(o.default,{did:t.info.did,src:t.info.logo,style:{flexShrink:0}}),(0,s.jsxs)("div",{className:"invite-app__content",children:[(0,s.jsx)("div",{className:"invite-app__title",children:t.info.name}),(0,s.jsx)("div",{className:"invite-app__description",children:t.info.description})]})]}))}v.propTypes={invitation:r.default.object.isRequired};var h,x,m=a.default.div(i||(h=["\n display: flex;\n justify-content: space-between;\n align-items: center;\n overflow: hidden;\n .invite-app__content {\n flex: 1;\n margin: 0 12px;\n font-weight: 700;\n overflow: hidden;\n }\n .invite-app__title {\n line-height: 1;\n margin-bottom: 2px;\n overflow: hidden;\n }\n .invite-app__description {\n font-size: 12px;\n white-space: nowrap;\n text-overflow: ellipsis;\n height: 1.3em;\n color: #999;\n overflow: hidden;\n }\n"],x||(x=h.slice(0)),i=Object.freeze(Object.defineProperties(h,{raw:{value:Object.freeze(x)}})))),g=v;t.default=g},91349:function(e,t,n){"use strict";var i=n(43681).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=n(5057),o=d(n(55898)),s=d(n(33518)),l=d(n(49777)),c=n(52118),u=d(n(99593)),p=n(604),f=n(96266);function d(e){return e&&e.__esModule?e:{default:e}}function v(e){var t=e.invitation,n=e.passportColor,r=(0,a.useState)(!1),o=i(r,2),s=o[0],d=o[1],v=(0,a.useContext)(c.LocaleContext).t,h=(0,a.useMemo)((function(){return(t.role.title||t.role.name).toUpperCase()}),[t.role.title,t.role.name]),x=(0,a.useMemo)((function(){return(0,l.default)({title:h,issuer:t.info.name,issuerDid:t.info.appDid,ownerName:"Your Name",isDataUrl:!0,preferredColor:t.info.passportColor||n})}),[t,h]),g=(0,a.useCallback)((function(){d(!0)}),[]),C=(0,a.useCallback)((function(){d(!1)}),[]);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(m,{children:[(0,f.jsx)("div",{className:"invite-passport__card",children:(0,f.jsx)("img",{src:x,alt:"passport",className:"invite-passport__cover"})}),(0,f.jsxs)("div",{className:"invite-passport__content",children:[(0,f.jsx)("div",{className:"invite-passport__title",children:h}),(0,f.jsx)("div",{className:"invite-passport__description",title:t.role.description,children:t.role.description}),(0,f.jsx)("div",{style:{flex:1}}),(0,f.jsx)("div",{className:"invite-passport__view-permission",onClick:g,children:v("invite.viewPermission")})]})]}),(0,f.jsx)(u.default,{open:s,title:v("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:C,children:t.role.permissions&&t.role.permissions.length>0?(0,f.jsx)("ul",{style:{listStyle:"circle",padding:"0 20px"},children:t.role.permissions.map((function(e){return(0,f.jsx)("li",{style:{listStyle:"circle"},children:e.description},e.name)}))}):(0,f.jsxs)("div",{style:{color:"#999",textAlign:"center"},children:[(0,f.jsx)(p.Inbox,{style:{width:"30px",height:"30px"}}),(0,f.jsx)("div",{children:v("invite.emptyPermission")})]})})]})}v.propTypes={invitation:o.default.object.isRequired,passportColor:o.default.string},v.defaultProps={passportColor:"auto"};var h,x,m=s.default.div(r||(h=["\n display: flex;\n max-width: 350px;\n margin: 30px auto;\n .invite-passport__card {\n margin-right: 12px;\n width: 100px;\n height: 100px;\n flex-shrink: 0;\n .invite-passport__cover {\n width: 100%;\n height: 100%;\n }\n }\n .invite-passport__content {\n flex: 1;\n display: flex;\n flex-direction: column;\n }\n .invite-passport__title {\n font-weight: 700;\n font-size: 16px;\n }\n .invite-passport__description {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n height: 3em;\n color: #999;\n font-size: 14px;\n }\n .invite-passport__view-permission {\n cursor: pointer;\n font-size: 14px;\n font-weight: 600;\n line-height: 18px;\n color: ",";\n }\n"],x||(x=h.slice(0)),r=Object.freeze(Object.defineProperties(h,{raw:{value:Object.freeze(x)}}))),(function(e){return e.theme.palette.primary.main})),g=v;t.default=g},17223:function(e,t,n){"use strict";var i=n(43681).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=n(5057),o=h(n(55898)),s=h(n(33518)),l=n(52118),c=h(n(57090)),u=h(n(75095)),p=n(12331),f=n(99875),d=h(n(22317)),v=n(96266);function h(e){return e&&e.__esModule?e:{default:e}}function x(e){var t=e.invitation,n=e.checkFn,r=e.onLoginSuccess,o=e.onReceive,s=(0,a.useState)(!1),h=i(s,2),x=h[0],m=h[1],g=(0,l.useLocaleContext)(),b=g.t,w=g.locale,y={passportId:(0,(0,d.default)().getPassportId)(),inviteId:t.inviteId},_=(0,a.useCallback)((function(){m(!1)}),[]),j=(0,a.useCallback)((function(){m(!1),r.apply(void 0,arguments)}),[r]),O=(0,a.useCallback)((function(){"function"!==typeof o?m(!0):o()}),[]);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(C,{children:[(0,v.jsx)(u.default,{size:"large",variant:"contained",className:"invite-receive__button","data-cy":"invite-receive-passport",color:"primary",onClick:O,children:b("invite.receive")}),(0,v.jsxs)("div",{className:"invite-receive__until",children:[b("invite.validUntil"),(0,f.formatDateTime)(t.expireDate)]})]}),(0,v.jsx)(c.default,{popup:!0,open:x,className:"connect",action:"invite",checkFn:n,checkTimeout:6e5,onSuccess:j,onClose:_,locale:w,webWalletUrl:(0,p.getWebWalletUrl)(),messages:{title:b("receive.dialog.title"),scan:b("receive.dialog.scan"),confirm:b("receive.dialog.confirm"),success:b("receive.dialog.success")},extraParams:y})]})}x.propTypes={invitation:o.default.object.isRequired,checkFn:o.default.func.isRequired,onLoginSuccess:o.default.func,onReceive:o.default.func},x.defaultProps={onLoginSuccess:function(){},onReceive:null};var m,g,C=s.default.div(r||(m=["\n text-align: center;\n .invite-receive__logo-wrapper {\n display: inline-flex;\n align-items: center;\n color: #9397a1;\n font-size: 14px;\n }\n .invite-receive__logo {\n height: 16px;\n margin-left: 8px;\n }\n .invite-receive__button {\n width: 100%;\n margin: 16px 0;\n white-space: nowrap;\n }\n .invite-receive__until {\n text-align: center;\n font-size: 14px;\n }\n .invite-receive__description {\n color: #999;\n text-align: left;\n list-style: decimal;\n padding: 0;\n padding-left: 1.2em;\n margin: 40px 0;\n }\n .invite-receive__description-item {\n list-style: decimal;\n }\n .invite-receive__link {\n color: ",";\n }\n"],g||(g=m.slice(0)),r=Object.freeze(Object.defineProperties(m,{raw:{value:Object.freeze(g)}}))),(function(e){return e.theme.palette.primary.main})),b=x;t.default=b},70642:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=n(5057),a=p(n(55898)),o=p(n(33518)),s=p(n(34916)),l=n(52118),c=n(99875),u=n(96266);function p(e){return e&&e.__esModule?e:{default:e}}function f(e){var t=e.invitation,n=(0,l.useLocaleContext)().t,i=(0,r.useMemo)((function(){return(t.role.title||t.role.name).toUpperCase()}),[t.role.title,t.role.name]),a=(0,r.useMemo)((function(){return n("invite.message",{name:"{{name}}",role:i,dapp:"{{dapp}}"})}),[n,i]),o=(0,c.getExplorerLink)(t.info.chainHost,t.inviter.did,"account"),p=(0,c.patchJsxToLocale)(a,{name:function(){return o?(0,u.jsx)("a",{target:"_blank",href:o,className:"invite-user__link",rel:"noreferrer",children:t.inviter.fullName},"name"):t.inviter.fullName},dapp:function(){return(0,u.jsx)("a",{target:"_blank",href:t.info.url,className:"invite-user__link",rel:"noreferrer",children:t.info.name},"dapp")}});return(0,u.jsxs)(h,{children:[(0,u.jsx)(s.default,{did:t.inviter.did,src:encodeURI(t.inviter.avatar),size:80,shape:"circle",variant:"circle"}),(0,u.jsx)("div",{className:"invite-user__message",children:p})]})}f.propTypes={invitation:a.default.object.isRequired};var d,v,h=o.default.div(i||(d=["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n .invite-user__name {\n font-weight: 700;\n font-size: 16px;\n margin: 8px 0 2px 0;\n }\n .invite-user__address {\n font-size: 12px;\n }\n .invite-user__message {\n margin-top: 20px;\n font-weight: 700;\n /* width: 90%; */\n text-align: center;\n font-size: 18px;\n }\n .invite-user__link {\n color: ",";\n }\n"],v||(v=d.slice(0)),i=Object.freeze(Object.defineProperties(d,{raw:{value:Object.freeze(v)}}))),(function(e){return e.theme.palette.primary.main})),x=f;t.default=x},45459:function(e,t,n){"use strict";t.Z=void 0;var i,r=h(n(55898)),a=h(n(33518)),o=n(76898),s=h(n(34519)),l=h(n(25343)),c=h(n(91349)),u=h(n(17223)),p=h(n(70642)),f=h(n(53317)),d=h(n(1914)),v=n(96266);function h(e){return e&&e.__esModule?e:{default:e}}function x(e){var t,n,i=e.getDataFn,r=e.passportColor,a=e.onLoginSuccess,d=e.checkFn,h=e.onReceive,x=(0,o.useRequest)(i);return x.loading?(0,v.jsx)(s.default,{}):x.error?(0,v.jsx)(l.default,{status:"404",title:null===(t=x.error)||void 0===t||null===(n=t.response)||void 0===n?void 0:n.data,description:""}):(0,v.jsxs)(C,{className:"page-invite__wrapper",children:[(0,v.jsx)(f.default,{invitation:x.data}),(0,v.jsxs)("div",{className:"page-invite__card",children:[(0,v.jsx)(p.default,{invitation:x.data}),(0,v.jsx)(c.default,{invitation:x.data,passportColor:r}),(0,v.jsx)(u.default,{invitation:x.data,onLoginSuccess:a,checkFn:d,onReceive:h})]})]})}x.propTypes={getDataFn:r.default.func.isRequired,checkFn:r.default.func.isRequired,onLoginSuccess:r.default.func,onReceive:r.default.func,passportColor:r.default.string},x.defaultProps={onLoginSuccess:function(){},passportColor:"auto",onReceive:null};var m,g,C=a.default.div(i||(m=["\n max-width: 460px;\n max-height: 650px;\n min-height: 450px;\n width: 90%;\n height: 80%;\n display: flex;\n flex-direction: column;\n .page-invite__card {\n background-color: #fff;\n border-radius: 4px;\n flex: 1;\n padding: 20px 30px;\n margin-top: 10px;\n }\n .page-invite__app {\n margin-top: 20px;\n }\n"],g||(g=m.slice(0)),i=Object.freeze(Object.defineProperties(m,{raw:{value:Object.freeze(g)}})))),b=(0,d.default)(x);t.Z=b},55372:function(e,t,n){"use strict";var i=n(77668),r=n(55319),a=n(5433);e.exports={translations:{zh:i(a),en:i(r)}}},1914:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t){return(0,a.jsx)(i.LocaleProvider,{translations:r.translations,children:(0,a.jsx)(e,s({},t))})}};var i=n(52118),r=n(55372),a=n(96266);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return(t=function(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))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[8249],{88249:function(e,t,n){n.r(t);var r=n(48262),a=n(96872),l=n(13693),u=(n(5057),n(53627),Object.defineProperty);function i(e,t){var n,r,a=e.levels;return((a&&0!==a.length?a[a.length-1]-((null===(n=this.electricInput)||void 0===n?void 0:n.test(t))?1:0):e.indentLevel)||0)*((null===(r=this.config)||void 0===r?void 0:r.indentUnit)||0)}r.C.defineMode("graphql-results",(function(e){var t=(0,l.o)({eatWhitespace:function(e){return e.eatSpace()},lexRules:o,parseRules:s,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:i,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}})),u(i,"name",{value:"indent",configurable:!0});var o={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},s={Document:[(0,a.p)("{"),(0,a.l)("Entry",(0,a.p)(",")),(0,a.p)("}")],Entry:[(0,a.t)("String","def"),(0,a.p)(":"),"Value"],Value:function(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[(0,a.t)("Number","number")],StringValue:[(0,a.t)("String","string")],BooleanValue:[(0,a.t)("Keyword","builtin")],NullValue:[(0,a.t)("Keyword","keyword")],ListValue:[(0,a.p)("["),(0,a.l)("Value",(0,a.p)(",")),(0,a.p)("]")],ObjectValue:[(0,a.p)("{"),(0,a.l)("ObjectField",(0,a.p)(",")),(0,a.p)("}")],ObjectField:[(0,a.t)("String","property"),(0,a.p)(":"),"Value"]}},13693:function(e,t,n){n.d(t,{o:function(){return i}});var r=n(96872),a=n(60844),l=Object.defineProperty,u=function(e,t){return l(e,"name",{value:t,configurable:!0})};function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{eatWhitespace:function(e){return e.eatWhile(r.i)},lexRules:r.L,parseRules:r.P,editorConfig:{}};return{startState:function(){var t={level:0,step:0,name:null,kind:null,type:null,rule:null,needsSeparator:!1,prevState:null};return c(e.parseRules,t,a.h.DOCUMENT),t},token:function(t,n){return o(t,n,e)}}}function o(e,t,n){var r;if(t.inBlockstring)return e.match(/.*"""/)?(t.inBlockstring=!1,"string"):(e.skipToEnd(),"string");var a=n.lexRules,l=n.parseRules,u=n.eatWhitespace,i=n.editorConfig;if(t.rule&&0===t.rule.length?d(t):t.needsAdvance&&(t.needsAdvance=!1,v(t,!0)),e.sol()){var o=(null===i||void 0===i?void 0:i.tabSize)||2;t.indentLevel=Math.floor(e.indentation()/o)}if(u(e))return"ws";var f=g(a,e);if(!f)return e.match(/\S+/)||e.match(/\s/),c(p,t,"Invalid"),"invalidchar";if("Comment"===f.kind)return c(p,t,"Comment"),"comment";var h=s({},t);if("Punctuation"===f.kind)if(/^[{([]/.test(f.value))void 0!==t.indentLevel&&(t.levels=(t.levels||[]).concat(t.indentLevel+1));else if(/^[})\]]/.test(f.value)){var b=t.levels=(t.levels||[]).slice(0,-1);t.indentLevel&&b.length>0&&b[b.length-1]<t.indentLevel&&(t.indentLevel=b[b.length-1])}for(;t.rule;){var y="function"===typeof t.rule?0===t.step?t.rule(f,e):null:t.rule[t.step];if(t.needsSeparator&&(y=null===y||void 0===y?void 0:y.separator),y){if(y.ofRule&&(y=y.ofRule),"string"===typeof y){c(l,t,y);continue}if(null===(r=y.match)||void 0===r?void 0:r.call(y,f))return y.update&&y.update(t,f),"Punctuation"===f.kind?v(t,!0):t.needsAdvance=!0,y.style}S(t)}return s(t,h),c(p,t,"Invalid"),"invalidchar"}function s(e,t){for(var n=Object.keys(t),r=0;r<n.length;r++)e[n[r]]=t[n[r]];return e}u(i,"onlineParser"),u(o,"getToken"),u(s,"assign");var p={Invalid:[],Comment:[]};function c(e,t,n){if(!e[n])throw new TypeError("Unknown rule: "+n);t.prevState=Object.assign({},t),t.kind=n,t.name=null,t.type=null,t.rule=e[n],t.step=0,t.needsSeparator=!1}function d(e){e.prevState&&(e.kind=e.prevState.kind,e.name=e.prevState.name,e.type=e.prevState.type,e.rule=e.prevState.rule,e.step=e.prevState.step,e.needsSeparator=e.prevState.needsSeparator,e.prevState=e.prevState.prevState)}function v(e,t){var n;if(f(e)&&e.rule){var r=e.rule[e.step];if(r.separator){var a=r.separator;if(e.needsSeparator=!e.needsSeparator,!e.needsSeparator&&a.ofRule)return}if(t)return}for(e.needsSeparator=!1,e.step++;e.rule&&!(Array.isArray(e.rule)&&e.step<e.rule.length);)d(e),e.rule&&(f(e)?(null===(n=e.rule)||void 0===n?void 0:n[e.step].separator)&&(e.needsSeparator=!e.needsSeparator):(e.needsSeparator=!1,e.step++))}function f(e){var t=Array.isArray(e.rule)&&"string"!==typeof e.rule[e.step]&&e.rule[e.step];return t&&t.isList}function S(e){for(;e.rule&&(!Array.isArray(e.rule)||!e.rule[e.step].ofRule);)d(e);e.rule&&v(e,!1)}function g(e,t){for(var n=Object.keys(e),r=0;r<n.length;r++){var a=t.match(e[n[r]]);if(a&&a instanceof Array)return{kind:n[r],value:a[0]}}}u(c,"pushRule"),u(d,"popRule"),u(v,"advanceRule"),u(f,"isList"),u(S,"unsuccessful"),u(g,"lex")}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[8262],{48262:function(e,t,n){n.r(t),n.d(t,{C:function(){return h},a:function(){return c},c:function(){return d}});var r,i=n(56666),o=n(96872),l=Object.defineProperty,a=function(e,t){return l(e,"name",{value:t,configurable:!0})};function s(e,t){return t.forEach((function(t){t&&"string"!==typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}a(s,"_mergeNamespaces");var u,c={exports:{}};u=c,o.c,u.exports=function(){var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),l=r||i||o,s=l&&(r?document.documentMode||6:+(o||i)[1]),u=!o&&/WebKit\//.test(e),c=u&&/Qt\/\d+\.\d+/.test(e),h=!o&&/Chrome\//.test(e),d=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),g=/PhantomJS/.test(e),v=f&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),m=/Android/.test(e),y=v||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=v||/Mac/.test(t),w=/\bCrOS\b/.test(e),x=/win/i.test(t),C=d&&e.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(d=!1,u=!0);var S=b&&(c||d&&(null==C||C<12.11)),L=n||l&&s>=9;function k(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}a(k,"classTest");var T,M=a((function(e,t){var n=e.className,r=k(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}}),"rmClass");function N(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function O(e,t){return N(e).appendChild(t)}function A(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function D(e,t,n,r){var i=A(e,t,n,r);return i.setAttribute("role","presentation"),i}function W(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function H(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function F(e,t){var n=e.className;k(t).test(n)||(e.className+=(n?" ":"")+t)}function P(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!k(n[r]).test(t)&&(t+=" "+n[r]);return t}a(N,"removeChildren"),a(O,"removeChildrenAndAdd"),a(A,"elt"),a(D,"eltP"),T=document.createRange?a((function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}),"range"):a((function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r}),"range"),a(W,"contains"),a(H,"activeElt"),a(F,"addClass"),a(P,"joinClasses");var E=a((function(e){e.select()}),"selectInput");function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function R(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function B(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,l=i||0;;){var a=e.indexOf("\t",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}v?E=a((function(e){e.selectionStart=0,e.selectionEnd=e.value.length}),"selectInput"):l&&(E=a((function(e){try{e.select()}catch(t){}}),"selectInput")),a(I,"bind"),a(R,"copyObj"),a(B,"countColumn");var z=a((function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)}),"Delayed");function G(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},z.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)},a(G,"indexOf");var U=50,V={toString:function(){return"CodeMirror.Pass"}},K={scroll:!1},j={origin:"*mouse"},_={origin:"+move"};function X(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}a(X,"findColumn");var Y=[""];function $(e){for(;Y.length<=e;)Y.push(q(Y)+" ");return Y[e]}function q(e){return e[e.length-1]}function Z(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Q(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function J(){}function ee(e,t){var n;return Object.create?n=Object.create(e):(J.prototype=e,n=new J),t&&R(t,n),n}a($,"spaceStr"),a(q,"lst"),a(Z,"map"),a(Q,"insertSorted"),a(J,"nothing"),a(ee,"createObj");var te=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ne(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||te.test(e))}function re(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ne(e))||t.test(e):ne(e)}function ie(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}a(ne,"isWordCharBasic"),a(re,"isWordChar"),a(ie,"isEmpty");var oe=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function le(e){return e.charCodeAt(0)>=768&&oe.test(e)}function ae(e,t,n){for(;(n<0?t>0:t<e.length)&&le(e.charAt(t));)t+=n;return t}function se(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function ue(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}a(le,"isExtendingChar"),a(ae,"skipExtendingChars"),a(se,"findFirst"),a(ue,"iterateBidiSections");var ce=null;function he(e,t,n){var r;ce=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ce=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ce=i)}return null!=r?r:ce}a(he,"getBidiPartAt");var de=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}a(n,"charType");var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,s=/[1n]/;function u(e,t,n){this.level=e,this.from=t,this.to=n}return a(u,"BidiSpan"),function(e,t){var a="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var c=e.length,h=[],d=0;d<c;++d)h.push(n(e.charCodeAt(d)));for(var f=0,p=a;f<c;++f){var g=h[f];"m"==g?h[f]=p:p=g}for(var v=0,m=a;v<c;++v){var y=h[v];"1"==y&&"r"==m?h[v]="n":o.test(y)&&(m=y,"r"==y&&(h[v]="R"))}for(var b=1,w=h[0];b<c-1;++b){var x=h[b];"+"==x&&"1"==w&&"1"==h[b+1]?h[b]="1":","!=x||w!=h[b+1]||"1"!=w&&"n"!=w||(h[b]=w),w=x}for(var C=0;C<c;++C){var S=h[C];if(","==S)h[C]="N";else if("%"==S){var L=void 0;for(L=C+1;L<c&&"%"==h[L];++L);for(var k=C&&"!"==h[C-1]||L<c&&"1"==h[L]?"1":"N",T=C;T<L;++T)h[T]=k;C=L-1}}for(var M=0,N=a;M<c;++M){var O=h[M];"L"==N&&"1"==O?h[M]="L":o.test(O)&&(N=O)}for(var A=0;A<c;++A)if(i.test(h[A])){var D=void 0;for(D=A+1;D<c&&i.test(h[D]);++D);for(var W="L"==(A?h[A-1]:a),H=W==("L"==(D<c?h[D]:a))?W?"L":"R":a,F=A;F<D;++F)h[F]=H;A=D-1}for(var P,E=[],I=0;I<c;)if(l.test(h[I])){var R=I;for(++I;I<c&&l.test(h[I]);++I);E.push(new u(0,R,I))}else{var B=I,z=E.length,G="rtl"==t?1:0;for(++I;I<c&&"L"!=h[I];++I);for(var U=B;U<I;)if(s.test(h[U])){B<U&&(E.splice(z,0,new u(1,B,U)),z+=G);var V=U;for(++U;U<I&&s.test(h[U]);++U);E.splice(z,0,new u(2,V,U)),z+=G,B=U}else++U;B<I&&E.splice(z,0,new u(1,B,I))}return"ltr"==t&&(1==E[0].level&&(P=e.match(/^\s+/))&&(E[0].from=P[0].length,E.unshift(new u(0,0,P[0].length))),1==q(E).level&&(P=e.match(/\s+$/))&&(q(E).to-=P[0].length,E.push(new u(0,c-P[0].length,c)))),"rtl"==t?E.reverse():E}}();function fe(e,t){var n=e.order;return null==n&&(n=e.order=de(e.text,t)),n}a(fe,"getOrder");var pe=[],ge=a((function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||pe).concat(n)}}),"on");function ve(e,t){return e._handlers&&e._handlers[t]||pe}function me(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=G(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ye(e,t){var n=ve(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function be(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ye(e,n||t.type,e,t),ke(t)||t.codemirrorIgnore}function we(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==G(n,t[r])&&n.push(t[r])}function xe(e,t){return ve(e,t).length>0}function Ce(e){e.prototype.on=function(e,t){ge(this,e,t)},e.prototype.off=function(e,t){me(this,e,t)}}function Se(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Le(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ke(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Te(e){Se(e),Le(e)}function Me(e){return e.target||e.srcElement}function Ne(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}a(ve,"getHandlers"),a(me,"off"),a(ye,"signal"),a(be,"signalDOMEvent"),a(we,"signalCursorActivity"),a(xe,"hasHandler"),a(Ce,"eventMixin"),a(Se,"e_preventDefault"),a(Le,"e_stopPropagation"),a(ke,"e_defaultPrevented"),a(Te,"e_stop"),a(Me,"e_target"),a(Ne,"e_button");var Oe,Ae,De=function(){if(l&&s<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function We(e){if(null==Oe){var t=A("span","\u200b");O(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Oe=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&s<8))}var n=Oe?A("span","\u200b"):A("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function He(e){if(null!=Ae)return Ae;var t=O(e,document.createTextNode("A\u062eA")),n=T(t,0,1).getBoundingClientRect(),r=T(t,1,2).getBoundingClientRect();return N(e),!(!n||n.left==n.right)&&(Ae=r.right-n.right<3)}a(We,"zeroWidthElement"),a(He,"hasBadBidiRects");var Fe=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Pe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ee=function(){var e=A("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Ie=null;function Re(e){if(null!=Ie)return Ie;var t=O(e,A("span","x")),n=t.getBoundingClientRect(),r=T(t,0,1).getBoundingClientRect();return Ie=Math.abs(n.left-r.left)>1}a(Re,"hasBadZoomedRects");var Be={},ze={};function Ge(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Be[e]=t}function Ue(e,t){ze[e]=t}function Ve(e){if("string"==typeof e&&ze.hasOwnProperty(e))e=ze[e];else if(e&&"string"==typeof e.name&&ze.hasOwnProperty(e.name)){var t=ze[e.name];"string"==typeof t&&(t={name:t}),(e=ee(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ve("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ve("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ke(e,t){t=Ve(t);var n=Be[t.name];if(!n)return Ke(e,"text/plain");var r=n(e,t);if(je.hasOwnProperty(t.name)){var i=je[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}a(Ge,"defineMode"),a(Ue,"defineMIME"),a(Ve,"resolveMode"),a(Ke,"getMode");var je={};function _e(e,t){R(t,je.hasOwnProperty(e)?je[e]:je[e]={})}function Xe(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ye(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function $e(e,t,n){return!e.startState||e.startState(t,n)}a(_e,"extendMode"),a(Xe,"copyState"),a(Ye,"innerMode"),a($e,"startState");var qe=a((function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n}),"StringStream");function Ze(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function Qe(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i})),r}function Je(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function et(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function tt(e){if(null==e.parent)return null;for(var t=e.parent,n=G(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function nt(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var l=0;l<e.lines.length;++l){var a=e.lines[l].height;if(t<a)break;t-=a}return n+l}function rt(e,t){return t>=e.first&&t<e.first+e.size}function it(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ot(e,t,n){if(void 0===n&&(n=null),!(this instanceof ot))return new ot(e,t,n);this.line=e,this.ch=t,this.sticky=n}function lt(e,t){return e.line-t.line||e.ch-t.ch}function at(e,t){return e.sticky==t.sticky&&0==lt(e,t)}function st(e){return ot(e.line,e.ch)}function ut(e,t){return lt(e,t)<0?t:e}function ct(e,t){return lt(e,t)<0?e:t}function ht(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function dt(e,t){if(t.line<e.first)return ot(e.first,0);var n=e.first+e.size-1;return t.line>n?ot(n,Ze(e,n).text.length):ft(t,Ze(e,t.line).text.length)}function ft(e,t){var n=e.ch;return null==n||n>t?ot(e.line,t):n<0?ot(e.line,0):e}function pt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=dt(e,t[r]);return n}qe.prototype.eol=function(){return this.pos>=this.string.length},qe.prototype.sol=function(){return this.pos==this.lineStart},qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},qe.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},qe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},qe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},qe.prototype.skipToEnd=function(){this.pos=this.string.length},qe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},qe.prototype.backUp=function(e){this.pos-=e},qe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=B(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?B(this.string,this.lineStart,this.tabSize):0)},qe.prototype.indentation=function(){return B(this.string,null,this.tabSize)-(this.lineStart?B(this.string,this.lineStart,this.tabSize):0)},qe.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=a((function(e){return n?e.toLowerCase():e}),"cased");if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},qe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},qe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},qe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)},a(Ze,"getLine"),a(Qe,"getBetween"),a(Je,"getLines"),a(et,"updateLineHeight"),a(tt,"lineNo"),a(nt,"lineAtHeight"),a(rt,"isLine"),a(it,"lineNumberFor"),a(ot,"Pos"),a(lt,"cmp"),a(at,"equalCursorPos"),a(st,"copyPos"),a(ut,"maxPos"),a(ct,"minPos"),a(ht,"clipLine"),a(dt,"clipPos"),a(ft,"clipToLen"),a(pt,"clipPosArray");var gt=a((function(e,t){this.state=e,this.lookAhead=t}),"SavedContext"),vt=a((function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1}),"Context");function mt(e,t,n,r){var i=[e.state.modeGen],o={};Tt(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var l=n.state,s=a((function(r){n.baseTokens=i;var a=e.state.overlays[r],s=1,u=0;n.state=!0,Tt(e,t.text,a.mode,n,(function(e,t){for(var n=s;u<e;){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,u=Math.min(e,r)}if(t)if(a.opaque)i.splice(n,s-n,e,"overlay "+t),s=n+2;else for(;n<s;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=l,n.baseTokens=null,n.baseTokenPos=1}),"loop"),u=0;u<e.state.overlays.length;++u)s(u);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function yt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=bt(e,tt(t)),i=t.text.length>e.options.maxHighlightLength&&Xe(e.doc.mode,r.state),o=mt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function bt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new vt(r,!0,t);var o=Mt(e,t,n),l=o>r.first&&Ze(r,o-1).stateAfter,a=l?vt.fromSaved(r,l,o):new vt(r,$e(r.mode),o);return r.iter(o,t,(function(n){wt(e,n.text,a);var r=a.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?a.save():null,a.nextLine()})),n&&(r.modeFrontier=a.line),a}function wt(e,t,n,r){var i=e.doc.mode,o=new qe(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&xt(i,n.state);!o.eol();)Ct(i,o,n.state),o.start=o.pos}function xt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ye(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Ct(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Ye(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}vt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},vt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},vt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},vt.fromSaved=function(e,t,n){return t instanceof gt?new vt(e,Xe(e.mode,t.state),n,t.lookAhead):new vt(e,Xe(e.mode,t),n)},vt.prototype.save=function(e){var t=!1!==e?Xe(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new gt(t,this.maxLookAhead):t},a(mt,"highlightLine"),a(yt,"getLineStyles"),a(bt,"getContextBefore"),a(wt,"processLine"),a(xt,"callBlankLine"),a(Ct,"readToken");var St=a((function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n}),"Token");function Lt(e,t,n,r){var i,o,l=e.doc,a=l.mode,s=Ze(l,(t=dt(l,t)).line),u=bt(e,t.line,n),c=new qe(s.text,e.options.tabSize,u);for(r&&(o=[]);(r||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=Ct(a,c,u.state),r&&o.push(new St(c,i,Xe(l.mode,u.state)));return r?o:new St(c,i,u.state)}function kt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Tt(e,t,n,r,i,o,l){var a=n.flattenSpans;null==a&&(a=e.options.flattenSpans);var s,u=0,c=null,h=new qe(t,e.options.tabSize,r),d=e.options.addModeClass&&[null];for(""==t&&kt(xt(n,r.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(a=!1,l&&wt(e,t,r,h.pos),h.pos=t.length,s=null):s=kt(Ct(n,h,r.state,d),o),d){var f=d[0].name;f&&(s="m-"+(s?f+" "+s:f))}if(!a||c!=s){for(;u<h.start;)i(u=Math.min(h.start,u+5e3),c);c=s}h.start=h.pos}for(;u<h.pos;){var p=Math.min(h.pos,u+5e3);i(p,c),u=p}}function Mt(e,t,n){for(var r,i,o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=o.first)return o.first;var s=Ze(o,a-1),u=s.stateAfter;if(u&&(!n||a+(u instanceof gt?u.lookAhead:0)<=o.modeFrontier))return a;var c=B(s.text,null,e.options.tabSize);(null==i||r>c)&&(i=a-1,r=c)}return i}function Nt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=Ze(e,r).stateAfter;if(i&&(!(i instanceof gt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}a(Lt,"takeToken"),a(kt,"extractLineClasses"),a(Tt,"runMode"),a(Mt,"findStartLine"),a(Nt,"retreatFrontier");var Ot=!1,At=!1;function Dt(){Ot=!0}function Wt(){At=!0}function Ht(e,t,n){this.marker=e,this.from=t,this.to=n}function Ft(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Pt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Et(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function It(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==l.type&&(!n||!o.marker.insertLeft)){var a=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Ht(l,o.from,a?null:o.to))}}return r}function Rt(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.to||(l.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==l.type&&(!n||o.marker.insertLeft)){var a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Ht(l,a?null:o.from-t,null==o.to?null:o.to-t))}}return r}function Bt(e,t){if(t.full)return null;var n=rt(e,t.from.line)&&Ze(e,t.from.line).markedSpans,r=rt(e,t.to.line)&&Ze(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,l=0==lt(t.from,t.to),a=It(n,i,l),s=Rt(r,o,l),u=1==t.text.length,c=q(t.text).length+(u?i:0);if(a)for(var h=0;h<a.length;++h){var d=a[h];if(null==d.to){var f=Ft(s,d.marker);f?u&&(d.to=null==f.to?null:f.to+c):d.to=i}}if(s)for(var p=0;p<s.length;++p){var g=s[p];null!=g.to&&(g.to+=c),null==g.from?Ft(a,g.marker)||(g.from=c,u&&(a||(a=[])).push(g)):(g.from+=c,u&&(a||(a=[])).push(g))}a&&(a=zt(a)),s&&s!=a&&(s=zt(s));var v=[a];if(!u){var m,y=t.text.length-2;if(y>0&&a)for(var b=0;b<a.length;++b)null==a[b].to&&(m||(m=[])).push(new Ht(a[b].marker,null,null));for(var w=0;w<y;++w)v.push(m);v.push(s)}return v}function zt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Gt(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=G(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var l=r[o],a=l.find(0),s=0;s<i.length;++s){var u=i[s];if(!(lt(u.to,a.from)<0||lt(u.from,a.to)>0)){var c=[s,1],h=lt(u.from,a.from),d=lt(u.to,a.to);(h<0||!l.inclusiveLeft&&!h)&&c.push({from:u.from,to:a.from}),(d>0||!l.inclusiveRight&&!d)&&c.push({from:a.to,to:u.to}),i.splice.apply(i,c),s+=c.length-3}}return i}function Ut(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Vt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Kt(e){return e.inclusiveLeft?-1:0}function jt(e){return e.inclusiveRight?1:0}function _t(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=lt(r.from,i.from)||Kt(e)-Kt(t);if(o)return-o;var l=lt(r.to,i.to)||jt(e)-jt(t);return l||t.id-e.id}function Xt(e,t){var n,r=At&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||_t(n,i.marker)<0)&&(n=i.marker);return n}function Yt(e){return Xt(e,!0)}function $t(e){return Xt(e,!1)}function qt(e,t){var n,r=At&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||_t(n,o.marker)<0)&&(n=o.marker)}return n}function Zt(e,t,n,r,i){var o=Ze(e,t),l=At&&o.markedSpans;if(l)for(var a=0;a<l.length;++a){var s=l[a];if(s.marker.collapsed){var u=s.marker.find(0),c=lt(u.from,n)||Kt(s.marker)-Kt(i),h=lt(u.to,r)||jt(s.marker)-jt(i);if(!(c>=0&&h<=0||c<=0&&h>=0)&&(c<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?lt(u.to,n)>=0:lt(u.to,n)>0)||c>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?lt(u.from,r)<=0:lt(u.from,r)<0)))return!0}}}function Qt(e){for(var t;t=Yt(e);)e=t.find(-1,!0).line;return e}function Jt(e){for(var t;t=$t(e);)e=t.find(1,!0).line;return e}function en(e){for(var t,n;t=$t(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function tn(e,t){var n=Ze(e,t),r=Qt(n);return n==r?t:tt(r)}function nn(e,t){if(t>e.lastLine())return t;var n,r=Ze(e,t);if(!rn(e,r))return t;for(;n=$t(r);)r=n.find(1,!0).line;return tt(r)+1}function rn(e,t){var n=At&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&on(e,t,r))return!0}}function on(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return on(e,r.line,Ft(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&on(e,t,i))return!0}function ln(e){for(var t=0,n=(e=Qt(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var l=0;l<o.children.length;++l){var a=o.children[l];if(a==n)break;t+=a.height}return t}function an(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Yt(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=$t(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function sn(e){var t=e.display,n=e.doc;t.maxLine=Ze(n,n.first),t.maxLineLength=an(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=an(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}a(Dt,"seeReadOnlySpans"),a(Wt,"seeCollapsedSpans"),a(Ht,"MarkedSpan"),a(Ft,"getMarkedSpanFor"),a(Pt,"removeMarkedSpan"),a(Et,"addMarkedSpan"),a(It,"markedSpansBefore"),a(Rt,"markedSpansAfter"),a(Bt,"stretchSpansOverChange"),a(zt,"clearEmptySpans"),a(Gt,"removeReadOnlyRanges"),a(Ut,"detachMarkedSpans"),a(Vt,"attachMarkedSpans"),a(Kt,"extraLeft"),a(jt,"extraRight"),a(_t,"compareCollapsedMarkers"),a(Xt,"collapsedSpanAtSide"),a(Yt,"collapsedSpanAtStart"),a($t,"collapsedSpanAtEnd"),a(qt,"collapsedSpanAround"),a(Zt,"conflictingCollapsedRange"),a(Qt,"visualLine"),a(Jt,"visualLineEnd"),a(en,"visualLineContinued"),a(tn,"visualLineNo"),a(nn,"visualLineEndNo"),a(rn,"lineIsHidden"),a(on,"lineIsHiddenInner"),a(ln,"heightAtLine"),a(an,"lineLength"),a(sn,"findMaxLine");var un=a((function(e,t,n){this.text=e,Vt(this,t),this.height=n?n(this):1}),"Line");function cn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ut(e),Vt(e,n);var i=r?r(e):1;i!=e.height&&et(e,i)}function hn(e){e.parent=null,Ut(e)}un.prototype.lineNo=function(){return tt(this)},Ce(un),a(cn,"updateLine"),a(hn,"cleanUpLine");var dn={},fn={};function pn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?fn:dn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function gn(e,t){var n=D("span",null,null,u?"padding-right: .1px":null),r={pre:D("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=mn,He(e.display.measure)&&(l=fe(o,e.doc.direction))&&(r.addToken=bn(r.addToken,l)),r.map=[],xn(o,r,yt(e,o,t!=e.display.externalMeasured&&tt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=P(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=P(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(We(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(u){var a=r.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ye(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=P(r.pre.className,r.textClass||"")),r}function vn(e){var t=A("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function mn(e,t,n,r,i,o,a){if(t){var u,c=e.splitSpaces?yn(t,e.trailingSpace):t,h=e.cm.state.specialChars,d=!1;if(h.test(t)){u=document.createDocumentFragment();for(var f=0;;){h.lastIndex=f;var p=h.exec(t),g=p?p.index-f:t.length-f;if(g){var v=document.createTextNode(c.slice(f,f+g));l&&s<9?u.appendChild(A("span",[v])):u.appendChild(v),e.map.push(e.pos,e.pos+g,v),e.col+=g,e.pos+=g}if(!p)break;f+=g+1;var m=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(m=u.appendChild(A("span",$(b),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((m=u.appendChild(A("span","\r"==p[0]?"\u240d":"\u2424","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((m=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),l&&s<9?u.appendChild(A("span",[m])):u.appendChild(m),e.col+=1);e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),l&&s<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||r||i||d||o||a){var w=n||"";r&&(w+=r),i&&(w+=i);var x=A("span",[u],w,o);if(a)for(var C in a)a.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,a[C]);return e.content.appendChild(x)}e.content.appendChild(u)}}function yn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o="\xa0"),r+=o,n=" "==o}return r}function bn(e,t){return function(n,r,i,o,l,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,c=u+r.length;;){for(var h=void 0,d=0;d<t.length&&!((h=t[d]).to>u&&h.from<=u);d++);if(h.to>=c)return e(n,r,i,o,l,a,s);e(n,r.slice(0,h.to-u),i,o,null,a,s),o=null,r=r.slice(h.to-u),u=h.to}}}function wn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function xn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var l,a,s,u,c,h,d,f=i.length,p=0,g=1,v="",m=0;;){if(m==p){s=u=c=a="",d=null,h=null,m=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var x=r[w],C=x.marker;if("bookmark"==C.type&&x.from==p&&C.widgetNode)y.push(C);else if(x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(s+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((d||(d={})).title=C.title),C.attributes)for(var S in C.attributes)(d||(d={}))[S]=C.attributes[S];C.collapsed&&(!h||_t(h.marker,C)<0)&&(h=x)}else x.from>p&&m>x.from&&(m=x.from)}if(b)for(var L=0;L<b.length;L+=2)b[L+1]==m&&(u+=" "+b[L]);if(!h||h.from==p)for(var k=0;k<y.length;++k)wn(t,0,y[k]);if(h&&(h.from||0)==p){if(wn(t,(null==h.to?f+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=f)break;for(var T=Math.min(f,m);;){if(v){var M=p+v.length;if(!h){var N=M>T?v.slice(0,T-p):v;t.addToken(t,N,l?l+s:s,c,p+N.length==m?u:"",a,d)}if(M>=T){v=v.slice(T-p),p=T;break}p=M,c=""}v=i.slice(o,o=n[g++]),l=pn(n[g++],t.cm.options)}}else for(var O=1;O<n.length;O+=2)t.addToken(t,i.slice(o,o=n[O]),pn(n[O+1],t.cm.options))}function Cn(e,t,n){this.line=t,this.rest=en(t),this.size=this.rest?tt(q(this.rest))-n+1:1,this.node=this.text=null,this.hidden=rn(e,t)}function Sn(e,t,n){for(var r,i=[],o=t;o<n;o=r){var l=new Cn(e.doc,Ze(e.doc,o),o);r=o+l.size,i.push(l)}return i}a(pn,"interpretTokenStyle"),a(gn,"buildLineContent"),a(vn,"defaultSpecialCharPlaceholder"),a(mn,"buildToken"),a(yn,"splitSpaces"),a(bn,"buildTokenBadBidi"),a(wn,"buildCollapsedSpan"),a(xn,"insertLineContent"),a(Cn,"LineView"),a(Sn,"buildViewArray");var Ln=null;function kn(e){Ln?Ln.ops.push(e):e.ownsGroup=Ln={ops:[e],delayedCallbacks:[]}}function Tn(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Mn(e,t){var n=e.ownsGroup;if(n)try{Tn(n)}finally{Ln=null,t(n)}}a(kn,"pushOperation"),a(Tn,"fireCallbacksForOps"),a(Mn,"finishOperation");var Nn=null;function On(e,t){var n=ve(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);Ln?r=Ln.delayedCallbacks:Nn?r=Nn:(r=Nn=[],setTimeout(An,0));for(var o=a((function(e){r.push((function(){return n[e].apply(null,i)}))}),"loop"),l=0;l<n.length;++l)o(l)}}function An(){var e=Nn;Nn=null;for(var t=0;t<e.length;++t)e[t]()}function Dn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?Pn(e,t):"gutter"==o?In(e,t,n,r):"class"==o?En(e,t):"widget"==o&&Rn(e,t,r)}t.changes=null}function Wn(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),l&&s<8&&(e.node.style.zIndex=2)),e.node}function Hn(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=Wn(t);t.background=r.insertBefore(A("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Fn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):gn(e,t)}function Pn(e,t){var n=t.text.className,r=Fn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,En(e,t)):n&&(t.text.className=n)}function En(e,t){Hn(e,t),t.line.wrapClass?Wn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function In(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=Wn(t);t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var l=Wn(t),a=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(a.setAttribute("aria-hidden","true"),e.display.input.setUneditable(a),l.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(A("div",it(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,c=o.hasOwnProperty(u)&&o[u];c&&a.appendChild(A("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Rn(e,t,n){t.alignable&&(t.alignable=null);for(var r=k("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);zn(e,t,n)}function Bn(e,t,n,r){var i=Fn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),En(e,t),In(e,t,n,r),zn(e,t,r),t.node}function zn(e,t,n){if(Gn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Gn(e,t.rest[r],t,n,!1)}function Gn(e,t,n,r,i){if(t.widgets)for(var o=Wn(n),l=0,a=t.widgets;l<a.length;++l){var s=a[l],u=A("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Un(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),On(s,"redraw")}}function Un(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Vn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!W(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),O(t.display.measure,A("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Kn(e,t){for(var n=Me(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function jn(e){return e.lineSpace.offsetTop}function _n(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Xn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=O(e.measure,A("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Yn(e){return U-e.display.nativeBarWidth}function $n(e){return e.display.scroller.clientWidth-Yn(e)-e.display.barWidth}function qn(e){return e.display.scroller.clientHeight-Yn(e)-e.display.barHeight}function Zn(e,t,n){var r=e.options.lineWrapping,i=r&&$n(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),a=0;a<l.length-1;a++){var s=l[a],u=l[a+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Qn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(tt(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Jn(e,t){var n=tt(t=Qt(t)),r=e.display.externalMeasured=new Cn(e.doc,t,n);r.lineN=n;var i=r.built=gn(e,r);return r.text=i.pre,O(e.display.lineMeasure,i.pre),r}function er(e,t,n,r){return rr(e,nr(e,t),n,r)}function tr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Er(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function nr(e,t){var n=tt(t),r=tr(e,n);r&&!r.text?r=null:r&&r.changes&&(Dn(e,r,n,Dr(e)),e.curOp.forceUpdate=!0),r||(r=Jn(e,t));var i=Qn(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function rr(e,t,n,r,i){t.before&&(n=-1);var o,l=n+(r||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Zn(e,t.view,t.rect),t.hasHeights=!0),(o=sr(e,t,n,r)).bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}a(On,"signalLater"),a(An,"fireOrphanDelayed"),a(Dn,"updateLineForChanges"),a(Wn,"ensureLineWrapped"),a(Hn,"updateLineBackground"),a(Fn,"getLineContent"),a(Pn,"updateLineText"),a(En,"updateLineClasses"),a(In,"updateLineGutter"),a(Rn,"updateLineWidgets"),a(Bn,"buildLineElement"),a(zn,"insertLineWidgets"),a(Gn,"insertLineWidgetsFor"),a(Un,"positionLineWidget"),a(Vn,"widgetHeight"),a(Kn,"eventInWidget"),a(jn,"paddingTop"),a(_n,"paddingVert"),a(Xn,"paddingH"),a(Yn,"scrollGap"),a($n,"displayWidth"),a(qn,"displayHeight"),a(Zn,"ensureLineHeights"),a(Qn,"mapFromLineView"),a(Jn,"updateExternalMeasurement"),a(er,"measureChar"),a(tr,"findViewForLine"),a(nr,"prepareMeasureForLine"),a(rr,"measureCharPrepared");var ir,or={left:0,right:0,top:0,bottom:0};function lr(e,t,n){for(var r,i,o,l,a,s,u=0;u<e.length;u+=3)if(a=e[u],s=e[u+1],t<a?(i=0,o=1,l="left"):t<s?o=1+(i=t-a):(u==e.length-3||t==s&&e[u+3]>t)&&(i=(o=s-a)-1,t>=s&&(l="right")),null!=i){if(r=e[u+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],l="left";if("right"==n&&i==s-a)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],l="right";break}return{node:r,start:i,end:o,collapse:l,coverStart:a,coverEnd:s}}function ar(e,t){var n=or;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function sr(e,t,n,r){var i,o=lr(t.map,n,r),a=o.node,u=o.start,c=o.end,h=o.collapse;if(3==a.nodeType){for(var d=0;d<4;d++){for(;u&&le(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c<o.coverEnd&&le(t.line.text.charAt(o.coverStart+c));)++c;if((i=l&&s<9&&0==u&&c==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():ar(T(a,u,c).getClientRects(),r)).left||i.right||0==u)break;c=u,u-=1,h="right"}l&&s<11&&(i=ur(e.display.measure,i))}else{var f;u>0&&(h=r="right"),i=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==r?f.length-1:0]:a.getBoundingClientRect()}if(l&&s<9&&!u&&(!i||!i.left&&!i.right)){var p=a.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+Ar(e.display),top:p.top,bottom:p.bottom}:or}for(var g=i.top-t.rect.top,v=i.bottom-t.rect.top,m=(g+v)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(m<y[b]);b++);var w=b?y[b-1]:0,x=y[b],C={left:("right"==h?i.right:i.left)-t.rect.left,right:("left"==h?i.left:i.right)-t.rect.left,top:w,bottom:x};return i.left||i.right||(C.bogus=!0),e.options.singleCursorHeightPerLine||(C.rtop=g,C.rbottom=v),C}function ur(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Re(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function cr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function hr(e){e.display.externalMeasure=null,N(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)cr(e.display.view[t])}function dr(e){hr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function fr(){return h&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function pr(){return h&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function gr(e){var t=Qt(e).widgets,n=0;if(t)for(var r=0;r<t.length;++r)t[r].above&&(n+=Vn(t[r]));return n}function vr(e,t,n,r,i){if(!i){var o=gr(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var l=ln(t);if("local"==r?l+=jn(e.display):l-=e.display.viewOffset,"page"==r||"window"==r){var a=e.display.lineSpace.getBoundingClientRect();l+=a.top+("window"==r?0:pr());var s=a.left+("window"==r?0:fr());n.left+=s,n.right+=s}return n.top+=l,n.bottom+=l,n}function mr(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=fr(),i-=pr();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:r-l.left,top:i-l.top}}function yr(e,t,n,r,i){return r||(r=Ze(e.doc,t.line)),vr(e,r,er(e,r,t.ch,i),n)}function br(e,t,n,r,i,o){function l(t,l){var a=rr(e,i,t,l?"right":"left",o);return l?a.left=a.right:a.right=a.left,vr(e,r,a,n)}r=r||Ze(e.doc,t.line),i||(i=nr(e,r)),a(l,"get");var s=fe(r,e.doc.direction),u=t.ch,c=t.sticky;if(u>=r.text.length?(u=r.text.length,c="before"):u<=0&&(u=0,c="after"),!s)return l("before"==c?u-1:u,"before"==c);function h(e,t,n){return l(n?e-1:e,1==s[t].level!=n)}a(h,"getBidi");var d=he(s,u,c),f=ce,p=h(u,d,"before"==c);return null!=f&&(p.other=h(u,f,"before"!=c)),p}function wr(e,t){var n=0;t=dt(e.doc,t),e.options.lineWrapping||(n=Ar(e.display)*t.ch);var r=Ze(e.doc,t.line),i=ln(r)+jn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function xr(e,t,n,r,i){var o=ot(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Cr(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return xr(r.first,0,null,-1,-1);var i=nt(r,n),o=r.first+r.size-1;if(i>o)return xr(r.first+r.size-1,Ze(r,o).text.length,null,1,1);t<0&&(t=0);for(var l=Ze(r,i);;){var a=Tr(e,l,i,t,n),s=qt(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==i)return u;l=Ze(r,i=u.line)}}function Sr(e,t,n,r){r-=gr(t);var i=t.text.length,o=se((function(t){return rr(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=se((function(t){return rr(e,n,t).top>r}),o,i)}}function Lr(e,t,n,r){return n||(n=nr(e,t)),Sr(e,t,n,vr(e,t,rr(e,n,r),"line").top)}function kr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Tr(e,t,n,r,i){i-=ln(t);var o=nr(e,t),l=gr(t),a=0,s=t.text.length,u=!0,c=fe(t,e.doc.direction);if(c){var h=(e.options.lineWrapping?Nr:Mr)(e,t,n,o,c,r,i);a=(u=1!=h.level)?h.from:h.to-1,s=u?h.to:h.from-1}var d,f,p=null,g=null,v=se((function(t){var n=rr(e,o,t);return n.top+=l,n.bottom+=l,!!kr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,g=n),!0)}),a,s),m=!1;if(g){var y=r-g.left<g.right-r,b=y==u;v=p+(b?0:1),f=b?"after":"before",d=y?g.left:g.right}else{u||v!=s&&v!=a||v++,f=0==v?"after":v==t.text.length?"before":rr(e,o,v-(u?1:0)).bottom+l<=i==u?"after":"before";var w=br(e,ot(n,v,f),"line",t,o);d=w.left,m=i<w.top?-1:i>=w.bottom?1:0}return xr(n,v=ae(t.text,v,1),f,m,r-d)}function Mr(e,t,n,r,i,o,l){var a=se((function(a){var s=i[a],u=1!=s.level;return kr(br(e,ot(n,u?s.to:s.from,u?"before":"after"),"line",t,r),o,l,!0)}),0,i.length-1),s=i[a];if(a>0){var u=1!=s.level,c=br(e,ot(n,u?s.from:s.to,u?"after":"before"),"line",t,r);kr(c,o,l,!0)&&c.top>l&&(s=i[a-1])}return s}function Nr(e,t,n,r,i,o,l){var a=Sr(e,t,r,l),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,h=null,d=0;d<i.length;d++){var f=i[d];if(!(f.from>=u||f.to<=s)){var p=rr(e,r,1!=f.level?Math.min(u,f.to)-1:Math.max(s,f.from)).right,g=p<o?o-p+1e9:p-o;(!c||h>g)&&(c=f,h=g)}}return c||(c=i[i.length-1]),c.from<s&&(c={from:s,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function Or(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ir){ir=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ir.appendChild(document.createTextNode("x")),ir.appendChild(A("br"));ir.appendChild(document.createTextNode("x"))}O(e.measure,ir);var n=ir.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),N(e.measure),n||1}function Ar(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),n=A("pre",[t],"CodeMirror-line-like");O(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Dr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var a=e.display.gutterSpecs[l].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:Wr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Wr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Hr(e){var t=Or(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Ar(e.display)-3);return function(i){if(rn(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function Fr(e){var t=e.doc,n=Hr(e);t.iter((function(e){var t=n(e);t!=e.height&&et(e,t)}))}function Pr(e,t,n,r){var i=e.display;if(!n&&"true"==Me(t).getAttribute("cm-not-content"))return null;var o,l,a=i.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,l=t.clientY-a.top}catch(h){return null}var s,u=Cr(e,o,l);if(r&&u.xRel>0&&(s=Ze(e.doc,u.line).text).length==u.ch){var c=B(s,s.length,e.options.tabSize)-s.length;u=ot(u.line,Math.max(0,Math.round((o-Xn(e.display).left)/Ar(e.display))-c))}return u}function Er(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function Ir(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)At&&tn(e.doc,t)<i.viewTo&&Br(e);else if(n<=i.viewFrom)At&&nn(e.doc,n+r)>i.viewFrom?Br(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Br(e);else if(t<=i.viewFrom){var o=zr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Br(e)}else if(n>=i.viewTo){var l=zr(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):Br(e)}else{var a=zr(e,t,t,-1),s=zr(e,n,n+r,1);a&&s?(i.view=i.view.slice(0,a.index).concat(Sn(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):Br(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function Rr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Er(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==G(l,n)&&l.push(n)}}}function Br(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zr(e,t,n,r){var i,o=Er(e,t),l=e.display.view;if(!At||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var a=e.display.viewFrom,s=0;s<o;s++)a+=l[s].size;if(a!=t){if(r>0){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,n+=i}for(;tn(e.doc,n)!=n;){if(o==(r<0?0:l.length-1))return null;n+=r*l[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Gr(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Sn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Sn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Er(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Sn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Er(e,n)))),r.viewTo=n}function Ur(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function Vr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Kr(e,t){void 0===t&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),l=e.options.$customCursor;l&&(t=!0);for(var a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();if(l){var c=l(e,s);c&&jr(e,c,i)}else(u||e.options.showCursorWhenSelecting)&&jr(e,s.head,i);u||Xr(e,s,o)}}return r}function jr(e,t,n){var r=br(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(A("div","\xa0","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=yr(e,t,"div",null,null),l=o.right-o.left;i.style.width=(l>0?l:e.defaultCharWidth())+"px"}if(r.other){var a=n.appendChild(A("div","\xa0","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function _r(e,t){return e.top-t.top||e.left-t.left}function Xr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),l=Xn(e.display),s=l.left,u=Math.max(r.sizerWidth,$n(e)-r.sizer.offsetLeft)-l.right,c="ltr"==i.direction;function h(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?u-e:n)+"px;\n height: "+(r-t)+"px"))}function d(t,n,r){var o,l,d=Ze(i,t),f=d.text.length;function p(n,r){return yr(e,ot(t,n),"div",d,r)}function g(t,n,r){var i=Lr(e,d,null,t),o="ltr"==n==("after"==r)?"left":"right";return p("after"==r?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1),o)[o]}a(p,"coords"),a(g,"wrapX");var v=fe(d,i.direction);return ue(v,n||0,null==r?f:r,(function(e,t,i,a){var d="ltr"==i,m=p(e,d?"left":"right"),y=p(t-1,d?"right":"left"),b=null==n&&0==e,w=null==r&&t==f,x=0==a,C=!v||a==v.length-1;if(y.top-m.top<=3){var S=(c?w:b)&&C,L=(c?b:w)&&x?s:(d?m:y).left,k=S?u:(d?y:m).right;h(L,m.top,k-L,m.bottom)}else{var T,M,N,O;d?(T=c&&b&&x?s:m.left,M=c?u:g(e,i,"before"),N=c?s:g(t,i,"after"),O=c&&w&&C?u:y.right):(T=c?g(e,i,"before"):s,M=!c&&b&&x?u:m.right,N=!c&&w&&C?s:y.left,O=c?g(t,i,"after"):u),h(T,m.top,M-T,m.bottom),m.bottom<y.top&&h(s,m.bottom,null,y.top),h(N,y.top,O-N,y.bottom)}(!o||_r(m,o)<0)&&(o=m),_r(y,o)<0&&(o=y),(!l||_r(m,l)<0)&&(l=m),_r(y,l)<0&&(l=y)})),{start:o,end:l}}a(h,"add"),a(d,"drawForLine");var f=t.from(),p=t.to();if(f.line==p.line)d(f.line,f.ch,p.ch);else{var g=Ze(i,f.line),v=Ze(i,p.line),m=Qt(g)==Qt(v),y=d(f.line,f.ch,m?g.text.length+1:null).end,b=d(p.line,m?0:null,p.ch).start;m&&(y.top<b.top-2?(h(y.right,y.top,null,y.bottom),h(s,b.top,b.left,b.bottom)):h(y.right,y.top,b.left-y.right,y.bottom)),y.bottom<b.top&&h(s,y.bottom,null,b.top)}n.appendChild(o)}function Yr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||Qr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function $r(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Zr(e))}function qr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Qr(e))}),100)}function Zr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ye(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),u&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Yr(e))}function Qr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ye(e,"blur",e,t),e.state.focused=!1,M(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Jr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,a=0;a<t.view.length;a++){var u=t.view[a],c=e.options.lineWrapping,h=void 0,d=0;if(!u.hidden){if(i+=u.line.height,l&&s<8){var f=u.node.offsetTop+u.node.offsetHeight;h=f-n,n=f}else{var p=u.node.getBoundingClientRect();h=p.bottom-p.top,!c&&u.text.firstChild&&(d=u.text.firstChild.getBoundingClientRect().right-p.left-1)}var g=u.line.height-h;if((g>.005||g<-.005)&&(i<r&&(o-=g),et(u.line,h),ei(u.line),u.rest))for(var v=0;v<u.rest.length;v++)ei(u.rest[v]);if(d>e.display.sizerWidth){var m=Math.ceil(d/Ar(e.display));m>e.display.maxLineLength&&(e.display.maxLineLength=m,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function ei(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function ti(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-jn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=nt(t,r),l=nt(t,i);if(n&&n.ensure){var a=n.ensure.from.line,s=n.ensure.to.line;a<o?(o=a,l=nt(t,ln(Ze(t,a))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=l&&(o=nt(t,ln(Ze(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function ni(e,t){if(!be(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!g){var o=A("div","\u200b",null,"position: absolute;\n top: "+(t.top-n.viewOffset-jn(e.display))+"px;\n height: "+(t.bottom-t.top+Yn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function ri(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?ot(t.line,t.ch+1,"before"):t,t=t.ch?ot(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var l=!1,a=br(e,t),s=n&&n!=t?br(e,n):a,u=oi(e,i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r}),c=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=u.scrollTop&&(di(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(l=!0)),null!=u.scrollLeft&&(pi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(l=!0)),!l)break}return i}function ii(e,t){var n=oi(e,t);null!=n.scrollTop&&di(e,n.scrollTop),null!=n.scrollLeft&&pi(e,n.scrollLeft)}function oi(e,t){var n=e.display,r=Or(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=qn(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+_n(n),s=t.top<r,u=t.bottom>a-r;if(t.top<i)l.scrollTop=s?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?a:t.bottom)-o);c!=i&&(l.scrollTop=c)}var h=e.options.fixedGutter?0:n.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-h,f=$n(e)-n.gutters.offsetWidth,p=t.right-t.left>f;return p&&(t.right=t.left+f),t.left<10?l.scrollLeft=0:t.left<d?l.scrollLeft=Math.max(0,t.left+h-(p?0:10)):t.right>f+d-3&&(l.scrollLeft=t.right+(p?0:10)-f),l}function li(e,t){null!=t&&(ci(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function ai(e){ci(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function si(e,t,n){null==t&&null==n||ci(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ui(e,t){ci(e),e.curOp.scrollToPos=t}function ci(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,hi(e,wr(e,t.from),wr(e,t.to),t.margin))}function hi(e,t,n,r){var i=oi(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});si(e,i.scrollLeft,i.scrollTop)}function di(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Vi(e,{top:t}),fi(e,t,!0),n&&Vi(e),Pi(e,100))}function fi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function pi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Xi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function gi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+_n(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Yn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}a(lr,"nodeAndOffsetInLineMap"),a(ar,"getUsefulRect"),a(sr,"measureCharInner"),a(ur,"maybeUpdateRectForZooming"),a(cr,"clearLineMeasurementCacheFor"),a(hr,"clearLineMeasurementCache"),a(dr,"clearCaches"),a(fr,"pageScrollX"),a(pr,"pageScrollY"),a(gr,"widgetTopHeight"),a(vr,"intoCoordSystem"),a(mr,"fromCoordSystem"),a(yr,"charCoords"),a(br,"cursorCoords"),a(wr,"estimateCoords"),a(xr,"PosWithInfo"),a(Cr,"coordsChar"),a(Sr,"wrappedLineExtent"),a(Lr,"wrappedLineExtentChar"),a(kr,"boxIsAfter"),a(Tr,"coordsCharInner"),a(Mr,"coordsBidiPart"),a(Nr,"coordsBidiPartWrapped"),a(Or,"textHeight"),a(Ar,"charWidth"),a(Dr,"getDimensions"),a(Wr,"compensateForHScroll"),a(Hr,"estimateHeight"),a(Fr,"estimateLineHeights"),a(Pr,"posFromMouse"),a(Er,"findViewIndex"),a(Ir,"regChange"),a(Rr,"regLineChange"),a(Br,"resetView"),a(zr,"viewCuttingPoint"),a(Gr,"adjustView"),a(Ur,"countDirtyView"),a(Vr,"updateSelection"),a(Kr,"prepareSelection"),a(jr,"drawSelectionCursor"),a(_r,"cmpCoords"),a(Xr,"drawSelectionRange"),a(Yr,"restartBlink"),a($r,"ensureFocus"),a(qr,"delayBlurEvent"),a(Zr,"onFocus"),a(Qr,"onBlur"),a(Jr,"updateHeightsInViewport"),a(ei,"updateWidgetHeight"),a(ti,"visibleLines"),a(ni,"maybeScrollWindow"),a(ri,"scrollPosIntoView"),a(ii,"scrollIntoView"),a(oi,"calculateScrollPos"),a(li,"addToScrollTop"),a(ai,"ensureCursorVisible"),a(si,"scrollToCoords"),a(ui,"scrollToRange"),a(ci,"resolveScrollToPos"),a(hi,"scrollToCoordsRange"),a(di,"updateScrollTop"),a(fi,"setScrollTop"),a(pi,"setScrollLeft"),a(gi,"measureForScrollbars");var vi=a((function(e,t,n){this.cm=n;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),ge(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),ge(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,l&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}),"NativeScrollbars");vi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},vi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},vi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},vi.prototype.zeroWidthHack=function(){var e=b&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},vi.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",a(r,"maybeDisable"),t.set(1e3,r)},vi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var mi=a((function(){}),"NullScrollbars");function yi(e,t){t||(t=gi(e));var n=e.display.barWidth,r=e.display.barHeight;bi(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Jr(e),bi(e,gi(e)),n=e.display.barWidth,r=e.display.barHeight}function bi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}mi.prototype.update=function(){return{bottom:0,right:0}},mi.prototype.setScrollLeft=function(){},mi.prototype.setScrollTop=function(){},mi.prototype.clear=function(){},a(yi,"updateScrollbars"),a(bi,"updateScrollbarsInner");var wi={native:vi,null:mi};function xi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&M(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new wi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ge(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?pi(e,t):di(e,t)}),e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}a(xi,"initScrollbars");var Ci=0;function Si(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ci,markArrays:null},kn(e.curOp)}function Li(e){var t=e.curOp;t&&Mn(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;ki(e)}))}function ki(e){for(var t=e.ops,n=0;n<t.length;n++)Ti(t[n]);for(var r=0;r<t.length;r++)Mi(t[r]);for(var i=0;i<t.length;i++)Ni(t[i]);for(var o=0;o<t.length;o++)Oi(t[o]);for(var l=0;l<t.length;l++)Ai(t[l])}function Ti(e){var t=e.cm,n=t.display;Ri(t),e.updateMaxLine&&sn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ii(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Mi(e){e.updatedDisplay=e.mustUpdate&&Gi(e.cm,e.update)}function Ni(e){var t=e.cm,n=t.display;e.updatedDisplay&&Jr(t),e.barMeasure=gi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=er(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Yn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-$n(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Oi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&pi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==H();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&yi(t,e.barMeasure),e.updatedDisplay&&_i(t,e.barMeasure),e.selectionChanged&&Yr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&$r(e.cm)}function Ai(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&Ui(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&fi(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&pi(t,e.scrollLeft,!0,!0),e.scrollToPos&&ni(t,ri(t,dt(r,e.scrollToPos.from),dt(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var l=0;l<i.length;++l)i[l].lines.length||ye(i[l],"hide");if(o)for(var a=0;a<o.length;++a)o[a].lines.length&&ye(o[a],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ye(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Di(e,t){if(e.curOp)return t();Si(e);try{return t()}finally{Li(e)}}function Wi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Si(e);try{return t.apply(e,arguments)}finally{Li(e)}}}function Hi(e){return function(){if(this.curOp)return e.apply(this,arguments);Si(this);try{return e.apply(this,arguments)}finally{Li(this)}}}function Fi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Si(t);try{return e.apply(this,arguments)}finally{Li(t)}}}function Pi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(Ei,e))}function Ei(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=bt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength?Xe(t.mode,r.state):null,s=mt(e,o,r,!0);a&&(r.state=a),o.styles=s.styles;var u=o.styleClasses,c=s.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),d=0;!h&&d<l.length;++d)h=l[d]!=o.styles[d];h&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&wt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Pi(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Di(e,(function(){for(var t=0;t<i.length;t++)Rr(e,i[t],"text")}))}}a(Si,"startOperation"),a(Li,"endOperation"),a(ki,"endOperations"),a(Ti,"endOperation_R1"),a(Mi,"endOperation_W1"),a(Ni,"endOperation_R2"),a(Oi,"endOperation_W2"),a(Ai,"endOperation_finish"),a(Di,"runInOp"),a(Wi,"operation"),a(Hi,"methodOp"),a(Fi,"docMethodOp"),a(Pi,"startWorker"),a(Ei,"highlightWorker");var Ii=a((function(e,t,n){var r=e.display;this.viewport=t,this.visible=ti(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=$n(e),this.force=n,this.dims=Dr(e),this.events=[]}),"DisplayUpdate");function Ri(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Yn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Yn(e)+"px",t.scrollbarsClipped=!0)}function Bi(e){if(e.hasFocus())return null;var t=H();if(!t||!W(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&W(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function zi(e){if(e&&e.activeElt&&e.activeElt!=H()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&W(document.body,e.anchorNode)&&W(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function Gi(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Br(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Ur(e))return!1;Yi(e)&&(Br(e),t.dims=Dr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>l&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),At&&(o=tn(e.doc,o),l=nn(e.doc,l));var a=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Gr(e,o,l),n.viewOffset=ln(Ze(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=Ur(e);if(!a&&0==s&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=Bi(e);return s>4&&(n.lineDiv.style.display="none"),Ki(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,zi(u),N(n.cursorDiv),N(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Pi(e,400)),n.updateLineNumbers=null,!0}function Ui(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=$n(e))r&&(t.visible=ti(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+_n(e.display)-qn(e),n.top)}),t.visible=ti(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Gi(e,t))break;Jr(e);var i=gi(e);Vr(e),yi(e,i),_i(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Vi(e,t){var n=new Ii(e,t);if(Gi(e,n)){Jr(e),Ui(e,n);var r=gi(e);Vr(e),yi(e,r),_i(e,r),n.finish()}}function Ki(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,l=o.firstChild;function s(t){var n=t.nextSibling;return u&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}a(s,"rm");for(var c=r.view,h=r.viewFrom,d=0;d<c.length;d++){var f=c[d];if(f.hidden);else if(f.node&&f.node.parentNode==o){for(;l!=f.node;)l=s(l);var p=i&&null!=t&&t<=h&&f.lineNumber;f.changes&&(G(f.changes,"gutter")>-1&&(p=!1),Dn(e,f,h,n)),p&&(N(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(it(e.options,h)))),l=f.node.nextSibling}else{var g=Bn(e,f,h,n);o.insertBefore(g,l)}h+=f.size}for(;l;)l=s(l)}function ji(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",On(e,"gutterChanged",e)}function _i(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Yn(e)+"px"}function Xi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Wr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;l<n.length;l++)if(!n[l].hidden){e.options.fixedGutter&&(n[l].gutter&&(n[l].gutter.style.left=o),n[l].gutterBackground&&(n[l].gutterBackground.style.left=o));var a=n[l].alignable;if(a)for(var s=0;s<a.length;s++)a[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function Yi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=it(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(A("div",[A("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-l)+1,r.lineNumWidth=r.lineNumInnerWidth+l,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",ji(e.display),!0}return!1}function $i(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],l=null;if("string"!=typeof o&&(l=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:l})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function qi(e){var t=e.gutters,n=e.gutterSpecs;N(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,l=i.style,a=t.appendChild(A("div",null,"CodeMirror-gutter "+o));l&&(a.style.cssText=l),"CodeMirror-linenumbers"==o&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",ji(e)}function Zi(e){qi(e.display),Ir(e),Xi(e)}function Qi(e,t,r,i){var o=this;this.input=r,o.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=D("div",null,"CodeMirror-code"),o.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=A("div",null,"CodeMirror-cursors"),o.measure=A("div",null,"CodeMirror-measure"),o.lineMeasure=A("div",null,"CodeMirror-measure"),o.lineSpace=D("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var a=D("div",[o.lineSpace],"CodeMirror-lines");o.mover=A("div",[a],null,"position: relative"),o.sizer=A("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=A("div",null,null,"position: absolute; height: "+U+"px; width: 1px;"),o.gutters=A("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=A("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=A("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),o.wrapper.setAttribute("translate","no"),l&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),u||n&&y||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=$i(i.gutters,i.lineNumbers),qi(o),r.init(o)}Ii.prototype.signal=function(e,t){xe(e,t)&&this.events.push(arguments)},Ii.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ye.apply(null,this.events[e])},a(Ri,"maybeClipScrollbars"),a(Bi,"selectionSnapshot"),a(zi,"restoreSelection"),a(Gi,"updateDisplayIfNeeded"),a(Ui,"postUpdateDisplay"),a(Vi,"updateDisplaySimple"),a(Ki,"patchDisplay"),a(ji,"updateGutterSpace"),a(_i,"setDocumentHeight"),a(Xi,"alignHorizontally"),a(Yi,"maybeUpdateLineNumberWidth"),a($i,"getGutters"),a(qi,"renderGutters"),a(Zi,"updateGutters"),a(Qi,"Display");var Ji=0,eo=null;function to(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function no(e){var t=to(e);return t.x*=eo,t.y*=eo,t}function ro(e,t){var r=to(t),i=r.x,o=r.y,l=eo;0===t.deltaMode&&(i=t.deltaX,o=t.deltaY,l=1);var a=e.display,s=a.scroller,c=s.scrollWidth>s.clientWidth,h=s.scrollHeight>s.clientHeight;if(i&&c||o&&h){if(o&&b&&u)e:for(var f=t.target,p=a.view;f!=s;f=f.parentNode)for(var g=0;g<p.length;g++)if(p[g].node==f){e.display.currentWheelTarget=f;break e}if(i&&!n&&!d&&null!=l)return o&&h&&di(e,Math.max(0,s.scrollTop+o*l)),pi(e,Math.max(0,s.scrollLeft+i*l)),(!o||o&&h)&&Se(t),void(a.wheelStartX=null);if(o&&null!=l){var v=o*l,m=e.doc.scrollTop,y=m+a.wrapper.clientHeight;v<0?m=Math.max(0,m+v-50):y=Math.min(e.doc.height,y+v+50),Vi(e,{top:m,bottom:y})}Ji<20&&0!==t.deltaMode&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(eo=(eo*Ji+n)/(Ji+1),++Ji)}}),200)):(a.wheelDX+=i,a.wheelDY+=o))}}l?eo=-.53:n?eo=15:h?eo=-.7:f&&(eo=-1/3),a(to,"wheelEventDelta"),a(no,"wheelEventPixels"),a(ro,"onScrollWheel");var io=a((function(e,t){this.ranges=e,this.primIndex=t}),"Selection");io.prototype.primary=function(){return this.ranges[this.primIndex]},io.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!at(n.anchor,r.anchor)||!at(n.head,r.head))return!1}return!0},io.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new oo(st(this.ranges[t].anchor),st(this.ranges[t].head));return new io(e,this.primIndex)},io.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},io.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(lt(t,r.from())>=0&<(e,r.to())<=0)return n}return-1};var oo=a((function(e,t){this.anchor=e,this.head=t}),"Range");function lo(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return lt(e.from(),t.from())})),n=G(t,i);for(var o=1;o<t.length;o++){var l=t[o],a=t[o-1],s=lt(a.to(),l.from());if(r&&!l.empty()?s>0:s>=0){var u=ct(a.from(),l.from()),c=ut(a.to(),l.to()),h=a.empty()?l.from()==l.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new oo(h?c:u,h?u:c))}}return new io(t,n)}function ao(e,t){return new io([new oo(e,t||e)],0)}function so(e){return e.text?ot(e.from.line+e.text.length-1,q(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function uo(e,t){if(lt(e,t.from)<0)return e;if(lt(e,t.to)<=0)return so(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=so(t).ch-t.to.ch),ot(n,r)}function co(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new oo(uo(i.anchor,t),uo(i.head,t)))}return lo(e.cm,n,e.sel.primIndex)}function ho(e,t,n){return e.line==t.line?ot(n.line,e.ch-t.ch+n.ch):ot(n.line+(e.line-t.line),e.ch)}function fo(e,t,n){for(var r=[],i=ot(e.first,0),o=i,l=0;l<t.length;l++){var a=t[l],s=ho(a.from,i,o),u=ho(so(a),i,o);if(i=a.to,o=u,"around"==n){var c=e.sel.ranges[l],h=lt(c.head,c.anchor)<0;r[l]=new oo(h?u:s,h?s:u)}else r[l]=new oo(s,s)}return new io(r,e.sel.primIndex)}function po(e){e.doc.mode=Ke(e.options,e.doc.modeOption),go(e)}function go(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Pi(e,100),e.state.modeGen++,e.curOp&&Ir(e)}function vo(e,t){return 0==t.from.ch&&0==t.to.ch&&""==q(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function mo(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){cn(e,n,i,r),On(e,"change",e,t)}function l(e,t){for(var n=[],o=e;o<t;++o)n.push(new un(c[o],i(o),r));return n}a(i,"spansFor"),a(o,"update"),a(l,"linesFor");var s=t.from,u=t.to,c=t.text,h=Ze(e,s.line),d=Ze(e,u.line),f=q(c),p=i(c.length-1),g=u.line-s.line;if(t.full)e.insert(0,l(0,c.length)),e.remove(c.length,e.size-c.length);else if(vo(e,t)){var v=l(0,c.length-1);o(d,d.text,p),g&&e.remove(s.line,g),v.length&&e.insert(s.line,v)}else if(h==d)if(1==c.length)o(h,h.text.slice(0,s.ch)+f+h.text.slice(u.ch),p);else{var m=l(1,c.length-1);m.push(new un(f+h.text.slice(u.ch),p,r)),o(h,h.text.slice(0,s.ch)+c[0],i(0)),e.insert(s.line+1,m)}else if(1==c.length)o(h,h.text.slice(0,s.ch)+c[0]+d.text.slice(u.ch),i(0)),e.remove(s.line+1,g);else{o(h,h.text.slice(0,s.ch)+c[0],i(0)),o(d,f+d.text.slice(u.ch),p);var y=l(1,c.length-1);g>1&&e.remove(s.line+1,g-1),e.insert(s.line+1,y)}On(e,"change",e,t)}function yo(e,t,n){function r(e,i,o){if(e.linked)for(var l=0;l<e.linked.length;++l){var a=e.linked[l];if(a.doc!=i){var s=o&&a.sharedHist;n&&!s||(t(a.doc,s),r(a.doc,e,s))}}}a(r,"propagate"),r(e,null,!0)}function bo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Fr(e),po(e),wo(e),e.options.direction=t.direction,e.options.lineWrapping||sn(e),e.options.mode=t.modeOption,Ir(e)}function wo(e){("rtl"==e.doc.direction?F:M)(e.display.lineDiv,"CodeMirror-rtl")}function xo(e){Di(e,(function(){wo(e),Ir(e)}))}function Co(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function So(e,t){var n={from:st(t.from),to:so(t),text:Qe(e,t.from,t.to)};return Ao(e,n,t.from.line,t.to.line+1),yo(e,(function(e){return Ao(e,n,t.from.line,t.to.line+1)}),!0),n}function Lo(e){for(;e.length&&q(e).ranges;)e.pop()}function ko(e,t){return t?(Lo(e.done),q(e.done)):e.done.length&&!q(e.done).ranges?q(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),q(e.done)):void 0}function To(e,t,n,r){var i=e.history;i.undone.length=0;var o,l,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=ko(i,i.lastOp==r)))l=q(o.changes),0==lt(t.from,t.to)&&0==lt(t.from,l.to)?l.to=so(t):o.changes.push(So(e,t));else{var s=q(i.done);for(s&&s.ranges||Oo(e.sel,i.done),o={changes:[So(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||ye(e,"historyAdded")}function Mo(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function No(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Mo(e,o,q(i.done),t))?i.done[i.done.length-1]=t:Oo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Lo(i.undone)}function Oo(e,t){var n=q(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ao(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Do(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Wo(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Do(n[i]));return r}function Ho(e,t){var n=Wo(e,t),r=Bt(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],l=r[i];if(o&&l)e:for(var a=0;a<l.length;++a){for(var s=l[a],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}else l&&(n[i]=l)}return n}function Fo(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?io.prototype.deepCopy.call(o):o);else{var l=o.changes,a=[];r.push({changes:a});for(var s=0;s<l.length;++s){var u=l[s],c=void 0;if(a.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(c=h.match(/^spans_(\d+)$/))&&G(t,Number(c[1]))>-1&&(q(a)[h]=u[h],delete u[h])}}}return r}function Po(e,t,n,r){if(r){var i=e.anchor;if(n){var o=lt(t,i)<0;o!=lt(n,i)<0?(i=t,t=n):o!=lt(t,n)<0&&(t=n)}return new oo(i,t)}return new oo(n||t,t)}function Eo(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Uo(e,new io([Po(e.sel.primary(),t,n,i)],0),r)}function Io(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Po(e.sel.ranges[o],t[o],null,i);Uo(e,lo(e.cm,r,e.sel.primIndex),n)}function Ro(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Uo(e,lo(e.cm,i,e.sel.primIndex),r)}function Bo(e,t,n,r){Uo(e,ao(t,n),r)}function zo(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new oo(dt(e,t[n].anchor),dt(e,t[n].head))},origin:n&&n.origin};return ye(e,"beforeSelectionChange",e,r),e.cm&&ye(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?lo(e.cm,r.ranges,r.ranges.length-1):t}function Go(e,t,n){var r=e.history.done,i=q(r);i&&i.ranges?(r[r.length-1]=t,Vo(e,t,n)):Uo(e,t,n)}function Uo(e,t,n){Vo(e,t,n),No(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Vo(e,t,n){(xe(e,"beforeSelectionChange")||e.cm&&xe(e.cm,"beforeSelectionChange"))&&(t=zo(e,t,n));var r=n&&n.bias||(lt(t.primary().head,e.sel.primary().head)<0?-1:1);Ko(e,_o(e,t,r,!0)),n&&!1===n.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||ai(e.cm)}function Ko(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,we(e.cm)),On(e,"cursorActivity",e))}function jo(e){Ko(e,_o(e,e.sel,null,!1))}function _o(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=Yo(e,l.anchor,a&&a.anchor,n,r),u=Yo(e,l.head,a&&a.head,n,r);(i||s!=l.anchor||u!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new oo(s,u))}return i?lo(e.cm,i,t.primIndex):t}function Xo(e,t,n,r,i){var o=Ze(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var a=o.markedSpans[l],s=a.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,c="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==a.from||(u?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(c?a.to>=t.ch:a.to>t.ch))){if(i&&(ye(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!s.atomic)continue;if(n){var h=s.find(r<0?1:-1),d=void 0;if((r<0?c:u)&&(h=$o(e,h,-r,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(d=lt(h,n))&&(r<0?d<0:d>0))return Xo(e,h,t,r,i)}var f=s.find(r<0?-1:1);return(r<0?u:c)&&(f=$o(e,f,r,f.line==t.line?o:null)),f?Xo(e,f,t,r,i):null}}return t}function Yo(e,t,n,r,i){var o=r||1,l=Xo(e,t,n,o,i)||!i&&Xo(e,t,n,o,!0)||Xo(e,t,n,-o,i)||!i&&Xo(e,t,n,-o,!0);return l||(e.cantEdit=!0,ot(e.first,0))}function $o(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?dt(e,ot(t.line-1)):null:n>0&&t.ch==(r||Ze(e,t.line)).text.length?t.line<e.first+e.size-1?ot(t.line+1,0):null:new ot(t.line,t.ch+n)}function qo(e){e.setSelection(ot(e.firstLine(),0),ot(e.lastLine()),K)}function Zo(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=dt(e,t)),n&&(r.to=dt(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),ye(e,"beforeChange",e,r),e.cm&&ye(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Qo(e,t,n){if(e.cm){if(!e.cm.curOp)return Wi(e.cm,Qo)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(xe(e,"beforeChange")||e.cm&&xe(e.cm,"beforeChange"))||(t=Zo(e,t,!0))){var r=Ot&&!n&&Gt(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Jo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Jo(e,t)}}function Jo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=lt(t.from,t.to)){var n=co(e,t);To(e,t,n,e.cm?e.cm.curOp.id:NaN),nl(e,t,n,Bt(e,t));var r=[];yo(e,(function(e,n){n||-1!=G(r,e.history)||(al(e.history,t),r.push(e.history)),nl(e,t,null,Bt(e,t))}))}}function el(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,l=e.sel,s="undo"==t?o.done:o.undone,u="undo"==t?o.undone:o.done,c=0;c<s.length&&(i=s[c],n?!i.ranges||i.equals(e.sel):i.ranges);c++);if(c!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(r)return void s.push(i);break}if(Oo(i,u),n&&!i.equals(e.sel))return void Uo(e,i,{clearRedo:!1});l=i}var h=[];Oo(l,u),u.push({changes:h,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var d=xe(e,"beforeChange")||e.cm&&xe(e.cm,"beforeChange"),f=a((function(n){var r=i.changes[n];if(r.origin=t,d&&!Zo(e,r,!1))return s.length=0,{};h.push(So(e,r));var o=n?co(e,r):q(s);nl(e,r,o,Ho(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:so(r)});var l=[];yo(e,(function(e,t){t||-1!=G(l,e.history)||(al(e.history,r),l.push(e.history)),nl(e,r,null,Ho(e,r))}))}),"loop"),p=i.changes.length-1;p>=0;--p){var g=f(p);if(g)return g.v}}}}function tl(e,t){if(0!=t&&(e.first+=t,e.sel=new io(Z(e.sel.ranges,(function(e){return new oo(ot(e.anchor.line+t,e.anchor.ch),ot(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Ir(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Rr(e.cm,r,"gutter")}}function nl(e,t,n,r){if(e.cm&&!e.cm.curOp)return Wi(e.cm,nl)(e,t,n,r);if(t.to.line<e.first)tl(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);tl(e,i),t={from:ot(e.first,0),to:ot(t.to.line+i,t.to.ch),text:[q(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ot(o,Ze(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Qe(e,t.from,t.to),n||(n=co(e,t)),e.cm?rl(e.cm,t,r):mo(e,t,r),Vo(e,n,K),e.cantEdit&&Yo(e,ot(e.firstLine(),0))&&(e.cantEdit=!1)}}function rl(e,t,n){var r=e.doc,i=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=tt(Qt(Ze(r,o.line))),r.iter(s,l.line+1,(function(e){if(e==i.maxLine)return a=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&we(e),mo(r,t,n,Hr(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,(function(e){var t=an(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)})),a&&(e.curOp.updateMaxLine=!0)),Nt(r,o.line),Pi(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?Ir(e):o.line!=l.line||1!=t.text.length||vo(e.doc,t)?Ir(e,o.line,l.line+1,u):Rr(e,o.line,"text");var c=xe(e,"changes"),h=xe(e,"change");if(h||c){var d={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};h&&On(e,"change",e,d),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}function il(e,t,n,r,i){var o;r||(r=n),lt(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Qo(e,{from:n,to:r,text:t,origin:i})}function ol(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function ll(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var a=0;a<o.ranges.length;a++)ol(o.ranges[a].anchor,t,n,r),ol(o.ranges[a].head,t,n,r)}else{for(var s=0;s<o.changes.length;++s){var u=o.changes[s];if(n<u.from.line)u.from=ot(u.from.line+r,u.from.ch),u.to=ot(u.to.line+r,u.to.ch);else if(t<=u.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function al(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;ll(e.done,n,r,i),ll(e.undone,n,r,i)}function sl(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Ze(e,ht(e,t)):i=tt(t),null==i?null:(r(o,i)&&e.cm&&Rr(e.cm,i,n),o)}function ul(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function cl(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}oo.prototype.from=function(){return ct(this.anchor,this.head)},oo.prototype.to=function(){return ut(this.anchor,this.head)},oo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},a(lo,"normalizeSelection"),a(ao,"simpleSelection"),a(so,"changeEnd"),a(uo,"adjustForChange"),a(co,"computeSelAfterChange"),a(ho,"offsetPos"),a(fo,"computeReplacedSel"),a(po,"loadMode"),a(go,"resetModeState"),a(vo,"isWholeLineUpdate"),a(mo,"updateDoc"),a(yo,"linkedDocs"),a(bo,"attachDoc"),a(wo,"setDirectionClass"),a(xo,"directionChanged"),a(Co,"History"),a(So,"historyChangeFromChange"),a(Lo,"clearSelectionEvents"),a(ko,"lastChangeEvent"),a(To,"addChangeToHistory"),a(Mo,"selectionEventCanBeMerged"),a(No,"addSelectionToHistory"),a(Oo,"pushSelectionToHistory"),a(Ao,"attachLocalSpans"),a(Do,"removeClearedSpans"),a(Wo,"getOldSpans"),a(Ho,"mergeOldSpans"),a(Fo,"copyHistoryArray"),a(Po,"extendRange"),a(Eo,"extendSelection"),a(Io,"extendSelections"),a(Ro,"replaceOneSelection"),a(Bo,"setSimpleSelection"),a(zo,"filterSelectionChange"),a(Go,"setSelectionReplaceHistory"),a(Uo,"setSelection"),a(Vo,"setSelectionNoUndo"),a(Ko,"setSelectionInner"),a(jo,"reCheckSelection"),a(_o,"skipAtomicInSelection"),a(Xo,"skipAtomicInner"),a(Yo,"skipAtomic"),a($o,"movePos"),a(qo,"selectAll"),a(Zo,"filterChange"),a(Qo,"makeChange"),a(Jo,"makeChangeInner"),a(el,"makeChangeFromHistory"),a(tl,"shiftDoc"),a(nl,"makeChangeSingleDoc"),a(rl,"makeChangeSingleDocInEditor"),a(il,"replaceRange"),a(ol,"rebaseHistSelSingle"),a(ll,"rebaseHistArray"),a(al,"rebaseHist"),a(sl,"changeLine"),a(ul,"LeafChunk"),ul.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,hn(i),On(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},a(cl,"BranchChunk"),cl.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),l=r.height;if(r.removeInner(e,o),this.height-=l-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ul))){var a=[];this.collapse(a),this.children=[new ul(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var l=i.lines.length%25+25,a=l;a<i.lines.length;){var s=new ul(i.lines.slice(a,a+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,l),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new cl(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=G(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new cl(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e);if(i.iterN(e,l,n))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var hl=a((function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t}),"LineWidget");function dl(e,t,n){ln(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&li(e,n)}function fl(e,t,n,r){var i=new hl(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),sl(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!rn(e,t)){var r=ln(t)<e.scrollTop;et(t,t.height+Vn(i)),r&&li(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&On(o,"lineWidgetAdded",o,i,"number"==typeof t?t:tt(t)),i}hl.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=tt(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Vn(this);et(n,Math.max(0,n.height-o)),e&&(Di(e,(function(){dl(e,n,-o),Rr(e,r,"widget")})),On(e,"lineWidgetCleared",e,this,r))}},hl.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Vn(this)-t;i&&(rn(this.doc,r)||et(r,r.height+i),n&&Di(n,(function(){n.curOp.forceUpdate=!0,dl(n,r,i),On(n,"lineWidgetChanged",n,e,tt(r))})))},Ce(hl),a(dl,"adjustScrollWhenAboveVisible"),a(fl,"addLineWidget");var pl=0,gl=a((function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++pl}),"TextMarker");function vl(e,t,n,r,i){if(r&&r.shared)return yl(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Wi(e.cm,vl)(e,t,n,r,i);var o=new gl(e,i),l=lt(t,n);if(r&&R(r,o,!1),l>0||0==l&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=D("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Zt(e,t.line,t,n,o)||t.line!=n.line&&Zt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Wt()}o.addToHistory&&To(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,s=t.line,u=e.cm;if(e.iter(s,n.line+1,(function(r){u&&o.collapsed&&!u.options.lineWrapping&&Qt(r)==u.display.maxLine&&(a=!0),o.collapsed&&s!=t.line&&et(r,0),Et(r,new Ht(o,s==t.line?t.ch:null,s==n.line?n.ch:null),e.cm&&e.cm.curOp),++s})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){rn(e,t)&&et(t,0)})),o.clearOnEnter&&ge(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Dt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++pl,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)Ir(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)Rr(u,c,"text");o.atomic&&jo(u.doc),On(u,"markerAdded",u,o)}return o}gl.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Si(e),xe(this,"clear")){var n=this.find();n&&On(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],a=Ft(l.markedSpans,this);e&&!this.collapsed?Rr(e,tt(l),"text"):e&&(null!=a.to&&(i=tt(l)),null!=a.from&&(r=tt(l))),l.markedSpans=Pt(l.markedSpans,a),null==a.from&&this.collapsed&&!rn(this.doc,l)&&e&&et(l,Or(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=Qt(this.lines[s]),c=an(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Ir(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&jo(e.doc)),e&&On(e,"markerCleared",e,this,r,i),t&&Li(e),this.parent&&this.parent.clear()}},gl.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],l=Ft(o.markedSpans,this);if(null!=l.from&&(n=ot(t?o:tt(o),l.from),-1==e))return n;if(null!=l.to&&(r=ot(t?o:tt(o),l.to),1==e))return r}return n&&{from:n,to:r}},gl.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Di(r,(function(){var i=t.line,o=tt(t.line),l=tr(r,o);if(l&&(cr(l),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!rn(n.doc,i)&&null!=n.height){var a=n.height;n.height=null;var s=Vn(n)-a;s&&et(i,i.height+s)}On(r,"markerChanged",r,e)}))},gl.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=G(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},gl.prototype.detachLine=function(e){if(this.lines.splice(G(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ce(gl),a(vl,"markText");var ml=a((function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this}),"SharedTextMarker");function yl(e,t,n,r,i){(r=R(r)).shared=!1;var o=[vl(e,t,n,r,i)],l=o[0],a=r.widgetNode;return yo(e,(function(e){a&&(r.widgetNode=a.cloneNode(!0)),o.push(vl(e,dt(e,t),dt(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;l=q(o)})),new ml(o,l)}function bl(e){return e.findMarks(ot(e.first,0),e.clipPos(ot(e.lastLine())),(function(e){return e.parent}))}function wl(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(lt(o,l)){var a=vl(e,o,l,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}function xl(e){for(var t=a((function(t){var n=e[t],r=[n.primary.doc];yo(n.primary.doc,(function(e){return r.push(e)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==G(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}}),"loop"),n=0;n<e.length;n++)t(n)}ml.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();On(this,"clear")}},ml.prototype.find=function(e,t){return this.primary.find(e,t)},Ce(ml),a(yl,"markTextShared"),a(bl,"findSharedMarkers"),a(wl,"copySharedMarkers"),a(xl,"detachSharedMarkers");var Cl=0,Sl=a((function(e,t,n,r,i){if(!(this instanceof Sl))return new Sl(e,t,n,r,i);null==n&&(n=0),cl.call(this,[new ul([new un("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=ot(n,0);this.sel=ao(o),this.history=new Co(null),this.id=++Cl,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),mo(this,{from:o,to:o,text:e}),Uo(this,ao(o),K)}),"Doc");Sl.prototype=ee(cl.prototype,{constructor:Sl,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Je(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Fi((function(e){var t=ot(this.first,0),n=this.first+this.size-1;Qo(this,{from:t,to:ot(n,Ze(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&si(this.cm,0,0),Uo(this,ao(t),K)})),replaceRange:function(e,t,n,r){il(this,e,t=dt(this,t),n=n?dt(this,n):t,r)},getRange:function(e,t,n){var r=Qe(this,dt(this,e),dt(this,t));return!1===n?r:""===n?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(rt(this,e))return Ze(this,e)},getLineNumber:function(e){return tt(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ze(this,e)),Qt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return dt(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Fi((function(e,t,n){Bo(this,dt(this,"number"==typeof e?ot(e,t||0):e),null,n)})),setSelection:Fi((function(e,t,n){Bo(this,dt(this,e),dt(this,t||e),n)})),extendSelection:Fi((function(e,t,n){Eo(this,dt(this,e),t&&dt(this,t),n)})),extendSelections:Fi((function(e,t){Io(this,pt(this,e),t)})),extendSelectionsBy:Fi((function(e,t){Io(this,pt(this,Z(this.sel.ranges,e)),t)})),setSelections:Fi((function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new oo(dt(this,e[i].anchor),dt(this,e[i].head||e[i].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Uo(this,lo(this.cm,r,t),n)}})),addSelection:Fi((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new oo(dt(this,e),dt(this,t||e))),Uo(this,lo(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Qe(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Qe(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Fi((function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];r[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:n}}for(var a=t&&"end"!=t&&fo(this,r,t),s=r.length-1;s>=0;s--)Qo(this,r[s]);a?Go(this,a):this.cm&&ai(this.cm)})),undo:Fi((function(){el(this,"undo")})),redo:Fi((function(){el(this,"redo")})),undoSelection:Fi((function(){el(this,"undo",!0)})),redoSelection:Fi((function(){el(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Co(this.history),yo(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Fo(this.history.done),undone:Fo(this.history.undone)}},setHistory:function(e){var t=this.history=new Co(this.history);t.done=Fo(e.done.slice(0),null,!0),t.undone=Fo(e.undone.slice(0),null,!0)},setGutterMarker:Fi((function(e,t,n){return sl(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&ie(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:Fi((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&sl(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,ie(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!rt(this,e))return null;if(t=e,!(e=Ze(this,e)))return null}else if(null==(t=tt(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Fi((function(e,t,n){return sl(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(k(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:Fi((function(e,t,n){return sl(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(k(n));if(!o)return!1;var l=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&l!=i.length?" ":"")+i.slice(l)||null}return!0}))})),addLineWidget:Fi((function(e,t,n){return fl(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return vl(this,dt(this,e),dt(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return vl(this,e=dt(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Ze(this,(e=dt(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=dt(this,e),t=dt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var l=o.markedSpans;if(l)for(var a=0;a<l.length;a++){var s=l[a];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n})),dt(this,ot(n,t))},indexFromPos:function(e){var t=(e=dt(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Sl(Je(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Sl(Je(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wl(r,bl(this)),r},unlinkDoc:function(e){if(e instanceof Ia&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),xl(bl(this));break}if(e.history==this.history){var n=[e.id];yo(e,(function(e){return n.push(e.id)}),!0),e.history=new Co(null),e.history.done=Fo(this.history.done,n),e.history.undone=Fo(this.history.undone,n)}},iterLinkedDocs:function(e){yo(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Fe(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Fi((function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&xo(this.cm))}))}),Sl.prototype.eachLine=Sl.prototype.iter;var Ll=0;function kl(e){var t=this;if(Nl(t),!be(t,e)&&!Kn(t.display,e)){Se(e),l&&(Ll=+new Date);var n=Pr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),s=0,u=a((function(){++s==i&&Wi(t,(function(){var e={from:n=dt(t.doc,n),to:n,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};Qo(t.doc,e),Go(t.doc,ao(dt(t.doc,n),dt(t.doc,so(e))))}))()}),"markAsReadAndPasteIfAllFilesAreRead"),c=a((function(e,n){if(t.options.allowDropFileTypes&&-1==G(t.options.allowDropFileTypes,e.type))u();else{var r=new FileReader;r.onerror=function(){return u()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[n]=e),u()},r.readAsText(e)}}),"readTextFromFile"),h=0;h<r.length;h++)c(r[h],h);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Vo(t.doc,ao(n,n)),f)for(var p=0;p<f.length;++p)il(t.doc,"",f[p].anchor,f[p].head,"drag");t.replaceSelection(d,"around","paste"),t.display.input.focus()}}catch(g){}}}}function Tl(e,t){if(l&&(!e.state.draggingText||+new Date-Ll<100))Te(t);else if(!be(e,t)&&!Kn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}function Ml(e,t){var n=Pr(e,t);if(n){var r=document.createDocumentFragment();jr(e,n,r),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),O(e.display.dragCursor,r)}}function Nl(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ol(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}a(kl,"onDrop"),a(Tl,"onDragStart"),a(Ml,"onDragOver"),a(Nl,"clearDragCursor"),a(Ol,"forEachCodeMirror");var Al=!1;function Dl(){Al||(Wl(),Al=!0)}function Wl(){var e;ge(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Ol(Hl)}),100))})),ge(window,"blur",(function(){return Ol(Qr)}))}function Hl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}a(Dl,"ensureGlobalHandlers"),a(Wl,"registerGlobalHandlers"),a(Hl,"onResize");for(var Fl={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Pl=0;Pl<10;Pl++)Fl[Pl+48]=Fl[Pl+96]=String(Pl);for(var El=65;El<=90;El++)Fl[El]=String.fromCharCode(El);for(var Il=1;Il<=12;Il++)Fl[Il+111]=Fl[Il+63235]="F"+Il;var Rl={};function Bl(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var l=0;l<o.length-1;l++){var a=o[l];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function zl(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=Z(n.split(" "),Bl),o=0;o<i.length;o++){var l=void 0,a=void 0;o==i.length-1?(a=i.join(" "),l=r):(a=i.slice(0,o+1).join(" "),l="...");var s=t[a];if(s){if(s!=l)throw new Error("Inconsistent bindings for "+a)}else t[a]=l}delete e[n]}for(var u in t)e[u]=t[u];return e}function Gl(e,t,n,r){var i=(t=jl(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Gl(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var l=Gl(e,t.fallthrough[o],n,r);if(l)return l}}}function Ul(e){var t="string"==typeof e?e:Fl[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Vl(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(S?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(S?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Kl(e,t){if(d&&34==e.keyCode&&e.char)return!1;var n=Fl[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Vl(n,e,t))}function jl(e){return"string"==typeof e?Rl[e]:e}function _l(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&<(o.from,q(r).to)<=0;){var l=r.pop();if(lt(l.from,o.from)<0){o.from=l.from;break}}r.push(o)}Di(e,(function(){for(var t=r.length-1;t>=0;t--)il(e.doc,"",r[t].from,r[t].to,"+delete");ai(e)}))}function Xl(e,t,n){var r=ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Yl(e,t,n){var r=Xl(e,t.ch,n);return null==r?null:new ot(t.line,r,n<0?"after":"before")}function $l(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=fe(n,t.doc.direction);if(o){var l,a=i<0?q(o):o[0],s=i<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var u=nr(t,n);l=i<0?n.text.length-1:0;var c=rr(t,u,l).top;l=se((function(e){return rr(t,u,e).top==c}),i<0==(1==a.level)?a.from:a.to-1,l),"before"==s&&(l=Xl(n,l,1))}else l=i<0?a.to:a.from;return new ot(r,l,s)}}return new ot(r,i<0?n.text.length:0,i<0?"before":"after")}function ql(e,t,n,r){var i=fe(t,e.doc.direction);if(!i)return Yl(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=he(i,n.ch,n.sticky),l=i[o];if("ltr"==e.doc.direction&&l.level%2==0&&(r>0?l.to>n.ch:l.from<n.ch))return Yl(t,n,r);var s,u=a((function(e,n){return Xl(t,e instanceof ot?e.ch:e,n)}),"mv"),c=a((function(n){return e.options.lineWrapping?(s=s||nr(e,t),Lr(e,t,s,n)):{begin:0,end:t.text.length}}),"getWrappedLineExtent"),h=c("before"==n.sticky?u(n,-1):n.ch);if("rtl"==e.doc.direction||1==l.level){var d=1==l.level==r<0,f=u(n,d?1:-1);if(null!=f&&(d?f<=l.to&&f<=h.end:f>=l.from&&f>=h.begin)){var p=d?"before":"after";return new ot(n.line,f,p)}}var g=a((function(e,t,r){for(var o=a((function(e,t){return t?new ot(n.line,u(e,1),"before"):new ot(n.line,e,"after")}),"getRes");e>=0&&e<i.length;e+=t){var l=i[e],s=t>0==(1!=l.level),c=s?r.begin:u(r.end,-1);if(l.from<=c&&c<l.to)return o(c,s);if(c=s?l.from:u(l.to,-1),r.begin<=c&&c<r.end)return o(c,s)}}),"searchInVisualLine"),v=g(o+r,r,h);if(v)return v;var m=r>0?h.end:u(h.begin,-1);return null==m||r>0&&m==t.text.length||!(v=g(r>0?0:i.length-1,r,c(m)))?null:v}Rl.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Rl.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Rl.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Rl.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Rl.default=b?Rl.macDefault:Rl.pcDefault,a(Bl,"normalizeKeyName"),a(zl,"normalizeKeyMap"),a(Gl,"lookupKey"),a(Ul,"isModifierKey"),a(Vl,"addModifierNames"),a(Kl,"keyName"),a(jl,"getKeyMap"),a(_l,"deleteNearSelection"),a(Xl,"moveCharLogically"),a(Yl,"moveLogically"),a($l,"endOfLine"),a(ql,"moveVisually");var Zl={selectAll:qo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),K)},killLine:function(e){return _l(e,(function(t){if(t.empty()){var n=Ze(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ot(t.head.line+1,0)}:{from:t.head,to:ot(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return _l(e,(function(t){return{from:ot(t.from().line,0),to:dt(e.doc,ot(t.to().line+1,0))}}))},delLineLeft:function(e){return _l(e,(function(e){return{from:ot(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return _l(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return _l(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ot(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ot(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return Ql(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ea(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return Jl(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),_)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),_)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?ea(e,t.head):r}),_)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),l=B(e.getLine(o.line),o.ch,r);t.push($(r-l%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Di(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=Ze(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ot(i.line,i.ch-1)),i.ch>0)i=new ot(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ot(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=Ze(e.doc,i.line-1).text;l&&(i=new ot(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),ot(i.line-1,l.length-1),i,"+transpose"))}n.push(new oo(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Di(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);ai(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ql(e,t){var n=Ze(e.doc,t),r=Qt(n);return r!=n&&(t=tt(r)),$l(!0,e,r,t,1)}function Jl(e,t){var n=Ze(e.doc,t),r=Jt(n);return r!=n&&(t=tt(r)),$l(!0,e,n,t,-1)}function ea(e,t){var n=Ql(e,t.line),r=Ze(e.doc,n.line),i=fe(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(n.ch,r.text.search(/\S/)),l=t.line==n.line&&t.ch<=o&&t.ch;return ot(n.line,l?0:o,n.sticky)}return n}function ta(e,t,n){if("string"==typeof t&&!(t=Zl[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=V}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function na(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Gl(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Gl(t,e.options.extraKeys,n,e)||Gl(t,e.options.keyMap,n,e)}a(Ql,"lineStart"),a(Jl,"lineEnd"),a(ea,"lineStartSmart"),a(ta,"doHandleBinding"),a(na,"lookupKeyForEditor");var ra=new z;function ia(e,t,n,r){var i=e.state.keySeq;if(i){if(Ul(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ra.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),oa(e,i+" "+t,n,r))return!0}return oa(e,t,n,r)}function oa(e,t,n,r){var i=na(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&On(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(Se(n),Yr(e)),!!i}function la(e,t){var n=Kl(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?ia(e,"Shift-"+n,t,(function(t){return ta(e,t,!0)}))||ia(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ta(e,t)})):ia(e,n,t,(function(t){return ta(e,t)})))}function aa(e,t,n){return ia(e,"'"+n+"'",t,(function(t){return ta(e,t,!0)}))}a(ia,"dispatchKey"),a(oa,"dispatchKeyInner"),a(la,"handleKeyBinding"),a(aa,"handleCharBinding");var sa=null;function ua(e){var t=this;if((!e.target||e.target==t.display.input.getField())&&(t.curOp.focus=H(),!be(t,e))){l&&s<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var i=la(t,e);d&&(sa=i?r:null,i||88!=r||Ee||!(b?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!b&&!i&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||ca(t)}}function ca(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(M(t,"CodeMirror-crosshair"),me(document,"keyup",n),me(document,"mouseover",n))}F(t,"CodeMirror-crosshair"),a(n,"up"),ge(document,"keyup",n),ge(document,"mouseover",n)}function ha(e){16==e.keyCode&&(this.doc.sel.shift=!1),be(this,e)}function da(e){var t=this;if((!e.target||e.target==t.display.input.getField())&&!(Kn(t.display,e)||be(t,e)||e.ctrlKey&&!e.altKey||b&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(d&&n==sa)return sa=null,void Se(e);if(!d||e.which&&!(e.which<10)||!la(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(aa(t,e,i)||t.display.input.onKeyPress(e))}}}a(ua,"onKeyDown"),a(ca,"showCrossHair"),a(ha,"onKeyUp"),a(da,"onKeyPress");var fa,pa,ga=400,va=a((function(e,t,n){this.time=e,this.pos=t,this.button=n}),"PastClick");function ma(e,t){var n=+new Date;return pa&&pa.compare(n,e,t)?(fa=pa=null,"triple"):fa&&fa.compare(n,e,t)?(pa=new va(n,e,t),fa=null,"double"):(fa=new va(n,e,t),pa=null,"single")}function ya(e){var t=this,n=t.display;if(!(be(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,Kn(n,e))u||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!Ma(t,e)){var r=Pr(t,e),i=Ne(e),o=r?ma(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&ba(t,i,r,o,e)||(1==i?r?xa(t,r,o,e):Me(e)==n.scroller&&Se(e):2==i?(r&&Eo(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(L?t.display.input.onContextMenu(e):qr(t)))}}function ba(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),ia(e,Vl(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=Zl[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=V}finally{e.state.suppressEdits=!1}return r}))}function wa(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=w?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=b?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(b?n.altKey:n.ctrlKey)),i}function xa(e,t,n,r){l?setTimeout(I($r,e),0):e.curOp.focus=H();var i,o=wa(e,n,r),a=e.doc.sel;e.options.dragDrop&&De&&!e.isReadOnly()&&"single"==n&&(i=a.contains(t))>-1&&(lt((i=a.ranges[i]).from(),t)<0||t.xRel>0)&&(lt(i.to(),t)>0||t.xRel<0)?Ca(e,r,t,o):La(e,r,t,o)}function Ca(e,t,n,r){var i=e.display,o=!1,c=Wi(e,(function(t){u&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:qr(e)),me(i.wrapper.ownerDocument,"mouseup",c),me(i.wrapper.ownerDocument,"mousemove",h),me(i.scroller,"dragstart",d),me(i.scroller,"drop",c),o||(Se(t),r.addNew||Eo(e.doc,n,null,null,r.extend),u&&!f||l&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),h=a((function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10}),"mouseMove"),d=a((function(){return o=!0}),"dragStart");u&&(i.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,ge(i.wrapper.ownerDocument,"mouseup",c),ge(i.wrapper.ownerDocument,"mousemove",h),ge(i.scroller,"dragstart",d),ge(i.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Sa(e,t,n){if("char"==n)return new oo(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new oo(ot(t.line,0),dt(e.doc,ot(t.line+1,0)));var r=n(e,t);return new oo(r.from,r.to)}function La(e,t,n,r){l&&qr(e);var i=e.display,o=e.doc;Se(t);var s,u,c=o.sel,h=c.ranges;if(r.addNew&&!r.extend?(u=o.sel.contains(n),s=u>-1?h[u]:new oo(n,n)):(s=o.sel.primary(),u=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new oo(n,n)),n=Pr(e,t,!0,!0),u=-1;else{var d=Sa(e,n,r.unit);s=r.extend?Po(s,d.anchor,d.head,r.extend):d}r.addNew?-1==u?(u=h.length,Uo(o,lo(e,h.concat([s]),u),{scroll:!1,origin:"*mouse"})):h.length>1&&h[u].empty()&&"char"==r.unit&&!r.extend?(Uo(o,lo(e,h.slice(0,u).concat(h.slice(u+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):Ro(o,u,s,j):(u=0,Uo(o,new io([s],0),j),c=o.sel);var f=n;function p(t){if(0!=lt(f,t))if(f=t,"rectangle"==r.unit){for(var i=[],l=e.options.tabSize,a=B(Ze(o,n.line).text,n.ch,l),h=B(Ze(o,t.line).text,t.ch,l),d=Math.min(a,h),p=Math.max(a,h),g=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));g<=v;g++){var m=Ze(o,g).text,y=X(m,d,l);d==p?i.push(new oo(ot(g,y),ot(g,y))):m.length>y&&i.push(new oo(ot(g,y),ot(g,X(m,p,l))))}i.length||i.push(new oo(n,n)),Uo(o,lo(e,c.ranges.slice(0,u).concat(i),u),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=s,x=Sa(e,t,r.unit),C=w.anchor;lt(x.anchor,C)>0?(b=x.head,C=ct(w.from(),x.anchor)):(b=x.anchor,C=ut(w.to(),x.head));var S=c.ranges.slice(0);S[u]=ka(e,new oo(dt(o,C),b)),Uo(o,lo(e,S,u),j)}}a(p,"extendTo");var g=i.wrapper.getBoundingClientRect(),v=0;function m(t){var n=++v,l=Pr(e,t,!0,"rectangle"==r.unit);if(l)if(0!=lt(l,f)){e.curOp.focus=H(),p(l);var a=ti(i,o);(l.line>=a.to||l.line<a.from)&&setTimeout(Wi(e,(function(){v==n&&m(t)})),150)}else{var s=t.clientY<g.top?-20:t.clientY>g.bottom?20:0;s&&setTimeout(Wi(e,(function(){v==n&&(i.scroller.scrollTop+=s,m(t))})),50)}}function y(t){e.state.selectingText=!1,v=1/0,t&&(Se(t),i.input.focus()),me(i.wrapper.ownerDocument,"mousemove",b),me(i.wrapper.ownerDocument,"mouseup",w),o.history.lastSelOrigin=null}a(m,"extend"),a(y,"done");var b=Wi(e,(function(e){0!==e.buttons&&Ne(e)?m(e):y(e)})),w=Wi(e,y);e.state.selectingText=w,ge(i.wrapper.ownerDocument,"mousemove",b),ge(i.wrapper.ownerDocument,"mouseup",w)}function ka(e,t){var n=t.anchor,r=t.head,i=Ze(e.doc,n.line);if(0==lt(n,r)&&n.sticky==r.sticky)return t;var o=fe(i);if(!o)return t;var l=he(o,n.ch,n.sticky),a=o[l];if(a.from!=n.ch&&a.to!=n.ch)return t;var s,u=l+(a.from==n.ch==(1!=a.level)?0:1);if(0==u||u==o.length)return t;if(r.line!=n.line)s=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=he(o,r.ch,r.sticky),h=c-l||(r.ch-n.ch)*(1==a.level?-1:1);s=c==u-1||c==u?h<0:h>0}var d=o[u+(s?-1:0)],f=s==(1==d.level),p=f?d.from:d.to,g=f?"after":"before";return n.ch==p&&n.sticky==g?t:new oo(new ot(n.line,p,g),r)}function Ta(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(c){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Se(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!xe(e,n))return ke(t);o-=a.top-l.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=l.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i)return ye(e,n,e,nt(e.doc,o),e.display.gutterSpecs[s].className,t),ke(t)}}function Ma(e,t){return Ta(e,t,"gutterClick",!0)}function Na(e,t){Kn(e.display,t)||Oa(e,t)||be(e,t,"contextmenu")||L||e.display.input.onContextMenu(t)}function Oa(e,t){return!!xe(e,"gutterContextMenu")&&Ta(e,t,"gutterContextMenu",!1)}function Aa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),dr(e)}va.prototype.compare=function(e,t,n){return this.time+ga>e&&0==lt(t,this.pos)&&n==this.button},a(ma,"clickRepeat"),a(ya,"onMouseDown"),a(ba,"handleMappedButton"),a(wa,"configureMouse"),a(xa,"leftButtonDown"),a(Ca,"leftButtonStartDrag"),a(Sa,"rangeForUnit"),a(La,"leftButtonSelect"),a(ka,"bidiSimplify"),a(Ta,"gutterEvent"),a(Ma,"clickInGutter"),a(Na,"onContextMenu"),a(Oa,"contextMenuInGutter"),a(Aa,"themeChanged");var Da={toString:function(){return"CodeMirror.Init"}},Wa={},Ha={};function Fa(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Da&&i(e,t,n)}:i)}a(n,"option"),e.defineOption=n,e.Init=Da,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,po(e)}),!0),n("indentUnit",2,po,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){go(e),dr(e),Ir(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(ot(r,o))}r++}));for(var i=n.length-1;i>=0;i--)il(e.doc,t,n[i],ot(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Da&&e.refresh()})),n("specialCharPlaceholder",vn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",y?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Aa(e),Zi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=jl(t),i=n!=Da&&jl(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ea,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=$i(t,e.options.lineNumbers),Zi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Wr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return yi(e)}),!0),n("scrollbarStyle","native",(function(e){xi(e),yi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=$i(e.options.gutters,t),Zi(e)}),!0),n("firstLineNumber",1,Zi,!0),n("lineNumberFormatter",(function(e){return e}),Zi,!0),n("showCursorWhenSelecting",!1,Vr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Qr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Pa),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Vr,!0),n("singleCursorHeightPerLine",!0,Vr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,go,!0),n("addModeClass",!1,go,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,go,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Pa(e,t,n){if(!t!=!(n&&n!=Da)){var r=e.display.dragFunctions,i=t?ge:me;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Ea(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(M(e.display.wrapper,"CodeMirror-wrap"),sn(e)),Fr(e),Ir(e),dr(e),setTimeout((function(){return yi(e)}),100)}function Ia(e,t){var n=this;if(!(this instanceof Ia))return new Ia(e,t);this.options=t=t?R(t):{},R(Wa,t,!1);var r=t.value;"string"==typeof r?r=new Sl(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ia.inputStyles[t.inputStyle](this),o=this.display=new Qi(e,r,i,t);for(var a in o.wrapper.CodeMirror=this,Aa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),xi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new z,keySeq:null,specialChars:null},t.autofocus&&!y&&o.input.focus(),l&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Ra(this),Dl(),Si(this),this.curOp.forceUpdate=!0,bo(this,r),t.autofocus&&!y||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Zr(n)}),20):Qr(this),Ha)Ha.hasOwnProperty(a)&&Ha[a](this,t[a],Da);Yi(this),t.finishInit&&t.finishInit(this);for(var c=0;c<Ba.length;++c)Ba[c](this);Li(this),u&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Ra(e){var t=e.display;ge(t.scroller,"mousedown",Wi(e,ya)),ge(t.scroller,"dblclick",l&&s<11?Wi(e,(function(t){if(!be(e,t)){var n=Pr(e,t);if(n&&!Ma(e,t)&&!Kn(e.display,t)){Se(t);var r=e.findWordAt(n);Eo(e.doc,r.anchor,r.head)}}})):function(t){return be(e,t)||Se(t)}),ge(t.scroller,"contextmenu",(function(t){return Na(e,t)})),ge(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||Na(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function o(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function u(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}a(i,"finishTouch"),a(o,"isMouseLikeTouchEvent"),a(u,"farAway"),ge(t.scroller,"touchstart",(function(i){if(!be(e,i)&&!o(i)&&!Ma(e,i)){t.input.ensurePolled(),clearTimeout(n);var l=+new Date;t.activeTouch={start:l,moved:!1,prev:l-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),ge(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),ge(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Kn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,l=e.coordsChar(t.activeTouch,"page");o=!r.prev||u(r,r.prev)?new oo(l,l):!r.prev.prev||u(r,r.prev.prev)?e.findWordAt(l):new oo(ot(l.line,0),dt(e.doc,ot(l.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),Se(n)}i()})),ge(t.scroller,"touchcancel",i),ge(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(di(e,t.scroller.scrollTop),pi(e,t.scroller.scrollLeft,!0),ye(e,"scroll",e))})),ge(t.scroller,"mousewheel",(function(t){return ro(e,t)})),ge(t.scroller,"DOMMouseScroll",(function(t){return ro(e,t)})),ge(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){be(e,t)||Te(t)},over:function(t){be(e,t)||(Ml(e,t),Te(t))},start:function(t){return Tl(e,t)},drop:Wi(e,kl),leave:function(t){be(e,t)||Nl(e)}};var c=t.input.getField();ge(c,"keyup",(function(t){return ha.call(e,t)})),ge(c,"keydown",Wi(e,ua)),ge(c,"keypress",Wi(e,da)),ge(c,"focus",(function(t){return Zr(e,t)})),ge(c,"blur",(function(t){return Qr(e,t)}))}a(Fa,"defineOptions"),a(Pa,"dragDropChanged"),a(Ea,"wrappingChanged"),a(Ia,"CodeMirror"),Ia.defaults=Wa,Ia.optionHandlers=Ha,a(Ra,"registerEventHandlers");var Ba=[];function za(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=bt(e,t).state:n="prev");var l=e.options.tabSize,a=Ze(o,t),s=B(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var u,c=a.text.match(/^\s*/)[0];if(r||/\S/.test(a.text)){if("smart"==n&&((u=o.mode.indent(i,a.text.slice(c.length),a.text))==V||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?B(Ze(o,t-1).text,null,l):0:"add"==n?u=s+e.options.indentUnit:"subtract"==n?u=s-e.options.indentUnit:"number"==typeof n&&(u=s+n),u=Math.max(0,u);var h="",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(u/l);f;--f)d+=l,h+="\t";if(d<u&&(h+=$(u-d)),h!=c)return il(o,h,ot(t,0),ot(t,c.length),"+input"),a.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var g=o.sel.ranges[p];if(g.head.line==t&&g.head.ch<c.length){var v=ot(t,c.length);Ro(o,p,new oo(v,v));break}}}Ia.defineInitHook=function(e){return Ba.push(e)},a(za,"indentLine");var Ga=null;function Ua(e){Ga=e}function Va(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var l=+new Date-200,a="paste"==i||e.state.pasteIncoming>l,s=Fe(t),u=null;if(a&&r.ranges.length>1)if(Ga&&Ga.text.join("\n")==t){if(r.ranges.length%Ga.text.length==0){u=[];for(var c=0;c<Ga.text.length;c++)u.push(o.splitLines(Ga.text[c]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=Z(s,(function(e){return[e]})));for(var h=e.curOp.updateInput,d=r.ranges.length-1;d>=0;d--){var f=r.ranges[d],p=f.from(),g=f.to();f.empty()&&(n&&n>0?p=ot(p.line,p.ch-n):e.state.overwrite&&!a?g=ot(g.line,Math.min(Ze(o,g.line).text.length,g.ch+q(s).length)):a&&Ga&&Ga.lineWise&&Ga.text.join("\n")==s.join("\n")&&(p=g=ot(p.line,0)));var v={from:p,to:g,text:u?u[d%u.length]:s,origin:i||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};Qo(e.doc,v),On(e,"inputRead",e,v)}t&&!a&&ja(e,t),ai(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ka(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Di(t,(function(){return Va(t,n,0,null,"paste")})),!0}function ja(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){l=za(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ze(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=za(e,i.head.line,"smart"));l&&On(e,"electricInput",e,i.head.line)}}}function _a(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:ot(i,0),head:ot(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Xa(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ya(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return u?e.style.width="1000px":e.setAttribute("wrap","off"),v&&(e.style.border="1px solid black"),Xa(e),t}function $a(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&Wi(this,t[e])(this,n,i),ye(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](jl(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Hi((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");Q(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,Ir(this)})),removeOverlay:Hi((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void Ir(this)}})),indentLine:Hi((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),rt(this.doc,e)&&za(this,e,t,n)})),indentSelection:Hi((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(za(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&ai(this));else{var o=i.from(),l=i.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var s=a;s<n;++s)za(this,s,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[r].from().ch>0&&Ro(this.doc,r,new oo(o,u[r].to()),K)}}})),getTokenAt:function(e,t){return Lt(this,e,t)},getLineTokens:function(e,t){return Lt(this,ot(e),t,!0)},getTokenTypeAt:function(e){e=dt(this.doc,e);var t,n=yt(this,Ze(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var l=r+i>>1;if((l?n[2*l-1]:0)>=o)i=l;else{if(!(n[2*l+1]<o)){t=n[2*l+2];break}r=l+1}}var a=t?t.indexOf("overlay "):-1;return a<0?t:0==a?null:t.slice(0,a-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var l=0;l<o[t].length;l++){var a=i[o[t][l]];a&&r.push(a)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var s=0;s<i._global.length;s++){var u=i._global[s];u.pred(o,this)&&-1==G(r,u.val)&&r.push(u.val)}return r},getStateAfter:function(e,t){var n=this.doc;return bt(this,(e=ht(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return br(this,null==e?n.head:"object"==typeof e?dt(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return yr(this,dt(this.doc,e),t||"page")},coordsChar:function(e,t){return Cr(this,(e=mr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=mr(this,{top:e,left:0},t||"page").top,nt(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=Ze(this.doc,e)}else r=e;return vr(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-ln(r):0)},defaultTextHeight:function(){return Or(this.display)},defaultCharWidth:function(){return Ar(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,l=(e=br(this,dt(this.doc,e))).bottom,a=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)l=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(l=e.bottom),a+t.offsetWidth>u&&(a=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(a=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?a=0:"middle"==i&&(a=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=a+"px"),n&&ii(this,{left:a,top:l,right:a+t.offsetWidth,bottom:l+t.offsetHeight})},triggerOnKeyDown:Hi(ua),triggerOnKeyPress:Hi(da),triggerOnKeyUp:ha,triggerOnMouseDown:Hi(ya),execCommand:function(e){if(Zl.hasOwnProperty(e))return Zl[e].call(null,this)},triggerElectric:Hi((function(e){ja(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=dt(this.doc,e),l=0;l<t&&!(o=qa(this.doc,o,i,n,r)).hitSide;++l);return o},moveH:Hi((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?qa(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),_)})),deleteH:Hi((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):_l(this,(function(n){var i=qa(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var l=dt(this.doc,e),a=0;a<t;++a){var s=br(this,l,"div");if(null==o?o=s.left:s.left=o,(l=Za(this,s,i,n)).hitSide)break}return l},moveV:Hi((function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(l){if(o)return e<0?l.from():l.to();var a=br(n,l.head,"div");null!=l.goalColumn&&(a.left=l.goalColumn),i.push(a.left);var s=Za(n,a,e,t);return"page"==t&&l==r.sel.primary()&&li(n,yr(n,s,"div").top-a.top),s}),_),i.length)for(var l=0;l<r.sel.ranges.length;l++)r.sel.ranges[l].goalColumn=i[l]})),findWordAt:function(e){var t=Ze(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var o=t.charAt(n),l=re(o,i)?function(e){return re(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!re(e)};n>0&&l(t.charAt(n-1));)--n;for(;r<t.length&&l(t.charAt(r));)++r}return new oo(ot(e.line,n),ot(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):M(this.display.cursorDiv,"CodeMirror-overwrite"),ye(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==H()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Hi((function(e,t){si(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Yn(this)-this.display.barHeight,width:e.scrollWidth-Yn(this)-this.display.barWidth,clientHeight:qn(this),clientWidth:$n(this)}},scrollIntoView:Hi((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ot(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?ui(this,e):hi(this,e.from,e.to,e.margin)})),setSize:Hi((function(e,t){var n=this,r=a((function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}),"interpret");null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&hr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Rr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,ye(this,"refresh",this)})),operation:function(e){return Di(this,e)},startOperation:function(){return Si(this)},endOperation:function(){return Li(this)},refresh:Hi((function(){var e=this.display.cachedTextHeight;Ir(this),this.curOp.forceUpdate=!0,dr(this),si(this,this.doc.scrollLeft,this.doc.scrollTop),ji(this.display),(null==e||Math.abs(e-Or(this.display))>.5||this.options.lineWrapping)&&Fr(this),ye(this,"refresh",this)})),swapDoc:Hi((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),bo(this,e),dr(this),this.display.input.reset(),si(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,On(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ce(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function qa(e,t,n,r,i){var o=t,l=n,s=Ze(e,t.line),u=i&&"rtl"==e.direction?-n:n;function c(){var n=t.line+u;return!(n<e.first||n>=e.first+e.size)&&(t=new ot(n,t.ch,t.sticky),s=Ze(e,n))}function h(o){var l;if("codepoint"==r){var a=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(a))l=null;else{var h=n>0?a>=55296&&a<56320:a>=56320&&a<57343;l=new ot(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(h?2:1))),-n)}}else l=i?ql(e.cm,s,t,n):Yl(s,t,n);if(null==l){if(o||!c())return!1;t=$l(i,e.cm,s,t.line,u)}else t=l;return!0}if(a(c,"findNextLine"),a(h,"moveOnce"),"char"==r||"codepoint"==r)h();else if("column"==r)h(!0);else if("word"==r||"group"==r)for(var d=null,f="group"==r,p=e.cm&&e.cm.getHelper(t,"wordChars"),g=!0;!(n<0)||h(!g);g=!1){var v=s.text.charAt(t.ch)||"\n",m=re(v,p)?"w":f&&"\n"==v?"n":!f||/\s/.test(v)?null:"p";if(!f||g||m||(m="s"),d&&d!=m){n<0&&(n=1,h(),t.sticky="after");break}if(m&&(d=m),n>0&&!h(!g))break}var y=Yo(e,t,o,l,!0);return at(o,y)&&(y.hitSide=!0),y}function Za(e,t,n,r){var i,o,l=e.doc,a=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(s-.5*Or(e.display),3);i=(n>0?t.bottom:t.top)+n*u}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Cr(e,a,i)).outside;){if(n<0?i<=0:i>=l.height){o.hitSide=!0;break}i+=5*n}return o}a(Ua,"setLastCopied"),a(Va,"applyTextInput"),a(Ka,"handlePaste"),a(ja,"triggerElectric"),a(_a,"copyableRanges"),a(Xa,"disableBrowserMagic"),a(Ya,"hiddenTextarea"),a($a,"addEditorMethods"),a(qa,"findPosH"),a(Za,"findPosV");var Qa=a((function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}),"ContentEditableInput");function Ja(e,t){var n=tr(e,t.line);if(!n||n.hidden)return null;var r=Ze(e.doc,t.line),i=Qn(n,r,t.line),o=fe(r,e.doc.direction),l="left";o&&(l=he(o,t.ch)%2?"right":"left");var a=lr(i.map,t.ch,l);return a.offset="right"==a.collapse?a.end:a.start,a}function es(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ts(e,t){return t&&(e.bad=!0),e}function ns(e,t,n,r,i){var o="",l=!1,s=e.doc.lineSeparator(),u=!1;function c(e){return function(t){return t.id==e}}function h(){l&&(o+=s,u&&(o+=s),l=u=!1)}function d(e){e&&(h(),o+=e)}function f(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void d(n);var o,a=t.getAttribute("cm-marker");if(a){var p=e.findMarks(ot(r,0),ot(i+1,0),c(+a));return void(p.length&&(o=p[0].find(0))&&d(Qe(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;g&&h();for(var v=0;v<t.childNodes.length;v++)f(t.childNodes[v]);/^(pre|p)$/i.test(t.nodeName)&&(u=!0),g&&(l=!0)}else 3==t.nodeType&&d(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(a(c,"recognizeMarker"),a(h,"close"),a(d,"addText"),a(f,"walk");f(t),t!=n;)t=t.nextSibling,u=!1;return o}function rs(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return ts(e.clipPos(ot(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return is(o,t,n)}}function is(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!W(r,t))return ts(ot(tt(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?q(e.rest):e.line;return ts(ot(tt(o),o.text.length),i)}var l=3==t.nodeType?t:null,s=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var u=e.measure,c=u.maps;function h(t,n,r){for(var i=-1;i<(c?c.length:0);i++)for(var o=i<0?u.map:c[i],l=0;l<o.length;l+=3){var a=o[l+2];if(a==t||a==n){var s=tt(i<0?e.line:e.rest[i]),h=o[l]+r;return(r<0||a!=t)&&(h=o[l+(r?1:0)]),ot(s,h)}}}a(h,"find");var d=h(l,s,n);if(d)return ts(d,i);for(var f=s.nextSibling,p=l?l.nodeValue.length-n:0;f;f=f.nextSibling){if(d=h(f,f.firstChild,0))return ts(ot(d.line,d.ch-p),i);p+=f.textContent.length}for(var g=s.previousSibling,v=n;g;g=g.previousSibling){if(d=h(g,g.firstChild,-1))return ts(ot(d.line,d.ch+v),i);v+=g.textContent.length}}Qa.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function l(e){if(o(e)&&!be(r,e)){if(r.somethingSelected())Ua({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=_a(r);Ua({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,K),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var l=Ga.text.join("\n");if(e.clipboardData.setData("Text",l),e.clipboardData.getData("Text")==l)return void e.preventDefault()}var a=Ya(),s=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),s.value=Ga.text.join("\n");var u=H();E(s),setTimeout((function(){r.display.lineSpace.removeChild(a),u.focus(),u==i&&n.showPrimarySelection()}),50)}}i.contentEditable=!0,Xa(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),a(o,"belongsToInput"),ge(i,"paste",(function(e){!o(e)||be(r,e)||Ka(e,r)||s<=11&&setTimeout(Wi(r,(function(){return t.updateFromDOM()})),20)})),ge(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),ge(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),ge(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),ge(i,"touchstart",(function(){return n.forceCompositionEnd()})),ge(i,"input",(function(){t.composing||t.readFromDOMSoon()})),a(l,"onCopyCut"),ge(i,"copy",l),ge(i,"cut",l)},Qa.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Qa.prototype.prepareSelection=function(){var e=Kr(this.cm,!1);return e.focus=H()==this.div,e},Qa.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Qa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Qa.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var l=rs(t,e.anchorNode,e.anchorOffset),a=rs(t,e.focusNode,e.focusOffset);if(!l||l.bad||!a||a.bad||0!=lt(ct(l,a),i)||0!=lt(ut(l,a),o)){var s=t.display.view,u=i.line>=t.display.viewFrom&&Ja(t,i)||{node:s[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&Ja(t,o);if(!c){var h=s[s.length-1].measure,d=h.maps?h.maps[h.maps.length-1]:h.map;c={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(u&&c){var f,p=e.rangeCount&&e.getRangeAt(0);try{f=T(u.node,u.offset,c.offset,c.node)}catch(g){}f&&(!n&&t.state.focused?(e.collapse(u.node,u.offset),f.collapsed||(e.removeAllRanges(),e.addRange(f))):(e.removeAllRanges(),e.addRange(f)),p&&null==e.anchorNode?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Qa.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Qa.prototype.showMultipleSelections=function(e){O(this.cm.display.cursorDiv,e.cursors),O(this.cm.display.selectionDiv,e.selection)},Qa.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Qa.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return W(this.div,t)},Qa.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&H()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Qa.prototype.blur=function(){this.div.blur()},Qa.prototype.getField=function(){return this.div},Qa.prototype.supportsTouch=function(){return!0},Qa.prototype.receivedFocus=function(){var e=this,t=this;function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.selectionInEditor()?setTimeout((function(){return e.pollSelection()}),20):Di(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),a(n,"poll"),this.polling.set(this.cm.options.pollInterval,n)},Qa.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Qa.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(m&&h&&this.cm.display.gutterSpecs.length&&es(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=rs(t,e.anchorNode,e.anchorOffset),r=rs(t,e.focusNode,e.focusOffset);n&&r&&Di(t,(function(){Uo(t.doc,ao(n,r),K),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},Qa.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),l=o.from(),a=o.to();if(0==l.ch&&l.line>r.firstLine()&&(l=ot(l.line-1,Ze(r.doc,l.line-1).length)),a.ch==Ze(r.doc,a.line).text.length&&a.line<r.lastLine()&&(a=ot(a.line+1,0)),l.line<i.viewFrom||a.line>i.viewTo-1)return!1;l.line==i.viewFrom||0==(e=Er(r,l.line))?(t=tt(i.view[0].line),n=i.view[0].node):(t=tt(i.view[e].line),n=i.view[e-1].node.nextSibling);var s,u,c=Er(r,a.line);if(c==i.view.length-1?(s=i.viewTo-1,u=i.lineDiv.lastChild):(s=tt(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var h=r.doc.splitLines(ns(r,n,u,t,s)),d=Qe(r.doc,ot(t,0),ot(s,Ze(r.doc,s).text.length));h.length>1&&d.length>1;)if(q(h)==q(d))h.pop(),d.pop(),s--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),t++}for(var f=0,p=0,g=h[0],v=d[0],m=Math.min(g.length,v.length);f<m&&g.charCodeAt(f)==v.charCodeAt(f);)++f;for(var y=q(h),b=q(d),w=Math.min(y.length-(1==h.length?f:0),b.length-(1==d.length?f:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==h.length&&1==d.length&&t==l.line)for(;f&&f>l.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)f--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(f).replace(/\u200b+$/,"");var x=ot(t,f),C=ot(s,d.length?q(d).length-p:0);return h.length>1||h[0]||lt(x,C)?(il(r.doc,h,x,C,"+input"),!0):void 0},Qa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Qa.prototype.reset=function(){this.forceCompositionEnd()},Qa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Qa.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Qa.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Di(this.cm,(function(){return Ir(e.cm)}))},Qa.prototype.setUneditable=function(e){e.contentEditable="false"},Qa.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Wi(this.cm,Va)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Qa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Qa.prototype.onContextMenu=function(){},Qa.prototype.resetPosition=function(){},Qa.prototype.needsContentAttribute=!0,a(Ja,"posToDOM"),a(es,"isInGutter"),a(ts,"badPos"),a(ns,"domTextBetween"),a(rs,"domToPos"),a(is,"locateNodeInLineView");var os=a((function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null}),"TextareaInput");function ls(e,t){if((t=t?R(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=H();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(a(r,"save"),e.form&&(ge(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch(u){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(me(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Ia((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function as(e){e.off=me,e.on=ge,e.wheelEventPixels=no,e.Doc=Sl,e.splitLines=Fe,e.countColumn=B,e.findColumn=X,e.isWordChar=ne,e.Pass=V,e.signal=ye,e.Line=un,e.changeEnd=so,e.scrollbarModel=wi,e.Pos=ot,e.cmpPos=lt,e.modes=Be,e.mimeModes=ze,e.resolveMode=Ve,e.getMode=Ke,e.modeExtensions=je,e.extendMode=_e,e.copyState=Xe,e.startState=$e,e.innerMode=Ye,e.commands=Zl,e.keyMap=Rl,e.keyName=Kl,e.isModifierKey=Ul,e.lookupKey=Gl,e.normalizeKeyMap=zl,e.StringStream=qe,e.SharedTextMarker=ml,e.TextMarker=gl,e.LineWidget=hl,e.e_preventDefault=Se,e.e_stopPropagation=Le,e.e_stop=Te,e.addClass=F,e.contains=W,e.rmClass=M,e.keyNames=Fl}os.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!be(r,e)){if(r.somethingSelected())Ua({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=_a(r);Ua({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,K):(n.prevInput="",i.value=t.text.join("\n"),E(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),v&&(i.style.width="0px"),ge(i,"input",(function(){l&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),ge(i,"paste",(function(e){be(r,e)||Ka(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),a(o,"prepareCopyCut"),ge(i,"cut",o),ge(i,"copy",o),ge(e.scroller,"paste",(function(t){if(!Kn(e,t)&&!be(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),ge(e.lineSpace,"selectstart",(function(t){Kn(e,t)||Se(t)})),ge(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),ge(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},os.prototype.createField=function(e){this.wrapper=Ya(),this.textarea=this.wrapper.firstChild},os.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},os.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Kr(e);if(e.options.moveInputWithCursor){var i=br(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return r},os.prototype.showSelection=function(e){var t=this.cm.display;O(t.cursorDiv,e.cursors),O(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},os.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&E(this.textarea),l&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",l&&s>=9&&(this.hasSelection=null))}},os.prototype.getField=function(){return this.textarea},os.prototype.supportsTouch=function(){return!1},os.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||H()!=this.textarea))try{this.textarea.focus()}catch(e){}},os.prototype.blur=function(){this.textarea.blur()},os.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},os.prototype.receivedFocus=function(){this.slowPoll()},os.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},os.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,a(n,"p"),t.polling.set(20,n)},os.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Pe(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(l&&s>=9&&this.hasSelection===i||b&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="\u200b"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,u=Math.min(r.length,i.length);a<u&&r.charCodeAt(a)==i.charCodeAt(a);)++a;return Di(t,(function(){Va(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},os.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},os.prototype.onKeyPress=function(){l&&s>=9&&(this.hasSelection=null),this.fastPoll()},os.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Pr(n,e),c=r.scroller.scrollTop;if(o&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Wi(n,Uo)(n.doc,ao(o),K);var h,f=i.style.cssText,p=t.wrapper.style.cssText,g=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-g.top-5)+"px; left: "+(e.clientX-g.left-5)+"px;\n z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",u&&(h=window.scrollY),r.input.focus(),u&&window.scrollTo(null,h),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a(m,"prepareSelectAllHack"),a(y,"rehide"),l&&s>=9&&m(),L){Te(e);var v=a((function(){me(window,"mouseup",v),setTimeout(y,20)}),"mouseup");ge(window,"mouseup",v)}else setTimeout(y,50)}function m(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="\u200b"+(e?i.value:"");i.value="\u21da",i.value=o,t.prevInput=e?"":"\u200b",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=f,l&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!l||l&&s<9)&&m();var e=0,o=a((function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"\u200b"==t.prevInput?Wi(n,qo)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())}),"poll");r.detectingSelectAll=setTimeout(o,200)}}},os.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},os.prototype.setUneditable=function(){},os.prototype.needsContentAttribute=!1,a(ls,"fromTextArea"),a(as,"addLegacyProps"),Fa(Ia),$a(Ia);var ss="iter insert remove copy getEditor constructor".split(" ");for(var us in Sl.prototype)Sl.prototype.hasOwnProperty(us)&&G(ss,us)<0&&(Ia.prototype[us]=function(e){return function(){return e.apply(this.doc,arguments)}}(Sl.prototype[us]));return Ce(Sl),Ia.inputStyles={textarea:os,contenteditable:Qa},Ia.defineMode=function(e){Ia.defaults.mode||"null"==e||(Ia.defaults.mode=e),Ge.apply(this,arguments)},Ia.defineMIME=Ue,Ia.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ia.defineMIME("text/plain","null"),Ia.defineExtension=function(e,t){Ia.prototype[e]=t},Ia.defineDocExtension=function(e,t){Sl.prototype[e]=t},Ia.fromTextArea=ls,as(Ia),Ia.version="5.65.3",Ia}();var h=c.exports,d=Object.freeze(s((r={__proto__:null},(0,i.Z)(r,Symbol.toStringTag,"Module"),(0,i.Z)(r,"default",h),r),[c.exports]))}}]);
|