@directus/app 9.0.0-rc.93 → 9.0.0-rc.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@directus_extensions-sdk.98dcef28.js +1 -0
- package/dist/{img/docs/200-200-contain-75.jpg → assets/200-200-contain-75.c99b890d.jpg} +0 -0
- package/dist/{img/docs/200-200-cover-100.jpg → assets/200-200-cover-100.6a119754.jpg} +0 -0
- package/dist/{img/docs/200-200-cover-50.jpg → assets/200-200-cover-50.b5c757be.jpg} +0 -0
- package/dist/{img/docs/200-200-cover-75.jpg → assets/200-200-cover-75.5e0d9ff8.jpg} +0 -0
- package/dist/assets/active-line.7ccf91ee.js +1 -0
- package/dist/assets/activity.a21be638.js +80 -0
- package/dist/assets/activity.e2f45839.js +1 -0
- package/dist/{img/docs/getting-started/quickstart/add-field.png → assets/add-field.880542d6.png} +0 -0
- package/dist/assets/af-ZA.5bc87dbc.js +1 -0
- package/dist/assets/af.0ae12dd5.js +1 -0
- package/dist/assets/api-config.05de7216.js +53 -0
- package/dist/assets/api-endpoints.fef8bc57.js +30 -0
- package/dist/assets/api-hooks.c2681548.js +77 -0
- package/dist/assets/apl.0e21be9c.js +1 -0
- package/dist/{img/docs/app-overview.svg → assets/app-overview.9d9e9cee.svg} +0 -0
- package/dist/assets/app.9000cdd9.js +1 -0
- package/dist/assets/application.ec7c721f.js +1 -0
- package/dist/assets/ar-SA.04f9b14b.js +1 -0
- package/dist/assets/ar-dz.4def840c.js +1 -0
- package/dist/assets/ar-kw.8e19bfac.js +1 -0
- package/dist/assets/ar-ly.1c517370.js +1 -0
- package/dist/assets/ar-ma.f01598f3.js +1 -0
- package/dist/assets/ar-sa.c5fe14e9.js +1 -0
- package/dist/assets/ar-tn.121f69b2.js +1 -0
- package/dist/assets/ar.bed29460.js +1 -0
- package/dist/assets/asciiarmor.33e369f6.js +1 -0
- package/dist/assets/asn.1.4920ff11.js +1 -0
- package/dist/assets/assets.992acbac.js +11 -0
- package/dist/assets/asterisk.95138c5b.js +1 -0
- package/dist/assets/authentication.612926d3.js +54 -0
- package/dist/assets/authentication.798de1bb.js +3 -0
- package/dist/assets/autorefresh.40d402db.js +1 -0
- package/dist/assets/aws.d42ee579.js +1 -0
- package/dist/assets/az.706ff558.js +1 -0
- package/dist/assets/backing-directus.a3faa50e.js +1 -0
- package/dist/assets/bg-BG.c3018167.js +2 -0
- package/dist/assets/bg.1c68ab52.js +1 -0
- package/dist/assets/bn-IN.4b03e908.js +1 -0
- package/dist/assets/bn.52d26e23.js +1 -0
- package/dist/assets/brainfuck.9efe5ea7.js +1 -0
- package/dist/assets/bs.4d20add5.js +1 -0
- package/dist/assets/ca-ES.5b66f040.js +1 -0
- package/dist/assets/ca.a79eb6d2.js +1 -0
- package/dist/assets/cli.67b15430.js +4 -0
- package/dist/assets/clike.8f3a442e.js +1 -0
- package/dist/assets/clojure.701fec72.js +1 -0
- package/dist/assets/cmake.fc763d62.js +1 -0
- package/dist/assets/cobol.f79ff64d.js +1 -0
- package/dist/assets/codebase-overview.287cd754.js +1 -0
- package/dist/assets/coffeescript.4d14a9ba.js +1 -0
- package/dist/assets/collections.68cbd85a.js +104 -0
- package/dist/assets/collections.ad345def.js +1 -0
- package/dist/assets/collections.edbdfb97.js +1 -0
- package/dist/assets/command-line-interface.5bf4f787.js +10 -0
- package/dist/assets/common-issues.beddcbd5.js +1 -0
- package/dist/assets/commonlisp.dec5665b.js +1 -0
- package/dist/assets/config-files.b9014483.js +46 -0
- package/dist/{img/docs/getting-started/quickstart/create-item.png → assets/create-item.32e17f40.png} +0 -0
- package/dist/assets/crystal.69fb4983.js +1 -0
- package/dist/assets/cs-CZ.7354d39b.js +1 -0
- package/dist/assets/cs.b1e8bc14.js +1 -0
- package/dist/assets/css.ee327201.js +1 -0
- package/dist/assets/cy.ac181a59.js +1 -0
- package/dist/assets/cypher.8064bb82.js +4 -0
- package/dist/assets/d.d0be83e5.js +1 -0
- package/dist/assets/da-DK.8c33c393.js +1 -0
- package/dist/assets/da.4016bc22.js +1 -0
- package/dist/assets/dart.ac78cb06.js +1 -0
- package/dist/assets/databases.49e0d39a.js +1 -0
- package/dist/assets/de-DE.756b1bc2.js +1 -0
- package/dist/assets/de-at.c5829c18.js +1 -0
- package/dist/assets/de.a55d079e.js +1 -0
- package/dist/assets/diff.0925fe44.js +1 -0
- package/dist/assets/digitalocean-app-platform.7691dea9.js +3 -0
- package/dist/assets/displays.6c61c116.js +45 -0
- package/dist/assets/displays.74c120ea.js +1 -0
- package/dist/assets/django.b8bdfecd.js +1 -0
- package/dist/assets/docker.b622caab.js +74 -0
- package/dist/assets/dockerfile.8f75a0de.js +1 -0
- package/dist/assets/dtd.018d27c1.js +1 -0
- package/dist/assets/dylan.43b15d5a.js +1 -0
- package/dist/assets/ebnf.d8d3015c.js +1 -0
- package/dist/assets/ecl.536914a1.js +1 -0
- package/dist/assets/eiffel.970896ba.js +1 -0
- package/dist/assets/el-GR.a8b8ce67.js +1 -0
- package/dist/assets/el.59a913c2.js +1 -0
- package/dist/assets/elm.ff665bb5.js +1 -0
- package/dist/assets/email-templates.b91ddc18.js +2 -0
- package/dist/{img/docs/getting-started/quickstart/empty-state.png → assets/empty-state.bbc4e874.png} +0 -0
- package/dist/assets/en-au.175fcb2b.js +1 -0
- package/dist/assets/en-gb.018f9a21.js +1 -0
- package/dist/assets/en-nz.2f0f7e5c.js +1 -0
- package/dist/assets/environment-variables.ba9937d8.js +25 -0
- package/dist/assets/eo.d92d8fbf.js +1 -0
- package/dist/assets/erlang.d2d9126b.js +1 -0
- package/dist/assets/error-codes.f2a3ffd0.js +1 -0
- package/dist/assets/es-419.3f65254f.js +1 -0
- package/dist/assets/es-CL.8d10f095.js +1 -0
- package/dist/assets/es-ES.5d54161e.js +1 -0
- package/dist/assets/es-us.35915abe.js +1 -0
- package/dist/assets/es.18d3cc7b.js +1 -0
- package/dist/assets/et-EE.e9345a23.js +3 -0
- package/dist/assets/et.420b5f6d.js +1 -0
- package/dist/assets/eu.edaff4b0.js +1 -0
- package/dist/assets/extensions.6d72373f.js +12 -0
- package/dist/assets/extensions.decbf7d4.js +1 -0
- package/dist/assets/fa-IR.bda5906f.js +1 -0
- package/dist/assets/fa.f3993a60.js +1 -0
- package/dist/assets/factor.e3365daf.js +1 -0
- package/dist/assets/fcl.41414f9f.js +1 -0
- package/dist/assets/fi-FI.f2290ce0.js +1 -0
- package/dist/assets/fi.3ee32d07.js +1 -0
- package/dist/assets/field-transforms.17c0c73e.js +1 -0
- package/dist/assets/fields.31f7d395.js +1 -0
- package/dist/assets/fields.40ee19c6.js +135 -0
- package/dist/assets/fields.a53c26fb.js +1 -0
- package/dist/assets/files.60739444.js +176 -0
- package/dist/assets/files.c4e0315a.js +1 -0
- package/dist/assets/files.e25d0ccc.js +1 -0
- package/dist/assets/filter-rules.b8a614b1.js +60 -0
- package/dist/assets/folders.0dc34ccf.js +132 -0
- package/dist/assets/forth.ef05c141.js +1 -0
- package/dist/assets/fortran.1e19c5bf.js +1 -0
- package/dist/assets/fr-FR.ba8ae448.js +1 -0
- package/dist/assets/fr-ca.e2e64899.js +1 -0
- package/dist/assets/fr-ch.e9042a4c.js +1 -0
- package/dist/assets/fr.9d599b24.js +1 -0
- package/dist/assets/gas.c0f3d89f.js +1 -0
- package/dist/assets/gfm.f4921c55.js +1 -0
- package/dist/assets/gherkin.b4aead5b.js +1 -0
- package/dist/assets/github-ci.3b64bcb6.js +2 -0
- package/dist/assets/gl.b8341ed4.js +1 -0
- package/dist/assets/go.9b716e9b.js +1 -0
- package/dist/assets/groovy.19675799.js +1 -0
- package/dist/assets/haml.463e8c81.js +1 -0
- package/dist/assets/handlebars.ddd0bf09.js +1 -0
- package/dist/assets/haskell-literate.66787338.js +1 -0
- package/dist/assets/haskell.067ee761.js +1 -0
- package/dist/assets/haxe.83cd17fd.js +1 -0
- package/dist/assets/he-IL.c8bffba0.js +1 -0
- package/dist/assets/he.18403882.js +1 -0
- package/dist/assets/hi-IN.325abf59.js +1 -0
- package/dist/assets/hi.e2a17765.js +1 -0
- package/dist/assets/hr.57f77dc3.js +1 -0
- package/dist/assets/htmlembedded.b5768293.js +1 -0
- package/dist/assets/htmlmixed.1bef4484.js +1 -0
- package/dist/assets/http.3c8bcb9e.js +1 -0
- package/dist/assets/hu-HU.eae26608.js +1 -0
- package/dist/assets/hu.adb9ccdc.js +1 -0
- package/dist/assets/hy-am.59b7a75e.js +1 -0
- package/dist/assets/id-ID.37c3caa2.js +1 -0
- package/dist/assets/id.bc299c4a.js +1 -0
- package/dist/assets/idl.e06015dc.js +1 -0
- package/dist/assets/iis.9b0eac15.js +23 -0
- package/dist/assets/index.03fb325e.js +1 -0
- package/dist/assets/index.04b285e2.js +1 -0
- package/dist/assets/index.04f0125c.js +1 -0
- package/dist/assets/index.060de02c.js +1 -0
- package/dist/assets/index.10011a59.js +1 -0
- package/dist/assets/index.12090a3c.js +1 -0
- package/dist/assets/index.1b3cf886.js +1 -1
- package/dist/assets/index.1b8dbdff.js +1 -0
- package/dist/assets/index.1e007d3f.js +1 -0
- package/dist/assets/index.2436914f.js +1 -0
- package/dist/assets/index.249a9de3.js +1 -0
- package/dist/assets/index.2757bd43.js +1 -0
- package/dist/assets/index.278e82cc.js +1 -0
- package/dist/assets/index.29e2fff8.js +1 -0
- package/dist/assets/index.2d5f95b4.js +1 -0
- package/dist/assets/index.2fca3514.js +1 -0
- package/dist/assets/index.33997d9d.js +1 -0
- package/dist/assets/index.3947e253.js +1 -0
- package/dist/assets/index.39fbd9d3.js +1 -0
- package/dist/assets/index.3b5ff69d.js +1 -0
- package/dist/assets/index.3db0073b.js +1 -0
- package/dist/assets/index.3f2c48a4.js +1 -0
- package/dist/assets/index.443a2f9f.js +1 -0
- package/dist/assets/index.494fcfd8.js +1 -0
- package/dist/assets/index.4df39eaf.css +1 -0
- package/dist/assets/index.4e13f2f8.js +1 -0
- package/dist/assets/index.4f01ef8c.js +1 -0
- package/dist/assets/index.50acf303.js +1 -0
- package/dist/assets/index.524ee23d.js +1 -0
- package/dist/assets/index.55d799e2.js +1 -0
- package/dist/assets/index.55efaf5d.js +1 -0
- package/dist/assets/index.569b5d1e.js +1 -0
- package/dist/assets/index.57b7ae99.js +1 -0
- package/dist/assets/index.60656b8b.js +1 -0
- package/dist/assets/index.6458a118.js +1 -0
- package/dist/assets/index.672229c6.js +1 -0
- package/dist/assets/index.6e0d6311.js +1 -0
- package/dist/assets/index.6f3a8602.js +1 -0
- package/dist/assets/index.75010559.js +1 -0
- package/dist/assets/index.76128ca5.js +1 -0
- package/dist/assets/index.78108306.js +1 -0
- package/dist/assets/index.791a131b.js +1 -0
- package/dist/assets/index.79ea1933.js +1 -0
- package/dist/assets/index.7b2f54b1.js +1 -0
- package/dist/assets/index.7c8089a5.js +1 -0
- package/dist/assets/index.7dff0e69.js +1 -0
- package/dist/assets/index.812e4c7d.js +1 -0
- package/dist/assets/index.83fb4d54.js +1 -0
- package/dist/assets/index.920a248c.js +1 -0
- package/dist/assets/index.9423b12b.js +1 -0
- package/dist/assets/index.9b8118f5.js +1 -0
- package/dist/assets/index.9db93f3d.js +1 -0
- package/dist/assets/index.9dd2d9ba.js +1 -0
- package/dist/assets/index.a1b44762.js +1 -0
- package/dist/assets/index.a4b4bdb0.js +1 -0
- package/dist/assets/index.a4c001bd.js +1 -0
- package/dist/assets/index.a89c6f27.css +1 -0
- package/dist/assets/index.acc90a73.js +26 -0
- package/dist/assets/index.ad41b99f.js +1 -0
- package/dist/assets/index.ad66e70f.js +1 -0
- package/dist/assets/index.ae29ffdc.js +1 -0
- package/dist/assets/index.b1e483ed.js +1 -0
- package/dist/assets/index.bb9fd9a2.js +1 -0
- package/dist/assets/index.bcc4be93.js +1 -0
- package/dist/assets/index.bed2e975.js +1 -0
- package/dist/assets/index.c3c56e37.js +1 -0
- package/dist/assets/index.c5be18e7.js +1 -0
- package/dist/assets/index.c700567b.js +1 -0
- package/dist/assets/index.c7623276.js +1 -0
- package/dist/assets/index.c793afa5.js +1 -0
- package/dist/assets/index.d5de3cc5.js +1 -0
- package/dist/assets/index.d8fe6c8d.js +1 -0
- package/dist/assets/index.db751ad4.js +1 -0
- package/dist/assets/index.dba4bb3d.js +1 -0
- package/dist/assets/index.dc71b91a.js +1 -1
- package/dist/assets/index.dfbb9917.js +1 -0
- package/dist/assets/index.e0619a70.js +1 -0
- package/dist/assets/index.e30aee6e.js +1 -0
- package/dist/assets/index.e38ec950.js +1 -0
- package/dist/assets/index.e8f18e11.js +1 -0
- package/dist/assets/index.ed320054.js +1 -0
- package/dist/assets/index.eedadecd.js +1 -0
- package/dist/assets/index.f01e9ede.js +1 -0
- package/dist/assets/index.f44bbe15.js +1 -0
- package/dist/assets/index.f64a436f.js +1 -0
- package/dist/assets/index.f97b7ea1.js +1 -0
- package/dist/assets/index.f9f47c3a.js +1 -0
- package/dist/assets/index.fc3763d5.js +1 -0
- package/dist/assets/index.ffc6c203.js +1 -1
- package/dist/assets/index.ffe35d0c.js +1 -0
- package/dist/assets/input-rich-text-html.67ebfae2.css +1 -0
- package/dist/assets/input-rich-text-html.84c66148.js +215 -0
- package/dist/assets/installation.e1dbc149.js +1 -0
- package/dist/assets/interfaces.01255de9.js +1 -0
- package/dist/assets/interfaces.b0c00c84.js +41 -0
- package/dist/assets/introduction.01b2e4dc.js +1 -0
- package/dist/assets/introduction.31e032e1.js +90 -0
- package/dist/assets/introduction.d8a933c4.js +4 -0
- package/dist/assets/is-IS.35706417.js +1 -1
- package/dist/assets/is.2eb43668.js +1 -0
- package/dist/assets/it-IT.b8f2b2eb.js +1 -0
- package/dist/assets/it.e663f69e.js +1 -0
- package/dist/assets/items.7a6f6549.js +1 -0
- package/dist/assets/items.936d5154.js +136 -0
- package/dist/assets/items.cc703ba0.js +1 -0
- package/dist/assets/ja-JP.1ed964ed.js +1 -0
- package/dist/assets/ja.21755c02.js +1 -0
- package/dist/assets/javascript-hint.cbc0738b.js +1 -0
- package/dist/assets/javascript.dc3d2420.js +1 -0
- package/dist/assets/jinja2.eea54433.js +1 -0
- package/dist/assets/jsonlint.09bf5bab.js +8 -0
- package/dist/assets/jsx.f1d31ad5.js +1 -0
- package/dist/assets/julia.d8f065ce.js +1 -0
- package/dist/assets/ka-GE.eff8ef9c.js +1 -0
- package/dist/assets/ka.09267484.js +1 -0
- package/dist/assets/kk.c27d7d0f.js +1 -0
- package/dist/assets/ko-KR.735832c7.js +1 -0
- package/dist/assets/ko.86462d08.js +1 -0
- package/dist/assets/layouts.7364017e.js +1 -0
- package/dist/assets/layouts.814d4797.js +55 -0
- package/dist/assets/lb.b4fb4102.js +1 -0
- package/dist/assets/livescript.46cf31b6.js +1 -0
- package/dist/assets/lt-LT.34699fea.js +1 -0
- package/dist/assets/lt.bec1e735.js +1 -0
- package/dist/assets/lua.325c2c6b.js +1 -0
- package/dist/assets/lv.1d9eac62.js +1 -0
- package/dist/{img/docs/guides/fields/m2a.png → assets/m2a.347ed339.png} +0 -0
- package/dist/{img/docs/guides/fields/m2m.png → assets/m2m.07bed843.png} +0 -0
- package/dist/{img/docs/guides/fields/m2o.png → assets/m2o.ac02ed03.png} +0 -0
- package/dist/assets/manual.7c3dba38.js +10 -0
- package/dist/assets/mark-selection.ed2c5876.js +1 -0
- package/dist/assets/match-highlighter.4b3626e4.js +1 -0
- package/dist/assets/mathematica.381297e3.js +1 -0
- package/dist/assets/mbox.79941f73.js +1 -0
- package/dist/assets/migrating-from-v8.dfc87139.js +1 -0
- package/dist/assets/migrations.90df93d0.js +15 -0
- package/dist/assets/mirc.3e97a3f6.js +1 -0
- package/dist/assets/mk.ac873732.js +1 -0
- package/dist/assets/mllike.71f195ab.js +1 -0
- package/dist/assets/mn-MN.0d0b4f58.js +1 -0
- package/dist/assets/modelica.1a621a12.js +1 -0
- package/dist/assets/modules.212f45fe.js +70 -0
- package/dist/assets/modules.4e43b77b.js +1 -0
- package/dist/assets/ms-MY.1b534f35.js +1 -0
- package/dist/assets/ms.a8caaf33.js +1 -0
- package/dist/assets/mscgen.e2238dca.js +1 -0
- package/dist/assets/multiplex.cf66acd1.js +3 -0
- package/dist/assets/mumps.b16c9680.js +1 -0
- package/dist/assets/nb.02bf1f1e.js +1 -0
- package/dist/assets/ne.8c2e7d13.js +1 -0
- package/dist/assets/nginx.18df341e.js +1 -0
- package/dist/assets/nl-NL.13431c5e.js +1 -0
- package/dist/assets/nl.15edef36.js +1 -0
- package/dist/assets/nn.33ea37c6.js +1 -0
- package/dist/assets/no-NO.b5ff3a94.js +1 -0
- package/dist/assets/nsis.a503f777.js +1 -0
- package/dist/assets/ntriples.56b4b182.js +1 -0
- package/dist/{img/docs/guides/fields/o2m.png → assets/o2m.339378e0.png} +0 -0
- package/dist/assets/octave.33df13f1.js +1 -0
- package/dist/{img/docs/original.jpg → assets/original.888775a8.jpg} +0 -0
- package/dist/assets/overlay.764847fa.js +1 -0
- package/dist/assets/oz.2d48749b.js +1 -0
- package/dist/assets/pascal.81f4581a.js +1 -0
- package/dist/assets/pegjs.efafdcc5.js +1 -0
- package/dist/assets/perl.8596c1bc.js +1 -0
- package/dist/assets/permissions.2ec0b72d.js +1 -0
- package/dist/assets/permissions.36038527.js +178 -0
- package/dist/assets/permissions.a1338df3.js +1 -0
- package/dist/{img/docs/getting-started/quickstart/permissions.png → assets/permissions.b47530e9.png} +0 -0
- package/dist/assets/php.1777c3a9.js +1 -0
- package/dist/assets/pig.8885d280.js +1 -0
- package/dist/assets/pl-PL.98a8d86b.js +1 -0
- package/dist/assets/pl.8a0826b3.js +1 -0
- package/dist/{img/docs/guides/installation/plesk-screenshot.png → assets/plesk-screenshot.9485a115.png} +0 -0
- package/dist/assets/plesk.a4f42612.js +21 -0
- package/dist/assets/powershell.be98509b.js +1 -0
- package/dist/assets/presets.63f21184.js +164 -0
- package/dist/assets/presets.f0dc4325.js +1 -0
- package/dist/assets/projects.dc4dc18e.js +1 -0
- package/dist/assets/projects.dcb06963.js +1 -0
- package/dist/assets/properties.2ebd0d03.js +1 -0
- package/dist/assets/protobuf.5d9c93b0.js +1 -0
- package/dist/assets/pt-BR.554f904a.js +1 -0
- package/dist/assets/pt-PT.3d44bffb.js +1 -0
- package/dist/assets/pt-br.e87cb008.js +1 -0
- package/dist/assets/pt.de450764.js +1 -0
- package/dist/assets/pug.e91d98f9.js +1 -0
- package/dist/assets/puppet.9f2ebdab.js +1 -0
- package/dist/assets/python.c1e483dd.js +1 -0
- package/dist/assets/q.39abe4fe.js +1 -0
- package/dist/assets/query.75a6371e.js +152 -0
- package/dist/assets/quickstart.c9b096de.js +11 -0
- package/dist/assets/r.65f74664.js +1 -0
- package/dist/assets/relations.0a568361.js +115 -0
- package/dist/assets/relationships.7853bd62.js +33 -0
- package/dist/assets/revisions.4cd101b7.js +1 -0
- package/dist/assets/revisions.fd9d7b28.js +40 -0
- package/dist/assets/ro-RO.ccadca2e.js +1 -0
- package/dist/assets/ro.1786958f.js +1 -0
- package/dist/assets/roles.516dcfd0.js +172 -0
- package/dist/assets/roles.67f9d19e.js +1 -0
- package/dist/assets/roles.7a89c5c2.js +23 -0
- package/dist/assets/rpm.f26b7980.js +1 -0
- package/dist/assets/rst.2b3860fa.js +1 -0
- package/dist/assets/ru-RU.157daab3.js +1 -0
- package/dist/assets/ru.2c0e4894.js +1 -0
- package/dist/assets/ruby.0135685f.js +1 -0
- package/dist/assets/running-locally.33c3318f.js +15 -0
- package/dist/assets/rust.921ee943.js +1 -0
- package/dist/assets/sas.f11da7ce.js +1 -0
- package/dist/assets/sass.0bcfd950.js +1 -0
- package/dist/assets/scheme.cbe1ab83.js +1 -0
- package/dist/assets/sdk.2518b1d6.js +297 -0
- package/dist/assets/server.e09600ce.js +114 -0
- package/dist/assets/settings.c8d65745.js +46 -0
- package/dist/assets/shell.8924a82c.js +1 -0
- package/dist/assets/show-hint.b218859c.js +1 -0
- package/dist/assets/si-LK.2e97c6ef.js +1 -0
- package/dist/assets/sieve.3778e157.js +1 -0
- package/dist/assets/simple.d22780dd.js +1 -0
- package/dist/assets/sk-SK.8e0ff1f5.js +1 -0
- package/dist/assets/sk.e174a41b.js +1 -0
- package/dist/assets/sl-SI.95e6b4ba.js +2 -0
- package/dist/assets/sl.34422efd.js +1 -0
- package/dist/assets/slim.5e004693.js +1 -0
- package/dist/assets/smalltalk.bf3265fb.js +1 -0
- package/dist/assets/smarty.8c8716a2.js +1 -0
- package/dist/assets/solr.9e6540f7.js +1 -0
- package/dist/assets/soy.56ab0937.js +1 -0
- package/dist/assets/sparql.43d432a5.js +1 -0
- package/dist/assets/spreadsheet.07392f13.js +1 -0
- package/dist/assets/sq.ee367a13.js +1 -0
- package/dist/assets/sql.c4cdd9b2.js +1 -0
- package/dist/assets/sr-CS.19f90fcc.js +1 -0
- package/dist/assets/sr-SP.14a7c9db.js +1 -0
- package/dist/assets/sr-cyrl.0abb2793.js +1 -0
- package/dist/assets/sr.efb7e3ec.js +1 -0
- package/dist/assets/stex.f0d31b7f.js +1 -0
- package/dist/assets/styles.03de0324.js +5 -0
- package/dist/assets/stylus.ba460a7c.js +1 -0
- package/dist/assets/support.53c113a5.js +1 -0
- package/dist/assets/sv-SE.443f17ed.js +1 -0
- package/dist/assets/sv.f13855af.js +1 -0
- package/dist/assets/swift.8cd7817c.js +1 -0
- package/dist/assets/ta-in.8c88aa82.js +1 -0
- package/dist/assets/tcl.f29b73cd.js +1 -0
- package/dist/{img/docs/getting-started/quickstart/terminal-install.png → assets/terminal-install.44adb787.png} +0 -0
- package/dist/{img/docs/getting-started/quickstart/terminal-start.png → assets/terminal-start.72064e09.png} +0 -0
- package/dist/assets/textile.66c32542.js +1 -0
- package/dist/assets/th-TH.0f7b8b93.js +2 -0
- package/dist/assets/th.d0e24ade.js +1 -0
- package/dist/assets/tiddlywiki.bb5d4cb4.js +1 -0
- package/dist/assets/tiki.3ab89288.js +1 -0
- package/dist/assets/toml.49782420.js +1 -0
- package/dist/assets/tornado.14a7581f.js +1 -0
- package/dist/assets/tr-TR.699f4478.js +1 -0
- package/dist/assets/tr.d887c301.js +1 -0
- package/dist/assets/transition-bounce.6127d3f4.js +26 -0
- package/dist/assets/transition-dialog.8c2b78e6.js +26 -0
- package/dist/assets/transition-expand.3cc2644f.js +26 -0
- package/dist/{img/docs/guides/fields/translations-2.png → assets/translations-2.29d07342.png} +0 -0
- package/dist/assets/translations.09f66f68.js +1 -0
- package/dist/{img/docs/guides/fields/translations.png → assets/translations.2f0017a9.png} +0 -0
- package/dist/assets/translations.bf0cc0e4.js +1 -0
- package/dist/assets/troff.b32a7667.js +1 -0
- package/dist/assets/ttcn-cfg.fd231dc8.js +1 -0
- package/dist/assets/ttcn.f8032e92.js +1 -0
- package/dist/assets/turtle.19b373fb.js +1 -0
- package/dist/assets/twig.f0fb3339.js +1 -0
- package/dist/assets/types.7f4b7fdf.js +1 -0
- package/dist/assets/ubuntu.5f65acb1.js +11 -0
- package/dist/assets/ug.2ae6849b.js +1 -0
- package/dist/assets/uk-UA.98203a38.js +1 -0
- package/dist/assets/uk.69d22b7d.js +1 -0
- package/dist/assets/use-sync.caf49894.js +1 -0
- package/dist/assets/users.3a0ace4e.js +237 -0
- package/dist/assets/users.4e727d89.js +1 -0
- package/dist/assets/users.5ec636fa.js +1 -0
- package/dist/assets/utilities.2cc2aaed.js +60 -0
- package/dist/assets/uz.a2abf7be.js +1 -0
- package/dist/assets/v-avatar.367102a1.js +10 -0
- package/dist/assets/v-badge.db55f316.js +5 -0
- package/dist/assets/v-breadcrumb.14cc3d02.js +2 -0
- package/dist/assets/v-button.db5add93.js +15 -0
- package/dist/assets/v-card-actions.53ff7c23.js +8 -0
- package/dist/assets/v-card-subtitle.d548ebd7.js +4 -0
- package/dist/assets/v-card-text.ccfd80ea.js +4 -0
- package/dist/assets/v-card-title.dfa34dfb.js +4 -0
- package/dist/assets/v-card.a9bdcfe7.js +23 -0
- package/dist/assets/v-checkbox.6c39e9ba.js +52 -0
- package/dist/assets/v-chip.7de0f28d.js +14 -0
- package/dist/assets/v-detail.70754781.js +4 -0
- package/dist/assets/v-dialog.5e4d5eec.js +8 -0
- package/dist/assets/v-divider.a12d7826.js +2 -0
- package/dist/assets/v-drawer.f1d66a7a.js +4 -0
- package/dist/assets/v-error.135a88cd.js +2 -0
- package/dist/assets/v-fancy-select.02f7aaca.js +24 -0
- package/dist/assets/v-field-select.2a7923c2.js +2 -0
- package/dist/assets/v-field-template.20f91158.js +2 -0
- package/dist/assets/v-form.5f224455.js +8 -0
- package/dist/assets/v-hover.a0cfae04.js +15 -0
- package/dist/assets/v-icon.01a972a1.js +11 -0
- package/dist/assets/v-info.66acb1ca.js +2 -0
- package/dist/assets/v-input.8b320383.js +2 -0
- package/dist/assets/v-item-group.a2284b25.js +90 -0
- package/dist/assets/v-item.c7047233.js +1 -0
- package/dist/assets/v-list-group.9df1640c.js +16 -0
- package/dist/assets/v-list-item-content.608d1c1c.js +1 -0
- package/dist/assets/v-list-item-hint.448682e1.js +1 -0
- package/dist/assets/v-list-item-icon.c929d6ca.js +5 -0
- package/dist/assets/v-list-item.38f559ef.js +1 -0
- package/dist/assets/v-list.ddd9dee8.js +16 -0
- package/dist/assets/v-menu.5d2a5197.js +1 -0
- package/dist/assets/v-notice.7a32b40f.js +2 -0
- package/dist/assets/v-overlay.49baba86.js +12 -0
- package/dist/assets/v-pagination.3dd2966e.js +2 -0
- package/dist/assets/v-progress-circular.1e3f3740.js +2 -0
- package/dist/assets/v-progress-linear.d9ce1c64.js +2 -0
- package/dist/assets/v-radio.bf2fae40.js +4 -0
- package/dist/assets/v-select.fe6c8380.js +14 -0
- package/dist/assets/v-sheet.199e42f9.js +8 -0
- package/dist/assets/v-skeleton-loader.610c2482.js +2 -0
- package/dist/assets/v-slider.7cb06720.js +18 -0
- package/dist/assets/v-switch.819585ea.js +26 -0
- package/dist/assets/v-tab-item.57727295.js +14 -0
- package/dist/assets/v-tab.c50c6063.js +5 -0
- package/dist/assets/v-table.3fb0b23d.js +66 -0
- package/dist/assets/v-tabs-items.40c7d99d.js +6 -0
- package/dist/assets/v-tabs.15012aa4.js +23 -0
- package/dist/assets/v-text-overflow.db9e6012.js +2 -0
- package/dist/assets/v-textarea.0dfcc7e5.js +2 -0
- package/dist/assets/v-upload.c63ac03a.js +2 -0
- package/dist/assets/vb.3424d677.js +1 -0
- package/dist/assets/vbscript.cdc364d7.js +1 -0
- package/dist/assets/velocity.f4008d37.js +1 -0
- package/dist/assets/vendor.9bb37c18.js +1582 -0
- package/dist/assets/verilog.66ea2af9.js +1 -0
- package/dist/assets/vhdl.99d82188.js +1 -0
- package/dist/assets/vi-VN.2f9e0c38.js +1 -0
- package/dist/assets/vi.cc30f87c.js +1 -0
- package/dist/assets/vue.b3c93dc6.js +1 -0
- package/dist/assets/wast.d1038cc4.js +1 -0
- package/dist/assets/webhooks.79b21582.js +1 -0
- package/dist/assets/webhooks.f4264b3c.js +147 -0
- package/dist/assets/webidl.8555e8e0.js +1 -0
- package/dist/assets/xquery.6c59672a.js +1 -0
- package/dist/assets/yacas.e6cf4b64.js +1 -0
- package/dist/assets/yaml-frontmatter.33b7b49a.js +1 -0
- package/dist/assets/yaml.5ae7aaeb.js +1 -0
- package/dist/assets/z80.2567912a.js +1 -0
- package/dist/assets/zh-CN.abb69524.js +1 -0
- package/dist/assets/zh-TW.0cd774e7.js +1 -0
- package/dist/assets/zh-cn.f12689f7.js +1 -0
- package/dist/assets/zh-tw.c5aeda5a.js +1 -0
- package/dist/index.6c765799.js +48 -0
- package/dist/index.html +6 -6
- package/dist/robots.txt +2 -0
- package/dist/vue-i18n.a899ce94.js +1 -0
- package/dist/vue-router.72391023.js +1 -0
- package/dist/vue.0523dd0d.js +1 -0
- package/package.json +30 -36
- package/dist/@directus_extensions-sdk.82644dda.js +0 -1
- package/dist/assets/active-line.1e725d08.js +0 -1
- package/dist/assets/af-ZA.5d47603b.js +0 -1
- package/dist/assets/af.d1f025e4.js +0 -1
- package/dist/assets/apl.138d03a1.js +0 -1
- package/dist/assets/ar-SA.ccb9a2f4.js +0 -1
- package/dist/assets/ar-dz.51626b08.js +0 -1
- package/dist/assets/ar-kw.17661f3b.js +0 -1
- package/dist/assets/ar-ly.680c2e68.js +0 -1
- package/dist/assets/ar-ma.492fc7af.js +0 -1
- package/dist/assets/ar-sa.8f7939ac.js +0 -1
- package/dist/assets/ar-tn.790c4d93.js +0 -1
- package/dist/assets/ar.dccc5590.js +0 -1
- package/dist/assets/asciiarmor.885158a0.js +0 -1
- package/dist/assets/asn.1.7c84ea0f.js +0 -1
- package/dist/assets/asterisk.eaba3630.js +0 -1
- package/dist/assets/autorefresh.8a423312.js +0 -1
- package/dist/assets/az.d5aa7e5e.js +0 -1
- package/dist/assets/bg-BG.75b943ca.js +0 -1
- package/dist/assets/bg.39ff05d3.js +0 -1
- package/dist/assets/bn-IN.c2f4d0db.js +0 -1
- package/dist/assets/bn.302ece7d.js +0 -1
- package/dist/assets/brainfuck.f652a8d9.js +0 -1
- package/dist/assets/bs.6f53d40f.js +0 -1
- package/dist/assets/ca-ES.16ce949e.js +0 -1
- package/dist/assets/ca.d109470e.js +0 -1
- package/dist/assets/clike.8e6e89ef.js +0 -1
- package/dist/assets/clojure.bac86c7f.js +0 -1
- package/dist/assets/cmake.b3d51c80.js +0 -1
- package/dist/assets/cobol.9ee0acc3.js +0 -1
- package/dist/assets/coffeescript.db12c8c0.js +0 -1
- package/dist/assets/commonlisp.2ea471d7.js +0 -1
- package/dist/assets/crystal.68277699.js +0 -1
- package/dist/assets/cs-CZ.ffffd5d7.js +0 -1
- package/dist/assets/cs.28f09710.js +0 -1
- package/dist/assets/css.1402bed3.js +0 -1
- package/dist/assets/cy.92581592.js +0 -1
- package/dist/assets/cypher.742574fc.js +0 -1
- package/dist/assets/d.d24c6e02.js +0 -1
- package/dist/assets/da-DK.365385b9.js +0 -1
- package/dist/assets/da.cffb74a7.js +0 -1
- package/dist/assets/dart.3b5c70a0.js +0 -1
- package/dist/assets/de-DE.d3a79b75.js +0 -1
- package/dist/assets/de-at.938fb471.js +0 -1
- package/dist/assets/de.2df4a32c.js +0 -1
- package/dist/assets/diff.4f602546.js +0 -1
- package/dist/assets/django.0b657de3.js +0 -1
- package/dist/assets/dockerfile.aa74a0f5.js +0 -1
- package/dist/assets/dtd.8a536b23.js +0 -1
- package/dist/assets/dylan.0b5ce9f5.js +0 -1
- package/dist/assets/ebnf.3ebdc7e5.js +0 -1
- package/dist/assets/ecl.8abe3fd5.js +0 -1
- package/dist/assets/eiffel.a85811cc.js +0 -1
- package/dist/assets/el-GR.f822e9ef.js +0 -1
- package/dist/assets/el.62a64d86.js +0 -1
- package/dist/assets/elm.eed0dd0d.js +0 -1
- package/dist/assets/en-au.ff2c7348.js +0 -1
- package/dist/assets/en-gb.8ee01156.js +0 -1
- package/dist/assets/en-nz.2d0a89a1.js +0 -1
- package/dist/assets/eo.ba784812.js +0 -1
- package/dist/assets/erlang.ad810380.js +0 -1
- package/dist/assets/es-419.d5f2918e.js +0 -1
- package/dist/assets/es-CL.24f67961.js +0 -1
- package/dist/assets/es-ES.f841ac04.js +0 -1
- package/dist/assets/es-us.fa99d599.js +0 -1
- package/dist/assets/es.849e0672.js +0 -1
- package/dist/assets/et-EE.297d625d.js +0 -1
- package/dist/assets/et.f358f3b0.js +0 -1
- package/dist/assets/eu.ede53b69.js +0 -1
- package/dist/assets/fa-IR.152863ad.js +0 -1
- package/dist/assets/fa.d30662e9.js +0 -1
- package/dist/assets/factor.32993485.js +0 -1
- package/dist/assets/fcl.5803df85.js +0 -1
- package/dist/assets/fi-FI.001d845b.js +0 -1
- package/dist/assets/fi.ad13ab5f.js +0 -1
- package/dist/assets/forth.65241f9f.js +0 -1
- package/dist/assets/fortran.5f4fdac6.js +0 -1
- package/dist/assets/fr-FR.d717ba4a.js +0 -1
- package/dist/assets/fr-ca.58676289.js +0 -1
- package/dist/assets/fr-ch.ad94ac42.js +0 -1
- package/dist/assets/fr.f75029e5.js +0 -1
- package/dist/assets/gas.a73dbaf0.js +0 -1
- package/dist/assets/gfm.5b28c1d9.js +0 -1
- package/dist/assets/gherkin.b5257b5b.js +0 -1
- package/dist/assets/gl.d71b5372.js +0 -1
- package/dist/assets/go.0730ef96.js +0 -1
- package/dist/assets/groovy.3d085c16.js +0 -1
- package/dist/assets/haml.04f50447.js +0 -1
- package/dist/assets/handlebars.1b32ef5d.js +0 -1
- package/dist/assets/haskell-literate.3b0af867.js +0 -1
- package/dist/assets/haskell.1727e9d1.js +0 -1
- package/dist/assets/haxe.b9a30852.js +0 -1
- package/dist/assets/he-IL.ca5fe809.js +0 -1
- package/dist/assets/he.b4d4ce9e.js +0 -1
- package/dist/assets/hi-IN.a03e3a17.js +0 -1
- package/dist/assets/hi.d515a5fb.js +0 -1
- package/dist/assets/hr.8f3a8f28.js +0 -1
- package/dist/assets/htmlembedded.19186900.js +0 -1
- package/dist/assets/htmlmixed.4f4aec15.js +0 -1
- package/dist/assets/http.9fce8327.js +0 -1
- package/dist/assets/hu-HU.44580860.js +0 -1
- package/dist/assets/hu.58a03c77.js +0 -1
- package/dist/assets/hy-am.a9251255.js +0 -1
- package/dist/assets/id-ID.3a72dba2.js +0 -1
- package/dist/assets/id.874a2211.js +0 -1
- package/dist/assets/idl.037025ce.js +0 -1
- package/dist/assets/index.0632abd5.js +0 -1
- package/dist/assets/index.09464a38.js +0 -1
- package/dist/assets/index.0f5003d9.js +0 -1
- package/dist/assets/index.1775ef7f.js +0 -1
- package/dist/assets/index.261119a5.js +0 -1
- package/dist/assets/index.263f9916.js +0 -1
- package/dist/assets/index.27e08f27.js +0 -1
- package/dist/assets/index.2bfe3e64.js +0 -1
- package/dist/assets/index.2c051ee7.js +0 -1
- package/dist/assets/index.2dc0f6ae.js +0 -1
- package/dist/assets/index.2e4ae1b3.js +0 -1
- package/dist/assets/index.30fd5350.js +0 -1
- package/dist/assets/index.314252b0.js +0 -1
- package/dist/assets/index.32a0aa8d.js +0 -1
- package/dist/assets/index.32fd7794.js +0 -1
- package/dist/assets/index.34473c1c.js +0 -1
- package/dist/assets/index.3562c3e6.js +0 -1
- package/dist/assets/index.367a4b9c.js +0 -1
- package/dist/assets/index.3719dec0.js +0 -1
- package/dist/assets/index.3ab81bf4.js +0 -1
- package/dist/assets/index.3af134f2.js +0 -1
- package/dist/assets/index.3b37c6db.js +0 -1
- package/dist/assets/index.431f5201.js +0 -1
- package/dist/assets/index.4be9c18f.css +0 -1
- package/dist/assets/index.53dd7132.js +0 -1
- package/dist/assets/index.58e0cb38.js +0 -1
- package/dist/assets/index.5ab3e533.js +0 -1
- package/dist/assets/index.65821855.js +0 -1
- package/dist/assets/index.6d6cd831.css +0 -1
- package/dist/assets/index.76b6d03f.js +0 -1
- package/dist/assets/index.7808cc30.js +0 -1
- package/dist/assets/index.7a1e6d44.js +0 -1
- package/dist/assets/index.808c913d.js +0 -1
- package/dist/assets/index.84637ffc.js +0 -1
- package/dist/assets/index.86885381.js +0 -1
- package/dist/assets/index.86eeba88.js +0 -1
- package/dist/assets/index.8869e3d5.js +0 -1
- package/dist/assets/index.8d7e6bd3.js +0 -1
- package/dist/assets/index.8f33bfe1.js +0 -1
- package/dist/assets/index.9007d259.js +0 -1
- package/dist/assets/index.94fedef1.js +0 -1
- package/dist/assets/index.95e73f79.js +0 -1
- package/dist/assets/index.96d52a67.js +0 -1
- package/dist/assets/index.974aecdb.js +0 -1
- package/dist/assets/index.990d958a.js +0 -1
- package/dist/assets/index.9ac3811e.js +0 -1
- package/dist/assets/index.9e044d51.js +0 -1
- package/dist/assets/index.9e1d8c27.js +0 -1
- package/dist/assets/index.9e825fd9.js +0 -1
- package/dist/assets/index.9f0dbfed.js +0 -1
- package/dist/assets/index.9f36ac5d.js +0 -1
- package/dist/assets/index.a1761bcf.js +0 -1
- package/dist/assets/index.a3c50a40.js +0 -1
- package/dist/assets/index.a889836b.js +0 -1
- package/dist/assets/index.ac21eeff.js +0 -1
- package/dist/assets/index.bac64c89.js +0 -1
- package/dist/assets/index.be83dfe1.js +0 -1
- package/dist/assets/index.be8ccd79.js +0 -1
- package/dist/assets/index.bfaf0e4b.js +0 -1
- package/dist/assets/index.c207d2ef.js +0 -1
- package/dist/assets/index.c492ffdd.js +0 -1
- package/dist/assets/index.c82905dc.js +0 -1
- package/dist/assets/index.cabcee3d.js +0 -1
- package/dist/assets/index.cc7c7000.js +0 -1
- package/dist/assets/index.cf319bfc.js +0 -1
- package/dist/assets/index.d12668fd.js +0 -1
- package/dist/assets/index.d34a51a7.js +0 -1
- package/dist/assets/index.d3edd4c9.js +0 -1
- package/dist/assets/index.d47e92f0.js +0 -1
- package/dist/assets/index.db0cdb68.js +0 -1
- package/dist/assets/index.de8eefc0.js +0 -1
- package/dist/assets/index.e05293e2.js +0 -1
- package/dist/assets/index.e11ef43f.js +0 -1
- package/dist/assets/index.e21c1d3a.js +0 -1
- package/dist/assets/index.e425e198.js +0 -1
- package/dist/assets/index.e43feb97.js +0 -1
- package/dist/assets/index.e48f63df.js +0 -1
- package/dist/assets/index.e4e61477.js +0 -1
- package/dist/assets/index.e806567c.js +0 -1
- package/dist/assets/index.e928056c.js +0 -1
- package/dist/assets/index.e9da7a62.js +0 -1
- package/dist/assets/index.ec8511c6.js +0 -1
- package/dist/assets/index.ef152166.js +0 -1
- package/dist/assets/index.f1dd56bb.js +0 -1
- package/dist/assets/index.f3fb8a50.js +0 -1
- package/dist/assets/index.f57170c4.js +0 -1
- package/dist/assets/input-rich-text-html.83d73b39.js +0 -1
- package/dist/assets/input-rich-text-html.e8d4bd2f.css +0 -1
- package/dist/assets/is.6f2fb7dc.js +0 -1
- package/dist/assets/it-IT.ffc3abbb.js +0 -1
- package/dist/assets/it.1f877773.js +0 -1
- package/dist/assets/ja-JP.162e38fc.js +0 -1
- package/dist/assets/ja.daee375c.js +0 -1
- package/dist/assets/javascript-hint.7e746a99.js +0 -1
- package/dist/assets/javascript.9549ad2c.js +0 -1
- package/dist/assets/jinja2.40927be5.js +0 -1
- package/dist/assets/jsonlint.47937558.js +0 -1
- package/dist/assets/jsx.9e37d21f.js +0 -1
- package/dist/assets/julia.acb79de0.js +0 -1
- package/dist/assets/ka-GE.b10f2438.js +0 -1
- package/dist/assets/ka.25489f01.js +0 -1
- package/dist/assets/kk.0d581723.js +0 -1
- package/dist/assets/ko-KR.b51fe8f7.js +0 -1
- package/dist/assets/ko.37ba2137.js +0 -1
- package/dist/assets/lb.54077437.js +0 -1
- package/dist/assets/livescript.f1c70693.js +0 -1
- package/dist/assets/lt-LT.f2d1529a.js +0 -1
- package/dist/assets/lt.5b3565fb.js +0 -1
- package/dist/assets/lua.953cb9b0.js +0 -1
- package/dist/assets/lv.7cedd6c7.js +0 -1
- package/dist/assets/mark-selection.7682e825.js +0 -1
- package/dist/assets/markdown.1a05cb93.css +0 -1
- package/dist/assets/markdown.551b8f0a.js +0 -1
- package/dist/assets/match-highlighter.919b3eec.js +0 -1
- package/dist/assets/mathematica.833bd412.js +0 -1
- package/dist/assets/mbox.a89134a6.js +0 -1
- package/dist/assets/mirc.849e63cf.js +0 -1
- package/dist/assets/mk.825f1d14.js +0 -1
- package/dist/assets/mllike.c535ef29.js +0 -1
- package/dist/assets/mn-MN.f0acb154.js +0 -1
- package/dist/assets/modelica.a77ca282.js +0 -1
- package/dist/assets/ms-MY.7c07f6cb.js +0 -1
- package/dist/assets/ms.d1e95708.js +0 -1
- package/dist/assets/mscgen.a6c93e8d.js +0 -1
- package/dist/assets/multiplex.e23badf8.js +0 -1
- package/dist/assets/mumps.a6914a7d.js +0 -1
- package/dist/assets/nb.6e3050d1.js +0 -1
- package/dist/assets/ne.dd77750a.js +0 -1
- package/dist/assets/nginx.3d8a5ba1.js +0 -1
- package/dist/assets/nl-NL.c0aec141.js +0 -1
- package/dist/assets/nl.122f2678.js +0 -1
- package/dist/assets/nn.d227a471.js +0 -1
- package/dist/assets/no-NO.0d2d39e4.js +0 -1
- package/dist/assets/nsis.db6492bd.js +0 -1
- package/dist/assets/ntriples.63369777.js +0 -1
- package/dist/assets/octave.97db7351.js +0 -1
- package/dist/assets/overlay.b1b2cf36.js +0 -1
- package/dist/assets/oz.1cb71e43.js +0 -1
- package/dist/assets/pascal.da3f7188.js +0 -1
- package/dist/assets/pegjs.5e201afc.js +0 -1
- package/dist/assets/perl.a58ef657.js +0 -1
- package/dist/assets/php.97377efe.js +0 -1
- package/dist/assets/pig.75ccff7f.js +0 -1
- package/dist/assets/pl-PL.94a335f5.js +0 -1
- package/dist/assets/pl.83ceb435.js +0 -1
- package/dist/assets/powershell.716f7a50.js +0 -1
- package/dist/assets/properties.c54ca5a3.js +0 -1
- package/dist/assets/protobuf.e290c77a.js +0 -1
- package/dist/assets/pt-BR.199302f5.js +0 -1
- package/dist/assets/pt-PT.d25d8774.js +0 -1
- package/dist/assets/pt-br.970a9f10.js +0 -1
- package/dist/assets/pt.cdeaa807.js +0 -1
- package/dist/assets/pug.647301d3.js +0 -1
- package/dist/assets/puppet.5d8bc8f9.js +0 -1
- package/dist/assets/python.baa5c5fc.js +0 -1
- package/dist/assets/q.0e70b9f7.js +0 -1
- package/dist/assets/r.508465be.js +0 -1
- package/dist/assets/ro-RO.b1b84879.js +0 -1
- package/dist/assets/ro.3546faad.js +0 -1
- package/dist/assets/rpm.dc1f1398.js +0 -1
- package/dist/assets/rst.37d8b953.js +0 -1
- package/dist/assets/ru-RU.41909648.js +0 -1
- package/dist/assets/ru.0a169a44.js +0 -1
- package/dist/assets/ruby.0b21b115.js +0 -1
- package/dist/assets/rust.b68b0491.js +0 -1
- package/dist/assets/sas.6bd125e8.js +0 -1
- package/dist/assets/sass.d8a66b78.js +0 -1
- package/dist/assets/scheme.fbd9cd49.js +0 -1
- package/dist/assets/shell.536840ad.js +0 -1
- package/dist/assets/show-hint.76dff27d.js +0 -1
- package/dist/assets/si-LK.818c6cc5.js +0 -1
- package/dist/assets/sieve.d6810dbf.js +0 -1
- package/dist/assets/simple.f6084fce.js +0 -1
- package/dist/assets/sk-SK.e330b880.js +0 -1
- package/dist/assets/sk.3293bdaf.js +0 -1
- package/dist/assets/sl-SI.bc331afe.js +0 -1
- package/dist/assets/sl.c2e613d5.js +0 -1
- package/dist/assets/slim.27cb11ca.js +0 -1
- package/dist/assets/smalltalk.ce2d7477.js +0 -1
- package/dist/assets/smarty.c9b0170f.js +0 -1
- package/dist/assets/solr.6772f3e1.js +0 -1
- package/dist/assets/soy.38f68247.js +0 -1
- package/dist/assets/sparql.4eb349ec.js +0 -1
- package/dist/assets/spreadsheet.91d9c19a.js +0 -1
- package/dist/assets/sq.b81a8e91.js +0 -1
- package/dist/assets/sql.c2bfcf00.js +0 -1
- package/dist/assets/sr-CS.c04a5f03.js +0 -1
- package/dist/assets/sr-SP.c462cf5b.js +0 -1
- package/dist/assets/sr-cyrl.de91b907.js +0 -1
- package/dist/assets/sr.09267bda.js +0 -1
- package/dist/assets/stex.c47fa51d.js +0 -1
- package/dist/assets/stylus.7d1172af.js +0 -1
- package/dist/assets/sv-SE.6a861adc.js +0 -1
- package/dist/assets/sv.343a5b1c.js +0 -1
- package/dist/assets/swift.ae6f8777.js +0 -1
- package/dist/assets/ta-in.b7dc8a97.js +0 -1
- package/dist/assets/tcl.3f7fb1db.js +0 -1
- package/dist/assets/textile.d3e9869f.js +0 -1
- package/dist/assets/th-TH.50daaf7b.js +0 -1
- package/dist/assets/th.981ce805.js +0 -1
- package/dist/assets/tiddlywiki.a51cc083.js +0 -1
- package/dist/assets/tiki.003bb5b4.js +0 -1
- package/dist/assets/toml.170f1d4c.js +0 -1
- package/dist/assets/tornado.d8602b56.js +0 -1
- package/dist/assets/tr-TR.ca2cee29.js +0 -1
- package/dist/assets/tr.17b11796.js +0 -1
- package/dist/assets/troff.f3e7d243.js +0 -1
- package/dist/assets/ttcn-cfg.9be8b155.js +0 -1
- package/dist/assets/ttcn.95142ef9.js +0 -1
- package/dist/assets/turtle.85b2a3da.js +0 -1
- package/dist/assets/twig.62b2dffd.js +0 -1
- package/dist/assets/ug.40c679dd.js +0 -1
- package/dist/assets/uk-UA.cbb553a2.js +0 -1
- package/dist/assets/uk.bc3bab47.js +0 -1
- package/dist/assets/use-sync.d10faf61.js +0 -1
- package/dist/assets/uz.2b2e9831.js +0 -1
- package/dist/assets/vb.bbf99b0c.js +0 -1
- package/dist/assets/vbscript.c0f76ccd.js +0 -1
- package/dist/assets/velocity.52207bab.js +0 -1
- package/dist/assets/vendor.86c52524.js +0 -147
- package/dist/assets/verilog.e0ac5285.js +0 -1
- package/dist/assets/vhdl.e07298c7.js +0 -1
- package/dist/assets/vi-VN.db2d52f3.js +0 -1
- package/dist/assets/vi.f786c3c8.js +0 -1
- package/dist/assets/vue.459ef190.js +0 -1
- package/dist/assets/wast.b3e73fcf.js +0 -1
- package/dist/assets/webidl.df1b3ed1.js +0 -1
- package/dist/assets/xquery.74161230.js +0 -1
- package/dist/assets/yacas.79eb5f9c.js +0 -1
- package/dist/assets/yaml-frontmatter.f48c04a8.js +0 -1
- package/dist/assets/yaml.22d709a8.js +0 -1
- package/dist/assets/z80.95ea5a67.js +0 -1
- package/dist/assets/zh-CN.b6c04332.js +0 -1
- package/dist/assets/zh-TW.c6eaba5c.js +0 -1
- package/dist/assets/zh-cn.36b5a283.js +0 -1
- package/dist/assets/zh-tw.f3b4c6d2.js +0 -1
- package/dist/img/docs/200-200-cover-25.jpg +0 -0
- package/dist/index.85e5984e.js +0 -1
- package/dist/vue-i18n.dd6d516e.js +0 -1
- package/dist/vue-router.85a06ff8.js +0 -1
- package/dist/vue.8174b3ce.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=Object.defineProperty,e=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,u=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,a=(t,e)=>{for(var n in e||(e={}))o.call(e,n)&&u(t,n,e[n]);if(r)for(var n of r(e))i.call(e,n)&&u(t,n,e[n]);return t},c=(t,r)=>e(t,n(r));"undefined"!=typeof require&&require;import{bo as s,H as l,w as f,J as d,G as m,a1 as g,am as h,bp as p,bq as v,a6 as b,z as y,y as w,l as x,K as C,L as S,B as k,U as T,C as O,M as _,F as E,E as D,S as A,R as M,N as z,V as R,P as N,D as B,W as P}from"./vendor.86c52524.js";import{l as I,b as L,m as H,n as V}from"../index.85e5984e.js";import"./use-sync.d10faf61.js";var F,j,U,W,q,$,G,K,X,Y,J,Q,Z,tt,et,nt,rt,ot,it,ut,at,ct,st,lt,ft,dt,mt,gt,ht,pt,vt,bt,yt,wt,xt,Ct,St,kt,Tt,Ot,_t,Et,Dt,At,Mt,zt,Rt,Nt,Bt,Pt,It,Lt,Ht,Vt,Ft,jt,Ut,Wt,qt,$t,Gt,Kt,Xt,Yt,Jt,Qt,Zt,te,ee,ne,re,oe,ie;F={exports:{}},function(){var t=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},e=function(t){return{eq:t}},n=e((function(t,e){return t===e})),r=function(t){return e((function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t.eq(e[o],n[o]))return!1;return!0}))},o=function(t,n){return function(t,n){return e((function(e,r){return t.eq(n(e),n(r))}))}(r(t),(function(t){return function(t,e){return Array.prototype.slice.call(t).sort(e)}(t,n)}))},i=function(t){return e((function(e,r){var i=Object.keys(e),u=Object.keys(r);if(!o(n).eq(i,u))return!1;for(var a=i.length,c=0;c<a;c++){var s=i[c];if(!t.eq(e[s],r[s]))return!1}return!0}))},u=e((function(e,n){if(e===n)return!0;var o=t(e);return o===t(n)&&(function(t){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(t)}(o)?e===n:"array"===o?r(u).eq(e,n):"object"===o&&i(u).eq(e,n))})),a=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},c=function(t){return function(e){return typeof e===t}},l=function(t){return function(e){return t===e}},f=a("string"),d=a("object"),m=a("array"),g=l(null),h=c("boolean"),p=l(void 0),v=function(t){return null==t},b=function(t){return!v(t)},y=c("function"),w=c("number"),x=function(){},C=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},S=function(t,e){return function(n){return t(e(n))}},k=function(t){return function(){return t}},T=function(t){return t},O=function(t,e){return t===e};function _(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var E,D,A=function(t){return function(e){return!t(e)}},M=function(t){return t()},z=function(t){t()},R=k(!1),N=k(!0),B=function(){return P},P={fold:function(t,e){return t()},isSome:R,isNone:N,getOr:D=T,getOrThunk:E=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:k(null),getOrUndefined:k(void 0),or:D,orThunk:E,map:B,each:x,bind:B,exists:R,forall:N,filter:function(){return B()},toArray:function(){return[]},toString:k("none()")},I=function(t){var e=k(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:N,isNone:R,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return I(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:P},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},L={some:I,none:B,from:function(t){return null==t?P:I(t)}},H=Array.prototype.slice,V=Array.prototype.indexOf,j=Array.prototype.push,U=function(t,e){return V.call(t,e)},W=function(t,e){return U(t,e)>-1},q=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},$=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},G=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},K=function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)},X=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}},Y=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},J=function(t,e,n){return K(t,(function(t,r){n=e(n,t,r)})),n},Q=function(t,e,n){return G(t,(function(t,r){n=e(n,t,r)})),n},Z=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return L.some(i);if(n(i,r))break}return L.none()},tt=function(t,e){return Z(t,e,R)},et=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return L.some(n);return L.none()},nt=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!m(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);j.apply(e,t[n])}return e}($(t,e))},rt=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},ot=function(t){var e=H.call(t,0);return e.reverse(),e},it=function(t,e){return Y(t,(function(t){return!W(e,t)}))},ut=function(t,e){return e>=0&&e<t.length?L.some(t[e]):L.none()},at=function(t){return ut(t,0)},ct=function(t){return ut(t,t.length-1)},st=y(Array.from)?Array.from:function(t){return H.call(t)},lt=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return L.none()},ft=Object.keys,dt=Object.hasOwnProperty,mt=function(t,e){for(var n=ft(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},gt=function(t,e){return ht(t,(function(t,n){return{k:n,v:e(t,n)}}))},ht=function(t,e){var n={};return mt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},pt=function(t){return function(e,n){t[n]=e}},vt=function(t,e,n,r){return mt(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},bt=function(t,e){var n={};return vt(t,e,pt(n),x),n},yt=function(t){return function(t,e){var n=[];return mt(t,(function(t,r){n.push(e(t,r))})),n}(t,T)},wt=function(t,e){return xt(t,e)?L.from(t[e]):L.none()},xt=function(t,e){return dt.call(t,e)},Ct=function(t,e){return xt(t,e)&&void 0!==t[e]&&null!==t[e]},St=Array.isArray,kt=function(t,e,n){var r,o;if(!t)return!1;if(n=n||t,void 0!==t.length){for(r=0,o=t.length;r<o;r++)if(!1===e.call(n,t[r],r,t))return!1}else for(r in t)if(xt(t,r)&&!1===e.call(n,t[r],r,t))return!1;return!0},Tt=function(t,e){var n=[];return kt(t,(function(r,o){n.push(e(r,o,t))})),n},Ot=function(t,e){var n=[];return kt(t,(function(r,o){e&&!e(r,o,t)||n.push(r)})),n},_t=function(t,e){if(t)for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},Et=function(t,e,n,r){for(var o=p(n)?t[0]:n,i=0;i<t.length;i++)o=e.call(r,o,t[i],i);return o},Dt=function(t,e,n){var r,o;for(r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t))return r;return-1},At=function(t){return t[t.length-1]},Mt=function(){return(Mt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function zt(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var Rt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Nt=function(){return Bt(0,0)},Bt=function(t,e){return{major:t,minor:e}},Pt={nu:Bt,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Nt():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Bt(r(1),r(2))}(t,n)},unknown:Nt},It=function(t,e){var n=String(e).toLowerCase();return tt(t,(function(t){return t.search(n)}))},Lt=function(t,e){return-1!==t.indexOf(e)},Ht=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(t,e,0)},Vt=function(t){return function(e){return e.replace(t,"")}},Ft=Vt(/^\s+|\s+$/g),jt=Vt(/^\s+/g),Ut=Vt(/\s+$/g),Wt=function(t){return t.length>0},qt=function(t){return!Wt(t)},$t=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Gt=function(t){return function(e){return Lt(e,t)}},Kt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Lt(t,"edge/")&&Lt(t,"chrome")&&Lt(t,"safari")&&Lt(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,$t],search:function(t){return Lt(t,"chrome")&&!Lt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Lt(t,"msie")||Lt(t,"trident")}},{name:"Opera",versionRegexes:[$t,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Gt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Gt("firefox")},{name:"Safari",versionRegexes:[$t,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Lt(t,"safari")||Lt(t,"mobile/"))&&Lt(t,"applewebkit")}}],Xt=[{name:"Windows",search:Gt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Lt(t,"iphone")||Lt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Gt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Gt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Gt("linux"),versionRegexes:[]},{name:"Solaris",search:Gt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Gt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Gt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Yt={browsers:k(Kt),oses:k(Xt)},Jt="Edge",Qt="Chrome",Zt="Opera",te="Firefox",ee="Safari",ne=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Jt),isChrome:r(Qt),isIE:r("IE"),isOpera:r(Zt),isFirefox:r(te),isSafari:r(ee)}},re={unknown:function(){return ne({current:void 0,version:Pt.unknown()})},nu:ne,edge:k(Jt),chrome:k(Qt),ie:k("IE"),opera:k(Zt),firefox:k(te),safari:k(ee)},oe="Windows",ie="Android",ue="Linux",ae="Solaris",ce="FreeBSD",se="ChromeOS",le=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(oe),isiOS:r("iOS"),isAndroid:r(ie),isOSX:r("OSX"),isLinux:r(ue),isSolaris:r(ae),isFreeBSD:r(ce),isChromeOS:r(se)}},fe={unknown:function(){return le({current:void 0,version:Pt.unknown()})},nu:le,windows:k(oe),ios:k("iOS"),android:k(ie),linux:k(ue),osx:k("OSX"),solaris:k(ae),freebsd:k(ce),chromeos:k(se)},de=function(t,e,n){var r=Yt.browsers(),o=Yt.oses(),i=e.bind((function(t){return function(t,e){return lt(e.brands,(function(e){var n=e.brand.toLowerCase();return tt(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:Pt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return It(t,e).map((function(t){var n=Pt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(re.unknown,re.nu),u=function(t,e){return It(t,e).map((function(t){var n=Pt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(fe.unknown,fe.nu),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:k(o),isiPhone:k(i),isTablet:k(c),isPhone:k(s),isTouch:k(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:k(l),isDesktop:k(f)}}(u,i,t,n);return{browser:i,os:u,deviceType:a}},me=function(t){return window.matchMedia(t).matches},ge=Rt((function(){return de(navigator.userAgent,L.from(navigator.userAgentData),me)})),he=function(){return ge()},pe=navigator.userAgent,ve=he(),be=ve.browser,ye=ve.os,we=ve.deviceType,xe=/WebKit/.test(pe)&&!be.isEdge(),Ce="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,Se=-1!==pe.indexOf("Windows Phone"),ke={opera:be.isOpera(),webkit:xe,ie:!(!be.isIE()&&!be.isEdge())&&be.version.major,gecko:be.isFirefox(),mac:ye.isOSX()||ye.isiOS(),iOS:we.isiPad()||we.isiPhone(),android:ye.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:be.isIE()?document.documentMode||7:10,fileApi:Ce,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!be.isIE(),desktop:we.isDesktop(),windowsPhone:Se,browser:{current:be.current,version:be.version,isChrome:be.isChrome,isEdge:be.isEdge,isFirefox:be.isFirefox,isIE:be.isIE,isOpera:be.isOpera,isSafari:be.isSafari},os:{current:ye.current,version:ye.version,isAndroid:ye.isAndroid,isChromeOS:ye.isChromeOS,isFreeBSD:ye.isFreeBSD,isiOS:ye.isiOS,isLinux:ye.isLinux,isOSX:ye.isOSX,isSolaris:ye.isSolaris,isWindows:ye.isWindows},deviceType:{isDesktop:we.isDesktop,isiPad:we.isiPad,isiPhone:we.isiPhone,isPhone:we.isPhone,isTablet:we.isTablet,isTouch:we.isTouch,isWebView:we.isWebView}},Te=/^\s*|\s*$/g,Oe=function(t){return null==t?"":(""+t).replace(Te,"")},_e=function(t,e){return e?!("array"!==e||!St(t))||typeof t===e:void 0!==t},Ee=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),kt(t,(function(t,o){if(!1===e.call(r,t,o,n))return!1;Ee(t,e,n,r)})))},De={trim:Oe,isArray:St,is:_e,toArray:function(t){if(St(t))return t;for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[n];return e},makeMap:function(t,e,n){var r;for(e=e||",","string"==typeof(t=t||[])&&(t=t.split(e)),n=n||{},r=t.length;r--;)n[t[r]]={};return n},each:kt,map:Tt,grep:Ot,inArray:_t,hasOwn:xt,extend:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o=e[r];for(var i in o)if(xt(o,i)){var u=o[i];void 0!==u&&(t[i]=u)}}return t},create:function(t,e,n){var r,o,i,u=this,a=0,c=(t=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(t))[3].match(/(^|\.)(\w+)$/i)[2],s=u.createNS(t[3].replace(/\.\w+$/,""),n);if(!s[c]){if("static"===t[2])return s[c]=e,void(this.onCreate&&this.onCreate(t[2],t[3],s[c]));e[c]||(e[c]=function(){},a=1),s[c]=e[c],u.extend(s[c].prototype,e),t[5]&&(r=u.resolve(t[5]).prototype,o=t[5].match(/\.(\w+)$/i)[1],i=s[c],s[c]=a?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[c].prototype[c]=s[c],u.each(r,(function(t,e){s[c].prototype[e]=r[e]})),u.each(e,(function(t,e){r[e]?s[c].prototype[e]=function(){return this.parent=r[e],t.apply(this,arguments)}:e!==c&&(s[c].prototype[e]=t)}))),u.each(e.static,(function(t,e){s[c][e]=t}))}},walk:Ee,createNS:function(t,e){var n,r;for(e=e||window,t=t.split("."),n=0;n<t.length;n++)e[r=t[n]]||(e[r]={}),e=e[r];return e},resolve:function(t,e){var n,r;for(e=e||window,n=0,r=(t=t.split(".")).length;n<r&&(e=e[t[n]]);n++);return e},explode:function(t,e){return!t||_e(t,"array")?t:Tt(t.split(e||","),Oe)},_addCacheSuffix:function(t){var e=ke.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t}},Ae=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Me={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Ae(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Ae(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Ae(n)},fromDom:Ae,fromPoint:function(t,e,n){return L.from(t.dom.elementFromPoint(e,n)).map(Ae)}},ze=function(t,e){var n=[],r=function(t){return n.push(t),e(t)},o=e(t);do{o=o.bind(r)}while(o.isSome());return n},Re=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Ne=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Be=function(t,e){return t.dom===e.dom},Pe=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},Ie=function(t,e){return he().browser.isIE()?Pe(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)};"undefined"!=typeof window?window:Function("return this;")();var Le,He,Ve=function(t){return t.dom.nodeName.toLowerCase()},Fe=function(t){return t.dom.nodeType},je=function(t){return function(e){return Fe(e)===t}},Ue=je(1),We=je(3),qe=je(9),$e=je(11),Ge=function(t){return Me.fromDom(t.dom.ownerDocument)},Ke=function(t){return qe(t)?t:Ge(t)},Xe=function(t){return Me.fromDom(Ke(t).dom.defaultView)},Ye=function(t){return L.from(t.dom.parentNode).map(Me.fromDom)},Je=function(t){return L.from(t.dom.previousSibling).map(Me.fromDom)},Qe=function(t){return L.from(t.dom.nextSibling).map(Me.fromDom)},Ze=function(t){return ot(ze(t,Je))},tn=function(t){return ze(t,Qe)},en=function(t){return $(t.dom.childNodes,Me.fromDom)},nn=function(t,e){var n=t.dom.childNodes;return L.from(n[e]).map(Me.fromDom)},rn=function(t){return nn(t,0)},on=function(t){return nn(t,t.dom.childNodes.length-1)},un=function(t){return t.dom.childNodes.length},an=function(t){return $e(t)&&b(t.dom.host)},cn=y(Element.prototype.attachShadow)&&y(Node.prototype.getRootNode),sn=k(cn),ln=cn?function(t){return Me.fromDom(t.dom.getRootNode())}:Ke,fn=function(t){return an(t)?t:function(t){var e=t.dom.head;if(null==e)throw new Error("Head is not available yet");return Me.fromDom(e)}(Ke(t))},dn=function(t){return Me.fromDom(t.dom.host)},mn=function(t){return b(t.dom.shadowRoot)},gn=function(t,e){Ye(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},hn=function(t,e){Qe(t).fold((function(){Ye(t).each((function(t){vn(t,e)}))}),(function(t){gn(t,e)}))},pn=function(t,e){rn(t).fold((function(){vn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},vn=function(t,e){t.dom.appendChild(e.dom)},bn=function(t,e){G(e,(function(e){vn(t,e)}))},yn=function(t){t.dom.textContent="",G(en(t),(function(t){wn(t)}))},wn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},xn=function(t){var e,n=en(t);n.length>0&&(e=t,G(n,(function(t){gn(e,t)}))),wn(t)},Cn=function(t){var e=We(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return(n=Me.fromDom(e),r=ln(n),an(r)?L.some(r):L.none()).fold((function(){return o.body.contains(e)}),S(Cn,dn))},Sn=function(t,e){return{left:t,top:e,translate:function(n,r){return Sn(t+n,e+r)}}},kn=Sn,Tn=function(t,e){return void 0!==t?t:void 0!==e?e:0},On=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?kn(n.offsetLeft,n.offsetTop):Cn(t)?function(t){var e=t.getBoundingClientRect();return kn(e.left,e.top)}(e):kn(0,0)},_n=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return kn(n,r)},En=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},Dn=function(t,e){he().browser.isSafari()&&y(t.dom.scrollIntoViewIfNeeded)?t.dom.scrollIntoViewIfNeeded(!1):t.dom.scrollIntoView(e)},An=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Mn=function(t){var e=void 0===t?window:t,n=e.document,r=_n(Me.fromDom(n));return function(t){var e=void 0===t?window:t;return L.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return An(r.left,r.top,n,o)}),(function(t){return An(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},zn=function(t){return function(e){return!!e&&e.nodeType===t}},Rn=function(t){return!!t&&!Object.getPrototypeOf(t)},Nn=zn(1),Bn=function(t){var e=t.map((function(t){return t.toLowerCase()}));return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return W(e,n)}return!1}},Pn=function(t,e){var n=e.toLowerCase().split(" ");return function(e){if(Nn(e))for(var r=0;r<n.length;r++){var o=e.ownerDocument.defaultView.getComputedStyle(e,null);if((o?o.getPropertyValue(t):null)===n[r])return!0}return!1}},In=function(t){return function(e){return Nn(e)&&e.hasAttribute(t)}},Ln=function(t){return Nn(t)&&t.hasAttribute("data-mce-bogus")},Hn=function(t){return Nn(t)&&"TABLE"===t.tagName},Vn=function(t){return function(e){if(Nn(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Fn=Bn(["textarea","input"]),jn=zn(3),Un=zn(8),Wn=zn(9),qn=zn(11),$n=Bn(["br"]),Gn=Bn(["img"]),Kn=Vn("true"),Xn=Vn("false"),Yn=Bn(["td","th"]),Jn=Bn(["video","audio","object","embed"]),Qn=function(t,e,n){return void 0===n&&(n=O),t.exists((function(t){return n(t,e)}))},Zn=function(t,e,n){return t.isSome()&&e.isSome()?L.some(n(t.getOrDie(),e.getOrDie())):L.none()},tr=function(t){return void 0!==t.style&&y(t.style.getPropertyValue)},er=function(t,e,n){if(!(f(n)||h(n)||w(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},nr=function(t,e,n){er(t.dom,e,n)},rr=function(t,e){var n=t.dom;mt(e,(function(t,e){er(n,e,t)}))},or=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},ir=function(t,e){return L.from(or(t,e))},ur=function(t,e){t.dom.removeAttribute(e)},ar=function(t,e){var n=t.dom;mt(e,(function(t,e){!function(t,e,n){if(!f(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);tr(t)&&t.style.setProperty(e,n)}(n,e,t)}))},cr=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Cn(t)?r:sr(n,e)},sr=function(t,e){return tr(t)?t.style.getPropertyValue(e):""},lr=function(t,e){var n=t.dom,r=sr(n,e);return L.from(r).filter((function(t){return t.length>0}))},fr=function(t){var e={},n=t.dom;if(tr(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},dr=he().browser,mr=function(t){return tt(t,Ue)},gr=function(t,e){return t.children&&W(t.children,e)},hr=function(t,e,n){var r=0,o=0,i=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===cr(Me.fromDom(t),"position")){var u=e.getBoundingClientRect();return{x:r=u.left+(i.documentElement.scrollLeft||t.scrollLeft)-i.documentElement.clientLeft,y:o=u.top+(i.documentElement.scrollTop||t.scrollTop)-i.documentElement.clientTop}}for(var a=e;a&&a!==n&&a.nodeType&&!gr(a,n);){var c=a;r+=c.offsetLeft||0,o+=c.offsetTop||0,a=c.offsetParent}for(a=e.parentNode;a&&a!==n&&a.nodeType&&!gr(a,n);)r-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode;o+=function(t){return dr.isFirefox()&&"table"===Ve(t)?mr(en(t)).filter((function(t){return"caption"===Ve(t)})).bind((function(t){return mr(tn(t)).map((function(e){var n=e.dom.offsetTop,r=t.dom.offsetTop,o=t.dom.offsetHeight;return n<=r?-o:0}))})).getOr(0):0}(Me.fromDom(e))}return{x:r,y:o}},pr={},vr={exports:pr};Le=pr,He=vr,function(t){"object"==typeof Le&&void 0!==He?He.exports=t():("undefined"!=typeof window?window:void 0!==s?s:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}((function(){return function t(e,n,r){function o(u,a){if(!n[u]){if(!e[u]){var c=!1;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var l=n[u]={exports:{}};e[u][0].call(l.exports,(function(t){return o(e[u][1][t]||t)}),l,l.exports,t,e,n,r)}return n[u].exports}for(var i=!1,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(n){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var s,l=[],f=!1,d=-1;function m(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&g())}function g(){if(!f){var t=c(m);f=!0;for(var e=l.length;e;){for(s=l,l=[];++d<e;)s&&s[d].run();d=-1,e=l.length}s=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(n){return o.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new h(t,e)),1!==l.length||f||c(g)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function u(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(o){return void c(e.promise,o)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(u){c(t,u)}var r,o}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(r){if(n)return;n=!0,c(e,r)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return u(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(c){n(c)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}));var br=vr.exports.boltExport,yr=function(t){var e=L.none(),n=[],r=function(t){o()?u(t):n.push(t)},o=function(){return e.isSome()},i=function(t){G(t,u)},u=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=L.some(t),i(n),n=[])})),{get:r,map:function(t){return yr((function(e){r((function(n){e(t(n))}))}))},isReady:o}},wr={nu:yr,pure:function(t){return yr((function(e){e(t)}))}},xr=function(t){setTimeout((function(){throw t}),0)},Cr=function(t){var e=function(e){t().then(e,xr)};return{map:function(e){return Cr((function(){return t().then(e)}))},bind:function(e){return Cr((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return Cr((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return wr.nu(e)},toCached:function(){var e=null;return Cr((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},Sr=function(t){return Cr((function(){return new br(t)}))},kr=function(t,e){return e((function(e){var n=[],r=0;0===t.length?e([]):G(t,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=t.length&&e(n)}}(i))}))}))},Tr=function(t){return{isValue:N,isError:R,getOr:k(t),getOrThunk:k(t),getOrDie:k(t),or:function(e){return Tr(t)},orThunk:function(e){return Tr(t)},fold:function(e,n){return n(t)},map:function(e){return Tr(e(t))},mapError:function(e){return Tr(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return L.some(t)}}},Or=function(t){return{isValue:R,isError:N,getOr:T,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:T,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return Or(t)},mapError:function(e){return Or(e(t))},each:x,bind:function(e){return Or(t)},exists:R,forall:N,toOptional:L.none}},_r={value:Tr,error:Or,fromOption:function(t,e){return t.fold((function(){return Or(e)}),Tr)}},Er=function(t){if(!m(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return G(t,(function(r,o){var i=ft(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!m(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+i);var c=function(t){var r=ft(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!rt(e,(function(t){return W(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:n})}}}})),n};Er([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Dr=function(t){return t.fold(T,T)};function Ar(t,e,n,r,o){return t(n,r)?L.some(n):y(o)&&o(n)?L.none():e(n,r,o)}var Mr,zr,Rr,Nr,Br,Pr,Ir,Lr,Hr,Vr,Fr,jr,Ur,Wr,qr,$r,Gr,Kr,Xr,Yr,Jr,Qr=function(t,e,n){for(var r=t.dom,o=y(n)?n:R;r.parentNode;){r=r.parentNode;var i=Me.fromDom(r);if(e(i))return L.some(i);if(o(i))break}return L.none()},Zr=function(t,e,n){return Ar((function(t,e){return e(t)}),Qr,t,e,n)},to=function(t,e){return tt(t.dom.childNodes,(function(t){return e(Me.fromDom(t))})).map(Me.fromDom)},eo=function(t,e,n){return Qr(t,(function(t){return Re(t,e)}),n)},no=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ne(n)?L.none():L.from(n.querySelector(t)).map(Me.fromDom)}(e,t)},ro=function(t,e,n){return Ar((function(t,e){return Re(t,e)}),eo,t,e,n)},oo=window.Promise?window.Promise:function(){var t=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];t.apply(e,n)}},e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(e,t(i,this),t(u,this))},r=n.immediateFn||"function"==typeof setImmediate&&setImmediate||function(t){return setTimeout(t,1)};function o(t){var e=this;null!==this._state?r((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(o){return void t.reject(o)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function i(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void s(t(n,e),t(i,this),t(u,this))}this._state=!0,this._value=e,a.call(this)}catch(r){u.call(this,r)}}function u(t){this._state=!1,this._value=t,a.call(this)}function a(){for(var t=0,e=this._deferreds.length;t<e;t++)o.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}var s=function(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(o){if(r)return;r=!0,n(o)}};return n.prototype.catch=function(t){return this.then(null,t)},n.prototype.then=function(t,e){var r=this;return new n((function(n,i){o.call(r,new c(t,e,n,i))}))},n.all=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var o=Array.prototype.slice.call(1===t.length&&e(t[0])?t[0]:t);return new n((function(t,e){if(0===o.length)return t([]);for(var n=o.length,r=function(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){r(i,t)}),e)}o[i]=u,0==--n&&t(o)}catch(c){e(c)}},i=0;i<o.length;i++)r(i,o[i])}))},n.resolve=function(t){return t&&"object"==typeof t&&t.constructor===n?t:new n((function(e){e(t)}))},n.reject=function(t){return new n((function(e,n){n(t)}))},n.race=function(t){return new n((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},n}(),io=function(t,e){return"number"!=typeof e&&(e=0),setTimeout(t,e)},uo=function(t,e){return"number"!=typeof e&&(e=1),setInterval(t,e)},ao=function(t,e){var n,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=io((function(){t.apply(this,r)}),e)};return r.stop=function(){clearTimeout(n)},r},co={requestAnimationFrame:function(t,e){Mr?Mr.then(t):Mr=new oo((function(t){e||(e=document.body),function(t,e){for(var n=window.requestAnimationFrame,r=["ms","moz","webkit"],o=0;o<r.length&&!n;o++)n=window[r[o]+"RequestAnimationFrame"];n||(n=function(t){window.setTimeout(t,0)}),n(t,e)}(t,e)})).then(t)},setTimeout:io,setInterval:uo,setEditorTimeout:function(t,e,n){return io((function(){t.removed||e()}),n)},setEditorInterval:function(t,e,n){var r=uo((function(){t.removed?clearInterval(r):e()}),n);return r},debounce:ao,throttle:ao,clearInterval:function(t){return clearInterval(t)},clearTimeout:function(t){return clearTimeout(t)}},so=function(t,e){void 0===e&&(e={});var n=0,r={},o=Me.fromDom(t),i=Ke(o),u=e.maxLoadTime||5e3,a=function(a,c,s){var l,f=De._addCacheSuffix(a),d=function(t){return wt(r,t).getOrThunk((function(){return{id:"mce-u"+n++,passed:[],failed:[],count:0}}))}(f);r[f]=d,d.count++;var m=function(t,e){for(var n=t.length;n--;)t[n]();d.status=e,d.passed=[],d.failed=[],l&&(l.onload=null,l.onerror=null,l=null)},g=function(){return m(d.passed,2)},h=function(){return m(d.failed,3)},p=function(){var e;e=p,function(){for(var e=t.styleSheets,n=e.length;n--;){var r=e[n].ownerNode;if(r&&r.id===l.id)return g(),!0}return!1}()||(Date.now()-y<u?co.setTimeout(e):h())};if(c&&d.passed.push(c),s&&d.failed.push(s),1!==d.status)if(2!==d.status)if(3!==d.status){d.status=1;var v=Me.fromTag("link",i.dom);rr(v,{rel:"stylesheet",type:"text/css",id:d.id});var b,y=Date.now();e.contentCssCors&&nr(v,"crossOrigin","anonymous"),e.referrerPolicy&&nr(v,"referrerpolicy",e.referrerPolicy),(l=v.dom).onload=p,l.onerror=h,b=v,vn(fn(o),b),nr(v,"href",f)}else h();else g()},c=function(t){return Sr((function(e){a(t,C(e,k(_r.value(t))),C(e,k(_r.error(t))))}))},s=function(t){var e=De._addCacheSuffix(t);wt(r,e).each((function(t){0==--t.count&&(delete r[e],function(t){var e=fn(o);no(e,"#"+t).each(wn)}(t.id))}))};return{load:a,loadAll:function(t,e,n){var r;(r=$(t,c),kr(r,Sr)).get((function(t){var r=X(t,(function(t){return t.isValue()}));r.fail.length>0?n(r.fail.map(Dr)):e(r.pass.map(Dr))}))},unload:s,unloadAll:function(t){G(t,(function(t){s(t)}))},_setReferrerPolicy:function(t){e.referrerPolicy=t}}},lo=(zr=new WeakMap,{forElement:function(t,e){var n=ln(t).dom;return L.from(zr.get(n)).getOrThunk((function(){var t=so(n,e);return zr.set(n,t),t}))}}),fo=function(){function t(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return t.prototype.current=function(){return this.node},t.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},t.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},t.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},t.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n])return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},t.prototype.findPreviousNode=function(t,e,n,r){var o,i,u;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(u=o[e];u;u=u[e])if(!u[e])return u;return o}if((i=t.parentNode)&&i!==this.rootNode)return i}},t}(),mo=function(t){var e;return function(n){return e=e||function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n}(t,N),xt(e,Ve(n))}},go=mo(["h1","h2","h3","h4","h5","h6"]),ho=mo(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),po=function(t){return Ue(t)&&!ho(t)},vo=function(t){return Ue(t)&&"br"===Ve(t)},bo=mo(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),yo=mo(["ul","ol","dl"]),wo=mo(["li","dd","dt"]),xo=mo(["thead","tbody","tfoot"]),Co=mo(["td","th"]),So=mo(["pre","script","textarea","style"]),ko=" ",To="\ufeff",Oo=function(t){return"\ufeff"===t},_o=function(t){return t.replace(/\uFEFF/g,"")},Eo=Nn,Do=jn,Ao=function(t){return Do(t)&&(t=t.parentNode),Eo(t)&&t.hasAttribute("data-mce-caret")},Mo=function(t){return Do(t)&&Oo(t.data)},zo=function(t){return Ao(t)||Mo(t)},Ro=function(t){return t.firstChild!==t.lastChild||!$n(t.firstChild)},No=function(t){var e=t.container();return!!jn(e)&&(e.data.charAt(t.offset())===To||t.isAtStart()&&Mo(e.previousSibling))},Bo=function(t){var e=t.container();return!!jn(e)&&(e.data.charAt(t.offset()-1)===To||t.isAtEnd()&&Mo(e.nextSibling))},Po=function(t,e,n){var r,o=e.ownerDocument.createElement(t);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=e.parentNode;return n?i.insertBefore(o,e):e.nextSibling?i.insertBefore(o,e.nextSibling):i.appendChild(o),o},Io=function(t){return Do(t)&&t.data[0]===To},Lo=function(t){return Do(t)&&t.data[t.data.length-1]===To},Ho=function(t){return t&&t.hasAttribute("data-mce-caret")?(e=t.getElementsByTagName("br"),n=e[e.length-1],Ln(n)&&n.parentNode.removeChild(n),t.removeAttribute("data-mce-caret"),t.removeAttribute("data-mce-bogus"),t.removeAttribute("style"),t.removeAttribute("_moz_abspos"),t):null;var e,n},Vo=function(t){return Ao(t.startContainer)},Fo=Kn,jo=Xn,Uo=$n,Wo=jn,qo=Bn(["script","style","textarea"]),$o=Bn(["img","input","textarea","hr","iframe","video","audio","object","embed"]),Go=Bn(["table"]),Ko=zo,Xo=function(t){return!Ko(t)&&(Wo(t)?!qo(t.parentNode):$o(t)||Uo(t)||Go(t)||Yo(t))},Yo=function(t){return!1===function(t){return Nn(t)&&"true"===t.getAttribute("unselectable")}(t)&&jo(t)},Jo=function(t,e){return Xo(t)&&function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if(Yo(t))return!1;if(Fo(t))return!0}return!0}(t,e)},Qo=/^[ \t\r\n]*$/,Zo=function(t){return Qo.test(t)},ti=function(t,e){var n,r,o,i=Me.fromDom(e),u=Me.fromDom(t);return n=u,r="pre,code",o=_(Be,i),eo(n,r,o).isSome()},ei=function(t,e){return Xo(t)&&!1===function(t,e){return jn(t)&&Zo(t.data)&&!1===ti(t,e)}(t,e)||function(t){return Nn(t)&&"A"===t.nodeName&&!t.hasAttribute("href")&&(t.hasAttribute("name")||t.hasAttribute("id"))}(t)||ni(t)},ni=In("data-mce-bookmark"),ri=In("data-mce-bogus"),oi=(Rr="data-mce-bogus",Nr="all",function(t){return Nn(t)&&t.getAttribute(Rr)===Nr}),ii=function(t,e){return void 0===e&&(e=!0),function(t,e){var n=0;if(ei(t,t))return!1;var r=t.firstChild;if(!r)return!0;var o=new fo(r,t);do{if(e){if(oi(r)){r=o.next(!0);continue}if(ri(r)){r=o.next();continue}}if($n(r))n++,r=o.next();else{if(ei(r,t))return!1;r=o.next()}}while(r);return n<=1}(t.dom,e)},ui=function(t,e){return b(t)&&(ei(t,e)||po(Me.fromDom(t)))},ai=function(t){return function(t){return"span"===t.nodeName.toLowerCase()}(t)&&"bookmark"===t.getAttribute("data-mce-type")},ci=function(t,e){return jn(t)&&t.data.length>0&&function(t,e){var n=new fo(t,e).prev(!1),r=new fo(t,e).next(!1),o=p(n)||ui(n,e),i=p(r)||ui(r,e);return o&&i}(t,e)},si=function(t,e,n){var r=n||e;if(Nn(e)&&ai(e))return e;for(var o=e.childNodes,i=o.length-1;i>=0;i--)si(t,o[i],r);if(Nn(e)){var u=e.childNodes;1===u.length&&ai(u[0])&&e.parentNode.insertBefore(u[0],e)}return function(t){return qn(t)||Wn(t)}(e)||ei(e,r)||function(t){return!!Nn(t)&&t.childNodes.length>0}(e)||ci(e,r)||t.remove(e),e},li=De.makeMap,fi=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,di=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,mi=/[<>&\"\']/g,gi=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,hi={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},pi={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},vi={"<":"<",">":">","&":"&",""":'"',"'":"'"},bi=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)r=String.fromCharCode(parseInt(t[n],e)),pi[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}},yi=bi("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),wi=function(t,e){return t.replace(e?fi:di,(function(t){return pi[t]||t}))},xi=function(t,e){return t.replace(e?fi:di,(function(t){return t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":pi[t]||"&#"+t.charCodeAt(0)+";"}))},Ci=function(t,e,n){return n=n||yi,t.replace(e?fi:di,(function(t){return pi[t]||n[t]||t}))},Si={encodeRaw:wi,encodeAllRaw:function(t){return(""+t).replace(mi,(function(t){return pi[t]||t}))},encodeNumeric:xi,encodeNamed:Ci,getEncodeFunc:function(t,e){var n=bi(e)||yi,r=li(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?fi:di,(function(t){return void 0!==pi[t]?pi[t]:void 0!==n[t]?n[t]:t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"}))}:r.named?e?function(t,e){return Ci(t,e,n)}:Ci:r.numeric?xi:wi},decode:function(t){return t.replace(gi,(function(t,e){return e?(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):hi[e]||String.fromCharCode(e):vi[t]||yi[t]||function(t){var e=Me.fromTag("div").dom;return e.innerHTML=t,e.textContent||e.innerText||t}(t)}))}},ki={},Ti={},Oi=De.makeMap,_i=De.each,Ei=De.extend,Di=De.explode,Ai=De.inArray,Mi=function(t,e){return(t=De.trim(t))?t.split(e||" "):[]},zi=function(t,e){var n;return t&&(n={},"string"==typeof t&&(t={"*":t}),_i(t,(function(t,r){n[r]=n[r.toUpperCase()]="map"===e?Oi(t,/[, ]/):Di(t,/[, ]/)}))),n},Ri=function(t){var e,n,r,o,i,u,a,c,s,l,f={},d={},m=[],g={},h={},p=function(e,n,r){var o=t[e];return o?o=Oi(o,/[, ]/,Oi(o.toUpperCase(),/[, ]/)):(o=ki[e])||(o=Oi(n," ",Oi(n.toUpperCase()," ")),o=Ei(o,r),ki[e]=o),o},v=(e=(t=t||{}).schema,c={},s=function(t,e,r){var o,i,u,a=function(t,e){var n,r,o={};for(n=0,r=t.length;n<r;n++)o[t[n]]=e||{};return o};e=e||"","string"==typeof(r=r||[])&&(r=Mi(r));var s=Mi(t);for(o=s.length;o--;)u={attributes:a(i=Mi([n,e].join(" "))),attributesOrder:i,children:a(r,Ti)},c[s[o]]=u},l=function(t,e){var n,r,o,i,u=Mi(t);n=u.length;for(var a=Mi(e);n--;)for(r=c[u[n]],o=0,i=a.length;o<i;o++)r.attributes[a[o]]={},r.attributesOrder.push(a[o])},ki[e]?ki[e]:(n="id accesskey class dir lang style tabindex title role",r="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",o="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(n+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",r+=" article aside details dialog figure main header footer hgroup section nav",o+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(n+=" xml:lang",o=[o,a="acronym applet basefont big font strike tt"].join(" "),_i(Mi(a),(function(t){s(t,"",o)})),r=[r,u="center dir isindex noframes"].join(" "),i=[r,o].join(" "),_i(Mi(u),(function(t){s(t,"",i)}))),i=i||[r,o].join(" "),s("html","manifest","head body"),s("head","","base command link meta noscript script style title"),s("title hr noscript br"),s("base","href target"),s("link","href rel media hreflang type sizes hreflang"),s("meta","name http-equiv content charset"),s("style","media type scoped"),s("script","src async defer type charset"),s("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",i),s("address dt dd div caption","",i),s("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",o),s("blockquote","cite",i),s("ol","reversed start type","li"),s("ul","","li"),s("li","value",i),s("dl","","dt dd"),s("a","href target rel media hreflang type",o),s("q","cite",o),s("ins del","cite datetime",i),s("img","src sizes srcset alt usemap ismap width height"),s("iframe","src name width height",i),s("embed","src type width height"),s("object","data type typemustmatch name usemap form width height",[i,"param"].join(" ")),s("param","name value"),s("map","name",[i,"area"].join(" ")),s("area","alt coords shape href target rel media hreflang type"),s("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),s("colgroup","span","col"),s("col","span"),s("tbody thead tfoot","","tr"),s("tr","","td th"),s("td","colspan rowspan headers",i),s("th","colspan rowspan headers scope abbr",i),s("form","accept-charset action autocomplete enctype method name novalidate target",i),s("fieldset","disabled form name",[i,"legend"].join(" ")),s("label","form for",o),s("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),s("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?i:o),s("select","disabled form multiple name required size","option optgroup"),s("optgroup","disabled label","option"),s("option","disabled label selected value"),s("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),s("menu","type label",[i,"li"].join(" ")),s("noscript","",i),"html4"!==e&&(s("wbr"),s("ruby","",[o,"rt rp"].join(" ")),s("figcaption","",i),s("mark rt rp summary bdi","",o),s("canvas","width height",i),s("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[i,"track source"].join(" ")),s("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[i,"track source"].join(" ")),s("picture","","img source"),s("source","src srcset type media sizes"),s("track","kind src srclang label default"),s("datalist","",[o,"option"].join(" ")),s("article section nav aside main header footer","",i),s("hgroup","","h1 h2 h3 h4 h5 h6"),s("figure","",[i,"figcaption"].join(" ")),s("time","datetime",o),s("dialog","open",i),s("command","type label icon disabled checked radiogroup command"),s("output","for form name",o),s("progress","value max",o),s("meter","value min max low high optimum",o),s("details","open",[i,"summary"].join(" ")),s("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(l("script","language xml:space"),l("style","xml:space"),l("object","declare classid code codebase codetype archive standby align border hspace vspace"),l("embed","align name hspace vspace"),l("param","valuetype type"),l("a","charset name rev shape coords"),l("br","clear"),l("applet","codebase archive code object alt name width height align hspace vspace"),l("img","name longdesc align border hspace vspace"),l("iframe","longdesc frameborder marginwidth marginheight scrolling align"),l("font basefont","size color face"),l("input","usemap align"),l("select"),l("textarea"),l("h1 h2 h3 h4 h5 h6 div p legend caption","align"),l("ul","type compact"),l("li","type"),l("ol dl menu dir","compact"),l("pre","width xml:space"),l("hr","align noshade size width"),l("isindex","prompt"),l("table","summary width frame rules cellspacing cellpadding align bgcolor"),l("col","width align char charoff valign"),l("colgroup","width align char charoff valign"),l("thead","align char charoff valign"),l("tr","align char charoff valign bgcolor"),l("th","axis align char charoff valign nowrap bgcolor width height"),l("form","accept"),l("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),l("tfoot","align char charoff valign"),l("tbody","align char charoff valign"),l("area","nohref"),l("body","background bgcolor text link vlink alink")),"html4"!==e&&(l("input button select textarea","autofocus"),l("input textarea","placeholder"),l("a","download"),l("link script img","crossorigin"),l("img","loading"),l("iframe","sandbox seamless allowfullscreen loading")),_i(Mi("a form meter progress dfn"),(function(t){c[t]&&delete c[t].children[t]})),delete c.caption.children.table,delete c.script,ki[e]=c,c));!1===t.verify_html&&(t.valid_elements="*[*]");var b=zi(t.valid_styles),y=zi(t.invalid_styles,"map"),w=zi(t.valid_classes,"map"),x=p("whitespace_elements","pre script noscript style textarea video audio iframe object code"),C=p("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),S=p("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),T=p("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),O="td th iframe video audio object script code",_=p("non_empty_elements",O+" pre",S),E=p("move_caret_before_on_enter_elements",O+" table",S),D=p("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),A=p("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",D),M=p("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");_i((t.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(t){h[t]=new RegExp("</"+t+"[^>]*>","gi")}));var z=function(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")},R=function(t){var e,n,r,o,i,u,a,c,s,l,d,g,h,p,v,b,y,w,x=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,C=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,S=/[*?+]/;if(t){var k=Mi(t,",");for(f["@"]&&(b=f["@"].attributes,y=f["@"].attributesOrder),e=0,n=k.length;e<n;e++)if(i=x.exec(k[e])){if(p=i[1],s=i[2],v=i[3],c=i[5],u={attributes:g={},attributesOrder:h=[]},"#"===p&&(u.paddEmpty=!0),"-"===p&&(u.removeEmpty=!0),"!"===i[4]&&(u.removeEmptyAttrs=!0),b&&(mt(b,(function(t,e){g[e]=t})),h.push.apply(h,y)),c)for(r=0,o=(c=Mi(c,"|")).length;r<o;r++)if(i=C.exec(c[r])){if(a={},d=i[1],l=i[2].replace(/[\\:]:/g,":"),p=i[3],w=i[4],"!"===d&&(u.attributesRequired=u.attributesRequired||[],u.attributesRequired.push(l),a.required=!0),"-"===d){delete g[l],h.splice(Ai(h,l),1);continue}p&&("="===p&&(u.attributesDefault=u.attributesDefault||[],u.attributesDefault.push({name:l,value:w}),a.defaultValue=w),":"===p&&(u.attributesForced=u.attributesForced||[],u.attributesForced.push({name:l,value:w}),a.forcedValue=w),"<"===p&&(a.validValues=Oi(w,"?"))),S.test(l)?(u.attributePatterns=u.attributePatterns||[],a.pattern=z(l),u.attributePatterns.push(a)):(g[l]||h.push(l),g[l]=a)}b||"@"!==s||(b=g,y=h),v&&(u.outputName=s,f[v]=u),S.test(s)?(u.pattern=z(s),m.push(u)):f[s]=u}}},N=function(t){f={},m=[],R(t),_i(v,(function(t,e){d[e]=t.children}))},B=function(t){var e=/^(~)?(.+)$/;t&&(ki.text_block_elements=ki.block_elements=null,_i(Mi(t,","),(function(t){var n=e.exec(t),r="~"===n[1],o=r?"span":"div",i=n[2];if(d[i]=d[o],g[i]=o,r||(A[i.toUpperCase()]={},A[i]={}),!f[i]){var u=f[o];delete(u=Ei({},u)).removeEmptyAttrs,delete u.removeEmpty,f[i]=u}_i(d,(function(t,e){t[o]&&(d[e]=t=Ei({},d[e]),t[i]=t[o])}))})))},P=function(e){var n=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;ki[t.schema]=null,e&&_i(Mi(e,","),(function(t){var e,r,o=n.exec(t);o&&(r=o[1],e=r?d[o[2]]:d[o[2]]={"#comment":{}},e=d[o[2]],_i(Mi(o[3],"|"),(function(t){"-"===r?delete e[t]:e[t]={}})))}))},I=function(t){var e,n=f[t];if(n)return n;for(e=m.length;e--;)if((n=m[e]).pattern.test(t))return n};t.valid_elements?N(t.valid_elements):(_i(v,(function(t,e){f[e]={attributes:t.attributes,attributesOrder:t.attributesOrder},d[e]=t.children})),"html5"!==t.schema&&_i(Mi("strong/b em/i"),(function(t){var e=Mi(t,"/");f[e[1]].outputName=e[0]})),_i(Mi("ol ul sub sup blockquote span font a table tbody strong em b i"),(function(t){f[t]&&(f[t].removeEmpty=!0)})),_i(Mi("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(t){f[t].paddEmpty=!0})),_i(Mi("span"),(function(t){f[t].removeEmptyAttrs=!0}))),B(t.custom_elements),P(t.valid_children),R(t.extended_valid_elements),P("+ol[ul|ol],+ul[ul|ol]"),_i({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(function(t,e){f[e]&&(f[e].parentsRequired=Mi(t))})),t.invalid_elements&&_i(Di(t.invalid_elements),(function(t){f[t]&&delete f[t]})),I("span")||R("span[!data-mce-type|*]");var L=k(b),H=k(y),V=k(w),F=k(T),j=k(A),U=k(D),W=k(M),q=k(S),$=k(C),G=k(_),K=k(E),X=k(x),Y=k(h),J=k(g);return{children:d,elements:f,getValidStyles:L,getValidClasses:V,getBlockElements:j,getInvalidStyles:H,getShortEndedElements:q,getTextBlockElements:U,getTextInlineElements:W,getBoolAttrs:F,getElementRule:I,getSelfClosingElements:$,getNonEmptyElements:G,getMoveCaretBeforeOnEnterElements:K,getWhiteSpaceElements:X,getSpecialElements:Y,isValidChild:function(t,e){var n=d[t.toLowerCase()];return!(!n||!n[e.toLowerCase()])},isValid:function(t,e){var n,r,o=I(t);if(o){if(!e)return!0;if(o.attributes[e])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(t))return!0}return!1},getCustomElements:J,addValidElements:R,setValidElements:N,addCustomElements:B,addValidChildren:P}},Ni=function(t,e,n,r){var o=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+o(e)+o(n)+o(r)},Bi=function(t,e){var n,r,o,i=this,u=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,a=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,c=/\s*([^:]+):\s*([^;]+);?/g,s=/\s+$/,l={},f="\ufeff";t=t||{},e&&(r=e.getValidStyles(),o=e.getInvalidStyles());var d="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n<d.length;n++)l[d[n]]=f+n,l[f+n]=d[n];return{toHex:function(t){return t.replace(u,Ni)},parse:function(e){var r,o,d,m,g,h,p,v,b={},y=t.url_converter,w=t.url_converter_scope||i,x=function(t,e,r){var o=b[t+"-top"+e];if(o){var i=b[t+"-right"+e];if(i){var u=b[t+"-bottom"+e];if(u){var a=b[t+"-left"+e];if(a){var c=[o,i,u,a];for(n=c.length-1;n--&&c[n]===c[n+1];);n>-1&&r||(b[t+e]=-1===n?c[0]:c.join(" "),delete b[t+"-top"+e],delete b[t+"-right"+e],delete b[t+"-bottom"+e],delete b[t+"-left"+e])}}}}},C=function(t){var e,n=b[t];if(n){for(e=(n=n.split(" ")).length;e--;)if(n[e]!==n[0])return!1;return b[t]=n[0],!0}},S=function(t){return m=!0,l[t]},k=function(t,e){return m&&(t=t.replace(/\uFEFF[0-9]/g,(function(t){return l[t]}))),e||(t=t.replace(/\\([\'\";:])/g,"$1")),t},T=function(t){return String.fromCharCode(parseInt(t.slice(1),16))},O=function(t){return t.replace(/\\[0-9a-f]+/gi,T)},_=function(e,n,r,o,i,u){if(i=i||u)return"'"+(i=k(i)).replace(/\'/g,"\\'")+"'";if(n=k(n||r||o),!t.allow_script_urls){var a=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return y&&(n=y.call(w,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,S).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(t){return t.replace(/[;:]/g,S)}));r=c.exec(e);)if(c.lastIndex=r.index+r[0].length,o=r[1].replace(s,"").toLowerCase(),d=r[2].replace(s,""),o&&d){if(o=O(o),d=O(d),-1!==o.indexOf(f)||-1!==o.indexOf('"'))continue;if(!t.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(d)))continue;"font-weight"===o&&"700"===d?d="bold":"color"!==o&&"background-color"!==o||(d=d.toLowerCase()),d=(d=d.replace(u,Ni)).replace(a,_),b[o]=m?k(d,!0):d}x("border","",!0),x("border","-width"),x("border","-color"),x("border","-style"),x("padding",""),x("margin",""),g="border",p="border-style",v="border-color",C(h="border-width")&&C(p)&&C(v)&&(b[g]=b[h]+" "+b[p]+" "+b[v],delete b[h],delete b[p],delete b[v]),"medium none"===b.border&&delete b.border,"none"===b["border-image"]&&delete b["border-image"]}return b},serialize:function(t,e){var n="",i=function(e){var o,i=r[e];if(i)for(var u=0,a=i.length;u<a;u++)e=i[u],(o=t[e])&&(n+=(n.length>0?" ":"")+e+": "+o+";")};return e&&r?(i("*"),i(e)):mt(t,(function(t,r){!t||o&&!function(t,e){var n=o["*"];return!(n&&n[t]||(n=o[e])&&n[t])}(r,e)||(n+=(n.length>0?" ":"")+r+": "+t+";")})),n}}},Pi={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},Ii=function(t){return t instanceof Event||y(t.initEvent)},Li=function(t,e,n,r){var o,i=function(t,e){var n=null!=e?e:{};for(var r in t)xt(Pi,r)||(n[r]=t[r]);return b(n.composedPath)&&(n.composedPath=function(){return t.composedPath()}),n}(e,r);return i.type=t,v(i.target)&&(i.target=null!==(o=i.srcElement)&&void 0!==o?o:n),function(t){return v(t.preventDefault)||Ii(t)}(e)&&(i.preventDefault=function(){i.defaultPrevented=!0,i.isDefaultPrevented=N,y(e.preventDefault)?e.preventDefault():Ii(e)&&(e.returnValue=!1)},i.stopPropagation=function(){i.cancelBubble=!0,i.isPropagationStopped=N,y(e.stopPropagation)?e.stopPropagation():Ii(e)&&(e.cancelBubble=!0)},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=N,i.stopPropagation()},function(t){return t.isDefaultPrevented===N||t.isDefaultPrevented===R}(i)||(i.isDefaultPrevented=!0===i.defaultPrevented?N:R,i.isPropagationStopped=!0===i.cancelBubble?N:R,i.isImmediatePropagationStopped=R)),i},Hi=/^(?:mouse|contextmenu)|click/,Vi=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},Fi=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},ji=function(t,e){var n=Li(t.type,t,document,e);if(function(t){return b(t)&&Hi.test(t.type)}(t)&&p(t.pageX)&&!p(t.clientX)){var r=n.target.ownerDocument||document,o=r.documentElement,i=r.body,u=n;u.pageX=t.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),u.pageY=t.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0)}return p(n.metaKey)&&(n.metaKey=!1),n},Ui=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function(){Fi(t,"DOMContentLoaded",i),Fi(t,"load",i),n.domLoaded||(n.domLoaded=!0,e(o)),t=null};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():Vi(t,"DOMContentLoaded",i),n.domLoaded||Vi(t,"load",i)}},Wi=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}return t.prototype.bind=function(t,e,n,r){var o,i,u,a,c,s,l,f=this,d=window,m=function(t){f.executeHandlers(ji(t||d.event),o)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[f.expando]?o=t[f.expando]:(o=f.count++,t[f.expando]=o,f.events[o]={}),r=r||t;var g=e.split(" ");for(u=g.length;u--;)s=m,c=l=!1,"DOMContentLoaded"===(a=g[u])&&(a="ready"),f.domLoaded&&"ready"===a&&"complete"===t.readyState?n.call(r,ji({type:a})):(f.hasMouseEnterLeave||(c=f.mouseEnterLeave[a])&&(s=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else for(;n&&n!==e;)n=n.parentNode;n||((t=ji(t||d.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,f.executeHandlers(t,o))}),f.hasFocusIn||"focusin"!==a&&"focusout"!==a||(l=!0,c="focusin"===a?"focus":"blur",s=function(t){(t=ji(t||d.event)).type="focus"===t.type?"focusin":"focusout",f.executeHandlers(t,o)}),(i=f.events[o][a])?"ready"===a&&f.domLoaded?n(ji({type:a})):i.push({func:n,scope:r}):(f.events[o][a]=i=[{func:n,scope:r}],i.fakeName=c,i.capture=l,i.nativeHandler=s,"ready"===a?Ui(t,s,f):Vi(t,c||a,s,l)));return t=i=null,n}},t.prototype.unbind=function(t,e,n){var r,o,i,u,a;if(!t||3===t.nodeType||8===t.nodeType)return this;var c=t[this.expando];if(c){if(a=this.events[c],e){var s=e.split(" ");for(o=s.length;o--;)if(r=a[u=s[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var l=r.nativeHandler,f=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=l,r.fakeName=f,r.capture=d,a[u]=r}n&&0!==r.length||(delete a[u],Fi(t,r.fakeName||u,r.nativeHandler,r.capture))}}else mt(a,(function(e,n){Fi(t,e.fakeName||n,e.nativeHandler,e.capture)})),a={};for(u in a)if(xt(a,u))return this;delete this.events[c];try{delete t[this.expando]}catch(m){t[this.expando]=null}}return this},t.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;var o=ji({type:e,target:t},n);do{(r=t[this.expando])&&this.executeHandlers(o,r),t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow}while(t&&!o.isPropagationStopped());return this},t.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),t.getElementsByTagName||(t=t.document),t&&t.getElementsByTagName)for(this.unbind(t),e=(n=t.getElementsByTagName("*")).length;e--;)(t=n[e])[this.expando]&&this.unbind(t);return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o<i;o++){var u=r[o];if(u&&!1===u.func.call(u.scope,t)&&t.preventDefault(),t.isImmediatePropagationStopped())return}},t.Event=new t,t}(),qi="sizzle"+-new Date,$i=window.document,Gi=0,Ki=0,Xi=Eu(),Yi=Eu(),Ji=Eu(),Qi=function(t,e){return t===e&&(Wr=!0),0},Zi="undefined",tu=1<<31,eu={}.hasOwnProperty,nu=[],ru=nu.pop,ou=nu.push,iu=nu.push,uu=nu.slice,au=nu.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},cu="[\\x20\\t\\r\\n\\f]",su="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",lu="\\[[\\x20\\t\\r\\n\\f]*("+su+")(?:"+cu+"*([*^$|!~]?=)"+cu+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+su+"))|)"+cu+"*\\]",fu=":("+su+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+lu+")*)|.*)\\)|)",du=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),mu=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),gu=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),hu=new RegExp("=[\\x20\\t\\r\\n\\f]*([^\\]'\"]*?)[\\x20\\t\\r\\n\\f]*\\]","g"),pu=new RegExp(fu),vu=new RegExp("^"+su+"$"),bu={ID:new RegExp("^#("+su+")"),CLASS:new RegExp("^\\.("+su+")"),TAG:new RegExp("^("+su+"|[*])"),ATTR:new RegExp("^"+lu),PSEUDO:new RegExp("^"+fu),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},yu=/^(?:input|select|textarea|button)$/i,wu=/^h\d$/i,xu=/^[^{]+\{\s*\[native \w/,Cu=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Su=/[+~]/,ku=/'|\\/g,Tu=new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)","ig"),Ou=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{iu.apply(nu=uu.call($i.childNodes),$i.childNodes),nu[$i.childNodes.length].nodeType}catch(i_){iu={apply:nu.length?function(t,e){ou.apply(t,uu.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var _u=function(t,e,n,r){var o,i,u,a,c,s,l,f,d,m;if((e?e.ownerDocument||e:$i)!==$r&&qr(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(a=(e=e||$r).nodeType)&&9!==a)return[];if(Kr&&!r){if(o=Cu.exec(t))if(u=o[1]){if(9===a){if(!(i=e.getElementById(u))||!i.parentNode)return n;if(i.id===u)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(u))&&Jr(e,i)&&i.id===u)return n.push(i),n}else{if(o[2])return iu.apply(n,e.getElementsByTagName(t)),n;if((u=o[3])&&Br.getElementsByClassName)return iu.apply(n,e.getElementsByClassName(u)),n}if(Br.qsa&&(!Xr||!Xr.test(t))){if(f=l=qi,d=e,m=9===a&&t,1===a&&"object"!==e.nodeName.toLowerCase()){for(s=Hr(t),(l=e.getAttribute("id"))?f=l.replace(ku,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",c=s.length;c--;)s[c]=f+Nu(s[c]);d=Su.test(t)&&zu(e.parentNode)||e,m=s.join(",")}if(m)try{return iu.apply(n,d.querySelectorAll(m)),n}catch(g){}finally{l||e.removeAttribute("id")}}}return Fr(t.replace(du,"$1"),e,n,r)};function Eu(){var t=[];return function e(n,r){return t.push(n+" ")>Pr.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function Du(t){return t[qi]=!0,t}function Au(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||tu)-(~t.sourceIndex||tu);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function Mu(t){return Du((function(e){return e=+e,Du((function(n,r){for(var o,i=t([],n.length,e),u=i.length;u--;)n[o=i[u]]&&(n[o]=!(r[o]=n[o]))}))}))}function zu(t){return t&&typeof t.getElementsByTagName!==Zi&&t}function Ru(){}function Nu(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function Bu(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=Ki++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,u){var a,c,s=[Gi,i];if(u){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,u))return!0}else for(;e=e[r];)if(1===e.nodeType||o){if((a=(c=e[qi]||(e[qi]={}))[r])&&a[0]===Gi&&a[1]===i)return s[2]=a[2];if(c[r]=s,s[2]=t(e,n,u))return!0}}}function Pu(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function Iu(t,e,n,r,o){for(var i,u=[],a=0,c=t.length,s=null!=e;a<c;a++)(i=t[a])&&(n&&!n(i,r,o)||(u.push(i),s&&e.push(a)));return u}function Lu(t,e,n,r,o,i){return r&&!r[qi]&&(r=Lu(r)),o&&!o[qi]&&(o=Lu(o,i)),Du((function(i,u,a,c){var s,l,f,d=[],m=[],g=u.length,h=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)_u(t,e[r],n);return n}(e||"*",a.nodeType?[a]:a,[]),p=!t||!i&&e?h:Iu(h,d,t,a,c),v=n?o||(i?t:g||r)?[]:u:p;if(n&&n(p,v,a,c),r)for(s=Iu(v,m),r(s,[],a,c),l=s.length;l--;)(f=s[l])&&(v[m[l]]=!(p[m[l]]=f));if(i){if(o||t){if(o){for(s=[],l=v.length;l--;)(f=v[l])&&s.push(p[l]=f);o(null,v=[],s,c)}for(l=v.length;l--;)(f=v[l])&&(s=o?au.call(i,f):d[l])>-1&&(i[s]=!(u[s]=f))}}else v=Iu(v===u?v.splice(g,v.length):v),o?o(null,u,v,c):iu.apply(u,v)}))}function Hu(t){for(var e,n,r,o=t.length,i=Pr.relative[t[0].type],u=i||Pr.relative[" "],a=i?1:0,c=Bu((function(t){return t===e}),u,!0),s=Bu((function(t){return au.call(e,t)>-1}),u,!0),l=[function(t,n,r){var o=!i&&(r||n!==jr)||((e=n).nodeType?c(t,n,r):s(t,n,r));return e=null,o}];a<o;a++)if(n=Pr.relative[t[a].type])l=[Bu(Pu(l),n)];else{if((n=Pr.filter[t[a].type].apply(null,t[a].matches))[qi]){for(r=++a;r<o&&!Pr.relative[t[r].type];r++);return Lu(a>1&&Pu(l),a>1&&Nu(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(du,"$1"),n,a<r&&Hu(t.slice(a,r)),r<o&&Hu(t=t.slice(r)),r<o&&Nu(t))}l.push(n)}return Pu(l)}Br=_u.support={},Lr=_u.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},qr=_u.setDocument=function(t){var e,n=t?t.ownerDocument||t:$i,r=n.defaultView;return n!==$r&&9===n.nodeType&&n.documentElement?($r=n,Gr=n.documentElement,Kr=!Lr(n),r&&r!==function(t){try{return t.top}catch(e){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){qr()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){qr()}))),Br.attributes=!0,Br.getElementsByTagName=!0,Br.getElementsByClassName=xu.test(n.getElementsByClassName),Br.getById=!0,Pr.find.ID=function(t,e){if(typeof e.getElementById!==Zi&&Kr){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},Pr.filter.ID=function(t){var e=t.replace(Tu,Ou);return function(t){return t.getAttribute("id")===e}},Pr.find.TAG=Br.getElementsByTagName?function(t,e){if(typeof e.getElementsByTagName!==Zi)return e.getElementsByTagName(t)}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},Pr.find.CLASS=Br.getElementsByClassName&&function(t,e){if(Kr)return e.getElementsByClassName(t)},Yr=[],Xr=[],Br.disconnectedMatch=!0,Xr=Xr.length&&new RegExp(Xr.join("|")),Yr=Yr.length&&new RegExp(Yr.join("|")),e=xu.test(Gr.compareDocumentPosition),Jr=e||xu.test(Gr.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Qi=e?function(t,e){if(t===e)return Wr=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!Br.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===$i&&Jr($i,t)?-1:e===n||e.ownerDocument===$i&&Jr($i,e)?1:Ur?au.call(Ur,t)-au.call(Ur,e):0:4&r?-1:1)}:function(t,e){if(t===e)return Wr=!0,0;var r,o=0,i=t.parentNode,u=e.parentNode,a=[t],c=[e];if(!i||!u)return t===n?-1:e===n?1:i?-1:u?1:Ur?au.call(Ur,t)-au.call(Ur,e):0;if(i===u)return Au(t,e);for(r=t;r=r.parentNode;)a.unshift(r);for(r=e;r=r.parentNode;)c.unshift(r);for(;a[o]===c[o];)o++;return o?Au(a[o],c[o]):a[o]===$i?-1:c[o]===$i?1:0},n):$r},_u.matches=function(t,e){return _u(t,null,null,e)},_u.matchesSelector=function(t,e){if((t.ownerDocument||t)!==$r&&qr(t),e=e.replace(hu,"='$1']"),Br.matchesSelector&&Kr&&(!Yr||!Yr.test(e))&&(!Xr||!Xr.test(e)))try{var n=(void 0).call(t,e);if(n||Br.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(i_){}return _u(e,$r,null,[t]).length>0},_u.contains=function(t,e){return(t.ownerDocument||t)!==$r&&qr(t),Jr(t,e)},_u.attr=function(t,e){(t.ownerDocument||t)!==$r&&qr(t);var n=Pr.attrHandle[e.toLowerCase()],r=n&&eu.call(Pr.attrHandle,e.toLowerCase())?n(t,e,!Kr):void 0;return void 0!==r?r:Br.attributes||!Kr?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},_u.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},_u.uniqueSort=function(t){var e,n=[],r=0,o=0;if(Wr=!Br.detectDuplicates,Ur=!Br.sortStable&&t.slice(0),t.sort(Qi),Wr){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return Ur=null,t},Ir=_u.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=Ir(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=Ir(e);return n},(Pr=_u.selectors={cacheLength:50,createPseudo:Du,match:bu,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Tu,Ou),t[3]=(t[3]||t[4]||t[5]||"").replace(Tu,Ou),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||_u.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&_u.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return bu.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&pu.test(n)&&(e=Hr(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Tu,Ou).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=Xi[t+" "];return e||(e=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+t+"("+cu+"|$)"))&&Xi(t,(function(t){return e.test("string"==typeof t.className&&t.className||typeof t.getAttribute!==Zi&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=_u.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),u="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,c){var s,l,f,d,m,g,h=i!==u?"nextSibling":"previousSibling",p=e.parentNode,v=a&&e.nodeName.toLowerCase(),b=!c&&!a;if(p){if(i){for(;h;){for(f=e;f=f[h];)if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;g=h="only"===t&&!g&&"nextSibling"}return!0}if(g=[u?p.firstChild:p.lastChild],u&&b){for(m=(s=(l=p[qi]||(p[qi]={}))[t]||[])[0]===Gi&&s[1],d=s[0]===Gi&&s[2],f=m&&p.childNodes[m];f=++m&&f&&f[h]||(d=m=0)||g.pop();)if(1===f.nodeType&&++d&&f===e){l[t]=[Gi,m,d];break}}else if(b&&(s=(e[qi]||(e[qi]={}))[t])&&s[0]===Gi)d=s[1];else for(;(f=++m&&f&&f[h]||(d=m=0)||g.pop())&&((a?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(b&&((f[qi]||(f[qi]={}))[t]=[Gi,d]),f!==e)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(t,e){var n,r=Pr.pseudos[t]||Pr.setFilters[t.toLowerCase()]||_u.error("unsupported pseudo: "+t);return r[qi]?r(e):r.length>1?(n=[t,t,"",e],Pr.setFilters.hasOwnProperty(t.toLowerCase())?Du((function(t,n){for(var o,i=r(t,e),u=i.length;u--;)t[o=au.call(t,i[u])]=!(n[o]=i[u])})):function(t){return r(t,0,n)}):r}},pseudos:{not:Du((function(t){var e=[],n=[],r=Vr(t.replace(du,"$1"));return r[qi]?Du((function(t,e,n,o){for(var i,u=r(t,null,o,[]),a=t.length;a--;)(i=u[a])&&(t[a]=!(e[a]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),e[0]=null,!n.pop()}})),has:Du((function(t){return function(e){return _u(t,e).length>0}})),contains:Du((function(t){return t=t.replace(Tu,Ou),function(e){return(e.textContent||e.innerText||Ir(e)).indexOf(t)>-1}})),lang:Du((function(t){return vu.test(t||"")||_u.error("unsupported lang: "+t),t=t.replace(Tu,Ou).toLowerCase(),function(e){var n;do{if(n=Kr?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=window.location&&window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===Gr},focus:function(t){return t===$r.activeElement&&(!$r.hasFocus||$r.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!Pr.pseudos.empty(t)},header:function(t){return wu.test(t.nodeName)},input:function(t){return yu.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:Mu((function(){return[0]})),last:Mu((function(t,e){return[e-1]})),eq:Mu((function(t,e,n){return[n<0?n+e:n]})),even:Mu((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:Mu((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:Mu((function(t,e,n){for(var r=n<0?n+e:n;--r>=0;)t.push(r);return t})),gt:Mu((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}}).pseudos.nth=Pr.pseudos.eq,G(["radio","checkbox","file","password","image"],(function(t){var e;Pr.pseudos[t]=(e=t,function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e})})),G(["submit","reset"],(function(t){var e;Pr.pseudos[t]=(e=t,function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e})})),Ru.prototype=Pr.filters=Pr.pseudos,Pr.setFilters=new Ru,Hr=_u.tokenize=function(t,e){var n,r,o,i,u,a,c,s=Yi[t+" "];if(s)return e?0:s.slice(0);for(u=t,a=[],c=Pr.preFilter;u;){for(i in n&&!(r=mu.exec(u))||(r&&(u=u.slice(r[0].length)||u),a.push(o=[])),n=!1,(r=gu.exec(u))&&(n=r.shift(),o.push({value:n,type:r[0].replace(du," ")}),u=u.slice(n.length)),Pr.filter)Pr.filter.hasOwnProperty(i)&&(!(r=bu[i].exec(u))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),u=u.slice(n.length)));if(!n)break}return e?u.length:u?_u.error(t):Yi(t,a).slice(0)},Vr=_u.compile=function(t,e){var n,r=[],o=[],i=Ji[t+" "];if(!i){for(e||(e=Hr(t)),n=e.length;n--;)(i=Hu(e[n]))[qi]?r.push(i):o.push(i);(i=Ji(t,function(t,e){var n=e.length>0,r=t.length>0,o=function(o,i,u,a,c){var s,l,f,d=0,m="0",g=o&&[],h=[],p=jr,v=o||r&&Pr.find.TAG("*",c),b=Gi+=null==p?1:Math.random()||.1,y=v.length;for(c&&(jr=i!==$r&&i);m!==y&&null!=(s=v[m]);m++){if(r&&s){for(l=0;f=t[l++];)if(f(s,i,u)){a.push(s);break}c&&(Gi=b)}n&&((s=!f&&s)&&d--,o&&g.push(s))}if(d+=m,n&&m!==d){for(l=0;f=e[l++];)f(g,h,i,u);if(o){if(d>0)for(;m--;)g[m]||h[m]||(h[m]=ru.call(a));h=Iu(h)}iu.apply(a,h),c&&!o&&h.length>0&&d+e.length>1&&_u.uniqueSort(a)}return c&&(Gi=b,jr=p),g};return n?Du(o):o}(o,r))).selector=t}return i},Fr=_u.select=function(t,e,n,r){var o,i,u,a,c,s="function"==typeof t&&t,l=!r&&Hr(t=s.selector||t);if(n=n||[],1===l.length){if((i=l[0]=l[0].slice(0)).length>2&&"ID"===(u=i[0]).type&&Br.getById&&9===e.nodeType&&Kr&&Pr.relative[i[1].type]){if(!(e=(Pr.find.ID(u.matches[0].replace(Tu,Ou),e)||[])[0]))return n;s&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=bu.needsContext.test(t)?0:i.length;o--&&(u=i[o],!Pr.relative[a=u.type]);)if((c=Pr.find[a])&&(r=c(u.matches[0].replace(Tu,Ou),Su.test(i[0].type)&&zu(e.parentNode)||e))){if(i.splice(o,1),!(t=r.length&&Nu(i)))return iu.apply(n,r),n;break}}return(s||Vr(t,l))(r,e,!Kr,n,Su.test(t)&&zu(e.parentNode)||e),n},Br.sortStable=qi.split("").sort(Qi).join("")===qi,Br.detectDuplicates=!!Wr,qr(),Br.sortDetached=!0;var Vu=document,Fu=Array.prototype.push,ju=Array.prototype.slice,Uu=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Wu=Wi.Event,qu=De.makeMap("children,contents,next,prev"),$u=function(t){return void 0!==t},Gu=function(t){return"string"==typeof t},Ku=function(t,e){var n,r=(e=e||Vu).createElement("div"),o=e.createDocumentFragment();for(r.innerHTML=t;n=r.firstChild;)o.appendChild(n);return o},Xu=function(t,e,n,r){var o;if(Gu(e))e=Ku(e,sa(t[0]));else if(e.length&&!e.nodeType){if(e=ma.makeArray(e),r)for(o=e.length-1;o>=0;o--)Xu(t,e[o],n,r);else for(o=0;o<e.length;o++)Xu(t,e[o],n,r);return t}if(e.nodeType)for(o=t.length;o--;)n.call(t[o],e);return t},Yu=function(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")},Ju=function(t,e,n){var r,o;return e=ma(e)[0],t.each((function(){var t=this;n&&r===t.parentNode||(r=t.parentNode,o=e.cloneNode(!1),t.parentNode.insertBefore(o,t)),o.appendChild(t)})),t},Qu=De.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Zu=De.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),ta={for:"htmlFor",class:"className",readonly:"readOnly"},ea={float:"cssFloat"},na={},ra={},oa=function(t,e){return new ma.fn.init(t,e)},ia=/^\s*|\s*$/g,ua=function(t){return null==t?"":(""+t).replace(ia,"")},aa=function(t,e){var n,r,o,i;if(t)if(void 0===(n=t.length)){for(r in t)if(t.hasOwnProperty(r)&&(i=t[r],!1===e.call(i,r,i)))break}else for(o=0;o<n&&(i=t[o],!1!==e.call(i,o,i));o++);return t},ca=function(t,e){var n=[];return aa(t,(function(t,r){e(r,t)&&n.push(r)})),n},sa=function(t){return t?9===t.nodeType?t:t.ownerDocument:Vu};oa.fn=oa.prototype={constructor:oa,selector:"",context:null,length:0,init:function(t,e){var n,r,o=this;if(!t)return o;if(t.nodeType)return o.context=o[0]=t,o.length=1,o;if(e&&e.nodeType)o.context=e;else{if(e)return ma(t).attr(e);o.context=e=document}if(Gu(t)){if(o.selector=t,!(n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:Uu.exec(t)))return ma(e).find(t);if(n[1])for(r=Ku(t,sa(e)).firstChild;r;)Fu.call(o,r),r=r.nextSibling;else{if(!(r=sa(e).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(t);o.length=1,o[0]=r}}else this.add(t,!1);return o},toArray:function(){return De.toArray(this)},add:function(t,e){var n,r,o=this;if(Gu(t))return o.add(ma(t));if(!1!==e)for(n=ma.unique(o.toArray().concat(ma.makeArray(t))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else Fu.apply(o,ma.makeArray(t));return o},attr:function(t,e){var n,r=this;if("object"==typeof t)aa(t,(function(t,e){r.attr(t,e)}));else{if(!$u(e)){if(r[0]&&1===r[0].nodeType){if((n=na[t])&&n.get)return n.get(r[0],t);if(Zu[t])return r.prop(t)?t:void 0;null===(e=r[0].getAttribute(t,2))&&(e=void 0)}return e}this.each((function(){var n;if(1===this.nodeType){if((n=na[t])&&n.set)return void n.set(this,e);null===e?this.removeAttribute(t,2):this.setAttribute(t,e,2)}}))}return r},removeAttr:function(t){return this.attr(t,null)},prop:function(t,e){var n=this;if("object"==typeof(t=ta[t]||t))aa(t,(function(t,e){n.prop(t,e)}));else{if(!$u(e))return n[0]&&n[0].nodeType&&t in n[0]?n[0][t]:e;this.each((function(){1===this.nodeType&&(this[t]=e)}))}return n},css:function(t,e){var n,r,o=this,i=function(t){return t.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()}))},u=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t}))};if("object"==typeof t)aa(t,(function(t,e){o.css(t,e)}));else if($u(e))t=i(t),"number"!=typeof e||Qu[t]||(e=e.toString()+"px"),o.each((function(){var n=this.style;if((r=ra[t])&&r.set)r.set(this,e);else{try{this.style[ea[t]||t]=e}catch(o){}null!==e&&""!==e||(n.removeProperty?n.removeProperty(u(t)):n.removeAttribute(t))}}));else{if(n=o[0],(r=ra[t])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(t)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(u(t))}catch(a){return}}return o},remove:function(){for(var t,e=this.length;e--;)t=this[e],Wu.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var t,e=this.length;e--;)for(t=this[e];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(t){var e,n=this;if($u(t)){e=n.length;try{for(;e--;)n[e].innerHTML=t}catch(r){ma(n[e]).empty().append(t)}return n}return n[0]?n[0].innerHTML:""},text:function(t){var e,n=this;if($u(t)){for(e=n.length;e--;)"innerText"in n[e]?n[e].innerText=t:n[0].textContent=t;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return Xu(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)}))},prepend:function(){return Xu(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(t,this.firstChild)}),!0)},before:function(){var t=this;return t[0]&&t[0].parentNode?Xu(t,arguments,(function(t){this.parentNode.insertBefore(t,this)})):t},after:function(){var t=this;return t[0]&&t[0].parentNode?Xu(t,arguments,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}),!0):t},appendTo:function(t){return ma(t).append(this),this},prependTo:function(t){return ma(t).prepend(this),this},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return Ju(this,t)},wrapAll:function(t){return Ju(this,t,!0)},wrapInner:function(t){return this.each((function(){ma(this).contents().wrapAll(t)})),this},unwrap:function(){return this.parent().each((function(){ma(this).replaceWith(this.childNodes)}))},clone:function(){var t=[];return this.each((function(){t.push(this.cloneNode(!0))})),ma(t)},addClass:function(t){return this.toggleClass(t,!0)},removeClass:function(t){return this.toggleClass(t,!1)},toggleClass:function(t,e){var n=this;return"string"!=typeof t||(-1!==t.indexOf(" ")?aa(t.split(" "),(function(){n.toggleClass(this,e)})):n.each((function(n,r){var o=Yu(r,t);if(o!==e){var i=r.className;o?r.className=ua((" "+i+" ").replace(" "+t+" "," ")):r.className+=i?" "+t:t}}))),n},hasClass:function(t){return Yu(this[0],t)},each:function(t){return aa(this,t)},on:function(t,e){return this.each((function(){Wu.bind(this,t,e)}))},off:function(t,e){return this.each((function(){Wu.unbind(this,t,e)}))},trigger:function(t){return this.each((function(){"object"==typeof t?Wu.fire(this,t.type,t):Wu.fire(this,t)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return ma(ju.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(t){var e,n,r=[];for(e=0,n=this.length;e<n;e++)ma.find(t,this[e],r);return ma(r)},filter:function(t){return ma("function"==typeof t?ca(this.toArray(),(function(e,n){return t(n,e)})):ma.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof ma&&(t=t[0]),this.each((function(n,r){for(;r;){if("string"==typeof t&&ma(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}})),ma(e)},offset:function(t){var e,n,r,o,i=0,u=0;return t?this.css(t):((e=this[0])&&(r=(n=e.ownerDocument).documentElement,e.getBoundingClientRect&&(i=(o=e.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,u=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:u})},push:Fu,sort:Array.prototype.sort,splice:Array.prototype.splice},De.extend(oa,{extend:De.extend,makeArray:function(t){return(e=t)&&e===e.window||t.nodeType?[t]:De.toArray(t);var e},inArray:function(t,e){var n;if(e.indexOf)return e.indexOf(t);for(n=e.length;n--;)if(e[n]===t)return n;return-1},isArray:De.isArray,each:aa,trim:ua,grep:ca,find:_u,expr:_u.selectors,unique:_u.uniqueSort,text:_u.getText,contains:_u.contains,filter:function(t,e,n){var r=e.length;for(n&&(t=":not("+t+")");r--;)1!==e[r].nodeType&&e.splice(r,1);return e=1===e.length?ma.find.matchesSelector(e[0],t)?[e[0]]:[]:ma.find.matches(t,e)}});var la=function(t,e,n){var r=[],o=t[e];for("string"!=typeof n&&n instanceof ma&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&ma(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r},fa=function(t,e,n,r){var o=[];for(r instanceof ma&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"==typeof r&&ma(t).is(r))break}o.push(t)}return o},da=function(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null};aa({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return la(t,"parentNode")},next:function(t){return da(t,"nextSibling",1)},prev:function(t){return da(t,"previousSibling",1)},children:function(t){return fa(t.firstChild,"nextSibling",1)},contents:function(t){return De.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},(function(t,e){oa.fn[t]=function(n){var r=[];this.each((function(){var t=e.call(r,this,n,r);t&&(ma.isArray(t)?r.push.apply(r,t):r.push(t))})),this.length>1&&(qu[t]||(r=ma.unique(r)),0===t.indexOf("parents")&&(r=r.reverse()));var o=ma(r);return n?o.filter(n):o}})),aa({parentsUntil:function(t,e){return la(t,"parentNode",e)},nextUntil:function(t,e){return fa(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return fa(t,"previousSibling",1,e).slice(1)}},(function(t,e){oa.fn[t]=function(n,r){var o=[];this.each((function(){var t=e.call(o,this,n,o);t&&(ma.isArray(t)?o.push.apply(o,t):o.push(t))})),this.length>1&&(o=ma.unique(o),0!==t.indexOf("parents")&&"prevUntil"!==t||(o=o.reverse()));var i=ma(o);return r?i.filter(r):i}})),oa.fn.is=function(t){return!!t&&this.filter(t).length>0},oa.fn.init.prototype=oa.fn,oa.overrideDefaults=function(t){var e,n=function(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o||(o=e.context),new n.fn.init(r,o)};return ma.extend(n,this),n},oa.attrHooks=na,oa.cssHooks=ra;var ma=oa,ga=De.each,ha=De.grep,pa=ke.ie,va=/^([a-z0-9],?)+$/i,ba=function(t,e){var n=e.attr("style"),r=t.serialize(t.parse(n),e[0].nodeName);r||(r=null),e.attr("data-mce-style",r)},ya=function(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o},wa=function(t,e){void 0===e&&(e={});var n={},r=window,o={},i=0,u=lo.forElement(Me.fromDom(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),a=[],c=e.schema?e.schema:Ri({}),s=Bi({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),l=e.ownEvents?new Wi:Wi.Event,d=c.getBlockElements(),m=ma.overrideDefaults((function(){return{context:t,element:U.getRoot()}})),g=function(e){return e&&t&&f(e)?t.getElementById(e):e},h=function(t){return m("string"==typeof t?g(t):t)},p=function(t,e,n){var r,o,i=h(t);return i.length&&(o=(r=W[e])&&r.get?r.get(i,e):i.attr(e)),void 0===o&&(o=n||""),o},b=function(t){var e=g(t);return e?e.attributes:[]},y=function(t,n,r){""===r&&(r=null);var o=h(t),i=o.attr(n);if(o.length){var u=W[n];u&&u.set?u.set(o,r,n):o.attr(n,r),i!==r&&e.onSetAttrib&&e.onSetAttrib({attrElm:o,attrName:n,attrValue:r})}},w=function(){return e.root_element||t.body},C=function(e,n){return hr(t.body,g(e),n)},S=function(t,e,n){var r=h(t);return n?r.css(e):("float"===(e=e.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()})))&&(e=ke.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[e]:void 0)},T=function(t){var e,n;return t=g(t),e=S(t,"width"),n=S(t,"height"),-1===e.indexOf("px")&&(e=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},O=function(t,e){var n;if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(va.test(e)){var r=e.toLowerCase().split(/,/),o=t.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return _u(e,i[0].ownerDocument||i[0],null,i).length>0},_=function(t,e,n,r){var o,i=[],u=g(t);for(r=void 0===r,n=n||("BODY"!==w().nodeName?w().parentNode:null),De.is(e,"string")&&(o=e,e="*"===e?function(t){return 1===t.nodeType}:function(t){return O(t,o)});u&&!(u===n||v(u.nodeType)||Wn(u)||qn(u));){if(!e||"function"==typeof e&&e(u)){if(!r)return[u];i.push(u)}u=u.parentNode}return r?i:null},E=function(t,e,n){var r=e;if(t)for("string"==typeof e&&(r=function(t){return O(t,e)}),t=t[n];t;t=t[n])if("function"==typeof r&&r(t))return t;return null},D=function(t,e,n){var r,o="string"==typeof t?g(t):t;if(!o)return!1;if(De.isArray(o)&&(o.length||0===o.length))return r=[],ga(o,(function(t,o){t&&r.push(e.call(n,"string"==typeof t?g(t):t,o))})),r;var i=n||this;return e.call(i,o)},A=function(t,e){h(t).each((function(t,n){ga(e,(function(t,e){y(n,e,t)}))}))},M=function(t,e){var n=h(t);pa?n.each((function(t,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+e,n.removeChild(n.firstChild)}catch(r){ma("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},z=function(e,n,r,o,i){return D(e,(function(e){var u="string"==typeof n?t.createElement(n):n;return A(u,r),o&&("string"!=typeof o&&o.nodeType?u.appendChild(o):"string"==typeof o&&M(u,o)),i?u:e.appendChild(u)}))},R=function(e,n,r){return z(t.createElement(e),e,n,r,!0)},N=Si.encodeAllRaw,B=function(t,e){var n=h(t);return e?n.each((function(){for(var t;t=this.firstChild;)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)})).remove():n.remove(),n.length>1?n.toArray():n[0]},P=function(t,e,n){h(t).toggleClass(e,n).each((function(){""===this.className&&ma(this).attr("class",null)}))},I=function(t,e,n){return D(e,(function(e){return De.is(e,"array")&&(t=t.cloneNode(!0)),n&&ga(ha(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},L=function(t){if(Nn(t)){var e="a"===t.nodeName.toLowerCase()&&!p(t,"href")&&p(t,"id");if(p(t,"name")||p(t,"data-mce-bookmark")||e)return!0}return!1},H=function(){return t.createRange()},V=function(n,o,i,u){if(De.isArray(n)){for(var c=n.length,s=[];c--;)s[c]=V(n[c],o,i,u);return s}return!e.collect||n!==t&&n!==r||a.push([n,o,i,u]),l.bind(n,o,i,u||U)},F=function(e,n,o){if(De.isArray(e)){for(var i=e.length,u=[];i--;)u[i]=F(e[i],n,o);return u}if(a.length>0&&(e===t||e===r))for(i=a.length;i--;){var c=a[i];e!==c[0]||n&&n!==c[1]||o&&o!==c[2]||l.unbind(c[0],c[1],c[2])}return l.unbind(e,n,o)},j=function(t){if(t&&Nn(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},U={doc:t,settings:e,win:r,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:u,boundEvents:a,styles:s,schema:c,events:l,isBlock:function(t){if("string"==typeof t)return!!d[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!d[t.nodeName])}return!1},$:m,$$:h,root:null,clone:function(e,n){if(!pa||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return ga(b(e),(function(t){y(r,t.nodeName,p(e,t.nodeName))})),r},getRoot:w,getViewPort:function(t){var e=Mn(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},getRect:function(t){t=g(t);var e=C(t),n=T(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},getSize:T,getParent:function(t,e,n){var r=_(t,e,n,!1);return r&&r.length>0?r[0]:null},getParents:_,get:g,getNext:function(t,e){return E(t,e,"nextSibling")},getPrev:function(t,e){return E(t,e,"previousSibling")},select:function(n,r){return _u(n,g(r)||e.root_element||t,[])},is:O,add:z,create:R,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)Ct(e,r)&&(o+=" "+r+'="'+N(e[r])+'"');return void 0!==n?o+">"+n+"</"+t+">":o+" />"},createFragment:function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();for(o.appendChild(r),e&&(r.innerHTML=e);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:B,setStyle:function(t,n,r){var o=f(n)?h(t).css(n,r):h(t).css(n);e.update_styles&&ba(s,o)},getStyle:S,setStyles:function(t,n){var r=h(t).css(n);e.update_styles&&ba(s,r)},removeAllAttribs:function(t){return D(t,(function(t){var e,n=t.attributes;for(e=n.length-1;e>=0;e--)t.removeAttributeNode(n.item(e))}))},setAttrib:y,setAttribs:A,getAttrib:p,getPos:C,parseStyle:function(t){return s.parse(t)},serializeStyle:function(t,e){return s.serialize(t,e)},addStyle:function(e){var r,o;if(U!==wa.DOM&&t===document){if(n[e])return;n[e]=!0}(o=t.getElementById("mceDefaultStyles"))||((o=t.createElement("style")).id="mceDefaultStyles",o.type="text/css",(r=t.getElementsByTagName("head")[0]).firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(t.createTextNode(e))},loadCSS:function(t){t||(t=""),G(t.split(","),(function(t){o[t]=!0,u.load(t,x)}))},addClass:function(t,e){h(t).addClass(e)},removeClass:function(t,e){P(t,e,!1)},hasClass:function(t,e){return h(t).hasClass(e)},toggleClass:P,show:function(t){h(t).show()},hide:function(t){h(t).hide()},isHidden:function(t){return"none"===h(t).css("display")},uniqueId:function(t){return(t||"mce_")+i++},setHTML:M,getOuterHTML:function(t){var e="string"==typeof t?g(t):t;return Nn(e)?e.outerHTML:ma("<div></div>").append(ma(e).clone()).html()},setOuterHTML:function(t,e){h(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}B(ma(this).html(e),!0)}))},decode:Si.decode,encode:N,insertAfter:function(t,e){var n=g(e);return D(t,(function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t}))},replace:I,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=R(e),ga(b(t),(function(e){y(n,e.nodeName,p(t,e.nodeName))})),I(n,t,!0)),n||t},findCommonAncestor:function(t,e){for(var n,r=t;r;){for(n=e;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},toHex:function(t){return s.toHex(De.trim(t))},run:D,getAttribs:b,isEmpty:function(t,e){var n,r,o=0;if(L(t))return!1;if(t=t.firstChild){var i=new fo(t,t.parentNode),u=c?c.getWhiteSpaceElements():{};e=e||(c?c.getNonEmptyElements():null);do{if(n=t.nodeType,Nn(t)){var a=t.getAttribute("data-mce-bogus");if(a){t=i.next("all"===a);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"===r){o++,t=i.next();continue}return!1}if(L(t))return!1}if(8===n)return!1;if(3===n&&!Zo(t.nodeValue))return!1;if(3===n&&t.parentNode&&u[t.parentNode.nodeName]&&Zo(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},createRng:H,nodeIndex:ya,split:function(t,e,n){var r,o,i,u=H();if(t&&e)return u.setStart(t.parentNode,ya(t)),u.setEnd(e.parentNode,ya(e)),r=u.extractContents(),(u=H()).setStart(e.parentNode,ya(e)+1),u.setEnd(t.parentNode,ya(t)+1),o=u.extractContents(),(i=t.parentNode).insertBefore(si(U,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(si(U,o),t),B(t),n||e},bind:V,unbind:F,fire:function(t,e,n){return l.fire(t,e,n)},getContentEditable:j,getContentEditableParent:function(t){for(var e=w(),n=null;t&&t!==e&&null===(n=j(t));t=t.parentNode);return n},destroy:function(){if(a.length>0)for(var t=a.length;t--;){var e=a[t];l.unbind(e[0],e[1],e[2])}mt(o,(function(t,e){u.unload(e),delete o[e]})),_u.setDocument&&_u.setDocument()},isChildOf:function(t,e){if(pa){for(;t;){if(e===t)return!0;t=t.parentNode}return!1}return t===e||e.contains(t)},dumpRng:function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset}},W=function(t,e,n){var r=e.keep_values,o={set:function(t,r,o){e.url_converter&&(r=e.url_converter.call(e.url_converter_scope||n(),r,o,t[0])),t.attr("data-mce-"+o,r).attr(o,r)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},i={style:{set:function(e,n){null===n||"object"!=typeof n?(r&&e.attr("data-mce-style",n),null!==n&&"string"==typeof n?(e.removeAttr("style"),e.css(t.parse(n))):e.attr("style",n)):e.css(n)},get:function(e){var n=e.attr("data-mce-style")||e.attr("style");return t.serialize(t.parse(n),e[0].nodeName)}}};return r&&(i.href=i.src=o),i}(s,e,k(U));return U};wa.DOM=wa(document),wa.nodeIndex=ya;var xa=wa.DOM,Ca=De.each,Sa=De.grep,ka=function(){function t(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}return t.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},t.prototype.loadScript=function(t,e,n){var r,o=xa,i=function(){o.remove(u),r&&(r.onerror=r.onload=r=null)},u=o.uniqueId();(r=document.createElement("script")).id=u,r.type="text/javascript",r.src=De._addCacheSuffix(t),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=function(){i(),e()},r.onerror=function(){i(),y(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)},t.prototype.isDone=function(t){return 2===this.states[t]},t.prototype.markDone=function(t){this.states[t]=2},t.prototype.add=function(t,e,n,r){var o=this.states[t];this.queue.push(t),void 0===o&&(this.states[t]=0),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},t.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},t.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},t.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},t.prototype.loadScripts=function(t,e,n,r){var o=this,i=[],u=function(t,e){Ca(o.scriptLoadedCallbacks[e],(function(e){y(e[t])&&e[t].call(e.scope)})),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var a=function(){var e=Sa(t);if(t.length=0,Ca(e,(function(t){2!==o.states[t]?3!==o.states[t]?1!==o.states[t]&&(o.states[t]=1,o.loading++,o.loadScript(t,(function(){o.states[t]=2,o.loading--,u("success",t),a()}),(function(){o.states[t]=3,o.loading--,i.push(t),u("failure",t),a()}))):u("failure",t):u("success",t)})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,Ca(n,(function(t){0===i.length?y(t.success)&&t.success.call(t.scope):y(t.failure)&&t.failure.call(t.scope,i)}))}};a()},t.ScriptLoader=new t,t}(),Ta=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Oa={},_a=Ta("en"),Ea=function(){return wt(Oa,_a.get())},Da={getData:function(){return gt(Oa,(function(t){return Mt({},t)}))},setCode:function(t){t&&_a.set(t)},getCode:function(){return _a.get()},add:function(t,e){var n=Oa[t];n||(Oa[t]=n={}),mt(e,(function(t,e){n[e.toLowerCase()]=t}))},translate:function(t){var e,n=Ea().getOr({}),r=function(t){return y(t)?Object.prototype.toString.call(t):o(t)?"":""+t},o=function(t){return""===t||null==t},i=function(t){var e=r(t);return wt(n,e.toLowerCase()).map(r).getOr(e)},u=function(t){return t.replace(/{context:\w+}$/,"")};if(o(t))return"";if(d(e=t)&&xt(e,"raw"))return r(t.raw);if(function(t){return m(t)&&t.length>1}(t)){var a=t.slice(1);return u(i(t[0]).replace(/\{([0-9]+)\}/g,(function(t,e){return xt(a,e)?r(a[e]):t})))}return u(i(t))},isRtl:function(){return Ea().bind((function(t){return wt(t,"_dir")})).exists((function(t){return"rtl"===t}))},hasCode:function(t){return xt(Oa,t)}},Aa=function(){var t=[],e={},n={},r=[],o=function(t,e){var n=Y(r,(function(n){return n.name===t&&n.state===e}));G(n,(function(t){return t.callback()}))},i=function(t){var e;return n[t]&&(e=n[t].dependencies),e||[]},u=function(t,e){return"object"==typeof e?e:"string"==typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},a=function(t,r,c,s,l){if(!e[t]){var f="string"==typeof r?r:r.prefix+r.resource+r.suffix;0!==f.indexOf("/")&&-1===f.indexOf("://")&&(f=Aa.baseURL+"/"+f),e[t]=f.substring(0,f.lastIndexOf("/"));var d=function(){o(t,"loaded"),function(t,e,n,r){var o=i(t);G(o,(function(t){var n=u(e,t);a(n.resource,n,void 0,void 0)})),n&&(r?n.call(r):n.call(ka))}(t,r,c,s)};n[t]?d():ka.ScriptLoader.add(f,d,s,l)}},c=function(t,o,i){void 0===i&&(i="added"),xt(n,t)&&"added"===i||xt(e,t)&&"loaded"===i?o():r.push({name:t,state:i,callback:o})};return{items:t,urls:e,lookup:n,_listeners:r,get:function(t){if(n[t])return n[t].instance},dependencies:i,requireLangPack:function(t,n){!1!==Aa.languageLoad&&c(t,(function(){var r=Da.getCode();!r||n&&-1===(","+(n||"")+",").indexOf(","+r+",")||ka.ScriptLoader.add(e[t]+"/langs/"+r+".js")}),"loaded")},add:function(e,r,i){var u=r;return t.push(u),n[e]={instance:u,dependencies:i},o(e,"added"),u},remove:function(t){delete e[t],delete n[t]},createUrl:u,addComponents:function(t,n){var r=e[t];G(n,(function(t){ka.ScriptLoader.add(r+"/"+t)}))},load:a,waitFor:c}};Aa.languageLoad=!0,Aa.baseURL="",Aa.PluginManager=Aa(),Aa.ThemeManager=Aa();var Ma=function(){var t=function(t){var e=Ta(L.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(L.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(L.some(t))}}}(x);return Mt(Mt({},t),{on:function(e){return t.get().each(e)}})},za=function(t,e){var n=null;return{cancel:function(){g(n)||(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];g(n)&&(n=setTimeout((function(){n=null,t.apply(null,r)}),e))}}},Ra=function(t,e){var n=null,r=function(){g(n)||(clearTimeout(n),n=null)};return{cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,t.apply(null,o)}),e)}}},Na=function(t,e){var n=or(t,e);return void 0===n||""===n?[]:n.split(" ")},Ba=function(t){return void 0!==t.dom.classList},Pa=function(t,e){return function(t,e,n){var r=Na(t,e).concat([n]);return nr(t,e,r.join(" ")),!0}(t,"class",e)},Ia=function(t,e){return function(t,e,n){var r=Y(Na(t,e),(function(t){return t!==n}));return r.length>0?nr(t,e,r.join(" ")):ur(t,e),!1}(t,"class",e)},La=function(t,e){Ba(t)?t.dom.classList.add(e):Pa(t,e)},Ha=function(t){0===(Ba(t)?t.dom.classList:function(t){return Na(t,"class")}(t)).length&&ur(t,"class")},Va=function(t,e){return Ba(t)&&t.dom.classList.contains(e)},Fa=function(t,e){var n=[];return G(en(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(Fa(t,e))})),n},ja=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ne(n)?[]:$(n.querySelectorAll(t),Me.fromDom)}(e,t)},Ua=k("mce-annotation"),Wa=k("data-mce-annotation"),qa=k("data-mce-annotation-uid"),$a=function(t,e){var n=t.selection.getRng(),r=Me.fromDom(n.startContainer),o=Me.fromDom(t.getBody()),i=e.fold((function(){return"."+Ua()}),(function(t){return"["+Wa()+'="'+t+'"]'})),u=nn(r,n.startOffset).getOr(r),a=ro(u,i,(function(t){return Be(t,o)})),c=function(t,e){return n=e,(r=t.dom)&&r.hasAttribute&&r.hasAttribute(n)?L.some(or(t,e)):L.none();var n,r};return a.bind((function(e){return c(e,""+qa()).bind((function(n){return c(e,""+Wa()).map((function(e){var r=Ga(t,n);return{uid:n,name:e,elements:r}}))}))}))},Ga=function(t,e){var n=Me.fromDom(t.getBody());return ja(n,"["+qa()+'="'+e+'"]')},Ka=function(t,e){var n=Ta({}),r=function(){return{listeners:[],previous:Ma()}},o=function(t,e){i(t,(function(t){return e(t),t}))},i=function(t,e){var o=n.get(),i=e(wt(o,t).getOrThunk(r));o[t]=i,n.set(o)},u=Ra((function(){var e,r,u,a=n.get(),c=(e=ft(a),(u=H.call(e,0)).sort(r),u);G(c,(function(e){i(e,(function(n){var r=n.previous.get();return $a(t,L.some(e)).fold((function(){r.isSome()&&(function(t){o(t,(function(e){G(e.listeners,(function(e){return e(!1,t)}))}))}(e),n.previous.clear())}),(function(t){var e=t.uid,i=t.name,u=t.elements;Qn(r,e)||(function(t,e,n){o(t,(function(r){G(r.listeners,(function(r){return r(!0,t,{uid:e,nodes:$(n,(function(t){return t.dom}))})}))}))}(i,e,u),n.previous.set(e))})),{previous:n.previous,listeners:n.listeners}}))}))}),30);return t.on("remove",(function(){u.cancel()})),t.on("NodeChange",(function(){u.throttle()})),{addListener:function(t,e){i(t,(function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}}))}}},Xa=function(t,e){t.on("init",(function(){t.serializer.addNodeFilter("span",(function(t){G(t,(function(t){(function(t){return L.from(t.attr(Wa())).bind(e.lookup)})(t).each((function(e){!1===e.persistent&&t.unwrap()}))}))}))}))},Ya=0,Ja=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Ya+String(e)},Qa=function(t,e){var n,r,o=Ge(t).dom,i=Me.fromDom(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,en(Me.fromDom(r)));bn(i,u),yn(t),vn(t,i)},Za=function(t,e){return Me.fromDom(t.dom.cloneNode(e))},tc=function(t){return Za(t,!1)},ec=function(t){return Za(t,!0)},nc=function(t,e,n){void 0===n&&(n=R);var r=new fo(t,e),o=function(t){var e;do{e=r[t]()}while(e&&!jn(e)&&!n(e));return L.from(e).filter(jn)};return{current:function(){return L.from(r.current()).filter(jn)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},rc=function(t,e){var n=e||function(e){return t.isBlock(e)||$n(e)||Xn(e)},r=function(t,e,n,o){if(jn(t)){var i=o(t,e,t.data);if(-1!==i)return L.some({container:t,offset:i})}return n().bind((function(t){return r(t.container,t.offset,n,o)}))};return{backwards:function(t,e,o,i){var u=nc(t,i,n);return r(t,e,(function(){return u.prev().map((function(t){return{container:t,offset:t.length}}))}),o).getOrNull()},forwards:function(t,e,o,i){var u=nc(t,i,n);return r(t,e,(function(){return u.next().map((function(t){return{container:t,offset:0}}))}),o).getOrNull()}}},oc=Math.round,ic=function(t){return t?{left:oc(t.left),top:oc(t.top),bottom:oc(t.bottom),right:oc(t.right),width:oc(t.width),height:oc(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},uc=function(t,e){return t=ic(t),e||(t.left=t.left+t.width),t.right=t.left,t.width=0,t},ac=function(t,e,n){return t>=0&&t<=Math.min(e.height,n.height)/2},cc=function(t,e){var n=Math.min(e.height/2,t.height/2);return t.bottom-n<e.top||!(t.top>e.bottom)&&ac(e.top-t.bottom,t,e)},sc=function(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&ac(e.bottom-t.top,t,e)},lc=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},fc=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},dc=function(t,e){if(Nn(t)&&t.hasChildNodes()){var n=t.childNodes;return n[(r=e,o=0,i=n.length-1,Math.min(Math.max(r,o),i))]}return t;var r,o,i},mc=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿-⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),gc=function(t){return"string"==typeof t&&t.charCodeAt(0)>=768&&mc.test(t)},hc=Nn,pc=Xo,vc=Pn("display","block table"),bc=Pn("float","left right"),yc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(!t[n](e))return!1;return!0}}(hc,pc,A(bc)),wc=A(Pn("white-space","pre pre-line pre-wrap")),xc=jn,Cc=$n,Sc=wa.nodeIndex,kc=function(t,e){return e<0&&Nn(t)&&t.hasChildNodes()?void 0:dc(t,e)},Tc=function(t){return"createRange"in t?t.createRange():wa.DOM.createRng()},Oc=function(t){return t&&/[\r\n\t ]/.test(t)},_c=function(t){return!!t.setStart&&!!t.setEnd},Ec=function(t){var e=t.startContainer,n=t.startOffset;if(Oc(t.toString())&&wc(e.parentNode)&&jn(e)){var r=e.data;if(Oc(r[n-1])||Oc(r[n+1]))return!0}return!1},Dc=function(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom},Ac=function(t){var e,n=t.getClientRects();return e=n.length>0?ic(n[0]):ic(t.getBoundingClientRect()),!_c(t)&&Cc(t)&&Dc(e)?function(t){var e=t.ownerDocument,n=Tc(e),r=e.createTextNode(ko),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=ic(n.getBoundingClientRect());return o.removeChild(r),i}(t):Dc(e)&&_c(t)?function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&jn(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),Ac(i)}return null}(t):e},Mc=function(t,e){var n=uc(t,e);return n.width=1,n.right=n.left+1,n},zc=function(t,e,n){var r=function(){return n||(n=function(t){var e=[],n=function(t){var n,r;0!==t.height&&(e.length>0&&(n=t,r=e[e.length-1],n.left===r.left&&n.top===r.top&&n.bottom===r.bottom&&n.right===r.right)||e.push(t))},r=function(t,r){var o=Tc(t.ownerDocument);if(r<t.data.length){if(gc(t.data[r]))return e;if(gc(t.data[r-1])&&(o.setStart(t,r),o.setEnd(t,r+1),!Ec(o)))return n(Mc(Ac(o),!1)),e}r>0&&(o.setStart(t,r-1),o.setEnd(t,r),Ec(o)||n(Mc(Ac(o),!1))),r<t.data.length&&(o.setStart(t,r),o.setEnd(t,r+1),Ec(o)||n(Mc(Ac(o),!0)))},o=t.container(),i=t.offset();if(xc(o))return r(o,i),e;if(hc(o))if(t.isAtEnd()){var u=kc(o,i);xc(u)&&r(u,u.data.length),yc(u)&&!Cc(u)&&n(Mc(Ac(u),!1))}else{if(u=kc(o,i),xc(u)&&r(u,0),yc(u)&&t.isAtEnd())return n(Mc(Ac(u),!1)),e;var a=kc(t.container(),t.offset()-1);yc(a)&&!Cc(a)&&(vc(a)||vc(u)||!yc(u))&&n(Mc(Ac(a),!1)),yc(u)&&n(Mc(Ac(u),!0))}return e}(zc(t,e))),n};return{container:k(t),offset:k(e),toRange:function(){var n=Tc(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return xc(t),0===e},isAtEnd:function(){return xc(t)?e>=t.data.length:e>=t.childNodes.length},isEqual:function(n){return n&&t===n.container()&&e===n.offset()},getNode:function(n){return kc(t,n?e-1:e)}}};zc.fromRangeStart=function(t){return zc(t.startContainer,t.startOffset)},zc.fromRangeEnd=function(t){return zc(t.endContainer,t.endOffset)},zc.after=function(t){return zc(t.parentNode,Sc(t)+1)},zc.before=function(t){return zc(t.parentNode,Sc(t))},zc.isAbove=function(t,e){return Zn(at(e.getClientRects()),ct(t.getClientRects()),cc).getOr(!1)},zc.isBelow=function(t,e){return Zn(ct(e.getClientRects()),at(t.getClientRects()),sc).getOr(!1)},zc.isAtStart=function(t){return!!t&&t.isAtStart()},zc.isAtEnd=function(t){return!!t&&t.isAtEnd()},zc.isTextPosition=function(t){return!!t&&jn(t.container())},zc.isElementPosition=function(t){return!1===zc.isTextPosition(t)};var Rc,Nc,Bc=function(t,e){jn(e)&&0===e.data.length&&t.remove(e)},Pc=function(t,e,n){qn(n)?function(t,e,n){var r=L.from(n.firstChild),o=L.from(n.lastChild);e.insertNode(n),r.each((function(e){return Bc(t,e.previousSibling)})),o.each((function(e){return Bc(t,e.nextSibling)}))}(t,e,n):function(t,e,n){e.insertNode(n),Bc(t,n.previousSibling),Bc(t,n.nextSibling)}(t,e,n)},Ic=jn,Lc=Ln,Hc=wa.nodeIndex,Vc=function(t){var e=t.parentNode;return Lc(e)?Vc(e):e},Fc=function(t){return t?Et(t.childNodes,(function(t,e){return Lc(e)&&"BR"!==e.nodeName?t=t.concat(Fc(e)):t.push(e),t}),[]):[]},jc=function(t){return function(e){return t===e}},Uc=function(t){return(Ic(t)?"text()":t.nodeName.toLowerCase())+"["+function(t){var e,n;e=Fc(Vc(t)),n=Dt(e,jc(t),t),e=e.slice(0,n+1);var r=Et(e,(function(t,n,r){return Ic(n)&&Ic(e[r-1])&&t++,t}),0);return e=Ot(e,Bn([t.nodeName])),(n=Dt(e,jc(t),t))-r}(t)+"]"},Wc=function(t,e){var n,r,o,i,u,a=[];return n=e.container(),r=e.offset(),Ic(n)?o=function(t,e){for(;(t=t.previousSibling)&&Ic(t);)e+=t.data.length;return e}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),a.push(Uc(n)),u=function(t,e,n){var r=[];for(e=e.parentNode;!(e===t||n&&n(e));e=e.parentNode)r.push(e);return r}(t,n),u=Ot(u,A(Ln)),(a=a.concat(Tt(u,(function(t){return Uc(t)})))).reverse().join("/")+","+o},qc=function(t,e){var n;if(!e)return null;var r=e.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=Et(o,(function(t,e){var n,r,o,i,u=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e);return u?("text()"===u[1]&&(u[1]="#text"),n=t,r=u[1],o=parseInt(u[2],10),i=Fc(n),i=Ot(i,(function(t,e){return!Ic(t)||!Ic(i[e-1])})),(i=Ot(i,Bn([r])))[o]):null}),t);return i?Ic(i)?function(t,e){for(var n,r=t,o=0;Ic(r);){if(n=r.data.length,e>=o&&e<=o+n){t=r,e-=o;break}if(!Ic(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return Ic(t)&&e>t.data.length&&(e=t.data.length),zc(t,e)}(i,parseInt(n,10)):(n="after"===n?Hc(i)+1:Hc(i),zc(i.parentNode,n)):null},$c=Xn,Gc=function(t,e,n,r,o){var i,u=r[o?"startContainer":"endContainer"],a=r[o?"startOffset":"endOffset"],c=[],s=0,l=t.getRoot();for(jn(u)?c.push(n?function(t,e,n){var r,o;for(o=t(e.data.slice(0,n)).length,r=e.previousSibling;r&&jn(r);r=r.previousSibling)o+=t(r.data).length;return o}(e,u,a):a):(a>=(i=u.childNodes).length&&i.length&&(s=1,a=Math.max(0,i.length-1)),c.push(t.nodeIndex(i[a],n)+s));u&&u!==l;u=u.parentNode)c.push(t.nodeIndex(u,n));return c},Kc=function(t,e,n){var r=0;return De.each(t.select(e),(function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++})),r},Xc=function(t,e){var n,r,o,i=e?"start":"end";n=t[i+"Container"],r=t[i+"Offset"],Nn(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(e?r:r-1,o.length-1)])&&(r=e?0:n.childNodes.length,t["set"+(e?"Start":"End")](n,r))},Yc=function(t){return Xc(t,!0),Xc(t,!1),t},Jc=function(t,e){var n;if(Nn(t)&&(t=dc(t,e),$c(t)))return t;if(zo(t)){if(jn(t)&&Ao(t)&&(t=t.parentNode),n=t.previousSibling,$c(n))return n;if(n=t.nextSibling,$c(n))return n}},Qc=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if($c(r)||"IMG"===o)return{name:o,index:Kc(n.dom,o,r)};var u=function(t){return Jc(t.startContainer,t.startOffset)||Jc(t.endContainer,t.endOffset)}(i);return u?{name:o=u.tagName,index:Kc(n.dom,o,u)}:function(t,e,n,r){var o=e.dom,i={};return i.start=Gc(o,t,n,r,!0),e.isCollapsed()||(i.end=Gc(o,t,n,r,!1)),Vo(r)&&(i.isFakeCaret=!0),i}(t,n,e,i)},Zc=function(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,""):t.create("span",r)},ts=function(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),u=t.getNode(),a=u.nodeName;if("IMG"===a)return{name:a,index:Kc(n,a,u)};var c=Yc(r.cloneRange());if(!i){c.collapse(!1);var s=Zc(n,o+"_end",e);Pc(n,c,s)}(r=Yc(r)).collapse(!0);var l=Zc(n,o+"_start",e);return Pc(n,r,l),t.moveToBookmark({id:o,keep:!0}),{id:o}},es=function(t,e,n){return 2===e?Qc(_o,n,t):3===e?function(t){var e=t.getRng();return{start:Wc(t.dom.getRoot(),zc.fromRangeStart(e)),end:Wc(t.dom.getRoot(),zc.fromRangeEnd(e))}}(t):e?function(t){return{rng:t.getRng()}}(t):ts(t,!1)},ns=_(Qc,T,!0),rs=wa.DOM,os=function(t,e,n){var r=t.getParam(e,n);if(-1!==r.indexOf("=")){var o=t.getParam(e,"","hash");return wt(o,t.id).getOr(n)}return r},is=function(t){return t.getParam("content_security_policy","")},us=function(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},as=function(t){return t.getParam("forced_root_block_attrs",{})},cs=function(t){return t.getParam("automatic_uploads",!0,"boolean")},ss=function(t){return t.getParam("images_reuse_filename",!1,"boolean")},ls=function(t){return t.getParam("icons","","string")},fs=function(t){return t.getParam("images_upload_url","","string")},ds=function(t){return t.getParam("images_upload_base_path","","string")},ms=function(t){return t.getParam("images_upload_credentials",!1,"boolean")},gs=function(t){return t.getParam("images_upload_handler",null,"function")},hs=function(t){return t.getParam("content_css_cors",!1,"boolean")},ps=function(t){return t.getParam("referrer_policy","","string")},vs=function(t){return t.getParam("language","en","string")},bs=function(t){return t.getParam("indent_use_margin",!1)},ys=function(t){var e=t.getParam("font_css",[]);return m(e)?e:$(e.split(","),Ft)},ws=function(t){var e=t.getParam("object_resizing");return!1!==e&&!ke.iOS&&(f(e)?e:"table,img,figure.image,div,video,iframe")},xs=function(t){return t.getParam("event_root")},Cs=function(t){return t.getParam("theme")},Ss=function(t){return t.getParam("validate")},ks=function(t){return!1!==t.getParam("inline_boundaries")},Ts=function(t){return t.getParam("content_css_cors")},Os=function(t){return t.getParam("plugins","","string")},_s=Nn,Es=jn,Ds=function(t){var e=t.parentNode;e&&e.removeChild(t)},As=function(t){var e=_o(t);return{count:t.length-e.length,text:e}},Ms=function(t){for(var e;-1!==(e=t.data.lastIndexOf(To));)t.deleteData(e,1)},zs=function(t,e){return Ps(t),e},Rs=function(t,e){var n,r,o,i=e.container(),u=(n=st(i.childNodes),r=t,o=U(n,r),-1===o?L.none():L.some(o)).map((function(t){return t<e.offset()?zc(i,e.offset()-1):e})).getOr(e);return Ps(t),u},Ns=function(t,e){return Es(t)&&e.container()===t?function(t,e){var n=As(t.data.substr(0,e.offset())),r=As(t.data.substr(e.offset()));return(n.text+r.text).length>0?(Ms(t),zc(t,e.offset()-n.count)):e}(t,e):zs(t,e)},Bs=function(t,e){return zc.isTextPosition(e)?Ns(t,e):function(t,e){return e.container()===t.parentNode?Rs(t,e):zs(t,e)}(t,e)},Ps=function(t){_s(t)&&zo(t)&&(Ro(t)?t.removeAttribute("data-mce-caret"):Ds(t)),Es(t)&&(Ms(t),0===t.data.length&&Ds(t))},Is=he().browser,Ls=Xn,Hs=Jn,Vs=Yn,Fs=function(t,e,n){var r,o,i=uc(e.getBoundingClientRect(),n);if("BODY"===t.tagName){var u=t.ownerDocument.documentElement;r=t.scrollLeft||u.scrollLeft,o=t.scrollTop||u.scrollTop}else{var a=t.getBoundingClientRect();r=t.scrollLeft-a.left,o=t.scrollTop-a.top}i.left+=r,i.right+=r,i.top+=o,i.bottom+=o,i.width=1;var c=e.offsetWidth-e.clientWidth;return c>0&&(n&&(c*=-1),i.left+=c,i.right+=c),i},js=function(t,e,n,r){var o,i,u=Ma(),a=us(t),c=a.length>0?a:"p",s=function(){!function(t){for(var e=ja(Me.fromDom(t),"*[contentEditable=false],video,audio,embed,object"),n=0;n<e.length;n++){var r,o=e[n].dom,i=o.previousSibling;Lo(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1)),i=o.nextSibling,Io(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1))}}(e),i&&(Ps(i),i=null),u.on((function(t){ma(t.caret).remove(),u.clear()})),o&&(co.clearInterval(o),o=void 0)},l=function(){o=co.setInterval((function(){r()?ma("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):ma("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")}),500)};return{show:function(t,r){var o;if(s(),Vs(r))return null;if(!n(r))return i=function(t,e){var n=t.ownerDocument.createTextNode(To),r=t.parentNode;if(e){if(o=t.previousSibling,Do(o)){if(zo(o))return o;if(Lo(o))return o.splitText(o.data.length-1)}r.insertBefore(n,t)}else{var o=t.nextSibling;if(Do(o)){if(zo(o))return o;if(Io(o))return o.splitText(1),o}t.nextSibling?r.insertBefore(n,t.nextSibling):r.appendChild(n)}return n}(r,t),o=r.ownerDocument.createRange(),Ws(i.nextSibling)?(o.setStart(i,0),o.setEnd(i,0)):(o.setStart(i,1),o.setEnd(i,1)),o;i=Po(c,r,t);var a=Fs(e,r,t);ma(i).css("top",a.top);var f=ma('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(Mt({},a)).appendTo(e)[0];return u.set({caret:f,element:r,before:t}),t&&ma(f).addClass("mce-visual-caret-before"),l(),(o=r.ownerDocument.createRange()).setStart(i,0),o.setEnd(i,0),o},hide:s,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){u.on((function(t){var n=Fs(e,t.element,t.before);ma(t.caret).css(Mt({},n))}))},destroy:function(){return co.clearInterval(o)}}},Us=function(){return Is.isIE()||Is.isEdge()||Is.isFirefox()},Ws=function(t){return Ls(t)||Hs(t)},qs=function(t){return Ws(t)||Hn(t)&&Us()},$s=Xn,Gs=Jn,Ks=Pn("display","block table table-cell table-caption list-item"),Xs=zo,Ys=Ao,Js=Nn,Qs=Xo,Zs=function(t){return t>0},tl=function(t){return t<0},el=function(t,e){for(var n;n=t(e);)if(!Ys(n))return n;return null},nl=function(t,e,n,r,o){var i=new fo(t,r),u=$s(t)||Ys(t);if(tl(e)){if(u&&n(t=el(i.prev.bind(i),!0)))return t;for(;t=el(i.prev.bind(i),o);)if(n(t))return t}if(Zs(e)){if(u&&n(t=el(i.next.bind(i),!0)))return t;for(;t=el(i.next.bind(i),o);)if(n(t))return t}return null},rl=function(t,e){for(;t&&t!==e;){if(Ks(t))return t;t=t.parentNode}return null},ol=function(t,e,n){return rl(t.container(),n)===rl(e.container(),n)},il=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return Js(n)?n.childNodes[r+t]:null},ul=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},al=function(t,e,n){return rl(e,t)===rl(n,t)},cl=function(t,e,n){for(var r=t?"previousSibling":"nextSibling";n&&n!==e;){var o=n[r];if(Xs(o)&&(o=o[r]),$s(o)||Gs(o)){if(al(e,o,n))return o;break}if(Qs(o))break;n=n.parentNode}return null},sl=_(ul,!0),ll=_(ul,!1),fl=function(t,e,n){var r,o=_(cl,!0,e),i=_(cl,!1,e),u=n.startContainer,a=n.startOffset;if(Ao(u)){Js(u)||(u=u.parentNode);var c=u.getAttribute("data-mce-caret");if("before"===c&&(r=u.nextSibling,qs(r)))return sl(r);if("after"===c&&(r=u.previousSibling,qs(r)))return ll(r)}if(!n.collapsed)return n;if(jn(u)){if(Xs(u)){if(1===t){if(r=i(u))return sl(r);if(r=o(u))return ll(r)}if(-1===t){if(r=o(u))return ll(r);if(r=i(u))return sl(r)}return n}if(Lo(u)&&a>=u.data.length-1)return 1===t&&(r=i(u))?sl(r):n;if(Io(u)&&a<=1)return-1===t&&(r=o(u))?ll(r):n;if(a===u.data.length)return(r=i(u))?sl(r):n;if(0===a)return(r=o(u))?ll(r):n}return n},dl=function(t,e){return L.from(il(t?0:-1,e)).filter($s)},ml=function(t,e,n){var r=fl(t,e,n);return-1===t?zc.fromRangeStart(r):zc.fromRangeEnd(r)},gl=function(t){return L.from(t.getNode()).map(Me.fromDom)},hl=function(t,e){for(;e=t(e);)if(e.isVisible())return e;return e},pl=function(t,e){var n=ol(t,e);return!(n||!$n(t.getNode()))||n};(Nc=Rc||(Rc={}))[Nc.Backwards=-1]="Backwards",Nc[Nc.Forwards=1]="Forwards";var vl,bl,yl,wl,xl=Xn,Cl=jn,Sl=Nn,kl=$n,Tl=Xo,Ol=function(t){return $o(t)||function(t){return!!Yo(t)&&!0!==Q(st(t.getElementsByTagName("*")),(function(t,e){return t||Fo(e)}),!1)}(t)},_l=Jo,El=function(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null},Dl=function(t,e){if(Zs(t)){if(Tl(e.previousSibling)&&!Cl(e.previousSibling))return zc.before(e);if(Cl(e))return zc(e,0)}if(tl(t)){if(Tl(e.nextSibling)&&!Cl(e.nextSibling))return zc.after(e);if(Cl(e))return zc(e,e.data.length)}return tl(t)?kl(e)?zc.before(e):zc.after(e):zc.before(e)},Al=function(t,e,n){var r,o,i,u;if(!Sl(n)||!e)return null;if(e.isEqual(zc.after(n))&&n.lastChild){if(u=zc.after(n.lastChild),tl(t)&&Tl(n.lastChild)&&Sl(n.lastChild))return kl(n.lastChild)?zc.before(n.lastChild):u}else u=e;var a=u.container(),c=u.offset();if(Cl(a)){if(tl(t)&&c>0)return zc(a,--c);if(Zs(t)&&c<a.length)return zc(a,++c);r=a}else{if(tl(t)&&c>0&&(o=El(a,c-1),Tl(o)))return!Ol(o)&&(i=nl(o,t,_l,o))?Cl(i)?zc(i,i.data.length):zc.after(i):Cl(o)?zc(o,o.data.length):zc.before(o);if(Zs(t)&&c<a.childNodes.length&&(o=El(a,c),Tl(o)))return kl(o)?function(t,e){var n=e.nextSibling;return n&&Tl(n)?Cl(n)?zc(n,0):zc.before(n):Al(Rc.Forwards,zc.after(e),t)}(n,o):!Ol(o)&&(i=nl(o,t,_l,o))?Cl(i)?zc(i,0):zc.before(i):Cl(o)?zc(o,0):zc.after(o);r=o||u.getNode()}if((Zs(t)&&u.isAtEnd()||tl(t)&&u.isAtStart())&&(r=nl(r,t,N,n,!0),_l(r,n)))return Dl(t,r);o=nl(r,t,_l,n);var s=At(Y(function(t,e){for(var n=[];t&&t!==e;)n.push(t),t=t.parentNode;return n}(a,n),xl));return!s||o&&s.contains(o)?o?Dl(t,o):null:u=Zs(t)?zc.after(s):zc.before(s)},Ml=function(t){return{next:function(e){return Al(Rc.Forwards,e,t)},prev:function(e){return Al(Rc.Backwards,e,t)}}},zl=function(t){return zc.isTextPosition(t)?0===t.offset():Xo(t.getNode())},Rl=function(t){if(zc.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return Xo(t.getNode(!0))},Nl=function(t,e){return!zc.isTextPosition(t)&&!zc.isTextPosition(e)&&t.getNode()===e.getNode(!0)},Bl=function(t,e,n){return t?!Nl(e,n)&&(r=e,!(!zc.isTextPosition(r)&&$n(r.getNode())))&&Rl(e)&&zl(n):!Nl(n,e)&&zl(e)&&Rl(n);var r},Pl=function(t,e,n){var r=Ml(e);return L.from(t?r.next(n):r.prev(n))},Il=function(t,e,n){return Pl(t,e,n).bind((function(r){return ol(n,r,e)&&Bl(t,n,r)?Pl(t,e,r):L.some(r)}))},Ll=function(t,e,n,r){return Il(t,e,n).bind((function(n){return r(n)?Ll(t,e,n,r):L.some(n)}))},Hl=function(t,e){var n,r=t?e.firstChild:e.lastChild;return jn(r)?L.some(zc(r,t?0:r.data.length)):r?Xo(r)?L.some(t?zc.before(r):$n(n=r)?zc.before(n):zc.after(n)):function(t,e,n){var r=t?zc.before(n):zc.after(n);return Pl(t,e,r)}(t,e,r):L.none()},Vl=_(Pl,!0),Fl=_(Pl,!1),jl=_(Hl,!0),Ul=_(Hl,!1),Wl="_mce_caret",ql=function(t){return Nn(t)&&t.id===Wl},$l=function(t,e){for(;e&&e!==t;){if(e.id===Wl)return e;e=e.parentNode}return null},Gl=function(t){return De.isArray(t.start)},Kl=function(t,e){return Nn(e)&&t.isBlock(e)&&!e.innerHTML&&!ke.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e},Xl=function(t,e){return Ul(t).fold(R,(function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0}))},Yl=function(t,e,n){return!(!function(t){return!1===t.hasChildNodes()}(e)||!$l(t,e)||(function(t,e){var n=t.ownerDocument.createTextNode(To);t.appendChild(n),e.setStart(n,0),e.setEnd(n,0)}(e,n),0))},Jl=function(t,e,n,r){var o,i,u,a,c=n[e?"start":"end"],s=t.getRoot();if(c){for(u=c[0],i=s,o=c.length-1;o>=1;o--){if(a=i.childNodes,Yl(s,i,r))return!0;if(c[o]>a.length-1)return!!Yl(s,i,r)||Xl(i,r);i=a[c[o]]}3===i.nodeType&&(u=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(u=Math.min(c[0],i.childNodes.length)),e?r.setStart(i,u):r.setEnd(i,u)}return!0},Ql=function(t){return jn(t)&&t.data.length>0},Zl=function(t,e,n){var r,o,i,u,a,c,s=t.get(n.id+"_"+e),l=n.keep;if(s){if(r=s.parentNode,"start"===e?(l?s.hasChildNodes()?(r=s.firstChild,o=1):Ql(s.nextSibling)?(r=s.nextSibling,o=0):Ql(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)+1):o=t.nodeIndex(s),a=r,c=o):(l?s.hasChildNodes()?(r=s.firstChild,o=1):Ql(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)):o=t.nodeIndex(s),a=r,c=o),!l){for(u=s.previousSibling,i=s.nextSibling,De.each(De.grep(s.childNodes),(function(t){jn(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))}));s=t.get(n.id+"_"+e);)t.remove(s,!0);u&&i&&u.nodeType===i.nodeType&&jn(u)&&!ke.opera&&(o=u.nodeValue.length,u.appendData(i.nodeValue),t.remove(i),a=u,c=o)}return L.some(zc(a,c))}return L.none()},tf=function(t,e){var n=t.dom;if(e){if(Gl(e))return function(t,e){var n=t.createRng();return Jl(t,!0,e,n)&&Jl(t,!1,e,n)?L.some(n):L.none()}(n,e);if(function(t){return f(t.start)}(e))return L.some(function(t,e){var n,r=t.createRng();return n=qc(t.getRoot(),e.start),r.setStart(n.container(),n.offset()),n=qc(t.getRoot(),e.end),r.setEnd(n.container(),n.offset()),r}(n,e));if(function(t){return xt(t,"id")}(e))return function(t,e){var n=Zl(t,"start",e),r=Zl(t,"end",e);return Zn(n,r.or(n),(function(e,n){var r=t.createRng();return r.setStart(Kl(t,e.container()),e.offset()),r.setEnd(Kl(t,n.container()),n.offset()),r}))}(n,e);if(function(t){return xt(t,"name")}(e))return function(t,e){return L.from(t.select(e.name)[e.index]).map((function(e){var n=t.createRng();return n.selectNode(e),n}))}(n,e);if(function(t){return xt(t,"rng")}(e))return L.some(e.rng)}return L.none()},ef=function(t,e,n){return es(t,e,n)},nf=function(t,e){tf(t,e).each((function(e){t.setRng(e)}))},rf=function(t){return Nn(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},of=(vl=ko,function(t){return vl===t}),uf=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},af=function(t){return!uf(t)&&!of(t)},cf=function(t){return!!t.nodeType},sf=function(t,e,n){var r=n.startOffset,o=n.startContainer;if((o!==n.endContainer||!function(t){return t&&/^(IMG)$/.test(t.nodeName)}(o.childNodes[r]))&&Nn(o)){var i=o.childNodes,u=void 0;r<i.length?(o=i[r],u=new fo(o,t.getParent(o,t.isBlock))):(o=i[i.length-1],(u=new fo(o,t.getParent(o,t.isBlock))).next(!0));for(var a=u.current();a;a=u.next())if(jn(a)&&!mf(a))return n.setStart(a,0),void e.setRng(n)}},lf=function(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(Nn(t)||!mf(t))return t}},ff=function(t,e){return cf(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]},df=function(t,e,n){return t.schema.isValidChild(e,n)},mf=function(t,e){if(void 0===e&&(e=!1),b(t)&&jn(t)){var n=e?t.data.replace(/ /g," "):t.data;return Zo(n)}return!1},gf=function(t,e){return y(t)?t=t(e):b(e)&&(t=t.replace(/%(\w+)/g,(function(t,n){return e[n]||t}))),t},hf=function(t,e){return e=e||"",t=""+((t=t||"").nodeName||t),e=""+(e.nodeName||e),t.toLowerCase()===e.toLowerCase()},pf=function(t,e,n){return"color"!==n&&"backgroundColor"!==n||(e=t.toHex(e)),"fontWeight"===n&&700===e&&(e="bold"),"fontFamily"===n&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e},vf=function(t,e,n){return pf(t,t.getStyle(e,n),n)},bf=function(t,e){var n;return t.getParent(e,(function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n})),n},yf=function(t,e,n){return t.getParents(e,n,t.getRoot())},wf=function(t,e,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(t){return bt(t,(function(t,e){return q(r,(function(t){return t===e}))}))};return q(t.formatter.get(e),(function(e){var r=o(e);return q(t.formatter.get(n),(function(t){var e,n,a,c=o(t);return e=r,n=c,void 0===a&&(a=u),i(a).eq(e,n)}))}))},xf=function(t){return Ct(t,"block")},Cf=function(t){return Ct(t,"selector")},Sf=function(t){return Ct(t,"inline")},kf=function(t){return Cf(t)&&!1!==t.expand&&!Sf(t)},Tf=rf,Of=yf,_f=mf,Ef=ff,Df=function(t,e){for(var n=e;n;){if(Nn(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e},Af=function(t,e,n,r){for(var o=e.data,i=n;t?i>=0:i<o.length;t?i--:i++)if(r(o.charAt(i)))return t?i+1:i;return-1},Mf=function(t,e,n){return Af(t,e,n,(function(t){return of(t)||uf(t)}))},zf=function(t,e,n){return Af(t,e,n,af)},Rf=function(t,e,n,r,o,i){var u,a=t.getParent(n,t.isBlock)||e,c=function(e,n,r){var i=rc(t),c=o?i.backwards:i.forwards;return L.from(c(e,n,(function(t,e){return Tf(t.parentNode)?-1:(u=t,r(o,t,e))}),a))};return c(n,r,Mf).bind((function(t){return i?c(t.container,t.offset+(o?-1:0),zf):L.some(t)})).orThunk((function(){return u?L.some({container:u,offset:o?0:u.length}):L.none()}))},Nf=function(t,e,n,r,o){jn(r)&&qt(r.data)&&r[o]&&(r=r[o]);for(var i=Of(t,r),u=0;u<i.length;u++)for(var a=0;a<e.length;a++){var c=e[a];if((!b(c.collapsed)||c.collapsed===n.collapsed)&&Cf(c)&&t.is(i[u],c.selector))return i[u]}return r},Bf=function(t,e,n,r){var o=n,i=t.dom,u=i.getRoot(),a=e[0];if(xf(a)&&!a.wrapper&&(o=i.getParent(n,a.block,u)),!o){var c=i.getParent(n,"LI,TD,TH");o=i.getParent(jn(n)?n.parentNode:n,(function(e){return e!==u&&Ef(t,e)}),c)}if(o&&xf(a)&&a.wrapper&&(o=Of(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!hf(o,"br")););return o||n},Pf=function(t,e,n,r){var o=n.parentNode;return!b(n[r])&&(!(o!==e&&!v(o)&&!t.isBlock(o))||Pf(t,e,o,r))},If=function(t,e,n,r,o){var i,u=n,a=o?"previousSibling":"nextSibling",c=t.getRoot();if(jn(n)&&!_f(n)&&(o?r>0:r<n.data.length))return n;for(;;){if(!e[0].block_expand&&t.isBlock(u))return u;for(var s=u[a];s;s=s[a]){var l=jn(s)&&!Pf(t,c,s,a);if(!Tf(s)&&(!$n(i=s)||!i.getAttribute("data-mce-bogus")||i.nextSibling)&&!_f(s,l))return u}if(u===c||u.parentNode===c){n=u;break}u=u.parentNode}return n},Lf=function(t){return Tf(t.parentNode)||Tf(t)},Hf=function(t,e,n,r){void 0===r&&(r=!1);var o=e.startContainer,i=e.startOffset,u=e.endContainer,a=e.endOffset,c=t.dom,s=n[0];return Nn(o)&&o.hasChildNodes()&&(o=dc(o,i),jn(o)&&(i=0)),Nn(u)&&u.hasChildNodes()&&(u=dc(u,e.collapsed?a:a-1),jn(u)&&(a=u.nodeValue.length)),o=Df(c,o),u=Df(c,u),Lf(o)&&(o=Tf(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,jn(o)&&(i=e.collapsed?o.length:0)),Lf(u)&&(u=Tf(u)?u:u.parentNode,u=e.collapsed?u.nextSibling||u:u.previousSibling||u,jn(u)&&(a=e.collapsed?0:u.length)),e.collapsed&&(Rf(c,t.getBody(),o,i,!0,r).each((function(t){var e=t.container,n=t.offset;o=e,i=n})),Rf(c,t.getBody(),u,a,!1,r).each((function(t){var e=t.container,n=t.offset;u=e,a=n}))),(Sf(s)||s.block_expand)&&(Sf(s)&&jn(o)&&0!==i||(o=If(c,n,o,i,!0)),Sf(s)&&jn(u)&&a!==u.nodeValue.length||(u=If(c,n,u,a,!1))),kf(s)&&(o=Nf(c,n,e,o,"previousSibling"),u=Nf(c,n,e,u,"nextSibling")),(xf(s)||Cf(s))&&(o=Bf(t,n,o,"previousSibling"),u=Bf(t,n,u,"nextSibling"),xf(s)&&(c.isBlock(o)||(o=If(c,n,o,i,!0)),c.isBlock(u)||(u=If(c,n,u,a,!1)))),Nn(o)&&(i=c.nodeIndex(o),o=o.parentNode),Nn(u)&&(a=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:o,startOffset:i,endContainer:u,endOffset:a}},Vf=function(t,e,n){var r=e.startOffset,o=dc(e.startContainer,r),i=e.endOffset,u=dc(e.endContainer,i-1),a=function(t){var e=t[0];jn(e)&&e===o&&r>=e.data.length&&t.splice(0,1);var n=t[t.length-1];return 0===i&&t.length>0&&n===u&&jn(n)&&t.splice(t.length-1,1),t},c=function(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r},s=function(e,n){return t.getParent(e,(function(t){return t.parentNode===n}),n)},l=function(t,e,r){for(var o=r?"nextSibling":"previousSibling",i=t,u=i.parentNode;i&&i!==e;i=u){u=i.parentNode;var s=c(i===t?i:i[o],o);s.length&&(r||s.reverse(),n(a(s)))}};if(o===u)return n(a([o]));var f=t.findCommonAncestor(o,u);if(t.isChildOf(o,u))return l(o,f,!0);if(t.isChildOf(u,o))return l(u,f);var d=s(o,f)||o,m=s(u,f)||u;l(o,d,!0);var g=c(d===o?d:d.nextSibling,"nextSibling",m===u?m.nextSibling:m);g.length&&n(a(g)),l(u,m)},Ff=function(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e},jf=function(t){return Y(function(t){return nt(t,(function(t){var e=fc(t);return e?[Me.fromDom(e)]:[]}))}(t),Co)},Uf=function(t,e){var n=ja(e,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:jf(t)},Wf=function(t){return Uf(Ff(t.selection.getSel()),Me.fromDom(t.getBody()))},qf=function(t,e){return eo(t,"table",e)},$f=function(t){return rn(t).fold(k([t]),(function(e){return[t].concat($f(e))}))},Gf=function(t){return on(t).fold(k([t]),(function(e){return"br"===Ve(e)?Je(e).map((function(e){return[t].concat(Gf(e))})).getOr([]):[t].concat(Gf(e))}))},Kf=function(t,e){return Zn(function(t){var e=t.startContainer,n=t.startOffset;return jn(e)?0===n?L.some(Me.fromDom(e)):L.none():L.from(e.childNodes[n]).map(Me.fromDom)}(e),function(t){var e=t.endContainer,n=t.endOffset;return jn(e)?n===e.data.length?L.some(Me.fromDom(e)):L.none():L.from(e.childNodes[n-1]).map(Me.fromDom)}(e),(function(e,n){var r=tt($f(t),_(Be,e)),o=tt(Gf(t),_(Be,n));return r.isSome()&&o.isSome()})).getOr(!1)},Xf=function(t,e,n,r){var o=n,i=new fo(n,o),u=bt(t.schema.getMoveCaretBeforeOnEnterElements(),(function(t,e){return!W(["td","th","table"],e.toLowerCase())}));do{if(jn(n)&&0!==De.trim(n.nodeValue).length)return void(r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length));if(u[n.nodeName])return void(r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))},Yf=function(t){var e=t.selection.getSel();return e&&e.rangeCount>0},Jf=function(t,e){var n=Wf(t);n.length>0?G(n,(function(n){var r=n.dom,o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)})):e(t.selection.getRng(),!1)},Qf=function(t,e,n){var r=ts(t,e);n(r),t.moveToBookmark(r)},Zf=(bl=We,yl="text",{get:function(t){if(!bl(t))throw new Error("Can only get "+yl+" value of a "+yl+" node");return wl(t).getOr("")},getOption:wl=function(t){return bl(t)?L.from(t.dom.nodeValue):L.none()},set:function(t,e){if(!bl(t))throw new Error("Can only set raw "+yl+" value of a "+yl+" node");t.dom.nodeValue=e}}),td=function(t){return Zf.get(t)},ed=function(t,e,n,r){return Ye(e).fold((function(){return"skipping"}),(function(o){return"br"===r||function(t){return We(t)&&td(t)===To}(e)?"valid":function(t){return Ue(t)&&Va(t,Ua())}(e)?"existing":ql(e.dom)?"caret":df(t,n,r)&&df(t,Ve(o),n)?"valid":"invalid-child"}))},nd=function(t,e,n,r){var o=e.uid,i=void 0===o?Ja("mce-annotation"):o,u=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["uid"]),a=Me.fromTag("span",t);La(a,Ua()),nr(a,""+qa(),i),nr(a,""+Wa(),n);var c=r(i,u),s=c.attributes,l=void 0===s?{}:s,f=c.classes,d=void 0===f?[]:f;return rr(a,l),function(t,e){G(e,(function(e){La(t,e)}))}(a,d),a},rd=function(t,e,n,r,o){var i=[],u=nd(t.getDoc(),o,n,r),a=Ma(),c=function(){a.clear()},s=function(t){G(t,l)},l=function(e){switch(ed(t,e,"span",Ve(e))){case"invalid-child":c();var n=en(e);s(n),c();break;case"valid":!function(t,e){gn(t,e),vn(e,t)}(e,a.get().getOrThunk((function(){var t=tc(u);return i.push(t),a.set(t),t})))}};return Vf(t.dom,e,(function(t){c(),function(t){var e=$(t,Me.fromDom);s(e)}(t)})),i},od=function(t,e,n,r){t.undoManager.transact((function(){var o=t.selection,i=o.getRng(),u=Wf(t).length>0;if(i.collapsed&&!u&&function(t,e){var n=Hf(t,e,[{inline:"span"}]);e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset),t.selection.setRng(e)}(t,i),o.getRng().collapsed&&!u){var a=nd(t.getDoc(),r,e,n.decorate);Qa(a,ko),o.getRng().insertNode(a.dom),o.select(a.dom)}else Qf(o,!1,(function(){Jf(t,(function(o){rd(t,o,e,n.decorate,r)}))}))}))},id=function(t){var e,n=(e={},{register:function(t,n){e[t]={name:t,settings:n}},lookup:function(t){return wt(e,t).map((function(t){return t.settings}))}});Xa(t,n);var r=Ka(t);return{register:function(t,e){n.register(t,e)},annotate:function(e,r){n.lookup(e).each((function(n){od(t,e,n,r)}))},annotationChanged:function(t,e){r.addListener(t,e)},remove:function(e){$a(t,L.some(e)).each((function(t){var e=t.elements;G(e,xn)}))},getAll:function(e){var n=function(t,e){var n=Me.fromDom(t.getBody()),r=ja(n,"["+Wa()+'="'+e+'"]'),o={};return G(r,(function(t){var e=or(t,qa()),n=wt(o,e).getOr([]);o[e]=n.concat([t])})),o}(t,e);return gt(n,(function(t){return $(t,(function(t){return t.dom}))}))}}},ud=function(t){return{getBookmark:_(ef,t),moveToBookmark:_(nf,t)}};ud.isBookmarkNode=rf;var ad=function(t,e){for(;e&&e!==t;){if(Kn(e)||Xn(e))return e;e=e.parentNode}return null},cd=function(t,e,n){if(n.collapsed)return!1;if(ke.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(Nn(r))return q(r.getClientRects(),(function(n){return lc(n,t,e)}))}return q(n.getClientRects(),(function(n){return lc(n,t,e)}))},sd=function(t,e,n){return t.fire(e,n)},ld=function(t,e,n,r){return t.fire("FormatApply",{format:e,node:n,vars:r})},fd=function(t,e,n,r){return t.fire("FormatRemove",{format:e,node:n,vars:r})},dd={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:function(t){return t.shiftKey||t.ctrlKey||t.altKey||dd.metaKeyPressed(t)},metaKeyPressed:function(t){return ke.mac?t.metaKey:t.ctrlKey&&!t.altKey}},md=Xn,gd=function(t,e){var n,r,o,i,u,a,c,s,l,f,d,m,g,h,p,v="data-mce-selected",y=e.dom,w=De.each,x=e.getDoc(),C=document,S=Math.abs,k=Math.round,T=e.getBody(),O={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},_=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},E=function(t){return Jn(t)||y.hasClass(t,"mce-preview-object")},D=function(t){var n=t.target;(function(t,e){if("longpress"===t.type||0===t.type.indexOf("touch")){var n=t.touches[0];return _(t.target)&&!cd(n.clientX,n.clientY,e)}return _(t.target)&&!cd(t.clientX,t.clientY,e)})(t,e.selection.getRng())&&!t.isDefaultPrevented()&&e.selection.select(n)},A=function(t){return y.is(t,"figure.image")?[t.querySelector("img")]:y.hasClass(t,"mce-preview-object")&&b(t.firstElementChild)?[t,t.firstElementChild]:[t]},M=function(t){var n=ws(e);return!!n&&"false"!==t.getAttribute("data-mce-resize")&&t!==e.getBody()&&(y.hasClass(t,"mce-preview-object")?Re(Me.fromDom(t.firstElementChild),n):Re(Me.fromDom(t),n))},z=function(t,n,r){if(b(r)){var o=A(t);G(o,(function(t){t.style[n]||!e.schema.isValid(t.nodeName.toLowerCase(),n)?y.setStyle(t,n,r):y.setAttrib(t,n,""+r)}))}},R=function(t,e,n){z(t,"width",e),z(t,"height",n)},N=function(t){var u,v,b,w;u=t.screenX-a,v=t.screenY-c,m=u*i[2]+s,g=v*i[3]+l,m=m<5?5:m,g=g<5?5:g,((_(n)||E(n))&&!1!==function(t){return t.getParam("resize_img_proportional",!0,"boolean")}(e)?!dd.modifierPressed(t):dd.modifierPressed(t))&&(S(u)>S(v)?(g=k(m*f),m=k(g/f)):(m=k(g/f),g=k(m*f))),R(r,m,g),b=(b=i.startPos.x+u)>0?b:0,w=(w=i.startPos.y+v)>0?w:0,y.setStyles(o,{left:b,top:w,display:"block"}),o.innerHTML=m+" × "+g,i[2]<0&&r.clientWidth<=m&&y.setStyle(r,"left",void 0+(s-m)),i[3]<0&&r.clientHeight<=g&&y.setStyle(r,"top",void 0+(l-g)),(u=T.scrollWidth-h)+(v=T.scrollHeight-p)!=0&&y.setStyles(o,{left:b-u,top:w-v}),d||(function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(e,n,s,l,"corner-"+i.name),d=!0)},B=function(){var t=d;d=!1,t&&(z(n,"width",m),z(n,"height",g)),y.unbind(x,"mousemove",N),y.unbind(x,"mouseup",B),C!==x&&(y.unbind(C,"mousemove",N),y.unbind(C,"mouseup",B)),y.remove(r),y.remove(o),y.remove(u),P(n),t&&(function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(e,n,m,g,"corner-"+i.name),y.setAttrib(n,"style",y.getAttrib(n,"style"))),e.nodeChanged()},P=function(t){V();var d=y.getPos(t,T),b=d.x,S=d.y,k=t.getBoundingClientRect(),_=k.width||k.right-k.left,D=k.height||k.bottom-k.top;n!==t&&(I(),n=t,m=g=0);var z=e.fire("ObjectSelected",{target:t}),P=y.getAttrib(n,v,"1");M(t)&&!z.isDefaultPrevented()?w(O,(function(t,e){var d,m=function(d){var m,g=A(n)[0];a=d.screenX,c=d.screenY,s=g.clientWidth,l=g.clientHeight,f=l/s,(i=t).name=e,i.startPos={x:_*t[0]+b,y:D*t[1]+S},h=T.scrollWidth,p=T.scrollHeight,u=y.add(T,"div",{class:"mce-resize-backdrop"}),y.setStyles(u,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),r=E(m=n)?y.create("img",{src:ke.transparentSrc}):m.cloneNode(!0),y.addClass(r,"mce-clonedresizable"),y.setAttrib(r,"data-mce-bogus","all"),r.contentEditable="false",y.setStyles(r,{left:b,top:S,margin:0}),R(r,_,D),r.removeAttribute(v),T.appendChild(r),y.bind(x,"mousemove",N),y.bind(x,"mouseup",B),C!==x&&(y.bind(C,"mousemove",N),y.bind(C,"mouseup",B)),o=y.add(T,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},s+" × "+l)};(d=y.get("mceResizeHandle"+e))&&y.remove(d),d=y.add(T,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===ke.ie&&(d.contentEditable=!1),y.bind(d,"mousedown",(function(t){t.stopImmediatePropagation(),t.preventDefault(),m(t)})),t.elm=d,y.setStyles(d,{left:_*t[0]+b-d.offsetWidth/2,top:D*t[1]+S-d.offsetHeight/2})})):I(),y.getAttrib(n,v)||n.setAttribute(v,P)},I=function(){V(),n&&n.removeAttribute(v),mt(O,(function(t,e){var n=y.get("mceResizeHandle"+e);n&&(y.unbind(n),y.remove(n))}))},L=function(n){var r,o=function(t,e){if(t)do{if(t===e)return!0}while(t=t.parentNode)};d||e.removed||(w(y.select("img[data-mce-selected],hr[data-mce-selected]"),(function(t){t.removeAttribute(v)})),r="mousedown"===n.type?n.target:t.getNode(),o(r=y.$(r).closest("table,img,figure.image,hr,video,span.mce-preview-object")[0],T)&&(F(),o(t.getStart(!0),r)&&o(t.getEnd(!0),r))?P(r):I())},H=function(t){return md(ad(e.getBody(),t))},V=function(){mt(O,(function(t){t.elm&&(y.unbind(t.elm),delete t.elm)}))},F=function(){try{e.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(t){}};return e.on("init",(function(){if(F(),ke.browser.isIE()||ke.browser.isEdge()){e.on("mousedown click",(function(t){var n=t.target,r=n.nodeName;d||!/^(TABLE|IMG|HR)$/.test(r)||H(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())}));var t=function(t){var n=function(t){co.setEditorTimeout(e,(function(){return e.selection.select(t)}))};if(H(t.target)||Jn(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))};y.bind(T,"mscontrolselect",t),e.on("remove",(function(){return y.unbind(T,"mscontrolselect",t)}))}var r=co.throttle((function(t){e.composing||L(t)}));e.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",r),e.on("keyup compositionend",(function(t){n&&"TABLE"===n.nodeName&&r(t)})),e.on("hide blur",I),e.on("contextmenu longpress",D,!0)})),e.on("remove",V),{isResizable:M,showResizeRect:P,hideResizeRect:I,updateResizeRect:L,destroy:function(){n=r=u=null}}},hd=function(t){return Kn(t)||Xn(t)},pd=function(t,e,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(t,e))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(i.caretRangeFromPoint)r=i.caretRangeFromPoint(t,e);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(u){r=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=De.toArray(i.getClientRects())).sort((function(t,n){return(t=Math.abs(Math.max(t.top-e,t.bottom-e)))-Math.abs(Math.max(n.top-e,n.bottom-e))}))).length>0){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(u){}}return null}(t,e,n)}return function(t,e){var n=t&&t.parentElement?t.parentElement():null;return Xn(function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(n,e,hd))?null:t}(r,n.body)}return r},vd=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},bd=function(t,e,n){return null!==function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(t,e,n)},yd=function(t,e,n){return bd(t,e,(function(t){return t.nodeName===n}))},wd=function(t){return t&&"TABLE"===t.nodeName},xd=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},Cd=function(t,e){return zo(t)&&!1===bd(t,e,ql)},Sd=function(t,e,n){for(var r=new fo(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());e=r[n?"prev":"next"]();)if($n(e))return!0},kd=function(t,e,n,r,o){var i,u,a=t.getRoot(),c=t.schema.getNonEmptyElements(),s=t.getParent(o.parentNode,t.isBlock)||a;if(r&&$n(o)&&e&&t.isEmpty(s))return L.some(zc(o.parentNode,t.nodeIndex(o)));for(var l=new fo(o,s);u=l[r?"prev":"next"]();){if("false"===t.getContentEditableParent(u)||Cd(u,a))return L.none();if(jn(u)&&u.nodeValue.length>0)return!1===yd(u,a,"A")?L.some(zc(u,r?u.nodeValue.length:0)):L.none();if(t.isBlock(u)||c[u.nodeName.toLowerCase()])return L.none();i=u}return n&&i?L.some(zc(i,0)):L.none()},Td=function(t,e,n,r){var o,i,u,a,c=t.getRoot(),s=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var l=Nn(o)&&i===o.childNodes.length,f=t.schema.getNonEmptyElements();if(a=n,zo(o))return L.none();if(Nn(o)&&i>o.childNodes.length-1&&(a=!1),Wn(o)&&(o=c,i=0),o===c){if(a&&(u=o.childNodes[i>0?i-1:0])){if(zo(u))return L.none();if(f[u.nodeName]||wd(u))return L.none()}if(o.hasChildNodes()){if(i=Math.min(!a&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=jn(o)&&l?o.data.length:0,!e&&o===c.lastChild&&wd(o))return L.none();if(function(t,e){for(;e&&e!==t;){if(Xn(e))return!0;e=e.parentNode}return!1}(c,o)||zo(o))return L.none();if(o.hasChildNodes()&&!1===wd(o)){u=o;var d=new fo(o,c);do{if(Xn(u)||zo(u)){s=!1;break}if(jn(u)&&u.nodeValue.length>0){i=a?0:u.nodeValue.length,o=u,s=!0;break}if(f[u.nodeName.toLowerCase()]&&!xd(u)){i=t.nodeIndex(u),o=u.parentNode,a||i++,s=!0;break}}while(u=a?d.next():d.prev())}}}return e&&(jn(o)&&0===i&&kd(t,l,e,!0,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),Nn(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!$n(u)||function(t,e){return t.previousSibling&&t.previousSibling.nodeName===e}(u,"A")||Sd(t,u,!1)||Sd(t,u,!0)||kd(t,l,e,!0,u).each((function(t){o=t.container(),i=t.offset(),s=!0})))),a&&!e&&jn(o)&&i===o.nodeValue.length&&kd(t,l,e,!1,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),s?L.some(zc(o,i)):L.none()},Od=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=zc.fromRangeStart(e);return Td(t,n,!0,r).each((function(t){n&&zc.isAbove(o,t)||r.setStart(t.container(),t.offset())})),n||Td(t,n,!1,r).each((function(t){r.setEnd(t.container(),t.offset())})),n&&r.collapse(!0),vd(e,r)?L.none():L.some(r)},_d=function(t,e){return t.splitText(e)},Ed=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&jn(e)?n>0&&n<e.nodeValue.length&&(e=(r=_d(e,n)).previousSibling,o>n?(e=r=_d(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(jn(e)&&n>0&&n<e.nodeValue.length&&(e=_d(e,n),n=0),jn(r)&&o>0&&o<r.nodeValue.length&&(o=(r=_d(r,o).previousSibling).nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}},Dd=function(t){return{walk:function(e,n){return Vf(t,e,n)},split:Ed,normalize:function(e){return Od(t,e).fold(R,(function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0}))}}};Dd.compareRanges=vd,Dd.getCaretRangeFromPoint=pd,Dd.getSelectedNode=fc,Dd.getNode=dc;var Ad,Md=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=cr(n,t);return parseFloat(o)||0}return r},r=function(t,e){return Q(e,(function(e,n){var r=cr(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!w(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;tr(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}("height",(function(t){var e=t.dom;return Cn(t)?e.getBoundingClientRect().height:e.offsetHeight})),zd=function(t,e){return t.view(e).fold(k([]),(function(e){var n=t.owner(e),r=zd(t,n);return[e].concat(r)}))},Rd=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?L.none():L.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(Me.fromDom)},owner:function(t){return Ke(t)}}),Nd=function(t){var e=Me.fromDom(document),n=_n(e),r=function(t,e){var n=e.owner(t);return zd(e,n)}(t,Rd),o=On(t),i=J(r,(function(t,e){var n=On(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return kn(i.left+o.left+n.left,i.top+o.top+n.top)},Bd=function(t){return"textarea"===Ve(t)},Pd=function(t,e){var n=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return kn(n.offsetLeft,n.offsetTop);var i=Tn(null==r?void 0:r.pageYOffset,o.scrollTop),u=Tn(null==r?void 0:r.pageXOffset,o.scrollLeft),a=Tn(o.clientTop,n.clientTop),c=Tn(o.clientLeft,n.clientLeft);return On(t).translate(u-c,i-a)}(t),r=function(t){return Md.get(t)}(t);return{element:t,bottom:n.top+r,height:r,pos:n,cleanup:e}},Id=function(t,e){var n=function(t,e){var n=en(t);if(0===n.length||Bd(t))return{element:t,offset:e};if(e<n.length&&!Bd(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return Bd(r)?{element:t,offset:e}:"img"===Ve(r)?{element:r,offset:1}:We(r)?{element:r,offset:td(r).length}:{element:r,offset:en(r).length}}(t,e),r=Me.fromHtml('<span data-mce-bogus="all">\ufeff</span>');return gn(n.element,r),Pd(r,(function(){return wn(r)}))},Ld=function(t,e,n,r){jd(t,(function(o,i){return Vd(t,e,n,r)}),n)},Hd=function(t,e,n,r,o){var i={elm:r.element.dom,alignToTop:o};(function(t,e){return t.fire("ScrollIntoView",e).isDefaultPrevented()})(t,i)||(n(e,_n(e).top,r,o),function(t,e){t.fire("AfterScrollIntoView",e)}(t,i))},Vd=function(t,e,n,r){var o=Me.fromDom(t.getBody()),i=Me.fromDom(t.getDoc());o.dom.offsetWidth;var u=Id(Me.fromDom(n.startContainer),n.startOffset);Hd(t,i,e,u,r),u.cleanup()},Fd=function(t,e,n,r){var o=Me.fromDom(t.getDoc());Hd(t,o,n,function(t){return Pd(Me.fromDom(t),x)}(e),r)},jd=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,u=n.endOffset;e(Me.fromDom(r),Me.fromDom(i));var a=t.dom.createRng();a.setStart(r,o),a.setEnd(i,u),t.selection.setRng(n)},Ud=function(t,e,n,r){var o=t.pos;if(n)En(o.left,o.top,r);else{var i=o.top-e+t.height;En(o.left,i,r)}},Wd=function(t,e,n,r,o){var i=n+e,u=r.pos.top,a=r.bottom,c=a-u>=n;u<e?Ud(r,n,!1!==o,t):u>i?Ud(r,n,c?!1!==o:!0===o,t):a>i&&!c&&Ud(r,n,!0===o,t)},qd=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Wd(t,e,o,n,r)},$d=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Wd(t,e,o,n,r);var i=Nd(n.element),u=Mn(window);i.top<u.y?Dn(n.element,!1!==r):i.top>u.bottom&&Dn(n.element,!0===r)},Gd=function(t,e,n){return Ld(t,qd,e,n)},Kd=function(t,e,n){return Fd(t,e,qd,n)},Xd=function(t,e,n){return Ld(t,$d,e,n)},Yd=function(t,e,n){return Fd(t,e,$d,n)},Jd=function(t,e,n){(t.inline?Gd:Xd)(t,e,n)},Qd=function(t){var e=ln(t).dom;return t.dom===e.activeElement},Zd=function(t){return void 0===t&&(t=Me.fromDom(document)),L.from(t.dom.activeElement).map(Me.fromDom)},tm=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},em=Er([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),nm=(em.before,em.on,em.after,function(t){return t.fold(T,T,T)}),rm=Er([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),om={domRange:rm.domRange,relative:rm.relative,exact:rm.exact,exactFromRange:function(t){return rm.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return Me.fromDom(t.startContainer)},relative:function(t,e){return nm(t)},exact:function(t,e,n,r){return t}})}(t);return Xe(e)},range:tm},im=he().browser,um=function(t,e){var n=We(e)?td(e).length:en(e).length+1;return t>n?n:t<0?0:t},am=function(t){return om.range(t.start,um(t.soffset,t.start),t.finish,um(t.foffset,t.finish))},cm=function(t,e){return!Rn(e.dom)&&(Ie(t,e)||Be(t,e))},sm=function(t){return function(e){return cm(t,e.start)&&cm(t,e.finish)}},lm=function(t){return!0===t.inline||im.isIE()},fm=function(t){return om.range(Me.fromDom(t.startContainer),t.startOffset,Me.fromDom(t.endContainer),t.endOffset)},dm=function(t){return function(t){var e=t.getSelection();return(e&&0!==e.rangeCount?L.from(e.getRangeAt(0)):L.none()).map(fm)}(Xe(t).dom).filter(sm(t))},mm=function(t){var e=document.createRange();try{return e.setStart(t.start.dom,t.soffset),e.setEnd(t.finish.dom,t.foffset),L.some(e)}catch(n){return L.none()}},gm=function(t){var e=lm(t)?dm(Me.fromDom(t.getBody())):L.none();t.bookmark=e.isSome()?e:t.bookmark},hm=function(t){return(t.bookmark?t.bookmark:L.none()).bind((function(e){return function(t,e){return L.from(e).filter(sm(t)).map(am)}(Me.fromDom(t.getBody()),e)})).bind(mm)},pm={isEditorUIElement:function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")}},vm=function(t,e){he().browser.isIE()?function(t){t.on("focusout",(function(){gm(t)}))}(t):function(t,e){t.on("mouseup touchend",(function(t){e.throttle()}))}(t,e),t.on("keyup NodeChange",(function(e){(function(t){return"nodechange"===t.type&&t.selectionChange})(e)||gm(t)}))},bm=function(t){var e=za((function(){gm(t)}),0);t.on("init",(function(){t.inline&&function(t,e){var n=function(){e.throttle()};wa.DOM.bind(document,"mouseup",n),t.on("remove",(function(){wa.DOM.unbind(document,"mouseup",n)}))}(t,e),vm(t,e)})),t.on("remove",(function(){e.cancel()}))},ym=wa.DOM,wm=function(t,e){var n=function(t){return t.getParam("custom_ui_selector","","string")}(t);return null!==ym.getParent(e,(function(e){return function(t){return pm.isEditorUIElement(t)}(e)||!!n&&t.dom.is(e,n)}))},xm=function(t,e){var n=e.editor;bm(n),n.on("focusin",(function(){var e=t.focusedEditor;e!==n&&(e&&e.fire("blur",{focusedEditor:n}),t.setActive(n),t.focusedEditor=n,n.fire("focus",{blurredEditor:e}),n.focus(!0))})),n.on("focusout",(function(){co.setEditorTimeout(n,(function(){var e=t.focusedEditor;wm(n,function(t){try{var e=ln(Me.fromDom(t.getElement()));return Zd(e).fold((function(){return document.body}),(function(t){return t.dom}))}catch(n){return document.body}}(n))||e!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null)}))})),Ad||(Ad=function(e){var n=t.activeEditor;n&&function(t){if(sn()&&b(t.target)){var e=Me.fromDom(t.target);if(Ue(e)&&mn(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return at(n)}}return L.from(t.target)}(e).each((function(e){e.ownerDocument===document&&(e===document.body||wm(n,e)||t.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null))}))},ym.bind(document,"focusin",Ad))},Cm=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(ym.unbind(document,"focusin",Ad),Ad=null)},Sm=function(t,e){return function(t){return t.collapsed?L.from(dc(t.startContainer,t.startOffset)).map(Me.fromDom):L.none()}(e).bind((function(e){return xo(e)?L.some(e):!1===Ie(t,e)?L.some(t):L.none()}))},km=function(t,e){Sm(Me.fromDom(t.getBody()),e).bind((function(t){return jl(t.dom)})).fold((function(){t.selection.normalize()}),(function(e){return t.selection.setRng(e.toRange())}))},Tm=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},Om=function(t){return Qd(t)||(e=t,Zd(ln(e)).filter((function(t){return e.dom.contains(t.dom)}))).isSome();var e},_m=function(t){return t.inline?function(t){var e=t.getBody();return e&&Om(Me.fromDom(e))}(t):function(t){return t.iframeElement&&Qd(Me.fromDom(t.iframeElement))}(t)},Em=function(t){return _m(t)||function(t){var e=ln(Me.fromDom(t.getElement()));return Zd(e).filter((function(e){return!(void 0!==(n=e.dom.classList)&&(n.contains("tox-edit-area")||n.contains("tox-edit-area__iframe")||n.contains("mce-content-body")))&&wm(t,e.dom);var n})).isSome()}(t)},Dm=function(t){return t.editorManager.setActive(t)},Am=function(t,e){t.removed||(e?Dm(t):function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===_m(t)&&hm(t).each((function(e){t.selection.setRng(e),r=e}));var o=function(t,e){return t.dom.getParent(e,(function(e){return"true"===t.dom.getContentEditable(e)}))}(t,e.getNode());if(t.$.contains(n,o))return Tm(o),km(t,r),void Dm(t);t.inline||(ke.opera||Tm(n),t.getWin().focus()),(ke.gecko||t.inline)&&(Tm(n),km(t,r)),Dm(t)}(t))},Mm=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,u=n?e.startOffset:e.endOffset;return L.from(i).map(Me.fromDom).map((function(t){return r&&e.collapsed?t:nn(t,o(t,u)).getOr(t)})).bind((function(t){return Ue(t)?L.some(t):Ye(t).filter(Ue)})).map((function(t){return t.dom})).getOr(t)},zm=function(t,e,n){return Mm(t,e,!0,n,(function(t,e){return Math.min(un(t),e)}))},Rm=function(t,e,n){return Mm(t,e,!1,n,(function(t,e){return e>0?e-1:e}))},Nm=function(t,e){for(var n=t;t&&jn(t)&&0===t.length;)t=e?t.nextSibling:t.previousSibling;return t||n},Bm=function(t,e){return $(e,(function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e}))},Pm={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Im=function(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var u=t.parent;u&&u!==e;u=u.parent)if(i=u[o])return i}},Lm=function(t){if(!Zo(t.value))return!1;var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)},Hm=function(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e},Vm=function(){function t(t,e){this.name=t,this.type=e,1===e&&(this.attributes=[],this.attributes.map={})}return t.create=function(e,n){var r=new t(e,Pm[e]||1);return n&&mt(n,(function(t,e){r.attr(e,t)})),r},t.prototype.replace=function(t){var e=this;return t.parent&&t.remove(),e.insert(t,e),e.remove(),e},t.prototype.attr=function(t,e){var n,r=this;if("string"!=typeof t)return null!=t&&mt(t,(function(t,e){r.attr(e,t)})),r;if(n=r.attributes){if(void 0!==e){if(null===e){if(t in n.map){delete n.map[t];for(var o=n.length;o--;)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){for(o=n.length;o--;)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}return n.map[t]}},t.prototype.clone=function(){var e,n=this,r=new t(n.name,n.type);if(e=n.attributes){var o=[];o.map={};for(var i=0,u=e.length;i<u;i++){var a=e[i];"id"!==a.name&&(o[o.length]={name:a.name,value:a.value},o.map[a.name]=a.value)}r.attributes=o}return r.value=n.value,r.shortEnded=n.shortEnded,r},t.prototype.wrap=function(t){var e=this;return e.parent.insert(t,e),t.append(e),e},t.prototype.unwrap=function(){for(var t=this,e=t.firstChild;e;){var n=e.next;t.insert(e,t,!0),e=n}t.remove()},t.prototype.remove=function(){var t=this,e=t.parent,n=t.next,r=t.prev;return e&&(e.firstChild===t?(e.firstChild=n,n&&(n.prev=null)):r.next=n,e.lastChild===t?(e.lastChild=r,r&&(r.next=null)):n.prev=r,t.parent=t.next=t.prev=null),t},t.prototype.append=function(t){var e=this;t.parent&&t.remove();var n=e.lastChild;return n?(n.next=t,t.prev=n,e.lastChild=t):e.lastChild=e.firstChild=t,t.parent=e,t},t.prototype.insert=function(t,e,n){t.parent&&t.remove();var r=e.parent||this;return n?(e===r.firstChild?r.firstChild=t:e.prev.next=t,t.prev=e.prev,t.next=e,e.prev=t):(e===r.lastChild?r.lastChild=t:e.next.prev=t,t.next=e.next,t.prev=e,e.next=t),t.parent=r,t},t.prototype.getAll=function(t){for(var e=[],n=this.firstChild;n;n=Im(n,this))n.name===t&&e.push(n);return e},t.prototype.children=function(){for(var t=[],e=this.firstChild;e;e=e.next)t.push(e);return t},t.prototype.empty=function(){var t=this;if(t.firstChild){for(var e=[],n=t.firstChild;n;n=Im(n,t))e.push(n);for(var r=e.length;r--;)(n=e[r]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return t.firstChild=t.lastChild=null,t},t.prototype.isEmpty=function(t,e,n){void 0===e&&(e={});var r=this,o=r.firstChild;if(Hm(r))return!1;if(o)do{if(1===o.type){if(o.attr("data-mce-bogus"))continue;if(t[o.name])return!1;if(Hm(o))return!1}if(8===o.type)return!1;if(3===o.type&&!Lm(o))return!1;if(3===o.type&&o.parent&&e[o.parent.name]&&Zo(o.value))return!1;if(n&&n(o))return!1}while(o=Im(o,r));return!0},t.prototype.walk=function(t){return Im(this,null,t)},t}(),Fm=function(t,e){return t.replace(e.re,(function(t){return wt(e.uris,t).getOr(t)}))},jm=["img","video"],Um=De.makeMap("button,fieldset,form,iframe,img,image,input,object,output,select,textarea"),Wm=function(t,e,n){return!t.allow_html_data_urls&&(/^data:image\//i.test(e)?function(t,e){return!(v(t)?W(jm,e):t)}(t.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(e):/^data:/i.test(e))},qm=function(t,e,n){for(var r=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,o=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=t.getShortEndedElements(),u=1,a=n;0!==u;)for(r.lastIndex=a;;){var c=r.exec(e);if(null===c)return a;if("!"===c[1]){a=Ht(c[2],"--")?$m(e,!1,c.index+"!--".length):$m(e,!0,c.index+1);break}o.lastIndex=r.lastIndex;var s=o.exec(e);if(!g(s)&&s.index===r.lastIndex){"/"===c[1]?u-=1:xt(i,c[2])||(u+=1),a=r.lastIndex+s[0].length;break}}return a},$m=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(t,e){return/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(t.substr(e))}(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var u=/--!?>/g;u.lastIndex=n;var a=u.exec(t);return a?a.index+a[0].length:r.length},Gm=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null},Km=function(t,e){var n;void 0===e&&(e=Ri());var r=null!==(n=(t=t||{}).document)&&void 0!==n?n:document,o=r.createElement("form");!1!==t.fix_self_closing&&(t.fix_self_closing=!0);var i=t.comment?t.comment:x,u=t.cdata?t.cdata:x,a=t.text?t.text:x,c=t.start?t.start:x,s=t.end?t.end:x,l=t.pi?t.pi:x,f=t.doctype?t.doctype:x,d=function(n,d){void 0===d&&(d="html");for(var m,g,h,p,v,b,y,w,x,C,S,k,T,O,_,E,D,A,M,z=n.html,R=0,N=[],B=0,P=Si.decode,I=De.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),L=/((java|vb)script|mhtml):/i,H="html"===d?0:1,V=function(t){var e,n;for(e=N.length;e--&&N[e].name!==t;);if(e>=0){for(n=N.length-1;n>=e;n--)(t=N[n]).valid&&s(t.name);N.length=e}},F=function(t,e){return a(Fm(t,n),e)},j=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),i(Fm(e,n)))},U=function(t,e){var n=t||"",r=!Ht(n,"--"),o=$m(z,r,e);return t=z.substr(e,o-e),j(r?n+t:t),o+1},W=function(e,i,u,a,c){var s,l;if(u=function(t){return Fm(t,n)}((i=i.toLowerCase())in X?i:P(u||a||c||"")),Y&&!w&&!1===function(t){return 0===t.indexOf("data-")||0===t.indexOf("aria-")}(i)){if(!(s=O[i])&&_){for(l=_.length;l--&&!(s=_[l]).pattern.test(i););-1===l&&(s=null)}if(!s)return;if(s.validValues&&!(u in s.validValues))return}if("name"!==i&&"id"!==i||!(e in Um)||!(u in r)&&!(u in o)){if(I[i]&&!t.allow_script_urls){var f=u.replace(/[\s\u0000-\u001F]+/g,"");try{f=decodeURIComponent(f)}catch(d){f=unescape(f)}if(L.test(f))return;if(Wm(t,f,e))return}w&&(i in I||0===i.indexOf("on"))||(p.map[i]=u,p.push({name:i,value:u}))}},q=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^'\">]+(?:\"[^\"]*\"|'[^']*'))*[^\"'>]*(?:\"[^\">]*|'[^'>]*)?|\\s*|\\/)>))","g"),$=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,G=e.getShortEndedElements(),K=t.self_closing_elements||e.getSelfClosingElements(),X=e.getBoolAttrs(),Y=t.validate,J=t.remove_internals,Q=t.fix_self_closing,Z=e.getSpecialElements(),tt=z+">";m=q.exec(tt);){var et=m[0];if(R<m.index&&F(P(z.substr(R,m.index-R))),g=m[7])":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),V(g);else if(g=m[8]){if(m.index+et.length>z.length){F(P(z.substr(m.index))),R=m.index+et.length;continue}":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),x=g in G,Q&&K[g]&&N.length>0&&N[N.length-1].name===g&&V(g);var nt=Gm($,m[9]);if(null!==nt){if("all"===nt){R=qm(e,z,q.lastIndex),q.lastIndex=R;continue}S=!1}if(!Y||(C=e.getElementRule(g))){if(S=!0,Y&&(O=C.attributes,_=C.attributePatterns),(T=m[9])?((w=-1!==T.indexOf("data-mce-type"))&&J&&(S=!1),(p=[]).map={},T.replace($,(function(t,e,n,r,o){return W(g,e,n,r,o),""}))):(p=[]).map={},Y&&!w){if(E=C.attributesRequired,D=C.attributesDefault,A=C.attributesForced,C.removeEmptyAttrs&&!p.length&&(S=!1),A)for(v=A.length;v--;)y=(k=A[v]).name,"{$uid}"===(M=k.value)&&(M="mce_"+B++),p.map[y]=M,p.push({name:y,value:M});if(D)for(v=D.length;v--;)(y=(k=D[v]).name)in p.map||("{$uid}"===(M=k.value)&&(M="mce_"+B++),p.map[y]=M,p.push({name:y,value:M}));if(E){for(v=E.length;v--&&!(E[v]in p.map););-1===v&&(S=!1)}if(k=p.map["data-mce-bogus"]){if("all"===k){R=qm(e,z,q.lastIndex),q.lastIndex=R;continue}S=!1}}S&&c(g,p,x)}else S=!1;if(h=Z[g]){h.lastIndex=R=m.index+et.length,(m=h.exec(z))?(S&&(b=z.substr(R,m.index-R)),R=m.index+m[0].length):(b=z.substr(R),R=z.length),S&&(b.length>0&&F(b,!0),s(g)),q.lastIndex=R;continue}x||(T&&T.indexOf("/")===T.length-1?S&&s(g):N.push({name:g,valid:S}))}else if(g=m[1])j(g);else if(g=m[2]){if(!(1===H||t.preserve_cdata||N.length>0&&e.isValidChild(N[N.length-1].name,"#cdata"))){R=U("",m.index+2),q.lastIndex=R;continue}u(g)}else if(g=m[3])f(g);else{if((g=m[4])||"<!"===et){R=U(g,m.index+et.length),q.lastIndex=R;continue}if(g=m[5]){if(1!==H){R=U("?",m.index+2),q.lastIndex=R;continue}l(g,m[6])}}R=m.index+et.length}for(R<z.length&&F(P(z.substr(R))),v=N.length-1;v>=0;v--)(g=N[v]).valid&&s(g.name)};return{parse:function(t,e){void 0===e&&(e="html"),d(function(t){for(var e,n=/data:[^;]+;base64,([a-z0-9\+\/=\s]+)/gi,r=[],o={},i=Ja("img"),u=0,a=0;e=n.exec(t);){var c=e[0],s=i+"_"+a++;o[s]=c,u<e.index&&r.push(t.substr(u,e.index-u)),r.push(s),u=e.index+c.length}var l=new RegExp(i+"_[0-9]+","g");return 0===u?{prefix:i,uris:o,html:t,re:l}:(u<t.length&&r.push(t.substr(u)),{prefix:i,uris:o,html:r.join(""),re:l})}(t),e)}}};Km.findEndTag=qm;var Xm=function(t,e){for(var n,r=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,o=t.schema,i=function(t,e){var n=new RegExp(["\\s?("+t.join("|")+')="[^"]+"'].join("|"),"gi");return e.replace(n,"")}(t.getTempAttrs(),e),u=o.getShortEndedElements();n=r.exec(i);){var a=r.lastIndex,c=n[0].length,s=void 0;s=u[n[1]]?a:Km.findEndTag(o,i,a),i=i.substring(0,a-c)+i.substring(s),r.lastIndex=a-c}return _o(i)},Ym=Xm,Jm=function(t,e,n,r){var o,i=function(t,e){return Mt(Mt({},t),{format:e,get:!0,getInner:!0})}(e,n),u=e.no_events?i:t.fire("BeforeGetContent",i);return o="raw"===u.format?De.trim(Ym(t.serializer,r.innerHTML)):"text"===u.format?t.dom.isEmpty(r)?"":_o(r.innerText||r.textContent):"tree"===u.format?t.serializer.serialize(r,u):function(t,e){var n=us(t),r=new RegExp("^(<"+n+"[^>]*>( | |\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return e.replace(r,"")}(t,t.serializer.serialize(r,u)),W(["text","tree"],u.format)||So(Me.fromDom(r))?u.content=o:u.content=De.trim(o),u.no_events?u.content:t.fire("GetContent",u).content},Qm=De.each,Zm=function(t){return{compare:function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return Qm(t.getAttribs(e),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))})),n},o=function(t,e){var n,r;for(r in t)if(xt(t,r)){if(void 0===(n=e[r]))return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(xt(e,r))return!1;return!0};return!(!o(r(e),r(n))||!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))||rf(e)||rf(n))}}},tg=De.makeMap,eg=function(t){var e=[],n=(t=t||{}).indent,r=tg(t.indent_before||""),o=tg(t.indent_after||""),i=Si.getEncodeFunc(t.entity_encoding||"raw",t.entities),u="html"===t.element_format;return{start:function(t,a,c){var s,l,f,d;if(n&&r[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n"),e.push("<",t),a)for(s=0,l=a.length;s<l;s++)f=a[s],e.push(" ",f.name,'="',i(f.value,!0),'"');e[e.length]=!c||u?">":" />",c&&n&&o[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n")},end:function(t){var r;e.push("</",t,">"),n&&o[t]&&e.length>0&&(r=e[e.length-1]).length>0&&"\n"!==r&&e.push("\n")},text:function(t,n){t.length>0&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("<![CDATA[",t,"]]>")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("<?",t," ",i(r),"?>"):e.push("<?",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("<!DOCTYPE",t,">",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}},ng=function(t,e){void 0===e&&(e=Ri());var n=eg(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)do{u(t)}while(t=t.next)}};n.reset();var u=function(t){var r=i[t.type];if(r)r(t);else{var a=t.name,c=t.shortEnded,s=t.attributes;if(o&&s&&s.length>1){var l=[];l.map={};var f=e.getElementRule(t.name);if(f){for(var d=0,m=f.attributesOrder.length;d<m;d++)if((h=f.attributesOrder[d])in s.map){var g=s.map[h];l.map[h]=g,l.push({name:h,value:g})}for(d=0,m=s.length;d<m;d++){var h;(h=s[d].name)in l.map||(g=s.map[h],l.map[h]=g,l.push({name:h,value:g}))}s=l}}if(n.start(t.name,s,c),!c){if(t=t.firstChild)do{u(t)}while(t=t.next);n.end(a)}}};return 1!==r.type||t.inner?i[11](r):u(r),n.getContent()}}},rg=new Set;G(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],(function(t){rg.add(t)}));var og=["font","text-decoration","text-emphasis"],ig=function(t,e){return ft(t.parseStyle(t.getAttrib(e,"style")))},ug=function(t,e){return rt(ig(t,e),(function(t){return!function(t){return rg.has(t)}(t)}))},ag=function(t,e,n){var r=ig(t,e),o=ig(t,n),i=function(r){var o=t.getStyle(e,r),i=t.getStyle(n,r);return Wt(o)&&Wt(i)&&o!==i};return q(r,(function(t){var e=function(e){return q(e,(function(e){return e===t}))};if(!e(o)&&e(og)){var n=Y(o,(function(t){return q(og,(function(e){return Ht(t,e)}))}));return q(n,i)}return i(t)}))},cg=function(t,e,n){return L.from(n.container()).filter(jn).exists((function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))}))},sg=_(cg,!0,uf),lg=_(cg,!1,uf),fg=function(t){var e=t.container();return jn(e)&&(0===e.data.length||Oo(e.data)&&ud.isBookmarkNode(e.parentNode))},dg=function(t,e){return function(n){return L.from(il(t?0:-1,n)).filter(e).isSome()}},mg=function(t){return Gn(t)&&"block"===cr(Me.fromDom(t),"display")},gg=function(t){return Xn(t)&&!function(t){return Nn(t)&&"all"===t.getAttribute("data-mce-bogus")}(t)},hg=dg(!0,mg),pg=dg(!1,mg),vg=dg(!0,Jn),bg=dg(!1,Jn),yg=dg(!0,Hn),wg=dg(!1,Hn),xg=dg(!0,gg),Cg=dg(!1,gg),Sg=function(t){var e=ja(t,"br"),n=Y(function(t){for(var e=[],n=t.dom;n;)e.push(Me.fromDom(n)),n=n.lastChild;return e}(t).slice(-1),vo);e.length===n.length&&G(n,wn)},kg=function(t){yn(t),vn(t,Me.fromHtml('<br data-mce-bogus="1">'))},Tg=function(t){on(t).each((function(e){Je(e).each((function(n){ho(t)&&vo(e)&&ho(n)&&wn(e)}))}))},Og=function(t,e,n){return Ie(e,t)?function(t,e){for(var n=y(e)?e:R,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=Me.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o}(t,(function(t){return n(t)||Be(t,e)})).slice(0,-1):[]},_g=function(t,e){return Og(t,e,R)},Eg=function(t,e){return[t].concat(_g(t,e))},Dg=function(t,e,n){return Ll(t,e,n,fg)},Ag=function(t,e){return tt(Eg(Me.fromDom(e.container()),t),ho)},Mg=function(t,e,n){return Dg(t,e.dom,n).forall((function(t){return Ag(e,n).fold((function(){return!1===ol(t,n,e.dom)}),(function(r){return!1===ol(t,n,e.dom)&&Ie(r,Me.fromDom(t.container()))}))}))},zg=function(t,e,n){return Ag(e,n).fold((function(){return Dg(t,e.dom,n).forall((function(t){return!1===ol(t,n,e.dom)}))}),(function(e){return Dg(t,e.dom,n).isNone()}))},Rg=_(zg,!1),Ng=_(zg,!0),Bg=_(Mg,!1),Pg=_(Mg,!0),Ig=function(t){return gl(t).exists(vo)},Lg=function(t,e,n){var r=Y(Eg(Me.fromDom(n.container()),e),ho),o=at(r).getOr(e);return Pl(t,o.dom,n).filter(Ig)},Hg=function(t,e){return gl(e).exists(vo)||Lg(!0,t,e).isSome()},Vg=function(t,e){return function(t){return L.from(t.getNode(!0)).map(Me.fromDom)}(e).exists(vo)||Lg(!1,t,e).isSome()},Fg=_(Lg,!1),jg=_(Lg,!0),Ug=function(t){return zc.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},Wg=function(t,e){var n=Y(Eg(Me.fromDom(e.container()),t),ho);return at(n).getOr(t)},qg=function(t,e){return Ug(e)?lg(e):lg(e)||Fl(Wg(t,e).dom,e).exists(lg)},$g=function(t,e){return Ug(e)?sg(e):sg(e)||Vl(Wg(t,e).dom,e).exists(sg)},Gg=function(t){return gl(t).bind((function(t){return Zr(t,Ue)})).exists((function(t){return e=cr(t,"white-space"),W(["pre","pre-wrap"],e);var e}))},Kg=function(t,e){return function(t,e){return Fl(t.dom,e).isNone()}(t,e)||function(t,e){return Vl(t.dom,e).isNone()}(t,e)||Rg(t,e)||Ng(t,e)||Vg(t,e)||Hg(t,e)},Xg=function(t,e){return!Gg(e)&&(Rg(t,e)||Bg(t,e)||Vg(t,e)||qg(t,e))},Yg=function(t,e){return!Gg(e)&&(Ng(t,e)||Pg(t,e)||Hg(t,e)||$g(t,e))},Jg=function(t,e){return Xg(t,e)||Yg(t,function(t){var e=t.container(),n=t.offset();return jn(e)&&n<e.data.length?zc(e,n+1):t}(e))},Qg=function(t,e){return of(t.charAt(e))},Zg=function(t){var e=t.container();return jn(e)&&Lt(e.data,ko)},th=function(t){var e=t.data,n=function(t){var e=t.split("");return $(e,(function(t,n){return of(t)&&n>0&&n<e.length-1&&af(e[n-1])&&af(e[n+1])?" ":t})).join("")}(e);return n!==e&&(t.data=n,!0)},eh=function(t,e){return L.some(e).filter(Zg).bind((function(e){var n=e.container();return function(t,e){var n=e.data,r=zc(e,0);return!(!Qg(n,0)||Jg(t,r)||(e.data=" "+n.slice(1),0))}(t,n)||th(n)||function(t,e){var n=e.data,r=zc(e,n.length-1);return!(!Qg(n,n.length-1)||Jg(t,r)||(e.data=n.slice(0,-1)+" ",0))}(t,n)?L.some(e):L.none()}))},nh=function(t){var e=Me.fromDom(t.getBody());t.selection.isCollapsed()&&eh(e,zc.fromRangeStart(t.selection.getRng())).each((function(e){t.selection.setRng(e.toRange())}))},rh=function(t,e,n){if(0!==n){var r=Me.fromDom(t),o=Qr(r,ho).getOr(r),i=t.data.slice(e,e+n),u=e+n>=t.data.length&&Yg(o,zc(t,t.data.length)),a=0===e&&Xg(o,zc(t,0));t.replaceData(e,n,function(t,e,n){return Q(t,(function(r,o){return uf(o)||of(o)?r.previousCharIsSpace||""===r.str&&e||r.str.length===t.length-1&&n?{previousCharIsSpace:!1,str:r.str+ko}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""}).str}(i,a,u))}},oh=function(t,e){var n=t.data.slice(e),r=n.length-jt(n).length;rh(t,e,r)},ih=function(t,e){var n=t.data.slice(0,e),r=n.length-Ut(n).length;rh(t,e-r,r)},uh=function(t,e,n,r){void 0===r&&(r=!0);var o=Ut(t.data).length,i=r?t:e,u=r?e:t;return r?i.appendData(u.data):i.insertData(0,u.data),wn(Me.fromDom(u)),n&&oh(i,o),i},ah=function(t,e){return function(t,e){var n=t.container(),r=t.offset();return!1===zc.isTextPosition(t)&&n===e.parentNode&&r>zc.before(e).offset()}(e,t)?zc(e.container(),e.offset()-1):e},ch=function(t){return Xo(t.previousSibling)?L.some((e=t.previousSibling,jn(e)?zc(e,e.data.length):zc.after(e))):t.previousSibling?Ul(t.previousSibling):L.none();var e},sh=function(t){return Xo(t.nextSibling)?L.some((e=t.nextSibling,jn(e)?zc(e,0):zc.before(e))):t.nextSibling?jl(t.nextSibling):L.none();var e},lh=function(t,e){return ch(e).orThunk((function(){return sh(e)})).orThunk((function(){return function(t,e){var n=zc.before(e.previousSibling?e.previousSibling:e.parentNode);return Fl(t,n).fold((function(){return Vl(t,zc.after(e))}),L.some)}(t,e)}))},fh=function(t,e){return sh(e).orThunk((function(){return ch(e)})).orThunk((function(){return function(t,e){return Vl(t,zc.after(e)).fold((function(){return Fl(t,zc.before(e))}),L.some)}(t,e)}))},dh=function(t,e,n){return function(t,e,n){return t?fh(e,n):lh(e,n)}(t,e,n).map(_(ah,n))},mh=function(t,e,n){n.fold((function(){t.focus()}),(function(n){t.selection.setRng(n.toRange(),e)}))},gh=function(t,e){return e&&xt(t.schema.getBlockElements(),Ve(e))},hh=function(t){if(ii(t)){var e=Me.fromHtml('<br data-mce-bogus="1">');return yn(t),vn(t,e),L.some(zc.before(e.dom))}return L.none()},ph=function(t,e,n){var r,o,i,u,a=Je(t).filter(We),c=Qe(t).filter(We);return wn(t),(r=a,o=c,i=e,u=function(t,e,r){var o=t.dom,i=e.dom,u=o.data.length;return uh(o,i,n),r.container()===i?zc(o,u):r},r.isSome()&&o.isSome()&&i.isSome()?L.some(u(r.getOrDie(),o.getOrDie(),i.getOrDie())):L.none()).orThunk((function(){return n&&(a.each((function(t){return ih(t.dom,t.dom.length)})),c.each((function(t){return oh(t.dom,0)}))),e}))},vh=function(t,e,n,r){void 0===r&&(r=!0);var o,i=dh(e,t.getBody(),n.dom),u=Qr(n,_(gh,t),(o=t.getBody(),function(t){return t.dom===o})),a=ph(n,i,function(t,e){return xt(t.schema.getTextInlineElements(),Ve(e))}(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(hh).fold((function(){r&&mh(t,e,a)}),(function(n){r&&mh(t,e,L.some(n))}))},bh=function(t){return ja(t,"td,th")},yh=function(t,e){return{start:t,end:e}},wh=Er([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),xh=function(t,e){return ro(Me.fromDom(t),"td,th",e)},Ch=function(t){return!Be(t.start,t.end)},Sh=function(t,e){return qf(t.start,e).bind((function(n){return qf(t.end,e).bind((function(t){return e=Be(n,t),r=n,e?L.some(r):L.none();var e,r}))}))},kh=function(t){return function(e){return Sh(e,t).map((function(t){return function(t,e,n){return{rng:t,table:e,cells:n}}(e,t,bh(t))}))}},Th=function(t,e,n,r){if(n.collapsed||!t.forall(Ch))return L.none();if(e.isSameTable){var o=t.bind(kh(r));return L.some({start:o,end:o})}var i=xh(n.startContainer,r),u=xh(n.endContainer,r),a=i.bind(function(t){return function(e){return qf(e,t).bind((function(t){return ct(bh(t)).map((function(t){return yh(e,t)}))}))}}(r)).bind(kh(r)),c=u.bind(function(t){return function(e){return qf(e,t).bind((function(t){return at(bh(t)).map((function(t){return yh(t,e)}))}))}}(r)).bind(kh(r));return L.some({start:a,end:c})},Oh=function(t,e){return et(t,(function(t){return Be(t,e)}))},_h=function(t){return Zn(Oh(t.cells,t.rng.start),Oh(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))},Eh=function(t,e,n){return t.exists((function(t){return function(t,e){return!Ch(t)&&Sh(t,e).exists((function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length}))}(t,n)&&Kf(t.start,e)}))},Dh=function(t,e){var n=e.startTable,r=e.endTable,o=t.cloneRange();return n.each((function(t){return o.setStartAfter(t.dom)})),r.each((function(t){return o.setEndBefore(t.dom)})),o},Ah=function(t,e){var n=function(t){return function(e){return Be(t,e)}}(t),r=function(t,e){var n=xh(t.startContainer,e),r=xh(t.endContainer,e);return Zn(n,r,yh)}(e,n),o=function(t,e){var n=function(t){return qf(Me.fromDom(t),e)},r=n(t.startContainer),o=n(t.endContainer),i=r.isSome(),u=o.isSome(),a=Zn(r,o,Be).getOr(!1);return{startTable:r,endTable:o,isStartInTable:i,isEndInTable:u,isSameTable:a,isMultiTable:!a&&i&&u}}(e,n);return Eh(r,e,n)?r.map((function(t){return wh.singleCellTable(e,t.start)})):o.isMultiTable?function(t,e,n,r){return Th(t,e,n,r).bind((function(t){var r=t.start,o=t.end,i=r.bind(_h).getOr([]),u=o.bind(_h).getOr([]);if(i.length>0&&u.length>0){var a=Dh(n,e);return L.some(wh.multiTable(i,u,a))}return L.none()}))}(r,o,e,n):function(t,e,n,r){return Th(t,e,n,r).bind((function(t){var e=t.start,n=t.end;return e.or(n)})).bind((function(t){var r=e.isSameTable,o=_h(t).getOr([]);if(r&&t.cells.length===o.length)return L.some(wh.fullTable(t.table));if(o.length>0){if(r)return L.some(wh.partialTable(o,L.none()));var i=Dh(n,e);return L.some(wh.partialTable(o,L.some(Mt(Mt({},e),{rng:i}))))}return L.none()}))}(r,o,e,n)},Mh=function(t){var e;return(8===Fe(e=t)||"#comment"===Ve(e)?Je(t):on(t)).bind(Mh).orThunk((function(){return L.some(t)}))},zh=function(t){return G(t,(function(t){ur(t,"contenteditable"),kg(t)}))},Rh=function(t,e){var n=Wf(t);t.selection.setCursorLocation(e.dom,0),n.length>1&&nr(e,"data-mce-selected","1")},Nh=function(t,e,n){return zh(e),n.map((function(e){var n=e.rng,r=e.isStartInTable,o=function(t,e){return L.from(t.dom.getParent(e,t.dom.isBlock)).map(Me.fromDom)}(t,r?n.endContainer:n.startContainer);n.deleteContents(),function(t,e,n){n.each((function(n){e?wn(n):(kg(n),t.selection.setCursorLocation(n.dom,0))}))}(t,r,o.filter(ii))})),n.forall((function(t){return t.isStartInTable}))?Rh(t,e[0]):t.selection.collapse(!0),!0},Bh=function(t,e,n,r){return zh(e.concat(n)),r.deleteContents(),Rh(t,e[0]),!0},Ph=function(t,e,n){e.deleteContents();var r,o=Mh(n).getOr(n),i=Me.fromDom(t.dom.getParent(o.dom,t.dom.isBlock));if(ii(i)&&(kg(i),t.selection.setCursorLocation(i.dom,0)),!Be(n,i)){var u=Qn(Ye(i),n)?[]:Ye(r=i).map(en).map((function(t){return Y(t,(function(t){return!Be(r,t)}))})).getOr([]);G(u.concat(en(n)),(function(t){Be(t,i)||Ie(t,i)||wn(t)}))}return!0},Ih=function(t,e){return vh(t,!1,e),!0},Lh=function(t,e,n,r){return Vh(e,r).fold((function(){return function(t,e,n){return Ah(e,n).map((function(e){return e.fold(_(Ph,t),_(Ih,t),_(Nh,t),_(Bh,t))}))}(t,e,n)}),(function(e){return function(t,e){return Fh(t,e)}(t,e)})).getOr(!1)},Hh=function(t,e){return tt(Eg(e,t),Co)},Vh=function(t,e){return tt(Eg(e,t),(n="caption",function(t){return Ue(t)&&Ve(t)===n}));var n},Fh=function(t,e){return kg(e),t.selection.setCursorLocation(e.dom,0),L.some(!0)},jh=function(t,e,n,r,o){return Il(n,t.getBody(),o).bind((function(i){return function(t,e,n,r){return jl(t.dom).bind((function(o){return Ul(t.dom).map((function(t){return e?n.isEqual(o)&&r.isEqual(t):n.isEqual(t)&&r.isEqual(o)}))})).getOr(!0)}(r,n,o,i)?function(t,e){return Fh(t,e)}(t,r):function(t,e,n){return Vh(t,Me.fromDom(n.getNode())).map((function(t){return!1===Be(t,e)}))}(e,r,i)})).or(L.some(!0))},Uh=function(t,e,n,r){var o=zc.fromRangeStart(t.selection.getRng());return Hh(n,r).bind((function(r){return ii(r)?Fh(t,r):function(t,e,n,r,o){return Il(n,t.getBody(),o).bind((function(t){return Hh(e,Me.fromDom(t.getNode())).map((function(t){return!1===Be(t,r)}))}))}(t,n,e,r,o)})).getOr(!1)},Wh=function(t,e){return t?yg(e):wg(e)},qh=function(t,e,n){var r=Me.fromDom(t.getBody());return Vh(r,n).fold((function(){return Uh(t,e,r,n)||function(t,e){var n=zc.fromRangeStart(t.selection.getRng());return Wh(e,n)||Pl(e,t.getBody(),n).exists((function(t){return Wh(e,t)}))}(t,e)}),(function(n){return function(t,e,n,r){var o=zc.fromRangeStart(t.selection.getRng());return ii(r)?Fh(t,r):jh(t,n,e,r,o)}(t,e,r,n).getOr(!1)}))},$h=function(t,e){var n=Me.fromDom(t.selection.getStart(!0)),r=Wf(t);return t.selection.isCollapsed()&&0===r.length?qh(t,e,n):function(t,e,n){var r=Me.fromDom(t.getBody()),o=t.selection.getRng();return 0!==n.length?Nh(t,n,L.none()):Lh(t,r,o,e)}(t,n,r)},Gh=function(t){var e=zc.fromRangeStart(t),n=zc.fromRangeEnd(t),r=t.commonAncestorContainer;return Pl(!1,r,n).map((function(o){return!ol(e,n,r)&&ol(e,o,r)?function(t,e,n,r){var o=document.createRange();return o.setStart(t,e),o.setEnd(n,r),o}(e.container(),e.offset(),o.container(),o.offset()):t})).getOr(t)},Kh=function(t){return t.collapsed?t:Gh(t)},Xh=function(t,e){return t.getBlockElements()[e.name]&&function(t){return t.firstChild&&t.firstChild===t.lastChild}(e)&&function(t){return"br"===t.name||t.value===ko}(e.firstChild)},Yh=function(t,e){var n=e.firstChild,r=e.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(t,e){var n=t.getNonEmptyElements();return e&&(e.isEmpty(n)||Xh(t,e))}(t,r)&&(r=r.prev),!(!n||n!==r||"ul"!==n.name&&"ol"!==n.name)},Jh=function(t){return t&&t.firstChild&&t.firstChild===t.lastChild&&function(t){return t.data===ko||$n(t)}(t.firstChild)},Qh=function(t){return t.length>0&&(!(e=t[t.length-1]).firstChild||Jh(e))?t.slice(0,-1):t;var e},Zh=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},tp=function(t,e){var n=zc.after(t),r=Ml(e).prev(n);return r?r.toRange():null},ep=function(t,e,n){var r=t.parentNode;return De.each(e,(function(e){r.insertBefore(e,t)})),function(t,e){var n=zc.before(t),r=Ml(e).next(n);return r?r.toRange():null}(t,n)},np=function(t,e,n,r){var o,i=function(t,e,n){var r=e.serialize(n);return function(t){var e=t.firstChild,n=t.lastChild;return e&&"META"===e.nodeName&&e.parentNode.removeChild(e),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),t}(t.createFragment(r))}(e,t,r),u=Zh(e,n.startContainer),a=Qh((o=i.firstChild,Y(o.childNodes,(function(t){return"LI"===t.nodeName})))),c=e.getRoot(),s=function(t){var r=zc.fromRangeStart(n),o=Ml(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||Zh(e,i.getNode())!==u};return s(1)?ep(u,a,c):s(2)?function(t,e,n,r){return r.insertAfter(e.reverse(),t),tp(e[0],n)}(u,a,c,e):function(t,e,n,r){var o=function(t,e){var n=e.cloneRange(),r=e.cloneRange();return n.setStartBefore(t),r.setEndAfter(t),[n.cloneContents(),r.cloneContents()]}(t,r),i=t.parentNode;return i.insertBefore(o[0],t),De.each(e,(function(e){i.insertBefore(e,t)})),i.insertBefore(o[1],t),i.removeChild(t),tp(e[e.length-1],n)}(u,a,c,n)},rp=Yn,op=function(t){var e=t.dom,n=Kh(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,rp);!function(t,e,n){return null!==n&&n===t.getParent(e.endContainer,rp)&&Kf(Me.fromDom(n),e)}(e,n,r)?t.getDoc().execCommand("Delete",!1,null):Ph(t,n,Me.fromDom(r))},ip=function(t,e,n){var r,o,i,u=t.selection,a=t.dom;/^ | $/.test(e)&&(e=function(t,e,n){var r=Me.fromDom(t.getRoot());return n=Xg(r,zc.fromRangeStart(e))?n.replace(/^ /," "):n.replace(/^ /," "),Yg(r,zc.fromRangeEnd(e))?n.replace(/( | )(<br( \/)>)?$/," "):n.replace(/ (<br( \/)?>)?$/," ")}(a,u.getRng(),e));var c=t.parser,s=n.merge,l=ng({validate:Ss(t)},t.schema),f='<span id="mce_marker" data-mce-type="bookmark"></span>',d=t.fire("BeforeSetContent",{content:e,format:"html",selection:!0,paste:n.paste});if(d.isDefaultPrevented())t.fire("SetContent",{content:d.content,format:"html",selection:!0,paste:n.paste});else{-1===(e=d.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,f);var m=(o=u.getRng()).startContainer||(o.parentElement?o.parentElement():null),g=t.getBody();m===g&&u.isCollapsed()&&a.isBlock(g.firstChild)&&function(t,e){return e&&!t.schema.getShortEndedElements()[e.nodeName]}(t,g.firstChild)&&a.isEmpty(g.firstChild)&&((o=a.createRng()).setStart(g.firstChild,0),o.setEnd(g.firstChild,0),u.setRng(o)),u.isCollapsed()||op(t);var h,p={context:(r=u.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},v=c.parse(e,p);if(!0===n.paste&&Yh(t.schema,v)&&function(t,e){return!!Zh(t,e)}(a,r))return o=np(l,a,u.getRng(),v),u.setRng(o),void t.fire("SetContent",d);if(function(t){for(var e=t;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(v),"mce_marker"===(i=v.lastChild).attr("id")){var y=i;for(i=i.prev;i;i=i.walk(!0))if(3===i.type||!a.isBlock(i.name)){t.schema.isValidChild(i.parent.name,"span")&&i.parent.insert(y,i,"br"===i.name);break}}if(t._selectionOverrides.showBlockCaretContainer(r),p.invalid){t.selection.setContent(f),r=u.getNode();var w=t.getBody();for(9===r.nodeType?r=i=w:i=r;i!==w;)r=i,i=i.parentNode;e=r===w?w.innerHTML:a.getOuterHTML(r),e=l.serialize(c.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return l.serialize(v)})))),r===w?a.setHTML(w,e):a.setOuterHTML(r,e)}else!function(t,e,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(t.dom.createFragment(e),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?t.dom.setHTML(n,e):t.selection.setContent(e)}}(t,e=l.serialize(v),r);!function(t,e){var n=t.schema.getTextInlineElements(),r=t.dom;if(e){var o=t.getBody(),i=Zm(r);De.each(r.select("*[data-mce-fragment]"),(function(t){if(b(n[t.nodeName.toLowerCase()])&&ug(r,t))for(var e=t.parentNode;b(e)&&e!==o&&!ag(r,t,e);e=e.parentNode)if(i.compare(e,t)){r.remove(t,!0);break}}))}}(t,s),function(t,e){var n,r=t.dom,o=t.selection;if(e){o.scrollIntoView(e);var i=function(e){for(var n=t.getBody();e&&e!==n;e=e.parentNode)if("false"===r.getContentEditable(e))return e;return null}(e);if(i)return r.remove(e),void o.select(i);var u=r.createRng(),a=e.previousSibling;if(jn(a)){if(u.setStart(a,a.nodeValue.length),!ke.ie){var c=e.nextSibling;jn(c)&&(a.appendData(c.data),c.parentNode.removeChild(c))}}else u.setStartBefore(e),u.setEndBefore(e);var s=r.getParent(e,r.isBlock);r.remove(e),s&&r.isEmpty(s)&&(t.$(s).empty(),u.setStart(s,0),u.setEnd(s,0),rp(s)||function(t){return!!t.getAttribute("data-mce-fragment")}(s)||!(n=function(e){var n=zc.fromRangeStart(e);if(n=Ml(t.getBody()).next(n))return n.toRange()}(u))?r.add(s,r.create("br",{"data-mce-bogus":"1"})):(u=n,r.remove(s))),o.setRng(u)}}(t,a.get("mce_marker")),h=t.getBody(),De.each(h.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")})),function(t,e){L.from(t.getParent(e,"td,th")).map(Me.fromDom).each(Tg)}(a,u.getStart()),t.fire("SetContent",d),t.addVisual()}},up=function(t,e){e(t),t.firstChild&&up(t.firstChild,e),t.next&&up(t.next,e)},ap=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var u in n.firstChild&&up(n.firstChild,(function(n){G(t,(function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})})),G(e,(function(t){"string"==typeof n.attr(t.name)&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})}))})),r)xt(r,u)&&i.push(r[u]);for(var a in o)xt(o,a)&&i.push(o[a]);return i}(t,e,n);G(r,(function(t){G(t.filter.callbacks,(function(e){e(t.nodes,t.filter.name,{})}))}))},cp=function(t){return t instanceof Vm},sp=function(t,e,n){t.dom.setHTML(t.getBody(),e),!0!==n&&function(t){_m(t)&&jl(t.getBody()).each((function(e){var n=e.getNode(),r=Hn(n)?jl(n).getOr(e):e;t.selection.setRng(r.toRange())}))}(t)},lp=function(t,e,n){var r=function(t,e){return Mt(Mt({format:"html"},t),{set:!0,content:cp(e)?"":e})}(n,e),o=n.no_events?r:t.fire("BeforeSetContent",r);return cp(e)||(e=o.content),L.from(t.getBody()).fold(k(e),(function(n){return cp(e)?function(t,e,n,r){ap(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=ng({validate:t.validate},t.schema).serialize(n);return r.content=So(Me.fromDom(e))?o:De.trim(o),sp(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r),n}(t,n,e,o):function(t,e,n,r){if(0===n.length||/^\s+$/.test(n)){var o='<br data-mce-bogus="1">';"TABLE"===e.nodeName?n="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(e.nodeName)&&(n="<li>"+o+"</li>");var i=us(t);i&&t.schema.isValidChild(e.nodeName.toLowerCase(),i.toLowerCase())?(n=o,n=t.dom.createHTML(i,as(t),n)):n||(n='<br data-mce-bogus="1">'),sp(t,n,r.no_selection),t.fire("SetContent",r)}else"raw"!==r.format&&(n=ng({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=So(Me.fromDom(e))?n:De.trim(n),sp(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r);return r.content}(t,n,e,o)}))},fp=function(t,e){return function(t,e){var n=t.dom;return n.parentNode?to(Me.fromDom(n.parentNode),(function(n){return!Be(t,n)&&e(n)})):L.none()}(t,e).isSome()},dp=function(t){return y(t)?t:R},mp=function(t,e,n){var r=e(t),o=dp(n);return r.orThunk((function(){return o(t)?L.none():function(t,e,n){for(var r=t.dom,o=dp(n);r.parentNode;){r=r.parentNode;var i=Me.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return L.none()}(t,e,o)}))},gp=hf,hp=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o<r.length;o++){var i=r[o];if(Cf(i)&&!1===i.inherit&&t.dom.is(e,i.selector))return!0}return!1},pp=function(t,e,n,r,o){var i=t.dom.getRoot();return e!==i&&(e=t.dom.getParent(e,(function(e){return!!hp(t,e,n)||e.parentNode===i||!!yp(t,e,n,r,!0)})),!!yp(t,e,n,r,o))},vp=function(t,e,n){return!!gp(e,n.inline)||!!gp(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0)},bp=function(t,e,n,r,o,i){var u=n[r];if(y(n.onmatch))return n.onmatch(e,n,r);if(u)if(p(u.length)){for(var a in u)if(xt(u,a)){var c="attributes"===r?t.getAttrib(e,a):vf(t,e,a),s=gf(u[a],i),l=v(c)||qt(c);if(l&&v(s))continue;if(o&&l&&!n.exact)return!1;if((!o||n.exact)&&!gp(c,pf(t,s,a)))return!1}}else for(var f=0;f<u.length;f++)if("attributes"===r?t.getAttrib(e,u[f]):vf(t,e,u[f]))return!0;return!0},yp=function(t,e,n,r,o){var i=t.formatter.get(n),u=t.dom;if(i&&e)for(var a=0;a<i.length;a++){var c=i[a];if(vp(t.dom,e,c)&&bp(u,e,c,"attributes",o,r)&&bp(u,e,c,"styles",o,r)){var s=c.classes;if(s)for(var l=0;l<s.length;l++)if(!t.dom.hasClass(e,gf(s[l],r)))return;return c}}},wp=function(t,e,n,r,o){if(r)return pp(t,r,e,n,o);if(r=t.selection.getNode(),pp(t,r,e,n,o))return!0;var i=t.selection.getStart();return!(i===r||!pp(t,i,e,n,o))},xp=function(t,e){var n=function(e){return Be(e,Me.fromDom(t.getBody()))};return L.from(t.selection.getStart(!0)).bind((function(r){return mp(Me.fromDom(r),(function(n){return lt(e,(function(e){return function(e,n){return yp(t,e.dom,n)?L.some(n):L.none()}(n,e)}))}),n)})).getOrNull()},Cp=function(t,e,n){return Q(n,(function(n,r){var o=function(t,e){return q(t.formatter.get(e),(function(t){var e=function(t){return t.length>1&&"%"===t.charAt(0)};return q(["styles","attributes"],(function(n){return wt(t,n).exists((function(t){var n=m(t)?t:yt(t);return q(n,e)}))}))}))}(t,r);return t.formatter.matchNode(e,r,{},o)?n.concat([r]):n}),[])},Sp=To,kp="_mce_caret",Tp=function(t){return function(t){for(var e=[];t;){if(3===t.nodeType&&t.nodeValue!==Sp||t.childNodes.length>1)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e}(t).length>0},Op=function(t){if(t){var e=new fo(t,t);for(t=e.current();t;t=e.next())if(jn(t))return t}return null},_p=function(t){var e=Me.fromTag("span");return rr(e,{id:kp,"data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&vn(e,Me.fromText(Sp)),e},Ep=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(Tp(e))vh(t,!1,Me.fromDom(e),n);else{var i=o.getRng(),u=r.getParent(e,r.isBlock),a=i.startContainer,c=i.startOffset,s=i.endContainer,l=i.endOffset,f=function(t){var e=Op(t);return e&&e.nodeValue.charAt(0)===Sp&&e.deleteData(0,1),e}(e);r.remove(e,!0),a===f&&c>0&&i.setStart(f,c-1),s===f&&l>0&&i.setEnd(f,l-1),u&&r.isEmpty(u)&&kg(Me.fromDom(u)),o.setRng(i)}},Dp=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)Ep(t,e,n);else if(!(e=$l(t.getBody(),o.getStart())))for(;e=r.get(kp);)Ep(t,e,!1)},Ap=function(t,e){return t.appendChild(e),e},Mp=function(t,e){var n=J(t,(function(t,e){return Ap(t,e.cloneNode(!1))}),e);return Ap(n,n.ownerDocument.createTextNode(Sp))},zp=function(t,e,n,r){var o,i,u,a=t.dom,c=t.selection,s=[],l=c.getRng(),f=l.startContainer,d=l.startOffset;for(i=f,3===f.nodeType&&(d!==f.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(yp(t,i,e,n,r)){u=i;break}i.nextSibling&&(o=!0),s.push(i),i=i.parentNode}if(u)if(o){var m=c.getBookmark();l.collapse(!0);var g=Hf(t,l,t.formatter.get(e),!0);g=Ed(g),t.formatter.remove(e,n,g,r),c.moveToBookmark(m)}else{var h=$l(t.getBody(),u),p=_p(!1).dom;!function(t,e,n){var r=t.dom,o=r.getParent(n,_(ff,t));o&&r.isEmpty(o)?n.parentNode.replaceChild(e,n):(Sg(Me.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(e,n):r.insertAfter(e,n))}(t,p,null!==h?h:u);var v=function(t,e,n,r,o,i){var u=t.formatter,a=t.dom,c=Y(ft(u.get()),(function(t){return t!==r&&!Lt(t,"removeformat")})),s=Cp(t,n,c);if(Y(s,(function(e){return!wf(t,e,r)})).length>0){var l=n.cloneNode(!1);return a.add(e,l),u.remove(r,o,l,i),a.remove(l),L.some(l)}return L.none()}(t,p,u,e,n,r),b=Mp(s.concat(v.toArray()),p);Ep(t,h,!1),c.setCursorLocation(b,1),a.isEmpty(u)&&a.remove(u)}},Rp=function(t){t.on("mouseup keydown",(function(e){!function(t,e){var n=t.selection,r=t.getBody();Dp(t,null,!1),8!==e&&46!==e||!n.isCollapsed()||n.getStart().innerHTML!==Sp||Dp(t,$l(r,n.getStart())),37!==e&&39!==e||Dp(t,$l(r,n.getStart()))}(t,e.keyCode)}))},Np=function(t,e){var n=t.schema.getTextInlineElements();return xt(n,Ve(e))&&!ql(e.dom)&&!Ln(e.dom)},Bp={},Pp=Ot,Ip=kt;!function(t,e){Bp[t]||(Bp[t]=[]),Bp[t].push(e)}("pre",(function(t){var e,n=t.selection.getRng(),r=Bn(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),Ip(Pp(Pp(e,r),(function(t){return r(t.previousSibling)&&-1!==_t(e,t.previousSibling)})),(function(t){var e,n;e=t.previousSibling,ma(n=t).remove(),ma(e).append("<br><br>").append(n.childNodes)})))}));var Lp,Hp,Vp=De.each,Fp=function(t){return Nn(t)&&!rf(t)&&!ql(t)&&!Ln(t)},jp=function(t,e){for(var n=t;n;n=n[e]){if(jn(n)&&Wt(n.data))return t;if(Nn(n)&&!rf(n))return n}return t},Up=function(t,e,n){var r=Zm(t);if(e&&n&&(e=jp(e,"previousSibling"),n=jp(n,"nextSibling"),r.compare(e,n))){for(var o=e.nextSibling;o&&o!==n;){var i=o;o=o.nextSibling,e.appendChild(i)}return t.remove(n),De.each(De.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},Wp=function(t,e,n,r){if(r&&!1!==e.merge_siblings){var o=Up(t,lf(r),r);Up(t,o,lf(o,!0))}},qp=function(t,e,n){Vp(t.childNodes,(function(t){Fp(t)&&(e(t)&&n(t),t.hasChildNodes()&&qp(t,e,n))}))},$p=function(t,e){return function(n){return!(!n||!vf(t,n,e))}},Gp=function(t,e,n){return function(r){t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),function(t,e){"SPAN"===e.nodeName&&0===t.getAttribs(e).length&&t.remove(e,!0)}(t,r)}},Kp=Er([{keep:[]},{rename:["name"]},{removed:[]}]),Xp=/^(src|href|style)$/,Yp=De.each,Jp=hf,Qp=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},Zp=function(t,e,n){var r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"];if(Nn(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return jn(r)&&n&&o>=r.nodeValue.length&&(r=new fo(r,t.getBody()).next()||r),jn(r)&&!n&&0===o&&(r=new fo(r,t.getBody()).prev()||r),r},tv=function(t,e){var n=e?"firstChild":"lastChild";if(function(t){return/^(TR|TH|TD)$/.test(t.nodeName)}(t)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t},ev=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},nv=function(t,e,n,r,o){var i=Me.fromDom(e),u=Me.fromDom(t.create(r,o)),a=n?tn(i):Ze(i);return bn(u,a),n?(gn(i,u),pn(u,i)):(hn(i,u),vn(u,i)),u.dom},rv=function(t,e,n,r){var o=lf(e,n,r);return v(o)||"BR"===o.nodeName||t.isBlock(o)},ov=function(t,e,n){var r,o=e.parentNode,i=t.dom,u=us(t);xf(n)&&(u?o===i.getRoot()&&(n.list_block&&Jp(e,n.list_block)||G(st(e.childNodes),(function(e){df(t,u,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=ev(i,e,u),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=null}))):i.isBlock(e)&&!i.isBlock(o)&&(rv(i,e,!1)||rv(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),rv(i,e,!0)||rv(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),function(t){return Cf(t)&&Sf(t)&&Qn(wt(t,"mixed"),!0)}(n)&&!Jp(n.inline,e)||i.remove(e,!0)},iv=function(t,e,n,r,o){var i,u=t.dom;if(!function(t,e,n){return!(!Sf(n)||!Jp(e,n.inline))||!(!xf(n)||!Jp(e,n.block))||(Cf(n)?Nn(e)&&t.is(e,n.selector):void 0)}(u,r,e)&&!function(t,e){return e.links&&"A"===t.nodeName}(r,e))return Kp.keep();var a=r;if(Sf(e)&&"all"===e.remove&&m(e.preserve_attributes)){var c=Y(u.getAttribs(a),(function(t){return W(e.preserve_attributes,t.name.toLowerCase())}));if(u.removeAllAttribs(a),G(c,(function(t){return u.setAttrib(a,t.name,t.value)})),c.length>0)return Kp.rename("span")}if("all"!==e.remove){Yp(e.styles,(function(t,r){t=pf(u,gf(t,n),r+""),w(r)&&(r=t,o=null),(e.remove_similar||!o||Jp(vf(u,o,r),t))&&u.setStyle(a,r,""),i=!0})),i&&""===u.getAttrib(a,"style")&&(a.removeAttribute("style"),a.removeAttribute("data-mce-style")),Yp(e.attributes,(function(t,r){var i;if(t=gf(t,n),w(r)&&(r=t,o=null),e.remove_similar||!o||Jp(u.getAttrib(o,r),t)){if("class"===r&&(t=u.getAttrib(a,r))&&(i="",G(t.split(/\s+/),(function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)})),i))return void u.setAttrib(a,r,i);if(Xp.test(r)&&a.removeAttribute("data-mce-"+r),"style"===r&&Bn(["li"])(a)&&"none"===u.getStyle(a,"list-style-type"))return a.removeAttribute(r),void u.setStyle(a,"list-style-type","none");"class"===r&&a.removeAttribute("className"),a.removeAttribute(r)}})),Yp(e.classes,(function(t){t=gf(t,n),o&&!u.hasClass(o,t)||u.removeClass(a,t)}));for(var s=u.getAttribs(a),l=0;l<s.length;l++){var f=s[l].nodeName;if(0!==f.indexOf("_")&&0!==f.indexOf("data-"))return Kp.keep()}}return"none"!==e.remove?(ov(t,a,e),Kp.removed()):Kp.keep()},uv=function(t,e,n,r,o){return iv(t,e,n,r,o).fold(R,(function(e){return t.dom.rename(r,e),!0}),N)},av=function(t,e,n,r){return iv(t,e,n,r,r).fold(k(r),(function(e){return t.dom.createFragment().appendChild(r),t.dom.rename(r,e)}),k(null))},cv=function(t,e,n,r,o){var i=t.formatter.get(e),u=i[0],a=!0,c=t.dom,s=t.selection,l=function(r){var a=function(t,e,n,r,o){var i;return G(yf(t.dom,e.parentNode).reverse(),(function(e){if(!i&&"_start"!==e.id&&"_end"!==e.id){var u=yp(t,e,n,r,o);u&&!1!==u.split&&(i=e)}})),i}(t,r,e,n,o);return function(t,e,n,r,o,i,u,a){var c,s,l,f=t.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){c=f.clone(m,!1);for(var g=0;g<e.length&&null!==(c=av(t,e[g],a,c));g++);c&&(s&&c.appendChild(s),l||(l=c),s=c)}!i||u.mixed&&f.isBlock(n)||(r=f.split(n,r)),s&&(o.parentNode.insertBefore(s,o),l.appendChild(o),Sf(u)&&Wp(f,u,0,s))}return r}(t,i,a,r,r,!0,u,n)},f=function(e){return q(i,(function(r){return uv(t,r,n,e,e)}))},d=function(e){var n=!0,r=!1;Nn(e)&&c.getContentEditable(e)&&(n=a,a="true"===c.getContentEditable(e),r=!0);var o=st(e.childNodes);if(a&&!r){var i=f(e),s=e.parentNode;!i&&b(s)&&kf(u)&&f(s)}if(u.deep&&o.length){for(var l=0;l<o.length;l++)d(o[l]);r&&(a=n)}G(["underline","line-through","overline"],(function(n){Nn(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&bf(c,e.parentNode)===n&&uv(t,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,e)}))},m=function(t){var e=c.get(t?"_start":"_end"),n=e[t?"firstChild":"lastChild"];return function(t){return rf(t)&&Nn(t)&&("_start"===t.id||"_end"===t.id)}(n)&&(n=n[t?"firstChild":"lastChild"]),jn(n)&&0===n.data.length&&(n=t?e.previousSibling||e.nextSibling:e.nextSibling||e.previousSibling),c.remove(e,!0),n},g=function(e){var n,r,o=Hf(t,e,i,e.collapsed);if(u.split){if(o=Ed(o),(n=Zp(t,o,!0))!==(r=Zp(t,o))){if(n=tv(n,!0),r=tv(r,!1),Qp(c,n,r)){var a=L.from(n.firstChild).getOr(n);return l(nv(c,a,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void m(!0)}if(Qp(c,r,n))return a=L.from(r.lastChild).getOr(r),l(nv(c,a,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void m(!1);n=ev(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=ev(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),Vf(c,s,(function(t){G(t,(function(t){rf(t)||rf(t.parentNode)||l(t)}))})),l(n),l(r),n=m(!0),r=m()}else n=r=l(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=c.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=c.nodeIndex(r)+1}Vf(c,o,(function(t){G(t,d)}))};if(r){if(cf(r)){var h=c.createRng();h.setStartBefore(r),h.setEndAfter(r),g(h)}else g(r);fd(t,e,r,n)}else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&Sf(u)&&!Wf(t).length?zp(t,e,n,o):(Qf(s,!0,(function(){Jf(t,g)})),Sf(u)&&wp(t,e,n,s.getStart())&&sf(c,s,s.getRng()),t.nodeChanged()),fd(t,e,r,n);else{r=s.getNode();for(var p=0;p<i.length&&(!i[p].ceFalseOverride||!uv(t,i[p],n,r,r));p++);fd(t,e,r,n)}},sv=De.each,lv=function(t,e,n,r){sv(e,(function(e){Sf(e)&&sv(t.dom.select(e.inline,r),(function(r){Fp(r)&&uv(t,e,n,r,e.exact?r:null)})),function(t,e,n){if(e.clear_child_styles){var r=e.links?"*:not(a)":"*";Vp(t.select(r,n),(function(n){Fp(n)&&Vp(e.styles,(function(e,r){t.setStyle(n,r,"")}))}))}}(t.dom,e,r)}))},fv=De.each,dv=function(t){return Nn(t)&&!rf(t)&&!ql(t)&&!Ln(t)},mv=function(t,e,n,r){var o=t.formatter.get(e),i=o[0],u=!r&&t.selection.isCollapsed(),a=t.dom,c=t.selection,s=function(t,e){if(void 0===e&&(e=i),y(e.onformat)&&e.onformat(t,e,n,r),fv(e.styles,(function(e,r){a.setStyle(t,r,gf(e,n))})),e.styles){var o=a.getAttrib(t,"style");o&&a.setAttrib(t,"data-mce-style",o)}fv(e.attributes,(function(e,r){a.setAttrib(t,r,gf(e,n))})),fv(e.classes,(function(e){e=gf(e,n),a.hasClass(t,e)||a.addClass(t,e)}))},l=function(t,e){var n=!1;return fv(t,(function(t){return!!Cf(t)&&(b(t.collapsed)&&t.collapsed!==u?void 0:a.is(e,t.selector)&&!ql(e)?(s(e,t),n=!0,!1):void 0)})),n},d=function(r,u,c){var d=[],m=!0,g=i.inline||i.block,h=function(t){if(f(t)){var e=a.create(t);return s(e),e}return null}(g);Vf(r,u,(function(u){var a,f=function(u){var p=!1,v=m,y=u.nodeName.toLowerCase(),w=u.parentNode,x=w.nodeName.toLowerCase();if(Nn(u)&&r.getContentEditable(u)&&(v=m,m="true"===r.getContentEditable(u),p=!0),$n(u)&&!function(t,e,n,r){if(function(t){return t.getParam("format_empty_lines",!1,"boolean")}(t)&&Sf(e)){var o=Mt(Mt({},t.schema.getTextBlockElements()),{td:{},th:{},li:{},dt:{},dd:{},figcaption:{},caption:{},details:{},summary:{}}),i=fp(Me.fromDom(n),(function(t){return ql(t.dom)}));return Ct(o,r)&&ii(Me.fromDom(n.parentNode),!1)&&!i}return!1}(t,i,u,x))return a=null,void(xf(i)&&r.remove(u));if(xf(i)&&i.wrapper&&yp(t,u,e,n))a=null;else{if(m&&!p&&xf(i)&&!i.wrapper&&ff(t,y)&&df(t,x,g)){var C=r.rename(u,g);return s(C),d.push(C),void(a=null)}if(Cf(i)){var S=l(o,u);if(!S&&b(w)&&kf(i)&&(S=l(o,w)),!Sf(i)||S)return void(a=null)}!m||p||!df(t,g,y)||!df(t,x,g)||!c&&jn(u)&&Oo(u.data)||ql(u)||Sf(i)&&r.isBlock(u)?(a=null,G(st(u.childNodes),f),p&&(m=v),a=null):(a||(a=r.clone(h,!1),u.parentNode.insertBefore(a,u),d.push(a)),a.appendChild(u))}};G(u,f)})),!0===i.links&&G(d,(function(t){var e=function(t){"A"===t.nodeName&&s(t,i),G(st(t.childNodes),e)};e(t)})),G(d,(function(u){var a,c=(a=0,G(u.childNodes,(function(t){(function(t){return b(t)&&jn(t)&&0===t.length})(t)||rf(t)||a++})),a);!(d.length>1)&&r.isBlock(u)||0!==c?(Sf(i)||xf(i)&&i.wrapper)&&(i.exact||1!==c||(u=function(t){return tt(t.childNodes,dv).filter((function(t){return vp(r,t,i)})).map((function(e){var n=r.clone(e,!1);return s(n),r.replace(n,t,!0),r.remove(e,!0),n})).getOr(t)}(u)),lv(t,o,n,u),function(t,e,n,r,o){yp(t,o.parentNode,n,r)&&uv(t,e,r,o)||e.merge_with_parents&&t.dom.getParent(o.parentNode,(function(i){if(yp(t,i,n,r))return uv(t,e,r,o),!0}))}(t,i,e,n,u),function(t,e,n,r){e.styles&&e.styles.backgroundColor&&qp(r,$p(t,"fontSize"),Gp(t,"backgroundColor",gf(e.styles.backgroundColor,n)))}(r,i,n,u),function(t,e,n,r){var o=function(e){if(1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType){var n=bf(t,e.parentNode);t.getStyle(e,"color")&&n?t.setStyle(e,"text-decoration",n):t.getStyle(e,"text-decoration")===n&&t.setStyle(e,"text-decoration",null)}};e.styles&&(e.styles.color||e.styles.textDecoration)&&(De.walk(r,o,"childNodes"),o(r))}(r,i,0,u),function(t,e,n,r){!Sf(e)||"sub"!==e.inline&&"sup"!==e.inline||(qp(r,$p(t,"fontSize"),Gp(t,"fontSize","")),t.remove(t.select("sup"===e.inline?"sub":"sup",r),!0))}(r,i,0,u),Wp(r,i,0,u)):r.remove(u,!0)}))};if("false"!==a.getContentEditable(c.getNode())){if(i){if(r)if(cf(r)){if(!l(o,r)){var m=a.createRng();m.setStartBefore(r),m.setEndAfter(r),d(a,Hf(t,m,o),!0)}}else d(a,r,!0);else if(u&&Sf(i)&&!Wf(t).length)!function(t,e,n){var r,o,i=t.selection,u=i.getRng(),a=u.startOffset,c=u.startContainer.nodeValue;(r=$l(t.getBody(),i.getStart()))&&(o=Op(r));var s,l,f=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(c&&a>0&&a<c.length&&f.test(c.charAt(a))&&f.test(c.charAt(a-1))){var d=i.getBookmark();u.collapse(!0);var m=Hf(t,u,t.formatter.get(e));m=Ed(m),t.formatter.apply(e,n,m),i.moveToBookmark(d)}else r&&o.nodeValue===Sp||(s=t.getDoc(),l=_p(!0).dom,o=(r=s.importNode(l,!0)).firstChild,u.insertNode(r),a=1),t.formatter.apply(e,n,r),i.setCursorLocation(o,a)}(t,e,n);else{var g=c.getNode(),h=o[0];t.settings.forced_root_block||!h.defaultBlock||a.getParent(g,a.isBlock)||mv(t,h.defaultBlock),c.setRng(Kh(c.getRng())),Qf(c,!0,(function(){Jf(t,(function(e,n){var r=n?e:Hf(t,e,o);d(a,r,!1)}))})),sf(a,c,c.getRng()),t.nodeChanged()}!function(t,e){Ip(Bp[t],(function(t){t(e)}))}(e,t)}ld(t,e,r,n)}else{r=c.getNode();for(var p=0,v=o.length;p<v;p++){var w=o[p];if(w.ceFalseOverride&&Cf(w)&&a.is(r,w.selector)){s(r,w);break}}ld(t,e,r,n)}},gv=function(t){return xt(t,"vars")},hv=function(t){return t.selection.getStart()},pv=function(t,e,n,r,o){return Z(e,(function(e){var i=t.formatter.matchNode(e,n,null!=o?o:{},r);return!p(i)}),(function(e){return!!hp(t,e,n)||!r&&b(t.formatter.matchNode(e,n,o,!0))}))},vv=function(t,e){var n=null!=e?e:hv(t);return Y(yf(t.dom,n),(function(t){return Nn(t)&&!Ln(t)}))},bv=function(t,e,n){var r=vv(t,e);mt(n,(function(n,o){var i=function(n){var i=pv(t,r,o,n.similar,gv(n)?n.vars:void 0),u=i.isSome();if(n.state.get()!==u){n.state.set(u);var a=i.getOr(e);gv(n)?n.callback(u,{node:a,format:o,parents:r}):G(n.callbacks,(function(t){return t(u,{node:a,format:o,parents:r})}))}};G([n.withSimilar,n.withoutSimilar],i),G(n.withVars,i)}))},yv=function(t,e,n,r,o,i){return null===e.get()&&function(t,e){t.set({}),e.on("NodeChange",(function(n){bv(e,n.element,t.get())})),e.on("FormatApply FormatRemove",(function(n){var r=L.from(n.node).map((function(t){return cf(t)?t:t.startContainer})).bind((function(t){return Nn(t)?L.some(t):L.from(t.parentElement)})).getOrThunk((function(){return hv(e)}));bv(e,r,t.get())}))}(e,t),function(t,e,n,r,o,i){var u=e.get();G(n.split(","),(function(e){var n=wt(u,e).getOrThunk((function(){var t={withSimilar:{state:Ta(!1),similar:!0,callbacks:[]},withoutSimilar:{state:Ta(!1),similar:!1,callbacks:[]},withVars:[]};return u[e]=t,t})),a=function(){var n=vv(t);return pv(t,n,e,o,i).isSome()};if(p(i)){var c=o?n.withSimilar:n.withoutSimilar;c.callbacks.push(r),1===c.callbacks.length&&c.state.set(a())}else n.withVars.push({state:Ta(a()),similar:o,vars:i,callback:r})})),e.set(u)}(t,e,n,r,o,i),{unbind:function(){return function(t,e,n){var r=t.get();G(e.split(","),(function(t){return wt(r,t).each((function(e){r[t]={withSimilar:Mt(Mt({},e.withSimilar),{callbacks:Y(e.withSimilar.callbacks,(function(t){return t!==n}))}),withoutSimilar:Mt(Mt({},e.withoutSimilar),{callbacks:Y(e.withoutSimilar.callbacks,(function(t){return t!==n}))}),withVars:Y(e.withVars,(function(t){return t.callback!==n}))}}))})),t.set(r)}(e,n,r)}}},wv=function(t,e){var n=(e||document).createDocumentFragment();return G(t,(function(t){n.appendChild(t.dom)})),Me.fromDom(n)},xv=function(t,e,n){return{element:t,width:e,rows:n}},Cv=function(t,e){return{element:t,cells:e}},Sv=function(t,e){return{x:t,y:e}},kv=function(t,e){var n=parseInt(or(t,e),10);return isNaN(n)?1:n},Tv=function(t,e,n){var r=t.rows;return!!(r[n]?r[n].cells:[])[e]},Ov=function(t){return Q(t,(function(t,e){return e.cells.length>t?e.cells.length:t}),0)},_v=function(t,e){for(var n=t.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(Be(o[i],e))return L.some(Sv(i,r));return L.none()},Ev=function(t,e,n,r,o){for(var i=[],u=t.rows,a=n;a<=o;a++){var c=u[a].cells,s=e<r?c.slice(e,r+1):c.slice(r,e+1);i.push(Cv(u[a].element,s))}return i},Dv=function(t){var e=xv(tc(t),0,[]);return G(ja(t,"tr"),(function(t,n){G(ja(t,"td,th"),(function(r,o){!function(t,e,n,r,o){for(var i=kv(o,"rowspan"),u=kv(o,"colspan"),a=t.rows,c=n;c<n+i;c++){a[c]||(a[c]=Cv(ec(r),[]));for(var s=e;s<e+u;s++)a[c].cells[s]=c===n&&s===e?o:tc(o)}}(e,function(t,e,n){for(;Tv(t,e,n);)e++;return e}(e,o,n),n,t,r)}))})),xv(e.element,Ov(e.rows),e.rows)},Av=function(t){return function(t,e){var n=tc(t.element),r=Me.fromTag("tbody");return bn(r,e),vn(n,r),n}(t,function(t){return $(t.rows,(function(t){var e=$(t.cells,(function(t){var e=ec(t);return ur(e,"colspan"),ur(e,"rowspan"),e})),n=tc(t.element);return bn(n,e),n}))}(t))},Mv=function(t,e,n){return _v(t,e).bind((function(e){return _v(t,n).map((function(n){return function(t,e,n){var r=e.x,o=e.y,i=n.x,u=n.y,a=o<u?Ev(t,r,o,i,u):Ev(t,r,u,i,o);return xv(t.element,Ov(a),a)}(t,e,n)}))}))},zv=function(t,e){return tt(t,(function(t){return"li"===Ve(t)&&Kf(t,e)})).fold(k([]),(function(e){return function(t){return tt(t,(function(t){return"ul"===Ve(t)||"ol"===Ve(t)}))}(t).map((function(t){var e=Me.fromTag(Ve(t)),n=bt(fr(t),(function(t,e){return Ht(e,"list-style")}));return ar(e,n),[Me.fromTag("li"),e]})).getOr([])}))},Rv=function(t,e){var n=Me.fromDom(e.commonAncestorContainer),r=Eg(n,t),o=Y(r,(function(t){return po(t)||go(t)})),i=zv(r,e),u=o.concat(i.length?i:function(t){return wo(t)?Ye(t).filter(yo).fold(k([]),(function(e){return[t,e]})):yo(t)?[t]:[]}(n));return $(u,tc)},Nv=function(){return wv([])},Bv=function(t,e){return n=Me.fromDom(e.cloneContents()),r=Rv(t,e),o=Q(r,(function(t,e){return vn(e,t),e}),n),r.length>0?wv([o]):o;var n,r,o},Pv=function(t,e){return(n=t,r=e[0],eo(r,"table",_(Be,n))).bind((function(t){var n=e[0],r=e[e.length-1],o=Dv(t);return Mv(o,n,r).map((function(t){return wv([Av(t)])}))})).getOrThunk(Nv);var n,r},Iv=function(t,e){var n=Uf(e,t);return n.length>0?Pv(t,n):function(t,e){return e.length>0&&e[0].collapsed?Nv():Bv(t,e[0])}(t,e)},Lv=function(t,e){return e>=0&&e<t.length&&uf(t.charAt(e))},Hv=function(t,e){var n=_o(t.innerText);return e?function(t){return t.replace(/^[ \f\n\r\t\v]+/,"")}(n):n},Vv=function(t,e,n){void 0===n&&(n={});var r=function(t,e){return Mt(Mt({},t),{format:e,get:!0,selection:!0})}(n,e),o=t.fire("BeforeGetContent",r);if(o.isDefaultPrevented())return t.fire("GetContent",o),o.content;if("text"===o.format)return function(t){return L.from(t.selection.getRng()).map((function(e){var n=L.from(t.dom.getParent(e.commonAncestorContainer,t.dom.isBlock)),r=t.getBody(),o=function(t){return t.map((function(t){return t.nodeName})).getOr("div").toLowerCase()}(n),i=ke.browser.isIE()&&"pre"!==o,u=t.dom.add(r,o,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),a=Hv(u,i),c=_o(u.textContent);if(t.dom.remove(u),Lv(c,0)||Lv(c,c.length-1)){var s=n.getOr(r),l=Hv(s,i),f=l.indexOf(a);return-1===f?a:(Lv(l,f-1)?" ":"")+a+(Lv(l,f+a.length)?" ":"")}return a})).getOr("")}(t);o.getInner=!0;var i=function(t,e){var n=t.selection.getRng(),r=t.dom.create("body"),o=t.selection.getSel(),i=Bm(t,Ff(o)),u=e.contextual?Iv(Me.fromDom(t.getBody()),i).dom:n.cloneContents();return u&&r.appendChild(u),t.selection.serializer.serialize(r,e)}(t,o);return"tree"===o.format?i:(o.content=t.selection.isCollapsed()?"":i,t.fire("GetContent",o),o.content)},Fv=function(t){return Nn(t)?t.outerHTML:jn(t)?Si.encodeRaw(t.data,!1):Un(t)?"\x3c!--"+t.data+"--\x3e":""},jv=function(t,e,n){var r=function(t){var e,n=document.createElement("div"),r=document.createDocumentFragment();for(t&&(n.innerHTML=t);e=n.firstChild;)r.appendChild(e);return r}(e);if(t.hasChildNodes()&&n<t.childNodes.length){var o=t.childNodes[n];o.parentNode.insertBefore(r,o)}else t.appendChild(r)},Uv=function(t,e){var n,r,o,i,u,a,c,s,l,f=$(st(e.childNodes),Fv);return function(t,e){var n=0;G(t,(function(t){0===t[0]?n++:1===t[0]?(jv(e,t[1],n),n++):2===t[0]&&function(t,e){if(t.hasChildNodes()&&e<t.childNodes.length){var n=t.childNodes[e];n.parentNode.removeChild(n)}}(e,n)}))}((r=t,o=(n=f).length+r.length+2,i=new Array(o),u=new Array(o),a=function(t,e,o,i,u){var c=s(t,e,o,i);if(null===c||c.start===e&&c.diag===e-i||c.end===t&&c.diag===t-o)for(var l=t,f=o;l<e||f<i;)l<e&&f<i&&n[l]===r[f]?(u.push([0,n[l]]),++l,++f):e-t>i-o?(u.push([2,n[l]]),++l):(u.push([1,r[f]]),++f);else{a(t,c.start,o,c.start-c.diag,u);for(var d=c.start;d<c.end;++d)u.push([0,n[d]]);a(c.end,e,c.end-c.diag,i,u)}},c=function(t,e,o,i){for(var u=t;u-e<i&&u<o&&n[u]===r[u-e];)++u;return function(t,e,n){return{start:t,end:e,diag:n}}(t,u,e)},s=function(t,e,o,a){var s=e-t,l=a-o;if(0===s||0===l)return null;var f,d,m,g,h,p=s-l,v=l+s,b=(v%2==0?v:v+1)/2;for(i[1+b]=t,u[1+b]=e+1,f=0;f<=b;++f){for(d=-f;d<=f;d+=2){for(m=d+b,d===-f||d!==f&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,h=(g=i[m])-t+o-d;g<e&&h<a&&n[g]===r[h];)i[m]=++g,++h;if(p%2!=0&&p-f<=d&&d<=p+f&&u[m-p]<=i[m])return c(u[m-p],d+t-o,e,a)}for(d=p-f;d<=p+f;d+=2){for(m=d+b-p,d===p-f||d!==p+f&&u[m+1]<=u[m-1]?u[m]=u[m+1]-1:u[m]=u[m-1],h=(g=u[m]-1)-t+o-d;g>=t&&h>=o&&n[g]===r[h];)u[m]=g--,h--;if(p%2==0&&-f<=d&&d<=f&&u[m]<=i[m+p])return c(u[m],d+t-o,e,a)}}},l=[],a(0,n.length,0,r.length,l),l),e),e},Wv=Rt((function(){return document.implementation.createHTMLDocument("undo")})),qv=function(t){var e,n=(e=t.getBody(),Y($(st(e.childNodes),Fv),(function(t){return t.length>0}))),r=nt(n,(function(e){var n=Xm(t.serializer,e);return n.length>0?[n]:[]})),o=r.join("");return-1!==o.indexOf("</iframe>")?function(t){return{type:"fragmented",fragments:t,content:"",bookmark:null,beforeBookmark:null}}(r):function(t){return{type:"complete",fragments:null,content:t,bookmark:null,beforeBookmark:null}}(o)},$v=function(t,e,n){var r=n?e.beforeBookmark:e.bookmark;"fragmented"===e.type?Uv(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw",no_selection:!b(r)||!Gl(r)||!r.isFakeCaret}),t.selection.moveToBookmark(r)},Gv=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},Kv=function(t){var e=Me.fromTag("body",Wv());return Qa(e,Gv(t)),G(ja(e,"*[data-mce-bogus]"),xn),e.dom.innerHTML},Xv=function(t,e){return!(!t||!e)&&(!!function(t,e){return Gv(t)===Gv(e)}(t,e)||function(t,e){return Kv(t)===Kv(e)}(t,e))},Yv=function(t){return 0===t.get()},Jv=function(t,e,n){Yv(n)&&(t.typing=e)},Qv=function(t,e){t.typing&&(Jv(t,!1,e),t.add())},Zv=function(t){return{undoManager:{beforeChange:function(e,n){return function(t,e,n){Yv(e)&&n.set(ns(t.selection))}(t,e,n)},add:function(e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=qv(t);if(i=i||{},i=De.extend(i,a),!1===Yv(r)||t.removed)return null;var c=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:u}).isDefaultPrevented())return null;if(c&&Xv(c,i))return null;e.data[n.get()]&&o.get().each((function(t){e.data[n.get()].beforeBookmark=t}));var s=function(t){return t.getParam("custom_undo_redo_levels",0,"number")}(t);if(s&&e.data.length>s){for(var l=0;l<e.data.length-1;l++)e.data[l]=e.data[l+1];e.data.length--,n.set(e.data.length)}i.bookmark=ns(t.selection),n.get()<e.data.length-1&&(e.data.length=n.get()+1),e.data.push(i),n.set(e.data.length-1);var f={level:i,lastLevel:c,originalEvent:u};return n.get()>0?(t.setDirty(!0),t.fire("AddUndo",f),t.fire("change",f)):t.fire("AddUndo",f),i}(t,e,n,r,o,i,u)},undo:function(e,n,r){return function(t,e,n,r){var o;return e.typing&&(e.add(),e.typing=!1,Jv(e,!1,n)),r.get()>0&&(r.set(r.get()-1),o=e.data[r.get()],$v(t,o,!0),t.setDirty(!0),t.fire("Undo",{level:o})),o}(t,e,n,r)},redo:function(e,n){return function(t,e,n){var r;return e.get()<n.length-1&&(e.set(e.get()+1),r=n[e.get()],$v(t,r,!1),t.setDirty(!0),t.fire("Redo",{level:r})),r}(t,e,n)},clear:function(e,n){return function(t,e,n){e.data=[],n.set(0),e.typing=!1,t.fire("ClearUndos")}(t,e,n)},reset:function(t){return function(t){t.clear(),t.add()}(t)},hasUndo:function(e,n){return function(t,e,n){return n.get()>0||e.typing&&e.data[0]&&!Xv(qv(t),e.data[0])}(t,e,n)},hasRedo:function(t,e){return function(t,e){return e.get()<t.data.length-1&&!t.typing}(t,e)},transact:function(t,e,n){return function(t,e,n){return Qv(t,e),t.beforeChange(),t.ignore(n),t.add()}(t,e,n)},ignore:function(t,e){return function(t,e){try{t.set(t.get()+1),e()}finally{t.set(t.get()-1)}}(t,e)},extra:function(e,n,r,o){return function(t,e,n,r,o){if(e.transact(r)){var i=e.data[n.get()].bookmark,u=e.data[n.get()-1];$v(t,u,!0),e.transact(o)&&(e.data[n.get()-1].beforeBookmark=i)}}(t,e,n,r,o)}},formatter:{match:function(e,n,r,o){return wp(t,e,n,r,o)},matchAll:function(e,n){return function(t,e,n){var r=[],o={},i=t.selection.getStart();return t.dom.getParent(i,(function(i){for(var u=0;u<e.length;u++){var a=e[u];!o[a]&&yp(t,i,a,n)&&(o[a]=!0,r.push(a))}}),t.dom.getRoot()),r}(t,e,n)},matchNode:function(e,n,r,o){return yp(t,e,n,r,o)},canApply:function(e){return function(t,e){var n=t.formatter.get(e),r=t.dom;if(n)for(var o=t.selection.getStart(),i=yf(r,o),u=n.length-1;u>=0;u--){var a=n[u];if(!Cf(a)||b(a.defaultBlock))return!0;for(var c=i.length-1;c>=0;c--)if(r.is(i[c],a.selector))return!0}return!1}(t,e)},closest:function(e){return xp(t,e)},apply:function(e,n,r){return mv(t,e,n,r)},remove:function(e,n,r,o){return cv(t,e,n,r,o)},toggle:function(e,n,r){return function(t,e,n,r){var o=t.formatter.get(e);!wp(t,e,n,r)||"toggle"in o[0]&&!o[0].toggle?mv(t,e,n,r):cv(t,e,n,r)}(t,e,n,r)},formatChanged:function(e,n,r,o,i){return yv(t,e,n,r,o,i)}},editor:{getContent:function(e,n){return function(t,e,n){return L.from(t.getBody()).fold(k("tree"===e.format?new Vm("body",11):""),(function(r){return Jm(t,e,n,r)}))}(t,e,n)},setContent:function(e,n){return lp(t,e,n)},insertContent:function(e,n){return ip(t,e,n)},addVisual:function(e){return function(t,e){var n=t.dom,r=b(e)?e:t.getBody();p(t.hasVisual)&&(t.hasVisual=function(t){return t.getParam("visual",!0,"boolean")}(t)),G(n.select("table,a",r),(function(e){switch(e.nodeName){case"TABLE":var r=function(t){return t.getParam("visual_table_class","mce-item-table","string")}(t),o=n.getAttrib(e,"border");o&&"0"!==o||!t.hasVisual?n.removeClass(e,r):n.addClass(e,r);break;case"A":if(!n.getAttrib(e,"href")){var i=n.getAttrib(e,"name")||e.id,u=function(t){return t.getParam("visual_anchor_class","mce-item-anchor","string")}(t);i&&t.hasVisual?n.addClass(e,u):n.removeClass(e,u)}}})),t.fire("VisualAid",{element:e,hasVisual:t.hasVisual})}(t,e)}},selection:{getContent:function(e,n){return Vv(t,e,n)}},raw:{getModel:function(){return L.none()}}}},tb=function(t){return xt(t.plugins,"rtc")},eb=function(t){var e=t;return function(t){return wt(t.plugins,"rtc").bind((function(t){return L.from(t.setup)}))}(t).fold((function(){return e.rtcInstance=Zv(t),L.none()}),(function(t){var n,r;return e.rtcInstance=(n=k(null),r=k(""),{undoManager:{beforeChange:x,add:n,undo:n,redo:n,clear:x,reset:x,hasUndo:R,hasRedo:R,transact:n,ignore:x,extra:x},formatter:{match:R,matchAll:k([]),matchNode:k(void 0),canApply:R,closest:r,apply:x,remove:x,toggle:x,formatChanged:k({unbind:x})},editor:{getContent:r,setContent:r,insertContent:x,addVisual:x},selection:{getContent:r},raw:{getModel:k(L.none())}}),L.some((function(){return t().then((function(t){return e.rtcInstance=function(t){var e=function(t){return d(t)?t:{}},n=t.undoManager,r=t.formatter,o=t.editor,i=t.selection,u=t.raw;return{undoManager:{beforeChange:n.beforeChange,add:n.add,undo:n.undo,redo:n.redo,clear:n.clear,reset:n.reset,hasUndo:n.hasUndo,hasRedo:n.hasRedo,transact:function(t,e,r){return n.transact(r)},ignore:function(t,e){return n.ignore(e)},extra:function(t,e,r,o){return n.extra(r,o)}},formatter:{match:function(t,n,o,i){return r.match(t,e(n),i)},matchAll:r.matchAll,matchNode:r.matchNode,canApply:function(t){return r.canApply(t)},closest:function(t){return r.closest(t)},apply:function(t,n,o){return r.apply(t,e(n))},remove:function(t,n,o,i){return r.remove(t,e(n))},toggle:function(t,n,o){return r.toggle(t,e(n))},formatChanged:function(t,e,n,o,i){return r.formatChanged(e,n,o,i)}},editor:{getContent:function(t,e){return o.getContent(t)},setContent:function(t,e){return o.setContent(t,e)},insertContent:function(t,e){return o.insertContent(t)},addVisual:o.addVisual},selection:{getContent:function(t,e){return i.getContent(e)}},raw:{getModel:function(){return L.some(u.getRawModel())}}}}(t),t.rtc.isRemote}))}))}))},nb=function(t){return t.rtcInstance?t.rtcInstance:Zv(t)},rb=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},ob=function(t,e){return void 0===e&&(e={}),function(t,e,n){return rb(t).selection.getContent(e,n)}(t,e.format?e.format:"html",e)},ib=function(t){return 0===t.dom.length?(wn(t),L.none()):L.some(t)},ub=function(t,e,n,r){t.bind((function(t){return(r?ih:oh)(t.dom,r?t.dom.length:0),e.filter(We).map((function(e){return function(t,e,n,r){var o=t.dom,i=e.dom,u=r?o.length:i.length;r?(uh(o,i,!1,!r),n.setStart(i,u)):(uh(i,o,!1,!r),n.setEnd(i,u))}(t,e,n,r)}))})).orThunk((function(){return function(t,e){return t.filter((function(t){return ud.isBookmarkNode(t.dom)})).bind(e?Qe:Je)}(e,r).or(e).filter(We).map((function(t){return function(t,e){Ye(t).each((function(n){var r=t.dom;e&&Xg(n,zc(r,0))?oh(r,0):!e&&Yg(n,zc(r,r.length))&&ih(r,r.length)}))}(t,r)}))}))},ab=function(t,e,n){void 0===n&&(n={});var r=function(t,e){return Mt(Mt({format:"html"},t),{set:!0,selection:!0,content:e})}(n,e),o=r;if(!r.no_events){var i=t.fire("BeforeSetContent",r);if(i.isDefaultPrevented())return void t.fire("SetContent",i);o=i}o.content=function(t,e){if("raw"!==e.format){var n=t.selection.getRng(),r=t.dom.getParent(n.commonAncestorContainer,t.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=t.parser.parse(e.content,Mt(Mt({isRootContent:!0,forced_root_block:!1},o),e));return ng({validate:t.validate},t.schema).serialize(i)}return e.content}(t,o);var u=t.selection.getRng();!function(t,e){var n=L.from(e.firstChild).map(Me.fromDom),r=L.from(e.lastChild).map(Me.fromDom);t.deleteContents(),t.insertNode(e);var o=n.bind(Je).filter(We).bind(ib),i=r.bind(Qe).filter(We).bind(ib);ub(o,n,t,!0),ub(i,r,t,!1),t.collapse(!1)}(u,u.createContextualFragment(o.content)),t.selection.setRng(u),Jd(t,u),o.no_events||t.fire("SetContent",o)},cb=function(t,e,n){if(t&&xt(t,e)){var r=Y(t[e],(function(t){return t!==n}));0===r.length?delete t[e]:t[e]=r}},sb=function(t){return!!t.select},lb=function(t){return!(!t||!t.ownerDocument)&&Ie(Me.fromDom(t.ownerDocument),Me.fromDom(t))},fb=function(t,e,n,r){var o,i,u=function(t,e){var n,r;return{selectorChangedWithUnbind:function(o,i){return n||(n={},r={},e.on("NodeChange",(function(e){var o=e.element,i=t.getParents(o,null,t.getRoot()),u={};De.each(n,(function(e,n){De.each(i,(function(o){if(t.is(o,n))return r[n]||(De.each(e,(function(t){t(!0,{node:o,selector:n,parents:i})})),r[n]=e),u[n]=e,!1}))})),De.each(r,(function(t,e){u[e]||(delete r[e],De.each(t,(function(t){t(!1,{node:o,selector:e,parents:i})})))}))}))),n[o]||(n[o]=[]),n[o].push(i),{unbind:function(){cb(n,o,i),cb(r,o,i)}}}}}(t,r).selectorChangedWithUnbind,a=function(t,e){return ab(r,t,e)},c=function(t){var e=l();e.collapse(!!t),f(e)},s=function(){return e.getSelection?e.getSelection():e.document.selection},l=function(){var n,u,a,c=function(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(r){return-1}},l=e.document;if(void 0!==r.bookmark&&!1===_m(r)){var f=hm(r);if(f.isSome())return f.map((function(t){return Bm(r,[t])[0]})).getOr(l.createRange())}try{(n=s())&&!Rn(n.anchorNode)&&(u=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():l.createRange(),u=Bm(r,[u])[0])}catch(d){}return u||(u=l.createRange?l.createRange():l.body.createTextRange()),u.setStart&&9===u.startContainer.nodeType&&u.collapsed&&(a=t.getRoot(),u.setStart(a,0),u.setEnd(a,0)),o&&i&&(0===c(u.START_TO_START,u,o)&&0===c(u.END_TO_END,u,o)?u=i:(o=null,i=null)),u},f=function(t,e){var n;if(function(t){return!!t&&(!!sb(t)||lb(t.startContainer)&&lb(t.endContainer))}(t)){var u=sb(t)?t:null;if(u){i=null;try{u.select()}catch(c){}}else{var a=s();if(t=r.fire("SetSelectionRange",{range:t,forward:e}).range,a){i=t;try{a.removeAllRanges(),a.addRange(t)}catch(c){}!1===e&&a.extend&&(a.collapse(t.endContainer,t.endOffset),a.extend(t.startContainer,t.startOffset)),o=a.rangeCount>0?a.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!a.setBaseAndExtent||ke.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset])&&"IMG"===n.tagName&&(a.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),a.anchorNode===t.startContainer&&a.focusNode===t.endContainer||a.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},d=function(){var e=s(),n=null==e?void 0:e.anchorNode,r=null==e?void 0:e.focusNode;if(!e||!n||!r||Rn(n)||Rn(r))return!0;var o=t.createRng();o.setStart(n,e.anchorOffset),o.collapse(!0);var i=t.createRng();return i.setStart(r,e.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0},m={bookmarkManager:null,controlSelection:null,dom:t,win:e,serializer:n,editor:r,collapse:c,setCursorLocation:function(e,n){var o=t.createRng();b(e)&&b(n)?(o.setStart(e,n),o.setEnd(e,n),f(o),c(!1)):(Xf(t,o,r.getBody(),!0),f(o))},getContent:function(t){return ob(r,t)},setContent:a,getBookmark:function(t,e){return g.getBookmark(t,e)},moveToBookmark:function(t){return g.moveToBookmark(t)},select:function(e,n){return function(t,e,n){return L.from(e).map((function(e){var r=t.nodeIndex(e),o=t.createRng();return o.setStart(e.parentNode,r),o.setEnd(e.parentNode,r+1),n&&(Xf(t,o,e,!0),Xf(t,o,e,!1)),o}))}(t,e,n).each(f),e},isCollapsed:function(){var t=l(),e=s();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},isForward:d,setNode:function(e){return a(t.getOuterHTML(e)),e},getNode:function(){return function(t,e){var n,r,o;if(!e)return t;r=e.startContainer,o=e.endContainer;var i=e.startOffset,u=e.endOffset;return n=e.commonAncestorContainer,!e.collapsed&&(r===o&&u-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Nm(r.nextSibling,!0):r.parentNode,o=0===u?Nm(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),l())},getSel:s,setRng:f,getRng:l,getStart:function(t){return zm(r.getBody(),l(),t)},getEnd:function(t){return Rm(r.getBody(),l(),t)},getSelectedBlocks:function(e,n){return function(t,e,n,r){var o,i=[],u=t.getRoot();if(n=t.getParent(n||zm(u,e,e.collapsed),t.isBlock),r=t.getParent(r||Rm(u,e,e.collapsed),t.isBlock),n&&n!==u&&i.push(n),n&&r&&n!==r){o=n;for(var a=new fo(n,u);(o=a.next())&&o!==r;)t.isBlock(o)&&i.push(o)}return r&&n!==r&&r!==u&&i.push(r),i}(t,l(),e,n)},normalize:function(){var e=l(),n=s();if(!(Ff(n).length>1)&&Yf(r)){var o=Od(t,e);return o.each((function(t){f(t,d())})),o.getOr(e)}return e},selectorChanged:function(t,e){return u(t,e),m},selectorChangedWithUnbind:u,getScrollContainer:function(){for(var e,n=t.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},scrollIntoView:function(t,e){return function(t,e,n){(t.inline?Kd:Yd)(t,e,n)}(r,t,e)},placeCaretAt:function(t,e){return f(pd(t,e,r.getDoc()))},getBoundingClientRect:function(){var t=l();return t.collapsed?zc.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},destroy:function(){e=o=i=null,h.destroy()}},g=ud(m),h=gd(m,r);return m.bookmarkManager=g,m.controlSelection=h,m},db=function(t,e,n){t.addNodeFilter("font",(function(t){G(t,(function(t){var r=e.parse(t.attr("style")),o=t.attr("color"),i=t.attr("face"),u=t.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),u&&(r["font-size"]=n[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",e.serialize(r)),function(t,e){G(e,(function(e){t.attr(e,null)}))}(t,["color","face","size"])}))}))},mb=function(t,e){var n=Bi();e.convert_fonts_to_spans&&db(t,n,De.explode(e.font_size_legacy_values)),function(t,e){t.addNodeFilter("strike",(function(t){G(t,(function(t){var n=e.parse(t.attr("style"));n["text-decoration"]="line-through",t.name="span",t.attr("style",e.serialize(n))}))}))}(t,n)},gb=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},hb=function(t,e){var n;try{n=atob(e)}catch(i_){return L.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return L.some(new Blob([r],{type:t}))},pb=function(t){return 0===t.indexOf("blob:")?function(t){return new oo((function(e,n){var r=function(){n("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="blob",o.onload=function(){200===o.status?e(o.response):r()},o.onerror=r,o.send()}catch(i){r()}}))}(t):0===t.indexOf("data:")?(e=t,new oo((function(t){var n=gb(e),r=n.type,o=n.data;hb(r,o).fold((function(){return t(new Blob([]))}),t)}))):null;var e},vb=0,bb=function(t){return(t||"blobid")+vb++},yb=function(t,e,n,r){var o,i;if(0!==e.src.indexOf("blob:")){var u=gb(e.src),a=u.data,c=u.type;o=a,(i=t.getByData(o,c))?n({image:e,blobInfo:i}):pb(e.src).then((function(r){i=t.create(bb(),r,o),t.add(i),n({image:e,blobInfo:i})}),(function(t){r(t)}))}else(i=t.getByUri(e.src))?n({image:e,blobInfo:i}):pb(e.src).then((function(r){(function(t){return new oo((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))})(r).then((function(u){o=gb(u).data,i=t.create(bb(),r,o),t.add(i),n({image:e,blobInfo:i})}))}),(function(t){r(t)}))},wb=function(t,e){var n={};return{findAll:function(r,o){o||(o=N);var i=Y(function(t){return t?st(t.getElementsByTagName("img")):[]}(r),(function(e){var n=e.src;return!!ke.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!n||n===ke.transparentSrc)&&(0===n.indexOf("blob:")?!t.isUploaded(n)&&o(e):0===n.indexOf("data:")&&o(e))})),u=$(i,(function(t){if(void 0!==n[t.src])return new oo((function(e){n[t.src].then((function(n){if("string"==typeof n)return n;e({image:t,blobInfo:n.blobInfo})}))}));var r=new oo((function(n,r){yb(e,t,n,r)})).then((function(t){return delete n[t.image.src],t})).catch((function(e){return delete n[t.src],e}));return n[t.src]=r,r}));return oo.all(u)}}},xb=function(t,e,n,r){(t.padd_empty_with_br||e.insert)&&n[r.name]?r.empty().append(new Vm("br",1)).shortEnded=!0:r.empty().append(new Vm("#text",3)).value=ko},Cb=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},Sb=function(t,e,n,r){return r.isEmpty(e,n,(function(e){return function(t,e){var n=t.getElementRule(e.name);return n&&n.paddEmpty}(t,e)}))},kb=function(t,e){var n=e.blob_cache,r=function(t){var r,o,i=t.attr("src");(function(t){return t.attr("src")===ke.transparentSrc||b(t.attr("data-mce-placeholder"))})(t)||function(t){return b(t.attr("data-mce-bogus"))}(t)||(r=i,o=/data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(r),o?L.some({type:o[1],data:decodeURIComponent(o[2])}):L.none()).filter((function(){return function(t,e){if(e.images_dataimg_filter){var n=new Image;return n.src=t.attr("src"),mt(t.attributes.map,(function(t,e){n.setAttribute(e,t)})),e.images_dataimg_filter(n)}return!0}(t,e)})).bind((function(t){var e=t.type,r=t.data;return L.from(n.getByData(r,e)).orThunk((function(){return hb(e,r).map((function(t){var e=n.create(bb(),t,r);return n.add(e),e}))}))})).each((function(e){t.attr("src",e.blobUri())}))};n&&t.addAttributeFilter("src",(function(t){return G(t,r)}))},Tb=De.makeMap,Ob=De.each,_b=De.explode,Eb=De.extend,Db=function(t,e){void 0===e&&(e=Ri());var n={},r=[],o={},i={};(t=t||{}).validate=!("validate"in t)||t.validate,t.root_name=t.root_name||"body";var u=function(t){var e=t.name;e in n&&((a=o[e])?a.push(t):o[e]=[t]);for(var u=r.length;u--;){var a,c=r[u].name;c in t.attributes.map&&((a=i[c])?a.push(t):i[c]=[t])}return t},a={schema:e,addAttributeFilter:function(t,e){Ob(_b(t),(function(t){var n;for(n=0;n<r.length;n++)if(r[n].name===t)return void r[n].callbacks.push(e);r.push({name:t,callbacks:[e]})}))},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(t,e){Ob(_b(t),(function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)}))},getNodeFilters:function(){var t=[];for(var e in n)xt(n,e)&&t.push({name:e,callbacks:n[e]});return t},filterNode:u,parse:function(a,c){var s,l,f,d,m,g,h,p,v=[];c=c||{},o={},i={};var b,y=Eb(Tb("script,style,head,html,body,title,meta,param"),e.getBlockElements()),w=e.getNonEmptyElements(),x=e.children,C=t.validate,S="forced_root_block"in c?c.forced_root_block:t.forced_root_block,k=!1===(b=S)?"":!0===b?"p":b,T=e.getWhiteSpaceElements(),O=/^[ \t\r\n]+/,_=/[ \t\r\n]+$/,E=/[ \t\r\n]+/g,D=/^[ \t\r\n]+$/,A=xt(T,c.context)||xt(T,t.root_name),M=function(t,e){var r,i=new Vm(t,e);return t in n&&((r=o[t])?r.push(i):o[t]=[i]),i},z=function(t){for(var n=e.getBlockElements(),r=t.prev;r&&3===r.type;){var o=r.value.replace(_,"");if(o.length>0)return void(r.value=o);var i=r.next;if(i){if(3===i.type&&i.value.length){r=r.prev;continue}if(!n[i.name]&&"script"!==i.name&&"style"!==i.name){r=r.prev;continue}}var u=r.prev;r.remove(),r=u}},R=Km({validate:C,document:t.document,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:function(t){var e={};for(var n in t)"li"!==n&&"p"!==n&&(e[n]=t[n]);return e}(e.getSelfClosingElements()),cdata:function(t){p.append(M("#cdata",4)).value=t},text:function(t,e){var n;A||(t=t.replace(E," "),function(t,e){return t&&(xt(e,t.name)||"br"===t.name)}(p.lastChild,y)&&(t=t.replace(O,""))),0!==t.length&&((n=M("#text",3)).raw=!!e,p.append(n).value=t)},comment:function(t){p.append(M("#comment",8)).value=t},pi:function(t,e){p.append(M(t,7)).value=e,z(p)},doctype:function(t){p.append(M("#doctype",10)).value=t,z(p)},start:function(t,n,o){var u=C?e.getElementRule(t):{};if(u){var a=M(u.outputName||t,1);a.attributes=n,a.shortEnded=o,p.append(a);var c=x[p.name];c&&x[a.name]&&!c[a.name]&&v.push(a);for(var s=r.length;s--;){var l=r[s].name;l in n.map&&((g=i[l])?g.push(a):i[l]=[a])}y[t]&&z(a),o||(p=a),!A&&T[t]&&(A=!0)}},end:function(n){var r,o,i,u,a=C?e.getElementRule(n):{};if(a){if(y[n]&&!A){if((r=p.firstChild)&&3===r.type)if((o=r.value.replace(O,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||D.test(o))&&(r.remove(),r=i),r=i;if((r=p.lastChild)&&3===r.type)if((o=r.value.replace(_,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||D.test(o))&&(r.remove(),r=i),r=i}if(A&&T[n]&&(A=!1),a.removeEmpty&&Sb(e,w,T,p))return u=p.parent,y[p.name]?p.empty().remove():p.unwrap(),void(p=u);a.paddEmpty&&(function(t){return Cb(t,"#text")&&t.firstChild.value===ko}(p)||Sb(e,w,T,p))&&xb(t,c,y,p),p=p.parent}}},e),N=p=new Vm(c.context||t.root_name,11);if(R.parse(a,c.format),C&&v.length&&(c.context?c.invalid=!0:function(t){for(var n=Tb("tr,td,th,tbody,thead,tfoot,table"),r=e.getNonEmptyElements(),o=e.getWhiteSpaceElements(),i=e.getTextBlockElements(),a=e.getSpecialElements(),c=function(t,n){if(void 0===n&&(n=t.parent),a[t.name])t.empty().remove();else{for(var r=0,o=t.children();r<o.length;r++){var i=o[r];e.isValidChild(n.name,i.name)||c(i,n)}t.unwrap()}},s=0;s<t.length;s++){var l=t[s],f=void 0,d=void 0,m=void 0;if(l.parent&&!l.fixed)if(i[l.name]&&"li"===l.parent.name){for(var g=l.next;g&&i[g.name];)g.name="li",g.fixed=!0,l.parent.insert(g,l.parent),g=g.next;l.unwrap()}else{var h=[l];for(f=l.parent;f&&!e.isValidChild(f.name,l.name)&&!n[f.name];f=f.parent)h.push(f);if(f&&h.length>1)if(e.isValidChild(f.name,l.name)){h.reverse();for(var p=d=u(h[0].clone()),v=0;v<h.length-1;v++){e.isValidChild(p.name,h[v].name)?(m=u(h[v].clone()),p.append(m)):m=p;for(var b=h[v].firstChild;b&&b!==h[v+1];){var y=b.next;m.append(b),b=y}p=m}Sb(e,r,o,d)?f.insert(l,h[0],!0):(f.insert(d,h[0],!0),f.insert(l,d)),f=h[0],(Sb(e,r,o,f)||Cb(f,"br"))&&f.empty().remove()}else c(l);else if(l.parent){if("li"===l.name){if((g=l.prev)&&("ul"===g.name||"ol"===g.name)){g.append(l);continue}if((g=l.next)&&("ul"===g.name||"ol"===g.name)){g.insert(l,g.firstChild,!0);continue}l.wrap(u(new Vm("ul",1)));continue}e.isValidChild(l.parent.name,"div")&&e.isValidChild("div",l.name)?l.wrap(u(new Vm("div",1))):c(l)}}}}(v)),k&&("body"===N.name||c.isRootContent)&&function(){var n=N.firstChild,r=null,o=function(t){t&&((n=t.firstChild)&&3===n.type&&(n.value=n.value.replace(O,"")),(n=t.lastChild)&&3===n.type&&(n.value=n.value.replace(_,"")))};if(e.isValidChild(N.name,k.toLowerCase())){for(;n;){var i=n.next;3===n.type||1===n.type&&"p"!==n.name&&!y[n.name]&&!n.attr("data-mce-type")?(r||((r=M(k,1)).attr(t.forced_root_block_attrs),N.insert(r,n)),r.append(n)):(o(r),r=null),n=i}o(r)}}(),!c.invalid){for(h in o)if(xt(o,h)){for(g=n[h],d=(s=o[h]).length;d--;)s[d].parent||s.splice(d,1);for(l=0,f=g.length;l<f;l++)g[l](s,h,c)}for(l=0,f=r.length;l<f;l++)if((g=r[l]).name in i){for(d=(s=i[g.name]).length;d--;)s[d].parent||s.splice(d,1);for(d=0,m=g.callbacks.length;d<m;d++)g.callbacks[d](s,g.name,c)}}return N}};return function(t,e){var n=t.schema;e.remove_trailing_brs&&t.addNodeFilter("br",(function(t,r,o){var i,u,a,c,s,l,f,d,m=t.length,g=De.extend({},n.getBlockElements()),h=n.getNonEmptyElements(),p=n.getWhiteSpaceElements();for(g.body=1,i=0;i<m;i++)if(a=(u=t[i]).parent,g[u.parent.name]&&u===a.lastChild){for(s=u.prev;s;){if("span"!==(l=s.name)||"bookmark"!==s.attr("data-mce-type")){"br"===l&&(u=null);break}s=s.prev}u&&(u.remove(),Sb(n,h,p,a)&&(f=n.getElementRule(a.name))&&(f.removeEmpty?a.remove():f.paddEmpty&&xb(e,o,g,a)))}else{for(c=u;a&&a.firstChild===c&&a.lastChild===c&&(c=a,!g[a.name]);)a=a.parent;c===a&&!0!==e.padd_empty_with_br&&((d=new Vm("#text",3)).value=ko,u.replace(d))}})),t.addAttributeFilter("href",(function(t){var n,r,o=t.length;if(!e.allow_unsafe_link_target)for(;o--;){var i=t[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(r=void 0,r=(n=i.attr("rel"))?De.trim(n):"",/\b(noopener)\b/g.test(r)?r:function(t){return t.split(" ").filter((function(t){return t.length>0})).concat(["noopener"]).sort().join(" ")}(r)))}})),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",(function(t){for(var e,n,r,o,i=t.length;i--;)if("a"===(o=t[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,e=o.lastChild;do{n=e.prev,r.insert(e,o),e=n}while(e)}})),e.fix_list_elements&&t.addNodeFilter("ul,ol",(function(t){for(var e,n,r=t.length;r--;)if("ul"===(n=(e=t[r]).parent).name||"ol"===n.name)if(e.prev&&"li"===e.prev.name)e.prev.append(e);else{var o=new Vm("li",1);o.attr("style","list-style-type: none"),e.wrap(o)}})),e.validate&&n.getValidClasses()&&t.addAttributeFilter("class",(function(t){for(var e=n.getValidClasses(),r=t.length;r--;){for(var o=t[r],i=o.attr("class").split(" "),u="",a=0;a<i.length;a++){var c=i[a],s=!1,l=e["*"];l&&l[c]&&(s=!0),l=e[o.name],!s&&l&&l[c]&&(s=!0),s&&(u&&(u+=" "),u+=c)}u.length||(u=null),o.attr("class",u)}})),kb(t,e)}(a,t),function(t,e){e.inline_styles&&mb(t,e)}(a,t),a},Ab=function(t,e,n){return function(t,e){return t&&t.hasEventListeners("PreProcess")&&!e.no_events}(t,n)?function(t,e,n){var r,o=t.dom,i=e.cloneNode(!0),u=document.implementation;if(u.createHTMLDocument){var a=u.createHTMLDocument("");De.each("BODY"===i.nodeName?i.childNodes:[i],(function(t){a.body.appendChild(a.importNode(t,!0))})),i="BODY"!==i.nodeName?a.body.firstChild:a.body,r=o.doc,o.doc=a}return function(t,e){t.fire("PreProcess",e)}(t,Mt(Mt({},n),{node:i})),r&&(o.doc=r),i}(t,e,n):e},Mb=function(t,e,n){-1===De.inArray(e,n)&&(t.addAttributeFilter(n,(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})),e.push(n))},zb=function(t,e,n,r,o){return function(t,e,n){return!e.no_events&&t?function(t,e){return t.fire("PostProcess",e)}(t,Mt(Mt({},e),{content:n})).content:n}(t,o,function(t,e,n){return ng(t,e).serialize(n)}(e,n,r))},Rb=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:wa.DOM,o=e&&e.schema?e.schema:Ri(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i=Db(t,o);return function(t,e,n){t.addAttributeFilter("data-mce-tabindex",(function(t,e){for(var n=t.length;n--;){var r=t[n];r.attr("tabindex",r.attr("data-mce-tabindex")),r.attr(e,null)}})),t.addAttributeFilter("src,href,style",(function(t,r){for(var o="data-mce-"+r,i=e.url_converter,u=e.url_converter_scope,a=t.length;a--;){var c=t[a],s=c.attr(o);void 0!==s?(c.attr(r,s.length>0?s:null),c.attr(o,null)):(s=c.attr(r),"style"===r?s=n.serializeStyle(n.parseStyle(s),c.name):i&&(s=i.call(u,s,r,c.name)),c.attr(r,s.length>0?s:null))}})),t.addAttributeFilter("class",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("class");r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}})),t.addAttributeFilter("data-mce-type",(function(t,e,n){for(var r=t.length;r--;){var o=t[r];"bookmark"!==o.attr("data-mce-type")||n.cleanup||(L.from(o.firstChild).exists((function(t){return!Oo(t.value)}))?o.unwrap():o.remove())}})),t.addNodeFilter("noscript",(function(t){for(var e=t.length;e--;){var n=t[e].firstChild;n&&(n.value=Si.decode(n.value))}})),t.addNodeFilter("script,style",(function(t,n){for(var r=function(t){return t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")},o=t.length;o--;){var i=t[o],u=i.firstChild?i.firstChild.value:"";if("script"===n){var a=i.attr("type");a&&i.attr("type","mce-no/type"===a?null:a.replace(/^mce\-/,"")),"xhtml"===e.element_format&&u.length>0&&(i.firstChild.value="// <![CDATA[\n"+r(u)+"\n// ]]>")}else"xhtml"===e.element_format&&u.length>0&&(i.firstChild.value="\x3c!--\n"+r(u)+"\n--\x3e")}})),t.addNodeFilter("#comment",(function(t){for(var r=t.length;r--;){var o=t[r];e.preserve_cdata&&0===o.value.indexOf("[CDATA[")?(o.name="#cdata",o.type=4,o.value=n.decode(o.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===o.value.indexOf("mce:protected ")&&(o.name="#text",o.type=3,o.raw=!0,o.value=unescape(o.value).substr(14))}})),t.addNodeFilter("xml:namespace,input",(function(t,e){for(var n=t.length;n--;){var r=t[n];7===r.type?r.remove():1===r.type&&("input"!==e||r.attr("type")||r.attr("type","text"))}})),t.addAttributeFilter("data-mce-type",(function(e){G(e,(function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())}))})),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)}))}(i,t,r),{schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,u){void 0===u&&(u={});var a=Mt({format:"html"},u),c=Ab(e,n,a),s=function(t,e,n){var r=_o(n.getInner?e.innerHTML:t.getOuterHTML(e));return n.selection||So(Me.fromDom(e))?r:De.trim(r)}(r,c,a),l=function(t,e,n){var r=n.selection?Mt({forced_root_block:!1},n):n,o=t.parse(e,r);return function(t){var e=function(t){return t&&"br"===t.name},n=t.lastChild;if(e(n)){var r=n.prev;e(r)&&(n.remove(),r.remove())}}(o),o}(i,s,a);return"tree"===a.format?l:zb(e,t,o,l,a)},addRules:o.addValidElements,setRules:o.setValidElements,addTempAttr:_(Mb,i,n),getTempAttrs:k(n),getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},Nb=function(t,e){var n=Rb(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}},Bb=function(t,e){return void 0===e&&(e={}),function(t,e,n){return nb(t).editor.getContent(e,n)}(t,e,e.format?e.format:"html")},Pb=function(t,e,n){return void 0===n&&(n={}),function(t,e,n){return nb(t).editor.setContent(e,n)}(t,e,n)},Ib=wa.DOM,Lb=function(t){return L.from(t).each((function(t){return t.destroy()}))},Hb=function(t){if(!t.removed){var e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement();r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&Ib.remove(o.nextSibling),function(t){t.fire("remove")}(t),t.editorManager.remove(t),!t.inline&&r&&function(t){Ib.setStyle(t.id,"display",t.orgDisplay)}(t),function(t){t.fire("detach")}(t),Ib.remove(t.getContainer()),Lb(e),Lb(n),t.destroy()}},Vb=function(t,e){var n=t.selection,r=t.dom;t.destroyed||(e||t.removed?(e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),Lb(n),Lb(r)),function(t){var e=t.formElement;e&&(e._mceOldSubmit&&(e.submit=e._mceOldSubmit,e._mceOldSubmit=null),Ib.unbind(e,"submit reset",t.formEventDelegate))}(t),function(t){t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null)}(t),t.destroyed=!0):t.remove())},Fb=(Lp=function(t,e){return d(t)&&d(e)?Fb(t,e):e},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)xt(o,i)&&(n[i]=Lp(n[i],o[i]))}return n}),jb=he().deviceType,Ub=jb.isTouch(),Wb=jb.isPhone(),qb=jb.isTablet(),$b=["lists","autolink","autosave"],Gb={table_grid:!1,object_resizing:!1,resize:!1},Kb=function(t){var e=m(t)?t.join(" "):t,n=$(f(e)?e.split(" "):[],Ft);return Y(n,(function(t){return t.length>0}))},Xb=function(t,e){var n,r,o=(r={},vt(e,(function(e,n){return W(t,n)}),pt(n={}),pt(r)),{t:n,f:r});return function(t,e){return{sections:k(t),settings:k(e)}}(o.t,o.f)},Yb=function(t,e){return xt(t.sections(),e)},Jb=function(t,e){return wt(t,"toolbar_mode").orThunk((function(){return wt(t,"toolbar_drawer").map((function(t){return!1===t?"wrap":t}))})).getOr(e)},Qb=function(t,e){var n={resize:!1,toolbar_mode:Jb(t,"scrolling"),toolbar_sticky:!1};return Mt(Mt(Mt({},Gb),n),e?{menubar:!1}:{})},Zb=function(t,e){var n=e.external_plugins?e.external_plugins:{};return t&&t.external_plugins?De.extend({},t.external_plugins,n):n},ty=function(t,e,n,r){return t&&function(t,e,n){var r=t.sections();return Yb(t,e)&&r[e].theme===n}(e,"mobile","mobile")?Y(r,_(W,$b)):t&&Yb(e,"mobile")?r:n},ey=function(t,e,n,r){var o=Kb(n.forced_plugins),i=Kb(r.plugins),u=function(t,e){return Yb(t,e)?t.sections()[e]:{}}(e,"mobile"),a=u.plugins?Kb(u.plugins):i,c=function(t,e){return[].concat(Kb(t)).concat(Kb(e))}(o,ty(t,e,i,a));if(ke.browser.isIE()&&W(c,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return De.extend(r,{plugins:c.join(" ")})},ny=function(t,e,n,r,o){var i=t?{mobile:Qb(o.mobile||{},e)}:{},u=Xb(["mobile"],Fb(i,o)),a=De.extend(n,r,u.settings(),function(t,e){return t&&Yb(e,"mobile")}(t,u)?function(t,e,n){void 0===n&&(n={});var r=t.sections(),o=wt(r,e).getOr({});return De.extend({},n,o)}(u,"mobile"):{},{validate:!0,external_plugins:Zb(r,u.settings())});return ey(t,u,r,a)},ry=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i={id:e,theme:"silver",toolbar_mode:Jb(t,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return Mt(Mt({},i),r?Gb:{})}(o,e,n,Ub,t);return ny(Wb||qb,Wb,i,r,o)},oy=function(t,e,n){return L.from(e.settings[n]).filter(t)},iy=function(t,e,n,r){var o,i=e in t.settings?t.settings[e]:n;return"hash"===r?function(t){var e={};return"string"==typeof t?G(t.indexOf("=")>0?t.split(/[;,](?![^=;,]*(?:[;,]|$))/):t.split(","),(function(t){var n=t.split("=");n.length>1?e[De.trim(n[0])]=De.trim(n[1]):e[De.trim(n[0])]=De.trim(n[0])})):e=t,e}(i):"string"===r?oy(f,t,e).getOr(n):"number"===r?oy(w,t,e).getOr(n):"boolean"===r?oy(h,t,e).getOr(n):"object"===r?oy(d,t,e).getOr(n):"array"===r?oy(m,t,e).getOr(n):"string[]"===r?oy((o=f,function(t){return m(t)&&rt(t,o)}),t,e).getOr(n):"function"===r?oy(y,t,e).getOr(n):i},uy=(Hp={},{add:function(t,e){Hp[t]=e},get:function(t){return Hp[t]?Hp[t]:{icons:{}}},has:function(t){return xt(Hp,t)}}),ay=function(t,e){return e.dom[t]},cy=function(t,e){return parseInt(cr(e,t),10)},sy=_(ay,"clientWidth"),ly=_(ay,"clientHeight"),fy=_(cy,"margin-top"),dy=_(cy,"margin-left"),my=function(t,e,n){var r,o=Me.fromDom(t.getBody()),i=t.inline?o:(r=o,Me.fromDom(Ke(r).dom.documentElement)),u=function(t,e,n,r){var o=function(t){return t.dom.getBoundingClientRect()}(e);return{x:n-(t?o.left+e.dom.clientLeft+dy(e):0),y:r-(t?o.top+e.dom.clientTop+fy(e):0)}}(t.inline,i,e,n);return function(t,e,n){var r=sy(t),o=ly(t);return e>=0&&n>=0&&e<=r&&n<=o}(i,u.x,u.y)},gy=function(t){var e,n=t.inline?t.getBody():t.getContentAreaContainer();return(e=n,L.from(e).map(Me.fromDom)).map(Cn).getOr(!1)},hy=function(t){var e,n=[],r=function(){var e,n=t.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},o=function(){return L.from(n[0])},i=function(){n.length>0&&r().reposition(n)},u=function(t){et(n,(function(e){return e===t})).each((function(t){n.splice(t,1)}))},a=function(e,a){if(void 0===a&&(a=!0),!t.removed&&gy(t))return a&&t.fire("BeforeOpenNotification",{notification:e}),tt(n,(function(t){return n=r().getArgs(t),o=e,!(n.type!==o.type||n.text!==o.text||n.progressBar||n.timeout||o.progressBar||o.timeout);var n,o})).getOrThunk((function(){t.editorManager.setActive(t);var a=r().open(e,(function(){u(a),i(),o().fold((function(){return t.focus()}),(function(t){return Me.fromDom(t.getEl()).dom.focus()}))}));return function(t){n.push(t)}(a),i(),t.fire("OpenNotification",{notification:Mt({},a)}),a}))},c=k(n);return(e=t).on("SkinLoaded",(function(){var t=function(t){return t.getParam("service_message")}(e);t&&a({text:t,type:"warning",timeout:0},!1)})),e.on("ResizeEditor ResizeWindow NodeChange",(function(){co.requestAnimationFrame(i)})),e.on("remove",(function(){G(n.slice(),(function(t){r().close(t)}))})),{open:a,close:function(){o().each((function(t){r().close(t),u(t),i()}))},getNotifications:c}},py=Aa.PluginManager,vy=Aa.ThemeManager,by=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}},r=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e?e.apply(t,n):void 0}},o=function(n){e.push(n),function(e){t.fire("OpenWindow",{dialog:e})}(n)},i=function(n){!function(e){t.fire("CloseWindow",{dialog:e})}(n),0===(e=Y(e,(function(t){return t!==n}))).length&&t.focus()},u=function(e){t.editorManager.setActive(t),gm(t);var n=e();return o(n),n};return t.on("remove",(function(){G(e,(function(t){n().close(t)}))})),{open:function(t,e){return u((function(){return n().open(t,e,i)}))},openUrl:function(t){return u((function(){return n().openUrl(t,i)}))},alert:function(t,e,o){var i=n();i.alert(t,r(o||i,e))},confirm:function(t,e,o){var i=n();i.confirm(t,r(o||i,e))},close:function(){L.from(e[e.length-1]).each((function(t){n().close(t),i(t)}))}}},yy=function(t,e){t.notificationManager.open({type:"error",text:e})},wy=function(t,e){t._skinLoaded?yy(t,e):t.on("SkinLoaded",(function(){yy(t,e)}))},xy=function(t,e,n){sd(t,e,{message:n}),console.error(n)},Cy=function(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e},Sy=function(t,e,n){xy(t,"PluginLoadError",Cy("plugin",e,n))},ky=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,zt([t],e)):r.log.apply(r,zt([t],e)))},Ty=function(t){return Oy(t,function(t){var e=t.getParam("content_css");return f(e)?$(e.split(","),Ft):m(e)?e:!1===e||t.inline?[]:["default"]}(t))},Oy=function(t,e){var n=t.editorManager.baseURL+"/skins/content",r="content"+t.editorManager.suffix+".css",o=!0===t.inline;return $(e,(function(e){return function(t){return/^[a-z0-9\-]+$/i.test(t)}(e)&&!o?n+"/"+e+"/"+r:t.documentBaseURI.toAbsolute(e)}))},_y=function(t){t.contentCSS=t.contentCSS.concat(Ty(t),function(t){return Oy(t,ys(t))}(t))},Ey=function(){var t={},e=function(t,e){return{status:t,resultUri:e}},n=function(e){return e in t};return{hasBlobUri:n,getResultUri:function(e){var n=t[e];return n?n.resultUri:null},isPending:function(e){return!!n(e)&&1===t[e].status},isUploaded:function(e){return!!n(e)&&2===t[e].status},markPending:function(n){t[n]=e(1,null)},markUploaded:function(n,r){t[n]=e(2,r)},removeFailed:function(e){delete t[e]},destroy:function(){t={}}}},Dy=0,Ay=function(t){return t+Dy+++(e=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+e()+e()+e());var e},My=function(t,e){var n={},r=function(t,n,r,o){var i=new XMLHttpRequest;i.open("POST",e.url),i.withCredentials=e.credentials,i.upload.onprogress=function(t){o(t.loaded/t.total*100)},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){if(i.status<200||i.status>=300)r("HTTP Error: "+i.status);else{var t,o,u=JSON.parse(i.responseText);u&&"string"==typeof u.location?n((t=e.basePath,o=u.location,t?t.replace(/\/$/,"")+"/"+o.replace(/^\//,""):o)):r("Invalid JSON: "+i.responseText)}};var u=new FormData;u.append("file",t.blob(),t.filename()),i.send(u)},o=function(t,e){return{url:e,blobInfo:t,status:!0}},i=function(t,e,n){return{url:"",blobInfo:t,status:!1,error:{message:e,options:n}}},u=function(t,e){De.each(n[t],(function(t){t(e)})),delete n[t]},a=function(r,a){return r=De.grep(r,(function(e){return!t.isUploaded(e.blobUri())})),oo.all(De.map(r,(function(r){return t.isPending(r.blobUri())?function(t){var e=t.blobUri();return new oo((function(t){n[e]=n[e]||[],n[e].push(t)}))}(r):function(e,n,r){return t.markPending(e.blobUri()),new oo((function(a){var c;try{var s=function(){c&&c.close()};n(e,(function(n){s(),t.markUploaded(e.blobUri(),n),u(e.blobUri(),o(e,n)),a(o(e,n))}),(function(n,r){var o=r||{};s(),t.removeFailed(e.blobUri()),u(e.blobUri(),i(e,n,o)),a(i(e,n,o))}),(function(t){t<0||t>100||L.from(c).orThunk((function(){return L.from(r).map(M)})).each((function(e){c=e,e.progressBar.value(t)}))}))}catch(l){a(i(e,l.message,{}))}}))}(r,e.handler,a)})))};return!1===y(e.handler)&&(e.handler=r),{upload:function(t,n){return e.url||e.handler!==r?a(t,n):new oo((function(t){t([])}))}}},zy=function(t){return function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}},Ry=function(t,e){return My(e,{url:fs(t),basePath:ds(t),credentials:ms(t),handler:gs(t)})},Ny=function(t){var e,n,r,o,i,u,a=(e=[],n=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var e,n=t.id||Ay("blobid"),r=t.name||n,o=t.blob;return{id:k(n),name:k(r),filename:k(t.filename||r+"."+(e=o.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[e.toLowerCase()]||"dat")),blob:k(o),base64:k(t.base64),blobUri:k(t.blobUri||URL.createObjectURL(o)),uri:k(t.uri)}},{create:function(t,e,r,o,i){if(f(t))return n({id:t,name:o,filename:i,blob:e,base64:r});if(d(t))return n(t);throw new Error("Unknown input type")},add:function(t){o(t.id())||e.push(t)},get:o=function(t){return r((function(e){return e.id()===t}))},getByUri:function(t){return r((function(e){return e.blobUri()===t}))},getByData:function(t,e){return r((function(n){return n.base64()===t&&n.blob().type===e}))},findFirst:r=function(t){return tt(e,t).getOrUndefined()},removeByUri:function(t){e=Y(e,(function(e){return e.blobUri()!==t||(URL.revokeObjectURL(e.blobUri()),!1)}))},destroy:function(){G(e,(function(t){URL.revokeObjectURL(t.blobUri())})),e=[]}}),c=Ey(),s=[],l=function(t){var e=Ta(null);return t.on("change AddUndo",(function(t){e.set(Mt({},t.level))})),{fireIfChanged:function(){var n=t.undoManager.data;ct(n).filter((function(t){return!Xv(e.get(),t)})).each((function(e){t.setDirty(!0),t.fire("change",{level:e,lastLevel:ut(n,n.length-2).getOrNull()})}))}}}(t),m=function(e){return function(n){return t.selection?e(n):[]}},g=function(t,e,n){var r=0;do{-1!==(r=t.indexOf(e,r))&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1)}while(-1!==r);return t},h=function(t,e,n){var r='src="'+n+'"'+(n===ke.transparentSrc?' data-mce-placeholder="1"':"");return t=g(t,'src="'+e+'"',r),t=g(t,'data-mce-src="'+e+'"','data-mce-src="'+n+'"')},p=function(e,n){G(t.undoManager.data,(function(t){"fragmented"===t.type?t.fragments=$(t.fragments,(function(t){return h(t,e,n)})):t.content=h(t.content,e,n)}))},v=function(e){return i||(i=Ry(t,c)),w().then(m((function(n){var r=$(n,(function(t){return t.blobInfo}));return i.upload(r,zy(t)).then(m((function(r){var o=[],i=$(r,(function(e,r){var i=n[r].blobInfo,u=n[r].image;return e.status&&function(t){return t.getParam("images_replace_blob_uris",!0,"boolean")}(t)?(a.removeByUri(u.src),tb(t)||function(e,n){var r,o=t.convertURL(n,"src");p(e.src,n),t.$(e).attr({src:ss(t)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o})}(u,e.url)):e.error&&(e.error.options.remove&&(p(u.getAttribute("src"),ke.transparentSrc),o.push(u)),function(t,e){wy(t,Da.translate(["Failed to upload image: {0}",e]))}(t,e.error.message)),{element:u,status:e.status,uploadUri:e.url,blobInfo:i}}));return i.length>0&&l.fireIfChanged(),o.length>0&&(tb(t)?console.error("Removing images on failed uploads is currently unsupported for RTC"):t.undoManager.transact((function(){G(o,(function(e){t.dom.remove(e),a.removeByUri(e.src)}))}))),e&&e(i),i})))})))},b=function(e){if(cs(t))return v(e)},y=function(e){return!1!==rt(s,(function(t){return t(e)}))&&(0!==e.getAttribute("src").indexOf("data:")||function(t){return t.getParam("images_dataimg_filter",N,"function")}(t)(e))},w=function(){return u||(u=wb(c,a)),u.findAll(t.getBody(),y).then(m((function(e){return e=Y(e,(function(e){return"string"!=typeof e||(wy(t,e),!1)})),tb(t)||G(e,(function(t){p(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")})),e})))},x=function(e){return e.replace(/src="(blob:[^"]+)"/g,(function(e,n){var r=c.getResultUri(n);if(r)return'src="'+r+'"';var o=a.getByUri(n);return o||(o=Q(t.editorManager.get(),(function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)}),null)),o?'src="data:'+o.blob().type+";base64,"+o.base64()+'"':e}))};return t.on("SetContent",(function(){cs(t)?b():w()})),t.on("RawSaveContent",(function(t){t.content=x(t.content)})),t.on("GetContent",(function(t){t.source_view||"raw"===t.format||"tree"===t.format||(t.content=x(t.content))})),t.on("PostRender",(function(){t.parser.addNodeFilter("img",(function(t){G(t,(function(t){var e=t.attr("src");if(!a.getByUri(e)){var n=c.getResultUri(e);n&&t.attr("src",n)}}))}))})),{blobCache:a,addFilter:function(t){s.push(t)},uploadImages:v,uploadImagesAuto:b,scanForImages:w,destroy:function(){a.destroy(),c.destroy(),u=i=null}}},By=function(t){var e={},n=function(t,r){t&&(f(t)?(m(r)||(r=[r]),G(r,(function(t){p(t.deep)&&(t.deep=!Cf(t)),p(t.split)&&(t.split=!Cf(t)||Sf(t)),p(t.remove)&&Cf(t)&&!Sf(t)&&(t.remove="none"),Cf(t)&&Sf(t)&&(t.mixed=!0,t.block_expand=!0),f(t.classes)&&(t.classes=t.classes.split(/\s+/))})),e[t]=r):mt(t,(function(t,e){n(e,t)})))};return n(function(t){var e={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",defaultBlock:"p",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(t,e,n){return Nn(t)&&t.hasAttribute("href")},onformat:function(e,n,r){De.each(r,(function(n,r){t.setAttrib(e,r,n)}))}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":function(t){var e;return null!==(e=null==t?void 0:t.customValue)&&void 0!==e?e:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return De.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(function(t){e[t]={block:t,remove:"all"}})),e}(t.dom)),n(function(t){return t.getParam("formats")}(t)),{get:function(t){return b(t)?e[t]:e},has:function(t){return xt(e,t)},register:n,unregister:function(t){return t&&e[t]&&delete e[t],e}}},Py=De.each,Iy=wa.DOM,Ly=function(t,e){var n,r,o,i=e&&e.schema||Ri({}),u=function(t){r="string"==typeof t?{name:t,classes:[],attrs:{}}:t;var e=Iy.create(r.name);return function(t,e){e.classes.length&&Iy.addClass(t,e.classes.join(" ")),Iy.setAttribs(t,e.attrs)}(e,r),e},a=function(t,e,n){var r,o,c=e.length>0&&e[0],s=c&&c.name,l=function(t,e){var n="string"!=typeof t?t.nodeName.toLowerCase():t,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(e&&-1!==De.inArray(o,e)?e:o[0])}(t,s);if(l)s===l?(o=e[0],e=e.slice(1)):o=l;else if(c)o=e[0],e=e.slice(1);else if(!n)return t;return o&&(r=u(o)).appendChild(t),n&&(r||(r=Iy.create("div")).appendChild(t),De.each(n,(function(e){var n=u(e);r.insertBefore(n,t)}))),a(r,e,o&&o.siblings)};return t&&t.length?(r=t[0],n=u(r),(o=Iy.create("div")).appendChild(a(n,t.slice(1),r.siblings)),o):""},Hy=function(t){var e,n={classes:[],attrs:{}};return"*"!==(t=n.selector=De.trim(t))&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==De.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}if("["===o){var u=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);u&&(n.attrs[u[1]]=u[2])}return""}))),n.name=e||"div",n},Vy=function(t,e){var n,r,o,i="",u=function(t){var e=t.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return f(e)?e:""}(t);if(""===u)return"";var a=function(t){return t.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=t.formatter.get(e)))return;e=e[0]}if("preview"in e){var c=wt(e,"preview");if(Qn(c,!1))return"";u=c.getOr(u)}n=e.block||e.inline||"span";var s,l=(s=e.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),De.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(t){var e=De.map(t.split(/(?:~\+|~|\+)/),Hy),n=e.pop();return e.length&&(n.siblings=e),n})).reverse()):[];l.length?(l[0].name||(l[0].name=n),n=e.selector,r=Ly(l,t)):r=Ly([n],t);var d=Iy.select(n,r)[0]||r.firstChild;return Py(e.styles,(function(t,e){var n=a(t);n&&Iy.setStyle(d,e,n)})),Py(e.attributes,(function(t,e){var n=a(t);n&&Iy.setAttrib(d,e,n)})),Py(e.classes,(function(t){var e=a(t);Iy.hasClass(d,e)||Iy.addClass(d,e)})),t.fire("PreviewFormats"),Iy.setStyles(r,{position:"absolute",left:-65535}),t.getBody().appendChild(r),o=Iy.getStyle(t.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,Py(u.split(" "),(function(e){var n=Iy.getStyle(d,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Iy.getStyle(t.getBody(),e,!0),"#ffffff"===Iy.toHex(n).toLowerCase())||"color"===e&&"#000000"===Iy.toHex(n).toLowerCase())){if("font-size"===e&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px"}"border"===e&&n&&(i+="padding:0 2px;"),i+=e+":"+n+";"}})),t.fire("AfterPreviewFormats"),Iy.remove(r),i},Fy=function(t){var e=By(t),n=Ta(null);return function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])}(t),Rp(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){!function(t,e,n,r){rb(t).formatter.apply(e,n,r)}(t,e,n,r)},remove:function(e,n,r,o){!function(t,e,n,r,o){rb(t).formatter.remove(e,n,r,o)}(t,e,n,r,o)},toggle:function(e,n,r){!function(t,e,n,r){rb(t).formatter.toggle(e,n,r)}(t,e,n,r)},match:function(e,n,r,o){return function(t,e,n,r,o){return rb(t).formatter.match(e,n,r,o)}(t,e,n,r,o)},closest:function(e){return function(t,e){return rb(t).formatter.closest(e)}(t,e)},matchAll:function(e,n){return function(t,e,n){return rb(t).formatter.matchAll(e,n)}(t,e,n)},matchNode:function(e,n,r,o){return function(t,e,n,r,o){return rb(t).formatter.matchNode(e,n,r,o)}(t,e,n,r,o)},canApply:function(e){return function(t,e){return rb(t).formatter.canApply(e)}(t,e)},formatChanged:function(e,r,o,i){return function(t,e,n,r,o,i){return rb(t).formatter.formatChanged(e,n,r,o,i)}(t,n,e,r,o,i)},getCssText:_(Vy,t)}},jy=function(t){switch(t.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return!0;default:return!1}},Uy=function(t){var e=Ma(),n=Ta(0),r=Ta(0),o={data:[],typing:!1,beforeChange:function(){!function(t,e,n){rb(t).undoManager.beforeChange(e,n)}(t,n,e)},add:function(i,u){return function(t,e,n,r,o,i,u){return rb(t).undoManager.add(e,n,r,o,i,u)}(t,o,r,n,e,i,u)},undo:function(){return function(t,e,n,r){return rb(t).undoManager.undo(e,n,r)}(t,o,n,r)},redo:function(){return function(t,e,n){return rb(t).undoManager.redo(e,n)}(t,r,o.data)},clear:function(){!function(t,e,n){rb(t).undoManager.clear(e,n)}(t,o,r)},reset:function(){!function(t,e){rb(t).undoManager.reset(e)}(t,o)},hasUndo:function(){return function(t,e,n){return rb(t).undoManager.hasUndo(e,n)}(t,o,r)},hasRedo:function(){return function(t,e,n){return rb(t).undoManager.hasRedo(e,n)}(t,o,r)},transact:function(e){return function(t,e,n,r){return rb(t).undoManager.transact(e,n,r)}(t,o,n,e)},ignore:function(e){!function(t,e,n){rb(t).undoManager.ignore(e,n)}(t,n,e)},extra:function(e,n){!function(t,e,n,r,o){rb(t).undoManager.extra(e,n,r,o)}(t,o,r,e,n)}};return tb(t)||function(t,e,n){var r=Ta(!1),o=function(t){Jv(e,!1,n),e.add({},t)};t.on("init",(function(){e.add()})),t.on("BeforeExecCommand",(function(t){var r=t.command;jy(r)||(Qv(e,n),e.beforeChange())})),t.on("ExecCommand",(function(t){var e=t.command;jy(e)||o(t)})),t.on("ObjectResizeStart cut",(function(){e.beforeChange()})),t.on("SaveContent ObjectResized blur",o),t.on("dragend",o),t.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),t.nodeChanged()),46!==i&&8!==i||t.nodeChanged(),r.get()&&e.typing&&!1===Xv(qv(t),e.data[0])&&(!1===t.isDirty()&&(t.setDirty(!0),t.fire("change",{level:e.data[0],lastLevel:null})),t.fire("TypingUndo"),r.set(!1),t.nodeChanged()))})),t.on("keydown",(function(t){var i=t.keyCode;if(!t.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)e.typing&&o(t);else{var u=t.ctrlKey&&!t.altKey||t.metaKey;!(i<16||i>20)||224===i||91===i||e.typing||u||(e.beforeChange(),Jv(e,!0,n),e.add({},t),r.set(!0))}})),t.on("mousedown",(function(t){e.typing&&o(t)})),t.on("input",(function(t){var e;t.inputType&&("insertReplacementText"===t.inputType||"insertText"===(e=t).inputType&&null===e.data||function(t){return"insertFromPaste"===t.inputType||"insertFromDrop"===t.inputType}(t))&&o(t)})),t.on("AddUndo Undo Redo ClearUndos",(function(e){e.isDefaultPrevented()||t.nodeChanged()}))}(t,o,n),function(t){t.addShortcut("meta+z","","Undo"),t.addShortcut("meta+y,meta+shift+z","","Redo")}(t),o},Wy=[9,27,dd.HOME,dd.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,dd.DOWN,dd.UP,dd.LEFT,dd.RIGHT].concat(ke.browser.isFirefox()?[224]:[]),qy="data-mce-placeholder",$y=function(t){return"keydown"===t.type||"keyup"===t.type},Gy=function(t){var e=t.keyCode;return e===dd.BACKSPACE||e===dd.DELETE},Ky=function(t){var e=t.dom,n=us(t),r=function(t){return t.getParam("placeholder",rs.getAttrib(t.getElement(),"placeholder"),"string")}(t),o=function(i,u){if(!function(t){if($y(t)){var e=t.keyCode;return!Gy(t)&&(dd.metaKeyPressed(t)||t.altKey||e>=112&&e<=123||W(Wy,e))}return!1}(i)){var a=t.getBody(),c=!function(t){return $y(t)&&!(Gy(t)||"keyup"===t.type&&229===t.keyCode)}(i)&&function(t,e,n){if(ii(Me.fromDom(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(e,a,n);(""!==e.getAttrib(a,qy)!==c||u)&&(e.setAttrib(a,qy,c?r:null),e.setAttrib(a,"aria-placeholder",c?r:null),function(t,e){t.fire("PlaceholderToggle",{state:e})}(t,c),t.on(c?"keydown":"keyup",o),t.off(c?"keyup":"keydown",o))}};r&&t.on("init",(function(e){o(e,!0),t.on("change SetContent ExecCommand",o),t.on("paste",(function(e){return co.setEditorTimeout(t,(function(){return o(e)}))}))}))},Xy=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,Yy=function(t,e){return Re(Me.fromDom(e),function(t){return t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(t))},Jy=function(t){return"rtl"===wa.DOM.getStyle(t,"direction",!0)||(e=t.textContent,Xy.test(e));var e},Qy=function(t,e,n){var r=function(t,e,n){return Y(wa.DOM.getParents(n.container(),"*",e),t)}(t,e,n);return L.from(r[r.length-1])},Zy=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?Mo(n)?jn(n.nextSibling)?zc(n.nextSibling,0):zc.after(n):No(e)?zc(n,r+1):e:Mo(n)?jn(n.previousSibling)?zc(n.previousSibling,n.previousSibling.data.length):zc.before(n):Bo(e)?zc(n,r-1):e},tw=_(Zy,!0),ew=_(Zy,!1),nw=function(t){return bo(t)||wo(t)},rw=function(t,e){return Ie(t,e)?Zr(e,nw,function(t){return function(e){return Be(t,Me.fromDom(e.dom.parentNode))}}(t)):L.none()},ow=function(t){t.dom.isEmpty(t.getBody())&&(t.setContent(""),function(t){var e=t.getBody(),n=e.firstChild&&t.dom.isBlock(e.firstChild)?e.firstChild:e;t.selection.setCursorLocation(n,0)}(t))},iw=function(t,e){return{from:t,to:e}},uw=function(t,e){var n=Me.fromDom(t),r=Me.fromDom(e.container());return rw(n,r).map((function(t){return function(t,e){return{block:t,position:e}}(t,e)}))},aw=function(t,e,n){var r=uw(t,zc.fromRangeStart(n)),o=r.bind((function(n){return Pl(e,t,n.position).bind((function(n){return uw(t,n).map((function(n){return function(t,e,n){return $n(n.position.getNode())&&!1===ii(n.block)?Hl(!1,n.block.dom).bind((function(r){return r.isEqual(n.position)?Pl(e,t,r).bind((function(e){return uw(t,e)})):L.some(n)})).getOr(n):n}(t,e,n)}))}))}));return Zn(r,o,iw).filter((function(t){return function(t){return!1===Be(t.from.block,t.to.block)}(t)&&function(t){return Ye(t.from.block).bind((function(e){return Ye(t.to.block).filter((function(t){return Be(e,t)}))})).isSome()}(t)&&function(t){return!1===Xn(t.from.block.dom)&&!1===Xn(t.to.block.dom)}(t)}))},cw=function(t){var e=function(t){var e=en(t);return et(e,ho).fold(k(e),(function(t){return e.slice(0,t)}))}(t);return G(e,wn),e},sw=function(t,e){var n=Eg(e,t);return tt(n.reverse(),(function(t){return ii(t)})).each(wn)},lw=function(t,e,n,r){if(ii(n))return kg(n),jl(n.dom);0===Y(Ze(r),(function(t){return!ii(t)})).length&&ii(e)&&gn(r,Me.fromTag("br"));var o=Fl(n.dom,zc.before(r.dom));return G(cw(e),(function(t){gn(r,t)})),sw(t,e),o},fw=function(t,e,n){if(ii(n))return wn(n),ii(e)&&kg(e),jl(e.dom);var r=Ul(n.dom);return G(cw(e),(function(t){vn(n,t)})),sw(t,e),r},dw=function(t,e){return Ie(e,t)?function(t,e){var n=Eg(e,t);return L.from(n[n.length-1])}(e,t):L.none()},mw=function(t,e){Hl(t,e.dom).map((function(t){return t.getNode()})).map(Me.fromDom).filter(vo).each(wn)},gw=function(t,e,n){return mw(!0,e),mw(!1,n),dw(e,n).fold(_(fw,t,e,n),_(lw,t,e,n))},hw=function(t,e,n,r){return e?gw(t,r,n):gw(t,n,r)},pw=function(t,e){var n=Me.fromDom(t.getBody()),r=function(t,e,n){return n.collapsed?aw(t,e,n):L.none()}(n.dom,e,t.selection.getRng()).bind((function(t){return hw(n,e,t.from.block,t.to.block)}));return r.each((function(e){t.selection.setRng(e.toRange())})),r.isSome()},vw=function(t,e){var n=Me.fromDom(e),r=_(Be,t);return Qr(n,Co,r).isSome()},bw=function(t,e){var n=Fl(t.dom,zc.fromRangeStart(e)).isNone(),r=Vl(t.dom,zc.fromRangeEnd(e)).isNone();return!function(t,e){return vw(t,e.startContainer)||vw(t,e.endContainer)}(t,e)&&n&&r},yw=function(t){var e=Me.fromDom(t.getBody()),n=t.selection.getRng();return bw(e,n)?function(t){return t.setContent(""),t.selection.setCursorLocation(),!0}(t):function(t,e){var n=e.getRng();return Zn(rw(t,Me.fromDom(n.startContainer)),rw(t,Me.fromDom(n.endContainer)),(function(r,o){return!1===Be(r,o)&&(n.deleteContents(),hw(t,!0,r,o).each((function(t){e.setRng(t.toRange())})),!0)})).getOr(!1)}(e,t.selection)},ww=function(t,e){return!t.selection.isCollapsed()&&yw(t)},xw=Kn,Cw=Xn,Sw=function(t,e,n,r,o){return L.from(e._selectionOverrides.showCaret(t,n,r,o))},kw=function(t,e){return t.fire("BeforeObjectSelected",{target:e}).isDefaultPrevented()?L.none():L.some(function(t){var e=t.ownerDocument.createRange();return e.selectNode(t),e}(e))},Tw=function(t,e,n){var r=fl(1,t.getBody(),e),o=zc.fromRangeStart(r),i=o.getNode();if(Ws(i))return Sw(1,t,i,!o.isAtEnd(),!1);var u=o.getNode(!0);if(Ws(u))return Sw(1,t,u,!1,!1);var a=t.dom.getParent(o.getNode(),(function(t){return Cw(t)||xw(t)}));return Ws(a)?Sw(1,t,a,!1,n):L.none()},Ow=function(t,e,n){return e.collapsed?Tw(t,e,n).getOr(e):e},_w=function(t){return xg(t)||vg(t)},Ew=function(t){return Cg(t)||bg(t)},Dw=function(t,e,n,r,o,i){return Sw(r,t,i.getNode(!o),o,!0).each((function(n){if(e.collapsed){var r=e.cloneRange();o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents()}else e.deleteContents();t.selection.setRng(n)})),function(t,e){jn(e)&&0===e.data.length&&t.remove(e)}(t.dom,n),!0},Aw=function(t,e){return function(t,e){var n=t.selection.getRng();if(!jn(n.commonAncestorContainer))return!1;var r=e?Rc.Forwards:Rc.Backwards,o=Ml(t.getBody()),i=_(hl,e?o.next:o.prev),u=e?_w:Ew,a=ml(r,t.getBody(),n),c=Zy(e,i(a));if(!c||!pl(a,c))return!1;if(u(c))return Dw(t,n,a.getNode(),r,e,c);var s=i(c);return!!(s&&u(s)&&pl(c,s))&&Dw(t,n,a.getNode(),r,e,s)}(t,e)},Mw=Er([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),zw=function(t,e,n,r){var o=r.getNode(!1===e);return rw(Me.fromDom(t),Me.fromDom(n.getNode())).map((function(t){return ii(t)?Mw.remove(t.dom):Mw.moveToElement(o)})).orThunk((function(){return L.some(Mw.moveToElement(o))}))},Rw=function(t,e,n){return Pl(e,t,n).bind((function(r){return o=r.getNode(),Co(Me.fromDom(o))||wo(Me.fromDom(o))||function(t,e,n,r){var o=function(e){return po(Me.fromDom(e))&&!ol(n,r,t)};return dl(!e,n).fold((function(){return dl(e,r).fold(R,o)}),o)}(t,e,n,r)?L.none():e&&Xn(r.getNode())||!1===e&&Xn(r.getNode(!0))?zw(t,e,n,r):e&&Cg(n)||!1===e&&xg(n)?L.some(Mw.moveToPosition(r)):L.none();var o}))},Nw=function(t,e,n){return function(t,e){var n=e.getNode(!1===t),r=t?"after":"before";return Nn(n)&&n.getAttribute("data-mce-caret")===r}(e,n)?function(t,e){return t&&Xn(e.nextSibling)?L.some(Mw.moveToElement(e.nextSibling)):!1===t&&Xn(e.previousSibling)?L.some(Mw.moveToElement(e.previousSibling)):L.none()}(e,n.getNode(!1===e)).fold((function(){return Rw(t,e,n)}),L.some):Rw(t,e,n).bind((function(e){return function(t,e,n){return n.fold((function(t){return L.some(Mw.remove(t))}),(function(t){return L.some(Mw.moveToElement(t))}),(function(n){return ol(e,n,t)?L.none():L.some(Mw.moveToPosition(n))}))}(t,n,e)}))},Bw=function(t,e){return L.from(ad(t.getBody(),e))},Pw=function(t,e){var n=t.selection.getNode();return Bw(t,n).filter(Xn).fold((function(){return function(t,e,n){var r=fl(e?1:-1,t,n),o=zc.fromRangeStart(r),i=Me.fromDom(t);return!1===e&&Cg(o)?L.some(Mw.remove(o.getNode(!0))):e&&xg(o)?L.some(Mw.remove(o.getNode())):!1===e&&xg(o)&&Vg(i,o)?Fg(i,o).map((function(t){return Mw.remove(t.getNode())})):e&&Cg(o)&&Hg(i,o)?jg(i,o).map((function(t){return Mw.remove(t.getNode())})):Nw(t,e,o)}(t.getBody(),e,t.selection.getRng()).exists((function(n){return n.fold(function(t,e){return function(n){return t._selectionOverrides.hideFakeCaret(),vh(t,e,Me.fromDom(n)),!0}}(t,e),function(t,e){return function(n){var r=e?zc.before(n):zc.after(n);return t.selection.setRng(r.toRange()),!0}}(t,e),function(t){return function(e){return t.selection.setRng(e.toRange()),!0}}(t))}))}),N)},Iw=function(t,e){var n=t.selection.getNode();return!(!Xn(n)||Yn(n))&&Bw(t,n.parentNode).filter(Xn).fold((function(){var n;return n=Me.fromDom(t.getBody()),G(ja(n,".mce-offscreen-selection"),wn),vh(t,e,Me.fromDom(t.selection.getNode())),ow(t),!0}),N)},Lw=function(t){var e=t.dom,n=t.selection,r=ad(t.getBody(),n.getNode());if(Kn(r)&&e.isBlock(r)&&e.isEmpty(r)){var o=e.create("br",{"data-mce-bogus":"1"});e.setHTML(r,""),r.appendChild(o),n.setRng(zc.before(o).toRange())}return!0},Hw=function(t,e){return t.selection.isCollapsed()?Pw(t,e):Iw(t,e)},Vw=function(t,e){return!!t.selection.isCollapsed()&&function(t,e){var n=zc.fromRangeStart(t.selection.getRng());return Pl(e,t.getBody(),n).filter((function(t){return e?hg(t):pg(t)})).bind((function(t){return L.from(il(e?0:-1,t))})).exists((function(e){return t.selection.select(e),!0}))}(t,e)},Fw=jn,jw=function(t){return Fw(t)&&t.data[0]===To},Uw=function(t){return Fw(t)&&t.data[t.data.length-1]===To},Ww=function(t){return t.ownerDocument.createTextNode(To)},qw=function(t,e){return t?function(t){if(Fw(t.previousSibling))return Uw(t.previousSibling)||t.previousSibling.appendData(To),t.previousSibling;if(Fw(t))return jw(t)||t.insertData(0,To),t;var e=Ww(t);return t.parentNode.insertBefore(e,t),e}(e):function(t){if(Fw(t.nextSibling))return jw(t.nextSibling)||t.nextSibling.insertData(0,To),t.nextSibling;if(Fw(t))return Uw(t)||t.appendData(To),t;var e=Ww(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e}(e)},$w=_(qw,!0),Gw=_(qw,!1),Kw=function(t,e){return jn(t.container())?qw(e,t.container()):qw(e,t.getNode())},Xw=function(t,e){var n=e.get();return n&&t.container()===n&&Mo(n)},Yw=function(t,e){return e.fold((function(e){Ps(t.get());var n=$w(e);return t.set(n),L.some(zc(n,n.length-1))}),(function(e){return jl(e).map((function(e){if(Xw(e,t))return zc(t.get(),1);Ps(t.get());var n=Kw(e,!0);return t.set(n),zc(n,1)}))}),(function(e){return Ul(e).map((function(e){if(Xw(e,t))return zc(t.get(),t.get().length-1);Ps(t.get());var n=Kw(e,!1);return t.set(n),zc(n,n.length-1)}))}),(function(e){Ps(t.get());var n=Gw(e);return t.set(n),L.some(zc(n,1))}))},Jw=function(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return L.none()},Qw=Er([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Zw=function(t,e){var n=rl(e,t);return n||t},tx=function(t,e,n){var r=tw(n),o=Zw(e,r.container());return Qy(t,o,r).fold((function(){return Vl(o,r).bind(_(Qy,t,o)).map((function(t){return Qw.before(t)}))}),L.none)},ex=function(t,e){return null===$l(t,e)},nx=function(t,e,n){return Qy(t,e,n).filter(_(ex,e))},rx=function(t,e,n){var r=ew(n);return nx(t,e,r).bind((function(t){return Fl(t,r).isNone()?L.some(Qw.start(t)):L.none()}))},ox=function(t,e,n){var r=tw(n);return nx(t,e,r).bind((function(t){return Vl(t,r).isNone()?L.some(Qw.end(t)):L.none()}))},ix=function(t,e,n){var r=ew(n),o=Zw(e,r.container());return Qy(t,o,r).fold((function(){return Fl(o,r).bind(_(Qy,t,o)).map((function(t){return Qw.after(t)}))}),L.none)},ux=function(t){return!1===Jy(cx(t))},ax=function(t,e,n){return Jw([tx,rx,ox,ix],[t,e,n]).filter(ux)},cx=function(t){return t.fold(T,T,T,T)},sx=function(t){return t.fold(k("before"),k("start"),k("end"),k("after"))},lx=function(t){return t.fold(Qw.before,Qw.before,Qw.after,Qw.after)},fx=function(t){return t.fold(Qw.start,Qw.start,Qw.end,Qw.end)},dx=function(t,e,n,r,o,i){return Zn(Qy(e,n,r),Qy(e,n,o),(function(e,r){return e!==r&&function(t,e,n){var r=rl(e,t),o=rl(n,t);return r&&r===o}(n,e,r)?Qw.after(t?e:r):i})).getOr(i)},mx=function(t,e){return t.fold(N,(function(t){return r=e,!(sx(n=t)===sx(r)&&cx(n)===cx(r));var n,r}))},gx=function(t,e){return t?e.fold(C(L.some,Qw.start),L.none,C(L.some,Qw.after),L.none):e.fold(L.none,C(L.some,Qw.before),L.none,C(L.some,Qw.end))},hx=function(t,e,n,r){var o=Zy(t,r),i=ax(e,n,o);return ax(e,n,o).bind(_(gx,t)).orThunk((function(){return function(t,e,n,r,o){var i=Zy(t,o);return Pl(t,n,i).map(_(Zy,t)).fold((function(){return r.map(lx)}),(function(o){return ax(e,n,o).map(_(dx,t,e,n,i,o)).filter(_(mx,r))})).filter(ux)}(t,e,n,i,r)}))};_(hx,!1),_(hx,!0);var px,vx,bx=function(t,e,n){var r=t?1:-1;return e.setRng(zc(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0},yx=function(t,e){var n=e.selection.getRng(),r=t?zc.fromRangeEnd(n):zc.fromRangeStart(n);return!!function(t){return y(t.selection.getSel().modify)}(e)&&(t&&No(r)?bx(!0,e.selection,r):!(t||!Bo(r))&&bx(!1,e.selection,r))};(vx=px||(px={}))[vx.Br=0]="Br",vx[vx.Block=1]="Block",vx[vx.Wrap=2]="Wrap",vx[vx.Eol=3]="Eol";var wx,xx,Cx=function(t,e){return t===Rc.Backwards?ot(e):e},Sx=function(t,e,n){return t===Rc.Forwards?e.next(n):e.prev(n)},kx=function(t,e,n,r){return $n(r.getNode(e===Rc.Forwards))?px.Br:!1===ol(n,r)?px.Block:px.Wrap},Tx=function(t,e,n,r){for(var o=Ml(n),i=r,u=[];i;){var a=Sx(e,o,i);if(!a)break;if($n(a.getNode(!1)))return e===Rc.Forwards?{positions:Cx(e,u).concat([a]),breakType:px.Br,breakAt:L.some(a)}:{positions:Cx(e,u),breakType:px.Br,breakAt:L.some(a)};if(a.isVisible()){if(t(i,a)){var c=kx(0,e,i,a);return{positions:Cx(e,u),breakType:c,breakAt:L.some(a)}}u.push(a),i=a}else i=a}return{positions:Cx(e,u),breakType:px.Eol,breakAt:L.none()}},Ox=function(t,e,n,r){return e(n,r).breakAt.map((function(r){var o=e(n,r).positions;return t===Rc.Backwards?o.concat(r):[r].concat(o)})).getOr([])},_x=function(t,e){return Q(t,(function(t,n){return t.fold((function(){return L.some(n)}),(function(r){return Zn(at(r.getClientRects()),at(n.getClientRects()),(function(t,o){var i=Math.abs(e-t.left);return Math.abs(e-o.left)<=i?n:r})).or(t)}))}),L.none())},Ex=function(t,e){return at(e.getClientRects()).bind((function(e){return _x(t,e.left)}))},Dx=_(Tx,zc.isAbove,-1),Ax=_(Tx,zc.isBelow,1),Mx=_(Ox,-1,Dx),zx=_(Ox,1,Ax),Rx=function(t){var e=function(e){return $(e,(function(e){var n=ic(e);return n.node=t,n}))};if(Nn(t))return e(t.getClientRects());if(jn(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}},Nx=function(t){return nt(t,Rx)};(xx=wx||(wx={}))[xx.Up=-1]="Up",xx[xx.Down=1]="Down";var Bx,Px,Ix=function(t,e,n,r,o,i){var u=0,a=[],c=function(r){var i=Nx([r]);-1===t&&(i=i.reverse());for(var c=0;c<i.length;c++){var l=i[c];if(!n(l,s)){if(a.length>0&&e(l,At(a))&&u++,l.line=u,o(l))return!0;a.push(l)}}},s=At(i.getClientRects());if(!s)return a;var l=i.getNode();return c(l),function(t,e,n,r){for(;r=nl(r,t,Jo,e);)if(n(r))return}(t,r,c,l),a},Lx=_(Ix,wx.Up,cc,sc),Hx=_(Ix,wx.Down,sc,cc),Vx=function(t){return function(e){return function(t,e){return e.line>t}(t,e)}},Fx=function(t){return function(e){return function(t,e){return e.line===t}(t,e)}},jx=Xn,Ux=nl,Wx=function(t,e){return Math.abs(t.left-e)},qx=function(t,e){return Math.abs(t.right-e)},$x=function(t,e){return t>=e.left&&t<=e.right},Gx=function(t,e){return t>=e.top&&t<=e.bottom},Kx=function(t,e){return Et(t,(function(t,n){var r=Math.min(Wx(t,e),qx(t,e)),o=Math.min(Wx(n,e),qx(n,e));return $x(e,n)?n:$x(e,t)?t:o===r&&jx(n.node)||o<r?n:t}))},Xx=function(t,e,n,r,o){var i=Ux(r,t,Jo,e,!o);do{if(!i||n(i))return}while(i=Ux(i,t,Jo,e))},Yx=function(t,e,n){var r=Nx(function(t){return Y(st(t.getElementsByTagName("*")),qs)}(t)),o=Y(r,_(Gx,n)),i=Kx(o,e);if(i){var u=!Hn(i.node)&&!Jn(i.node);if((i=Kx(function(t,e,n){void 0===n&&(n=!0);var r=[],o=function(t,n){var o=Y(Nx([n]),(function(n){return!t(n,e)}));return r=r.concat(o),0===o.length};return r.push(e),Xx(wx.Up,t,_(o,cc),e.node,n),Xx(wx.Down,t,_(o,sc),e.node,n),r}(t,i,u),e))&&qs(i.node))return function(t,e){return{node:t.node,before:Wx(t,e)<qx(t,e)}}(i,e)}return null},Jx=function(t,e){t.selection.setRng(e),Jd(t,t.selection.getRng())},Qx=function(t,e,n){return L.some(Ow(t,e,n))},Zx=function(t,e,n,r,o,i){var u=e===Rc.Forwards,a=Ml(t.getBody()),c=_(hl,u?a.next:a.prev),s=u?r:o;if(!n.collapsed){var l=fc(n);if(i(l))return Sw(e,t,l,e===Rc.Backwards,!1)}var f=ml(e,t.getBody(),n);if(s(f))return kw(t,f.getNode(!u));var d=Zy(u,c(f)),m=Vo(n);if(!d)return m?L.some(n):L.none();if(s(d))return Sw(e,t,d.getNode(!u),u,!1);var g=c(d);return g&&s(g)&&pl(d,g)?Sw(e,t,g.getNode(!u),u,!1):m?Qx(t,d.toRange(),!1):L.none()},tC=function(t,e,n,r,o,i){var u=ml(e,t.getBody(),n),a=At(u.getClientRects()),c=e===wx.Down;if(!a)return L.none();var s,l=(c?Hx:Lx)(t.getBody(),Vx(1),u),f=Y(l,Fx(1)),d=a.left,m=Kx(f,d);if(m&&i(m.node)){var g=Math.abs(d-m.left),h=Math.abs(d-m.right);return Sw(e,t,m.node,g<h,!1)}if(s=r(u)?u.getNode():o(u)?u.getNode(!0):fc(n)){var p=function(t,e,n,r){var o,i,u,a,c=Ml(e),s=[],l=0,f=function(t){return At(t.getClientRects())};1===t?(o=c.next,i=sc,u=cc,a=zc.after(r)):(o=c.prev,i=cc,u=sc,a=zc.before(r));var d=f(a);do{if(a.isVisible()){var m=f(a);if(!u(m,d)){s.length>0&&i(m,At(s))&&l++;var g=ic(m);if(g.position=a,g.line=l,n(g))return s;s.push(g)}}}while(a=o(a));return s}(e,t.getBody(),Vx(1),s),v=Kx(Y(p,Fx(1)),d);if(v)return Qx(t,v.position.toRange(),!1);if(v=At(Y(p,Fx(0))))return Qx(t,v.position.toRange(),!1)}return 0===f.length?eC(t,c).filter(c?o:r).map((function(e){return Ow(t,e.toRange(),!1)})):L.none()},eC=function(t,e){var n=t.selection.getRng(),r=t.getBody();if(e){var o=zc.fromRangeEnd(n),i=Ax(r,o);return ct(i.positions)}return o=zc.fromRangeStart(n),i=Dx(r,o),at(i.positions)},nC=function(t,e,n){return eC(t,e).filter(n).exists((function(e){return t.selection.setRng(e.toRange()),!0}))},rC=function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)},oC=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},iC=function(t,e,n){return Yw(e,n).map((function(e){return rC(t,e),n}))},uC=function(t,e){if(t.selection.isCollapsed()&&!0!==t.composing&&e.get()){var n=zc.fromRangeStart(t.selection.getRng());zc.isTextPosition(n)&&!1===function(t){return No(t)||Bo(t)}(n)&&(rC(t,Bs(e.get(),n)),e.set(null))}},aC=function(t,e,n){return!!ks(t)&&function(t,e,n){var r=t.getBody(),o=zc.fromRangeStart(t.selection.getRng()),i=_(Yy,t);return hx(n,i,r,o).bind((function(n){return iC(t,e,n)}))}(t,e,n).isSome()},cC=function(t,e,n){return!!ks(e)&&yx(t,e)},sC=function(t){var e=Ta(null),n=_(Yy,t);return t.on("NodeChange",(function(r){var o,i,u,a,c,s;!ks(t)||ke.browser.isIE()&&r.initial||(o=n,i=t.dom,u=r.parents,a=$(ja(Me.fromDom(i.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(t){return t.dom})),c=Y(a,o),s=Y(u,o),G(it(c,s),_(oC,!1)),G(it(s,c),_(oC,!0)),uC(t,e),function(t,e,n,r){if(e.selection.isCollapsed()){var o=Y(r,t);G(o,(function(r){var o=zc.fromRangeStart(e.selection.getRng());ax(t,e.getBody(),o).bind((function(t){return iC(e,n,t)}))}))}}(n,t,e,r.parents))})),e},lC=_(cC,!0),fC=_(cC,!1),dC=function(t,e,n){if(ks(t)){var r=eC(t,e).getOrThunk((function(){var n=t.selection.getRng();return e?zc.fromRangeEnd(n):zc.fromRangeStart(n)}));return ax(_(Yy,t),t.getBody(),r).exists((function(e){var r=lx(e);return Yw(n,r).exists((function(e){return rC(t,e),!0}))}))}return!1},mC=function(t,e){return function(n){return Yw(e,n).exists((function(e){return rC(t,e),!0}))}},gC=function(t,e,n,r){var o=t.getBody(),i=_(Yy,t);t.undoManager.ignore((function(){t.selection.setRng(function(t,e){var n=document.createRange();return n.setStart(t.container(),t.offset()),n.setEnd(e.container(),e.offset()),n}(n,r)),t.execCommand("Delete"),ax(i,o,zc.fromRangeStart(t.selection.getRng())).map(fx).map(mC(t,e))})),t.nodeChanged()},hC=function(t,e,n,r){var o=function(t,e){return rl(e,t)||t}(t.getBody(),r.container()),i=_(Yy,t),u=ax(i,o,r);return u.bind((function(t){return n?t.fold(k(L.some(fx(t))),L.none,k(L.some(lx(t))),L.none):t.fold(L.none,k(L.some(lx(t))),L.none,k(L.some(fx(t))))})).map(mC(t,e)).getOrThunk((function(){var a=Il(n,o,r),c=a.bind((function(t){return ax(i,o,t)}));return Zn(u,c,(function(){return Qy(i,o,r).exists((function(e){return!!function(t){return Zn(jl(t),Ul(t),(function(e,n){var r=Zy(!0,e),o=Zy(!1,n);return Vl(t,r).forall((function(t){return t.isEqual(o)}))})).getOr(!0)}(e)&&(vh(t,n,Me.fromDom(e)),!0)}))})).orThunk((function(){return c.bind((function(o){return a.map((function(o){return n?gC(t,e,r,o):gC(t,e,o,r),!0}))}))})).getOr(!1)}))},pC=function(t,e,n){if(t.selection.isCollapsed()&&ks(t)){var r=zc.fromRangeStart(t.selection.getRng());return hC(t,e,n,r)}return!1},vC=function(t){return 1===un(t)},bC=function(t,e,n,r){var o=_(Np,e),i=$(Y(r,o),(function(t){return t.dom}));if(0===i.length)vh(e,t,n);else{var u=function(t,e){var n=_p(!1),r=Mp(e,n.dom);return gn(Me.fromDom(t),n),wn(Me.fromDom(t)),zc(r,0)}(n.dom,i);e.selection.setRng(u.toRange())}},yC=function(t,e){var n=Me.fromDom(t.getBody()),r=Me.fromDom(t.selection.getStart()),o=Y(function(t,e){var n=Eg(e,t);return et(n,ho).fold(k(n),(function(t){return n.slice(0,t)}))}(n,r),vC);return ct(o).exists((function(n){var r,i=zc.fromRangeStart(t.selection.getRng());return!(!function(t,e,n){return Zn(jl(n),Ul(n),(function(r,o){var i=Zy(!0,r),u=Zy(!1,o),a=Zy(!1,e);return t?Vl(n,a).exists((function(t){return t.isEqual(u)&&e.isEqual(i)})):Fl(n,a).exists((function(t){return t.isEqual(i)&&e.isEqual(u)}))})).getOr(!0)}(e,i,n.dom)||(r=n,ql(r.dom)&&Tp(r.dom))||(bC(e,t,n,o),0))}))},wC=function(t,e){return!!t.selection.isCollapsed()&&yC(t,e)},xC=function(t,e,n){return t._selectionOverrides.hideFakeCaret(),vh(t,e,Me.fromDom(n)),!0},CC=function(t,e){return t.selection.isCollapsed()?function(t,e){var n=e?vg:bg,r=e?Rc.Forwards:Rc.Backwards,o=ml(r,t.getBody(),t.selection.getRng());return n(o)?xC(t,e,o.getNode(!e)):L.from(Zy(e,o)).filter((function(t){return n(t)&&pl(o,t)})).exists((function(n){return xC(t,e,n.getNode(!e))}))}(t,e):function(t,e){var n=t.selection.getNode();return!!Jn(n)&&xC(t,e,n)}(t,e)},SC=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},kC=function(t,e){return(t||"table"===Ve(e)?"margin":"padding")+("rtl"===cr(e,"direction")?"-right":"-left")},TC=function(t){var e=_C(t);return!t.mode.isReadOnly()&&(e.length>1||function(t,e){return rt(e,(function(e){var n=kC(bs(t),e),r=lr(e,n).map(SC).getOr(0);return"false"!==t.dom.getContentEditable(e.dom)&&r>0}))}(t,e))},OC=function(t){return yo(t)||wo(t)},_C=function(t){return Y((e=t.selection.getSelectedBlocks(),$(e,Me.fromDom)),(function(t){return!OC(t)&&!function(t){return Ye(t).exists(OC)}(t)&&Zr(t,(function(t){return Kn(t.dom)||Xn(t.dom)})).exists((function(t){return Kn(t.dom)}))}));var e},EC=function(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=function(t){return t.getParam("indentation","40px","string")}(t),u=/[a-z%]+$/i.exec(i)[0],a=parseInt(i,10),c=bs(t),s=us(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),G(_C(t),(function(t){!function(t,e,n,r,o,i){var u=kC(n,Me.fromDom(i));if("outdent"===e){var a=Math.max(0,SC(i.style[u])-r);t.setStyle(i,u,a?a+o:"")}else a=SC(i.style[u])+r+o,t.setStyle(i,u,a)}(n,e,c,a,u,t.dom)}))},DC=function(t,e){if(t.selection.isCollapsed()&&TC(t)){var n=t.dom,r=t.selection.getRng(),o=zc.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&Rg(Me.fromDom(i),o))return EC(t,"outdent"),!0}return!1},AC=function(t,e){t.getDoc().execCommand(e,!1,null)},MC=function(t,e){t.addCommand("delete",(function(){!function(t,e){DC(t)||Hw(t,!1)||Aw(t,!1)||pC(t,e,!1)||pw(t,!1)||$h(t)||Vw(t,!1)||CC(t,!1)||ww(t)||wC(t,!1)||(AC(t,"Delete"),ow(t))}(t,e)})),t.addCommand("forwardDelete",(function(){!function(t,e){Hw(t,!0)||Aw(t,!0)||pC(t,e,!0)||pw(t,!0)||$h(t)||Vw(t,!0)||CC(t,!0)||ww(t)||wC(t,!0)||AC(t,"ForwardDelete")}(t,e)}))},zC=function(t){return void 0===t.touches||1!==t.touches.length?L.none():L.some(t.touches[0])},RC=function(t){var e=Ma(),n=Ta(!1),r=Ra((function(e){t.fire("longpress",Mt(Mt({},e),{type:"longpress"})),n.set(!0)}),400);t.on("touchstart",(function(t){zC(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.throttle(t),n.set(!1),e.set(i)}))}),!0),t.on("touchmove",(function(o){r.cancel(),zC(o).each((function(r){e.on((function(o){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(r,o)&&(e.clear(),n.set(!1),t.fire("longpresscancel"))}))}))}),!0),t.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&e.get().filter((function(t){return t.target.isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():t.fire("tap",Mt(Mt({},o),{type:"tap"}))}))}),!0)},NC=function(t,e){return xt(t,e.nodeName)},BC=function(t,e){return!!jn(e)||!!Nn(e)&&!NC(t,e)&&!rf(e)},PC=function(t,e){if(jn(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||NC(t,e.nextSibling)))return!0}return!1},IC=function(t){var e,n,r,o=t.dom,i=t.selection,u=t.schema,a=u.getBlockElements(),c=i.getStart(),s=t.getBody(),l=us(t);if(c&&Nn(c)&&l){var f=s.nodeName.toLowerCase();if(u.isValidChild(f,l.toLowerCase())&&!function(t,e,n){return q(_g(Me.fromDom(n),Me.fromDom(e)),(function(e){return NC(t,e.dom)}))}(a,s,c)){var d=i.getRng(),m=d.startContainer,g=d.startOffset,h=d.endContainer,p=d.endOffset,v=_m(t);for(c=s.firstChild;c;)if(BC(a,c)){if(PC(a,c)){n=c,c=c.nextSibling,o.remove(n);continue}e||(e=o.create(l,as(t)),c.parentNode.insertBefore(e,c),r=!0),n=c,c=c.nextSibling,e.appendChild(n)}else e=null,c=c.nextSibling;r&&v&&(d.setStart(m,g),d.setEnd(h,p),i.setRng(d),t.nodeChanged())}}},LC=function(t,e){e.hasAttribute("data-mce-caret")&&(Ho(e),function(t){t.selection.setRng(t.selection.getRng())}(t),t.selection.scrollIntoView(e))},HC=function(t,e){var n=function(t){return no(Me.fromDom(t.getBody()),"*[data-mce-caret]").map((function(t){return t.dom})).getOrNull()}(t);if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void LC(t,n)):void(Ro(n)&&(LC(t,n),t.undoManager.add()))},VC=Xn,FC=function(t,e,n){var r=Ml(t.getBody()),o=_(hl,1===e?r.next:r.prev);if(n.collapsed&&function(t){return""!==us(t)}(t)){var i=t.dom.getParent(n.startContainer,"PRE");if(!i)return;if(!o(zc.fromRangeStart(n))){var u=function(t){var e=t.dom.create(us(t));return(!ke.ie||ke.ie>=11)&&(e.innerHTML='<br data-mce-bogus="1">'),e}(t);1===e?t.$(i).after(u):t.$(i).before(u),t.selection.select(u,!0),t.selection.collapse()}}},jC=function(t,e){var n=e?Rc.Forwards:Rc.Backwards,r=t.selection.getRng();return function(t,e,n){return Zx(e,t,n,xg,Cg,VC)}(n,t,r).orThunk((function(){return FC(t,n,r),L.none()}))},UC=function(t,e){var n=e?1:-1,r=t.selection.getRng();return function(t,e,n){return tC(e,t,n,(function(t){return xg(t)||yg(t)}),(function(t){return Cg(t)||wg(t)}),VC)}(n,t,r).orThunk((function(){return FC(t,n,r),L.none()}))},WC=function(t,e){return jC(t,e).exists((function(e){return Jx(t,e),!0}))},qC=function(t,e){return UC(t,e).exists((function(e){return Jx(t,e),!0}))},$C=function(t,e){return nC(t,e,e?Cg:xg)},GC=function(t){return W(["figcaption"],Ve(t))},KC=function(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e},XC=function(t,e,n){n?vn(t,e):pn(t,e)},YC=function(t,e,n,r){return""===e?function(t,e){var n=Me.fromTag("br");return XC(t,n,e),KC(n)}(t,r):function(t,e,n,r){var o=Me.fromTag(n),i=Me.fromTag("br");return rr(o,r),vn(o,i),XC(t,o,e),KC(i)}(t,r,e,n)},JC=function(t,e,n){return e?function(t,e){return Ax(t,e).breakAt.isNone()}(t.dom,n):function(t,e){return Dx(t,e).breakAt.isNone()}(t.dom,n)},QC=function(t,e){var n=Me.fromDom(t.getBody()),r=zc.fromRangeStart(t.selection.getRng()),o=us(t),i=as(t);return function(t,e){var n=_(Be,e);return Zr(Me.fromDom(t.container()),ho,n).filter(GC)}(r,n).exists((function(){if(JC(n,e,r)){var u=YC(n,o,i,e);return t.selection.setRng(u),!0}return!1}))},ZC=function(t,e){return!!t.selection.isCollapsed()&&QC(t,e)},tS=function(t,e){return nt(function(t){return $(t,(function(t){return Mt({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:x},t)}))}(t),(function(t){return function(t,e){return e.keyCode===t.keyCode&&e.shiftKey===t.shiftKey&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey}(t,e)?[t]:[]}))},eS=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}},nS=function(t,e){return tt(tS(t,e),(function(t){return t.action()}))},rS=function(t,e){var n=e?Rc.Forwards:Rc.Backwards,r=t.selection.getRng();return Zx(t,n,r,vg,bg,Jn).exists((function(e){return Jx(t,e),!0}))},oS=function(t,e){var n=e?1:-1,r=t.selection.getRng();return tC(t,n,r,vg,bg,Jn).exists((function(e){return Jx(t,e),!0}))},iS=function(t,e){return nC(t,e,e?bg:vg)},uS=function(t,e,n,r,o){var i=ja(Me.fromDom(n),"td,th,caption").map((function(t){return t.dom}));return function(t,e,n){return Q(t,(function(t,r){return t.fold((function(){return L.some(r)}),(function(t){var o=Math.sqrt(Math.abs(t.x-e)+Math.abs(t.y-n)),i=Math.sqrt(Math.abs(r.x-e)+Math.abs(r.y-n));return L.some(i<o?r:t)}))}),L.none())}(Y(function(t,e){return nt(e,(function(e){var n=function(t,e){return{left:t.left-e,top:t.top-e,right:t.right+2*e,bottom:t.bottom+2*e,width:t.width+e,height:t.height+e}}(ic(e.getBoundingClientRect()),-1);return[{x:n.left,y:t(n),cell:e},{x:n.right,y:t(n),cell:e}]}))}(t,i),(function(t){return e(t,o)})),r,o).map((function(t){return t.cell}))},aS=_(uS,(function(t){return t.bottom}),(function(t,e){return t.y<e})),cS=_(uS,(function(t){return t.top}),(function(t,e){return t.y>e})),sS=function(t,e){return at(e.getClientRects()).bind((function(e){return aS(t,e.left,e.top)})).bind((function(t){return Ex(Ul(n=t).map((function(t){return Dx(n,t).positions.concat(t)})).getOr([]),e);var n}))},lS=function(t,e){return ct(e.getClientRects()).bind((function(e){return cS(t,e.left,e.top)})).bind((function(t){return Ex(jl(n=t).map((function(t){return[t].concat(Ax(n,t).positions)})).getOr([]),e);var n}))},fS=function(t,e,n){var r=t(e,n);return function(t){return t.breakType===px.Wrap&&0===t.positions.length}(r)||!$n(n.getNode())&&function(t){return t.breakType===px.Br&&1===t.positions.length}(r)?!function(t,e,n){return n.breakAt.exists((function(n){return t(e,n).breakAt.isSome()}))}(t,e,r):r.breakAt.isNone()},dS=_(fS,Dx),mS=_(fS,Ax),gS=function(t,e,n,r){var o=t.selection.getRng(),i=e?1:-1;return!(!Us()||!function(t,e,n){var r=zc.fromRangeStart(e);return Hl(!t,n).exists((function(t){return t.isEqual(r)}))}(e,o,n)||(Sw(i,t,n,!e,!1).each((function(e){Jx(t,e)})),0))},hS=function(t,e){var n=e.getNode(t);return Nn(n)&&"TABLE"===n.nodeName?L.some(n):L.none()},pS=function(t,e,n){var r=hS(!!e,n),o=!1===e;r.fold((function(){return Jx(t,n.toRange())}),(function(r){return Hl(o,t.getBody()).filter((function(t){return t.isEqual(n)})).fold((function(){return Jx(t,n.toRange())}),(function(o){return function(t,e,n,r){var o=us(e);o?e.undoManager.transact((function(){var r=Me.fromTag(o);rr(r,as(e)),vn(r,Me.fromTag("br")),t?hn(Me.fromDom(n),r):gn(Me.fromDom(n),r);var i=e.dom.createRng();i.setStart(r.dom,0),i.setEnd(r.dom,0),Jx(e,i)})):Jx(e,r.toRange())}(e,t,r,n)}))}))},vS=function(t,e,n,r){var o=t.selection.getRng(),i=zc.fromRangeStart(o),u=t.getBody();if(!e&&dS(r,i)){var a=function(t,e,n){return sS(e,n).orThunk((function(){return at(n.getClientRects()).bind((function(n){return _x(Mx(t,zc.before(e)),n.left)}))})).getOr(zc.before(e))}(u,n,i);return pS(t,e,a),!0}return!(!e||!mS(r,i))&&(a=function(t,e,n){return lS(e,n).orThunk((function(){return at(n.getClientRects()).bind((function(n){return _x(zx(t,zc.after(e)),n.left)}))})).getOr(zc.after(e))}(u,n,i),pS(t,e,a),!0)},bS=function(t,e,n){return L.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(r){return L.from(t.dom.getParent(r,"table")).map((function(o){return n(t,e,o,r)}))})).getOr(!1)},yS=function(t,e){return bS(t,e,gS)},wS=function(t,e){return bS(t,e,vS)},xS=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){var r=he().os;nS([{keyCode:dd.RIGHT,action:eS(WC,t,!0)},{keyCode:dd.LEFT,action:eS(WC,t,!1)},{keyCode:dd.UP,action:eS(qC,t,!1)},{keyCode:dd.DOWN,action:eS(qC,t,!0)},{keyCode:dd.RIGHT,action:eS(yS,t,!0)},{keyCode:dd.LEFT,action:eS(yS,t,!1)},{keyCode:dd.UP,action:eS(wS,t,!1)},{keyCode:dd.DOWN,action:eS(wS,t,!0)},{keyCode:dd.RIGHT,action:eS(rS,t,!0)},{keyCode:dd.LEFT,action:eS(rS,t,!1)},{keyCode:dd.UP,action:eS(oS,t,!1)},{keyCode:dd.DOWN,action:eS(oS,t,!0)},{keyCode:dd.RIGHT,action:eS(aC,t,e,!0)},{keyCode:dd.LEFT,action:eS(aC,t,e,!1)},{keyCode:dd.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:eS(lC,t,e)},{keyCode:dd.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:eS(fC,t,e)},{keyCode:dd.UP,action:eS(ZC,t,!1)},{keyCode:dd.DOWN,action:eS(ZC,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))},CS=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){nS([{keyCode:dd.BACKSPACE,action:eS(DC,t,!1)},{keyCode:dd.BACKSPACE,action:eS(Hw,t,!1)},{keyCode:dd.DELETE,action:eS(Hw,t,!0)},{keyCode:dd.BACKSPACE,action:eS(Aw,t,!1)},{keyCode:dd.DELETE,action:eS(Aw,t,!0)},{keyCode:dd.BACKSPACE,action:eS(pC,t,e,!1)},{keyCode:dd.DELETE,action:eS(pC,t,e,!0)},{keyCode:dd.BACKSPACE,action:eS($h,t,!1)},{keyCode:dd.DELETE,action:eS($h,t,!0)},{keyCode:dd.BACKSPACE,action:eS(Vw,t,!1)},{keyCode:dd.DELETE,action:eS(Vw,t,!0)},{keyCode:dd.BACKSPACE,action:eS(CC,t,!1)},{keyCode:dd.DELETE,action:eS(CC,t,!0)},{keyCode:dd.BACKSPACE,action:eS(ww,t,!1)},{keyCode:dd.DELETE,action:eS(ww,t,!0)},{keyCode:dd.BACKSPACE,action:eS(pw,t,!1)},{keyCode:dd.DELETE,action:eS(pw,t,!0)},{keyCode:dd.BACKSPACE,action:eS(wC,t,!1)},{keyCode:dd.DELETE,action:eS(wC,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)})),t.on("keyup",(function(e){!1===e.isDefaultPrevented()&&function(t,e){nS([{keyCode:dd.BACKSPACE,action:eS(Lw,t)},{keyCode:dd.DELETE,action:eS(Lw,t)}],e)}(t,e)}))},SS=function(t,e){var n,r=e,o=t.dom,i=t.schema.getMoveCaretBeforeOnEnterElements();if(e){if(/^(LI|DT|DD)$/.test(e.nodeName)){var u=function(t){for(;t;){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}}(e.firstChild);u&&/^(UL|OL|DL)$/.test(u.nodeName)&&e.insertBefore(o.doc.createTextNode(ko),e.firstChild)}var a=o.createRng();if(e.normalize(),e.hasChildNodes()){for(var c=new fo(e,e);n=c.current();){if(jn(n)){a.setStart(n,0),a.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){a.setStartBefore(n),a.setEndBefore(n);break}r=n,n=c.next()}n||(a.setStart(r,0),a.setEnd(r,0))}else $n(e)?e.nextSibling&&o.isBlock(e.nextSibling)?(a.setStartBefore(e),a.setEndBefore(e)):(a.setStartAfter(e),a.setEndAfter(e)):(a.setStart(e,0),a.setEnd(e,0));t.selection.setRng(a),Jd(t,a)}},kS=function(t){return L.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},TS=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},OS=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},_S=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},ES=function(t,e,n){for(var r=t[n?"firstChild":"lastChild"];r&&!Nn(r);)r=r[n?"nextSibling":"previousSibling"];return r===e},DS=function(t,e,n,r,o){var i=t.dom,u=t.selection.getRng();if(n!==t.getBody()){var a;OS(a=n)&&OS(a.parentNode)&&(o="LI");var c=o?e(o):i.create("BR");if(ES(n,r,!0)&&ES(n,r,!1))if(TS(n,"LI")){var s=_S(n);i.insertAfter(c,s),function(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.firstChild)===t}(n)?i.remove(s):i.remove(n)}else i.replace(c,n);else if(ES(n,r,!0))TS(n,"LI")?(i.insertAfter(c,_S(n)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(n)):n.parentNode.insertBefore(c,n),i.remove(r);else if(ES(n,r,!1))i.insertAfter(c,_S(n)),i.remove(r);else{n=_S(n);var l=u.cloneRange();l.setStartAfter(r),l.setEndAfter(n);var f=l.extractContents();"LI"===o&&function(t,e){return t.firstChild&&t.firstChild.nodeName===e}(f,"LI")?(c=f.firstChild,i.insertAfter(f,n)):(i.insertAfter(f,n),i.insertAfter(c,n)),i.remove(r)}SS(t,c)}},AS=function(t,e){return e&&"A"===e.nodeName&&t.isEmpty(e)},MS=function(t){t.innerHTML='<br data-mce-bogus="1">'},zS=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},RS=function(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)},NS=function(t,e,n){return!1===jn(e)?n:t?1===n&&e.data.charAt(n-1)===To?0:n:n===e.data.length-1&&e.data.charAt(n)===To?e.data.length:n},BS=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},PS=function(t,e){var n=us(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){var r=t.dom;L.from(n.style).map(r.parseStyle).each((function(t){var n=fr(Me.fromDom(e)),o=Mt(Mt({},n),t);r.setStyles(e,o)}));var o=L.from(n.class).map((function(t){return t.split(/\s+/)})),i=L.from(e.className).map((function(t){return Y(t.split(/\s+/),(function(t){return""!==t}))}));Zn(o,i,(function(t,n){var o=Y(n,(function(e){return!W(t,e)})),i=zt(zt([],t),o);r.setAttrib(e,"class",i.join(" "))}));var u=["style","class"],a=bt(n,(function(t,e){return!W(u,e)}));r.setAttribs(e,a)}(t,e,as(t))},IS=function(t,e){var n,r,o,i,u,a,c,s,l,f,d=t.dom,m=t.schema,g=m.getNonEmptyElements(),h=t.selection.getRng(),p=function(e){var n,o,u,a=r,c=m.getTextInlineElements();if(u=n=e||"TABLE"===s||"HR"===s?d.create(e||l):i.cloneNode(!1),!1===function(t){return t.getParam("keep_styles",!0)}(t))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(c[a.nodeName]){if(ql(a)||rf(a))continue;o=a.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(u=o,n.appendChild(o))}}while((a=a.parentNode)&&a!==x);return PS(t,n),MS(u),n},v=function(t){var e,n,u=NS(t,r,o);if(jn(r)&&(t?u>0:u<r.nodeValue.length))return!1;if(r.parentNode===i&&f&&!t)return!0;if(t&&Nn(r)&&r===i.firstChild)return!0;if(zS(r,"TABLE")||zS(r,"HR"))return f&&!t||!f&&t;var a=new fo(r,i);for(jn(r)&&(t&&0===u?a.prev():t||u!==r.nodeValue.length||a.next());e=a.current();){if(Nn(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),g[n]&&"br"!==n))return!1}else if(jn(e)&&!Zo(e.nodeValue))return!1;t?a.prev():a.next()}return!0},b=function(){u=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==C?p(l):p(),function(t){return t.getParam("end_container_on_empty_block",!1)}(t)&&RS(d,c)&&d.isEmpty(i)?u=d.split(c,i):d.insertAfter(u,i),SS(t,u)};Od(d,h).each((function(t){h.setStart(t.startContainer,t.startOffset),h.setEnd(t.endContainer,t.endOffset)})),r=h.startContainer,o=h.startOffset,l=us(t);var y=!(!e||!e.shiftKey),w=!(!e||!e.ctrlKey);Nn(r)&&r.hasChildNodes()&&(f=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=f&&jn(r)?r.nodeValue.length:0);var x=BS(d,r);if(x){(l&&!y||!l&&y)&&(r=function(t,e,n,r,o){var i,u,a,c,s,l,f=e||"P",d=t.dom,m=BS(d,r);if(!(u=d.getParent(r,d.isBlock))||!RS(d,u)){if(l=(u=u||m)===t.getBody()||function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)}(u)?u.nodeName.toLowerCase():u.parentNode.nodeName.toLowerCase(),!u.hasChildNodes())return i=d.create(f),PS(t,i),u.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(c=r;c.parentNode!==u;)c=c.parentNode;for(;c&&!d.isBlock(c);)a=c,c=c.previousSibling;if(a&&t.schema.isValidChild(l,f.toLowerCase())){for(i=d.create(f),PS(t,i),a.parentNode.insertBefore(i,a),c=a;c&&!d.isBlock(c);)s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o)}}return r}(t,l,h,r,o)),i=d.getParent(r,d.isBlock),c=i?d.getParent(i.parentNode,d.isBlock):null,s=i?i.nodeName.toUpperCase():"";var C=c?c.nodeName.toUpperCase():"";"LI"!==C||w||(i=c,c=c.parentNode,s=C),/^(LI|DT|DD)$/.test(s)&&d.isEmpty(i)?DS(t,p,c,i,l):l&&i===t.getBody()||(l=l||"P",Ao(i)?(u=Ho(i),d.isEmpty(i)&&MS(i),PS(t,u),SS(t,u)):v()?b():v(!0)?(u=i.parentNode.insertBefore(p(),i),SS(t,zS(i,"HR")?u:i)):((n=function(t){var e=t.cloneRange();return e.setStart(t.startContainer,NS(!0,t.startContainer,t.startOffset)),e.setEnd(t.endContainer,NS(!1,t.endContainer,t.endOffset)),e}(h).cloneRange()).setEndAfter(i),function(t){G(Fa(Me.fromDom(t),We),(function(t){var e=t.dom;e.nodeValue=_o(e.nodeValue)}))}(a=n.extractContents()),function(t){do{jn(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)}(a),u=a.firstChild,d.insertAfter(a,i),function(t,e,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(t.isBlock(o))return;Nn(o)&&!e[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)(!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||AS(t,o))&&t.remove(o)}}(d,g,u),function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")}(d,i),d.isEmpty(i)&&MS(i),u.normalize(),d.isEmpty(u)?(d.remove(u),b()):(PS(t,u),SS(t,u))),d.setAttrib(u,"id",""),t.fire("NewBlock",{newBlock:u}))}},LS=function(t,e,n){var r=t.dom.createRng();n?(r.setStartBefore(e),r.setEndBefore(e)):(r.setStartAfter(e),r.setEndAfter(e)),t.selection.setRng(r),Jd(t,r)},HS=function(t,e){var n,r,o=t.selection,i=t.dom,u=o.getRng();Od(i,u).each((function(t){u.setStart(t.startContainer,t.startOffset),u.setEnd(t.endContainer,t.endOffset)}));var a=u.startOffset,c=u.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=a>c.childNodes.length-1;c=c.childNodes[Math.min(a,c.childNodes.length-1)]||c,a=s&&3===c.nodeType?c.nodeValue.length:0}var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!e||!e.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&a>=c.nodeValue.length&&(function(t,e,n){for(var r,o=new fo(e,n),i=t.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0}(t.schema,c,l)||(n=i.create("br"),u.insertNode(n),u.setStartAfter(n),u.setEndAfter(n),r=!0)),n=i.create("br"),Pc(i,u,n),LS(t,n,r),t.undoManager.add()},VS=function(t,e){var n=Me.fromTag("br");gn(Me.fromDom(e),n),t.undoManager.add()},FS=function(t,e){jS(t.getBody(),e)||hn(Me.fromDom(e),Me.fromTag("br"));var n=Me.fromTag("br");hn(Me.fromDom(e),n),LS(t,n.dom,!1),t.undoManager.add()},jS=function(t,e){return n=zc.after(e),!!$n(n.getNode())||Vl(t,zc.after(e)).map((function(t){return $n(t.getNode())})).getOr(!1);var n},US=function(t){return t&&"A"===t.nodeName&&"href"in t},WS=function(t){return t.fold(R,US,US,R)},qS=function(t,e){e.fold(x,_(VS,t),_(FS,t),x)},$S=function(t,e){var n=function(t){var e=_(Yy,t),n=zc.fromRangeStart(t.selection.getRng());return ax(e,t.getBody(),n).filter(WS)}(t);n.isSome()?n.each(_(qS,t)):HS(t,e)},GS=function(t,e){return kS(t).filter((function(t){return e.length>0&&Re(Me.fromDom(t),e)})).isSome()},KS=Er([{br:[]},{block:[]},{none:[]}]),XS=function(t,e){return function(t){return GS(t,function(t){return t.getParam("no_newline_selector","")}(t))}(t)},YS=function(t){return function(e,n){return""===us(e)===t}},JS=function(t){return function(e,n){return function(t){return kS(t).filter((function(t){return wo(Me.fromDom(t))})).isSome()}(e)===t}},QS=function(t,e){return function(n,r){return function(t){return kS(t).fold(k(""),(function(t){return t.nodeName.toUpperCase()}))}(n)===t.toUpperCase()===e}},ZS=function(t){return QS("pre",t)},tk=function(t){return function(e,n){return function(t){return t.getParam("br_in_pre",!0)}(e)===t}},ek=function(t,e){return function(t){return GS(t,function(t){return t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(t))}(t)},nk=function(t,e){return e},rk=function(t){var e=us(t),n=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o}(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")},ok=function(t,e){return function(n,r){return Q(t,(function(t,e){return t&&e(n,r)}),!0)?L.some(e):L.none()}},ik=function(t,e){(function(t,e){return Jw([ok([XS],KS.none()),ok([QS("summary",!0)],KS.br()),ok([ZS(!0),tk(!1),nk],KS.br()),ok([ZS(!0),tk(!1)],KS.block()),ok([ZS(!0),tk(!0),nk],KS.block()),ok([ZS(!0),tk(!0)],KS.br()),ok([JS(!0),nk],KS.br()),ok([JS(!0)],KS.block()),ok([YS(!0),nk,rk],KS.block()),ok([YS(!0)],KS.br()),ok([ek],KS.br()),ok([YS(!1),nk],KS.br()),ok([rk],KS.block())],[t,!(!e||!e.shiftKey)]).getOr(KS.none())})(t,e).fold((function(){$S(t,e)}),(function(){IS(t,e)}),x)},uk=function(t){t.on("keydown",(function(e){e.keyCode===dd.ENTER&&function(t,e){var n;e.isDefaultPrevented()||(e.preventDefault(),(n=t.undoManager).typing&&(n.typing=!1,n.add()),t.undoManager.transact((function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),ik(t,e)})))}(t,e)}))},ak=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){nS([{keyCode:dd.END,action:eS($C,t,!0)},{keyCode:dd.HOME,action:eS($C,t,!1)},{keyCode:dd.END,action:eS(iS,t,!0)},{keyCode:dd.HOME,action:eS(iS,t,!1)},{keyCode:dd.END,action:eS(dC,t,!0,e)},{keyCode:dd.HOME,action:eS(dC,t,!1,e)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))},ck=he().browser,sk=function(t){!function(t){var e=za((function(){t.composing||nh(t)}),0);ck.isIE()&&(t.on("keypress",(function(t){e.throttle()})),t.on("remove",(function(t){e.cancel()})))}(t),t.on("input",(function(e){!1===e.isComposing&&nh(t)}))},lk=he(),fk=function(t){return t.stopImmediatePropagation()},dk=function(t){return t.keyCode===dd.PAGE_UP||t.keyCode===dd.PAGE_DOWN},mk=function(t,e,n){n&&!t.get()?e.on("NodeChange",fk,!0):!n&&t.get()&&e.off("NodeChange",fk),t.set(n)},gk=function(t,e){if(!lk.os.isOSX()){var n=Ta(!1);t.on("keydown",(function(e){dk(e)&&mk(n,t,!0)})),t.on("keyup",(function(r){!1===r.isDefaultPrevented()&&function(t,e,n){nS([{keyCode:dd.PAGE_UP,action:eS(dC,t,!1,e)},{keyCode:dd.PAGE_DOWN,action:eS(dC,t,!0,e)}],n)}(t,e,r),dk(r)&&n.get()&&(mk(n,t,!1),t.nodeChanged())}))}},hk=function(t,e){var n=e.container(),r=e.offset();return jn(n)?(n.insertData(r,t),L.some(zc(n,r+t.length))):gl(e).map((function(n){var r=Me.fromText(t);return e.isAtEnd()?hn(n,r):gn(n,r),zc(r.dom,t.length)}))},pk=_(hk,ko),vk=_(hk," "),bk=function(t,e){return function(n){return function(t,e){return!Gg(e)&&(Kg(t,e)||qg(t,e)||$g(t,e))}(t,n)?pk(e):vk(e)}},yk=function(t){var e=zc.fromRangeStart(t.selection.getRng()),n=Me.fromDom(t.getBody());if(t.selection.isCollapsed()){var r=_(Yy,t),o=zc.fromRangeStart(t.selection.getRng());return ax(r,t.getBody(),o).bind(function(t){return function(e){return e.fold((function(e){return Fl(t.dom,zc.before(e))}),(function(t){return jl(t)}),(function(t){return Ul(t)}),(function(e){return Vl(t.dom,zc.after(e))}))}}(n)).bind(bk(n,e)).exists(function(t){return function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}}(t))}return!1},wk=function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){nS([{keyCode:dd.SPACEBAR,action:eS(yk,t)}],e).each((function(t){e.preventDefault()}))}(t,e)}))},xk=function(t){var e=sC(t);return function(t){t.on("keyup compositionstart",_(HC,t))}(t),xS(t,e),CS(t,e),uk(t),wk(t),sk(t),ak(t,e),gk(t,e),e},Ck=function(){function t(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",(function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&vd(o,e)||t.fire("SelectionChange"),e=o})),t.on("contextmenu",(function(){t.fire("SelectionChange")})),t.on("SelectionChange",(function(){var e=t.selection.getStart(!0);!e||!ke.range&&t.selection.isCollapsed()||Yf(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})})),t.on("mouseup",(function(e){!e.isDefaultPrevented()&&Yf(t)&&("IMG"===t.selection.getNode().nodeName?co.setEditorTimeout(t,(function(){t.nodeChanged()})):t.nodeChanged())}))}return t.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(e=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,(function(t){if(t===r)return!0;n.push(t)})),(t=t||{}).element=e,t.parents=n,this.editor.fire("NodeChange",t))},t.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;e>=0&&n[e]===this.lastPath[e];e--);if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},t}(),Sk=function(t){!function(t){t.on("click",(function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}))}(t),function(t){t.parser.addNodeFilter("details",(function(t){G(t,(function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")}))})),t.serializer.addNodeFilter("details",(function(t){G(t,(function(t){var e=t.attr("data-mce-open");t.attr("open",f(e)?e:null),t.attr("data-mce-open",null)}))}))}(t)},kk=function(t){return Nn(t)&&bo(Me.fromDom(t))},Tk=function(t){t.on("click",(function(e){e.detail>=3&&function(t){var e=t.selection.getRng(),n=zc.fromRangeStart(e),r=zc.fromRangeEnd(e);if(zc.isElementPosition(n)){var o=n.container();kk(o)&&jl(o).each((function(t){return e.setStart(t.container(),t.offset())}))}zc.isElementPosition(r)&&(o=n.container(),kk(o)&&Ul(o).each((function(t){return e.setEnd(t.container(),t.offset())}))),t.selection.setRng(Kh(e))}(t)}))},Ok=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}},_k=function(t,e){return n=function(t){return t.inline?Ok(t.getBody()):{left:0,top:0}}(t),r=function(t){var e=t.getBody();return t.inline?{left:e.scrollLeft,top:e.scrollTop}:{left:0,top:0}}(t),{pageX:(o=function(t,e){if(e.target.ownerDocument!==t.getDoc()){var n=Ok(t.getContentAreaContainer()),r=function(t){var e=t.getBody(),n=t.getDoc().documentElement,r={left:e.scrollLeft,top:e.scrollTop},o={left:e.scrollLeft||n.scrollLeft,top:e.scrollTop||n.scrollTop};return t.inline?r:o}(t);return{left:e.pageX-n.left+r.left,top:e.pageY-n.top+r.top}}return{left:e.pageX,top:e.pageY}}(t,e)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o},Ek=Xn,Dk=Kn,Ak=function(t,e,n,r){var o=t.dom,i=e.cloneNode(!0);o.setStyles(i,{width:n,height:r}),o.setAttrib(i,"data-mce-selected",null);var u=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(u,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),o.setStyles(i,{margin:0,boxSizing:"border-box"}),u.appendChild(i),u},Mk=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},zk=function(t,e){return function(n){if(function(t){return 0===t.button}(n)){var r=tt(e.dom.getParents(n.target),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}(Ek,Dk)).getOr(null);if(a=e.getBody(),Ek(c=r)&&c!==a){var o=e.dom.getPos(r),i=e.getBody(),u=e.getDoc().documentElement;t.set({element:r,dragging:!1,screenX:n.screenX,screenY:n.screenY,maxX:(e.inline?i.scrollWidth:u.offsetWidth)-2,maxY:(e.inline?i.scrollHeight:u.offsetHeight)-2,relX:n.pageX-o.x,relY:n.pageY-o.y,width:r.offsetWidth,height:r.offsetHeight,ghost:Ak(e,r,r.offsetWidth,r.offsetHeight)})}}var a,c}},Rk=function(t,e){return function(n){t.on((function(t){if(t.dragging&&function(t,e,n){return e!==n&&!t.dom.isChildOf(e,n)&&!Ek(e)}(e,(u=e.selection,3===(a=u.getSel().getRangeAt(0).startContainer).nodeType?a.parentNode:a),t.element)){var r=(o=t.element,(i=o.cloneNode(!0)).removeAttribute("data-mce-selected"),i);e.fire("drop",{clientX:n.clientX,clientY:n.clientY}).isDefaultPrevented()||e.undoManager.transact((function(){Mk(t.element),e.insertContent(e.dom.getOuterHTML(r)),e._selectionOverrides.hideFakeCaret()}))}var o,i,u,a})),Nk(t)}},Nk=function(t){t.on((function(t){Mk(t.ghost)})),t.clear()},Bk=function(t){var e=Ma(),n=wa.DOM,r=document,o=zk(e,t),i=function(t,e){var n=co.throttle((function(t,n){e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t,n)}),0);return e.on("remove",n.stop),function(r){return t.on((function(t){var o,i,u=Math.max(Math.abs(r.screenX-t.screenX),Math.abs(r.screenY-t.screenY));if(!t.dragging&&u>10){if(e.fire("dragstart",{target:t.element}).isDefaultPrevented())return;t.dragging=!0,e.focus()}if(t.dragging){var a=function(t,e){return{pageX:e.pageX-t.relX,pageY:e.pageY+5}}(t,_k(e,r));o=t.ghost,i=e.getBody(),o.parentNode!==i&&i.appendChild(o),function(t,e,n,r,o,i){var u=0,a=0;t.style.left=e.pageX+"px",t.style.top=e.pageY+"px",e.pageX+n>o&&(u=e.pageX+n-o),e.pageY+r>i&&(a=e.pageY+r-i),t.style.width=n-u+"px",t.style.height=r-a+"px"}(t.ghost,a,t.width,t.height,t.maxX,t.maxY),n(r.clientX,r.clientY)}}))}}(e,t),u=Rk(e,t),a=function(t,e){return function(){t.on((function(t){t.dragging&&e.fire("dragend")})),Nk(t)}}(e,t);t.on("mousedown",o),t.on("mousemove",i),t.on("mouseup",u),n.bind(r,"mousemove",i),n.bind(r,"mouseup",a),t.on("remove",(function(){n.unbind(r,"mousemove",i),n.unbind(r,"mouseup",a)}))},Pk=function(t){Bk(t),function(t){t.on("drop",(function(e){var n=void 0!==e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(Ek(n)||"false"===t.dom.getContentEditableParent(n))&&e.preventDefault()}))}(t),function(t){return t.getParam("block_unsupported_drop",!0,"boolean")}(t)&&function(t){var e=function(e){if(!e.isDefaultPrevented()){var n=e.dataTransfer;n&&(W(n.types,"Files")||n.files.length>0)&&(e.preventDefault(),"drop"===e.type&&wy(t,"Dropped file type is not supported"))}},n=function(n){wm(t,n.target)&&e(n)},r=function(){var r=wa.DOM,o=t.dom,i=document,u=t.inline?t.getBody():t.getDoc(),a=["drop","dragover"];G(a,(function(t){r.bind(i,t,n),o.bind(u,t,e)})),t.on("remove",(function(){G(a,(function(t){r.unbind(i,t,n),o.unbind(u,t,e)}))}))};t.on("init",(function(){co.setEditorTimeout(t,r,0)}))}(t)},Ik=Kn,Lk=Xn,Hk=function(t,e){return ad(t.getBody(),e)},Vk=function(t){var e,n=t.selection,r=t.dom,o=r.isBlock,i=t.getBody(),u=js(t,i,o,(function(){return _m(t)})),a="sel-"+r.uniqueId(),c="data-mce-selected",s=function(t){return t!==i&&(Lk(t)||Jn(t))&&r.isChildOf(t,i)},l=function(t){t&&n.setRng(t)},f=n.getRng,d=function(e,r,o,i){return void 0===i&&(i=!0),t.fire("ShowCaret",{target:r,direction:e,before:o}).isDefaultPrevented()?null:(i&&n.scrollIntoView(r,-1===e),u.show(o,r))},m=function(t){return zo(t)||Io(t)||Lo(t)},g=function(t){return m(t.startContainer)||m(t.endContainer)},h=function(e){var n=t.schema.getShortEndedElements(),o=r.createRng(),i=e.startContainer,u=e.startOffset,a=e.endContainer,c=e.endOffset;return xt(n,i.nodeName.toLowerCase())?0===u?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,u),xt(n,a.nodeName.toLowerCase())?0===c?o.setEndBefore(a):o.setEndAfter(a):o.setEnd(a,c),o},p=function(o){var i=o.cloneNode(!0),u=t.fire("ObjectSelected",{target:o,targetClone:i});if(u.isDefaultPrevented())return null;var s=function(e,o,i){var u=t.$,c=no(Me.fromDom(t.getBody()),"#"+a).fold((function(){return u([])}),(function(t){return u([t.dom])}));0===c.length&&(c=u('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",a)).appendTo(t.getBody());var s=r.createRng();o===i&&ke.ie?(c.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(o),s.setStartAfter(c[0].firstChild.firstChild),s.setEndAfter(o)):(c.empty().append(ko).append(o).append(ko),s.setStart(c[0].firstChild,1),s.setEnd(c[0].lastChild,0)),c.css({top:r.getPos(e,t.getBody()).y}),c[0].focus();var l=n.getSel();return l.removeAllRanges(),l.addRange(s),s}(o,u.targetClone,i),l=Me.fromDom(o);return G(ja(Me.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){Be(l,t)||ur(t,c)})),r.getAttrib(o,c)||o.setAttribute(c,"1"),e=o,y(),s},v=function(t,e){if(!t)return null;if(t.collapsed){if(!g(t)){var n=e?1:-1,o=ml(n,i,t),u=o.getNode(!e);if(qs(u))return d(n,u,!!e&&!o.isAtEnd(),!1);var a=o.getNode(e);if(qs(a))return d(n,a,!e&&!o.isAtEnd(),!1)}return null}var c=t.startContainer,l=t.startOffset,f=t.endOffset;if(3===c.nodeType&&0===l&&Lk(c.parentNode)&&(c=c.parentNode,l=r.nodeIndex(c),c=c.parentNode),1!==c.nodeType)return null;if(f===l+1&&c===t.endContainer){var m=c.childNodes[l];if(s(m))return p(m)}return null},b=function(){e&&e.removeAttribute(c),no(Me.fromDom(t.getBody()),"#"+a).each(wn),e=null},y=function(){u.hide()};return ke.ceFalse&&!tb(t)&&function(){t.on("mouseup",(function(e){var n=f();n.collapsed&&my(t,e.clientX,e.clientY)&&Tw(t,n,!1).each(l)})),t.on("click",(function(e){var o=Hk(t,e.target);o&&(Lk(o)&&(e.preventDefault(),t.focus()),Ik(o)&&r.isChildOf(o,n.getNode())&&b())})),t.on("blur NewBlock",b),t.on("ResizeWindow FullscreenStateChanged",u.reposition);var c=function(t){var e=Ml(t);if(!t.firstChild)return!1;var n,r=zc.before(t.firstChild),o=e.next(r);return o&&!(xg(n=o)||Cg(n)||vg(n)||bg(n))},m=function(e,n){var i,u,a=r.getParent(e,o),s=r.getParent(n,o);return!(!a||e===s||!r.isChildOf(a,s)||!1!==Lk(Hk(t,a)))||a&&(i=a,u=s,!(r.getParent(i,o)===r.getParent(u,o)))&&c(a)};t.on("tap",(function(e){var n=e.target,r=Hk(t,n);Lk(r)?(e.preventDefault(),kw(t,r).each(v)):s(n)&&kw(t,n).each(v)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==my(t,e.clientX,e.clientY)){var u=Hk(t,o);if(u)Lk(u)?(e.preventDefault(),kw(t,u).each(v)):(b(),Ik(u)&&e.shiftKey||cd(e.clientX,e.clientY,n.getRng())||(y(),n.placeCaretAt(e.clientX,e.clientY)));else if(s(o))kw(t,o).each(v);else if(!1===qs(o)){b(),y();var a=Yx(i,e.clientX,e.clientY);if(a&&!m(o,a.node)){e.preventDefault();var c=d(1,a.node,a.before,!1);t.getBody().focus(),l(c)}}}})),t.on("keypress",(function(t){dd.modifierPressed(t)||Lk(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(t){t.range=h(t.range);var e=v(t.range,t.forward);e&&(t.range=e)})),t.on("AfterSetSelectionRange",(function(t){var e,n=t.range,o=n.startContainer.parentNode;g(n)||"mcepastebin"===o.id||y(),e=o,r.hasClass(e,"mce-offscreen-selection")||b()})),t.on("copy",(function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!ke.ie){var o=(e=r.get(a))?e.getElementsByTagName("*")[0]:e;o&&(t.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText))}})),Pk(t),function(t){var e=za((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=Ow(t,e,!1);t.selection.setRng(n)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))}(t),function(t){t.on("init",(function(){t.on("focusin",(function(e){var n=e.target;if(Jn(n)){var r=ad(t.getBody(),n),o=Xn(r)?r:n;t.selection.getNode()!==o&&kw(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:d,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(Ho(t),l(f()),n.scrollIntoView(t))},hideFakeCaret:y,destroy:function(){u.destroy(),e=null}}},Fk=function(t){var e,n,r=De.each,o=dd.BACKSPACE,i=dd.DELETE,u=t.dom,a=t.selection,c=t.parser,s=ke.gecko,l=ke.ie,f=ke.webkit,d="data:text/mce-internal,",m=l?"Text":"URL",g=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(r){}},h=function(t){return t.isDefaultPrevented()},p=function(){var e=function(t){var e=u.create("body"),n=t.cloneContents();return e.appendChild(n),a.serializer.serialize(e,{format:"html"})};t.on("keydown",(function(n){var r,a,c,s,l,f=n.keyCode;if(!h(n)&&(f===i||f===o)){if(r=t.selection.isCollapsed(),a=t.getBody(),r&&!u.isEmpty(a))return;if(!r&&(c=t.selection.getRng(),s=e(c),(l=u.createRng()).selectNode(t.getBody()),s!==e(l)))return;n.preventDefault(),t.setContent(""),a.firstChild&&u.isBlock(a.firstChild)?t.selection.setCursorLocation(a.firstChild,0):t.selection.setCursorLocation(a,0),t.nodeChanged()}}))},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},b=function(){t.inline||u.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=a.getRng(),t.getBody().focus(),"mousedown"===e.type){if(zo(n.startContainer))return;a.placeCaretAt(e.clientX,e.clientY)}else a.setRng(n)}))},y=function(){Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!h(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),co.setEditorTimeout(t,(function(){n.focus()}))}}))},w=function(){t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==u.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&u.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),a.select(n))}))},C=function(){t.on("keydown",(function(t){if(!h(t)&&t.keyCode===o&&a.isCollapsed()&&0===a.getRng().startOffset){var e=a.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},S=function(){(function(t){return t.getParam("readonly")})(t)||t.on("BeforeExecCommand mousedown",(function(){g("StyleWithCSS",!1),g("enableInlineTableEditing",!1),ws(t)||g("enableObjectResizing",!1)}))},k=function(){t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||r(u.select("a"),(function(t){var e=t.parentNode,n=u.getRoot();if(e.lastChild===t){for(;e&&!u.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}u.add(e,"br",{"data-mce-bogus":1})}}))}))},T=function(){t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},O=function(){t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()}))},_=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(ke.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))},E=function(){ke.mac&&t.on("keydown",(function(e){!dd.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}))},D=function(){t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},A=function(){t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))}))},M=function(){t.on("dragstart",(function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&a.select(e.target),(n=t.selection.getContent()).length>0&&(r=d+escape(t.id)+","+escape(n),e.dataTransfer.setData(m,r)))}(e)})),t.on("drop",(function(e){if(!h(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(m))&&e.indexOf(d)>=0?(e=e.substr(d.length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=pd(e.x,e.y,t.getDoc());a.setRng(r),o=n.html,i=!0,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):t.execCommand("mceInsertContent",!1,o)}}var o,i}))},z=x;return tb(t)?(f&&(b(),w(),A(),v(),ke.iOS&&(O(),_(),D())),s&&(y(),S(),T(),E())):(t.on("keydown",(function(e){var n,r;if(!h(e)&&e.keyCode===dd.BACKSPACE){var o=(n=a.getRng()).startContainer,i=n.startOffset,c=u.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==c;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=u.createRng()).setStart(o,0),n.setEnd(o,0),a.setRng(n))}}})),p(),ke.windowsPhone||t.on("keyup focusin mouseup",(function(t){dd.modifierPressed(t)||a.normalize()}),!0),f&&(b(),w(),us(t)&&t.on("init",(function(){g("DefaultParagraphSeparator",us(t))})),A(),C(),c.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),ke.iOS?(O(),_(),D()):v()),ke.ie>=11&&(_(),C()),ke.ie&&(v(),g("AutoUrlDetect",!1),M()),s&&(t.on("keydown",(function(e){if(!h(e)&&e.keyCode===o){if(!t.getBody().getElementsByTagName("hr").length)return;if(a.isCollapsed()&&0===a.getRng().startOffset){var n=a.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return u.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(u.remove(r),e.preventDefault())}}})),y(),e=function(){var e=u.getAttribs(a.getStart().cloneNode(!1));return function(){var n=a.getStart();n!==t.getBody()&&(u.setAttrib(n,"style",null),r(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},n=function(){return!a.isCollapsed()&&u.getParent(a.getStart(),u.isBlock)!==u.getParent(a.getEnd(),u.isBlock)},t.on("keypress",(function(r){var o;if(!h(r)&&(8===r.keyCode||46===r.keyCode)&&n())return o=e(),t.getDoc().execCommand("delete",!1,null),o(),r.preventDefault(),!1})),u.bind(t.getDoc(),"cut",(function(r){var o;!h(r)&&n()&&(o=e(),co.setEditorTimeout(t,(function(){o()})))})),S(),k(),T(),E(),C())),{refreshContentEditable:z,isHidden:function(){if(!s||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},jk=wa.DOM,Uk=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},Wk=function(t){return bt(t,(function(t){return!1===p(t)}))},qk=function(t){var e=t.settings,n=t.editorUpload.blobCache;return Wk({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:Uk(t),validate:!0,blob_cache:n,document:t.getDoc(),images_dataimg_filter:e.images_dataimg_filter})},$k=function(t){var e=t.dom.getRoot();t.inline||Yf(t)&&t.selection.getStart(!0)!==e||jl(e).each((function(e){var n=e.getNode(),r=Hn(n)?jl(n).getOr(e):e;ke.browser.isIE()?function(t,e){var n=Me.fromDom(t.getBody()),r=(lm(t)?L.from(e):L.none()).map(fm).filter(sm(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))},Gk=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),$k(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&co.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},Kk=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader},Xk=function(t){var e=Kk(t),n=ys(t),r=t.contentCSS,o=function(){e.unloadAll(r),t.inline||t.ui.styleSheetLoader.unloadAll(n)},i=function(){t.removed?o():t.on("remove",o)};if(t.contentStyles.length>0){var u="";De.each(t.contentStyles,(function(t){u+=t+"\r\n"})),t.dom.addStyle(u)}var a=oo.all(function(t,e,n){var r=[new oo((function(n,r){return Kk(t).loadAll(e,n,r)}))];return t.inline?r:r.concat([new oo((function(e,r){return t.ui.styleSheetLoader.loadAll(n,e,r)}))])}(t,r,n)).then(i).catch(i);return t.settings.content_style&&function(t,e){var n=Me.fromDom(t.getBody()),r=fn(ln(n)),o=Me.fromTag("style");nr(o,"type","text/css"),vn(o,Me.fromText(e)),vn(r,o),t.on("remove",(function(){wn(o)}))}(t,t.settings.content_style),a},Yk=function(t){var e=t.settings,n=t.getDoc(),r=t.getBody();!function(t){t.fire("PreInit")}(t),e.browser_spellcheck||e.gecko_spellcheck||(n.body.spellcheck=!1,jk.setAttrib(r,"spellcheck","false")),t.quirks=Fk(t),function(t){t.fire("PostRender")}(t);var o=function(t){return t.getParam("directionality",Da.isRtl()?"rtl":void 0)}(t);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",(function(t){De.each(e.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type}))},Jk=function(t){!0!==t.removed&&(function(t){tb(t)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"})}(t),Gk(t))},Qk=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(jk.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i=t.getBody();i.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===jk.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=Ny(t),t.schema=Ri(n),t.dom=wa(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:hs(t),referrerPolicy:ps(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=Db(qk(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){for(var r,o,i=e.length,u=t.dom,a="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(a)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=u.serializeStyle(u.parseStyle(o),r.name)).length||(o=null),r.attr(a,o),r.attr(n,o)):"tabindex"===n?(r.attr(a,o),r.attr(n,null)):r.attr(a,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Vm("br",1)).shortEnded=!0)}})),e}(t),t.serializer=Nb(function(t){var e=t.settings;return Mt(Mt({},qk(t)),Wk({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before,block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements}))}(t),t),t.selection=fb(t.dom,t.getWin(),t.serializer,t),t.annotator=id(t),t.formatter=Fy(t),t.undoManager=Uy(t),t._nodeChangeDispatcher=new Ck(t),t._selectionOverrides=Vk(t),RC(t),Sk(t),tb(t)||Tk(t);var u=function(t){return tb(t)?Ta(null):xk(t)}(t);MC(t,u),function(t){us(t)&&t.on("NodeChange",_(IC,t))}(t),Ky(t);var a=eb(t);Yk(t),a.fold((function(){Xk(t).then((function(){return Jk(t)}))}),(function(e){t.setProgressState(!0),Xk(t).then((function(){e().then((function(e){t.setProgressState(!1),Jk(t)}),(function(e){t.notificationManager.open({type:"error",text:String(e)}),Jk(t)}))}))}))},Zk=wa.DOM,tT=function(t){var e=function(t){return t.getParam("doctype","<!DOCTYPE html>")}(t)+"<html><head>";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='<base href="'+t.documentBaseURI.getURI()+'" />'),e+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=function(t){return os(t,"body_id","tinymce")}(t),r=function(t){return os(t,"body_class","")}(t);return is(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+is(t)+'" />'),e+='</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'"><br></body></html>'},eT=function(t,e){var n=t.translate(function(t){return t.getParam("iframe_aria_text","Rich Text Area. Press ALT-0 for help.","string")}(t)),r=function(t,e,n,r){var o=Me.fromTag("iframe");return rr(o,r),rr(o,{id:t+"_ifr",frameBorder:"0",allowTransparency:"true",title:e}),La(o,"tox-edit-area__iframe"),o}(t.id,n,e.height,function(t){return t.getParam("iframe_attrs",{})}(t)).dom;r.onload=function(){r.onload=null,t.fire("load")};var o=function(t,e){if(document.domain!==window.location.hostname&&ke.browser.isIE()){var n=Ay("mce");t[n]=function(){Qk(t)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return Zk.setAttrib(e,"src",r),!0}return!1}(t,r);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=r,t.iframeHTML=tT(t),Zk.add(e.iframeContainer,r),o},nT=wa.DOM,rT=function(t,e,n){var r=py.get(n),o=py.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=De.trim(n),r&&-1===De.inArray(e,n)){if(De.each(py.dependencies(n),(function(n){rT(t,e,n)})),t.plugins[n])return;try{var i=new r(t,o,t.$);t.plugins[n]=i,i.init&&(i.init(t,o),e.push(n))}catch(i_){!function(t,e,n){var r=Da.translate(["Failed to initialize plugin: {0}",e]);sd(t,"PluginLoadError",{message:r}),ky(r,n),wy(t,r)}(t,n,i_)}}},oT=function(t){return t.replace(/^\-/,"")},iT=function(t){return{editorContainer:t,iframeContainer:t,api:{}}},uT=function(t){var e=t.getElement();return t.inline?iT(null):function(t){var e=nT.create("div");return nT.insertAfter(e,t),iT(e)}(e)},aT=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,f(Cs(t))?function(t){return t.theme.renderUI()}(t):y(Cs(t))?function(t){var e=t.getElement(),n=Cs(t)(t,e);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:e.offsetHeight,n}(t):uT(t)},cT=function(t){t.fire("ScriptsLoaded"),function(t){var e=De.trim(ls(t)),n=t.ui.registry.getAll().icons,r=Mt(Mt({},uy.get("default").icons),uy.get(e).icons);mt(r,(function(e,r){xt(n,r)||t.ui.registry.addIcon(r,e)}))}(t),function(t){var e=Cs(t);if(f(e)){t.settings.theme=oT(e);var n=vy.get(e);t.theme=new n(t,vy.urls[e]),t.theme.init&&t.theme.init(t,vy.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}}(t),function(t){var e=[];De.each(Os(t).split(/[ ,]/),(function(n){rT(t,e,oT(n))}))}(t);var e=aT(t);!function(t,e){var n={show:L.from(e.show).getOr(x),hide:L.from(e.hide).getOr(x),disable:L.from(e.disable).getOr(x),isDisabled:L.from(e.isDisabled).getOr(R),enable:function(){t.mode.isReadOnly()||L.from(e.enable).map(z)}};t.ui=Mt(Mt({},t.ui),n)}(t,L.from(e.api).getOr({}));var n={editorContainer:e.editorContainer,iframeContainer:e.iframeContainer};return t.editorContainer=n.editorContainer?n.editorContainer:null,_y(t),t.inline?Qk(t):function(t,e){var n=eT(t,e);e.editorContainer&&(Zk.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=Zk.isHidden(e.editorContainer)),t.getElement().style.display="none",Zk.setAttrib(t.id,"aria-hidden","true"),n||Qk(t)}(t,n)},sT=wa.DOM,lT=function(t){return"-"===t.charAt(0)},fT=function(t,e){var n=vs(e),r=function(t){return t.getParam("language_url","","string")}(e);if(!1===Da.hasCode(n)&&"en"!==n){var o=""!==r?r:e.editorManager.baseURL+"/langs/"+n+".js";t.add(o,x,void 0,(function(){!function(t,e,n){xy(t,"LanguageLoadError",Cy("language",e,n))}(e,o,n)}))}},dT=function(t,e,n){return L.from(e).filter((function(t){return t.length>0&&!uy.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:L.some(e)}}))},mT=function(t,e,n){var r=dT(e,"default",n),o=function(t){return L.from(function(t){return t.getParam("icons_url","","string")}(t)).filter((function(t){return t.length>0})).map((function(t){return{url:t,name:L.none()}}))}(e).orThunk((function(){return dT(e,ls(e),"")}));G(function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e}([r,o]),(function(n){t.add(n.url,x,void 0,(function(){!function(t,e,n){xy(t,"IconsLoadError",Cy("icons",e,n))}(e,n.url,n.name.getOrUndefined())}))}))},gT=function(t,e){var n=ka.ScriptLoader;!function(t,e,n,r){var o=Cs(e);if(f(o)){if(!lT(o)&&!xt(vy.urls,o)){var i=function(t){return t.getParam("theme_url")}(e);i?vy.load(o,e.documentBaseURI.toAbsolute(i)):vy.load(o,"themes/"+o+"/theme"+n+".js")}t.loadQueue((function(){vy.waitFor(o,r)}))}else r()}(n,t,e,(function(){fT(n,t),mT(n,t,e),function(t,e){De.each(function(t){return t.getParam("external_plugins")}(t),(function(e,n){py.load(n,e,x,void 0,(function(){Sy(t,e,n)})),t.settings.plugins+=" "+n})),De.each(Os(t).split(/[ ,]/),(function(n){if((n=De.trim(n))&&!py.urls[n])if(lT(n)){n=n.substr(1,n.length);var r=py.dependencies(n);De.each(r,(function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"},o=py.createUrl(r,n);py.load(o.resource,o,x,void 0,(function(){Sy(t,o.prefix+o.resource+o.suffix,o.resource)}))}))}else{var o={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"};py.load(n,o,x,void 0,(function(){Sy(t,o.prefix+o.resource+o.suffix,n)}))}}))}(t,e),n.loadQueue((function(){t.removed||cT(t)}),t,(function(){t.removed||cT(t)}))}))},hT=function(t){var e=t.id;Da.setCode(vs(t));var n=function(){sT.unbind(window,"ready",n),t.render()};if(Wi.Event.domLoaded){if(t.getElement()&&ke.contentEditable){var r=Me.fromDom(t.getElement()),o=function(t){return Q(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})}(r);t.on("remove",(function(){K(r.dom.attributes,(function(t){return ur(r,t.name)})),rr(r,o)})),t.ui.styleSheetLoader=function(t,e){return lo.forElement(t,{contentCssCors:Ts(e),referrerPolicy:ps(e)})}(r,t),function(t){return t.getParam("inline")}(t)?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var i=t.getElement().form||sT.getParent(e,"form");i&&(t.formElement=i,function(t){return t.getParam("hidden_input")}(t)&&!Fn(t.getElement())&&(sT.insertAfter(sT.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},sT.bind(i,"submit reset",t.formEventDelegate),t.on("reset",(function(){t.resetContent()})),!function(t){return t.getParam("submit_patch")}(t)||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),i._mceOldSubmit(i)})),t.windowManager=by(t),t.notificationManager=hy(t),function(t){return"xml"===t.getParam("encoding")}(t)&&t.on("GetContent",(function(t){t.save&&(t.content=sT.encode(t.content))})),function(t){return t.getParam("add_form_submit_trigger")}(t)&&t.on("submit",(function(){t.initialized&&t.save()})),function(t){return t.getParam("add_unload_trigger")}(t)&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),gT(t,t.suffix)}}else sT.bind(window,"ready",n)},pT=function(t,e){return function(t,e){return rb(t).editor.addVisual(e)}(t,e)},vT={"font-size":"size","font-family":"face"},bT=function(t,e,n){return mp(Me.fromDom(n),(function(e){return function(e){return lr(e,t).orThunk((function(){return"font"===Ve(e)?wt(vT,t).bind((function(t){return ir(e,t)})):L.none()}))}(e)}),(function(t){return Be(Me.fromDom(e),t)}))},yT=function(t){return function(e,n){return L.from(n).map(Me.fromDom).filter(Ue).bind((function(n){return bT(t,e,n.dom).or(function(t,e){return L.from(wa.DOM.getStyle(e,t,!0))}(t,n.dom))})).getOr("")}},wT=yT("font-size"),xT=C((function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),yT("font-family")),CT=function(t){return jl(t.getBody()).map((function(t){var e=t.container();return jn(e)?e.parentNode:e}))},ST=function(t,e){return function(t){return L.from(t.selection.getRng()).bind((function(e){var n=t.getBody();return e.startContainer===n&&0===e.startOffset?L.none():L.from(t.selection.getStart(!0))}))}(t).orThunk(_(CT,t)).map(Me.fromDom).filter(Ue).bind(e)},kT=function(t,e){return ST(t,S(L.some,e))},TT=function(t,e){if(/^[0-9.]+$/.test(e)){var n=parseInt(e,10);if(n>=1&&n<=7){var r=function(t){return De.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(t),o=function(t){return De.explode(t.getParam("font_size_classes",""))}(t);return o?o[n-1]||e:r[n-1]||e}return e}return e},OT=function(t){var e=t.split(/\s*,\s*/);return $(e,(function(t){return-1===t.indexOf(" ")||Ht(t,'"')||Ht(t,"'")?t:"'"+t+"'"})).join(",")},_T=function(t,e){var n=function(t){if("string"!=typeof t){var e=De.extend({paste:t.paste,data:{paste:t.paste}},t);return{content:t.content,details:e}}return{content:t,details:{}}}(e);!function(t,e,n){nb(t).editor.insertContent(e,n)}(t,n.content,n.details)},ET=De.each,DT=De.map,AT=De.inArray,MT=function(){function t(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}return t.prototype.execCommand=function(t,e,n,r){var o,i=!1,u=this;if(!u.editor.removed){var a;if("mcefocus"!==t.toLowerCase()&&(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?(a=u.editor,hm(a).each((function(t){return a.selection.setRng(t)}))):u.editor.focus()),(r=u.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n})).isDefaultPrevented())return!1;var c=t.toLowerCase();if(o=u.commands.exec[c])return o(c,e,n),u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(ET(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),i=!0,!1})),i)return i;if(u.editor.theme&&u.editor.theme.execCommand&&u.editor.theme.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{i=u.editor.getDoc().execCommand(t,e,n)}catch(s){}return!!i&&(u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},t.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(n){}return!1}},t.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(n){}}},t.prototype.addCommands=function(t,e){void 0===e&&(e="exec");var n=this;ET(t,(function(t,r){ET(r.toLowerCase().split(","),(function(r){n.commands[e][r]=t}))}))},t.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,u){return e.call(n||r.editor,o,i,u)}},t.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(e){}return!1},t.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},t.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},t.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},t.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},t.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},t.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e),this.editor.nodeChanged()},t.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},t.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},t.prototype.setupCommands=function(t){var e=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":x,"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},mceFocus:function(e,n,r){Am(t,r)},"Cut,Copy,Paste":function(n){var r,o=t.getDoc();try{e.execNativeCommand(n)}catch(u){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");ke.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:i,type:"error"})}},unlink:function(){if(t.selection.isCollapsed()){var e=t.dom.getParent(t.selection.getStart(),"a");e&&t.dom.remove(e,!0)}else t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),ET("left,center,right,justify".split(","),(function(e){r!==e&&t.formatter.remove("align"+e)})),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,{value:r})},FontName:function(e,n,r){!function(t,e){var n=TT(t,e);t.formatter.toggle("fontname",{value:OT(n)}),t.nodeChanged()}(t,r)},FontSize:function(e,n,r){!function(t,e){t.formatter.toggle("fontsize",{value:TT(t,e)}),t.nodeChanged()}(t,r)},LineHeight:function(e,n,r){!function(t,e){t.formatter.toggle("lineheight",{value:String(e)}),t.nodeChanged()}(t,r)},Lang:function(t,n,r){e.toggleFormat(t,{value:r.code,customValue:r.customCode})},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),(function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1}),t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){_T(t,r)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})))},mceInsertNewLine:function(e,n,r){ik(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){EC(t,e)},mceRepaint:x,InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"==typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e=t.dom.getParent(t.selection.getStart(),Kn);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return $S(t,r),!0}});var n=function(e){return function(){var n=t.selection,r=n.isCollapsed()?[t.dom.getParent(n.getNode(),t.dom.isBlock)]:n.getSelectedBlocks(),o=DT(r,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==AT(o,!0)}};e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return TC(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",(function(){return function(t){return kT(t,(function(e){return xT(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("FontSize",(function(){return function(t){return kT(t,(function(e){return wT(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("LineHeight",(function(){return function(t){return kT(t,(function(e){var n=Me.fromDom(t.getBody());return mp(e,(function(t){return lr(t,"line-height")}),_(Be,n)).getOrThunk((function(){var t=parseFloat(cr(e,"line-height")),n=parseFloat(cr(e,"font-size"));return String(t/n)}))})).getOr("")}(t)}),this)},t}(),zT="data-mce-contenteditable",RT=function(t,e,n){var r,o;Va(t,e)&&!1===n?(o=e,Ba(r=t)?r.dom.classList.remove(o):Ia(r,o),Ha(r)):n&&La(t,e)},NT=function(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(r){}},BT=function(t,e){t.dom.contentEditable=e?"true":"false"},PT=function(t,e){var n=Me.fromDom(t.getBody());RT(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),function(t){L.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")}))}(t),t.readonly=!0,BT(n,!1),G(ja(n,'*[contenteditable="true"]'),(function(t){nr(t,zT,"true"),BT(t,!1)}))):(t.readonly=!1,BT(n,!0),function(t){G(ja(t,'*[data-mce-contenteditable="true"]'),(function(t){ur(t,zT),BT(t,!0)}))}(n),NT(t,"StyleWithCSS",!1),NT(t,"enableInlineTableEditing",!1),NT(t,"enableObjectResizing",!1),Em(t)&&t.focus(),function(t){t.selection.setRng(t.selection.getRng())}(t),t.nodeChanged())},IT=function(t){return t.readonly},LT=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){IT(t)&&G(e,(function(t){t.attr(zT,t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter(zT,(function(e){IT(t)&&G(e,(function(t){t.attr("contenteditable",t.attr(zT))}))})),t.serializer.addTempAttr(zT)},HT=function(t,e){if(function(t){return"click"===t.type}(e)&&!dd.metaKeyPressed(e)){var n=Me.fromDom(e.target);(function(t,e){return ro(e,"a",(function(e){return Be(e,Me.fromDom(t.getBody()))})).bind((function(t){return ir(t,"href")}))})(t,n).each((function(n){if(e.preventDefault(),/^#/.test(n)){var r=t.dom.select(n+',[name="'+(Ht(o=n,i="#")?function(t,e){return t.substring(e)}(o,i.length):o)+'"]');r.length&&t.selection.scrollIntoView(r[0],!0)}else window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes");var o,i}))}},VT=De.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),FT=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||R}return t.isNative=function(t){return!!VT[t.toLowerCase()]},t.prototype.fire=function(t,e){var n=t.toLowerCase(),r=Li(n,e||{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,u=o.length;i<u;i++){var a=o[i];if(!a.removed){if(a.once&&this.off(n,a.func),r.isImmediatePropagationStopped())return r;if(!1===a.func.call(this.scope,r))return r.preventDefault(),r}}return r},t.prototype.on=function(t,e,n,r){if(!1===e&&(e=R),e){var o={func:e,removed:!1};r&&De.extend(o,r);for(var i=t.toLowerCase().split(" "),u=i.length;u--;){var a=i[u],c=this.bindings[a];c||(c=[],this.toggleEvent(a,!0)),c=n?zt([o],c):zt(zt([],c),[o]),this.bindings[a]=c}}return this},t.prototype.off=function(t,e){var n=this;if(t)for(var r=t.toLowerCase().split(" "),o=r.length;o--;){var i=r[o],u=this.bindings[i];if(!i)return mt(this.bindings,(function(t,e){n.toggleEvent(e,!1),delete n.bindings[e]})),this;if(u){if(e){var a=X(u,(function(t){return t.func===e}));u=a.fail,this.bindings[i]=u,G(a.pass,(function(t){t.removed=!0}))}else u.length=0;u.length||(this.toggleEvent(t,!1),delete this.bindings[i])}}else mt(this.bindings,(function(t,e){n.toggleEvent(e,!1)})),this.bindings={};return this},t.prototype.once=function(t,e,n){return this.on(t,e,n,{once:!0})},t.prototype.has=function(t){return t=t.toLowerCase(),!(!this.bindings[t]||0===this.bindings[t].length)},t}(),jT=function(t){return t._eventDispatcher||(t._eventDispatcher=new FT({scope:t,toggleEvent:function(e,n){FT.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher},UT={fire:function(t,e,n){var r=this;if(r.removed&&"remove"!==t&&"detach"!==t)return e;var o=jT(r).fire(t,e);if(!1!==n&&r.parent)for(var i=r.parent();i&&!o.isPropagationStopped();)i.fire(t,o,!1),i=i.parent();return o},on:function(t,e,n){return jT(this).on(t,e,n)},off:function(t,e){return jT(this).off(t,e)},once:function(t,e){return jT(this).once(t,e)},hasEventListeners:function(t){return jT(this).has(t)}},WT=wa.DOM,qT=function(t,e){if("selectionchange"===e)return t.getDoc();if(!t.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(e))return t.getDoc().documentElement;var n=xs(t);return n?(t.eventRoot||(t.eventRoot=WT.select(n)[0]),t.eventRoot):t.getBody()},$T=function(t,e,n){!function(t){return!t.hidden&&!IT(t)}(t)?IT(t)&&HT(t,n):t.fire(e,n)},GT=function(t,e){var n;if(t.delegates||(t.delegates={}),!t.delegates[e]&&!t.removed){var r=qT(t,e);if(xs(t)){if(Bx||(Bx={},t.editorManager.on("removeEditor",(function(){t.editorManager.activeEditor||Bx&&(mt(Bx,(function(e,n){t.dom.unbind(qT(t,n))})),Bx=null)}))),Bx[e])return;n=function(n){for(var r=n.target,o=t.editorManager.get(),i=o.length;i--;){var u=o[i].getBody();(u===r||WT.isChildOf(r,u))&&$T(o[i],e,n)}},Bx[e]=n,WT.bind(r,e,n)}else n=function(n){$T(t,e,n)},WT.bind(r,e,n),t.delegates[e]=n}},KT=Mt(Mt({},UT),{bindPendingEventDelegates:function(){var t=this;De.each(t._pendingNativeEvents,(function(e){GT(t,e)}))},toggleNativeEvent:function(t,e){var n=this;"focus"!==t&&"blur"!==t&&(n.removed||(e?n.initialized?GT(n,t):n._pendingNativeEvents?n._pendingNativeEvents.push(t):n._pendingNativeEvents=[t]:n.initialized&&(n.dom.unbind(qT(n,t),t,n.delegates[t]),delete n.delegates[t])))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(mt(t.delegates,(function(e,n){t.dom.unbind(qT(t,n),n,e)})),delete t.delegates),!t.inline&&e&&n&&(e.onload=null,n.unbind(t.getWin()),n.unbind(t.getDoc())),n&&(n.unbind(e),n.unbind(t.getContainer()))}}),XT=["design","readonly"],YT=function(t,e,n,r){var o=n[e.get()],i=n[r];try{i.activate()}catch(i_){return void console.error("problem while activating editor mode "+r+":",i_)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&PT(t,i.editorReadOnly),e.set(r),function(t,e){t.fire("SwitchMode",{mode:e})}(t,r)},JT=function(t){var e=Ta("design"),n=Ta({design:{activate:x,deactivate:x,editorReadOnly:!1},readonly:{activate:x,deactivate:x,editorReadOnly:!0}});return function(t){t.serializer?LT(t):t.on("PreInit",(function(){LT(t)}))}(t),function(t){t.on("ShowCaret",(function(e){IT(t)&&e.preventDefault()})),t.on("ObjectSelected",(function(e){IT(t)&&e.preventDefault()}))}(t),{isReadOnly:function(){return IT(t)},set:function(r){return function(t,e,n,r){if(r!==n.get()){if(!xt(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?YT(t,n,e,r):t.on("init",(function(){return YT(t,n,e,r)}))}}(t,n.get(),e,r)},get:function(){return e.get()},register:function(t,e){n.set(function(t,e,n){var r;if(W(XT,e))throw new Error("Cannot override default mode "+e);return Mt(Mt({},t),((r={})[e]=Mt(Mt({},n),{deactivate:function(){try{n.deactivate()}catch(i_){console.error("problem while deactivating editor mode "+e+":",i_)}}}),r))}(n.get(),t,e))}}},QT=De.each,ZT=De.explode,tO={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},eO=De.makeMap("alt,ctrl,shift,meta,access"),nO=function(t){var e,n={};QT(ZT(t.toLowerCase(),"+"),(function(t){t in eO?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=tO[t]||t.toUpperCase().charCodeAt(0))}));var r=[n.keyCode];for(e in eO)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,ke.mac?n.ctrl=!0:n.shift=!0),n.meta&&(ke.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},rO=function(){function t(t){this.shortcuts={},this.pendingPatterns=[],this.editor=t;var e=this;t.on("keyup keypress keydown",(function(t){!e.hasModifier(t)&&!e.isFunctionKey(t)||t.isDefaultPrevented()||(QT(e.shortcuts,(function(n){if(e.matchShortcut(t,n))return e.pendingPatterns=n.subpatterns.slice(0),"keydown"===t.type&&e.executeShortcutAction(n),!0})),e.matchShortcut(t,e.pendingPatterns[0])&&(1===e.pendingPatterns.length&&"keydown"===t.type&&e.executeShortcutAction(e.pendingPatterns[0]),e.pendingPatterns.shift()))}))}return t.prototype.add=function(t,e,n,r){var o=this,i=o.normalizeCommandFunc(n);return QT(ZT(De.trim(t)),(function(t){var n=o.createShortcut(t,e,i,r);o.shortcuts[n.id]=n})),!0},t.prototype.remove=function(t){var e=this.createShortcut(t);return!!this.shortcuts[e.id]&&(delete this.shortcuts[e.id],!0)},t.prototype.normalizeCommandFunc=function(t){var e=this,n=t;return"string"==typeof n?function(){e.editor.execCommand(n,!1,null)}:De.isArray(n)?function(){e.editor.execCommand(n[0],n[1],n[2])}:n},t.prototype.createShortcut=function(t,e,n,r){var o=De.map(ZT(t,">"),nO);return o[o.length-1]=De.extend(o[o.length-1],{func:n,scope:r||this.editor}),De.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},t.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},t.prototype.isFunctionKey=function(t){return"keydown"===t.type&&t.keyCode>=112&&t.keyCode<=123},t.prototype.matchShortcut=function(t,e){return!!e&&e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&e.alt===t.altKey&&e.shift===t.shiftKey&&!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0)},t.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},t}(),oO=function(){var t,e,n,r,o,i,u,a,c=(e={},n={},r={},o={},i={},u={},{addButton:(a=function(t,e){return function(n,r){return t[n.toLowerCase()]=Mt(Mt({},r),{type:e})}})(t={},"button"),addGroupToolbarButton:a(t,"grouptoolbarbutton"),addToggleButton:a(t,"togglebutton"),addMenuButton:a(t,"menubutton"),addSplitButton:a(t,"splitbutton"),addMenuItem:a(e,"menuitem"),addNestedMenuItem:a(e,"nestedmenuitem"),addToggleMenuItem:a(e,"togglemenuitem"),addAutocompleter:a(n,"autocompleter"),addContextMenu:a(o,"contextmenu"),addContextToolbar:a(i,"contexttoolbar"),addContextForm:a(i,"contextform"),addSidebar:a(u,"sidebar"),addIcon:function(t,e){return r[t.toLowerCase()]=e},getAll:function(){return{buttons:t,menuItems:e,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:u}}});return{addAutocompleter:c.addAutocompleter,addButton:c.addButton,addContextForm:c.addContextForm,addContextMenu:c.addContextMenu,addContextToolbar:c.addContextToolbar,addIcon:c.addIcon,addMenuButton:c.addMenuButton,addMenuItem:c.addMenuItem,addNestedMenuItem:c.addNestedMenuItem,addSidebar:c.addSidebar,addSplitButton:c.addSplitButton,addToggleButton:c.addToggleButton,addGroupToolbarButton:c.addGroupToolbarButton,addToggleMenuItem:c.addToggleMenuItem,getAll:c.getAll}},iO=De.each,uO=De.trim,aO="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),cO={ftp:21,http:80,https:443,mailto:25},sO=function(){function t(e,n){e=uO(e),this.settings=n||{};var r=this.settings.base_uri,o=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))o.source=e;else{var i=0===e.indexOf("//");if(0!==e.indexOf("/")||i||(e=(r&&r.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){var u=this.settings.base_uri?this.settings.base_uri.path:new t(document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)e="//mce_host"+o.toAbsPath(u,e);else{var a=/([^#?]*)([#?]?.*)/.exec(e);e=(r&&r.protocol||"http")+"://mce_host"+o.toAbsPath(u,a[1])+a[2]}}e=e.replace(/@@/g,"(mce_at)");var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);iO(aO,(function(t,e){var n=c[e];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[t]=n})),r&&(o.protocol||(o.protocol=r.protocol),o.userInfo||(o.userInfo=r.userInfo),o.port||"mce_host"!==o.host||(o.port=r.port),o.host&&"mce_host"!==o.host||(o.host=r.host),o.source=""),i&&(o.protocol="")}}return t.parseDataUri=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},t.getDocumentBaseUrl=function(t){var e;return e=0!==t.protocol.indexOf("http")&&"file:"!==t.protocol?t.href:t.protocol+"//"+t.host+t.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/")),e},t.prototype.setPath=function(t){var e=/^(.*?)\/?(\w+)?$/.exec(t);this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},t.prototype.toRelative=function(e){var n;if("./"===e)return e;var r=new t(e,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},t.prototype.toAbsolute=function(e,n){var r=new t(e,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},t.prototype.isSameOrigin=function(t){if(this.host==t.host&&this.protocol==t.protocol){if(this.port==t.port)return!0;var e=cO[this.protocol];if(e&&(this.port||e)==(t.port||e))return!0}return!1},t.prototype.toRelPath=function(t,e){var n,r,o=0,i="",u=t.substring(0,t.lastIndexOf("/")).split("/"),a=e.split("/");if(u.length>=a.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||u[n]!==a[n]){o=n+1;break}if(u.length<a.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||u[n]!==a[n]){o=n+1;break}if(1===o)return e;for(n=0,r=u.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=a.length;n<r;n++)i+=n!==o-1?"/"+a[n]:a[n];return i},t.prototype.toAbsPath=function(t,e){var n,r,o=0,i=[],u=/\/$/.test(e)?"/":"",a=t.split("/"),c=e.split("/");for(iO(a,(function(t){t&&i.push(t)})),a=i,n=c.length-1,i=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?o>0?o--:i.push(c[n]):o++);return 0!==(r=(n=a.length-o)<=0?ot(i).join("/"):a.slice(0,n).join("/")+"/"+ot(i).join("/")).indexOf("/")&&(r="/"+r),u&&r.lastIndexOf("/")!==r.length-1&&(r+=u),r},t.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},t}(),lO=wa.DOM,fO=De.extend,dO=De.each,mO=De.resolve,gO=ke.ie,hO=function(){function t(t,e,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,fO(this,KT),this.settings=ry(this,t,this.documentBaseUrl,n.defaultSettings,e),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(ka.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),wa.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),Aa.languageLoad=this.settings.language_load,Aa.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new sO(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new rO(this),this.editorCommands=new MT(this),this.settings.cache_suffix&&(ke.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:oO(),styleSheetLoader:void 0,show:x,hide:x,enable:x,disable:x,isDisabled:R};var o=JT(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=ma.overrideDefaults((function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}))}return t.prototype.render=function(){hT(this)},t.prototype.focus=function(t){this.execCommand("mceFocus",!1,t)},t.prototype.hasFocus=function(){return _m(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o=this,i=o.settings[t];if(i)return o.callbackLookup&&(r=o.callbackLookup[t])&&(i=r.func,r=r.scope),"string"==typeof i&&(r=(r=i.replace(/\.\w+$/,""))?mO(r):0,i=mO(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[t]={func:i,scope:r}),i.apply(r||o,e)},t.prototype.translate=function(t){return Da.translate(t)},t.prototype.getParam=function(t,e,n){return iy(this,t,e,n)},t.prototype.hasPlugin=function(t,e){return!(!W(Os(this).split(/[ ,]/),t)||e&&void 0===py.get(t))},t.prototype.nodeChanged=function(t){this._nodeChangeDispatcher.nodeChanged(t)},t.prototype.addCommand=function(t,e,n){this.editorCommands.addCommand(t,e,n)},t.prototype.addQueryStateHandler=function(t,e,n){this.editorCommands.addQueryStateHandler(t,e,n)},t.prototype.addQueryValueHandler=function(t,e,n){this.editorCommands.addQueryValueHandler(t,e,n)},t.prototype.addShortcut=function(t,e,n,r){this.shortcuts.add(t,e,n,r)},t.prototype.execCommand=function(t,e,n,r){return this.editorCommands.execCommand(t,e,n,r)},t.prototype.queryCommandState=function(t){return this.editorCommands.queryCommandState(t)},t.prototype.queryCommandValue=function(t){return this.editorCommands.queryCommandValue(t)},t.prototype.queryCommandSupported=function(t){return this.editorCommands.queryCommandSupported(t)},t.prototype.show=function(){var t=this;t.hidden&&(t.hidden=!1,t.inline?t.getBody().contentEditable="true":(lO.show(t.getContainer()),lO.hide(t.id)),t.load(),t.fire("show"))},t.prototype.hide=function(){var t=this,e=t.getDoc();t.hidden||(gO&&e&&!t.inline&&e.execCommand("SelectAll"),t.save(),t.inline?(t.getBody().contentEditable="false",t===t.editorManager.focusedEditor&&(t.editorManager.focusedEditor=null)):(lO.hide(t.getContainer()),lO.setStyle(t.id,"display",t.orgDisplay)),t.hidden=!0,t.fire("hide"))},t.prototype.isHidden=function(){return!!this.hidden},t.prototype.setProgressState=function(t,e){this.fire("ProgressState",{state:t,time:e})},t.prototype.load=function(t){var e,n=this,r=n.getElement();if(n.removed)return"";if(r){(t=t||{}).load=!0;var o=Fn(r)?r.value:r.innerHTML;return e=n.setContent(o,t),t.element=r,t.no_events||n.fire("LoadContent",t),t.element=r=null,e}},t.prototype.save=function(t){var e,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(t=t||{}).save=!0,t.element=o,t.content=r.getContent(t),t.no_events||r.fire("SaveContent",t),"raw"===t.format&&r.fire("RawSaveContent",t),e=t.content,Fn(o)?o.value=e:(!t.is_removing&&r.inline||(o.innerHTML=e),(n=lO.getParent(r.id,"form"))&&dO(n.elements,(function(t){if(t.name===r.id)return t.value=e,!1}))),t.element=o=null,!1!==t.set_dirty&&r.setDirty(!1),e},t.prototype.setContent=function(t,e){return Pb(this,t,e)},t.prototype.getContent=function(t){return Bb(this,t)},t.prototype.insertContent=function(t,e){e&&(t=fO({content:t},e)),this.execCommand("mceInsertContent",!1,t)},t.prototype.resetContent=function(t){void 0===t?Pb(this,this.startContent,{format:"raw"}):Pb(this,t),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},t.prototype.isDirty=function(){return!this.isNotDirty},t.prototype.setDirty=function(t){var e=!this.isNotDirty;this.isNotDirty=!t,t&&t!==e&&this.fire("dirty")},t.prototype.getContainer=function(){var t=this;return t.container||(t.container=lO.get(t.editorContainer||t.id+"_parent")),t.container},t.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},t.prototype.getElement=function(){return this.targetElm||(this.targetElm=lO.get(this.id)),this.targetElm},t.prototype.getWin=function(){var t,e=this;return e.contentWindow||(t=e.iframeElement)&&(e.contentWindow=t.contentWindow),e.contentWindow},t.prototype.getDoc=function(){var t,e=this;return e.contentDocument||(t=e.getWin())&&(e.contentDocument=t.document),e.contentDocument},t.prototype.getBody=function(){var t=this.getDoc();return this.bodyElement||(t?t.body:null)},t.prototype.convertURL=function(t,e,n){var r=this,o=r.settings;return o.urlconverter_callback?r.execCallback("urlconverter_callback",t,n,!0,e):!o.convert_urls||n&&"LINK"===n.nodeName||0===t.indexOf("file:")||0===t.length?t:o.relative_urls?r.documentBaseURI.toRelative(t):t=r.documentBaseURI.toAbsolute(t,o.remove_script_host)},t.prototype.addVisual=function(t){pT(this,t)},t.prototype.remove=function(){Hb(this)},t.prototype.destroy=function(t){Vb(this,t)},t.prototype.uploadImages=function(t){return this.editorUpload.uploadImages(t)},t.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},t.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},t.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},t.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},t.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},t}(),pO=wa.DOM,vO=De.explode,bO=De.each,yO=De.extend,wO=0,xO=!1,CO=[],SO=[],kO=function(t){var e=t.type;bO(EO.get(),(function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t)}}))},TO=function(t){t!==xO&&(t?ma(window).on("resize scroll",kO):ma(window).off("resize scroll",kO),xO=t)},OO=function(t){var e=SO;delete CO[t.id];for(var n=0;n<CO.length;n++)if(CO[n]===t){CO.splice(n,1);break}return SO=Y(SO,(function(e){return t!==e})),EO.activeEditor===t&&(EO.activeEditor=SO.length>0?SO[0]:null),EO.focusedEditor===t&&(EO.focusedEditor=null),e.length!==SO.length},_O="CSS1Compat"!==document.compatMode,EO=Mt(Mt({},UT),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:ma,majorVersion:"5",minorVersion:"9.2",releaseDate:"2021-09-08",editors:CO,i18n:Da,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e,n=this,r="";e=sO.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/"));var o,i=window.tinymce||window.tinyMCEPreInit;if(i)t=i.base||i.baseURL,r=i.suffix;else{for(var u=document.getElementsByTagName("script"),a=0;a<u.length;a++){var c;if(""!==(c=u[a].src||"")){var s=c.substring(c.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(c)){-1!==s.indexOf(".min")&&(r=".min"),t=c.substring(0,c.lastIndexOf("/"));break}}}!t&&document.currentScript&&(-1!==(c=document.currentScript.src).indexOf(".min")&&(r=".min"),t=c.substring(0,c.lastIndexOf("/")))}n.baseURL=new sO(e).toAbsolute(t),n.documentBaseURL=e,n.baseURI=new sO(n.baseURL),n.suffix=r,(o=n).on("AddEditor",_(xm,o)),o.on("RemoveEditor",_(Cm,o))},overrideDefaults:function(t){var e=t.base_url;e&&this._setBaseUrl(e);var n=t.suffix;t.suffix&&(this.suffix=n),this.defaultSettings=t;var r=t.plugin_base_urls;void 0!==r&&mt(r,(function(t,e){Aa.PluginManager.urls[e]=t}))},init:function(t){var e,n=this,r=De.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),o=function(t){var e=t.id;return e||(e=wt(t,"name").filter((function(t){return!pO.get(t)})).getOrThunk(pO.uniqueId),t.setAttribute("id",e)),e},i=function(t,e){return e.constructor===RegExp?e.test(t.className):pO.hasClass(t,e)},u=function(t){e=t},a=function(){var e,c=0,s=[],l=function(t,r,o){var i=new hO(t,r,n);s.push(i),i.on("init",(function(){++c===e.length&&u(s)})),i.targetElm=i.targetElm||o,i.render()};pO.unbind(window,"ready",a),function(e){var r=t[e];r&&r.apply(n,[])}("onpageload"),e=ma.unique(function(t){var e=[];if(ke.browser.isIE()&&ke.browser.version.major<11)return ky("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(_O)return ky("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return bO(t.types,(function(t){e=e.concat(pO.select(t.selector))})),e;if(t.selector)return pO.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var n=t.elements||"";n.length>0&&bO(vO(n),(function(t){var n=pO.get(t);n?e.push(n):bO(document.forms,(function(n){bO(n.elements,(function(n){n.name===t&&(t="mce_editor_"+wO++,pO.setAttrib(n,"id",t),e.push(n))}))}))}));break;case"textareas":case"specific_textareas":bO(pO.select("textarea"),(function(n){t.editor_deselector&&i(n,t.editor_deselector)||t.editor_selector&&!i(n,t.editor_selector)||e.push(n)}))}return e}(t)),t.types?bO(t.types,(function(n){De.each(e,(function(e){return!pO.is(e,n.selector)||(l(o(e),yO({},t,n),e),!1)}))})):(De.each(e,(function(t){var e;(e=n.get(t.id))&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(OO(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null)})),0===(e=De.grep(e,(function(t){return!n.get(t.id)}))).length?u([]):bO(e,(function(e){!function(t,e){return t.inline&&e.tagName.toLowerCase()in r}(t,e)?l(o(e),t,e):ky("Could not initialize inline editor on invalid inline target element",e)})))};return n.settings=t,pO.bind(window,"ready",a),new oo((function(t){e?t(e):u=function(e){t(e)}}))},get:function(t){return 0===arguments.length?SO.slice(0):f(t)?tt(SO,(function(e){return e.id===t})).getOr(null):w(t)&&SO[t]?SO[t]:null},add:function(t){var e=this;return CO[t.id]===t||(null===e.get(t.id)&&(function(t){return"length"!==t}(t.id)&&(CO[t.id]=t),CO.push(t),SO.push(t)),TO(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),Px||(Px=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",Px))),t},createEditor:function(t,e){return this.add(new hO(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!f(t))return n=t,g(r.get(n.id))?null:(OO(n)&&r.fire("RemoveEditor",{editor:n}),0===SO.length&&window.removeEventListener("beforeunload",Px),n.remove(),TO(SO.length>0),n);bO(pO.select(t),(function(t){(n=r.get(t.id))&&r.remove(n)}))}else for(e=SO.length-1;e>=0;e--)r.remove(SO[e])},execCommand:function(t,e,n){var r=this,o=r.get(n);switch(t){case"mceAddEditor":return r.get(n)||new hO(n,r.settings,r).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(r.execCommand("mceAddEditor",!1,n),!0)}return!!r.activeEditor&&r.activeEditor.execCommand(t,e,n)},triggerSave:function(){bO(SO,(function(t){t.save()}))},addI18n:function(t,e){Da.add(t,e)},translate:function(t){return Da.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new sO(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new sO(this.baseURL)}});EO.setup();var DO,AO,MO,zO,RO=Math.min,NO=Math.max,BO=Math.round,PO=function(t,e,n){var r=e.x,o=e.y,i=t.w,u=t.h,a=e.w,c=e.h,s=(n||"").split("");return"b"===s[0]&&(o+=c),"r"===s[1]&&(r+=a),"c"===s[0]&&(o+=BO(c/2)),"c"===s[1]&&(r+=BO(a/2)),"b"===s[3]&&(o-=u),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=BO(u/2)),"c"===s[4]&&(r-=BO(i/2)),IO(r,o,i,u)},IO=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},LO={inflate:function(t,e,n){return IO(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},relativePosition:PO,findBestRelativePosition:function(t,e,n,r){var o,i;for(i=0;i<r.length;i++)if((o=PO(t,e,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(t,e){var n=NO(t.x,e.x),r=NO(t.y,e.y),o=RO(t.x+t.w,e.x+e.w),i=RO(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:IO(n,r,o-n,i-r)},clamp:function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,u=t.y+t.h,a=e.x+e.w,c=e.y+e.h,s=NO(0,e.x-r),l=NO(0,e.y-o),f=NO(0,i-a),d=NO(0,u-c);return r+=s,o+=l,n&&(i+=s,u+=l,r-=f,o-=d),IO(r,o,(i-=f)-r,(u-=d)-o)},create:IO,fromClientRect:function(t){return IO(t.left,t.top,t.width,t.height)}},HO=(DO={},AO={},{load:function(t,e){var n='Script at URL "'+e+'" failed to load',r='Script at URL "'+e+"\" did not call `tinymce.Resource.add('"+t+"', data)` within 1 second";if(void 0!==DO[t])return DO[t];var o=new oo((function(o,i){var u=function(t,e,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(r=!0,null!==o&&(clearTimeout(o),o=null),t.apply(null,e))}},u=i(t),a=i(e);return{start:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r||null!==o||(o=setTimeout((function(){return a.apply(null,t)}),n))},resolve:u,reject:a}}(o,i);AO[t]=u.resolve,ka.ScriptLoader.loadScript(e,(function(){return u.start(r)}),(function(){return u.reject(n)}))}));return DO[t]=o,o},add:function(t,e){void 0!==AO[t]&&(AO[t](e),delete AO[t]),DO[t]=oo.resolve(e)}}),VO=De.each,FO=De.extend,jO=function(){};jO.extend=MO=function(t){var e=this.prototype,n=function(){var t,e,n,r=this;if(!zO&&(r.init&&r.init.apply(r,arguments),e=r.Mixins))for(t=e.length;t--;)(n=e[t]).init&&n.init.apply(r,arguments)},r=function(){return this};zO=!0;var o=new this;return zO=!1,t.Mixins&&(VO(t.Mixins,(function(e){for(var n in e)"init"!==n&&(t[n]=e[n])})),e.Mixins&&(t.Mixins=e.Mixins.concat(t.Mixins))),t.Methods&&VO(t.Methods.split(","),(function(e){t[e]=r})),t.Properties&&VO(t.Properties.split(","),(function(e){var n="_"+e;t[e]=function(t){var e=this;return void 0!==t?(e[n]=t,e):e[n]}})),t.Statics&&VO(t.Statics,(function(t,e){n[e]=t})),t.Defaults&&e.Defaults&&(t.Defaults=FO({},e.Defaults,t.Defaults)),mt(t,(function(t,n){"function"==typeof t&&e[n]?o[n]=function(t,n){return function(){var r=this,o=r._super;r._super=e[t];var i=n.apply(r,arguments);return r._super=o,i}}(n,t):o[n]=t})),n.prototype=o,n.constructor=n,n.extend=MO,n};var UO,WO,qO,$O,GO=Math.min,KO=Math.max,XO=Math.round,YO={serialize:function(t){var e=JSON.stringify(t);return f(e)?e.replace(/[\u0080-\uFFFF]/g,(function(t){var e=t.charCodeAt(0).toString(16);return"\\u"+"0000".substring(e.length)+e})):e},parse:function(t){try{return JSON.parse(t)}catch(e){}}},JO={callbacks:{},count:0,send:function(t){var e=this,n=wa.DOM,r=void 0!==t.count?t.count:e.count,o="tinymce_jsonp_"+r;e.callbacks[r]=function(i){n.remove(o),delete e.callbacks[r],t.callback(i)},n.add(n.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),e.count++}},QO=Mt(Mt({},UT),{send:function(t){var e,n=0,r=function(){!t.async||4===e.readyState||n++>1e4?(t.success&&n<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,n>1e4?"TIMED_OUT":"GENERAL",e,t),e=null):co.setTimeout(r,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",QO.fire("beforeInitialize",{settings:t}),(e=new XMLHttpRequest).overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&De.each(t.requestheaders,(function(t){e.setRequestHeader(t.key,t.value)})),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),(e=QO.fire("beforeSend",{xhr:e,settings:t}).xhr).send(t.data),!t.async)return r();co.setTimeout(r,10)}}),ZO=De.extend,t_=function(){function t(t){this.settings=ZO({},t),this.count=0}return t.sendRPC=function(e){return(new t).send(e)},t.prototype.send=function(t){var e=t.error,n=t.success,r=ZO(this.settings,t);r.success=function(t,o){void 0===(t=YO.parse(t))&&(t={error:"JSON Parse error."}),t.error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=YO.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",QO.send(r)},t}();try{var e_="__storage_test__";(UO=window.localStorage).setItem(e_,e_),UO.removeItem(e_)}catch(i_){WO={},qO=[],$O={getItem:function(t){return WO[t]||null},setItem:function(t,e){qO.push(t),WO[t]=String(e)},key:function(t){return qO[t]},removeItem:function(t){qO=qO.filter((function(e){return e===t})),delete WO[t]},clear:function(){qO=[],WO={}},length:0},Object.defineProperty($O,"length",{get:function(){return qO.length},configurable:!1,enumerable:!1}),UO=$O}var n_,r_={geom:{Rect:LO},util:{Promise:oo,Delay:co,Tools:De,VK:dd,URI:sO,Class:jO,EventDispatcher:FT,Observable:UT,I18n:Da,XHR:QO,JSON:YO,JSONRequest:t_,JSONP:JO,LocalStorage:UO,Color:function(t){var e={},n=0,r=0,o=0,i=function(t){var i;return"object"==typeof t?"r"in t?(n=t.r,r=t.g,o=t.b):"v"in t&&function(t,e,i){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,i=parseInt(i,10)/100,e=KO(0,GO(e,1)),i=KO(0,GO(i,1)),0!==e){var u=t/60,a=i*e,c=a*(1-Math.abs(u%2-1)),s=i-a;switch(Math.floor(u)){case 0:n=a,r=c,o=0;break;case 1:n=c,r=a,o=0;break;case 2:n=0,r=a,o=c;break;case 3:n=0,r=c,o=a;break;case 4:n=c,r=0,o=a;break;case 5:n=a,r=0,o=c;break;default:n=r=o=0}n=XO(255*(n+s)),r=XO(255*(r+s)),o=XO(255*(o+s))}else n=r=o=XO(255*i)}(t.h,t.s,t.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,e};return t&&i(t),e.toRgb=function(){return{r:n,g:r,b:o}},e.toHsv=function(){return function(t,e,n){var r,o;o=0;var i=GO(t/=255,GO(e/=255,n/=255)),u=KO(t,KO(e,n));return i===u?{h:0,s:0,v:100*(o=i)}:(r=(u-i)/u,o=u,{h:XO(60*((t===i?3:n===i?1:5)-(t===i?e-n:n===i?t-e:n-t)/(u-i))),s:XO(100*r),v:XO(100*o)})}(n,r,o)},e.toHex=function(){var t=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+t(n)+t(r)+t(o)},e.parse=i,e},ImageUploader:function(t){var e=Ey(),n=Ry(t,e);return{upload:function(e,r){return void 0===r&&(r=!0),n.upload(e,r?zy(t):void 0)}}}},dom:{EventUtils:Wi,Sizzle:_u,DomQuery:ma,TreeWalker:fo,TextSeeker:rc,DOMUtils:wa,ScriptLoader:ka,RangeUtils:Dd,Serializer:Nb,StyleSheetLoader:so,ControlSelection:gd,BookmarkManager:ud,Selection:fb,Event:Wi.Event},html:{Styles:Bi,Entities:Si,Node:Vm,Schema:Ri,SaxParser:Km,DomParser:Db,Writer:eg,Serializer:ng},Env:ke,AddOnManager:Aa,Annotator:id,Formatter:Fy,UndoManager:Uy,EditorCommands:MT,WindowManager:by,NotificationManager:hy,EditorObservable:KT,Shortcuts:rO,Editor:hO,FocusManager:pm,EditorManager:EO,DOM:wa.DOM,ScriptLoader:ka.ScriptLoader,PluginManager:py,ThemeManager:vy,IconManager:uy,Resource:HO,trim:De.trim,isArray:De.isArray,is:De.is,toArray:De.toArray,makeMap:De.makeMap,each:De.each,map:De.map,grep:De.grep,inArray:De.inArray,extend:De.extend,create:De.create,walk:De.walk,createNS:De.createNS,resolve:De.resolve,explode:De.explode,_addCacheSuffix:De._addCacheSuffix,isOpera:ke.opera,isWebKit:ke.webkit,isIE:ke.ie,isGecko:ke.gecko,isMac:ke.mac},o_=De.extend(EO,r_);n_=o_,window.tinymce=n_,window.tinyMCE=n_,function(t){try{F.exports=t}catch(e){}}(o_)}(),function(){var t=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},e=function(t){return function(e){return typeof e===t}},n=function(t){return function(e){return t===e}},r=t("string"),o=t("object"),i=t("array"),u=n(null),a=e("boolean"),c=n(void 0),l=function(t){return null==t},f=function(t){return!l(t)},d=e("function"),m=e("number"),g=function(t,e){if(i(t)){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}return!1},h=function(){},p=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},v=function(t){return function(){return t}},b=function(t){return t},y=function(t,e){return t===e};function w(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var x=function(t){return function(e){return!t(e)}},C=function(t){return function(){throw new Error(t)}},S=v(!1),k=v(!0),T=tinymce.util.Tools.resolve("tinymce.ThemeManager"),O=function(){return(O=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function _(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function E(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var D,A,M,z,R=function(){return N},N={fold:function(t,e){return t()},isSome:S,isNone:k,getOr:A=b,getOrThunk:D=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:v(null),getOrUndefined:v(void 0),or:A,orThunk:D,map:R,each:h,bind:R,exists:S,forall:k,filter:function(){return R()},toArray:function(){return[]},toString:v("none()")},B=function(t){var e=v(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:k,isNone:S,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return B(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:N},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},P={some:B,none:R,from:function(t){return null==t?N:B(t)}},I=Array.prototype.slice,L=Array.prototype.indexOf,H=Array.prototype.push,V=function(t,e){return L.call(t,e)},F=function(t,e){return V(t,e)>-1},j=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},U=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},W=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=I.call(t,r,r+e);n.push(o)}return n},q=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},$=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},G=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}},K=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},X=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)}(t,(function(t,r){n=e(n,t,r)})),n},Y=function(t,e,n){return $(t,(function(t,r){n=e(n,t,r)})),n},J=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return P.some(i);if(n(i,r))break}return P.none()}(t,e,S)},Q=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return P.some(n)}return P.none()},Z=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!i(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);H.apply(e,t[n])}return e},tt=function(t,e){return Z(q(t,e))},et=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},nt=function(t){var e=I.call(t,0);return e.reverse(),e},rt=function(t,e){return K(t,(function(t){return!F(e,t)}))},ot=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},it=function(t){return[t]},ut=function(t,e){var n=I.call(t,0);return n.sort(e),n},at=function(t,e){return e>=0&&e<t.length?P.some(t[e]):P.none()},ct=function(t){return at(t,0)},st=function(t){return at(t,t.length-1)},lt=d(Array.from)?Array.from:function(t){return I.call(t)},ft=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return P.none()},dt=function(t){return{isValue:k,isError:S,getOr:v(t),getOrThunk:v(t),getOrDie:v(t),or:function(e){return dt(t)},orThunk:function(e){return dt(t)},fold:function(e,n){return n(t)},map:function(e){return dt(e(t))},mapError:function(e){return dt(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return P.some(t)}}},mt=function(t){return{isValue:S,isError:k,getOr:b,getOrThunk:function(t){return t()},getOrDie:function(){return C(String(t))()},or:b,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return mt(t)},mapError:function(e){return mt(e(t))},each:h,bind:function(e){return mt(t)},exists:S,forall:k,toOptional:P.none}},gt={value:dt,error:mt,fromOption:function(t,e){return t.fold((function(){return mt(e)}),dt)}};(z=M||(M={}))[z.Error=0]="Error",z[z.Value=1]="Value";var ht,pt=function(t,e,n){return t.stype===M.Error?e(t.serror):n(t.svalue)},vt=function(t){return{stype:M.Value,svalue:t}},bt=function(t){return{stype:M.Error,serror:t}},yt=function(t){return t.fold(bt,vt)},wt=function(t){return pt(t,gt.error,gt.value)},xt=vt,Ct=function(t){var e=[],n=[];return $(t,(function(t){pt(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},St=bt,kt=function(t,e){return t.stype===M.Value?e(t.svalue):t},Tt=function(t,e){return t.stype===M.Error?e(t.serror):t},Ot=function(t,e){return t.stype===M.Value?{stype:M.Value,svalue:e(t.svalue)}:t},_t=function(t,e){return t.stype===M.Error?{stype:M.Error,serror:e(t.serror)}:t},Et=pt,Dt=function(t,e,n,r){return{tag:"field",key:t,newKey:e,presence:n,prop:r}},At=function(t,e,n){switch(t.tag){case"field":return e(t.key,t.newKey,t.presence,t.prop);case"custom":return n(t.newKey,t.instantiator)}},Mt=Object.keys,zt=Object.hasOwnProperty,Rt=function(t,e){for(var n=Mt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Nt=function(t,e){return Bt(t,(function(t,n){return{k:n,v:e(t,n)}}))},Bt=function(t,e){var n={};return Rt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},Pt=function(t,e){var n,r={};return function(t,e,n,r){Rt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,(n=r,function(t,e){n[e]=t}),h),r},It=function(t,e){var n=[];return Rt(t,(function(t,r){n.push(e(t,r))})),n},Lt=function(t,e){for(var n=Mt(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];if(e(u,i,t))return P.some(u)}return P.none()},Ht=function(t){return It(t,b)},Vt=function(t,e){return Ft(t,e)?P.from(t[e]):P.none()},Ft=function(t,e){return zt.call(t,e)},jt=function(t,e){return Ft(t,e)&&void 0!==t[e]&&null!==t[e]},Ut=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)Ft(i,u)&&(r[u]=t(r[u],i[u]))}return r}},Wt=Ut((function(t,e){return o(t)&&o(e)?Wt(t,e):e})),qt=Ut((function(t,e){return e})),$t=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Gt=function(t){return{tag:"defaultedThunk",process:t}},Kt=function(t){return Gt(v(t))},Xt=function(t){return{tag:"mergeWithThunk",process:t}},Yt=function(t){return p(St,Z)(t)},Jt=function(t){var e=Ct(t);return e.errors.length>0?Yt(e.errors):xt(e.values)},Qt=function(t){return o(t)&&Mt(t).length>100?" removed due to size":JSON.stringify(t,null,2)},Zt=function(t,e){return St([{path:t,getErrorInfo:e}])},te=function(t){return{extract:function(e,n){return Tt(t(n),(function(t){return function(t,e){return Zt(t,v(e))}(e,t)}))},toString:v("val")}},ee=te(xt),ne=function(t,e,n,r){return Vt(e,n).fold((function(){return function(t,e,n){return Zt(t,(function(){return'Could not find valid *required* value for "'+e+'" in '+Qt(n)}))}(t,n,e)}),r)},re=function(t,e,n,r){return r(Vt(t,e).getOrThunk((function(){return n(t)})))},oe=function(t,e,n,r,o){var i=function(t){return o.extract(e.concat([r]),t)},u=function(t){return t.fold((function(){return xt(P.none())}),(function(t){var n=o.extract(e.concat([r]),t);return Ot(n,P.some)}))};switch(t.tag){case"required":return ne(e,n,r,i);case"defaultedThunk":return re(n,r,t.process,i);case"option":return function(t,e,n){return n(Vt(t,e))}(n,r,u);case"defaultedOptionThunk":return function(t,e,n,r){return r(Vt(t,e).map((function(e){return!0===e?n(t):e})))}(n,r,t.process,u);case"mergeWithThunk":return re(n,r,v({}),(function(e){var r=Wt(t.process(n),e);return i(r)}))}},ie=function(t){return{extract:function(e,n){return t().extract(e,n)},toString:function(){return t().toString()}}},ue=function(t){var e=ae(t),n=X(t,(function(t,e){return At(e,(function(e){var n;return Wt(t,((n={})[e]=!0,n))}),v(t))}),{});return{extract:function(t,r){var o=a(r)?[]:Mt(Pt(r,f)),i=K(o,(function(t){return!jt(n,t)}));return 0===i.length?e.extract(t,r):function(t,e){return Zt(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))}(t,i)},toString:e.toString}},ae=function(t){return{extract:function(e,n){return function(t,e,n){for(var r={},o=[],i=0,u=n;i<u.length;i++){var a=u[i];At(a,(function(n,i,u,a){var c=oe(u,t,e,n,a);Et(c,(function(t){o.push.apply(o,t)}),(function(t){r[i]=t}))}),(function(t,n){r[t]=n(e)}))}return o.length>0?St(o):xt(r)}(e,n,t)},toString:function(){return"obj{\n"+q(t,(function(t){return At(t,(function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))})).join("\n")+"}"}}},ce=function(t){return{extract:function(e,n){var r=q(n,(function(n,r){return t.extract(e.concat(["["+r+"]"]),n)}));return Jt(r)},toString:function(){return"array("+t.toString()+")"}}},se=function(t){return{extract:function(e,n){for(var r=[],o=0,i=t;o<i.length;o++){var u=i[o].extract(e,n);if(u.stype===M.Value)return u;r.push(u)}return Jt(r)},toString:function(){return"oneOf("+q(t,(function(t){return t.toString()})).join(", ")+")"}}},le=function(t,e){return{extract:function(n,r){var o=Mt(r),i=function(e,n){return ce(te(t)).extract(e,n)}(n,o);return kt(i,(function(t){var o=q(t,(function(t){return Dt(t,t,{tag:"required",process:{}},e)}));return ae(o).extract(n,r)}))},toString:function(){return"setOf("+e.toString()+")"}}},fe=p(ce,ae),de=v(ee),me=function(t,e){return te((function(n){var r=typeof n;return t(n)?xt(n):St("Expected type: "+e+" but got: "+r)}))},ge=me(m,"number"),he=me(r,"string"),pe=me(a,"boolean"),ve=me(d,"function"),be=function(t){if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every((function(e){return be(t[e])}));default:return!1}},ye=te((function(t){return be(t)?xt(t):St("Expected value to be acceptable for sending via postMessage")})),we=function(t,e,n,r){return Vt(n,r).fold((function(){return function(t,e,n){return Zt(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+Qt(e)}))}(t,n,r)}),(function(n){return n.extract(t.concat(["branch: "+r]),e)}))},xe=function(t,e){return{extract:function(n,r){return Vt(r,t).fold((function(){return function(t,e){return Zt(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))}(n,t)}),(function(t){return we(n,r,e,t)}))},toString:function(){return"chooseOn("+t+"). Possible values: "+Mt(e)}}},Ce=function(t){return te((function(e){return t(e).fold(St,xt)}))},Se=function(t,e){return le((function(e){return yt(t(e))}),e)},ke=function(t,e,n){return wt(function(t,e,n){var r=e.extract([t],n);return _t(r,(function(t){return{input:n,errors:t}}))}(t,e,n))},Te=function(t){return t.fold((function(t){throw new Error(_e(t))}),b)},Oe=function(t,e,n){return Te(ke(t,e,n))},_e=function(t){return"Errors: \n"+(e=t.errors,n=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:v("... (only showing first ten failures)")}]):e,q(n,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))).join("\n")+"\n\nInput object: "+Qt(t.input);var e,n},Ee=function(t,e){return xe(t,Nt(e,ae))},De=Dt,Ae=function(t,e){return{tag:"custom",newKey:t,instantiator:e}},Me=function(t){return Ce((function(e){return F(t,e)?gt.value(e):gt.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')}))},ze=function(t){return De(t,t,{tag:"required",process:{}},de())},Re=function(t,e){return De(t,t,{tag:"required",process:{}},e)},Ne=function(t){return Re(t,ge)},Be=function(t){return Re(t,he)},Pe=function(t,e){return De(t,t,{tag:"required",process:{}},Me(e))},Ie=function(t){return Re(t,ve)},Le=function(t,e){return De(t,t,{tag:"required",process:{}},ae(e))},He=function(t,e){return De(t,t,{tag:"required",process:{}},fe(e))},Ve=function(t,e){return De(t,t,{tag:"required",process:{}},ce(e))},Fe=function(t){return De(t,t,{tag:"option",process:{}},de())},je=function(t,e){return De(t,t,{tag:"option",process:{}},e)},Ue=function(t){return je(t,ge)},We=function(t){return je(t,he)},qe=function(t){return je(t,ve)},$e=function(t,e){return je(t,ce(e))},Ge=function(t,e){return je(t,ae(e))},Ke=function(t,e){return De(t,t,Kt(e),de())},Xe=function(t,e,n){return De(t,t,Kt(e),n)},Ye=function(t,e){return Xe(t,e,ge)},Je=function(t,e){return Xe(t,e,he)},Qe=function(t,e,n){return Xe(t,e,Me(n))},Ze=function(t,e){return Xe(t,e,pe)},tn=function(t,e){return Xe(t,e,ve)},en=function(t,e,n){return Xe(t,e,ce(n))},nn=function(t,e,n){return Xe(t,e,ae(n))},rn=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},on=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},un={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return on(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return on(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return on(n)},fromDom:on,fromPoint:function(t,e,n){return P.from(t.dom.elementFromPoint(e,n)).map(on)}},an=function(){return cn(0,0)},cn=function(t,e){return{major:t,minor:e}},sn={nu:cn,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?an():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return cn(r(1),r(2))}(t,n)},unknown:an},ln=function(t,e){var n=String(e).toLowerCase();return J(t,(function(t){return t.search(n)}))},fn=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},dn=function(t,e){return-1!==t.indexOf(e)},mn=function(t,e){return fn(t,e,0)},gn=function(t,e){return fn(t,e,t.length-e.length)},hn=(ht=/^\s+|\s+$/g,function(t){return t.replace(ht,"")}),pn=function(t){return t.length>0},vn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,bn=function(t){return function(e){return dn(e,t)}},yn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return dn(t,"edge/")&&dn(t,"chrome")&&dn(t,"safari")&&dn(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,vn],search:function(t){return dn(t,"chrome")&&!dn(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return dn(t,"msie")||dn(t,"trident")}},{name:"Opera",versionRegexes:[vn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:bn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:bn("firefox")},{name:"Safari",versionRegexes:[vn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(dn(t,"safari")||dn(t,"mobile/"))&&dn(t,"applewebkit")}}],wn=[{name:"Windows",search:bn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return dn(t,"iphone")||dn(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:bn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:bn("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:bn("linux"),versionRegexes:[]},{name:"Solaris",search:bn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:bn("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:bn("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],xn={browsers:v(yn),oses:v(wn)},Cn="Edge",Sn="Chrome",kn="Opera",Tn="Firefox",On="Safari",_n=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Cn),isChrome:r(Sn),isIE:r("IE"),isOpera:r(kn),isFirefox:r(Tn),isSafari:r(On)}},En={unknown:function(){return _n({current:void 0,version:sn.unknown()})},nu:_n,edge:v(Cn),chrome:v(Sn),ie:v("IE"),opera:v(kn),firefox:v(Tn),safari:v(On)},Dn="Windows",An="Android",Mn="Linux",zn="Solaris",Rn="FreeBSD",Nn="ChromeOS",Bn=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Dn),isiOS:r("iOS"),isAndroid:r(An),isOSX:r("OSX"),isLinux:r(Mn),isSolaris:r(zn),isFreeBSD:r(Rn),isChromeOS:r(Nn)}},Pn={unknown:function(){return Bn({current:void 0,version:sn.unknown()})},nu:Bn,windows:v(Dn),ios:v("iOS"),android:v(An),linux:v(Mn),osx:v("OSX"),solaris:v(zn),freebsd:v(Rn),chromeos:v(Nn)},In=function(t,e,n){var r=xn.browsers(),o=xn.oses(),i=e.bind((function(t){return function(t,e){return ft(e.brands,(function(e){var n=e.brand.toLowerCase();return J(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:sn.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return ln(t,e).map((function(t){var n=sn.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(En.unknown,En.nu),u=function(t,e){return ln(t,e).map((function(t){var n=sn.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(Pn.unknown,Pn.nu),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:v(o),isiPhone:v(i),isTablet:v(c),isPhone:v(s),isTouch:v(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:v(l),isDesktop:v(f)}}(u,i,t,n);return{browser:i,os:u,deviceType:a}},Ln=function(t){return window.matchMedia(t).matches},Hn=$t((function(){return In(navigator.userAgent,P.from(navigator.userAgentData),Ln)})),Vn=function(){return Hn()},Fn=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},jn=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Un=function(t,e){return t.dom===e.dom},Wn=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},qn=function(t,e){return Vn().browser.isIE()?Wn(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},$n=function(t){if(!i(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return $(t,(function(r,o){var u=Mt(r);if(1!==u.length)throw new Error("one and only one name per case");var a=u[0],c=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!i(c))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+i);var u=function(t){var r=Mt(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!et(e,(function(t){return F(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:u,log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}})),n};$n([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Gn,Kn=function(t,e){return function(t,e){var n={};return Rt(t,(function(t,r){F(e,r)||(n[r]=t)})),n}(t,e)},Xn=function(t,e){return function(t,e){var n;return(n={})[t]=e,n}(t,e)},Yn=function(t){return function(t){var e={};return $(t,(function(t){e[t.key]=t.value})),e}(t)},Jn=function(t,e){var n,r,o=(n=[],r=[],$(t,(function(t){t.fold((function(t){n.push(t)}),(function(t){r.push(t)}))})),{errors:n,values:r});return o.errors.length>0?function(t){return gt.error(Z(t))}(o.errors):function(t,e){return 0===t.length?gt.value(e):gt.value(Wt(e,qt.apply(void 0,t)))}(o.values,e)},Qn=function(t){return d(t)?t:S},Zn=function(t,e,n){for(var r=t.dom,o=Qn(n);r.parentNode;){r=r.parentNode;var i=un.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return P.none()},tr=function(t,e,n){var r=e(t),o=Qn(n);return r.orThunk((function(){return o(t)?P.none():Zn(t,e,o)}))},er=function(t,e){return Un(t.element,e.event.target)},nr={can:k,abort:S,run:h},rr=function(t){if(!jt(t,"can")&&!jt(t,"abort")&&!jt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return O(O({},nr),t)},or=function(t){return{can:function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Y(t,(function(t,r){return t&&e(r).apply(void 0,n)}),!0)}}(t,(function(t){return t.can})),abort:function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Y(t,(function(t,r){return t||e(r).apply(void 0,n)}),!1)}}(t,(function(t){return t.abort})),run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];$(t,(function(t){t.run.apply(void 0,e)}))}}},ir=v,ur=ir("touchstart"),ar=ir("touchmove"),cr=ir("touchend"),sr=ir("touchcancel"),lr=ir("mousedown"),fr=ir("mousemove"),dr=ir("mouseout"),mr=ir("mouseup"),gr=ir("mouseover"),hr=ir("focusin"),pr=ir("focusout"),vr=ir("keydown"),br=ir("keyup"),yr=ir("input"),wr=ir("change"),xr=ir("click"),Cr=ir("transitioncancel"),Sr=ir("transitionend"),kr=ir("transitionstart"),Tr=ir("selectstart"),Or=function(t){return v("alloy."+t)},_r={tap:Or("tap")},Er=Or("focus"),Dr=Or("blur.post"),Ar=Or("paste.post"),Mr=Or("receive"),zr=Or("execute"),Rr=Or("focus.item"),Nr=_r.tap,Br=Or("longpress"),Pr=Or("sandbox.close"),Ir=Or("typeahead.cancel"),Lr=Or("system.init"),Hr=Or("system.touchmove"),Vr=Or("system.touchend"),Fr=Or("system.scroll"),jr=Or("system.resize"),Ur=Or("system.attached"),Wr=Or("system.detached"),qr=Or("system.dismissRequested"),$r=Or("system.repositionRequested"),Gr=Or("focusmanager.shifted"),Kr=Or("slotcontainer.visibility"),Xr=Or("change.tab"),Yr=Or("dismiss.tab"),Jr=Or("highlight"),Qr=Or("dehighlight"),Zr=function(t,e){ro(t,t.element,e,{})},to=function(t,e,n){ro(t,t.element,e,n)},eo=function(t){Zr(t,zr())},no=function(t,e,n){ro(t,e,n,{})},ro=function(t,e,n,r){var o=O({target:e},r);t.getSystem().triggerEvent(n,e,o)},oo=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event)},io=function(t){return Yn(t)},uo=function(t,e){return{key:t,value:rr({abort:e})}},ao=function(t){return{key:t,value:rr({run:function(t,e){e.event.prevent()}})}},co=function(t,e){return{key:t,value:rr({run:e})}},so=function(t,e,n){return{key:t,value:rr({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},lo=function(t){return function(e){return{key:t,value:rr({run:function(t,n){er(t,n)&&e(t,n)}})}}},fo=function(t,e,n){return function(t,e){return co(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){oo(e,e.element,t,r)}))}))}(t,e.partUids[n])},mo=function(t,e){return co(t,(function(t,n){var r=n.event,o=t.getSystem().getByDom(r.target).getOrThunk((function(){return tr(r.target,(function(e){return t.getSystem().getByDom(e).toOptional()}),S).getOr(t)}));e(t,o,n)}))},go=function(t){return co(t,(function(t,e){e.cut()}))},ho=function(t){return co(t,(function(t,e){e.stop()}))},po=function(t,e){return lo(t)(e)},vo=lo(Ur()),bo=lo(Wr()),yo=lo(Lr()),wo=(Gn=zr(),function(t){return co(Gn,t)});"undefined"!=typeof window?window:Function("return this;")();var xo,Co,So=function(t){return t.dom.nodeName.toLowerCase()},ko=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},To=ko(1),Oo=ko(3),_o=ko(9),Eo=ko(11),Do=function(t){return un.fromDom(t.dom.ownerDocument)},Ao=function(t){return _o(t)?t:Do(t)},Mo=function(t){return un.fromDom(Ao(t).dom.documentElement)},zo=function(t){return un.fromDom(Ao(t).dom.defaultView)},Ro=function(t){return P.from(t.dom.parentNode).map(un.fromDom)},No=function(t){return P.from(t.dom.offsetParent).map(un.fromDom)},Bo=function(t){return q(t.dom.childNodes,un.fromDom)},Po=function(t,e){var n=t.dom.childNodes;return P.from(n[e]).map(un.fromDom)},Io=function(t,e){return{element:t,offset:e}},Lo=function(t,e){var n=Bo(t);return n.length>0&&e<n.length?Io(n[e],0):Io(t,e)},Ho=function(t){return Eo(t)&&f(t.dom.host)},Vo=d(Element.prototype.attachShadow)&&d(Node.prototype.getRootNode),Fo=v(Vo),jo=Vo?function(t){return un.fromDom(t.dom.getRootNode())}:Ao,Uo=function(t){return Ho(t)?t:un.fromDom(Ao(t).dom.body)},Wo=function(t){var e=jo(t);return Ho(e)?P.some(e):P.none()},qo=function(t){return un.fromDom(t.dom.host)},$o=function(t){return f(t.dom.shadowRoot)},Go=function(t,e){Ro(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Ko=function(t,e){(function(t){return P.from(t.dom.nextSibling).map(un.fromDom)})(t).fold((function(){Ro(t).each((function(t){Yo(t,e)}))}),(function(t){Go(t,e)}))},Xo=function(t,e){(function(t){return Po(t,0)})(t).fold((function(){Yo(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Yo=function(t,e){t.dom.appendChild(e.dom)},Jo=function(t,e){$(e,(function(e){Yo(t,e)}))},Qo=function(t){t.dom.textContent="",$(Bo(t),(function(t){Zo(t)}))},Zo=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},ti=function(t){var e,n=Bo(t);n.length>0&&(e=t,$(n,(function(t){Go(e,t)}))),Zo(t)},ei=function(t){return t.dom.innerHTML},ni=function(t,e){var n,r,o=Do(t).dom,i=un.fromDom(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,Bo(un.fromDom(r)));Jo(i,u),Qo(t),Yo(t,i)},ri=function(t,e,n){if(!(r(n)||a(n)||m(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},oi=function(t,e,n){ri(t.dom,e,n)},ii=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},ui=function(t,e){return P.from(ii(t,e))},ai=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},ci=function(t,e){t.dom.removeAttribute(e)},si=function(t){return function(t,e){return un.fromDom(t.dom.cloneNode(e))}(t,!1)},li=function(t){return Ho(t)?"#shadow-root":function(t){var e=un.fromTag("div"),n=un.fromDom(t.dom.cloneNode(!0));return Yo(e,n),ei(e)}(si(t))},fi=function(t){return li(t)},di=io([function(t,e){return{key:t,value:rr({can:e})}}(Er(),(function(t,e){var n=e.event,r=n.originator,o=n.target;return!function(t,e,n){return Un(e,t.element)&&!Un(e,n)}(t,r,o)||(console.warn(Er()+" did not get interpreted by the desired target. \nOriginator: "+fi(r)+"\nTarget: "+fi(o)+"\nCheck the "+Er()+" event handlers"),!1)}))]),mi=Object.freeze({__proto__:null,events:di}),gi=0,hi=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++gi+String(e)},pi=v("alloy-id-"),vi=v("data-alloy-id"),bi=pi(),yi=vi(),wi=function(t,e){Object.defineProperty(t.dom,yi,{value:e,writable:!0})},xi=function(t){var e=To(t)?t.dom[yi]:null;return P.from(e)},Ci=function(t){return hi(t)},Si=b,ki=function(t){var e=function(e){return"The component must be in a context to execute: "+e+(t?"\n"+fi(t().element)+" is not in context.":"")},n=function(t){return function(){throw new Error(e(t))}},r=function(t){return function(){console.warn(e(t))}};return{debugInfo:v("fake"),triggerEvent:r("triggerEvent"),triggerFocus:r("triggerFocus"),triggerEscape:r("triggerEscape"),broadcast:r("broadcast"),broadcastOn:r("broadcastOn"),broadcastEvent:r("broadcastEvent"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),isConnected:S}},Ti=ki(),Oi=function(t){return q(t,(function(t){return gn(t,"/*")?t.substring(0,t.length-"/*".length):t}))},_i=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:Oi(i)}},t},Ei=hi("alloy-premade"),Di=function(t){return Xn(Ei,t)},Ai=function(t){return function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Oi(i.slice(1))}},t}((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return t.apply(void 0,E([e.getApis(),e],n))}),t)},Mi={init:function(){return zi({readState:v("No State required")})}},zi=function(t){return t},Ri=function(t,e){var n={};return Rt(t,(function(t,r){Rt(t,(function(t,o){var i=Vt(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},Ni=function(t){return{classes:c(t.classes)?[]:t.classes,attributes:c(t.attributes)?{}:t.attributes,styles:c(t.styles)?{}:t.styles}},Bi=function(t){return t.cHandler},Pi=function(t,e){return{name:t,handler:e}},Ii=function(t,e,n){var r=O(O({},n),function(t,e){var n={};return $(t,(function(t){n[t.name()]=t.handlers(e)})),n}(e,t));return Ri(r,Pi)},Li=function(t){var e=function(t){return d(t)?{can:k,abort:S,run:t}:t}(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}},Hi=function(t,e,n){var r=e[n];return r?function(t,e,n,r){try{var o=ut(n,(function(n,o){var i=n[e],u=o[e],a=r.indexOf(i),c=r.indexOf(u);if(-1===a)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===c)throw new Error("The ordering for "+t+" does not have an entry for "+u+".\nOrder specified: "+JSON.stringify(r,null,2));return a<c?-1:c<a?1:0}));return gt.value(o)}catch(i){return gt.error([i])}}("Event: "+n,"name",t,r).map((function(t){var e=q(t,(function(t){return t.handler}));return or(e)})):function(t,e){return gt.error(["The event ("+t+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(q(e,(function(t){return t.name})),null,2)])}(n,t)},Vi=function(t,e){var n=It(t,(function(t,n){return(1===t.length?gt.value(t[0].handler):Hi(t,e,n)).map((function(r){var o=Li(r),i=t.length>1?K(e[n],(function(e){return j(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return Xn(n,function(t,e){return{handler:t,purpose:e}}(o,i))}))}));return Jn(n,{})},Fi="alloy.base.behaviour",ji=ae([De("dom","dom",{tag:"required",process:{}},ae([ze("tag"),Ke("styles",{}),Ke("classes",[]),Ke("attributes",{}),Fe("value"),Fe("innerHtml")])),ze("components"),ze("uid"),Ke("events",{}),Ke("apis",{}),De("eventOrder","eventOrder",(xo={},xo[zr()]=["disabling",Fi,"toggling","typeaheadevents"],xo[Er()]=[Fi,"focusing","keying"],xo[Lr()]=[Fi,"disabling","toggling","representing"],xo[yr()]=[Fi,"representing","streaming","invalidating"],xo[Wr()]=[Fi,"representing","item-events","tooltipping"],xo[lr()]=["focusing",Fi,"item-type-events"],xo[ur()]=["focusing",Fi,"item-type-events"],xo[gr()]=["item-type-events","tooltipping"],xo[Mr()]=["receiving","reflecting","tooltipping"],Co=xo,Xt(v(Co))),de()),Fe("domModification")]),Ui=function(t){return t.events},Wi=function(t,e){var n=ii(t,e);return void 0===n||""===n?[]:n.split(" ")},qi=function(t){return void 0!==t.dom.classList},$i=function(t,e){return function(t,e,n){var r=Wi(t,e).concat([n]);return oi(t,e,r.join(" ")),!0}(t,"class",e)},Gi=function(t,e){return function(t,e,n){var r=K(Wi(t,e),(function(t){return t!==n}));return r.length>0?oi(t,e,r.join(" ")):ci(t,e),!1}(t,"class",e)},Ki=function(t,e){qi(t)?t.dom.classList.add(e):$i(t,e)},Xi=function(t){0===(qi(t)?t.dom.classList:function(t){return Wi(t,"class")}(t)).length&&ci(t,"class")},Yi=function(t,e){qi(t)?t.dom.classList.remove(e):Gi(t,e);Xi(t)},Ji=function(t,e){return qi(t)&&t.dom.classList.contains(e)},Qi=function(t,e){$(e,(function(e){Ki(t,e)}))},Zi=function(t,e){$(e,(function(e){Yi(t,e)}))},tu=function(t,e,n){return void 0===n&&(n=y),t.exists((function(t){return n(t,e)}))},eu=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},nu=function(t,e,n){return t.isSome()&&e.isSome()?P.some(n(t.getOrDie(),e.getOrDie())):P.none()},ru=function(t,e){return t?P.some(e):P.none()},ou=function(t){return void 0!==t.style&&d(t.style.getPropertyValue)},iu=function(t){var e=Oo(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return Wo(un.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=iu,r=qo,function(t){return n(r(t))}))},uu=function(){return au(un.fromDom(document))},au=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return un.fromDom(e)},cu=function(t,e,n){if(!r(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);ou(t)&&t.style.setProperty(e,n)},su=function(t,e){ou(t)&&t.style.removeProperty(e)},lu=function(t,e,n){var r=t.dom;cu(r,e,n)},fu=function(t,e){var n=t.dom;Rt(e,(function(t,e){cu(n,e,t)}))},du=function(t,e){var n=t.dom;Rt(e,(function(t,e){t.fold((function(){su(n,e)}),(function(t){cu(n,e,t)}))}))},mu=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||iu(t)?r:gu(n,e)},gu=function(t,e){return ou(t)?t.style.getPropertyValue(e):""},hu=function(t,e){var n=t.dom,r=gu(n,e);return P.from(r).filter((function(t){return t.length>0}))},pu=function(t){var e={},n=t.dom;if(ou(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},vu=function(t,e,n){var r=un.fromTag(t);return lu(r,e,n),hu(r,e).isSome()},bu=function(t,e){var n=t.dom;su(n,e),tu(ui(t,"style").map(hn),"")&&ci(t,"style")},yu=function(t){return t.dom.offsetWidth},wu=function(t){return t.dom.value},xu=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},Cu=function(t){var e,n,r,o=un.fromTag(t.tag);e=o,n=t.attributes,r=e.dom,Rt(n,(function(t,e){ri(r,e,t)})),Qi(o,t.classes),fu(o,t.styles),t.innerHtml.each((function(t){return ni(o,t)}));var i=t.domChildren;return Jo(o,i),t.value.each((function(t){xu(o,t)})),t.uid,wi(o,t.uid),o},Su=function(t,e){return function(t,e){var n=q(e,(function(t){return Ge(t.name(),[ze("config"),Ke("state",Mi)])})),r=ke("component.behaviours",ae(n),t.behaviours).fold((function(e){throw new Error(_e(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),b);return{list:e,data:Nt(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return v(e)}))}}(t,e)},ku=function(t){var e=function(t){var e=Vt(t,"behaviours").getOr({}),n=K(Mt(e),(function(t){return void 0!==e[t]}));return q(n,(function(t){return e[t].me}))}(t);return Su(t,e)},Tu=function(t,e,n){var r,o,i,u=O(O({},(r=t).dom),{uid:r.uid,domChildren:q(r.components,(function(t){return t.element}))}),a=function(t){return t.domModification.fold((function(){return Ni({})}),Ni)}(t),c={"alloy.base.modification":a},s=e.length>0?function(t,e,n,r){var o=O({},e);$(n,(function(e){o[e.name()]=e.exhibit(t,r)}));var i=Ri(o,(function(t,e){return{name:t,modification:e}})),u=function(t){return X(t,(function(t,e){return O(O({},e.modification),t)}),{})},a=X(i.classes,(function(t,e){return e.modification.concat(t)}),[]),c=u(i.attributes),s=u(i.styles);return Ni({classes:a,attributes:c,styles:s})}(n,c,e,u):a;return i=s,O(O({},o=u),{attributes:O(O({},o.attributes),i.attributes),styles:O(O({},o.styles),i.styles),classes:o.classes.concat(i.classes)})},Ou=function(t,e,n){var r={"alloy.base.behaviour":Ui(t)};return function(t,e,n,r){var o=Ii(t,n,r);return Vi(o,e)}(n,t.eventOrder,e,r).getOrDie()},_u=function(t){var e=function(){return f},n=rn(Ti),r=Te(function(t){return ke("custom.definition",ji,t)}(t)),o=ku(t),i=function(t){return t.list}(o),u=function(t){return t.data}(o),a=Tu(r,i,u),c=Cu(a),s=Ou(r,i,u),l=rn(r.components),f={uid:t.uid,getSystem:n.get,config:function(e){var n=u;return(d(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return d(u[t.name()])},spec:t,readState:function(t){return u[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},getApis:function(){return r.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(ki(e))},element:c,syncComponents:function(){var t=Bo(c),e=tt(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),it)}));l.set(e)},components:l.get,events:s};return f},Eu=function(t){var e=Si(t),n=e.events,r=_(e,["events"]),o=function(t){var e=Vt(t,"components").getOr([]);return q(e,zu)}(r),i=O(O({},r),{events:O(O({},mi),n),components:o});return gt.value(_u(i))},Du=function(t){var e=un.fromText(t);return Au({element:e})},Au=function(t){var e=Oe("external.component",ue([ze("element"),Fe("uid")]),t),n=rn(ki()),r=e.uid.getOrThunk((function(){return Ci("external")}));wi(e.element,r);var o={uid:r,getSystem:n.get,config:P.none,hasConfigured:S,connect:function(t){n.set(t)},disconnect:function(){n.set(ki((function(){return o})))},getApis:function(){return{}},element:e.element,spec:t,readState:v("No state"),syncComponents:h,components:v([]),events:{}};return Di(o)},Mu=Ci,zu=function(t){return function(t){return Vt(t,Ei)}(t).getOrThunk((function(){var e=function(t){return Ft(t,"uid")}(t)?t:O({uid:Mu("")},t);return Eu(e).getOrDie()}))},Ru=Di,Nu=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=mu(n,t);return parseFloat(o)||0}return r},r=function(t,e){return Y(e,(function(e,n){var r=mu(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!m(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;ou(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}},Bu=Nu("height",(function(t){var e=t.dom;return iu(t)?e.getBoundingClientRect().height:e.offsetHeight})),Pu=function(t){return Bu.get(t)},Iu=function(t){return Bu.getOuter(t)},Lu=function(t,e){return{left:t,top:e,translate:function(n,r){return Lu(t+n,e+r)}}},Hu=Lu,Vu=function(t,e){return void 0!==t?t:void 0!==e?e:0},Fu=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return Hu(n.offsetLeft,n.offsetTop);var i=Vu(null==r?void 0:r.pageYOffset,o.scrollTop),u=Vu(null==r?void 0:r.pageXOffset,o.scrollLeft),a=Vu(o.clientTop,n.clientTop),c=Vu(o.clientLeft,n.clientLeft);return ju(t).translate(u-c,i-a)},ju=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?Hu(n.offsetLeft,n.offsetTop):iu(t)?function(t){var e=t.getBoundingClientRect();return Hu(e.left,e.top)}(e):Hu(0,0)},Uu=Nu("width",(function(t){return t.dom.offsetWidth})),Wu=function(t){return Uu.get(t)},qu=function(t){return Uu.getOuter(t)},$u=function(t){var e=un.fromDom(function(t){if(Fo()&&f(t.target)){var e=un.fromDom(t.target);if(To(e)&&$o(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return ct(n)}}return P.from(t.target)}(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},o=p(r,n);return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(e,t.clientX,t.clientY,n,r,o,t)},Gu=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e($u(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:w(Ku,t,e,i,o)}},Ku=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Xu=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return Hu(n,r)},Yu=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},Ju=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Qu=function(t){var e=void 0===t?window:t,n=e.document,r=Xu(un.fromDom(n));return function(t){var e=void 0===t?window:t;return P.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Ju(r.left,r.top,n,o)}),(function(t){return Ju(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Zu=function(t,e){return t.view(e).fold(v([]),(function(e){var n=t.owner(e),r=Zu(t,n);return[e].concat(r)}))},ta=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?P.none():P.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(un.fromDom)},owner:function(t){return Do(t)}}),ea=function(t){var e=un.fromDom(document),n=Xu(e);return function(t,e){var n=e.owner(t),r=Zu(e,n);return P.some(r)}(t,ta).fold(w(Fu,t),(function(e){var r=ju(t),o=X(e,(function(t,e){var n=ju(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return Hu(o.left+r.left+n.left,o.top+r.top+n.top)}))},na=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},ra=function(t){var e=Fu(t),n=qu(t),r=Iu(t);return na(e.left,e.top,n,r)},oa=function(t){var e=ea(t),n=qu(t),r=Iu(t);return na(e.left,e.top,n,r)},ia=function(){return Qu(window)};function ua(t,e,n,r,o){return t(n,r)?P.some(n):d(o)&&o(n)?P.none():e(n,r,o)}var aa,ca,sa=function(t,e,n){for(var r=t.dom,o=d(n)?n:S;r.parentNode;){r=r.parentNode;var i=un.fromDom(r);if(e(i))return P.some(i);if(o(i))break}return P.none()},la=function(t,e,n){return ua((function(t,e){return e(t)}),sa,t,e,n)},fa=function(t,e,n){return la(t,e,n).isSome()},da=function(t,e,n){return sa(t,(function(t){return Fn(t,e)}),n)},ma=function(t,e){return function(t,e){return J(t.dom.childNodes,(function(t){return e(un.fromDom(t))})).map(un.fromDom)}(t,(function(t){return Fn(t,e)}))},ga=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return jn(n)?P.none():P.from(n.querySelector(t)).map(un.fromDom)}(e,t)},ha=function(t,e,n){return ua((function(t,e){return Fn(t,e)}),da,t,e,n)},pa=function(){var t=hi("aria-owns");return{id:t,link:function(e){oi(e,"aria-owns",t)},unlink:function(t){ci(t,"aria-owns")}}},va=function(t,e){return function(t){return la(t,(function(t){if(!To(t))return!1;var e=ii(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1})).bind((function(t){var e=ii(t,"id"),n=jo(t);return ga(n,'[aria-owns="'+e+'"]')}))}(e).exists((function(e){return ba(t,e)}))},ba=function(t,e){return fa(e,(function(e){return Un(e,t.element)}),S)||va(t,e)},ya="unknown";(ca=aa||(aa={}))[ca.STOP=0]="STOP",ca[ca.NORMAL=1]="NORMAL",ca[ca.LOGGING=2]="LOGGING";var wa=rn({}),xa=function(t,e,n){switch(Vt(wa.get(),t).orThunk((function(){var e=Mt(wa.get());return ft(e,(function(e){return t.indexOf(e)>-1?P.some(wa.get()[e]):P.none()}))})).getOr(aa.NORMAL)){case aa.NORMAL:return n(ka());case aa.LOGGING:var r=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();F(["mousemove","mouseover","mouseout",Lr()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:q(n,(function(t){return F(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+fi(t.target)+")":t.outcome}))})}}}(t,e),o=n(r);return r.write(),o;case aa.STOP:return!0}},Ca=["alloy/data/Fields","alloy/debugging/Debugging"],Sa=function(t,e,n){return xa(t,e,n)},ka=v({logEventCut:h,logEventStopped:h,logNoParent:h,logEventNoHandlers:h,logEventResponse:h,write:h}),Ta=v([ze("menu"),ze("selectedMenu")]),Oa=v([ze("item"),ze("selectedItem")]);v(ae(Oa().concat(Ta())));var _a=v(ae(Oa())),Ea=Le("initSize",[ze("numColumns"),ze("numRows")]),Da=function(){return Le("markers",[ze("backgroundMenu")].concat(Ta()).concat(Oa()))},Aa=function(t){return Le("markers",q(t,ze))},Ma=function(t,e,n){return function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return J(e,(function(t){return t.indexOf("alloy")>0&&!j(Ca,(function(e){return t.indexOf(e)>-1}))})).getOr(ya)}}(),De(e,e,n,Ce((function(t){return gt.value((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}))})))},za=function(t){return Ma(0,t,Kt(h))},Ra=function(t){return Ma(0,t,Kt(P.none))},Na=function(t){return Ma(0,t,{tag:"required",process:{}})},Ba=function(t){return Ma(0,t,{tag:"required",process:{}})},Pa=function(t,e){return Ae(t,v(e))},Ia=function(t){return Ae(t,b)},La=v(Ea),Ha=function(t,e,n,r,o,i,u,a){return void 0===a&&(a=!1),{x:t,y:e,bubble:n,direction:r,placement:o,restriction:i,label:u+"-"+o,alwaysFit:a}},Va=$n([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Fa=Va.southeast,ja=Va.southwest,Ua=Va.northeast,Wa=Va.northwest,qa=Va.south,$a=Va.north,Ga=Va.east,Ka=Va.west,Xa=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},Ya=function(t,e,n){return Math.min(Math.max(t,e),n)},Ja=function(t,e){return ot(["left","right","top","bottom"],(function(n){return Vt(e,n).map((function(e){return function(t,e){switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(t,e)}))}))},Qa="layout",Za=function(t){return t.x},tc=function(t,e){return t.x+t.width/2-e.width/2},ec=function(t,e){return t.x+t.width-e.width},nc=function(t,e){return t.y-e.height},rc=function(t){return t.y+t.height},oc=function(t,e){return t.y+t.height/2-e.height/2},ic=function(t,e,n){return Ha(Za(t),rc(t),n.southeast(),Fa(),"southeast",Ja(t,{left:1,top:3}),Qa)},uc=function(t,e,n){return Ha(ec(t,e),rc(t),n.southwest(),ja(),"southwest",Ja(t,{right:0,top:3}),Qa)},ac=function(t,e,n){return Ha(Za(t),nc(t,e),n.northeast(),Ua(),"northeast",Ja(t,{left:1,bottom:2}),Qa)},cc=function(t,e,n){return Ha(ec(t,e),nc(t,e),n.northwest(),Wa(),"northwest",Ja(t,{right:0,bottom:2}),Qa)},sc=function(t,e,n){return Ha(tc(t,e),nc(t,e),n.north(),$a(),"north",Ja(t,{bottom:2}),Qa)},lc=function(t,e,n){return Ha(tc(t,e),rc(t),n.south(),qa(),"south",Ja(t,{top:3}),Qa)},fc=function(t,e,n){return Ha(function(t){return t.x+t.width}(t),oc(t,e),n.east(),Ga(),"east",Ja(t,{left:0}),Qa)},dc=function(t,e,n){return Ha(function(t,e){return t.x-e.width}(t,e),oc(t,e),n.west(),Ka(),"west",Ja(t,{right:1}),Qa)},mc=function(){return[ic,uc,ac,cc,lc,sc,fc,dc]},gc=function(){return[uc,ic,cc,ac,lc,sc,fc,dc]},hc=function(){return[ac,cc,ic,uc,sc,lc]},pc=function(){return[cc,ac,uc,ic,sc,lc]},vc=function(){return[ic,uc,ac,cc,lc,sc]},bc=function(){return[uc,ic,cc,ac,lc,sc]},yc=Object.freeze({__proto__:null,events:function(t){return io([co(Mr(),(function(e,n){var r=t.channels,o=Mt(r),i=n,u=function(t,e){return e.universal?t:K(t,(function(t){return F(e.channels,t)}))}(o,i);$(u,(function(t){var n=r[t],o=n.schema,u=Oe("channel["+t+"] data\nReceiver: "+fi(e.element),o,i.data);n.onReceive(e,u)}))}))])}}),wc=[Re("channels",Se(gt.value,ue([Na("onReceive"),Ke("schema",de())])))],xc=function(t,e,n){return yo((function(r,o){n(r,t,e)}))},Cc=function(t,e,n){return function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),u=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:Oi(u.slice(0,1).concat(u.slice(3)))}},t}((function(r){for(var o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];var u=[r].concat(o);return r.config({name:v(t)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)}),(function(t){var n=Array.prototype.slice.call(u,1);return e.apply(void 0,[r,t.config,t.state].concat(n))}))}),n,e)},Sc=function(t){return{key:t,value:void 0}},kc=function(t,e,n,r,o,i,u){var a=function(t){return jt(t,n)?t[n]():P.none()},c=Nt(o,(function(t,e){return Cc(n,t,e)})),s=Nt(i,(function(t,e){return _i(t,e)})),l=O(O(O({},s),c),{revoke:w(Sc,n),config:function(e){var r=Oe(n+"-config",t,e);return{key:n,value:{config:r,me:l,configAsRaw:$t((function(){return Oe(n+"-config",t,e)})),initialConfig:e,state:u}}},schema:v(e),exhibit:function(t,e){return nu(a(t),Vt(r,"exhibit"),(function(t,n){return n(e,t.config,t.state)})).getOrThunk((function(){return Ni({})}))},name:v(n),handlers:function(t){return a(t).map((function(t){return Vt(r,"events").getOr((function(){return{}}))(t.config,t.state)})).getOr({})}});return l},Tc=function(t){return Yn(t)},Oc=ue([ze("fields"),ze("name"),Ke("active",{}),Ke("apis",{}),Ke("state",Mi),Ke("extra",{})]),_c=function(t){var e=Oe("Creating behaviour: "+t.name,Oc,t);return function(t,e,n,r,o,i){var u,a,c=ue(t),s=Ge(e,[(u="config",a=t,je(u,ue(a)))]);return kc(c,s,e,n,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)},Ec=ue([ze("branchKey"),ze("branches"),ze("name"),Ke("active",{}),Ke("apis",{}),Ke("state",Mi),Ke("extra",{})]),Dc=function(t){var e=Oe("Creating behaviour: "+t.name,Ec,t);return function(t,e,n,r,o,i){var u=t,a=Ge(e,[je("config",t)]);return kc(u,a,e,n,r,o,i)}(Ee(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)},Ac=v(void 0),Mc=_c({fields:wc,name:"receiving",active:yc}),zc=Object.freeze({__proto__:null,exhibit:function(t,e){return Ni({classes:[],styles:e.useFixed()?{}:{position:"relative"}})}}),Rc=function(t){return t.dom.focus()},Nc=function(t){var e=jo(t).dom;return t.dom===e.activeElement},Bc=function(t){return void 0===t&&(t=un.fromDom(document)),P.from(t.dom.activeElement).map(un.fromDom)},Pc=function(t){return Bc(jo(t)).filter((function(e){return t.dom.contains(e.dom)}))},Ic=function(t,e){var n=jo(e),r=Bc(n).bind((function(t){var n,r,o=function(e){return Un(t,e)};return o(e)?P.some(e):(n=o,(r=function(t){for(var e=0;e<t.childNodes.length;e++){var o=un.fromDom(t.childNodes[e]);if(n(o))return P.some(o);var i=r(t.childNodes[e]);if(i.isSome())return i}return P.none()})(e.dom))})),o=t(e);return r.each((function(t){Bc(n).filter((function(e){return Un(e,t)})).fold((function(){Rc(t)}),h)})),o},Lc=function(t,e,n,r,o){var i=function(t){return t+"px"};return{position:t,left:e.map(i),top:n.map(i),right:r.map(i),bottom:o.map(i)}},Hc=function(t,e){du(t,function(t){return O(O({},t),{position:P.some(t.position)})}(e))},Vc=$n([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Fc=function(t,e,n,r,o,i){var u,a,c,s,l,f,d,m,g,h=e.rect,p=h.x-n,v=h.y-r,b=o-(p+h.width),y=i-(v+h.height),w=P.some(p),x=P.some(v),C=P.some(b),S=P.some(y),k=P.none();return u=e.direction,a=function(){return Lc(t,w,x,k,k)},c=function(){return Lc(t,k,x,C,k)},s=function(){return Lc(t,w,k,k,S)},l=function(){return Lc(t,k,k,C,S)},f=function(){return Lc(t,w,x,k,k)},d=function(){return Lc(t,w,k,k,S)},m=function(){return Lc(t,w,x,k,k)},g=function(){return Lc(t,k,x,C,k)},u.fold(a,c,s,l,f,d,m,g)},jc=function(t,e){return t.fold((function(){var t=e.rect;return Lc("absolute",P.some(t.x),P.some(t.y),P.none(),P.none())}),(function(t,n,r,o){return Fc("absolute",e,t,n,r,o)}),(function(t,n,r,o){return Fc("fixed",e,t,n,r,o)}))},Uc=function(t,e){var n=w(ea,e),r=t.fold(n,n,(function(){var t=Xu();return ea(e).translate(-t.left,-t.top)})),o=qu(e),i=Iu(e);return na(r.left,r.top,o,i)},Wc=function(t,e){return e.fold((function(){return t.fold(ia,ia,na)}),(function(e){return t.fold(e,e,(function(){var n=e(),r=qc(t,n.x,n.y);return na(r.left,r.top,n.width,n.height)}))}))},qc=function(t,e,n){var r=Hu(e,n);return t.fold(v(r),v(r),(function(){var t=Xu();return r.translate(-t.left,-t.top)}))};Vc.none;var $c,Gc,Kc=Vc.relative,Xc=Vc.fixed,Yc="data-alloy-placement",Jc=function(t){return ui(t,Yc)},Qc=$n([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),Zc=function(t,e,n,r){var o=t.bubble,i=o.offset,u=function(t,e,n){var r=function(r,o){return e[r].map((function(e){var i="top"===r||"bottom"===r,u=i?n.top:n.left,a=("left"===r||"top"===r?Math.max:Math.min)(e,o)+u;return i?Ya(a,t.y,t.bottom):Ya(a,t.x,t.right)})).getOr(o)},o=r("left",t.x),i=r("top",t.y),u=r("right",t.right),a=r("bottom",t.bottom);return na(o,i,u-o,a-i)}(r,t.restriction,i),a=t.x+i.left,c=t.y+i.top,s=na(a,c,e,n),l=function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,u=t.x,a=t.y,c=t.right,s=t.bottom,l=t.width,f=t.height;return{originInBounds:u>=n&&u<=o&&a>=r&&a<=i,sizeInBounds:c<=o&&c>=n&&s<=i&&s>=r,visibleW:Math.min(l,u>=n?o-u:c-n),visibleH:Math.min(f,a>=r?i-a:s-r)}}(s,u),f=l.originInBounds,d=l.sizeInBounds,m=l.visibleW,g=l.visibleH,h=f&&d,p=h?s:function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,u=t.x,a=t.y,c=t.width,s=t.height,l=Math.max(n,o-c),f=Math.max(r,i-s),d=Ya(u,n,l),m=Ya(a,r,f),g=Math.min(d+c,o)-d,h=Math.min(m+s,i)-m;return na(d,m,g,h)}(s,u),b=p.width>0&&p.height>0,y=function(t,e,n){var r,o,i,u=v(e.bottom-n.y),a=v(n.bottom-e.y),c=(r=a,o=a,i=u,t.fold(r,r,i,i,r,i,o,o)),s=v(e.right-n.x),l=v(n.right-e.x);return{maxWidth:function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)}(t,l,l,s),maxHeight:c}}(t.direction,p,r),w=y.maxWidth,x={rect:p,maxHeight:y.maxHeight,maxWidth:w,direction:t.direction,placement:t.placement,classes:{on:o.classesOn,off:o.classesOff},layout:t.label,testY:c};return h||t.alwaysFit?Qc.fit(x):Qc.nofit(x,m,g,b)},ts=function(t){var e=rn(P.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(P.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(P.some(t))}}},es=function(){return ts((function(t){return t.unbind()}))},ns=function(){var t=ts(h);return O(O({},t),{on:function(e){return t.get().each(e)}})},rs=k,os=function(t,e,n){return function(t,e,n,r){return Gu(t,e,n,r,!1)}(t,e,rs,n)},is=function(t,e,n){return function(t,e,n,r){return Gu(t,e,n,r,!0)}(t,e,rs,n)},us=$u,as=["top","bottom","right","left"],cs="data-alloy-transition-timer",ss=function(t,e){return function(t,e){return et(e,(function(e){return Ji(t,e)}))}(t,e.classes)},ls=function(t,e){var n=function(t){return parseFloat(t).toPrecision(3)};return Lt(e,(function(e,r){var o,i,u,a=t[r].map(n),c=e.map(n);return void 0===u&&(u=y),!nu(o=a,i=c,u).getOr(o.isNone()&&i.isNone())})).isSome()},fs=function(t,e){var n,o=es(),i=es(),u=function(e){var n,r=null!==(n=e.raw.pseudoElement)&&void 0!==n?n:"";return Un(e.target,t)&&!pn(r)&&F(as,e.raw.propertyName)},a=function(r){if(l(r)||u(r)){o.clear(),i.clear();var a=null==r?void 0:r.raw.type;(l(a)||a===Sr())&&(clearTimeout(n),ci(t,cs),Zi(t,e.classes))}},c=function(){o.set(os(t,Sr(),a)),i.set(os(t,Cr(),a))};if("ontransitionstart"in t.dom)var s=os(t,kr(),(function(t){u(t)&&(s.unbind(),c())}));else c();var f=function(t){var e=function(e){var n=mu(t,e),o=r(n)?n.split(/\s*,\s*/):[];return K(o,pn)},n=function(t){if(r(t)&&/^[\d.]+/.test(t)){var e=parseFloat(t);return gn(t,"ms")?e:1e3*e}return 0},o=e("transition-delay"),i=e("transition-duration");return Y(i,(function(t,e,r){var i=n(o[r])+n(e);return Math.max(t,i)}),0)}(t);requestAnimationFrame((function(){n=setTimeout(a,f+17),oi(t,cs,n)}))},ds=function(t,e,n,r,o,i){var u=function(t,e,n){return n.exists((function(n){var r=t.mode;return"all"===r||n[r]!==e[r]}))}(r,o,i);if(u||ss(t,r)){lu(t,"position",n.position);var a=Uc(e,t),c=jc(e,O(O({},o),{rect:a})),s=ot(as,(function(t){return c[t]}));ls(n,s)&&(du(t,s),u&&function(t,e){Qi(t,e.classes),ui(t,cs).each((function(e){clearTimeout(parseInt(e,10)),ci(t,cs)})),fs(t,e)}(t,r),yu(t))}else Zi(t,r.classes)},ms=function(t,e,n,r){bu(e,"max-height"),bu(e,"max-width");var o,i={width:qu(o=e),height:Iu(o)};return function(t,e,n,r,o,i){var u=r.width,a=r.height,c=function(e,c,s,l,f){var d=e(n,r,o,t,i),m=Zc(d,u,a,i);return m.fold(v(m),(function(t,e,n,r){return(f===r?n>l||e>s:!f&&r)?m:Qc.nofit(c,s,l,f)}))};return Y(e,(function(t,e){var n=w(c,e);return t.fold(v(t),n)}),Qc.nofit({rect:n,maxHeight:r.height,maxWidth:r.width,direction:Fa(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:n.y},-1,-1,!1)).fold(b,b)}(e,r.preference,t,i,n,r.bounds)},gs=function(t,e){!function(t,e){oi(t,Yc,e)}(t,e.placement)},hs=function(t,e){!function(t,e){var n=Bu.max(t,e,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);lu(t,"max-height",n+"px")}(t,Math.floor(e))},ps=v((function(t,e){hs(t,e),fu(t,{"overflow-x":"hidden","overflow-y":"auto"})})),vs=v((function(t,e){hs(t,e)})),bs=function(t,e,n){return void 0===t[e]?n:t[e]},ys=function(t,e,n,r){var o=ms(t,e,n,r);return function(t,e,n){var r=jc(n.origin,e);n.transition.each((function(o){ds(t,n.origin,r,o,e,n.lastPlacement)})),Hc(t,r)}(e,o,r),gs(e,o),function(t,e){var n=e.classes;Zi(t,n.off),Qi(t,n.on)}(e,o),function(t,e,n){(0,n.maxHeightFunction)(t,e.maxHeight)}(e,o,r),function(t,e,n){(0,n.maxWidthFunction)(t,e.maxWidth)}(e,o,r),{layout:o.layout,placement:o.placement}},ws=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],xs=function(t,e,n,r){void 0===r&&(r=1);var o=t*r,i=e*r,u=function(t){return Vt(n,t).getOr([])},a=function(t,e,n){var r=rt(ws,n);return{offset:Hu(t,e),classesOn:tt(n,u),classesOff:tt(r,u)}};return{southeast:function(){return a(-t,e,["top","alignLeft"])},southwest:function(){return a(t,e,["top","alignRight"])},south:function(){return a(-t/2,e,["top","alignCentre"])},northeast:function(){return a(-t,-e,["bottom","alignLeft"])},northwest:function(){return a(t,-e,["bottom","alignRight"])},north:function(){return a(-t/2,-e,["bottom","alignCentre"])},east:function(){return a(t,-e/2,["valignCentre","left"])},west:function(){return a(-t,-e/2,["valignCentre","right"])},insetNortheast:function(){return a(o,i,["top","alignLeft","inset"])},insetNorthwest:function(){return a(-o,i,["top","alignRight","inset"])},insetNorth:function(){return a(-o/2,i,["top","alignCentre","inset"])},insetSoutheast:function(){return a(o,-i,["bottom","alignLeft","inset"])},insetSouthwest:function(){return a(-o,-i,["bottom","alignRight","inset"])},insetSouth:function(){return a(-o/2,-i,["bottom","alignCentre","inset"])},insetEast:function(){return a(-o,-i/2,["valignCentre","right","inset"])},insetWest:function(){return a(o,-i/2,["valignCentre","left","inset"])}}},Cs=function(){return xs(0,0,{})},Ss=b,ks=function(t,e){return function(n){return"rtl"===Ts(n)?e:t}},Ts=function(t){return"rtl"===mu(t,"direction")?"rtl":"ltr"};(Gc=$c||($c={})).TopToBottom="toptobottom",Gc.BottomToTop="bottomtotop";var Os="data-alloy-vertical-dir",_s=function(t){return fa(t,(function(t){return To(t)&&ii(t,"data-alloy-vertical-dir")===$c.BottomToTop}))},Es=function(){return Ge("layouts",[ze("onLtr"),ze("onRtl"),Fe("onBottomLtr"),Fe("onBottomRtl")])},Ds=function(t,e,n,r,o,i,u){var a=u.map(_s).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),l=a?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),f=a?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r);return ks(l,f)(t)},As=[ze("hotspot"),Fe("bubble"),Ke("overrides",{}),Es(),Pa("placement",(function(t,e,n){var r=e.hotspot,o=Uc(n,r.element),i=Ds(t.element,e,vc(),bc(),hc(),pc(),P.some(e.hotspot.element));return P.some(Ss({anchorBox:o,bubble:e.bubble.getOr(Cs()),overrides:e.overrides,layouts:i,placer:P.none()}))}))],Ms=[ze("x"),ze("y"),Ke("height",0),Ke("width",0),Ke("bubble",Cs()),Ke("overrides",{}),Es(),Pa("placement",(function(t,e,n){var r=qc(n,e.x,e.y),o=na(r.left,r.top,e.width,e.height),i=Ds(t.element,e,mc(),gc(),mc(),gc(),P.none());return P.some(Ss({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:P.none()}))}))],zs=$n([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Rs=function(t){return t.fold(b,(function(t,e,n){return t.translate(-e,-n)}))},Ns=function(t){return t.fold(b,b)},Bs=function(t){return Y(t,(function(t,e){return t.translate(e.left,e.top)}),Hu(0,0))},Ps=function(t){var e=q(t,Ns);return Bs(e)},Is=zs.screen,Ls=zs.absolute,Hs=function(t,e,n){var r=Do(t.element),o=Xu(r),i=function(t,e,n){var r=zo(n.root).dom;return P.from(r.frameElement).map(un.fromDom).filter((function(e){var n=Do(e),r=Do(t.element);return Un(n,r)})).map(Fu)}(t,0,n).getOr(o);return Ls(i,o.left,o.top)},Vs=function(t,e,n,r){var o=Is(Hu(t,e));return P.some(function(t,e,n){return{point:t,width:e,height:n}}(o,n,r))},Fs=function(t,e,n,r,o){return t.map((function(t){var i,u,a,c,s,l,f,d=[e,t.point],m=(i=function(){return Ps(d)},u=function(){return Ps(d)},a=function(){return function(t){var e=q(t,Rs);return Bs(e)}(d)},r.fold(i,u,a)),g=(c=m.left,s=m.top,l=t.width,f=t.height,{x:c,y:s,width:l,height:f}),h=n.showAbove?hc():vc(),p=n.showAbove?pc():bc(),v=Ds(o,n,h,p,h,p,P.none());return Ss({anchorBox:g,bubble:n.bubble.getOr(Cs()),overrides:n.overrides,layouts:v,placer:P.none()})}))},js=[ze("node"),ze("root"),Fe("bubble"),Es(),Ke("overrides",{}),Ke("showAbove",!1),Pa("placement",(function(t,e,n){var r=Hs(t,0,e);return e.node.filter(iu).bind((function(o){var i=o.dom.getBoundingClientRect(),u=Vs(i.left,i.top,i.width,i.height),a=e.node.getOr(t.element);return Fs(u,r,e,n,a)}))}))],Us=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Ws=$n([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),qs=(Ws.before,Ws.on,Ws.after,function(t){return t.fold(b,b,b)}),$s=$n([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Gs={domRange:$s.domRange,relative:$s.relative,exact:$s.exact,exactFromRange:function(t){return $s.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return un.fromDom(t.startContainer)},relative:function(t,e){return qs(t)},exact:function(t,e,n,r){return t}})}(t);return zo(e)},range:Us},Ks=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},Xs=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Ys=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Js=$n([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Qs=function(t,e,n){return e(un.fromDom(n.startContainer),n.startOffset,un.fromDom(n.endContainer),n.endOffset)},Zs=function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return Js.rtl(un.fromDom(t.endContainer),t.endOffset,un.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Qs(0,Js.ltr,n)})):Qs(0,Js.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:v(t),rtl:P.none}},relative:function(e,n){return{ltr:$t((function(){return Ks(t,e,n)})),rtl:$t((function(){return P.some(Ks(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:$t((function(){return Xs(t,e,n,r,o)})),rtl:$t((function(){return P.some(Xs(t,r,o,e,n))}))}}})}(t,e))},tl=function(t,e){return Zs(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})};Js.ltr,Js.rtl;var el,nl,rl=function(t,e){var n=function(e){return t(e)?P.from(e.dom.nodeValue):P.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(Oo,"text"),ol=function(t){return rl.getOption(t)},il=["img","br"],ul=function(t){return ol(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||F(il,So(t))},al=function(t,e){var n=function(t){for(var r=Bo(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return P.some(i);var u=n(i);if(u.isSome())return u}return P.none()};return n(t)},cl=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return jn(n)?[]:q(n.querySelectorAll(t),un.fromDom)}(e,t)},sl=function(t,e,n,r){var o=function(t,e,n,r){var o=Do(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=Un(t,n)&&e===r;return o.collapsed&&!i},ll=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return P.some(Us(un.fromDom(e.startContainer),e.startOffset,un.fromDom(n.endContainer),n.endOffset))}return P.none()},fl=function(t){if(null===t.anchorNode||null===t.focusNode)return ll(t);var e=un.fromDom(t.anchorNode),n=un.fromDom(t.focusNode);return sl(e,t.anchorOffset,n,t.focusOffset)?P.some(Us(e,t.anchorOffset,n,t.focusOffset)):ll(t)},dl=function(t){return function(t){return P.from(t.getSelection())}(t).filter((function(t){return t.rangeCount>0})).bind(fl)},ml=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?P.some(n).map(Ys):P.none()}(tl(t,e))},gl=function(t,e){return function(t){var e=t.getBoundingClientRect();return e.width>0||e.height>0?P.some(e).map(Ys):P.none()}(tl(t,e))},hl=function(t,e){return{element:t,offset:e}},pl=function(t,e){var n=Bo(t);if(0===n.length)return hl(t,e);if(e<n.length)return hl(n[e],0);var r=n[n.length-1],o=Oo(r)?function(t){return rl.get(t)}(r).length:Bo(r).length;return hl(r,o)},vl=function(t,e){return Oo(t)?hl(t,e):pl(t,e)},bl=function(t,e){return e.getSelection.getOrThunk((function(){return function(){return dl(t)}}))().map((function(t){var e=vl(t.start,t.soffset),n=vl(t.finish,t.foffset);return Gs.range(e.element,e.offset,n.element,n.offset)}))},yl=[Fe("getSelection"),ze("root"),Fe("bubble"),Es(),Ke("overrides",{}),Ke("showAbove",!1),Pa("placement",(function(t,e,n){var r=zo(e.root).dom,o=Hs(t,0,e),i=bl(r,e).bind((function(t){return gl(r,Gs.exactFromRange(t)).orThunk((function(){var e=un.fromText("\ufeff");Go(t.start,e);var n=ml(r,Gs.exact(e,0,e,1));return Zo(e),n})).bind((function(t){return Vs(t.left,t.top,t.width,t.height)}))})),u=bl(r,e).bind((function(t){return To(t.start)?P.some(t.start):(e=t.start,Ro(e));var e})).getOr(t.element);return Fs(i,o,e,n,u)}))],wl="link-layout",xl=function(t){return t.x+t.width},Cl=function(t,e){return t.x-e.width},Sl=function(t,e){return t.y-e.height+t.height},kl=function(t){return t.y},Tl=function(t,e,n){return Ha(xl(t),kl(t),n.southeast(),Fa(),"southeast",Ja(t,{left:0,top:2}),wl)},Ol=function(t,e,n){return Ha(Cl(t,e),kl(t),n.southwest(),ja(),"southwest",Ja(t,{right:1,top:2}),wl)},_l=function(t,e,n){return Ha(xl(t),Sl(t,e),n.northeast(),Ua(),"northeast",Ja(t,{left:0,bottom:3}),wl)},El=function(t,e,n){return Ha(Cl(t,e),Sl(t,e),n.northwest(),Wa(),"northwest",Ja(t,{right:1,bottom:3}),wl)},Dl=function(){return[Tl,Ol,_l,El]},Al=function(){return[Ol,Tl,El,_l]},Ml=[ze("item"),Es(),Ke("overrides",{}),Pa("placement",(function(t,e,n){var r=Uc(n,e.item.element),o=Ds(t.element,e,Dl(),Al(),Dl(),Al(),P.none());return P.some(Ss({anchorBox:r,bubble:Cs(),overrides:e.overrides,layouts:o,placer:P.none()}))}))],zl=Ee("type",{selection:yl,node:js,hotspot:As,submenu:Ml,makeshift:Ms}),Rl=[Ve("classes",he),Qe("mode","all",["all","layout","placement"])],Nl=[Ke("useFixed",S),Fe("getBounds")],Bl=[Re("anchor",zl),Ge("transition",Rl)],Pl=function(t,e,n,r,o,i,u){return function(t,e,n,r,o,i,u,a){var c=bs(u,"maxHeightFunction",ps()),s=bs(u,"maxWidthFunction",h),l=t.anchorBox,f=t.origin,d={bounds:Wc(f,i),origin:f,preference:r,maxHeightFunction:c,maxWidthFunction:s,lastPlacement:o,transition:a};return ys(l,e,n,d)}(function(t,e){return function(t,e){return{anchorBox:t,origin:e}}(t,e)}(n.anchorBox,e),o.element,n.bubble,n.layouts,i,r,n.overrides,u)},Il=function(t,e,n,r,o,i){var u=i.map(ra);return Ll(t,e,n,r,o,u)},Ll=function(t,e,n,r,o,i){var u=Oe("placement.info",ae(Bl),o),a=u.anchor,c=r.element,s=n.get(r.uid);Ic((function(){lu(c,"position","fixed");var o=hu(c,"visibility");lu(c,"visibility","hidden");var l,f=e.useFixed()?(l=document.documentElement,Xc(0,0,l.clientWidth,l.clientHeight)):function(t){var e=Fu(t.element),n=t.element.dom.getBoundingClientRect();return Kc(e.left,e.top,n.width,n.height)}(t),d=a.placement,m=i.map(v).or(e.getBounds);d(t,a,f).each((function(e){var o=e.placer.getOr(Pl)(t,f,e,m,r,s,u.transition);n.set(r.uid,o)})),o.fold((function(){bu(c,"visibility")}),(function(t){lu(c,"visibility",t)})),hu(c,"left").isNone()&&hu(c,"top").isNone()&&hu(c,"right").isNone()&&hu(c,"bottom").isNone()&&tu(hu(c,"position"),"fixed")&&bu(c,"position")}),c)},Hl=Object.freeze({__proto__:null,position:function(t,e,n,r,o){Il(t,e,n,r,o,P.none())},positionWithin:Il,positionWithinBounds:Ll,getMode:function(t,e,n){return e.useFixed()?"fixed":"absolute"},reset:function(t,e,n,r){var o=r.element;$(["position","left","right","top","bottom"],(function(t){return bu(o,t)})),function(t){ci(t,Yc)}(o),n.clear(r.uid)}}),Vl=Object.freeze({__proto__:null,init:function(){var t={};return zi({readState:function(){return t},clear:function(e){f(e)?delete t[e]:t={}},set:function(e,n){t[e]=n},get:function(e){return Vt(t,e)}})}}),Fl=_c({fields:Nl,name:"positioning",active:zc,apis:Hl,state:Vl}),jl=function(t){Zr(t,Wr());var e=t.components();$(e,jl)},Ul=function(t){var e=t.components();$(e,Ul),Zr(t,Ur())},Wl=function(t,e){Yo(t.element,e.element)},ql=function(t,e){var n=t.components();!function(t){$(t.components(),(function(t){return Zo(t.element)})),Qo(t.element),t.syncComponents()}(t);var r=rt(n,e);$(r,(function(e){jl(e),t.getSystem().removeFromWorld(e)})),$(e,(function(e){e.getSystem().isConnected()?Wl(t,e):(t.getSystem().addToWorld(e),Wl(t,e),iu(t.element)&&Ul(e)),t.syncComponents()}))},$l=function(t,e){Gl(t,e,Yo)},Gl=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),iu(t.element)&&Ul(e),t.syncComponents()},Kl=function(t){jl(t),Zo(t.element),t.getSystem().removeFromWorld(t)},Xl=function(t){var e=Ro(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}));Kl(t),e.each((function(t){t.syncComponents()}))},Yl=function(t){var e=t.components();$(e,Kl),Qo(t.element),t.syncComponents()},Jl=function(t,e){Ql(t,e,Yo)},Ql=function(t,e,n){n(t,e.element);var r=Bo(e.element);$(r,(function(t){e.getByDom(t).each(Ul)}))},Zl=function(t){var e=Bo(t.element);$(e,(function(e){t.getByDom(e).each(jl)})),Zo(t.element)},tf=function(t,e,n,r){n.get().each((function(e){Yl(t)}));var o=e.getAttachPoint(t);$l(o,t);var i=t.getSystem().build(r);return $l(t,i),n.set(i),i},ef=function(t,e,n,r){var o=tf(t,e,n,r);return e.onOpen(t,o),o},nf=function(t,e,n){n.get().each((function(r){Yl(t),Xl(t),e.onClose(t,r),n.clear()}))},rf=function(t,e,n){return n.isOpen()},of=function(t,e,n){var r=e.getAttachPoint(t);lu(t.element,"position",Fl.getMode(r)),function(t,e,n,r){hu(t.element,e).fold((function(){ci(t.element,n)}),(function(e){oi(t.element,n,e)})),lu(t.element,e,r)}(t,"visibility",e.cloakVisibilityAttr,"hidden")},uf=function(t,e,n){var r;r=t.element,j(["top","left","right","bottom"],(function(t){return hu(r,t).isSome()}))||bu(t.element,"position"),function(t,e,n){ui(t.element,n).fold((function(){return bu(t.element,e)}),(function(n){return lu(t.element,e,n)}))}(t,"visibility",e.cloakVisibilityAttr)},af=Object.freeze({__proto__:null,cloak:of,decloak:uf,open:ef,openWhileCloaked:function(t,e,n,r,o){of(t,e),ef(t,e,n,r),o(),uf(t,e)},close:nf,isOpen:rf,isPartOf:function(t,e,n,r){return rf(0,0,n)&&n.get().exists((function(n){return e.isPartOf(t,n,r)}))},getState:function(t,e,n){return n.get()},setContent:function(t,e,n,r){return n.get().map((function(){return tf(t,e,n,r)}))}}),cf=Object.freeze({__proto__:null,events:function(t,e){return io([co(Pr(),(function(n,r){nf(n,t,e)}))])}}),sf=[za("onOpen"),za("onClose"),ze("isPartOf"),ze("getAttachPoint"),Ke("cloakVisibilityAttr","data-precloak-visibility")],lf=_c({fields:sf,name:"sandboxing",active:cf,apis:af,state:Object.freeze({__proto__:null,init:function(){var t=ns(),e=v("not-implemented");return zi({readState:e,isOpen:t.isSet,clear:t.clear,set:t.set,get:t.get})}})}),ff=v("dismiss.popups"),df=v("reposition.popups"),mf=v("mouse.released"),gf=ue([Ke("isExtraPart",S),Ge("fireEventInstead",[Ke("event",qr())])]),hf=function(t){var e,n=Oe("Dismissal",gf,t);return(e={})[ff()]={schema:ue([ze("target")]),onReceive:function(t,e){lf.isOpen(t)&&(lf.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold((function(){return lf.close(t)}),(function(e){return Zr(t,e.event)})))}},e},pf=ue([Ge("fireEventInstead",[Ke("event",$r())]),Ie("doReposition")]),vf=function(t){var e,n=Oe("Reposition",pf,t);return(e={})[df()]={onReceive:function(t){lf.isOpen(t)&&n.fireEventInstead.fold((function(){return n.doReposition(t)}),(function(e){return Zr(t,e.event)}))}},e},bf=function(t,e,n){e.store.manager.onLoad(t,e,n)},yf=function(t,e,n){e.store.manager.onUnload(t,e,n)},wf=Object.freeze({__proto__:null,onLoad:bf,onUnload:yf,setValue:function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),xf=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[vo((function(n,r){bf(n,t,e)})),bo((function(n,r){yf(n,t,e)}))]:[xc(t,e,bf)];return io(n)}}),Cf=function(){var t=rn(null);return zi({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},Sf=function(){var t=rn({}),e=rn({});return zi({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},lookup:function(n){return Vt(t.get(),n).orThunk((function(){return Vt(e.get(),n)}))},update:function(n){var r=t.get(),o=e.get(),i={},u={};$(n,(function(t){i[t.value]=t,Vt(t,"meta").each((function(e){Vt(e,"text").each((function(e){u[e]=t}))}))})),t.set(O(O({},r),i)),e.set(O(O({},o),u))},clear:function(){t.set({}),e.set({})}})},kf=Object.freeze({__proto__:null,memory:Cf,dataset:Sf,manual:function(){return zi({readState:h})},init:function(t){return t.store.manager.state(t)}}),Tf=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},Of=[Fe("initialValue"),ze("getFallbackEntry"),ze("getDataKey"),ze("setValue"),Pa("manager",{setValue:Tf,getValue:function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).getOrThunk((function(){return r.getFallbackEntry(o)}))},onLoad:function(t,e,n){e.store.initialValue.each((function(r){Tf(t,e,n,r)}))},onUnload:function(t,e,n){n.clear()},state:Sf})],_f=[ze("getValue"),Ke("setValue",h),Fe("initialValue"),Pa("manager",{setValue:function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(t,e,n){e.store.initialValue.each((function(n){e.store.setValue(t,n)}))},onUnload:h,state:Mi.init})],Ef=[Fe("initialValue"),Pa("manager",{setValue:function(t,e,n,r){n.set(r),e.onSetValue(t,r)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each((function(t){n.isNotSet()&&n.set(t)}))},onUnload:function(t,e,n){n.clear()},state:Cf})],Df=[Xe("store",{mode:"memory"},Ee("mode",{memory:Ef,manual:_f,dataset:Of})),za("onSetValue"),Ke("resetOnDom",!1)],Af=_c({fields:Df,name:"representing",active:xf,apis:wf,extra:{setValueFrom:function(t,e){var n=Af.getValue(e);Af.setValue(t,n)}},state:kf}),Mf=function(t,e){return nn(t,{},q(e,(function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,De(n,n,{tag:"option",process:{}},te((function(t){return St("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([Ae("dump",b)]))},zf=function(t){return t.dump},Rf=function(t,e){return O(O({},t.dump),Tc(e))},Nf=Mf,Bf=Rf,Pf="placeholder",If=$n([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Lf=function(t){return Ft(t,"uiType")},Hf=function(t,e,n,r){return Lf(n)&&n.uiType===Pf?function(t,e,n,r){return t.exists((function(t){return t!==n.owner}))?If.single(!0,v(n)):Vt(r,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+Mt(r)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(t){return t.replace()}))}(t,0,n,r):If.single(!1,v(n))},Vf=function(t,e,n,r){return Hf(t,0,n,r).fold((function(o,i){var u=Lf(n)?i(e,n.config,n.validated):i(e),a=Vt(u,"components").getOr([]),c=tt(a,(function(n){return Vf(t,e,n,r)}));return[O(O({},u),{components:c})]}),(function(t,r){if(Lf(n)){var o=r(e,n.config,n.validated);return n.validated.preprocess.getOr(b)(o)}return r(e)}))},Ff=function(t,e,n,r){var o=Nt(r,(function(t,e){return r=t,o=!1,{name:v(n=e),required:function(){return r.fold((function(t,e){return t}),(function(t,e){return t}))},used:function(){return o},replace:function(){if(o)throw new Error("Trying to use the same placeholder more than once: "+n);return o=!0,r}};var n,r,o})),i=function(t,e,n,r){return tt(n,(function(n){return Vf(t,e,n,r)}))}(t,e,n,o);return Rt(o,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))})),i},jf=If.single,Uf=If.multiple,Wf=v(Pf),qf=$n([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),$f=Ke("factory",{sketch:b}),Gf=Ke("schema",[]),Kf=ze("name"),Xf=De("pname","pname",Gt((function(t){return"<alloy."+hi(t.name)+">"})),de()),Yf=Ae("schema",(function(){return[Fe("preprocess")]})),Jf=Ke("defaults",v({})),Qf=Ke("overrides",v({})),Zf=ae([$f,Gf,Kf,Xf,Jf,Qf]),td=ae([$f,Gf,Kf,Jf,Qf]),ed=ae([$f,Gf,Kf,Xf,Jf,Qf]),nd=ae([$f,Yf,Kf,ze("unit"),Xf,Jf,Qf]),rd=function(t){return t.fold(P.some,P.none,P.some,P.some)},od=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},id=function(t,e){return function(n){var r=Oe("Converting part type",e,n);return t(r)}},ud=id(qf.required,Zf),ad=id(qf.external,td),cd=id(qf.optional,ed),sd=id(qf.group,nd),ld=v("entirety"),fd=Object.freeze({__proto__:null,required:ud,external:ad,optional:cd,group:sd,asNamedPart:rd,name:od,asCommon:function(t){return t.fold(b,b,b,b)},original:ld}),dd=function(t,e,n,r){return Wt(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},md=function(t,e){var n={};return $(e,(function(e){rd(e).each((function(e){var r=gd(t,e.pname);n[e.name]=function(n){var o=Oe("Part: "+e.name+" in "+t,ae(e.schema),n);return O(O({},r),{config:n,validated:o})}}))})),n},gd=function(t,e){return{uiType:Wf(),owner:t,name:e}},hd=function(t,e,n){return{uiType:Wf(),owner:t,name:e,config:n,validated:{}}},pd=function(t){return tt(t,(function(t){return t.fold(P.none,P.some,P.none,P.none).map((function(t){return Le(t.name,t.schema.concat([Ia(ld())]))})).toArray()}))},vd=function(t){return q(t,od)},bd=function(t,e,n){return function(t,e,n){var r={},o={};return $(n,(function(t){t.fold((function(t){r[t.pname]=jf(!0,(function(e,n,r){return t.factory.sketch(dd(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=v(t.factory.sketch(dd(e,t,n[ld()]),n))}),(function(t){r[t.pname]=jf(!1,(function(e,n,r){return t.factory.sketch(dd(e,t,n,r))}))}),(function(t){r[t.pname]=Uf(!0,(function(e,n,r){var o=e[t.name];return q(o,(function(n){return t.factory.sketch(Wt(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:v(r),externals:v(o)}}(0,e,n)},yd=function(t,e,n){return Ff(P.some(t),e,e.components,n)},wd=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},xd=function(t,e,n){return wd(t,e,n).getOrDie("Could not find part: "+n)},Cd=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return $(n,(function(t){r[t]=v(i.getByUid(o[t]))})),r},Sd=function(t,e){var n=t.getSystem();return Nt(e.partUids,(function(t,e){return v(n.getByUid(t))}))},kd=function(t){return Mt(t.partUids)},Td=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return $(n,(function(t){r[t]=v(i.getByUid(o[t]).getOrDie())})),r},Od=function(t,e){var n=vd(e);return Yn(q(n,(function(e){return{key:e,value:t+"-"+e}})))},_d=function(t){return De("partUids","partUids",Xt((function(e){return Od(e.uid,t)})),de())},Ed=Object.freeze({__proto__:null,generate:md,generateOne:hd,schemas:pd,names:vd,substitutes:bd,components:yd,defaultUids:Od,defaultUidsSchema:_d,getAllParts:Sd,getAllPartNames:kd,getPart:wd,getPartOrDie:xd,getParts:Cd,getPartsOrDie:Td}),Dd=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[Le("parts",t)]:[]).concat([ze("uid"),Ke("dom",{}),Ke("components",[]),Ia("originalSpec"),Ke("debug.sketcher",{})]).concat(e)}(r,o);return Oe(t+" [SpecSchema]",ue(i.concat(e)),n)},Ad=function(t,e,n,r,o){var i=Md(o),u=pd(n),a=_d(n),c=Dd(t,e,i,u,[a]),s=bd(0,c,n);return r(c,yd(t,c,s.internals()),i,s.externals())},Md=function(t){return function(t){return Ft(t,"uid")}(t)?t:O(O({},t),{uid:Ci("uid")})},zd=ue([ze("name"),ze("factory"),ze("configFields"),Ke("apis",{}),Ke("extraApis",{})]),Rd=ue([ze("name"),ze("factory"),ze("configFields"),ze("partFields"),Ke("apis",{}),Ke("extraApis",{})]),Nd=function(t){var e=Oe("Sketcher for "+t.name,zd,t),n=Nt(e.apis,Ai),r=Nt(e.extraApis,(function(t,e){return _i(t,e)}));return O(O({name:e.name,configFields:e.configFields,sketch:function(t){return function(t,e,n,r){var o=Md(r);return n(Dd(t,e,o,[],[]),o)}(e.name,e.configFields,e.factory,t)}},n),r)},Bd=function(t){var e=Oe("Sketcher for "+t.name,Rd,t),n=md(e.name,e.partFields),r=Nt(e.apis,Ai),o=Nt(e.extraApis,(function(t,e){return _i(t,e)}));return O(O({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:function(t){return Ad(e.name,e.configFields,e.partFields,e.factory,t)},parts:n},r),o)},Pd=function(t){return"input"===So(t)&&"radio"!==ii(t,"type")||"textarea"===So(t)},Id=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),Ld=[ze("find")],Hd=_c({fields:Ld,name:"composing",apis:Id}),Vd=["input","button","textarea","select"],Fd=function(t,e,n){(e.disabled()?Gd:Kd)(t,e)},jd=function(t,e){return!0===e.useNative&&F(Vd,So(t.element))},Ud=function(t){oi(t.element,"disabled","disabled")},Wd=function(t){ci(t.element,"disabled")},qd=function(t){oi(t.element,"aria-disabled","true")},$d=function(t){oi(t.element,"aria-disabled","false")},Gd=function(t,e,n){e.disableClass.each((function(e){Ki(t.element,e)})),(jd(t,e)?Ud:qd)(t),e.onDisabled(t)},Kd=function(t,e,n){e.disableClass.each((function(e){Yi(t.element,e)})),(jd(t,e)?Wd:$d)(t),e.onEnabled(t)},Xd=function(t,e){return jd(t,e)?function(t){return ai(t.element,"disabled")}(t):function(t){return"true"===ii(t.element,"aria-disabled")}(t)},Yd=Object.freeze({__proto__:null,enable:Kd,disable:Gd,isDisabled:Xd,onLoad:Fd,set:function(t,e,n,r){(r?Gd:Kd)(t,e)}}),Jd=Object.freeze({__proto__:null,exhibit:function(t,e){return Ni({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return io([uo(zr(),(function(e,n){return Xd(e,t)})),xc(t,e,Fd)])}}),Qd=[tn("disabled",S),Ke("useNative",!0),Fe("disableClass"),za("onDisabled"),za("onEnabled")],Zd=_c({fields:Qd,name:"disabling",active:Jd,apis:Yd}),tm=function(t,e,n,r){var o=cl(t.element,"."+e.highlightClass);$(o,(function(n){j(r,(function(t){return t.element===n}))||(Yi(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),Zr(n,Qr())})))}))},em=function(t,e,n,r){tm(t,e,0,[r]),nm(t,e,n,r)||(Ki(r.element,e.highlightClass),e.onHighlight(t,r),Zr(r,Jr()))},nm=function(t,e,n,r){return Ji(r.element,e.highlightClass)},rm=function(t,e,n,r){var o=cl(t.element,"."+e.itemClass);return P.from(o[r]).fold((function(){return gt.error(new Error("No element found with index "+r))}),t.getSystem().getByDom)},om=function(t,e,n){return ga(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},im=function(t,e,n){var r=cl(t.element,"."+e.itemClass);return(r.length>0?P.some(r[r.length-1]):P.none()).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},um=function(t,e,n,r){var o=cl(t.element,"."+e.itemClass);return Q(o,(function(t){return Ji(t,e.highlightClass)})).bind((function(e){var n=Xa(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},am=function(t,e,n){var r=cl(t.element,"."+e.itemClass);return eu(q(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},cm=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return tm(t,e,0,[])},dehighlight:function(t,e,n,r){nm(t,e,n,r)&&(Yi(r.element,e.highlightClass),e.onDehighlight(t,r),Zr(r,Qr()))},highlight:em,highlightFirst:function(t,e,n){om(t,e).each((function(r){em(t,e,n,r)}))},highlightLast:function(t,e,n){im(t,e).each((function(r){em(t,e,n,r)}))},highlightAt:function(t,e,n,r){rm(t,e,n,r).fold((function(t){throw t}),(function(r){em(t,e,n,r)}))},highlightBy:function(t,e,n,r){var o=am(t,e);J(o,r).each((function(r){em(t,e,n,r)}))},isHighlighted:nm,getHighlighted:function(t,e,n){return ga(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},getFirst:om,getLast:im,getPrevious:function(t,e,n){return um(t,e,0,-1)},getNext:function(t,e,n){return um(t,e,0,1)},getCandidates:am}),sm=[ze("highlightClass"),ze("itemClass"),za("onHighlight"),za("onDehighlight")],lm=_c({fields:sm,name:"highlighting",apis:cm}),fm=[8],dm=[9],mm=[13],gm=[27],hm=[32],pm=[37],vm=[38],bm=[39],ym=[40],wm=function(t,e,n){var r=nt(t.slice(0,e)),o=nt(t.slice(e+1));return J(r.concat(o),n)},xm=function(t,e,n){var r=nt(t.slice(0,e));return J(r,n)},Cm=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return J(o.concat(r),n)},Sm=function(t,e,n){var r=t.slice(e+1);return J(r,n)},km=function(t){return function(e){var n=e.raw;return F(t,n.which)}},Tm=function(t){return function(e){return et(t,(function(t){return t(e)}))}},Om=function(t){return!0===t.raw.shiftKey},_m=function(t){return!0===t.raw.ctrlKey},Em=x(Om),Dm=function(t,e){return{matches:t,classification:e}},Am=function(t,e,n){e.exists((function(t){return n.exists((function(e){return Un(e,t)}))}))||to(t,Gr(),{prevFocus:e,newFocus:n})},Mm=function(){var t=function(t){return Pc(t.element)};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);Am(e,r,o)}}},zm=function(){var t=function(t){return lm.getHighlighted(t).map((function(t){return t.element}))};return{get:t,set:function(e,n){var r=t(e);e.getSystem().getByDom(n).fold(h,(function(t){lm.highlight(e,t)}));var o=t(e);Am(e,r,o)}}};(nl=el||(el={})).OnFocusMode="onFocus",nl.OnEnterOrSpaceMode="onEnterOrSpace",nl.OnApiMode="onApi";var Rm,Nm=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,u,a=n(t,e,r,o);return(i=a,u=e.event,J(i,(function(t){return t.matches(u)})).map((function(t){return t.classification}))).bind((function(n){return n(t,e,r,o)}))},u={schema:function(){return t.concat([Ke("focusManager",Mm()),Xe("focusInside","onFocus",Ce((function(t){return F(["onFocus","onEnterOrSpace","onApi"],t)?gt.value(t):gt.error("Invalid value for focusInside")}))),Pa("handler",u),Pa("state",e),Pa("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var u=t.focusInside!==el.OnFocusMode?P.none():o(t).map((function(n){return co(Er(),(function(r,o){n(r,t,e),o.stop()}))})),a=[co(vr(),(function(r,u){i(r,u,n,t,e).fold((function(){!function(n,r){var i=km(hm.concat(mm))(r.event);t.focusInside===el.OnEnterOrSpaceMode&&i&&er(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))}(r,u)}),(function(t){u.stop()}))})),co(br(),(function(n,o){i(n,o,r,t,e).each((function(t){o.stop()}))}))];return io(u.toArray().concat(a))}};return u},Bm=function(t){var e=[Fe("onEscape"),Fe("onEnter"),Ke("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Ke("firstTabstop",0),Ke("useTabstopAt",k),Fe("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return ha(e,t)})).getOr(e);return Pu(n)>0},r=function(t,e,r){(function(t,e){var r=cl(t.element,e.selector),o=K(r,(function(t){return n(e,t)}));return P.from(o[e.firstTabstop])})(t,e).each((function(n){e.focusManager.set(t,n)}))},o=function(t,e,r,o,i){return i(e,r,(function(t){return function(t,e){return n(t,e)&&t.useTabstopAt(e)}(o,t)})).fold((function(){return o.cyclic?P.some(!0):P.none()}),(function(e){return o.focusManager.set(t,e),P.some(!0)}))},i=function(t,e,n,r){var i=cl(t.element,n.selector);return function(t,e){return e.focusManager.get(t).bind((function(t){return ha(t,e.selector)}))}(t,n).bind((function(e){return Q(i,w(Un,e)).bind((function(e){return o(t,i,e,n,r)}))}))},u=v([Dm(Tm([Om,km(dm)]),(function(t,e,n){var r=n.cyclic?wm:xm;return i(t,0,n,r)})),Dm(km(dm),(function(t,e,n){var r=n.cyclic?Cm:Sm;return i(t,0,n,r)})),Dm(km(gm),(function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))})),Dm(Tm([Em,km(mm)]),(function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))}))]),a=v([]);return Nm(e,Mi.init,u,a,(function(){return P.some(r)}))},Pm=Bm(Ae("cyclic",S)),Im=Bm(Ae("cyclic",k)),Lm=function(t,e,n){return Pd(n)&&km(hm)(e.event)?P.none():function(t,e,n){return no(t,n,zr()),P.some(!0)}(t,0,n)},Hm=function(t,e){return P.some(!0)},Vm=[Ke("execute",Lm),Ke("useSpace",!1),Ke("useEnter",!0),Ke("useControlEnter",!1),Ke("useDown",!1)],Fm=function(t,e,n){return n.execute(t,e,t.element)},jm=Nm(Vm,Mi.init,(function(t,e,n,r){var o=n.useSpace&&!Pd(t.element)?hm:[],i=n.useEnter?mm:[],u=n.useDown?ym:[],a=o.concat(i).concat(u);return[Dm(km(a),Fm)].concat(n.useControlEnter?[Dm(Tm([_m,km(mm)]),Fm)]:[])}),(function(t,e,n,r){return n.useSpace&&!Pd(t.element)?[Dm(km(hm),Hm)]:[]}),(function(){return P.none()})),Um=function(){var t=ns();return zi({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set({numRows:e,numColumns:n})},getNumRows:function(){return t.get().map((function(t){return t.numRows}))},getNumColumns:function(){return t.get().map((function(t){return t.numColumns}))}})},Wm=Object.freeze({__proto__:null,flatgrid:Um,init:function(t){return t.state(t)}}),qm=function(t){return function(e,n,r,o){var i=t(e.element);return Xm(i,e,n,r,o)}},$m=function(t,e){var n=ks(t,e);return qm(n)},Gm=function(t,e){var n=ks(e,t);return qm(n)},Km=function(t){return function(e,n,r,o){return Xm(t,e,n,r,o)}},Xm=function(t,e,n,r,o){return r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)})).map((function(t){return r.focusManager.set(e,t),!0}))},Ym=Km,Jm=Km,Qm=Km,Zm=function(t){return!((e=t.dom).offsetWidth<=0&&e.offsetHeight<=0);var e},tg=function(t,e,n){var r=cl(t,n);return function(t,e){return Q(t,e).map((function(e){return{index:e,candidates:t}}))}(K(r,Zm),(function(t){return Un(t,e)}))},eg=function(t,e){return Q(t,(function(t){return Un(e,t)}))},ng=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind((function(e){var r=e.row*n+e.column;return r>=0&&r<t.length?P.some(t[r]):P.none()}))},rg=function(t,e,n,r,o){return ng(t,e,r,(function(e,i){var u=e===n-1?t.length-e*r:r,a=Xa(i,o,0,u-1);return P.some({row:e,column:a})}))},og=function(t,e,n,r,o){return ng(t,e,r,(function(e,i){var u=Xa(e,o,0,n-1),a=u===n-1?t.length-u*r:r,c=Ya(i,0,a-1);return P.some({row:u,column:c})}))},ig=[ze("selector"),Ke("execute",Lm),Ra("onEscape"),Ke("captureTab",!1),La()],ug=function(t,e,n){ga(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},ag=function(t){return function(e,n,r,o){return tg(e,n,r.selector).bind((function(e){return t(e.candidates,e.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},cg=function(t,e,n){return n.captureTab?P.some(!0):P.none()},sg=ag((function(t,e,n,r){return rg(t,e,n,r,-1)})),lg=ag((function(t,e,n,r){return rg(t,e,n,r,1)})),fg=ag((function(t,e,n,r){return og(t,e,n,r,-1)})),dg=ag((function(t,e,n,r){return og(t,e,n,r,1)})),mg=v([Dm(km(pm),$m(sg,lg)),Dm(km(bm),Gm(sg,lg)),Dm(km(vm),Ym(fg)),Dm(km(ym),Jm(dg)),Dm(Tm([Om,km(dm)]),cg),Dm(Tm([Em,km(dm)]),cg),Dm(km(gm),(function(t,e,n){return n.onEscape(t,e)})),Dm(km(hm.concat(mm)),(function(t,e,n,r){return function(t,e){return e.focusManager.get(t).bind((function(t){return ha(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))}))]),gg=v([Dm(km(hm),Hm)]),hg=Nm(ig,Um,mg,gg,(function(){return P.some(ug)})),pg=function(t,e,n,r){var o=function(t,e,n){var i,u=Xa(e,r,0,n.length-1);return u===t?P.none():(i=n[u],"button"===So(i)&&"disabled"===ii(i,"disabled")?o(t,u,n):P.from(n[u]))};return tg(t,n,e).bind((function(t){var e=t.index,n=t.candidates;return o(e,e,n)}))},vg=[ze("selector"),Ke("getInitial",P.none),Ke("execute",Lm),Ra("onEscape"),Ke("executeOnMove",!1),Ke("allowVertical",!0)],bg=function(t,e,n){return function(t,e){return e.focusManager.get(t).bind((function(t){return ha(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))},yg=function(t,e,n){e.getInitial(t).orThunk((function(){return ga(t.element,e.selector)})).each((function(n){e.focusManager.set(t,n)}))},wg=function(t,e,n){return pg(t,n.selector,e,-1)},xg=function(t,e,n){return pg(t,n.selector,e,1)},Cg=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?bg(e,n,r):P.some(!0)}))}},Sg=function(t,e,n){return n.onEscape(t,e)},kg=v([Dm(km(hm),Hm)]),Tg=Nm(vg,Mi.init,(function(t,e,n,r){var o=pm.concat(n.allowVertical?vm:[]),i=bm.concat(n.allowVertical?ym:[]);return[Dm(km(o),Cg($m(wg,xg))),Dm(km(i),Cg(Gm(wg,xg))),Dm(km(mm),bg),Dm(km(hm),bg),Dm(km(gm),Sg)]}),kg,(function(){return P.some(yg)})),Og=function(t,e,n){return P.from(t[e]).bind((function(t){return P.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},_g=function(t,e,n,r){var o=t[e].length,i=Xa(n,r,0,o-1);return Og(t,e,i)},Eg=function(t,e,n,r){var o=Xa(n,r,0,t.length-1),i=t[o].length,u=Ya(e,0,i-1);return Og(t,o,u)},Dg=function(t,e,n,r){var o=t[e].length,i=Ya(n+r,0,o-1);return Og(t,e,i)},Ag=function(t,e,n,r){var o=Ya(n+r,0,t.length-1),i=t[o].length,u=Ya(e,0,i-1);return Og(t,o,u)},Mg=[Le("selectors",[ze("row"),ze("cell")]),Ke("cycles",!0),Ke("previousSelector",P.none),Ke("execute",Lm)],zg=function(t,e,n){e.previousSelector(t).orThunk((function(){var n=e.selectors;return ga(t.element,n.cell)})).each((function(n){e.focusManager.set(t,n)}))},Rg=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return ha(r,o.selectors.row).bind((function(t){var e=cl(t,o.selectors.cell);return eg(e,r).bind((function(e){var r=cl(n,o.selectors.row);return eg(r,t).bind((function(t){var n=function(t,e){return q(t,(function(t){return cl(t,e.selectors.cell)}))}(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},Ng=Rg((function(t,e,n){return _g(t,e,n,-1)}),(function(t,e,n){return Dg(t,e,n,-1)})),Bg=Rg((function(t,e,n){return _g(t,e,n,1)}),(function(t,e,n){return Dg(t,e,n,1)})),Pg=Rg((function(t,e,n){return Eg(t,n,e,-1)}),(function(t,e,n){return Ag(t,n,e,-1)})),Ig=Rg((function(t,e,n){return Eg(t,n,e,1)}),(function(t,e,n){return Ag(t,n,e,1)})),Lg=v([Dm(km(pm),$m(Ng,Bg)),Dm(km(bm),Gm(Ng,Bg)),Dm(km(vm),Ym(Pg)),Dm(km(ym),Jm(Ig)),Dm(km(hm.concat(mm)),(function(t,e,n){return Pc(t.element).bind((function(r){return n.execute(t,e,r)}))}))]),Hg=v([Dm(km(hm),Hm)]),Vg=Nm(Mg,Mi.init,Lg,Hg,(function(){return P.some(zg)})),Fg=[ze("selector"),Ke("execute",Lm),Ke("moveOnTab",!1)],jg=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},Ug=function(t,e,n){ga(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},Wg=function(t,e,n){return pg(t,n.selector,e,-1)},qg=function(t,e,n){return pg(t,n.selector,e,1)},$g=v([Dm(km(vm),Qm(Wg)),Dm(km(ym),Qm(qg)),Dm(Tm([Om,km(dm)]),(function(t,e,n,r){return n.moveOnTab?Qm(Wg)(t,e,n,r):P.none()})),Dm(Tm([Em,km(dm)]),(function(t,e,n,r){return n.moveOnTab?Qm(qg)(t,e,n,r):P.none()})),Dm(km(mm),jg),Dm(km(hm),jg)]),Gg=v([Dm(km(hm),Hm)]),Kg=Nm(Fg,Mi.init,$g,Gg,(function(){return P.some(Ug)})),Xg=[Ra("onSpace"),Ra("onEnter"),Ra("onShiftEnter"),Ra("onLeft"),Ra("onRight"),Ra("onTab"),Ra("onShiftTab"),Ra("onUp"),Ra("onDown"),Ra("onEscape"),Ke("stopSpaceKeyup",!1),Fe("focusIn")],Yg=Nm(Xg,Mi.init,(function(t,e,n){return[Dm(km(hm),n.onSpace),Dm(Tm([Em,km(mm)]),n.onEnter),Dm(Tm([Om,km(mm)]),n.onShiftEnter),Dm(Tm([Om,km(dm)]),n.onShiftTab),Dm(Tm([Em,km(dm)]),n.onTab),Dm(km(vm),n.onUp),Dm(km(ym),n.onDown),Dm(km(pm),n.onLeft),Dm(km(bm),n.onRight),Dm(km(hm),n.onSpace),Dm(km(gm),n.onEscape)]}),(function(t,e,n){return n.stopSpaceKeyup?[Dm(km(hm),Hm)]:[]}),(function(t){return t.focusIn})),Jg=Pm.schema(),Qg=Im.schema(),Zg=Tg.schema(),th=hg.schema(),eh=Vg.schema(),nh=jm.schema(),rh=Kg.schema(),oh=Yg.schema(),ih=Dc({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Jg,cyclic:Qg,flow:Zg,flatgrid:th,matrix:eh,execution:nh,menu:rh,special:oh}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold((function(){t.getSystem().triggerFocus(t.element,t.element)}),(function(r){r(t,e,n)}))},setGridSize:function(t,e,n,r,o){!function(t){return jt(t,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:Wm}),uh=function(t,e,n,r){var o=t.getSystem().build(r);Gl(t,o,n)},ah=function(t,e,n,r){var o=ch(t);J(o,(function(t){return Un(r.element,t.element)})).each(Xl)},ch=function(t,e){return t.components()},sh=function(t,e,n,r,o){var i=ch(t);return P.from(i[r]).map((function(e){return ah(t,0,0,e),o.each((function(e){uh(t,0,(function(t,e){var n,o;o=e,Po(n=t,r).fold((function(){Yo(n,o)}),(function(t){Go(t,o)}))}),e)})),e}))},lh=_c({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,e,n,r){uh(t,0,Yo,r)},prepend:function(t,e,n,r){uh(t,0,Xo,r)},remove:ah,replaceAt:sh,replaceBy:function(t,e,n,r,o){var i=ch(t);return Q(i,r).bind((function(e){return sh(t,0,0,e,o)}))},set:function(t,e,n,r){Ic((function(){var e=q(r,t.getSystem().build);ql(t,e)}),t.element)},contents:ch})}),fh=function(t,e){return{key:t,value:{config:{},me:function(t,e){var n=io(e);return _c({fields:[ze("enabled")],name:t,active:{events:v(n)}})}(t,e),configAsRaw:v({}),initialConfig:{},state:Mi}}},dh=function(t,e){e.ignore||(Rc(t.element),e.onFocus(t))},mh=Object.freeze({__proto__:null,focus:dh,blur:function(t,e){e.ignore||t.element.dom.blur()},isFocused:function(t){return Nc(t.element)}}),gh=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return Ni(n)},events:function(t){return io([co(Er(),(function(e,n){dh(e,t),n.stop()}))].concat(t.stopMousedown?[co(lr(),(function(t,e){e.event.prevent()}))]:[]))}}),hh=[za("onFocus"),Ke("stopMousedown",!1),Ke("ignore",!1)],ph=_c({fields:hh,name:"focusing",active:gh,apis:mh}),vh=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},bh=function(t,e,n){e.toggleClass.each((function(e){n.get()?Ki(t.element,e):Yi(t.element,e)}))},yh=function(t,e,n){Ch(t,e,n,!n.get())},wh=function(t,e,n){n.set(!0),bh(t,e,n),vh(t,e,n)},xh=function(t,e,n){n.set(!1),bh(t,e,n),vh(t,e,n)},Ch=function(t,e,n,r){(r?wh:xh)(t,e,n)},Sh=function(t,e,n){Ch(t,e,n,e.selected)},kh=Object.freeze({__proto__:null,onLoad:Sh,toggle:yh,isOn:function(t,e,n){return n.get()},on:wh,off:xh,set:Ch}),Th=Object.freeze({__proto__:null,exhibit:function(){return Ni({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=yh,wo((function(t){o(t,n,r)}))),u=xc(t,e,Sh);return io(Z([t.toggleOnExecute?[i]:[],[u]]))}}),Oh=function(t,e,n){oi(t.element,"aria-expanded",n)},_h=[Ke("selected",!1),Fe("toggleClass"),Ke("toggleOnExecute",!0),Xe("aria",{mode:"none"},Ee("mode",{pressed:[Ke("syncWithExpanded",!1),Pa("update",(function(t,e,n){oi(t.element,"aria-pressed",n),e.syncWithExpanded&&Oh(t,e,n)}))],checked:[Pa("update",(function(t,e,n){oi(t.element,"aria-checked",n)}))],expanded:[Pa("update",Oh)],selected:[Pa("update",(function(t,e,n){oi(t.element,"aria-selected",n)}))],none:[Pa("update",h)]}))],Eh=_c({fields:_h,name:"toggling",active:Th,apis:kh,state:(Rm=!1,{init:function(){var t=rn(Rm);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(Rm)},readState:function(){return t.get()}}}})}),Dh=function(){var t=function(t,e){e.stop(),eo(t)};return[co(xr(),t),co(Nr(),t),go(ur()),go(lr())]},Ah=function(t){return io(Z([t.map((function(t){return wo((function(e,n){t(e),n.stop()}))})).toArray(),Dh()]))},Mh="alloy.item-hover",zh="alloy.item-focus",Rh=function(t){(Pc(t.element).isNone()||ph.isFocused(t))&&(ph.isFocused(t)||ph.focus(t),to(t,Mh,{item:t}))},Nh=function(t){to(t,zh,{item:t})},Bh=v(Mh),Ph=v(zh),Ih=[ze("data"),ze("components"),ze("dom"),Ke("hasSubmenu",!1),Fe("toggling"),Nf("itemBehaviours",[Eh,ph,ih,Af]),Ke("ignoreFocus",!1),Ke("domModification",{}),Pa("builder",(function(t){return{dom:t.dom,domModification:O(O({},t.domModification),{attributes:O(O(O({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Bf(t.itemBehaviours,[t.toggling.fold(Eh.revoke,(function(t){return Eh.config(O({aria:{mode:"checked"}},t))})),ph.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Nh(t)}}),ih.config({mode:"execution"}),Af.config({store:{mode:"memory",initialValue:t.data}}),fh("item-type-events",E(E([],Dh()),[co(gr(),Rh),co(Rr(),ph.focus)]))]),components:t.components,eventOrder:t.eventOrder}})),Ke("eventOrder",{})],Lh=[ze("dom"),ze("components"),Pa("builder",(function(t){return{dom:t.dom,components:t.components,events:io([ho(Rr())])}}))],Hh=v("item-widget"),Vh=v([ud({name:"widget",overrides:function(t){return{behaviours:Tc([Af.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:h}})])}}})]),Fh=[ze("uid"),ze("data"),ze("components"),ze("dom"),Ke("autofocus",!1),Ke("ignoreFocus",!1),Nf("widgetBehaviours",[Af,ph,ih]),Ke("domModification",{}),_d(Vh()),Pa("builder",(function(t){var e=bd(Hh(),t,Vh()),n=yd(Hh(),t,e.internals()),r=function(e){return wd(e,t,"widget").map((function(t){return ih.focusIn(t),t}))},o=function(e,n){return Pd(n.event.target)?P.none():t.autofocus?(n.setSource(e.element),P.none()):P.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:io([wo((function(t,e){r(t).each((function(t){e.stop()}))})),co(gr(),Rh),co(Rr(),(function(e,n){t.autofocus?r(e):ph.focus(e)}))]),behaviours:Bf(t.widgetBehaviours,[Af.config({store:{mode:"memory",initialValue:t.data}}),ph.config({ignore:t.ignoreFocus,onFocus:function(t){Nh(t)}}),ih.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:Ac(),onLeft:o,onRight:o,onEscape:function(e,n){return ph.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element),P.none()):P.none():(ph.focus(e),P.some(!0))}})])}}))],jh=Ee("type",{widget:Fh,item:Ih,separator:Lh}),Uh=v([sd({factory:{sketch:function(t){var e=Oe("menu.spec item",jh,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return Ft(e,"uid")?e:O(O({},e),{uid:Ci("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Wh=v([ze("value"),ze("items"),ze("dom"),ze("components"),Ke("eventOrder",{}),Mf("menuBehaviours",[lm,Af,Hd,ih]),Xe("movement",{mode:"menu",moveOnTab:!0},Ee("mode",{grid:[La(),Pa("config",(function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}}))],matrix:[Pa("config",(function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}})),ze("rowSelector")],menu:[Ke("moveOnTab",!0),Pa("config",(function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}}))]})),Re("markers",_a()),Ke("fakeFocus",!1),Ke("focusManager",Mm()),za("onHighlight")]),qh=v("alloy.menu-focus"),$h=Bd({name:"Menu",configFields:Wh(),partFields:Uh(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Rf(t.menuBehaviours,[lm.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),Af.config({store:{mode:"memory",initialValue:t.value}}),Hd.config({find:P.some}),ih.config(t.movement.config(t,t.movement))]),events:io([co(Ph(),(function(t,e){var n=e.event;t.getSystem().getByDom(n.target).each((function(n){lm.highlight(t,n),e.stop(),to(t,qh(),{menu:t,item:n})}))})),co(Bh(),(function(t,e){var n=e.event.item;lm.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Gh=function(t,e,n,r){return Vt(n,r).bind((function(r){return Vt(t,r).bind((function(r){var o=Gh(t,e,n,r);return P.some([r].concat(o))}))})).getOr([])},Kh=function(t,e){var n={};Rt(t,(function(t,e){$(t,(function(t){n[t]=e}))}));var r=e,o=Bt(e,(function(t,e){return{k:t,v:e}})),i=Nt(o,(function(t,e){return[e].concat(Gh(n,r,o,e))}));return Nt(n,(function(t){return Vt(i,t).getOr([t])}))},Xh=function(t){return"prepared"===t.type?P.some(t.menu):P.none()},Yh={init:function(){var t=rn({}),e=rn({}),n=rn({}),r=ns(),o=rn({}),i=function(e,n,r){return u(e).bind((function(o){return function(e){return Lt(t.get(),(function(t,n){return t===e}))}(e).bind((function(t){return n(t).map((function(t){return{triggeredMenu:o,triggeringItem:t,triggeringPath:r}}))}))}))},u=function(t){return a(t).bind(Xh)},a=function(t){return Vt(e.get(),t)},c=function(e){return Vt(t.get(),e)};return{setMenuBuilt:function(t,n){var r;e.set(O(O({},e.get()),((r={})[t]={type:"prepared",menu:n},r)))},setContents:function(i,u,a,c){r.set(i),t.set(a),e.set(u),o.set(c);var s=Kh(c,a);n.set(s)},expand:function(e){return Vt(t.get(),e).map((function(t){var r=Vt(n.get(),e).getOr([]);return[t].concat(r)}))},refresh:function(t){return Vt(n.get(),t)},collapse:function(t){return Vt(n.get(),t).bind((function(t){return t.length>1?P.some(t.slice(1)):P.none()}))},lookupMenu:a,lookupItem:c,otherMenus:function(t){var e=o.get();return rt(Mt(e),t)},getPrimary:function(){return r.get().bind(u)},getMenus:function(){return e.get()},clear:function(){t.set({}),e.set({}),n.set({}),r.clear()},isClear:function(){return r.get().isNone()},getTriggeringPath:function(t,e){var o=K(c(t).toArray(),(function(t){return u(t).isSome()}));return Vt(n.get(),t).bind((function(t){var n=nt(o.concat(t));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return P.none();e.push(r.getOrDie())}return P.some(e)}(tt(n,(function(t,o){return i(t,e,n.slice(0,o+1)).fold((function(){return tu(r.get(),t)?[]:[P.none()]}),(function(t){return[P.some(t)]}))})))}))}}},extractPreparedMenu:Xh},Jh=v("collapse-item"),Qh=Nd({name:"TieredMenu",configFields:[Ba("onExecute"),Ba("onEscape"),Na("onOpenMenu"),Na("onOpenSubmenu"),za("onRepositionMenu"),za("onCollapseMenu"),Ke("highlightImmediately",!0),Le("data",[ze("primary"),ze("menus"),ze("expansions")]),Ke("fakeFocus",!1),za("onHighlight"),za("onHover"),Da(),ze("dom"),Ke("navigateOnHover",!0),Ke("stayInDom",!1),Mf("tmenuBehaviours",[ih,lm,Hd,lh]),Ke("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(t,e){var n,r,o=ns(),i=Yh.init(),u=function(e){var n=function(e,n,r){return Nt(r,(function(r,o){var i=function(){return $h.sketch(O(O({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?zm():Mm()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))}(e,t.data.primary,t.data.menus),r=c();return i.setContents(t.data.primary,n,t.data.expansions,r),i.getPrimary()},a=function(t){return Af.getValue(t).value},c=function(e){return Nt(t.data.menus,(function(t,e){return tt(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},s=function(t,e){lm.highlight(t,e),lm.getHighlighted(e).orThunk((function(){return lm.getFirst(e)})).each((function(e){no(t,e.element,Rr())}))},l=function(t,e){return eu(q(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?P.some(t.menu):P.none()}))})))},f=function(e,n,r){var o=l(n,n.otherMenus(r));$(o,(function(n){Zi(n.element,[t.markers.backgroundMenu]),t.stayInDom||lh.remove(e,n)}))},d=function(e,n){var r=function(e){return o.get().getOrThunk((function(){var n={},r=cl(e.element,"."+t.markers.item),i=K(r,(function(t){return"true"===ii(t,"aria-haspopup")}));return $(i,(function(t){e.getSystem().getByDom(t).each((function(t){var e=a(t);n[e]=t}))})),o.set(n),n}))}(e);Rt(r,(function(t,e){var r=F(n,e);oi(t.element,"aria-expanded",r)}))},m=function(e,n,r){return P.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return P.none();var i=o.menu,u=l(n,r.slice(1));return $(u,(function(e){Ki(e.element,t.markers.backgroundMenu)})),iu(i.element)||lh.append(e,Ru(i)),Zi(i.element,[t.markers.backgroundMenu]),s(e,i),f(e,n,r),P.some(i)}))}))};(r=n||(n={}))[r.HighlightSubmenu=0]="HighlightSubmenu",r[r.HighlightParent=1]="HighlightParent";var g=function(e,r,o){if(void 0===o&&(o=n.HighlightSubmenu),r.hasConfigured(Zd)&&Zd.isDisabled(r))return P.some(r);var u=a(r);return i.expand(u).bind((function(u){return d(e,u),P.from(u[0]).bind((function(a){return i.lookupMenu(a).bind((function(c){var s=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return i.setMenuBuilt(e,r),r}return n.menu}(e,a,c);return iu(s.element)||lh.append(e,Ru(s)),t.onOpenSubmenu(e,r,s,nt(u)),o===n.HighlightSubmenu?(lm.highlightFirst(s),m(e,i,u)):(lm.dehighlightAll(s),P.some(r))}))}))}))},p=function(e,n){var r=a(n);return i.collapse(r).bind((function(r){return d(e,r),m(e,i,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},v=function(e){return function(n,r){return ha(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map(k)}))}))}},b=io([co(qh(),(function(t,e){var n=e.event.item;i.lookupItem(a(n)).each((function(){var n=e.event.menu;lm.highlight(t,n);var r=a(e.event.item);i.refresh(r).each((function(e){return f(t,i,e)}))}))})),wo((function(e,r){var o=r.event.target;e.getSystem().getByDom(o).each((function(r){0===a(r).indexOf("collapse-item")&&p(e,r),g(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),h)}))})),vo((function(e,n){u(e).each((function(n){lh.append(e,Ru(n)),t.onOpenMenu(e,n),t.highlightImmediately&&s(e,n)}))}))].concat(t.navigateOnHover?[co(Bh(),(function(e,r){var o=r.event.item;!function(t,e){var n=a(e);i.refresh(n).bind((function(e){return d(t,e),m(t,i,e)}))}(e,o),g(e,o,n.HighlightParent),t.onHover(e,o)}))]:[])),y=function(t){return lm.getHighlighted(t).bind(lm.getHighlighted)},w={collapseMenu:function(t){y(t).each((function(e){p(t,e)}))},highlightPrimary:function(t){i.getPrimary().each((function(e){s(t,e)}))},repositionMenus:function(e){i.getPrimary().bind((function(t){return y(e).bind((function(t){var e=a(t),n=Ht(i.getMenus()),r=eu(q(n,Yh.extractPreparedMenu));return i.getTriggeringPath(e,(function(t){return function(t,e,n){return ft(e,(function(t){if(!t.getSystem().isConnected())return P.none();var e=lm.getCandidates(t);return J(e,(function(t){return a(t)===n}))}))}(0,r,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))})).fold((function(){(function(t){return P.from(t.components()[0]).filter((function(t){return"menu"===ii(t.element,"role")}))})(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Rf(t.tmenuBehaviours,[ih.config({mode:"special",onRight:v((function(t,e){return Pd(e.element)?P.none():g(t,e,n.HighlightSubmenu)})),onLeft:v((function(t,e){return Pd(e.element)?P.none():p(t,e)})),onEscape:v((function(e,n){return p(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))})),focusIn:function(t,e){i.getPrimary().each((function(e){no(t,e.element,Rr())}))}}),lm.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),Hd.config({find:function(t){return lm.getHighlighted(t)}}),lh.config({})]),eventOrder:t.eventOrder,apis:w,events:b}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:Xn(t,e),expansions:{}}},collapseItem:function(t){return{value:hi(Jh()),meta:{text:t}}}}}),Zh=Nd({name:"InlineView",configFields:[ze("lazySink"),za("onShow"),za("onHide"),qe("onEscape"),Mf("inlineBehaviours",[lf,Af,Mc]),Ge("fireDismissalEventInstead",[Ke("event",qr())]),Ge("fireRepositionEventInstead",[Ke("event",$r())]),Ke("getRelated",P.none),Ke("isExtraPart",S),Ke("eventOrder",P.none)],factory:function(t,e){var n=function(t,e,n,o){r(t,e,n,(function(){return o.map((function(t){return ra(t)}))}))},r=function(e,n,r,o){var i=t.lazySink(e).getOrDie();lf.openWhileCloaked(e,n,(function(){return Fl.positionWithinBounds(i,e,r,o())})),Af.setValue(e,P.some({mode:"position",config:r,getBounds:o}))},o=function(e,n,r,o){var i=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},u="horizontal"===r.type?{layouts:{onLtr:function(){return vc()},onRtl:function(){return bc()}}}:{},a=function(t){return function(t){return 2===t.length}(t)?u:{}};return Qh.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return lf.close(e),t.onEscape.map((function(t){return t(e)})),P.some(!0)},onExecute:function(){return P.some(!0)},onOpenMenu:function(t,e){Fl.positionWithinBounds(i().getOrDie(),e,n,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Fl.position(o,n,{anchor:O({type:"submenu",item:e},a(r))})},onRepositionMenu:function(t,e,r){var u=i().getOrDie();Fl.positionWithinBounds(u,e,n,o()),$(r,(function(t){var e=a(t.triggeringPath);Fl.position(u,t.triggeredMenu,{anchor:O({type:"submenu",item:t.triggeringItem},e)})}))}})}(t,e,n,r,o);lf.open(e,i),Af.setValue(e,P.some({mode:"menu",menu:i}))},i=function(e){lf.isOpen(e)&&Af.getValue(e).each((function(n){switch(n.mode){case"menu":lf.getState(e).each(Qh.repositionMenus);break;case"position":var r=t.lazySink(e).getOrDie();Fl.positionWithinBounds(r,e,n.config,n.getBounds())}}))},u={setContent:function(t,e){lf.setContent(t,e)},showAt:function(t,e,r){n(t,e,r,P.none())},showWithin:n,showWithinBounds:r,showMenuAt:function(t,e,n){o(t,e,n,P.none)},showMenuWithinBounds:o,hide:function(t){lf.isOpen(t)&&(Af.setValue(t,P.none()),lf.close(t))},getContent:function(t){return lf.getState(t)},reposition:i,isOpen:lf.isOpen};return{uid:t.uid,dom:t.dom,behaviours:Rf(t.inlineBehaviours,[lf.config({isPartOf:function(e,n,r){return ba(n,r)||function(e,n){return t.getRelated(e).exists((function(t){return ba(t,n)}))}(e,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),Af.config({store:{mode:"memory",initialValue:P.none()}}),Mc.config({channels:O(O({},hf(O({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),vf(O(O({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:i})))})]),eventOrder:t.eventOrder,apis:u}},apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),tp="layout-inset",ep=function(t){return t.x},np=function(t,e){return t.x+t.width/2-e.width/2},rp=function(t,e){return t.x+t.width-e.width},op=function(t){return t.y},ip=function(t,e){return t.y+t.height-e.height},up=function(t,e){return t.y+t.height/2-e.height/2},ap=function(t,e,n){return Ha(rp(t,e),ip(t,e),n.insetSouthwest(),Wa(),"southwest",Ja(t,{right:0,bottom:3}),tp)},cp=function(t,e,n){return Ha(ep(t),ip(t,e),n.insetSoutheast(),Ua(),"southeast",Ja(t,{left:1,bottom:3}),tp)},sp=function(t,e,n){return Ha(rp(t,e),op(t),n.insetNorthwest(),ja(),"northwest",Ja(t,{right:0,top:2}),tp)},lp=function(t,e,n){return Ha(ep(t),op(t),n.insetNortheast(),Fa(),"northeast",Ja(t,{left:1,top:2}),tp)},fp=function(t,e,n){return Ha(np(t,e),op(t),n.insetNorth(),qa(),"north",Ja(t,{top:2}),tp)},dp=function(t,e,n){return Ha(np(t,e),ip(t,e),n.insetSouth(),$a(),"south",Ja(t,{bottom:3}),tp)},mp=function(t,e,n){return Ha(rp(t,e),up(t,e),n.insetEast(),Ka(),"east",Ja(t,{right:0}),tp)},gp=function(t,e,n){return Ha(ep(t),up(t,e),n.insetWest(),Ga(),"west",Ja(t,{left:1}),tp)},hp=function(t){switch(t){case"north":return fp;case"northeast":return lp;case"northwest":return sp;case"south":return dp;case"southeast":return cp;case"southwest":return ap;case"east":return mp;case"west":return gp}},pp=function(t,e,n,r,o){return Jc(r).map(hp).getOr(fp)(t,e,n,r,o)},vp=function(t){switch(t){case"north":return dp;case"northeast":return cp;case"northwest":return ap;case"south":return fp;case"southeast":return lp;case"southwest":return sp;case"east":return gp;case"west":return mp}},bp=function(t,e,n,r,o){return Jc(r).map(vp).getOr(fp)(t,e,n,r,o)},yp=tinymce.util.Tools.resolve("tinymce.util.Delay"),wp=Nd({name:"Button",factory:function(t){var e=Ah(t.action),n=t.dom.tag,r=function(e){return Vt(t.dom,"attributes").bind((function(t){return Vt(t,e)}))};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:Bf(t.buttonBehaviours,[ph.config({}),ih.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return O({type:t},e)}return{role:r("role").getOr("button")}}()},eventOrder:t.eventOrder}},configFields:[Ke("uid",void 0),ze("dom"),Ke("components",[]),Nf("buttonBehaviours",[ph,ih]),Fe("action"),Fe("role"),Ke("eventOrder",{})]}),xp=function(t){var e=function(t){return void 0!==t.uid}(t)&&jt(t,"uid")?t.uid:Ci("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).toOptional()},asSpec:function(){return O(O({},t),{uid:e})}}},Cp=tinymce.util.Tools.resolve("tinymce.util.I18n"),Sp={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},kp="temporary-placeholder",Tp=function(t){return function(){return Vt(t,kp).getOr("!not found!")}},Op=function(t,e){var n,r,o=t.toLowerCase();if(Cp.isRtl()){var i=gn(n=o,r="-rtl")?n:function(t,e){return t+e}(n,r);return Ft(e,i)?i:o}return o},_p=function(t,e){return Vt(e,Op(t,e))},Ep=function(t,e){var n=e();return _p(t,n).getOrThunk(Tp(n))},Dp=function(){return fh("add-focusable",[vo((function(t){ma(t.element,"svg").each((function(t){return oi(t,"focusable","false")}))}))])},Ap=function(t,e,n,r){var o,i,u=function(t){return!!Cp.isRtl()&&Ft(Sp,t)}(e)?["tox-icon--flip"]:[],a=Vt(n,Op(e,n)).or(r).getOrThunk(Tp(n));return{dom:{tag:t.tag,attributes:null!==(o=t.attributes)&&void 0!==o?o:{},classes:t.classes.concat(u),innerHtml:a},behaviours:Tc(E(E([],null!==(i=t.behaviours)&&void 0!==i?i:[]),[Dp()]))}},Mp=function(t,e,n,r){return void 0===r&&(r=P.none()),Ap(e,t,n(),r)},zp={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Rp=Nd({name:"Notification",factory:function(t){var e,n,r,o,i,u=xp({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:Tc([lh.config({})])}),a=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},c=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},s=xp({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[a(0)]},c(0)],behaviours:Tc([lh.config({})])}),l={updateProgress:function(t,e){t.getSystem().isConnected()&&s.getOpt(t).each((function(t){lh.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[a(e)]},c(e)])}))},updateText:function(t,e){if(t.getSystem().isConnected()){var n=u.get(t);lh.set(n,[Du(e)])}}},f=Z([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return P.from(zp[t])})).toArray()]),d=xp(wp.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[Mp("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":t.translationProvider("Close")}},t.iconProvider)],action:function(e){t.onAction(e)}})),m=[(e=f,n={tag:"div",classes:["tox-notification__icon"]},r=t.iconProvider,o=r(),i=J(e,(function(t){return Ft(o,Op(t,o))})),Ap(n,i.getOr(kp),o,P.none())),{dom:{tag:"div",classes:["tox-notification__body"]},components:[u.asSpec()],behaviours:Tc([lh.config({})])}];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map((function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]})).getOr(["tox-notification","tox-notification--in"])},behaviours:Tc([ph.config({}),fh("notification-events",[co(hr(),(function(t){d.getOpt(t).each(ph.focus)}))])]),components:m.concat(t.progress?[s.asSpec()]:[]).concat(t.closeButton?[d.asSpec()]:[]),apis:l}},configFields:[Fe("level"),ze("progress"),ze("icon"),ze("onAction"),ze("text"),ze("iconProvider"),ze("translationProvider"),Ze("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function Np(t,e,n){var r=e.backstage.shared;return{open:function(t,e){var o=!t.closeButton&&t.timeout&&(t.timeout>0||t.timeout<0),i=function(){e(),Zh.hide(a)},u=zu(Rp.sketch({text:t.text,level:F(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:P.from(t.icon),closeButton:!o,onAction:i,iconProvider:r.providers.icons,translationProvider:r.providers.translate})),a=zu(Zh.sketch(O({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));return n.add(a),t.timeout>0&&yp.setTimeout((function(){i()}),t.timeout),{close:i,moveTo:function(t,e){Zh.showAt(a,Ru(u),{anchor:{type:"makeshift",x:t,y:e}})},moveRel:function(t,e){if("banner"!==e){var n=function(t){switch(t){case"bc-bc":return dp;case"tc-tc":return fp;case"tc-bc":return sc;case"bc-tc":default:return lc}}(e),o={type:"node",root:uu(),node:P.some(un.fromDom(t)),layouts:{onRtl:function(){return[n]},onLtr:function(){return[n]}}};Zh.showAt(a,Ru(u),{anchor:o})}else Zh.showAt(a,Ru(u),{anchor:r.anchors.banner()})},text:function(t){Rp.updateText(u,t)},settings:t,getEl:function(){return u.element.dom},progressBar:{value:function(t){Rp.updateProgress(u,t)}}}},close:function(t){t.close()},reposition:function(t){!function(t){$(t,(function(t){return t.moveTo(0,0)}))}(t),function(t){t.length>0&&(ct(t).each((function(t){return t.moveRel(null,"banner")})),$(t,(function(e,n){n>0&&e.moveRel(t[n-1].getEl(),"bc-tc")})))}(t)},getArgs:function(t){return t.settings}}}var Bp,Pp,Ip=function(t,e){var n=null,r=function(){u(n)||(clearTimeout(n),n=null)};return{cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,t.apply(null,o)}),e)}}},Lp=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Hp=function(t,e,n,r,o){var i=Lp(t,(function(e){return function(t,e){return t.isBlock(e)||F(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}(t,e)}));return P.from(i.backwards(e,n,r,o))},Vp=function(t,e){return Fp(un.fromDom(t.selection.getNode())).getOrThunk((function(){var n,r=un.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return Yo(r,un.fromDom(e.extractContents())),e.insertNode(r.dom),Ro(r).each((function(t){return t.dom.normalize()})),(n=r,al(n,ul)).map((function(e){t.selection.setCursorLocation(e.dom,function(t){return"img"===So(t)?1:ol(t).fold((function(){return Bo(t).length}),(function(t){return t.length}))}(e))})),r}))},Fp=function(t){return ha(t,"[data-mce-autocompleter]")},jp=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Up=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Wp=function(t,e){return t.substring(e.length)},qp=function(t,e,n,r){if(void 0===r&&(r=0),!(o=e).collapsed||3!==o.startContainer.nodeType)return P.none();var o,i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return Hp(t,e.startContainer,e.startOffset,(function(t,e,r){return function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(Up(o))return P.none();if(o===n)break}return P.some(r)}(r,e,n).getOr(e)}),i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return P.none();var i=jp(o);return 0!==i.lastIndexOf(n)||Wp(i,n).length<r?P.none():P.some({text:Wp(i,n),range:o,triggerChar:n})}))},$p=function(t,e,n,r){return void 0===r&&(r=0),Fp(un.fromDom(e.startContainer)).fold((function(){return qp(t,e,n,r)}),(function(e){var r=t.createRng();r.selectNode(e.dom);var o=jp(r);return P.some({range:r,text:Wp(o,n),triggerChar:n})}))},Gp=function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){to(t,vr(),{raw:e})};e.on("keydown",(function(e){var r=function(){return t.getView().bind(lm.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(eo),e.preventDefault()):40===e.which?(r().fold((function(){t.getView().each(lm.highlightFirst)}),(function(t){n(t,e)})),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||r().each((function(t){n(t,e),e.preventDefault(),e.stopImmediatePropagation()})):13!==e.which&&38!==e.which&&40!==e.which||t.cancelIfNecessary())})),e.on("NodeChange",(function(e){t.isActive()&&!t.isProcessingAction()&&Fp(un.fromDom(e.element)).isNone()&&t.cancelIfNecessary()}))},Kp=tinymce.util.Tools.resolve("tinymce.util.Promise"),Xp=function(t,e){return{container:t,offset:e}},Yp=function(t){if(function(t){return 3===t.nodeType}(t))return Xp(t,t.data.length);var e=t.childNodes;return e.length>0?Yp(e[e.length-1]):Xp(t,e.length)},Jp=function(t,e){var n=t.childNodes;return n.length>0&&e<n.length?Jp(n[e],0):n.length>0&&function(t){return 1===t.nodeType}(t)&&n.length===e?Yp(n[n.length-1]):Xp(t,e)},Qp=function(t){return function(e){var n=Jp(e.startContainer,e.startOffset);return!function(t,e){return Hp(t,e.container,e.offset,(function(t,e){return 0===e?-1:e}),t.getRoot()).filter((function(t){var e=t.container.data.charAt(t.offset-1);return!Up(e)})).isSome()}(t,n)}},Zp=function(t,e){var n=e(),r=t.selection.getRng();return function(t,e,n){return ft(n.triggerChars,(function(n){return $p(t,e,n)}))}(t.dom,r,n).bind((function(n){return tv(t,e,n)}))},tv=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng().startContainer.nodeValue,u=K(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return Qp(t.dom)}))(n.range,i,n.text)}));if(0===u.length)return P.none();var a=Kp.all(q(u,(function(t){return t.fetch(n.text,t.maxResults,r).then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction,highlightOn:t.highlightOn}}))})));return P.some({lookupData:a,context:n})},ev=ae([Be("type"),We("text")]),nv=ae([Ke("type","autocompleteitem"),Ke("active",!1),Ke("disabled",!1),Ke("meta",{}),Be("value"),We("text"),We("icon")]),rv=ae([Be("type"),Be("ch"),Ye("minChars",1),Ke("columns",1),Ye("maxResults",10),qe("matches"),Ie("fetch"),Ie("onAction"),en("highlightOn",[],he)]),ov=[Ze("disabled",!1),We("tooltip"),We("icon"),We("text"),tn("onSetup",(function(){return h}))],iv=ae([Be("type"),Ie("onAction")].concat(ov)),uv=function(t){return ke("toolbarbutton",iv,t)},av=[Ze("active",!1)].concat(ov),cv=ae(av.concat([Be("type"),Ie("onAction")])),sv=function(t){return ke("ToggleButton",cv,t)},lv=[tn("predicate",S),Qe("scope","node",["node","editor"]),Qe("position","selection",["node","selection","line"])],fv=ov.concat([Ke("type","contextformbutton"),Ke("primary",!1),Ie("onAction"),Ae("original",b)]),dv=av.concat([Ke("type","contextformbutton"),Ke("primary",!1),Ie("onAction"),Ae("original",b)]),mv=ov.concat([Ke("type","contextformbutton")]),gv=av.concat([Ke("type","contextformtogglebutton")]),hv=Ee("type",{contextformbutton:fv,contextformtogglebutton:dv}),pv=ae([Ke("type","contextform"),tn("initValue",v("")),We("label"),Ve("commands",hv),je("launch",Ee("type",{contextformbutton:mv,contextformtogglebutton:gv}))].concat(lv)),vv=ae([Ke("type","contexttoolbar"),Be("items")].concat(lv)),bv=function(t){var e,n,r=t.ui.registry.getAll().popups,o=Nt(r,(function(t){return(e=t,ke("Autocompleter",rv,e)).fold((function(t){throw new Error(_e(t))}),b);var e})),i=(e=It(o,(function(t){return t.ch})),n={},$(e,(function(t){n[t]={}})),Mt(n)),u=Ht(o);return{dataset:o,triggerChars:i,lookupByChar:function(t){return K(u,(function(e){return e.ch===t}))}}};(Pp=Bp||(Bp={}))[Pp.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",Pp[Pp.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var yv,wv,xv=Bp,Cv="tox-menu-nav__js",Sv="tox-collection__item",kv="tox-swatch",Tv={normal:Cv,color:kv},Ov="tox-collection__item--enabled",_v="tox-collection__item-icon",Ev="tox-collection__item-label",Dv="tox-collection__item-caret",Av="tox-collection__item--active",Mv="tox-collection__item-container",zv="tox-collection__item-container--row",Rv=function(t){return Vt(Tv,t).getOr(Cv)},Nv=function(t){return"color"===t?"tox-swatches":"tox-menu"},Bv=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:Nv(t),tieredMenu:"tox-tiered-menu"}},Pv=function(t){var e=Bv(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:Rv(t)}},Iv=function(t,e,n){var r=Bv(n);return{tag:"div",classes:Z([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},Lv=[$h.parts.items({})],Hv=function(t,e,n){var r=Bv(n);return{dom:{tag:"div",classes:Z([[r.tieredMenu]])},markers:Pv(n)}},Vv=function(t,e){return function(n){var r=W(n,e);return q(r,(function(e){return{dom:t,components:e}}))}},Fv=function(t,e){var n=[],r=[];return $(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],Ft(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),q(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},jv=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[$h.parts.items({preprocess:function(n){return"auto"!==t&&t>1?Vv({tag:"div",classes:["tox-collection__group"]},t)(n):Fv(n,(function(t,n){return"separator"===e[n].type}))}})]}},Uv=function(t){return j(t,(function(t){return"icon"in t&&void 0!==t.icon}))},Wv=function(t){return console.error(_e(t)),console.log(t),P.none()},qv=function(t,e,n,r,o){var i,u=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[$h.parts.items({preprocess:function(t){return Fv(t,(function(t,e){return"separator"===i[e].type}))}})]});return{value:t,dom:u.dom,components:u.components,items:n}},$v=function(t,e,n,r,o){var i;return"color"===o?{value:t,dom:(i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[$h.parts.items({preprocess:"auto"!==t?Vv({tag:"div",classes:["tox-swatches__row"]},t):b})]}]}}(r)).dom,components:i.components,items:n}:"normal"===o&&"auto"===r?{value:t,dom:(i=jv(r,n)).dom,components:i.components,items:n}:"normal"===o&&1===r?{value:t,dom:(i=jv(1,n)).dom,components:i.components,items:n}:"normal"===o?{value:t,dom:(i=jv(r,n)).dom,components:i.components,items:n}:"listpreview"===o&&"auto"!==r?{value:t,dom:(i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[$h.parts.items({preprocess:Vv({tag:"div",classes:["tox-collection__group"]},t)})]}}(r)).dom,components:i.components,items:n}:{value:t,dom:Iv(e,r,o),components:Lv,items:n}},Gv=[Be("type"),Be("src"),We("alt"),en("classes",[],he)],Kv=ae(Gv),Xv=[Be("type"),Be("text"),We("name"),en("classes",["tox-collection__item-label"],he)],Yv=ae(Xv),Jv=ie((function(){return xe("type",{cardimage:Kv,cardtext:Yv,cardcontainer:Qv})})),Qv=ae([Be("type"),Je("direction","horizontal"),Je("align","left"),Je("valign","middle"),Ve("items",Jv)]),Zv=[Ze("disabled",!1),We("text"),We("shortcut"),De("value","value",Gt((function(){return hi("menuitem-value")})),de()),Ke("meta",{})],tb=ae([Be("type"),We("label"),Ve("items",Jv),tn("onSetup",(function(){return h})),tn("onAction",h)].concat(Zv)),eb=ae([Be("type"),Ze("active",!1),We("icon")].concat(Zv)),nb=[Be("type"),Be("fancytype"),tn("onAction",h)],rb=[Ke("initData",{})].concat(nb),ob=[nn("initData",{},[Ze("allowCustomColors",!0),$e("colors",de())])].concat(nb),ib=Ee("fancytype",{inserttable:rb,colorswatch:ob}),ub=ae([Be("type"),tn("onSetup",(function(){return h})),tn("onAction",h),We("icon")].concat(Zv)),ab=ae([Be("type"),Ie("getSubmenuItems"),tn("onSetup",(function(){return h})),We("icon")].concat(Zv)),cb=ae([Be("type"),We("icon"),Ze("active",!1),tn("onSetup",(function(){return h})),Ie("onAction")].concat(Zv)),sb=function(t,e,n){var r=cl(t.element,"."+n);if(r.length>0){var o=Q(r,(function(t){var n=t.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>e})).getOr(r.length);return P.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return P.none()},lb=function(t,e){return Tc([fh(t,e)])},fb=function(t){return lb(hi("unnamed-events"),t)},db=hi("tooltip.exclusive"),mb=hi("tooltip.show"),gb=hi("tooltip.hide"),hb=function(t,e,n){t.getSystem().broadcastOn([db],{})},pb=Object.freeze({__proto__:null,hideAllExclusive:hb,setComponents:function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&lh.set(t,r)}))}}),vb=Object.freeze({__proto__:null,events:function(t,e){var n=function(n){e.getTooltip().each((function(r){Xl(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()};return io(Z([[co(mb,(function(n){e.resetTimer((function(){!function(n){if(!e.isShowing()){hb(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:io("normal"===t.mode?[co(gr(),(function(t){Zr(n,mb)})),co(dr(),(function(t){Zr(n,gb)}))]:[]),behaviours:Tc([lh.config({})])});e.setTooltip(o),$l(r,o),t.onShow(n,o),Fl.position(r,o,{anchor:t.anchor(n)})}}(n)}),t.delay)})),co(gb,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),co(Mr(),(function(t,e){var r=e;r.universal||F(r.channels,db)&&n(t)})),bo((function(t){n(t)}))],"normal"===t.mode?[co(hr(),(function(t){Zr(t,mb)})),co(Dr(),(function(t){Zr(t,gb)})),co(gr(),(function(t){Zr(t,mb)})),co(dr(),(function(t){Zr(t,gb)}))]:[co(Jr(),(function(t,e){Zr(t,mb)})),co(Qr(),(function(t){Zr(t,gb)}))]]))}}),bb=[ze("lazySink"),ze("tooltipDom"),Ke("exclusive",!0),Ke("tooltipComponents",[]),Ke("delay",300),Qe("mode","normal",["normal","follow-highlight"]),Ke("anchor",(function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:v([lc,sc,ic,ac,uc,cc]),onRtl:v([lc,sc,ic,ac,uc,cc])}}})),za("onHide"),za("onShow")],yb=_c({fields:bb,name:"tooltipping",active:vb,state:Object.freeze({__proto__:null,init:function(){var t=ns(),e=ns(),n=function(){t.on(clearTimeout)},r=v("not-implemented");return zi({getTooltip:e.get,isShowing:e.isSet,setTooltip:e.set,clearTooltip:e.clear,clearTimer:n,resetTimer:function(e,r){n(),t.set(setTimeout(e,r))},readState:r})}}),apis:pb}),wb=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),xb=tinymce.util.Tools.resolve("tinymce.EditorManager"),Cb=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},Sb=function(t){return t.getParam("width",wb.DOM.getStyle(t.getElement(),"width"))},kb=function(t){return P.from(t.getParam("min_width")).filter(m)},Tb=function(t){return P.from(t.getParam("min_height")).filter(m)},Ob=function(t){return P.from(t.getParam("max_width")).filter(m)},_b=function(t){return P.from(t.getParam("max_height")).filter(m)},Eb=function(t){return!1!==t.getParam("menubar",!0,"boolean")},Db=function(t){var e=t.getParam("toolbar",!0),n=!0===e,o=r(e),u=i(e)&&e.length>0;return!Mb(t)&&(u||o||n)},Ab=function(t){var e=U(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=K(e,(function(t){return"string"==typeof t}));return n.length>0?P.some(n):P.none()},Mb=function(t){return Ab(t).fold((function(){return t.getParam("toolbar",[],"string[]").length>0}),k)};(wv=yv||(yv={})).default="wrap",wv.floating="floating",wv.sliding="sliding",wv.scrolling="scrolling";var zb,Rb,Nb=function(t){return t.getParam("toolbar_mode","","string")};(Rb=zb||(zb={})).auto="auto",Rb.top="top",Rb.bottom="bottom";var Bb,Pb,Ib=function(t){return t.getParam("toolbar_location",zb.auto,"string")},Lb=function(t){return Ib(t)===zb.bottom},Hb=function(t){if(!t.inline)return P.none();var e=function(t){return t.getParam("fixed_toolbar_container","","string")}(t);if(e.length>0)return ga(uu(),e);var n=function(t){return t.getParam("fixed_toolbar_container_target")}(t);return f(n)?P.some(un.fromDom(n)):P.none()},Vb=function(t){return t.inline&&Hb(t).isSome()},Fb=function(t){return Hb(t).getOrThunk((function(){return Uo(jo(un.fromDom(t.getElement())))}))},jb=function(t){return t.inline&&!Eb(t)&&!Db(t)&&!Mb(t)},Ub=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!Vb(t)&&!jb(t)},Wb=function(t){var e=t.getParam("menu");return e?Nt(e,(function(t){return O(O({},t),{items:t.items})})):{}},qb=function(t){return t.getParam("menubar")},$b=function(t){return t.getParam("anchor_top","#top")},Gb=function(t){return t.getParam("anchor_bottom","#bottom")},Kb="silver.readonly",Xb=ae([(Bb="readonly",Re(Bb,pe))]),Yb=function(t,e){var n=t.outerContainer.element;e&&(t.mothership.broadcastOn([ff()],{target:n}),t.uiMothership.broadcastOn([ff()],{target:n})),t.mothership.broadcastOn([Kb],{readonly:e}),t.uiMothership.broadcastOn([Kb],{readonly:e})},Jb=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&Yb(e,!0)})),t.on("SwitchMode",(function(){return Yb(e,t.mode.isReadOnly())})),function(t){return t.getParam("readonly",!1,"boolean")}(t)&&t.setMode("readonly")},Qb=function(){var t;return Mc.config({channels:(t={},t[Kb]={schema:Xb,onReceive:function(t,e){Zd.set(t,e.readonly)}},t)})},Zb=function(t){return Zd.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},ty=function(t){return Zd.config({disabled:t})},ey=function(t){return Zd.config({disabled:t,disableClass:"tox-tbtn--disabled"})},ny=function(t){return Zd.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},ry=function(t,e){var n=t.getApi(e);return function(t){t(n)}},oy=function(t,e){return vo((function(n){ry(t,n)((function(n){var r=t.onSetup(n);d(r)&&e.set(r)}))}))},iy=function(t,e){return bo((function(n){return ry(t,n)(e.get())}))},uy=function(t,e){return wo((function(n,r){ry(t,n)(t.onAction),t.triggersSubmenu||e!==xv.CLOSE_ON_EXECUTE||(Zr(n,Pr()),r.stop())}))},ay=((Pb={})[zr()]=["disabling","alloy.base.behaviour","toggling","item-events"],Pb),cy=eu,sy=function(t,e,n,r){var o=rn(h);return{type:"item",dom:e.dom,components:cy(e.optComponents),data:t.data,eventOrder:ay,hasSubmenu:t.triggersSubmenu,itemBehaviours:Tc([fh("item-events",[uy(t,n),oy(t,o),iy(t,o)]),Zb((function(){return t.disabled||r.isDisabled()})),Qb(),lh.config({})].concat(t.itemBehaviours))}},ly=function(t){return{value:t.value,meta:O({text:t.text.getOr("")},t.meta)}},fy=tinymce.util.Tools.resolve("tinymce.Env"),dy=function(t){var e=fy.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),r=q(n,(function(t){var n=t.toLowerCase().trim();return Ft(e,n)?e[n]:t}));return fy.mac?r.join(""):r.join("+")},my=function(t,e,n){return void 0===n&&(n=[_v]),Mp(t,{tag:"div",classes:n},e)},gy=function(t){return{dom:{tag:"div",classes:[Ev]},components:[Du(Cp.translate(t))]}},hy=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},py=function(t,e){return{dom:{tag:"div",classes:[Ev]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Du(Cp.translate(e))]}]}},vy=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:dy(t)}}},by=function(t){return my("checkmark",t,["tox-collection__item-checkmark"])},yy=function(t,e,n){var r,o,i=t.ariaLabel,u=t.value,a=t.iconContent.map((function(t){return function(t,e,n){var r=e();return _p(t,r).or(n).getOrThunk(Tp(r))}(t,e.icons,n)}));return{dom:(r=a.getOr(""),o={tag:"div",attributes:i.map((function(t){return{title:e.translate(t)}})).getOr({}),classes:["tox-swatch"]},O(O({},o),"custom"===u?{tag:"button",classes:E(E([],o.classes),["tox-swatches__picker-btn"]),innerHtml:r}:"remove"===u?{classes:E(E([],o.classes),["tox-swatch--remove"]),innerHtml:r}:{attributes:O(O({},o.attributes),{"data-mce-color":u}),styles:{"background-color":u}})),optComponents:[]}},wy=function(t){var e=t.map((function(t){return{attributes:{title:Cp.translate(t)}}})).getOr({});return O({tag:"div",classes:[Cv,Sv]},e)},xy=function(t,e,n,r){return void 0===r&&(r=P.none()),"color"===t.presets?yy(t,e,r):function(t,e,n,r){var o={tag:"div",classes:[_v]},i=n?t.iconContent.map((function(t){return Mp(t,o,e.icons,r)})).orThunk((function(){return P.some({dom:o})})):P.none(),u=t.checkMark,a=P.from(t.meta).fold((function(){return gy}),(function(t){return Ft(t,"style")?w(py,t.style):gy})),c=t.htmlContent.fold((function(){return t.textContent.map(a)}),(function(t){return P.some(hy(t,[Ev]))}));return{dom:wy(t.ariaLabel),optComponents:[i,c,t.shortcutContent.map(vy),u,t.caret]}}(t,e,n,r)},Cy=function(t,e){return Vt(t,"tooltipWorker").map((function(t){return[yb.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:vs}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){yb.setComponents(e,[Au({element:un.fromDom(t)})])}))}})]})).getOr([])},Sy=function(t,e){var n=function(t){return wb.DOM.encode(t)}(Cp.translate(t));if(e.length>0){var r=new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"gi");return n.replace(r,(function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"}))}return n},ky=function(t,e){return q(t,(function(t){switch(t.type){case"cardcontainer":return u=t,a=ky(t.items,e),c="vertical"===u.direction?"tox-collection__item-container--column":zv,s="left"===u.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right",{dom:{tag:"div",classes:[Mv,c,s,function(){switch(u.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:a};case"cardimage":return r=t.src,o=t.classes,i=t.alt,{dom:{tag:"img",classes:o,attributes:{src:r,alt:i.getOr("")}}};case"cardtext":var n=t.name.exists((function(t){return F(e.cardText.highlightOn,t)}))?P.from(e.cardText.matchText).getOr(""):"";return hy(Sy(t.text,n),t.classes)}var r,o,i,u,a,c,s}))},Ty=md(Hh(),Vh()),Oy=function(t){return{value:t}},_y=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Ey=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Dy=function(t){return _y.test(t)||Ey.test(t)},Ay=function(t){return(e=t,n="#",mn(e,n)?function(t,e){return t.substring(e)}(e,n.length):e).toUpperCase();var e,n},My=function(t){var e=function(t){return{value:t.value.replace(_y,(function(t,e,n,r){return e+e+n+n+r+r}))}}(t),n=Ey.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},zy=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},Ry=function(t){var e=zy(t.red)+zy(t.green)+zy(t.blue);return Oy(e)},Ny=Math.min,By=Math.max,Py=Math.round,Iy=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Ly=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Hy=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},Vy=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},Fy=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=By(0,Ny(i,1)),u=By(0,Ny(u,1)),0===i)return e=n=r=Py(255*u),Hy(e,n,r,1);var a=o/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=Py(255*(e+l)),n=Py(255*(n+l)),r=Py(255*(r+l)),Hy(e,n,r,1)},jy=function(t){var e=My(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return Hy(n,r,o,1)},Uy=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return Hy(o,i,u,a)},Wy=function(t){if("transparent"===t)return P.some(Hy(0,0,0,0));var e=Iy.exec(t);if(null!==e)return P.some(Uy(e[1],e[2],e[3],"1"));var n=Ly.exec(t);return null!==n?P.some(Uy(n[1],n[2],n[3],n[4])):P.none()},qy=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},$y=Hy(255,0,0,1),Gy=function(t,e){return t.fire("ResizeContent",e)},Ky=function(t,e,n){return{hue:t,saturation:e,value:n}},Xy=function(t){var e,n=0,r=0,o=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(o,Math.min(i,u)),c=Math.max(o,Math.max(i,u));return a===c?Ky(0,0,100*(r=a)):(n=60*((n=o===a?3:u===a?1:5)-(o===a?i-u:u===a?o-i:u-o)/(c-a)),e=(c-a)/c,r=c,Ky(Math.round(n),Math.round(100*e),Math.round(100*r)))},Yy=function(t){return Ry(Fy(t))},Jy=function(t){return(e=t,Dy(e)?P.some({value:Ay(e)}):P.none()).orThunk((function(){return Wy(t).map(Ry)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],u=r[2],a=r[3];return Ry(Hy(o,i,u,a))}));var e},Qy=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Zy="tinymce-custom-colors";var tw,ew,nw="choiceitem",rw=[{type:nw,text:"Light Green",value:"#BFEDD2"},{type:nw,text:"Light Yellow",value:"#FBEEB8"},{type:nw,text:"Light Red",value:"#F8CAC6"},{type:nw,text:"Light Purple",value:"#ECCAFA"},{type:nw,text:"Light Blue",value:"#C2E0F4"},{type:nw,text:"Green",value:"#2DC26B"},{type:nw,text:"Yellow",value:"#F1C40F"},{type:nw,text:"Red",value:"#E03E2D"},{type:nw,text:"Purple",value:"#B96AD9"},{type:nw,text:"Blue",value:"#3598DB"},{type:nw,text:"Dark Turquoise",value:"#169179"},{type:nw,text:"Orange",value:"#E67E23"},{type:nw,text:"Dark Red",value:"#BA372A"},{type:nw,text:"Dark Purple",value:"#843FA1"},{type:nw,text:"Dark Blue",value:"#236FA1"},{type:nw,text:"Light Gray",value:"#ECF0F1"},{type:nw,text:"Medium Gray",value:"#CED4D9"},{type:nw,text:"Gray",value:"#95A5A6"},{type:nw,text:"Dark Gray",value:"#7E8C8D"},{type:nw,text:"Navy Blue",value:"#34495E"},{type:nw,text:"Black",value:"#000000"},{type:nw,text:"White",value:"#ffffff"}],ow=function(t){void 0===t&&(t=10);var e,n=Qy.getItem(Zy),o=r(n)?JSON.parse(n):[],i=t-(e=o).length<0?e.slice(0,t):e,u=function(t){i.splice(t,1)};return{add:function(e){(function(t,e){var n=V(t,e);return-1===n?P.none():P.some(n)})(i,e).each(u),i.unshift(e),i.length>t&&i.pop(),Qy.setItem(Zy,JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),iw=function(t){return!1!==t.getParam("custom_colors")},uw=function(t){var e=function(t){return t.getParam("color_map")}(t);return void 0!==e?function(t){for(var e=[],n=0;n<t.length;n+=2)e.push({text:t[n+1],value:"#"+Jy(t[n]).value,type:"choiceitem"});return e}(e):rw},aw=function(t){ow.add(t)},cw=function(t){return function(t,e){return t.getParam("color_cols",e,"number")}(t,function(t){return Math.max(5,Math.ceil(Math.sqrt(t)))}(uw(t).length))},sw=function(t){var e="choiceitem",n={type:e,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[n,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[n]},lw=function(t,e,n,r){"custom"===n?pw(t)((function(n){n.each((function(n){aw(n),t.execCommand("mceApplyTextcolor",e,n),r(n)}))}),"#000000"):"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},fw=function(t,e){return t.concat(q(ow.state(),(function(t){return{type:nw,text:t,value:t}})).concat(sw(e)))},dw=function(t,e){return function(n){n(fw(t,e))}},mw=function(t,e,n){var r="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";t.setIconFill(r,n)},gw=function(t,e,n,r,o){t.ui.registry.addSplitButton(e,{tooltip:r,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return P.from(function(t,e){var n;return t.dom.getParents(t.selection.getStart(),(function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(n=n||r)})),n}(t,n)).bind((function(t){return Wy(t).map((function(t){var n=Ry(t).value;return dn(e.toLowerCase(),n)}))})).getOr(!1)},columns:cw(t),fetch:dw(uw(t),iw(t)),onAction:function(e){null!==o.get()&&lw(t,n,o.get(),h)},onItemAction:function(r,i){lw(t,n,i,(function(n){o.set(n),function(t,e){t.fire("TextColorChange",e)}(t,{name:e,color:n})}))},onSetup:function(n){null!==o.get()&&mw(n,e,o.get());var r=function(t){t.name===e&&mw(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},hw=function(t,e,n,r){t.ui.registry.addNestedMenuItem(e,{text:r,icon:"forecolor"===e?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(e){lw(t,n,e.value,h)}}]}})},pw=function(t){return function(e,n){var r=!1,o={colorpicker:n};t.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onAction:function(t,e){"hex-valid"===e.name&&(r=e.value)},onSubmit:function(n){var o=n.getData().colorpicker;r?(e(P.from(o)),n.close()):t.windowManager.alert(t.translate(["Invalid hex color code: {0}",o]))},onClose:h,onCancel:function(){e(P.none())}})}},vw=function(t,e,n,r,o,i,u,a){var c=Uv(e),s=bw(e,n,r,"color"!==o?"normal":"color",i,u,a);return $v(t,c,s,r,o)},bw=function(t,e,n,r,o,i,u){return eu(q(t,(function(a){return"choiceitem"===a.type?(c=a,ke("choicemenuitem",eb,c)).fold(Wv,(function(c){return P.some(function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=xy({presets:n,textContent:e?t.text:P.none(),htmlContent:P.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:P.none(),checkMark:e?P.some(by(u.icons)):P.none(),caret:P.none(),value:t.value},u,a);return Wt(sy({data:ly(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){Eh.set(t,e)},isActive:function(){return Eh.isOn(t)},isDisabled:function(){return Zd.isDisabled(t)},setDisabled:function(e){return Zd.set(t,e)}}},onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),h},triggersSubmenu:!1,itemBehaviours:[]},c,i,u),{toggling:{toggleClass:Ov,toggleOnExecute:!1,selected:t.active}})}(c,1===n,r,e,i(a.value),o,u,Uv(t)))})):P.none();var c})))},yw=function(t,e){var n=Pv(e);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===e?"tox-swatches__row":"tox-collection__group")}},ww=function(t,e){var n=t.initData.allowCustomColors&&e.colorinput.hasCustomColors();return t.initData.colors.fold((function(){return fw(e.colorinput.getColors(),n)}),(function(t){return t.concat(sw(n))}))},xw=hi("cell-over"),Cw=hi("cell-execute"),Sw=function(t,e,n){var r,o=function(n){return to(n,Cw,{row:t,col:e})},i=function(t,e){e.stop(),o(t)};return zu({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:Tc([fh("insert-table-picker-cell",[co(gr(),ph.focus),co(zr(),o),co(xr(),i),co(Nr(),i)]),Eh.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),ph.config({onFocus:function(n){return to(n,xw,{row:t,col:e})}})])})},kw=function(t){return tt(t,(function(t){return q(t,Ru)}))},Tw=function(t,e){return Du(e+1+"x"+(t+1))},Ow={inserttable:function(t){var e=hi("size-label"),n=function(t,e,n){for(var r=[],o=0;o<e;o++){for(var i=[],u=0;u<n;u++)i.push(Sw(o,u,t));r.push(i)}return r}(e,10,10),r=xp({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[Du("0x0")],behaviours:Tc([lh.config({})])});return{type:"widget",data:{value:hi("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Ty.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:kw(n).concat(r.asSpec()),behaviours:Tc([fh("insert-table-picker",[mo(xw,(function(t,e,o){var i=o.event.row,u=o.event.col;!function(t,e,n,r,o){for(var i=0;i<r;i++)for(var u=0;u<o;u++)Eh.set(t[i][u],i<=e&&u<=n)}(n,i,u,10,10),lh.set(r.get(t),[Tw(i,u)])})),mo(Cw,(function(e,n,r){t.onAction({numRows:r.event.row+1,numColumns:r.event.col+1}),Zr(e,Pr())}))]),ih.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(t,e){var n=ww(t,e),r=e.colorinput.getColorCols(),o="color",i=vw(hi("menu-value"),n,(function(e){t.onAction({value:e})}),r,o,xv.CLOSE_ON_EXECUTE,S,e.shared.providers),u=O(O({},i),{markers:Pv(o),movement:yw(r,o)});return{type:"widget",data:{value:hi("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Ty.widget($h.sketch(u))]}}},_w=function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=xy({presets:r,textContent:P.none(),htmlContent:n?t.text.map((function(t){return Sy(t,e)})):P.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:P.none(),checkMark:P.none(),caret:P.none(),value:t.value},u.providers,a,t.icon);return sy({data:ly(t),disabled:t.disabled,getApi:v({}),onAction:function(e){return o(t.value,t.meta)},onSetup:v(h),triggersSubmenu:!1,itemBehaviours:Cy(t.meta,u)},c,i,u.providers)},Ew=function(t){var e=t.text.fold((function(){return{}}),(function(t){return{innerHtml:t}}));return{type:"separator",dom:O({tag:"div",classes:[Sv,"tox-collection__group-heading"]},e),components:[]}},Dw=function(t,e,n,r){void 0===r&&(r=!0);var o=xy({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:P.none(),ariaLabel:t.text,caret:P.none(),checkMark:P.none(),shortcutContent:t.shortcut},n,r);return sy({data:ly(t),getApi:function(t){return{isDisabled:function(){return Zd.isDisabled(t)},setDisabled:function(e){return Zd.set(t,e)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n)},Aw=function(t,e,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var i,u=o?(i=n.icons,my("chevron-down",i,[Dv])):function(t){return my("chevron-right",t,[Dv])}(n.icons),a=xy({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:P.none(),ariaLabel:t.text,caret:P.some(u),checkMark:P.none(),shortcutContent:t.shortcut},n,r);return sy({data:ly(t),getApi:function(t){return{isDisabled:function(){return Zd.isDisabled(t)},setDisabled:function(e){return Zd.set(t,e)}}},disabled:t.disabled,onAction:h,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},a,e,n)},Mw=function(t,e,n,r){void 0===r&&(r=!0);var o=xy({iconContent:t.icon,textContent:t.text,htmlContent:P.none(),ariaLabel:t.text,checkMark:P.some(by(n.icons)),caret:P.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return Wt(sy({data:ly(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){Eh.set(t,e)},isActive:function(){return Eh.isOn(t)},isDisabled:function(){return Zd.isDisabled(t)},setDisabled:function(e){return Zd.set(t,e)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n),{toggling:{toggleClass:Ov,toggleOnExecute:!1,selected:t.active}})},zw=function(t,e){return Vt(Ow,t.fancytype).map((function(n){return n(t,e)}))},Rw=function(t,e,n,r){var o={dom:wy(t.label),optComponents:[P.some({dom:{tag:"div",classes:[Mv,zv]},components:ky(t.items,r)})]};return sy({data:ly(O({text:P.none()},t)),disabled:t.disabled,getApi:function(t){return{isDisabled:function(){return Zd.isDisabled(t)},setDisabled:function(e){Zd.set(t,e),$(cl(t.element,"*"),(function(n){t.getSystem().getByDom(n).each((function(t){t.hasConfigured(Zd)&&Zd.set(t,e)}))}))}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:P.from(r.itemBehaviours).getOr([])},o,e,n.providers)};(ew=tw||(tw={}))[ew.ContentFocus=0]="ContentFocus",ew[ew.UiFocus=1]="UiFocus";var Nw,Bw,Pw=function(t,e,n,r,o){var i,u=n.shared.providers,a=function(t){return o?O(O({},t),{shortcut:P.none(),icon:t.text.isSome()?P.none():t.icon}):t};switch(t.type){case"menuitem":return(i=t,ke("menuitem",ub,i)).fold(Wv,(function(t){return P.some(Dw(a(t),e,u,r))}));case"nestedmenuitem":return function(t){return ke("nestedmenuitem",ab,t)}(t).fold(Wv,(function(t){return P.some(Aw(a(t),e,u,r,o))}));case"togglemenuitem":return function(t){return ke("togglemenuitem",cb,t)}(t).fold(Wv,(function(t){return P.some(Mw(a(t),e,u,r))}));case"separator":return function(t){return ke("separatormenuitem",ev,t)}(t).fold(Wv,(function(t){return P.some(Ew(t))}));case"fancymenuitem":return function(t){return ke("fancymenuitem",ib,t)}(t).fold(Wv,(function(t){return zw(a(t),n)}));default:return console.error("Unknown item in general menu",t),P.none()}},Iw=function(t,e,n,r,o,i,u){var a=1===r,c=!a||Uv(t);return eu(q(t,(function(t){switch(t.type){case"separator":return(r=t,ke("Autocompleter.Separator",ev,r)).fold(Wv,(function(t){return P.some(Ew(t))}));case"cardmenuitem":return function(t){return ke("cardmenuitem",tb,t)}(t).fold(Wv,(function(t){return P.some(Rw(O(O({},t),{onAction:function(e){t.onAction(e),n(t.value,t.meta)}}),o,i,{itemBehaviours:Cy(t.meta,i),cardText:{matchText:e,highlightOn:u}}))}));case"autocompleteitem":default:return function(t){return ke("Autocompleter.Item",nv,t)}(t).fold(Wv,(function(t){return P.some(_w(t,e,a,"normal",n,o,i,c))}))}var r})))},Lw=function(t,e,n,r,o){var i=Uv(e),u=eu(q(e,(function(t){var e=function(t){return Pw(t,n,r,function(t){return o?!Ft(t,"text"):i}(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?e(O(O({},t),{disabled:!0})):e(t)})));return(o?qv:$v)(t,i,u,1,"normal")},Hw=function(t){return Qh.singleData(t.value,t)},Vw=function(t,e){var n=ns(),r=rn(!1),o=zu(Zh.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:Tc([fh("dismissAutocompleter",[co(qr(),(function(){return a()}))])]),lazySink:e.getSink})),i=function(){return n.get().isSome()},u=function(){i()&&Zh.hide(o)},a=function(){if(i()){var e=n.get().map((function(t){return t.element}));Fp(e.getOr(un.fromDom(t.selection.getNode()))).each(ti),u(),n.clear(),r.set(!1)}},c=$t((function(){return bv(t)})),s=function(e,n,r,i){e.matchLength=n.text.length;var u=ft(r,(function(t){return P.from(t.columns)})).getOr(1);Zh.showAt(o,$h.sketch(function(t,e,n,r){var o=n===tw.ContentFocus?zm():Mm(),i=yw(e,r),u=Pv(r);return{dom:t.dom,components:t.components,items:t.items,value:t.value,markers:{selectedItem:u.selectedItem,item:u.item},movement:i,fakeFocus:n===tw.ContentFocus,focusManager:o,menuBehaviours:fb("auto"!==e?[]:[vo((function(t,e){sb(t,4,u.item).each((function(e){var n=e.numColumns,r=e.numRows;ih.setGridSize(t,r,n)}))}))])}}($v("autocompleter-value",!0,i,u,"normal"),u,tw.ContentFocus,"normal")),{anchor:{type:"node",root:un.fromDom(t.getBody()),node:P.from(e.element)}}),Zh.getContent(o).each(lm.highlightFirst)},l=function(o){(function(e){return n.get().map((function(n){return $p(t.dom,t.selection.getRng(),n.triggerChar).bind((function(n){return tv(t,c,n,e)}))})).getOrThunk((function(){return Zp(t,c)}))})(o).fold(a,(function(o){!function(e){if(!i()){var o=Vp(t,e.range);n.set({triggerChar:e.triggerChar,element:o,matchLength:e.text.length}),r.set(!1)}}(o.context),o.lookupData.then((function(i){n.get().map((function(n){var c,f,d,m=o.context;if(n.triggerChar===m.triggerChar){var g=(c=m.triggerChar,d=ft(f=i,(function(t){return P.from(t.columns)})).getOr(1),tt(f,(function(n){var o=n.items;return Iw(o,n.matchText,(function(e,o){var i=t.selection.getRng();$p(t.dom,i,c).fold((function(){return console.error("Lost context. Cursor probably moved")}),(function(t){var i=t.range,c={hide:function(){a()},reload:function(t){u(),l(t)}};r.set(!0),n.onAction(c,i,e,o),r.set(!1)}))}),d,xv.BUBBLE_TO_SANDBOX,e,n.highlightOn)})));g.length>0?s(n,m,i,g):m.text.length-n.matchLength>=10?a():u()}}))}))}))},f={onKeypress:Ip((function(t){27!==t.which&&l()}),50),cancelIfNecessary:a,isMenuOpen:function(){return Zh.isOpen(o)},isActive:i,isProcessingAction:r.get,getView:function(){return Zh.getContent(o)}};!1===t.hasPlugin("rtc")&&Gp(f,t)},Fw=function(t,e,n){return ha(t,e,n).isSome()},jw=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},schedule:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},Uw=function(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?P.none():P.some(e.touches[0])},Ww=function(t){var e=ns(),n=rn(!1),r=jw((function(e){t.triggerEvent(Br(),e),n.set(!0)}),400),o=Yn([{key:ur(),value:function(t){return Uw(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.schedule(t),n.set(!1),e.set(i)})),P.none()}},{key:ar(),value:function(t){return r.cancel(),Uw(t).each((function(t){e.on((function(n){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(t,n)&&e.clear()}))})),P.none()}},{key:cr(),value:function(o){r.cancel();return e.get().filter((function(t){return Un(t.target,o.target)})).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(Nr(),o)}))}}]);return{fireIfReady:function(t,e){return Vt(o,e).bind((function(e){return e(t)}))}}},qw=function(){return Vn().browser.isFirefox()},$w=ue([Ie("triggerEvent"),Ke("stopBackspace",!0)]),Gw=function(t,e){var n=Oe("Getting GUI events settings",$w,e),r=Ww(n),o=q(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return os(t,e,(function(t){r.fireIfReady(t,e).each((function(e){e&&t.kill()})),n.triggerEvent(e,t)&&t.kill()}))})),i=ns(),u=os(t,"paste",(function(t){r.fireIfReady(t,"paste").each((function(e){e&&t.kill()})),n.triggerEvent("paste",t)&&t.kill(),i.set(setTimeout((function(){n.triggerEvent(Ar(),t)}),0))})),a=os(t,"keydown",(function(t){n.triggerEvent("keydown",t)?t.kill():!0===n.stopBackspace&&function(t){return t.raw.which===fm[0]&&!F(["input","textarea"],So(t.target))&&!Fw(t.target,'[contenteditable="true"]')}(t)&&t.prevent()})),c=function(t,e){return qw()?is(t,"focus",e):os(t,"focusin",e)}(t,(function(t){n.triggerEvent("focusin",t)&&t.kill()})),s=ns(),l=function(t,e){return qw()?is(t,"blur",e):os(t,"focusout",e)}(t,(function(t){n.triggerEvent("focusout",t)&&t.kill(),s.set(setTimeout((function(){n.triggerEvent(Dr(),t)}),0))}));return{unbind:function(){$(o,(function(t){t.unbind()})),a.unbind(),c.unbind(),l.unbind(),u.unbind(),i.on(clearTimeout),s.on(clearTimeout)}}},Kw=function(t,e){var n=Vt(t,"target").getOr(e);return rn(n)},Xw=$n([{stopped:[]},{resume:["element"]},{complete:[]}]),Yw=function(t,e,n,r,o,i){var u=t(e,r),a=function(t,e){var n=rn(!1),r=rn(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}}(n,o);return u.fold((function(){return i.logEventNoHandlers(e,r),Xw.complete()}),(function(t){var n=t.descHandler;return Bi(n)(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose),Xw.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose),Xw.complete()):Ro(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),Xw.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),Xw.resume(r)}))}))},Jw=function(t,e,n,r,o,i){return Yw(t,e,n,r,o,i).fold(k,(function(r){return Jw(t,e,n,r,o,i)}),S)},Qw=function(t,e,n){var r,o,i=(r=e,o=rn(!1),{stop:function(){o.set(!0)},cut:h,isStopped:o.get,isCut:S,event:r,setSource:C("Cannot set source of a broadcasted event"),getSource:C("Cannot get source of a broadcasted event")});return $(t,(function(t){var e=t.descHandler;Bi(e)(i)})),i.isStopped()},Zw=function(t,e,n,r,o){var i=Kw(n,r);return Jw(t,e,n,r,i,o)},tx=function(){var t={};return{registerId:function(e,n,r){Rt(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=function(t,e){return n=w.apply(void 0,[t.handler].concat(e)),r=t.purpose,{cHandler:n,purpose:r};var n,r}(r,e),t[o]=i}))},unregisterId:function(e){Rt(t,(function(t,n){Ft(t,e)&&delete t[e]}))},filterByType:function(e){return Vt(t,e).map((function(t){return It(t,(function(t,e){return function(t,e){return{id:t,descHandler:e}}(e,t)}))})).getOr([])},find:function(e,n,r){var o=Vt(t,n);return tr(r,(function(t){return function(t,e){return xi(e).fold((function(){return P.none()}),(function(n){return t.bind((function(t){return Vt(t,n)})).map((function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)}))}))}(o,t)}),e)}}},ex=function(){var t=tx(),e={},n=function(t){var e=t.element;return xi(e).getOrThunk((function(){return function(t,e){var n=hi(bi+t);return wi(e,n),n}("uid-",t.element)}))},r=function(n){xi(n.element).each((function(n){delete e[n],t.unregisterId(n)}))};return{find:function(e,n,r){return t.find(e,n,r)},filter:function(e){return t.filterByType(e)},register:function(o){var i=n(o);jt(e,i)&&function(t,n){var o=e[n];if(o!==t)throw new Error('The tagId "'+n+'" is already used by: '+fi(o.element)+"\nCannot use it for: "+fi(t.element)+"\nThe conflicting element is"+(iu(o.element)?" ":" not ")+"already in the DOM");r(t)}(o,i);var u=[o];t.registerId(u,i,o.events),e[i]=o},unregister:r,getById:function(t){return Vt(e,t)}}},nx=Nd({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,r=_(e,["attributes"]);return{uid:t.uid,dom:O({tag:"div",attributes:O({role:"presentation"},n)},r),components:t.components,behaviours:zf(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[Ke("components",[]),Mf("containerBehaviours",[]),Ke("events",{}),Ke("domModification",{}),Ke("eventOrder",{})]}),rx=function(t){var e=function(e){return Ro(t.element).fold(k,(function(t){return Un(e,t)}))},n=ex(),r=function(t,r){return n.find(e,t,r)},o=Gw(t.element,{triggerEvent:function(t,e){return Sa(t,e.target,(function(n){return function(t,e,n,r){return Zw(t,e,n,n.target,r)}(r,t,e,n)}))}}),i={debugInfo:v("real"),triggerEvent:function(t,e,n){Sa(t,e,(function(o){return Zw(r,t,n,e,o)}))},triggerFocus:function(t,e){xi(t).fold((function(){Rc(t)}),(function(n){Sa(Er(),t,(function(n){return function(t,e,n,r,o){var i=Kw(n,r);Yw(t,e,n,r,i,o)}(r,Er(),{originator:e,kill:h,prevent:h,target:t},t,n),!1}))}))},triggerEscape:function(t,e){i.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:zu,addToGui:function(t){c(t)},removeFromGui:function(t){s(t)},addToWorld:function(t){u(t)},removeFromWorld:function(t){a(t)},broadcast:function(t){f(t)},broadcastOn:function(t,e){d(t,e)},broadcastEvent:function(t,e){m(t,e)},isConnected:k},u=function(t){t.connect(i),Oo(t.element)||(n.register(t),$(t.components(),u),i.triggerEvent(Lr(),t.element,{target:t.element}))},a=function(t){Oo(t.element)||($(t.components(),a),n.unregister(t)),t.disconnect()},c=function(e){$l(t,e)},s=function(t){Xl(t)},l=function(t){var e=n.filter(Mr());$(e,(function(e){var n=e.descHandler;Bi(n)(t)}))},f=function(t){l({universal:!0,data:t})},d=function(t,e){l({universal:!1,channels:t,data:e})},m=function(t,e){var r=n.filter(t);return Qw(r,e)},g=function(t){return n.getById(t).fold((function(){return gt.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),gt.value)},p=function(t){var e=xi(t).getOr("not found");return g(e)};return u(t),{root:t,element:t.element,destroy:function(){o.unbind(),Zo(t.element)},add:c,remove:s,getByUid:g,getByDom:p,addToWorld:u,removeFromWorld:a,broadcast:f,broadcastOn:d,broadcastEvent:m}},ox=v([Ke("prefix","form-field"),Mf("fieldBehaviours",[Hd,Af])]),ix=v([cd({schema:[ze("dom")],name:"label"}),cd({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[ze("text")],name:"aria-descriptor"}),ud({factory:{sketch:function(t){var e=Kn(t,["factory"]);return t.factory.sketch(e)}},schema:[ze("factory")],name:"field"})]),ux=Bd({name:"FormField",configFields:ox(),partFields:ix(),factory:function(t,e,n,r){var o=Rf(t.fieldBehaviours,[Hd.config({find:function(e){return wd(e,t,"field")}}),Af.config({store:{mode:"manual",getValue:function(t){return Hd.getCurrent(t).bind(Af.getValue)},setValue:function(t,e){Hd.getCurrent(t).each((function(t){Af.setValue(t,e)}))}}})]),i=io([vo((function(e,n){var r=Cd(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=hi(t.prefix);r.label().each((function(t){oi(t.element,"for",n),oi(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=hi(t.prefix);oi(n.element,"id",r),oi(e.element,"aria-describedby",r)}))}))}))]),u={getField:function(e){return wd(e,t,"field")},getLabel:function(e){return wd(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:u}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),ax=Object.freeze({__proto__:null,exhibit:function(t,e){return Ni({attributes:Yn([{key:e.tabAttr,value:"true"}])})}}),cx=[Ke("tabAttr","data-alloy-tabstop")],sx=_c({fields:cx,name:"tabstopping",active:ax}),lx=tinymce.util.Tools.resolve("tinymce.html.Entities"),fx=function(t,e,n,r){var o=dx(t,e,n,r);return ux.sketch(o)},dx=function(t,e,n,r){return{dom:mx(n),components:t.toArray().concat([e]),fieldBehaviours:Tc(r)}},mx=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},gx=function(t,e){return ux.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},hx=hi("form-component-change"),px=hi("form-close"),vx=hi("form-cancel"),bx=hi("form-action"),yx=hi("form-submit"),wx=hi("form-block"),xx=hi("form-unblock"),Cx=hi("form-tabchange"),Sx=hi("form-resize"),kx=function(t,e){var n,r,o,i=t.label.map((function(t){return gx(t,e)})),u=function(t){return function(e,n){ha(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,ii(r,"data-collection-item-value"))}))}},a=u((function(n,r,o,i){r.stop(),e.isDisabled()||to(n,bx,{name:t.name,value:i})})),c=[co(gr(),u((function(t,e,n){Rc(n)}))),co(xr(),a),co(Nr(),a),co(hr(),u((function(t,e,n){ga(t.element,"."+Av).each((function(t){Yi(t,Av)})),Ki(n,Av)}))),co(pr(),u((function(t){ga(t.element,"."+Av).each((function(t){Yi(t,Av)}))}))),wo(u((function(e,n,r,o){to(e,bx,{name:t.name,value:o})})))],s=function(t,e){return q(cl(t.element,".tox-collection__item"),e)},l=ux.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:b},behaviours:Tc([Zd.config({disabled:e.isDisabled,onDisabled:function(t){s(t,(function(t){Ki(t,"tox-collection__item--state-disabled"),oi(t,"aria-disabled",!0)}))},onEnabled:function(t){s(t,(function(t){Yi(t,"tox-collection__item--state-disabled"),ci(t,"aria-disabled")}))}}),Qb(),lh.config({}),Af.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=q(r,(function(n){var r=Cp.translate(n.text),o=1===t.columns?'<div class="tox-collection__item-label">'+r+"</div>":"",i='<div class="tox-collection__item-icon">'+n.icon+"</div>",u={_:" "," - ":" ","-":" "},a=r.replace(/\_| \- |\-/g,(function(t){return u[t]}));return'<div class="tox-collection__item'+(e.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+lx.encodeAllRaw(n.value)+'" title="'+a+'" aria-label="'+a+'">'+i+o+"</div>"})),i="auto"!==t.columns&&t.columns>1?W(o,t.columns):[o],u=q(i,(function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}));ni(n.element,u.join(""))}(n,r),"auto"===t.columns&&sb(n,5,"tox-collection__item").each((function(t){var e=t.numRows,r=t.numColumns;ih.setGridSize(n,e,r)})),Zr(n,Sx)}}),sx.config({}),ih.config((r=t.columns,o="normal",1===r?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===r?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===o?".tox-swatches__row":".tox-collection__group",cell:"color"===o?".tox-swatch":"."+Sv}})),fh("collection-events",c)]),eventOrder:(n={},n[zr()]=["disabling","alloy.base.behaviour","collection-events"],n)});return fx(i,l,["tox-form__group--collection"],[])},Tx=v([Fe("data"),Ke("inputAttributes",{}),Ke("inputStyles",{}),Ke("tag","input"),Ke("inputClasses",[]),za("onSetValue"),Ke("styles",{}),Ke("eventOrder",{}),Mf("inputBehaviours",[Af,ph]),Ke("selectOnFocus",!0)]),Ox=function(t){return Tc([ph.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=wu(e);e.dom.setSelectionRange(0,n.length)}:h})])},_x=function(t){return O(O({},Ox(t)),Rf(t.inputBehaviours,[Af.config({store:O(O({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return wu(t.element)},setValue:function(t,e){wu(t.element)!==e&&xu(t.element,e)}}),onSetValue:t.onSetValue})]))},Ex=function(t){return{tag:t.tag,attributes:O({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},Dx=Nd({name:"Input",configFields:Tx(),factory:function(t,e){return{uid:t.uid,dom:Ex(t),components:[],behaviours:_x(t),eventOrder:t.eventOrder}}}),Ax={},Mx={exports:Ax};Nw=Ax,Bw=Mx,function(t){"object"==typeof Nw&&void 0!==Bw?Bw.exports=t():("undefined"!=typeof window?window:void 0!==s?s:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}((function(){return function t(e,n,r){function o(u,a){if(!n[u]){if(!e[u]){var c=!1;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var l=n[u]={exports:{}};e[u][0].call(l.exports,(function(t){return o(e[u][1][t]||t)}),l,l.exports,t,e,n,r)}return n[u].exports}for(var i=!1,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(n){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var s,l=[],f=!1,d=-1;function m(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&g())}function g(){if(!f){var t=c(m);f=!0;for(var e=l.length;e;){for(s=l,l=[];++d<e;)s&&s[d].run();d=-1,e=l.length}s=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(n){return o.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new h(t,e)),1!==l.length||f||c(g)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function u(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(o){return void c(e.promise,o)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(u){c(t,u)}var r,o}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(r){if(n)return;n=!0,c(e,r)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return u(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(c){n(c)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}));var zx,Rx,Nx=Mx.exports.boltExport,Bx=function(t){var e=P.none(),n=[],r=function(t){o()?u(t):n.push(t)},o=function(){return e.isSome()},i=function(t){$(t,u)},u=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=P.some(t),i(n),n=[])})),{get:r,map:function(t){return Bx((function(e){r((function(n){e(t(n))}))}))},isReady:o}},Px={nu:Bx,pure:function(t){return Bx((function(e){e(t)}))}},Ix=function(t){setTimeout((function(){throw t}),0)},Lx=function(t){var e=function(e){t().then(e,Ix)};return{map:function(e){return Lx((function(){return t().then(e)}))},bind:function(e){return Lx((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return Lx((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return Px.nu(e)},toCached:function(){var e=null;return Lx((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},Hx=function(t){return Lx((function(){return new Nx(t)}))},Vx=function(t){return Lx((function(){return Nx.resolve(t)}))},Fx=["input","textarea"],jx=function(t){var e=So(t);return F(Fx,e)},Ux=function(t,e){var n=e.getRoot(t).getOr(t.element);Yi(n,e.invalidClass),e.notify.each((function(e){jx(t.element)&&oi(t.element,"aria-invalid",!1),e.getContainer(t).each((function(t){ni(t,e.validHtml)})),e.onValid(t)}))},Wx=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element);Ki(o,e.invalidClass),e.notify.each((function(e){jx(t.element)&&oi(t.element,"aria-invalid",!0),e.getContainer(t).each((function(t){ni(t,r)})),e.onInvalid(t,r)}))},qx=function(t,e,n){return e.validator.fold((function(){return Vx(gt.value(!0))}),(function(e){return e.validate(t)}))},$x=function(t,e,n){return e.notify.each((function(e){e.onValidate(t)})),qx(t,e).map((function(n){return t.getSystem().isConnected()?n.fold((function(n){return Wx(t,e,0,n),gt.error(n)}),(function(n){return Ux(t,e),gt.value(n)})):gt.error("No longer in system")}))},Gx=Object.freeze({__proto__:null,markValid:Ux,markInvalid:Wx,query:qx,run:$x,isInvalid:function(t,e){var n=e.getRoot(t).getOr(t.element);return Ji(n,e.invalidClass)}}),Kx=Object.freeze({__proto__:null,events:function(t,e){return t.validator.map((function(e){return io([co(e.onEvent,(function(e){$x(e,t).get(b)}))].concat(e.validateOnLoad?[vo((function(e){$x(e,t).get(h)}))]:[]))})).getOr({})}}),Xx=[ze("invalidClass"),Ke("getRoot",P.none),Ge("notify",[Ke("aria","alert"),Ke("getContainer",P.none),Ke("validHtml",""),za("onValid"),za("onInvalid"),za("onValidate")]),Ge("validator",[ze("validate"),Ke("onEvent","input"),Ke("validateOnLoad",!0)])],Yx=_c({fields:Xx,name:"invalidating",active:Kx,apis:Gx,extra:{validation:function(t){return function(e){var n=Af.getValue(e);return Vx(t(n))}}}}),Jx=Object.freeze({__proto__:null,getCoupled:function(t,e,n,r){return n.getOrCreate(t,e,r)}}),Qx=[Re("others",Se(gt.value,de()))],Zx=_c({fields:Qx,name:"coupling",apis:Jx,state:Object.freeze({__proto__:null,init:function(){var t={},e=v({});return zi({readState:e,getOrCreate:function(e,n,r){var o=Mt(n.others);if(o)return Vt(t,r).getOrThunk((function(){var o=Vt(n.others,r).getOrDie("No information found for coupled component: "+r)(e),i=e.getSystem().build(o);return t[r]=i,i}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))}})}})}),tC=v("sink"),eC=v(cd({name:tC(),overrides:v({dom:{tag:"div"},behaviours:Tc([Fl.config({useFixed:k})]),events:io([go(vr()),go(lr()),go(xr())])})}));(Rx=zx||(zx={}))[Rx.HighlightFirst=0]="HighlightFirst",Rx[Rx.HighlightNone=1]="HighlightNone";var nC,rC,oC,iC,uC=function(t,e){var n=t.getHotspot(e).getOr(e),r="hotspot",o=t.getAnchorOverrides();return t.layouts.fold((function(){return{type:r,hotspot:n,overrides:o}}),(function(t){return{type:r,hotspot:n,overrides:o,layouts:t}}))},aC=function(t,e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=function(t,e,n){return(0,t.fetch)(n).map(e)}(t,e,r),c=fC(r,t);return a.map((function(t){return t.bind((function(t){return P.from(Qh.sketch(O(O({},i.menu()),{uid:Ci(""),data:t,highlightImmediately:u===zx.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();Fl.position(r,e,{anchor:n}),lf.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();Fl.position(r,n,{anchor:{type:"submenu",item:e}}),lf.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();Fl.position(o,e,{anchor:n}),$(r,(function(t){Fl.position(o,t.triggeredMenu,{anchor:{type:"submenu",item:t.triggeringItem}})}))},onEscape:function(){return ph.focus(r),lf.close(o),P.some(!0)}})))}))}))}(t,e,uC(t,n),n,r,o,u).map((function(t){return t.fold((function(){lf.isOpen(r)&&lf.close(r)}),(function(t){lf.cloak(r),lf.open(r,t),i(r)})),r}))},cC=function(t,e,n,r,o,i,u){return lf.close(r),Vx(r)},sC=function(t,e,n,r,o,i){var u=Zx.getCoupled(n,"sandbox");return(lf.isOpen(u)?cC:aC)(t,e,n,u,r,o,i)},lC=function(t,e,n){var r,o,i=Hd.getCurrent(e).getOr(e),u=Wu(t.element);n?lu(i.element,"min-width",u+"px"):(r=i.element,o=u,Uu.set(r,o))},fC=function(t,e){return t.getSystem().getByUid(e.uid+"-"+tC()).map((function(t){return function(){return gt.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return gt.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(e){return function(){return e(t)}}))}))},dC=function(t){lf.getState(t).each((function(t){Qh.repositionMenus(t)}))},mC=function(t,e,n){var r=pa(),o=fC(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:Bf(t.sandboxBehaviours,[Af.config({store:{mode:"memory",initialValue:e}}),lf.config({onOpen:function(o,i){var u=uC(t,e);r.link(e.element),t.matchWidth&&lC(u.hotspot,i,t.useMinWidth),t.onOpen(u,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},onClose:function(t,o){r.unlink(e.element),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},isPartOf:function(t,n,r){return ba(n,r)||ba(e,r)},getAttachPoint:function(){return o().getOrDie()}}),Hd.config({find:function(t){return lf.getState(t).bind((function(t){return Hd.getCurrent(t)}))}}),Mc.config({channels:O(O({},hf({isExtraPart:S})),vf({doReposition:dC}))})])}},gC=function(t){var e=Zx.getCoupled(t,"sandbox");dC(e)},hC=function(){return[Ke("sandboxClasses",[]),Nf("sandboxBehaviours",[Hd,Mc,lf,Af])]},pC=v([ze("dom"),ze("fetch"),za("onOpen"),Ra("onExecute"),Ke("getHotspot",P.some),Ke("getAnchorOverrides",v({})),Es(),Mf("dropdownBehaviours",[Eh,Zx,ih,ph]),ze("toggleClass"),Ke("eventOrder",{}),Fe("lazySink"),Ke("matchWidth",!1),Ke("useMinWidth",!1),Fe("role")].concat(hC())),vC=v([ad({schema:[Da()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),eC()]),bC=Bd({name:"Dropdown",configFields:pC(),partFields:vC(),factory:function(t,e,n,r){var o,i,u=function(t){lf.getState(t).each((function(t){Qh.highlightPrimary(t)}))},a={expand:function(e){Eh.isOn(e)||sC(t,b,e,r,h,zx.HighlightNone).get(h)},open:function(e){Eh.isOn(e)||sC(t,b,e,r,h,zx.HighlightFirst).get(h)},isOpen:Eh.isOn,close:function(e){Eh.isOn(e)&&sC(t,b,e,r,h,zx.HighlightFirst).get(h)},repositionMenus:function(t){Eh.isOn(t)&&gC(t)}},c=function(t,e){return eo(t),P.some(!0)};return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.dropdownBehaviours,[Eh.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),Zx.config({others:{sandbox:function(e){return mC(t,e,{onOpen:function(){return Eh.on(e)},onClose:function(){return Eh.off(e)}})}}}),ih.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,e){if(bC.isOpen(t)){var n=Zx.getCoupled(t,"sandbox");u(n)}else bC.open(t);return P.some(!0)},onEscape:function(t,e){return bC.isOpen(t)?(bC.close(t),P.some(!0)):P.none()}}),ph.config({})]),events:Ah(P.some((function(e){sC(t,b,e,r,u,zx.HighlightFirst).get(h)}))),eventOrder:O(O({},t.eventOrder),(o={},o[zr()]=["disabling","toggling","alloy.base.behaviour"],o)),apis:a,domModification:{attributes:O(O({"aria-haspopup":"true"},t.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===t.dom.tag?{type:(i="type",Vt(t.dom,"attributes").bind((function(t){return Vt(t,i)}))).getOr("button")}:{})}}},apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),yC=Object.freeze({__proto__:null,events:function(){return io([uo(Tr(),k)])},exhibit:function(){return Ni({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),wC=_c({fields:[],name:"unselecting",active:yC}),xC=hi("color-input-change"),CC=hi("color-swatch-change"),SC=hi("color-picker-cancel"),kC=function(t,e,n){var r=ux.parts.field({factory:Dx,inputClasses:["tox-textfield"],onSetValue:function(t){return Yx.run(t).get(h)},inputBehaviours:Tc([Zd.config({disabled:e.providers.isDisabled}),Qb(),sx.config({}),Yx.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return Ro(t.element)},notify:{onValid:function(t){var e=Af.getValue(t);to(t,xC,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=Af.getValue(t);if(0===e.length)return Vx(gt.value(!0));var n=un.fromTag("span");lu(n,"background-color",e);var r=hu(n,"background-color").fold((function(){return gt.error("blah")}),(function(t){return gt.value(e)}));return Vx(r)}}})]),selectOnFocus:!1}),o=t.label.map((function(t){return gx(t,e.providers)})),i=function(t,e){to(t,CC,{value:e})},u=xp(function(t,e){return bC.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:Tc([ty(e.providers.isDisabled),Qb(),wC.config({}),sx.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return Hx((function(e){return t.fetch(e)})).map((function(r){return P.from(Hw(Wt(vw(hi("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,xv.CLOSE_ON_EXECUTE,S,e.providers),{movement:yw(t.columns,t.presets)})))}))},parts:{menu:Hv(0,0,t.presets)}})}({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[uc,ic,lc]},onLtr:function(){return[ic,uc,lc]}},components:[],fetch:dw(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:function(t,e){u.getOpt(t).each((function(t){"custom"===e?n.colorPicker((function(e){e.fold((function(){return Zr(t,SC)}),(function(e){i(t,e),aw(e)}))}),"#ffffff"):i(t,"remove"===e?"":e)}))}},e));return ux.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,u.asSpec()]}]),fieldBehaviours:Tc([fh("form-field-events",[co(xC,(function(e,n){u.getOpt(e).each((function(t){lu(t.element,"background-color",n.event.color)})),to(e,hx,{name:t.name})})),co(CC,(function(t,e){ux.getField(t).each((function(n){Af.setValue(n,e.event.value),Hd.getCurrent(t).each(ph.focus)}))})),co(SC,(function(t,e){ux.getField(t).each((function(e){Hd.getCurrent(t).each(ph.focus)}))}))])])})},TC=cd({schema:[ze("dom")],name:"label"}),OC=function(t){return cd({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold((function(){return{}}),(function(t){return{events:io([so(ur(),(function(e,n,r){return t(e,r)}),[e]),so(lr(),(function(e,n,r){return t(e,r)}),[e]),so(fr(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},_C=OC("top-left"),EC=OC("top"),DC=OC("top-right"),AC=OC("right"),MC=OC("bottom-right"),zC=OC("bottom"),RC=OC("bottom-left"),NC=OC("left"),BC=ud({name:"thumb",defaults:v({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:io([fo(ur(),t,"spectrum"),fo(ar(),t,"spectrum"),fo(cr(),t,"spectrum"),fo(lr(),t,"spectrum"),fo(fr(),t,"spectrum"),fo(mr(),t,"spectrum")])}}}),PC=ud({schema:[Ae("mouseIsDown",(function(){return rn(!1)}))],name:"spectrum",overrides:function(t){var e=t.model.manager,n=function(n,r){return e.getValueFromEvent(r).map((function(r){return e.setValueFrom(n,t,r)}))};return{behaviours:Tc([ih.config({mode:"special",onLeft:function(n){return e.onLeft(n,t)},onRight:function(n){return e.onRight(n,t)},onUp:function(n){return e.onUp(n,t)},onDown:function(n){return e.onDown(n,t)}}),ph.config({})]),events:io([co(ur(),n),co(ar(),n),co(lr(),n),co(fr(),(function(e,r){t.mouseIsDown.get()&&n(e,r)}))])}}}),IC=[TC,NC,AC,EC,zC,_C,DC,RC,MC,BC,PC],LC=v("slider.change.value"),HC=function(t){var e=t.event.raw;if(function(t){return-1!==t.type.indexOf("touch")}(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?P.some(n.touches[0]).map((function(t){return Hu(t.clientX,t.clientY)})):P.none()}var r=e;return void 0!==r.clientX?P.some(r).map((function(t){return Hu(t.clientX,t.clientY)})):P.none()},VC=function(t){return t.model.minX},FC=function(t){return t.model.minY},jC=function(t){return t.model.minX-1},UC=function(t){return t.model.minY-1},WC=function(t){return t.model.maxX},qC=function(t){return t.model.maxY},$C=function(t){return t.model.maxX+1},GC=function(t){return t.model.maxY+1},KC=function(t,e,n){return e(t)-n(t)},XC=function(t){return KC(t,WC,VC)},YC=function(t){return KC(t,qC,FC)},JC=function(t){return XC(t)/2},QC=function(t){return YC(t)/2},ZC=function(t){return t.stepSize},tS=function(t){return t.snapToGrid},eS=function(t){return t.snapStart},nS=function(t){return t.rounded},rS=function(t,e){return void 0!==t[e+"-edge"]},oS=function(t){return rS(t,"left")},iS=function(t){return rS(t,"right")},uS=function(t){return rS(t,"top")},aS=function(t){return rS(t,"bottom")},cS=function(t){return t.model.value.get()},sS=function(t){return{x:t}},lS=function(t){return{y:t}},fS=function(t,e){return{x:t,y:e}},dS=function(t,e){to(t,LC(),{value:e})},mS=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},gS=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},hS=function(t,e,n){return Math.max(e,Math.min(n,t))},pS=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?e-1:e,h=l?n+1:n;if(o<f)return g;if(o>d)return h;var p=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,f,d),v=hS(p/m*r+e,g,h);return u&&v>=e&&v<=n?function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return hS(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),u=Math.floor((t-e)/r),a=Math.floor((n-e)/r),c=e+Math.min(a,u+i)*r;return Math.max(e,c)}))}(v,e,n,i,a):c?Math.round(v):v},vS=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return o<e?i?0:s:o>n?u?a:l:(o-e)/r*c},bS="top",yS="right",wS="bottom",xS="left",CS=function(t){return t.element.dom.getBoundingClientRect()},SS=function(t,e){return t[e]},kS=function(t){var e=CS(t);return SS(e,xS)},TS=function(t){var e=CS(t);return SS(e,yS)},OS=function(t){var e=CS(t);return SS(e,bS)},_S=function(t){var e=CS(t);return SS(e,wS)},ES=function(t){var e=CS(t);return SS(e,"width")},DS=function(t){var e=CS(t);return SS(e,"height")},AS=function(t,e,n){return(t+e)/2-n},MS=function(t,e){var n=CS(t),r=CS(e),o=SS(n,xS),i=SS(n,yS),u=SS(r,xS);return AS(o,i,u)},zS=function(t,e){var n=CS(t),r=CS(e),o=SS(n,bS),i=SS(n,wS),u=SS(r,bS);return AS(o,i,u)},RS=function(t,e){to(t,LC(),{value:e})},NS=function(t){return{x:t}},BS=function(t,e,n){var r={min:VC(e),max:WC(e),range:XC(e),value:n,step:ZC(e),snap:tS(e),snapStart:eS(e),rounded:nS(e),hasMinEdge:oS(e),hasMaxEdge:iS(e),minBound:kS(t),maxBound:TS(t),screenRange:ES(t)};return pS(r)},PS=function(t){return function(e,n){return function(t,e,n){var r=(t>0?gS:mS)(cS(n).x,VC(n),WC(n),ZC(n));return RS(e,NS(r)),P.some(r)}(t,e,n).map(k)}},IS=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=ES(t),u=r.bind((function(e){return P.some(MS(e,t))})).getOr(0),a=o.bind((function(e){return P.some(MS(e,t))})).getOr(i),c={min:VC(e),max:WC(e),range:XC(e),value:n,hasMinEdge:oS(e),hasMaxEdge:iS(e),minBound:kS(t),minOffset:0,maxBound:TS(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return vS(c)}(e,i,n,r,o);return kS(e)-kS(t)+u},LS=PS(-1),HS=PS(1),VS=P.none,FS=P.none,jS={"top-left":P.none(),top:P.none(),"top-right":P.none(),right:P.some((function(t,e){dS(t,sS($C(e)))})),"bottom-right":P.none(),bottom:P.none(),"bottom-left":P.none(),left:P.some((function(t,e){dS(t,sS(jC(e)))}))},US=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=BS(t,e,n),o=NS(r);return RS(t,o),r},setToMin:function(t,e){var n=VC(e);RS(t,NS(n))},setToMax:function(t,e){var n=WC(e);RS(t,NS(n))},findValueOfOffset:BS,getValueFromEvent:function(t){return HC(t).map((function(t){return t.left}))},findPositionOfValue:IS,setPositionFromValue:function(t,e,n,r){var o=cS(n),i=IS(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=Wu(e.element)/2;lu(e.element,"left",i-u+"px")},onLeft:LS,onRight:HS,onUp:VS,onDown:FS,edgeActions:jS}),WS=function(t,e){to(t,LC(),{value:e})},qS=function(t){return{y:t}},$S=function(t,e,n){var r={min:FC(e),max:qC(e),range:YC(e),value:n,step:ZC(e),snap:tS(e),snapStart:eS(e),rounded:nS(e),hasMinEdge:uS(e),hasMaxEdge:aS(e),minBound:OS(t),maxBound:_S(t),screenRange:DS(t)};return pS(r)},GS=function(t){return function(e,n){return function(t,e,n){var r=(t>0?gS:mS)(cS(n).y,FC(n),qC(n),ZC(n));return WS(e,qS(r)),P.some(r)}(t,e,n).map(k)}},KS=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=DS(t),u=r.bind((function(e){return P.some(zS(e,t))})).getOr(0),a=o.bind((function(e){return P.some(zS(e,t))})).getOr(i),c={min:FC(e),max:qC(e),range:YC(e),value:n,hasMinEdge:uS(e),hasMaxEdge:aS(e),minBound:OS(t),minOffset:0,maxBound:_S(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return vS(c)}(e,i,n,r,o);return OS(e)-OS(t)+u},XS=P.none,YS=P.none,JS=GS(-1),QS=GS(1),ZS={"top-left":P.none(),top:P.some((function(t,e){dS(t,lS(UC(e)))})),"top-right":P.none(),right:P.none(),"bottom-right":P.none(),bottom:P.some((function(t,e){dS(t,lS(GC(e)))})),"bottom-left":P.none(),left:P.none()},tk=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=$S(t,e,n),o=qS(r);return WS(t,o),r},setToMin:function(t,e){var n=FC(e);WS(t,qS(n))},setToMax:function(t,e){var n=qC(e);WS(t,qS(n))},findValueOfOffset:$S,getValueFromEvent:function(t){return HC(t).map((function(t){return t.top}))},findPositionOfValue:KS,setPositionFromValue:function(t,e,n,r){var o=cS(n),i=KS(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=Pu(e.element)/2;lu(e.element,"top",i-u+"px")},onLeft:XS,onRight:YS,onUp:JS,onDown:QS,edgeActions:ZS}),ek=function(t,e){to(t,LC(),{value:e})},nk=function(t,e){return{x:t,y:e}},rk=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?gS:mS,i=e?cS(r).x:o(cS(r).x,VC(r),WC(r),ZC(r)),u=e?o(cS(r).y,FC(r),qC(r),ZC(r)):cS(r).y;return ek(n,nk(i,u)),P.some(i)}(t,e,n,r).map(k)}},ok=rk(-1,!1),ik=rk(1,!1),uk=rk(-1,!0),ak=rk(1,!0),ck={"top-left":P.some((function(t,e){dS(t,fS(jC(e),UC(e)))})),top:P.some((function(t,e){dS(t,fS(JC(e),UC(e)))})),"top-right":P.some((function(t,e){dS(t,fS($C(e),UC(e)))})),right:P.some((function(t,e){dS(t,fS($C(e),QC(e)))})),"bottom-right":P.some((function(t,e){dS(t,fS($C(e),GC(e)))})),bottom:P.some((function(t,e){dS(t,fS(JC(e),GC(e)))})),"bottom-left":P.some((function(t,e){dS(t,fS(jC(e),GC(e)))})),left:P.some((function(t,e){dS(t,fS(jC(e),QC(e)))}))},sk=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=BS(t,e,n.left),o=$S(t,e,n.top),i=nk(r,o);return ek(t,i),i},setToMin:function(t,e){var n=VC(e),r=FC(e);ek(t,nk(n,r))},setToMax:function(t,e){var n=WC(e),r=qC(e);ek(t,nk(n,r))},getValueFromEvent:function(t){return HC(t)},setPositionFromValue:function(t,e,n,r){var o=cS(n),i=IS(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=KS(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=Wu(e.element)/2,c=Pu(e.element)/2;lu(e.element,"left",i-a+"px"),lu(e.element,"top",u-c+"px")},onLeft:ok,onRight:ik,onUp:uk,onDown:ak,edgeActions:ck}),lk=Bd({name:"Slider",configFields:[Ke("stepSize",1),Ke("onChange",h),Ke("onChoose",h),Ke("onInit",h),Ke("onDragStart",h),Ke("onDragEnd",h),Ke("snapToGrid",!1),Ke("rounded",!0),Fe("snapStart"),Re("model",Ee("mode",{x:[Ke("minX",0),Ke("maxX",100),Ae("value",(function(t){return rn(t.mode.minX)})),ze("getInitialValue"),Pa("manager",US)],y:[Ke("minY",0),Ke("maxY",100),Ae("value",(function(t){return rn(t.mode.minY)})),ze("getInitialValue"),Pa("manager",tk)],xy:[Ke("minX",0),Ke("maxX",100),Ke("minY",0),Ke("maxY",100),Ae("value",(function(t){return rn({x:t.mode.minX,y:t.mode.minY})})),ze("getInitialValue"),Pa("manager",sk)]})),Mf("sliderBehaviours",[ih,Af]),Ae("mouseIsDown",(function(){return rn(!1)}))],partFields:IC,factory:function(t,e,n,r){var o,i=function(e){return xd(e,t,"thumb")},u=function(e){return xd(e,t,"spectrum")},a=function(e){return wd(e,t,"left-edge")},c=function(e){return wd(e,t,"right-edge")},s=function(e){return wd(e,t,"top-edge")},l=function(e){return wd(e,t,"bottom-edge")},f=t.model,d=f.manager,m=function(e,n){d.setPositionFromValue(e,n,t,{getLeftEdge:a,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:u})},g=function(t,e){f.value.set(e);var n=i(t);m(t,n)},h=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&wd(e,t,"thumb").each((function(n){var r=f.value.get();t.onChoose(e,n,r)}))},p=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},v=function(e,n){n.stop(),t.onDragEnd(e,i(e)),h(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.sliderBehaviours,[ih.config({mode:"special",focusIn:function(e){return wd(e,t,"spectrum").map(ih.focusIn).map(k)}}),Af.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),Mc.config({channels:(o={},o[mf()]={onReceive:h},o)})]),events:io([co(LC(),(function(e,n){!function(e,n){g(e,n);var r=i(e);t.onChange(e,r,n),P.some(!0)}(e,n.event.value)})),vo((function(e,n){var r=f.getInitialValue();f.value.set(r);var o=i(e);m(e,o);var a=u(e);t.onInit(e,o,a,f.value.get())})),co(ur(),p),co(cr(),v),co(lr(),p),co(mr(),v)]),apis:{resetToMin:function(e){d.setToMin(e,t)},resetToMax:function(e){d.setToMax(e,t)},setValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(t,e,n){t.setValue(e,n)},resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),fk=hi("rgb-hex-update"),dk=hi("slider-update"),mk=hi("palette-update"),gk="form",hk=[Mf("formBehaviours",[Af])],pk=function(t){return"<alloy.field."+t+">"},vk=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.formBehaviours,[Af.config({store:{mode:"manual",getValue:function(e){var n=Sd(e,t);return Nt(n,(function(t,e){return t().bind((function(t){var n,r,o=Hd.getCurrent(t);return n=o,r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+fi(t.element)),n.fold((function(){return gt.error(r)}),gt.value)})).map(Af.getValue)}))},setValue:function(e,n){Rt(n,(function(n,r){wd(e,t,r).each((function(t){Hd.getCurrent(t).each((function(t){Af.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return wd(e,t,n).bind(Hd.getCurrent)}}}},bk={getField:Ai((function(t,e,n){return t.getField(e,n)})),sketch:function(t){var e,n={field:function(t,n){return e.push(t),hd(gk,pk(t),n)},record:v(e=[])},r=t(n),o=n.record(),i=q(o,(function(t){return ud({name:t,pname:pk(t)})}));return Ad(gk,hk,i,vk,r)}},yk=hi("valid-input"),wk=hi("invalid-input"),xk=hi("validating-input"),Ck="colorcustom.rgb.",Sk=function(t,e,n,r){var o=function(n,r){return Yx.config({invalidClass:e("invalid"),notify:{onValidate:function(t){to(t,xk,{type:n})},onValid:function(t){to(t,yk,{type:n,value:Af.getValue(t)})},onInvalid:function(t){to(t,wk,{type:n,value:Af.getValue(t)})}},validator:{validate:function(e){var n=Af.getValue(e),o=r(n)?gt.value(!0):gt.error(t("aria.input.invalid"));return Vx(o)},validateOnLoad:!1}})},i=function(n,r,i,u,a){var c=t("colorcustom.rgb.range"),s=[ux.parts.label({dom:{tag:"label",innerHtml:i,attributes:{"aria-label":u}}}),ux.parts.field({data:a,factory:Dx,inputAttributes:O({type:"text"},"hex"===r?{"aria-live":"polite"}:{}),inputClasses:[e("textfield")],inputBehaviours:Tc([o(r,n),sx.config({})]),onSetValue:function(t){Yx.isInvalid(t)&&Yx.run(t).get(h)}})],l="hex"!==r?[ux.parts["aria-descriptor"]({text:c})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:s.concat(l)}},u=function(t,e){var n=e.red,r=e.green,o=e.blue;Af.setValue(t,{red:n,green:r,blue:o})},a=xp({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),c=function(t,e){a.getOpt(t).each((function(t){lu(t.element,"background-color","#"+e.value)}))};return Nd({factory:function(){var o={red:rn(P.some(255)),green:rn(P.some(255)),blue:rn(P.some(255)),hex:rn(P.some("ffffff"))},s=function(t){return o[t].get()},l=function(t,e){o[t].set(e)},f=function(t){var e=t.red,n=t.green,r=t.blue;l("red",P.some(e)),l("green",P.some(n)),l("blue",P.some(r))},d=function(t,e){var n=e.event;"hex"!==n.type?l(n.type,P.none()):r(t)},m=function(t,e,n){var r=parseInt(n,10);l(e,P.some(r)),s("red").bind((function(t){return s("green").bind((function(e){return s("blue").map((function(n){return Hy(t,e,n,1)}))}))})).each((function(e){var n=function(t,e){var n=Ry(e);return bk.getField(t,"hex").each((function(e){ph.isFocused(e)||Af.setValue(t,{hex:n.value})})),n}(t,e);to(t,fk,{hex:n}),c(t,n)}))},g=function(t,e){var r=e.event;!function(t){return"hex"===t.type}(r)?m(t,r.type,r.value):function(t,e){n(t);var r=Oy(e);l("hex",P.some(e));var o=jy(r);u(t,o),f(o),to(t,fk,{hex:r}),c(t,r)}(t,r.value)},h=function(e){return{label:t(Ck+e+".label"),description:t(Ck+e+".description")}},p=h("red"),v=h("green"),b=h("blue"),y=h("hex");return Wt(bk.sketch((function(n){return{dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[n.field("red",ux.sketch(i(Vy,"red",p.label,p.description,255))),n.field("green",ux.sketch(i(Vy,"green",v.label,v.description,255))),n.field("blue",ux.sketch(i(Vy,"blue",b.label,b.description,255))),n.field("hex",ux.sketch(i(Dy,"hex",y.label,y.description,"ffffff"))),a.asSpec()],formBehaviours:Tc([Yx.config({invalidClass:e("form-invalid")}),fh("rgb-form-events",[co(yk,g),co(wk,d),co(xk,d)])])}})),{apis:{updateHex:function(t,e){Af.setValue(t,{hex:e.value}),function(t,e){var n=jy(e);u(t,n),f(n)}(t,e),c(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})},kk=function(t,e){var n=lk.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=lk.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"<div class="+e("sv-palette-inner-thumb")+' role="presentation"></div>'}}),o=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var u=o.createLinearGradient(0,0,0,r);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=u,o.fillRect(0,0,n,r)}};return Nd({factory:function(t){var i=v({x:0,y:0}),u=Tc([Hd.config({find:P.some}),ph.config({})]);return lk.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:i},rounded:!1,components:[n,r],onChange:function(t,e,n){to(t,mk,{value:n})},onInit:function(t,e,n,r){o(n.element.dom,qy($y))},sliderBehaviours:u})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,e,n){!function(t,e){var n=t.components()[0].element.dom,r=Ky(e,100,100),i=Fy(r);o(n,qy(i))}(e,n)},setThumb:function(t,e,n){!function(t,e){var n=Xy(jy(e));lk.setValue(t,{x:n.saturation,y:100-n.value})}(e,n)}},extraApis:{}})},Tk=function(t,e){return Nd({name:"ColourPicker",configFields:[ze("dom"),Ke("onValidHex",h),Ke("onInvalidHex",h)],factory:function(n){var r,o=Sk(t,e,n.onValidHex,n.onInvalidHex),i=kk(0,e),u=function(t){return 100-t/360*100},a={paletteRgba:rn($y),paletteHue:rn(0)},c=xp(function(t,e){var n=lk.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=lk.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return lk.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:v({y:0})},components:[n,r],sliderBehaviours:Tc([ph.config({})]),onChange:function(t,e,n){to(t,dk,{value:n})}})}(0,e)),s=xp(i.sketch({})),l=xp(o.sketch({})),f=function(t,e,n){s.getOpt(t).each((function(t){i.setHue(t,n)}))},d=function(t,e){l.getOpt(t).each((function(t){o.updateHex(t,e)}))},m=function(t,e,n){c.getOpt(t).each((function(t){lk.setValue(t,{y:u(n)})}))},g=function(t,e){s.getOpt(t).each((function(t){i.setThumb(t,e)}))},h=function(t,e,n,r){!function(t,e){var n=jy(t);a.paletteRgba.set(n),a.paletteHue.set(e)}(e,n),$(r,(function(r){r(t,e,n)}))};return{uid:n.uid,dom:n.dom,components:[s.asSpec(),c.asSpec(),l.asSpec()],behaviours:Tc([fh("colour-picker-events",[co(fk,(r=[f,m,g],function(t,e){var n=e.event.hex,o=function(t){return Xy(jy(t))}(n);h(t,n,o.hue,r)})),co(mk,function(){var t=[d];return function(e,n){var r=n.event.value,o=a.paletteHue.get(),i=Ky(o,r.x,100-r.y),u=Yy(i);h(e,u,o,t)}}()),co(dk,function(){var t=[f,d];return function(e,n){var r=function(t){return(100-t)/100*360}(n.event.value.y),o=a.paletteRgba.get(),i=Xy(o),u=Ky(r,i.saturation,i.value),c=Yy(u);h(e,c,r,t)}}())]),Hd.config({find:function(t){return l.getOpt(t)}}),ih.config({mode:"acyclic"})])}}})},Ok=function(){return Hd.config({find:P.some})},_k=function(t){return Hd.config({find:t.getOpt})},Ek=function(t){return Hd.config({find:function(e){return Po(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},Dk={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},Ak=function(t){return function(t){return Dk[t]}(t)},Mk=tinymce.util.Tools.resolve("tinymce.Resource"),zk=tinymce.util.Tools.resolve("tinymce.util.Tools"),Rk=ae([Ke("preprocess",b),Ke("postprocess",b)]),Nk=function(t,e,n){return Af.config(Wt({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},Bk=function(t,e,n){return Nk(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}))},Pk=function(t,e){var n=Oe("RepresentingConfigs.memento processors",Rk,e);return Af.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=Af.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);Af.setValue(i,o)}}})},Ik=Nk,Lk=function(t){return Bk(t,ei,ni)},Hk=function(t){return Af.config({store:{mode:"memory",initialValue:t}})},Vk=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){$(t,(function(t){t(e,n)}))}},o=function(t,e){if(!Zd.isDisabled(t)){var n=e.event.raw;u(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;u(t,n.files)},u=function(n,r){Af.setValue(n,function(t,e){var n=zk.explode(e.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"));return K(lt(t),(function(t){return j(n,(function(e){return gn(t.name.toLowerCase(),"."+e.toLowerCase())}))}))}(r,e)),to(n,hx,{name:t.name})},a=xp({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Tc([fh("input-file-events",[go(xr()),go(Nr())])])}),c=t.label.map((function(t){return gx(t,e)})),s=ux.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Tc([Hk([]),Ok(),Zd.config({}),Eh.config({toggleClass:"dragenter",toggleOnExecute:!1}),fh("dropzone-events",[co("dragenter",r([n,Eh.toggle])),co("dragleave",r([n,Eh.toggle])),co("dragover",n),co("drop",r([n,o])),co(wr(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},wp.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[a.asSpec()],action:function(t){a.get(t).element.dom.click()},buttonBehaviours:Tc([sx.config({}),ty(e.isDisabled),Qb()])})]}]}}}});return fx(c,s,["tox-form__group--stretched"],[])},Fk=hi("alloy-fake-before-tabstop"),jk=hi("alloy-fake-after-tabstop"),Uk=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:Tc([ph.config({ignore:!0}),sx.config({})])}},Wk=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[Uk([Fk]),t,Uk([jk])],behaviours:Tc([Ek(1)])}},qk=function(t,e){to(t,vr(),{raw:{which:9,shiftKey:e}})},$k=function(t,e){var n=e.element;Ji(n,Fk)?qk(t,!0):Ji(n,jk)&&qk(t,!1)},Gk=function(t){return Fw(t,["."+Fk,"."+jk].join(","),S)},Kk=!(Vn().browser.isIE()||Vn().browser.isEdge()),Xk=function(t,e){var n=Kk&&t.sandboxed,r=O(O({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(t){var e=rn("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)oi(n.element,"srcdoc",r);else{oi(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}}(n),i=t.label.map((function(t){return gx(t,e)})),u=ux.parts.field({factory:{sketch:function(t){return Wk({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:Tc([sx.config({}),ph.config({}),Ik(P.none(),o.getValue,o.setValue)])})}}});return fx(i,u,["tox-form__group--stretched"],[])},Yk=function(t,e){return Zk(document.createElement("canvas"),t,e)},Jk=function(t){var e=Yk(t.width,t.height);return Qk(e).drawImage(t,0,0),e},Qk=function(t){return t.getContext("2d")},Zk=function(t,e,n){return t.width=e,t.height=n,t},tT=function(t){return t.naturalWidth||t.width},eT=function(t){return t.naturalHeight||t.height},nT=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(u,this),r(a,this))},e=window,n=t.immediateFn||"function"==typeof e.setImmediate&&e.setImmediate||function(t){return setTimeout(t,1)},r=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.apply(e,n)}},o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(o){return void t.reject(o)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void l(r(e,t),r(u,this),r(a,this))}this._state=!0,this._value=t,c.call(this)}catch(n){a.call(this,n)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function s(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}var l=function(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(o){if(r)return;r=!0,n(o)}};return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new s(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(t,e){if(0===r.length)return t([]);for(var n=r.length,o=function(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),e)}r[i]=u,0==--n&&t(r)}catch(c){e(c)}},i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++){o[r].then(t,n)}}))},t}(),rT=function(t){return new nT((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return P.none();for(var r=n[1],o=e[1],i=1024,u=atob(o),a=u.length,c=Math.ceil(a/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,d=Math.min(f+i,a),m=new Array(d-f),g=f,h=0;g<d;++h,++g)m[h]=u[g].charCodeAt(0);s[l]=new Uint8Array(m)}return P.some(new Blob(s,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))},oT=function(t,e,n){return e=e||"image/png",d(HTMLCanvasElement.prototype.toBlob)?new nT((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):rT(t.toDataURL(e,n))},iT=function(t){return function(t){return new nT((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)},u=function(){i(),e(o)},a=function(){i(),n("Unable to load data of type "+t.type+": "+r)};o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&setTimeout(u,0)}))}(t).then((function(t){uT(t);var e=Yk(tT(t),eT(t));return Qk(e).drawImage(t,0,0),e}))},uT=function(t){URL.revokeObjectURL(t.src)},aT=function(t,e,n){var r=e.type,o=v(r),i=v(n),u=function(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))};return{getType:o,toBlob:function(){return nT.resolve(e)},toDataURL:i,toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return oT(t,e,n)}))},toAdjustedDataURL:u,toAdjustedBase64:function(t,e){return u(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(Jk)}}},cT=function(t){return function(t){return new nT((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return aT(iT(t),t,e)}))},sT=function(t,e){return oT(t,e).then((function(e){return aT(nT.resolve(t),e,t.toDataURL())}))},lT=function(t,e,n){var r="string"==typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r},fT=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10],dT=function(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)r[u]=e[u+5*i];for(u=0;u<5;u++){n=0;for(var a=0;a<5;a++)n+=t[u+5*a]*r[a];o[u+5*i]=n}}return o},mT=function(t,e){return t.toCanvas().then((function(n){return gT(n,t.getType(),e)}))},gT=function(t,e,n){var r=Qk(t),o=function(t,e){for(var n,r,o,i,u=t.data,a=e[0],c=e[1],s=e[2],l=e[3],f=e[4],d=e[5],m=e[6],g=e[7],h=e[8],p=e[9],v=e[10],b=e[11],y=e[12],w=e[13],x=e[14],C=e[15],S=e[16],k=e[17],T=e[18],O=e[19],_=0;_<u.length;_+=4)n=u[_],r=u[_+1],o=u[_+2],i=u[_+3],u[_]=n*a+r*c+o*s+i*l+f,u[_+1]=n*d+r*m+o*g+i*h+p,u[_+2]=n*v+r*b+o*y+i*w+x,u[_+3]=n*C+r*S+o*k+i*T+O;return t}(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(o,0,0),sT(t,e)},hT=function(t,e,n){var r=Qk(t),o=r.getImageData(0,0,t.width,t.height),i=r.getImageData(0,0,t.width,t.height);return i=function(t,e,n){for(var r=function(t,e,n){return t>n?t=n:t<e&&(t=e),t},o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),u=t.data,a=e.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,h=0;h<o;h++)for(var p=0;p<o;p++){var v=r(f+p-i,0,c-1),b=4*(r(l+h-i,0,s-1)*c+v),y=n[h*o+p];d+=u[b]*y,m+=u[b+1]*y,g+=u[b+2]*y}var w=4*(l*c+f);a[w]=r(d,0,255),a[w+1]=r(m,0,255),a[w+2]=r(g,0,255)}return e}(o,i,n),r.putImageData(i,0,0),sT(t,e)},pT=function(t){return function(e,n){return mT(e,t([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],n))}},vT=(nC=[-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1],function(t){return mT(t,nC)}),bT=pT((function(t,e){return e=lT(255*e,-255,255),dT(t,[1,0,0,0,e,0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])})),yT=pT((function(t,e){var n;return e=lT(e,-1,1),n=(e*=100)<0?127+e/100*127:127*(n=0===(n=e%1)?fT[e]:fT[Math.floor(e)]*(1-n)+fT[Math.floor(e)+1]*n)+127,dT(t,[n/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])})),wT=function(t,e,n,r){return mT(t,function(t,e,n,r){return e=lT(e,0,2),n=lT(n,0,2),r=lT(r,0,2),dT(t,[e,0,0,0,0,0,n,0,0,0,0,0,r,0,0,0,0,0,1,0,0,0,0,0,1])}([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],e,n,r))},xT=(rC=[0,-1,0,-1,5,-1,0,-1,0],function(t){return function(t,e){return t.toCanvas().then((function(n){return hT(n,t.getType(),e)}))}(t,rC)}),CT=(oC=function(t,e){return 255*Math.pow(t/255,1-e)},function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){for(var r=Qk(t),o=new Array(256),i=0;i<o.length;i++)o[i]=oC(i,n);var u=function(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t}(r.getImageData(0,0,t.width,t.height),o);return r.putImageData(u,0,0),sT(t,e)}(n,t.getType(),e)}))}),ST=function(t,e,n){var r=tT(t),o=eT(t),i=e/r,u=n/o,a=!1;(i<.5||i>2)&&(i=i<.5?.5:2,a=!0),(u<.5||u>2)&&(u=u<.5?.5:2,a=!0);var c=kT(t,i,u);return a?c.then((function(t){return ST(t,e,n)})):c},kT=function(t,e,n){return new nT((function(r){var o=tT(t),i=eT(t),u=Math.floor(o*e),a=Math.floor(i*n),c=Yk(u,a);Qk(c).drawImage(t,0,0,o,i,0,0,u,a),r(c)}))},TT=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},OT=function(t,e,n){var r=(n<0?360+n:n)*Math.PI/180,o=t.width,i=t.height,u=Math.sin(r),a=Math.cos(r),c=TT(Math.abs(o*a)+Math.abs(i*u)),s=TT(Math.abs(o*u)+Math.abs(i*a)),l=Yk(c,s),f=Qk(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(t,-o/2,-i/2),sT(l,e)},_T=function(t,e,n){var r=Yk(t.width,t.height),o=Qk(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),sT(r,e)},ET=function(t,e,n,r,o,i){var u=Yk(o,i);return Qk(u).drawImage(t,-n,-r),sT(u,e)},DT=function(t){return vT(t)},AT=function(t){return xT(t)},MT=function(t,e){return CT(t,e)},zT=function(t,e){return bT(t,e)},RT=function(t,e){return yT(t,e)},NT=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return _T(n,t.getType(),e)}))}(t,e)},BT=function(t,e,n,r,o){return function(t,e,n,r,o){return t.toCanvas().then((function(i){return ET(i,t.getType(),e,n,r,o)}))}(t,e,n,r,o)},PT=function(t,e,n){return function(t,e,n){return t.toCanvas().then((function(r){return ST(r,e,n).then((function(e){return sT(e,t.getType())}))}))}(t,e,n)},IT=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return OT(n,t.getType(),e)}))}(t,e)},LT=function(t,e,n){return Mp(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:n},e)},HT=function(t,e){return LT(t,e,[])},VT=function(t,e){return LT(t,e,[lh.config({})])},FT=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:Tc([lh.config({})])}},jT=hi("toolbar.button.execute"),UT=((iC={})[zr()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],iC),WT=hi("update-menu-text"),qT=hi("update-menu-icon"),$T=function(t,e,n){var r=rn(h),o=t.text.map((function(t){return xp(FT(t,e,n.providers))})),i=t.icon.map((function(t){return xp(VT(t,n.providers.icons))})),u=function(t,e){var n=Af.getValue(t);return ph.focus(n),to(n,"keydown",{raw:e.event.raw}),bC.close(n),P.some(!0)},a=t.role.fold((function(){return{}}),(function(t){return{role:t}})),c=t.tooltip.fold((function(){return{}}),(function(t){var e=n.providers.translate(t);return{title:e,"aria-label":e}})),s=Mp("chevron-down",{tag:"div",classes:[e+"__select-chevron"]},n.providers.icons);return xp(bC.sketch(O(O(O({},t.uid?{uid:t.uid}:{}),a),{dom:{tag:"button",classes:[e,e+"--select"].concat(q(t.classes,(function(t){return e+"--"+t}))),attributes:O({},c)},components:cy([i.map((function(t){return t.asSpec()})),o.map((function(t){return t.asSpec()})),P.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:Tc(E(E([],t.dropdownBehaviours),[ty((function(){return t.disabled||n.providers.isDisabled()})),Qb(),wC.config({}),lh.config({}),fh("dropdown-events",[oy(t,r),iy(t,r)]),fh("menubutton-update-display-text",[co(WT,(function(t,e){o.bind((function(e){return e.getOpt(t)})).each((function(t){lh.set(t,[Du(n.providers.translate(e.event.text))])}))})),co(qT,(function(t,e){i.bind((function(e){return e.getOpt(t)})).each((function(t){lh.set(t,[VT(e.event.icon,n.providers.icons)])}))}))])])),eventOrder:Wt(UT,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:Tc([ih.config({mode:"special",onLeft:u,onRight:u})]),lazySink:n.getSink,toggleClass:e+"--active",parts:{menu:Hv(0,t.columns,t.presets)},fetch:function(e){return Hx(w(t.fetch,e))}}))).asSpec()},GT=function(t){return"separator"===t.type},KT={type:"separator"},XT=function(t,e){var n=Y(t,(function(t,n){return function(t){return r(t)}(n)?""===n?t:"|"===n?t.length>0&&!GT(t[t.length-1])?t.concat([KT]):t:Ft(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&>(n[n.length-1])&&n.pop(),n},YT=function(t,e){return function(t){return Ft(t,"getSubmenuItems")}(t)?function(t,e){var n=t.getSubmenuItems(),r=JT(n,e);return{item:t,menus:Wt(r.menus,Xn(t.value,r.items)),expansions:Wt(r.expansions,Xn(t.value,t.value))}}(t,e):{item:t,menus:{},expansions:{}}},JT=function(t,e){var n=XT(r(t)?t.split(" "):t,e);return X(n,(function(t,n){var r=function(t){if(GT(t))return t;var e=Vt(t,"value").getOrThunk((function(){return hi("generated-menu-item")}));return Wt({value:e},t)}(n),o=YT(r,e);return{menus:Wt(t.menus,o.menus),items:[o.item].concat(t.items),expansions:Wt(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},QT=function(t,e,n,r){var o=hi("primary-menu"),i=JT(t,n.shared.providers.menuItems());if(0===i.items.length)return P.none();var u=Lw(o,i.items,e,n,r),a=Nt(i.menus,(function(t,r){return Lw(r,t,e,n,!1)})),c=Wt(a,Xn(o,u));return P.from(Qh.tieredData(o,c,i.expansions))},ZT=function(t){return{isDisabled:function(){return Zd.isDisabled(t)},setDisabled:function(e){return Zd.set(t,e)},setActive:function(e){var n=t.element;e?(Ki(n,"tox-tbtn--enabled"),oi(n,"aria-pressed",!0)):(Yi(n,"tox-tbtn--enabled"),ci(n,"aria-pressed"))},isActive:function(){return Ji(t.element,"tox-tbtn--enabled")}}},tO=function(t,e,n,r){return $T({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(QT(t,xv.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:ZT,columns:1,presets:"normal",classes:[],dropdownBehaviours:[sx.config({})]},e,n.shared)},eO=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each((function(n){e().getOpt(n).each((function(e){Rc(e.element),to(e,bx,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(q(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return O(O({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},nO=function(t,e,n,r,o,i){void 0===n&&(n=[]);var u=e.fold((function(){return{}}),(function(t){return{action:t}})),a=O({buttonBehaviours:Tc([ty((function(){return t.disabled||i.isDisabled()})),Qb(),sx.config({}),fh("button press",[ao("click"),ao("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Wt(a,{dom:r});return Wt(c,{components:o})},rO=function(t,e,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({})},i=t.icon.map((function(t){return HT(t,n.icons)})),u=cy([i]);return nO(t,e,r,o,u,n)},oO=function(t,e,n,r){void 0===r&&(r=[]);var o=rO(t,P.some(e),n,r);return wp.sketch(o)},iO=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),u=t.icon?t.icon.map((function(t){return HT(t,n.icons)})):P.none(),a=u.isSome()?cy([u]):[],c=u.isSome()?{}:{innerHtml:i},s=E(E(E(E([],t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"]),u.isSome()?["tox-button--icon"]:[]),t.borderless?["tox-button--naked"]:[]),o),l=O(O({tag:"button",classes:s},c),{attributes:{title:i}});return nO(t,e,r,l,a,n)},uO=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=iO(t,P.some(e),n,r,o);return wp.sketch(i)},aO=function(t,e){return function(n){"custom"===e?to(n,bx,{name:t,value:{}}):"submit"===e?Zr(n,yx):"cancel"===e?Zr(n,vx):console.error("Unknown button type: ",e)}},cO=function(t,e,n){if(function(t,e){return"menu"===e}(0,e)){var r=t,o=O(O({},t),{onSetup:function(e){return e.setDisabled(t.disabled),h},fetch:eO(r.items,(function(){return i}),n)}),i=xp(tO(o,"tox-tbtn",n,P.none()));return i.asSpec()}if(function(t,e){return"custom"===e||"cancel"===e||"submit"===e}(0,e)){var u=aO(t.name,e),a=O(O({},t),{borderless:!1});return uO(a,u,n.shared.providers,[])}console.error("Unknown footer button type: ",e)},sO=function(t,e){var n,r,o=aO(t.name,"custom");return n=P.none(),r=ux.parts.field(O({factory:wp},iO(t,P.some(o),e,[Hk(""),Ok()]))),fx(n,r,[],[])},lO=v([Ke("field1Name","field1"),Ke("field2Name","field2"),Na("onLockedChange"),Aa(["lockClass"]),Ke("locked",!1),Nf("coupledFieldBehaviours",[Hd,Af])]),fO=function(t,e){return ud({factory:ux,name:t,overrides:function(t){return{fieldBehaviours:Tc([fh("coupled-input-behaviour",[co(yr(),(function(n){(function(t,e,n){return wd(t,e,n).bind(Hd.getCurrent)})(n,t,e).each((function(e){wd(n,t,"lock").each((function(r){Eh.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},dO=v([fO("field1","field2"),fO("field2","field1"),ud({factory:wp,schema:[ze("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:Tc([Eh.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),mO=Bd({name:"FormCoupledInputs",configFields:lO(),partFields:dO(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:Bf(t.coupledFieldBehaviours,[Hd.config({find:P.some}),Af.config({store:{mode:"manual",getValue:function(e){var n,r=Td(e,t,["field1","field2"]);return(n={})[t.field1Name]=Af.getValue(r.field1()),n[t.field2Name]=Af.getValue(r.field2()),n},setValue:function(e,n){var r=Td(e,t,["field1","field2"]);jt(n,t.field1Name)&&Af.setValue(r.field1(),n[t.field1Name]),jt(n,t.field2Name)&&Af.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return wd(e,t,"field1")},getField2:function(e){return wd(e,t,"field2")},getLock:function(e){return wd(e,t,"lock")}}}},apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),gO=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==e){var n=parseFloat(e[1]),r=e[2];return gt.value({value:n,unit:r})}return gt.error(t)},hO=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return Ft(n,t)};return t.unit===e?P.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?P.some(t.value):P.some(t.value/n[t.unit]*n[e]):P.none()},pO=function(t){return P.none()},vO=function(t,e){var n=gO(t).toOptional(),r=gO(e).toOptional();return nu(n,r,(function(t,e){return hO(t,e.unit).map((function(t){return e.value/t})).map((function(t){return n=t,r=e.unit,function(t){return hO(t,r).map((function(t){return{value:t*n,unit:r}}))};var n,r})).getOr(pO)})).getOr(pO)},bO=function(t,e){var n=pO,r=hi("ratio-event"),o=function(t){return Mp(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},e.icons)},i=mO.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[o("lock"),o("unlock")],buttonBehaviours:Tc([Zd.config({disabled:function(){return t.disabled||e.isDisabled()}}),Qb(),sx.config({})])}),u=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},a=function(n){return ux.parts.field({factory:Dx,inputClasses:["tox-textfield"],inputBehaviours:Tc([Zd.config({disabled:function(){return t.disabled||e.isDisabled()}}),Qb(),sx.config({}),fh("size-input-events",[co(hr(),(function(t,e){to(t,r,{isField1:n})})),co(wr(),(function(e,n){to(e,hx,{name:t.name})}))])]),selectOnFocus:!1})},c=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},s=mO.parts.field1(u([ux.parts.label(c("Width")),a(!0)])),l=mO.parts.field2(u([ux.parts.label(c("Height")),a(!1)]));return mO.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[s,l,u([c(" "),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){gO(Af.getValue(t)).each((function(t){n(t).each((function(t){Af.setValue(e,function(t){var e,n={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},r=t.value.toFixed((e=t.unit)in n?n[e]:1);return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit}(t))}))}))},coupledFieldBehaviours:Tc([Zd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){mO.getField1(t).bind(ux.getField).each(Zd.disable),mO.getField2(t).bind(ux.getField).each(Zd.disable),mO.getLock(t).each(Zd.disable)},onEnabled:function(t){mO.getField1(t).bind(ux.getField).each(Zd.enable),mO.getField2(t).bind(ux.getField).each(Zd.enable),mO.getLock(t).each(Zd.enable)}}),Qb(),fh("size-input-events2",[co(r,(function(t,e){var r=e.event.isField1,o=r?mO.getField1(t):mO.getField2(t),i=r?mO.getField2(t):mO.getField1(t),u=o.map(Af.getValue).getOr(""),a=i.map(Af.getValue).getOr("");n=vO(u,a)}))])])})},yO={undo:v(hi("undo")),redo:v(hi("redo")),zoom:v(hi("zoom")),back:v(hi("back")),apply:v(hi("apply")),swap:v(hi("swap")),transform:v(hi("transform")),tempTransform:v(hi("temp-transform")),transformApply:v(hi("transform-apply"))},wO=v("save-state"),xO=v("disable"),CO=v("enable"),SO={formActionEvent:bx,saveState:wO,disable:xO,enable:CO},kO=function(t,e){var n=function(t,n,r,o){return xp(uO({name:t,text:t,disabled:r,primary:o,icon:P.none(),borderless:!1},n,e))},r=function(t,n,r,o){return xp(oO({name:t,icon:P.some(t),tooltip:P.some(n),disabled:o,primary:!1,borderless:!1},r,e))},o=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Zd)&&Zd.disable(n)}))},i=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Zd)&&Zd.enable(n)}))},u={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},a=h,c=function(t,e,n){to(t,e,n)},s=function(t){return Zr(t,SO.disable())},l=function(t){return Zr(t,SO.enable())},f=function(t,e){s(t),c(t,yO.transform(),{transform:e}),l(t)},d=function(t){return function(){tt.getOpt(t).each((function(t){lh.set(t,[Q])}))}},m=function(t,e){s(t),c(t,yO.transformApply(),{transform:e,swap:d(t)}),l(t)},g=function(){return n("Back",(function(t){return c(t,yO.back(),{swap:d(t)})}),!1,!1)},p=function(){return xp({dom:{tag:"div",classes:["tox-spacer"]},behaviours:Tc([Zd.config({})])})},b=function(){return n("Apply",(function(t){return c(t,yO.apply(),{swap:d(t)})}),!0,!0)},y=[g(),p(),n("Apply",(function(e){m(e,(function(e){var n=t.getRect();return BT(e,n.x,n.y,n.w,n.h)})),t.hideCrop()}),!1,!0)],w=nx.sketch({dom:u,components:y.map((function(t){return t.asSpec()})),containerBehaviours:Tc([fh("image-tools-crop-buttons-events",[co(SO.disable(),(function(t,e){o(y,t)})),co(SO.enable(),(function(t,e){i(y,t)}))])])}),x=xp(bO({name:"size",label:P.none(),constrain:!0,disabled:!1},e)),C=[g(),p(),x,p(),n("Apply",(function(t){x.getOpt(t).each((function(e){var n=Af.getValue(e),r=function(t,e){return function(n){return PT(n,t,e)}}(parseInt(n.width,10),parseInt(n.height,10));m(t,r)}))}),!1,!0)],S=nx.sketch({dom:u,components:C.map((function(t){return t.asSpec()})),containerBehaviours:Tc([fh("image-tools-resize-buttons-events",[co(SO.disable(),(function(t,e){o(C,t)})),co(SO.enable(),(function(t,e){i(C,t)}))])])}),k=function(t,e){return function(n){return t(n,e)}},T=k(NT,"h"),O=k(NT,"v"),_=k(IT,-90),E=k(IT,90),D=function(t,e){!function(t,e){s(t),c(t,yO.tempTransform(),{transform:e}),l(t)}(t,e)},A=[g(),p(),r("flip-horizontally","Flip horizontally",(function(t){D(t,T)}),!1),r("flip-vertically","Flip vertically",(function(t){D(t,O)}),!1),r("rotate-left","Rotate counterclockwise",(function(t){D(t,_)}),!1),r("rotate-right","Rotate clockwise",(function(t){D(t,E)}),!1),p(),b()],M=nx.sketch({dom:u,components:A.map((function(t){return t.asSpec()})),containerBehaviours:Tc([fh("image-tools-fliprotate-buttons-events",[co(SO.disable(),(function(t,e){o(A,t)})),co(SO.enable(),(function(t,e){i(A,t)}))])])}),z=function(t,n,r,o,i){var u=lk.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}),a=lk.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=lk.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return xp(lk.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:i,getInitialValue:v({x:o})},components:[u,a,c],sliderBehaviours:Tc([ph.config({})]),onChoose:n}))},R=function(t,e,n,r,o){return z(t,(function(t,n,r){var o=k(e,r.x/100);f(t,o)}),n,r,o)},N=function(t,e,n,r,a){var c=function(t,e,n,r,o){return[g(),R(t,e,n,r,o),b()]}(t,e,n,r,a);return nx.sketch({dom:u,components:c.map((function(t){return t.asSpec()})),containerBehaviours:Tc([fh("image-tools-filter-panel-buttons-events",[co(SO.disable(),(function(t,e){o(c,t)})),co(SO.enable(),(function(t,e){i(c,t)}))])])})},B=[g(),p(),b()],I=nx.sketch({dom:u,components:B.map((function(t){return t.asSpec()}))}),L=N("Brightness",zT,-100,0,100),H=N("Contrast",RT,-100,0,100),V=N("Gamma",MT,-100,0,100),F=function(t,e,n){return function(r){return function(t,e,n,r){return wT(t,e,n,r)}(r,t,e,n)}},j=function(t){return z(t,(function(t,e,n){var r=U.getOpt(t),o=q.getOpt(t),i=W.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=Af.getValue(e).x/100,i=Af.getValue(r).x/100,u=Af.getValue(n).x/100,a=F(o,i,u);f(t,a)}))}))}))}),0,100,200)},U=j("R"),W=j("G"),q=j("B"),$=[g(),U,W,q,b()],G=nx.sketch({dom:u,components:$.map((function(t){return t.asSpec()}))}),K=function(t,e,n){return function(r){c(r,yO.swap(),{transform:e,swap:function(){tt.getOpt(r).each((function(e){lh.set(e,[t]),n(e)}))}})}},X=P.some(AT),Y=P.some(DT),J=[r("crop","Crop",K(w,P.none(),(function(e){t.showCrop()})),!1),r("resize","Resize",K(S,P.none(),(function(e){x.getOpt(e).each((function(e){var n=t.getMeasurements(),r=n.width,o=n.height;Af.setValue(e,{width:r,height:o})}))})),!1),r("orientation","Orientation",K(M,P.none(),a),!1),r("brightness","Brightness",K(L,P.none(),a),!1),r("sharpen","Sharpen",K(I,X,a),!1),r("contrast","Contrast",K(H,P.none(),a),!1),r("color-levels","Color levels",K(G,P.none(),a),!1),r("gamma","Gamma",K(V,P.none(),a),!1),r("invert","Invert",K(I,Y,a),!1)],Q=nx.sketch({dom:u,components:J.map((function(t){return t.asSpec()}))}),Z=nx.sketch({dom:{tag:"div"},components:[Q],containerBehaviours:Tc([lh.config({})])}),tt=xp(Z);return{memContainer:tt,getApplyButton:function(t){return tt.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))}}},TO=tinymce.util.Tools.resolve("tinymce.geom.Rect"),OO=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),_O=tinymce.util.Tools.resolve("tinymce.util.Observable"),EO=tinymce.util.Tools.resolve("tinymce.util.VK"),DO=function(t){var e,n;if(t.changedTouches)for(e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]};function AO(t,e){var n,r,o,i,u=e.document||document,a=u.getElementById(e.handle||t),c=function(t){if(DO(t),t.button!==r)return s(t);t.deltaX=t.screenX-o,t.deltaY=t.screenY-i,t.preventDefault(),e.drag(t)},s=function(t){DO(t),OO(u).off("mousemove touchmove",c).off("mouseup touchend",s),n.remove(),e.stop&&e.stop(t)};return OO(a).on("mousedown touchstart",(function(t){var l,f=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),u=e(n.offsetWidth,r.offsetWidth),a=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight);return{width:o<u?i:o,height:a<e(n.offsetHeight,r.offsetHeight)?c:a}}(u);DO(t),t.preventDefault(),r=t.button;var d=a;o=t.screenX,i=t.screenY,l=window.getComputedStyle?window.getComputedStyle(d,null).getPropertyValue("cursor"):d.runtimeStyle.cursor,n=OO("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:l}).appendTo(u.body),OO(u).on("mousemove touchmove",c).on("mouseup touchend",s),e.start(t)})),{destroy:function(){OO(a).off()}}}var MO=0,zO=function(t,e,n,r,o){var i,u="tox-crid-"+MO++,a=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],c=["top","right","bottom","left"],s=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}},l=function(e,r,o,i){var u,a,c,l,f;u=r.x,a=r.y,c=r.w,l=r.h,u+=o*e.deltaX,a+=i*e.deltaY,(c+=o*e.deltaW)<20&&(c=20),(l+=i*e.deltaH)<20&&(l=20),f=t=TO.clamp({x:u,y:a,w:c,h:l},n,"move"===e.name),f=s(n,f),g.fire("updateRect",{rect:f}),m(f)},f=function(t){var n=function(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),OO("#"+u+"-"+t,r).css({left:e.x,top:e.y,width:e.w,height:e.h})};zk.each(a,(function(e){OO("#"+u+"-"+e.name,r).css({left:t.w*e.xMul+t.x,top:t.h*e.yMul+t.y})})),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)},d=function(e){f(t=e)},m=function(t){var e,r;d((e=n,{x:(r=t).x+e.x,y:r.y+e.y,w:r.w,h:r.h}))};OO('<div id="'+u+'" class="tox-croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),zk.each(c,(function(t){OO("#"+u,r).append('<div id="'+u+"-"+t+'"class="tox-croprect-block" style="display: none" data-mce-bogus="all">')})),zk.each(a,(function(t){OO("#"+u,r).append('<div id="'+u+"-"+t.name+'" class="tox-croprect-handle tox-croprect-handle-'+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')})),i=zk.map(a,(function(e){var n;return AO(u,{document:r.ownerDocument,handle:u+"-"+e.name,start:function(){n=t},drag:function(t){l(e,n,t.deltaX,t.deltaY)}})})),f(t),OO(r).on("focusin focusout",(function(t){OO(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")})),OO(r).on("keydown",(function(e){var n;zk.each(a,(function(t){if(e.target.id===u+"-"+t.name)return n=t,!1}));var r=function(t,e,r,o,i){t.stopPropagation(),t.preventDefault(),l(n,r,o,i)};switch(e.keyCode){case EO.LEFT:r(e,0,t,-10,0);break;case EO.RIGHT:r(e,0,t,10,0);break;case EO.UP:r(e,0,t,0,-10);break;case EO.DOWN:r(e,0,t,0,10);break;case EO.ENTER:case EO.SPACEBAR:e.preventDefault(),o()}}));var g=zk.extend({toggleVisibility:function(t){var e=zk.map(a,(function(t){return"#"+u+"-"+t.name})).concat(zk.map(c,(function(t){return"#"+u+"-"+t}))).join(",");t?OO(e,r).show():OO(e,r).hide()},setClampRect:function(e){n=e,f(t)},setRect:d,getInnerRect:function(){return s(n,t)},setInnerRect:m,setViewPortRect:function(n){e=n,f(t)},destroy:function(){zk.each(i,(function(t){t.destroy()})),i=[]}},_O);return g},RO=function(t){var e=xp({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),n=rn(1),r=ns(),o=rn({x:0,y:0,w:1,h:1}),i=rn({x:0,y:0,w:1,h:1}),u=function(t,i){s.getOpt(t).each((function(t){var u=n.get(),a=Wu(t.element),c=Pu(t.element),s=i.dom.naturalWidth*u,l=i.dom.naturalHeight*u,f=Math.max(0,a/2-s/2),d=Math.max(0,c/2-l/2),m={left:f.toString()+"px",top:d.toString()+"px",width:s.toString()+"px",height:l.toString()+"px",position:"absolute"};fu(i,m),e.getOpt(t).each((function(t){fu(t.element,m)})),r.on((function(t){var e=o.get();t.setRect({x:e.x*u+f,y:e.y*u+d,w:e.w*u,h:e.h*u}),t.setClampRect({x:f,y:d,w:s,h:l}),t.setViewPortRect({x:0,y:0,w:a,h:c})}))}))},a=function(t,e){var r,a=un.fromTag("img");return oi(a,"src",e),(r=a.dom,new Kp((function(t){var e=function(){r.removeEventListener("load",e),t(r)};r.complete?t(r):r.addEventListener("load",e)}))).then((function(){t.getSystem().isConnected()&&s.getOpt(t).map((function(t){var e=Au({element:a});lh.replaceAt(t,1,P.some(e));var r=i.get(),c={x:0,y:0,w:a.dom.naturalWidth,h:a.dom.naturalHeight};i.set(c);var l=TO.inflate(c,-20,-20);o.set(l),r.w===c.w&&r.h===c.h||function(t,e){s.getOpt(t).each((function(t){var r=Wu(t.element),o=Pu(t.element),i=e.dom.naturalWidth,u=e.dom.naturalHeight,a=Math.min(r/i,o/u);a>=1?n.set(1):n.set(a)}))}(t,a),u(t,a)}))}))},c=nx.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[e.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:Tc([fh("image-panel-crop-events",[vo((function(t){s.getOpt(t).each((function(t){var e=t.element.dom,i=zO({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},e,h);i.toggleVisibility(!1),i.on("updateRect",(function(t){var e=t.rect,r=n.get(),i={x:Math.round(e.x/r),y:Math.round(e.y/r),w:Math.round(e.w/r),h:Math.round(e.h/r)};o.set(i)})),r.set(i)}))}))])])}],containerBehaviours:Tc([lh.config({}),fh("image-panel-events",[vo((function(e){a(e,t)}))])])}),s=xp(c);return{memContainer:s,updateSrc:a,zoom:function(t,e){var r=n.get(),o=e>0?Math.min(2,r+.1):Math.max(.1,r-.1);n.set(o),s.getOpt(t).each((function(t){var e=t.components()[1].element;u(t,e)}))},showCrop:function(){r.on((function(t){t.toggleVisibility(!0)}))},hideCrop:function(){r.on((function(t){t.toggleVisibility(!1)}))},getRect:function(){return o.get()},getMeasurements:function(){var t=i.get();return{width:t.w,height:t.h}}}},NO=function(t,e,n,r,o){return oO({name:t,icon:P.some(e),disabled:n,tooltip:P.some(t),primary:!1,borderless:!1},r,o)},BO=function(t,e){e?Zd.enable(t):Zd.disable(t)};var PO,IO,LO,HO=function(t){var e,n,r,o,i=rn(t),u=ns(),a=(n=-1,{data:e=[],add:function(t){var r=e.splice(++n);return e.push(t),{state:t,removed:r}},undo:function(){if(r())return e[--n]},redo:function(){if(o())return e[++n]},canUndo:r=function(){return n>0},canRedo:o=function(){return-1!==n&&n<e.length-1}});a.add(t);var c=function(t){i.set(t)},s=function(t){return{blob:t,url:URL.createObjectURL(t)}},l=function(t){URL.revokeObjectURL(t.url)},f=function(){u.on(l),u.clear()},d=function(t){var e=s(t);c(e);var n,r=a.add(e).removed;return n=r,zk.each(n,l),e.url};return{getBlobState:function(){return i.get()},setBlobState:c,addBlobState:d,getTempState:function(){return u.get().getOrThunk(i.get)},updateTempState:function(t){var e=s(t);return f(),u.set(e),e.url},addTempState:function(t){var e=s(t);return u.set(e),e.url},applyTempState:function(t){return u.get().fold(h,(function(e){d(e.blob),t()}))},destroyTempState:f,undo:function(){var t=a.undo();return c(t),t.url},redo:function(){var t=a.redo();return c(t),t.url},getHistoryStates:function(){return{undoEnabled:a.canUndo(),redoEnabled:a.canRedo()}}}},VO=function(t,e){var n=HO(t.currentState),r=function(t){var e=n.getHistoryStates();d.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),to(t,SO.formActionEvent,{name:SO.saveState(),value:e.undoEnabled})},o=function(t){return t.toBlob()},i=function(t){to(t,SO.formActionEvent,{name:SO.disable(),value:{}})},u=function(t){m.getApplyButton(t).each((function(t){Zd.enable(t)})),to(t,SO.formActionEvent,{name:SO.enable(),value:{}})},a=function(t,e){return i(t),f.updateSrc(t,e)},c=function(t,e,n,c,s){i(t),function(t){return cT(t)}(e).then(n).then(o).then(c).then((function(e){return a(t,e)})).then((function(){r(t),s(),u(t)})).catch((function(e){console.log(e),t.getSystem().isConnected()&&u(t)}))},s=function(t,e,r){var o=n.getBlobState().blob;c(t,o,e,(function(t){return n.updateTempState(t)}),r)},l=function(t){var e=n.getBlobState().url;return n.destroyTempState(),r(t),e},f=RO(t.currentState.url),d=function(t){var e=xp(NO("Undo","undo",!0,(function(t){to(t,yO.undo(),{direction:1})}),t)),n=xp(NO("Redo","redo",!0,(function(t){to(t,yO.redo(),{direction:1})}),t));return{container:nx.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[e.asSpec(),n.asSpec(),NO("Zoom in","zoom-in",!1,(function(t){to(t,yO.zoom(),{direction:1})}),t),NO("Zoom out","zoom-out",!1,(function(t){to(t,yO.zoom(),{direction:-1})}),t)]}),updateButtonUndoStates:function(t,r,o){e.getOpt(t).each((function(t){BO(t,r)})),n.getOpt(t).each((function(t){BO(t,o)}))}}}(e),m=kO(f,e);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[m.memContainer.asSpec(),f.memContainer.asSpec(),d.container],behaviours:Tc([Af.config({store:{mode:"manual",getValue:function(){return n.getBlobState()}}}),fh("image-tools-events",[co(yO.undo(),(function(t,e){var o=n.undo();a(t,o).then((function(e){u(t),r(t)}))})),co(yO.redo(),(function(t,e){var o=n.redo();a(t,o).then((function(e){u(t),r(t)}))})),co(yO.zoom(),(function(t,e){var n=e.event.direction;f.zoom(t,n)})),co(yO.back(),(function(t,e){!function(t){var e=l(t);a(t,e).then((function(e){u(t)}))}(t),(0,e.event.swap)(),f.hideCrop()})),co(yO.apply(),(function(t,e){n.applyTempState((function(){l(t),(0,e.event.swap)()}))})),co(yO.transform(),(function(t,e){return s(t,e.event.transform,h)})),co(yO.tempTransform(),(function(t,e){return function(t,e){var r=n.getTempState().blob;c(t,r,e,(function(t){return n.addTempState(t)}),h)}(t,e.event.transform)})),co(yO.transformApply(),(function(t,e){return function(t,e,r){var o=n.getBlobState().blob;c(t,o,e,(function(e){var r=n.addBlobState(e);return l(t),r}),r)}(t,e.event.transform,e.event.swap)})),co(yO.swap(),(function(t,e){!function(t){d.updateButtonUndoStates(t,!1,!1)}(t);var n=e.event.transform,r=e.event.swap;n.fold((function(){r()}),(function(e){s(t,e,r)}))}))]),Ok()])}},FO=function(t){return!Ft(t,"items")},jO="data-value",UO=function(t,e,n,r){return q(n,(function(n){return FO(n)?{type:"togglemenuitem",text:n.text,value:n.value,active:n.value===r,onAction:function(){Af.setValue(t,n.value),to(t,hx,{name:e}),ph.focus(t)}}:{type:"nestedmenuitem",text:n.text,getSubmenuItems:function(){return UO(t,e,n.items,r)}}}))},WO=function(t,e){return ft(t,(function(t){return FO(t)?ru(t.value===e,t):WO(t.items,e)}))},qO=Nd({name:"HtmlSelect",configFields:[ze("options"),Mf("selectBehaviours",[ph,Af]),Ke("selectClasses",[]),Ke("selectAttributes",{}),Fe("data")],factory:function(t,e){var n=q(t.options,(function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}})),r=t.data.map((function(t){return Xn("initialValue",t)})).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:Rf(t.selectBehaviours,[ph.config({}),Af.config({store:O({mode:"manual",getValue:function(t){return wu(t.element)},setValue:function(e,n){J(t.options,(function(t){return t.value===n})).isSome()&&xu(e.element,n)}},r)})])}}}),$O=function(t,e){var n=t.label.map((function(t){return gx(t,e)})),r=[Zd.config({disabled:function(){return t.disabled||e.isDisabled()}}),Qb(),ih.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return Zr(t,yx),P.some(!0)}}),fh("textfield-change",[co(yr(),(function(e,n){to(e,hx,{name:t.name})})),co(Ar(),(function(e,n){to(e,hx,{name:t.name})}))]),sx.config({})],o=t.validation.map((function(t){return Yx.config({getRoot:function(t){return Ro(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=Af.getValue(e),r=t.validator(n);return Vx(!0===r?gt.value(n):gt.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),i=t.placeholder.fold(v({}),(function(t){return{placeholder:e.translate(t)}})),u=t.inputMode.fold(v({}),(function(t){return{inputmode:t}})),a=O(O({},i),u),c=ux.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:a,inputClasses:[t.classname],inputBehaviours:Tc(Z([r,o])),selectOnFocus:!1,factory:Dx}),s=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),l=[Zd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){ux.getField(t).each(Zd.disable)},onEnabled:function(t){ux.getField(t).each(Zd.enable)}}),Qb()];return fx(n,c,s,l)},GO=Object.freeze({__proto__:null,events:function(t,e){var n=t.stream.streams.setup(t,e);return io([co(t.event,n),bo((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[co(t,(function(){return e.cancel()}))]})).getOr([])))}}),KO=function(t){var e=rn(null);return zi({readState:function(){return{timer:null!==e.get()?"set":"unset"}},setTimer:function(t){e.set(t)},cancel:function(){var t=e.get();null!==t&&t.cancel()}})},XO=Object.freeze({__proto__:null,throttle:KO,init:function(t){return t.stream.streams.state(t)}}),YO=[Re("stream",Ee("mode",{throttle:[ze("delay"),Ke("stopEvent",!0),Pa("streams",{setup:function(t,e){var n=t.stream,r=Ip(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},state:KO})]})),Ke("event","input"),Fe("cancelEvent"),Na("onStream")],JO=_c({fields:YO,name:"streaming",active:GO,state:XO}),QO=function(t,e,n){var r=Af.getValue(n);Af.setValue(e,r),t_(e)},ZO=function(t,e){var n=t.element,r=wu(n),o=n.dom;"number"!==ii(n,"type")&&e(o,r)},t_=function(t){ZO(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},e_=function(t,e,n){if(t.selectsOver){var r=Af.getValue(e),o=t.getDisplayText(r),i=Af.getValue(n);return 0===t.getDisplayText(i).indexOf(o)?P.some((function(){QO(0,e,n),function(t,e){ZO(t,(function(t,n){return t.setSelectionRange(e,n.length)}))}(e,o.length)})):P.none()}return P.none()},n_=v("alloy.typeahead.itemexecute"),r_=v([Fe("lazySink"),ze("fetch"),Ke("minChars",5),Ke("responseTime",1e3),za("onOpen"),Ke("getHotspot",P.some),Ke("getAnchorOverrides",v({})),Ke("layouts",P.none()),Ke("eventOrder",{}),nn("model",{},[Ke("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),Ke("selectsOver",!0),Ke("populateFromBrowse",!0)]),za("onSetValue"),Ra("onExecute"),za("onItemExecute"),Ke("inputClasses",[]),Ke("inputAttributes",{}),Ke("inputStyles",{}),Ke("matchWidth",!0),Ke("useMinWidth",!1),Ke("dismissOnBlur",!0),Aa(["openClass"]),Fe("initialData"),Mf("typeaheadBehaviours",[ph,Af,JO,ih,Eh,Zx]),Ae("previewing",(function(){return rn(!0)}))].concat(Tx()).concat(hC())),o_=v([ad({schema:[Da()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){e_(t.model,r,n).fold((function(){return lm.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&QO(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map((function(t){return to(t,n_(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&QO(t.model,e,n)}))}}}})]),i_=Bd({name:"Typeahead",configFields:r_(),partFields:o_(),factory:function(t,e,n,r){var o=function(e,n,o){t.previewing.set(!1);var i=Zx.getCoupled(e,"sandbox");if(lf.isOpen(i))Hd.getCurrent(i).each((function(t){lm.getHighlighted(t).fold((function(){o(t)}),(function(){oo(i,t.element,"keydown",n)}))}));else{aC(t,u(e),e,i,r,(function(t){Hd.getCurrent(t).each(o)}),zx.HighlightFirst).get(h)}},i=Ox(t),u=function(t){return function(e){return e.map((function(e){var n=Ht(e.menus),r=tt(n,(function(t){return K(t.items,(function(t){return"item"===t.type}))}));return Af.getState(t).update(q(r,(function(t){return t.data}))),e}))}},a=[ph.config({}),Af.config({onSetValue:t.onSetValue,store:O({mode:"dataset",getDataKey:function(t){return wu(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(e,n){xu(e.element,t.model.getDisplayText(n))}},t.initialData.map((function(t){return Xn("initialValue",t)})).getOr({}))}),JO.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(e,n){var o=Zx.getCoupled(e,"sandbox");if(ph.isFocused(e)&&wu(e.element).length>=t.minChars){var i=Hd.getCurrent(o).bind((function(t){return lm.getHighlighted(t).map(Af.getValue)}));t.previewing.set(!0);aC(t,u(e),e,o,r,(function(e){Hd.getCurrent(o).each((function(e){i.fold((function(){t.model.selectsOver&&lm.highlightFirst(e)}),(function(t){lm.highlightBy(e,(function(e){return Af.getValue(e).value===t.value})),lm.getHighlighted(e).orThunk((function(){return lm.highlightFirst(e),P.none()}))}))}))}),zx.HighlightFirst).get(h)}},cancelEvent:Ir()}),ih.config({mode:"special",onDown:function(t,e){return o(t,e,lm.highlightFirst),P.some(!0)},onEscape:function(t){var e=Zx.getCoupled(t,"sandbox");return lf.isOpen(e)?(lf.close(e),P.some(!0)):P.none()},onUp:function(t,e){return o(t,e,lm.highlightLast),P.some(!0)},onEnter:function(e){var n=Zx.getCoupled(e,"sandbox"),r=lf.isOpen(n);if(r&&!t.previewing.get())return Hd.getCurrent(n).bind((function(t){return lm.getHighlighted(t)})).map((function(t){return to(e,n_(),{item:t}),!0}));var o=Af.getValue(e);return Zr(e,Ir()),t.onExecute(n,e,o),r&&lf.close(n),P.some(!0)}}),Eh.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),Zx.config({others:{sandbox:function(e){return mC(t,e,{onOpen:function(){return Eh.on(e)},onClose:function(){return Eh.off(e)}})}}}),fh("typeaheadevents",[wo((function(e){var n=h;sC(t,u(e),e,r,n,zx.HighlightFirst).get(h)})),co(n_(),(function(e,n){var r=Zx.getCoupled(e,"sandbox");QO(t.model,e,n.event.item),Zr(e,Ir()),t.onItemExecute(e,r,n.event.item,Af.getValue(e)),lf.close(r),t_(e)}))].concat(t.dismissOnBlur?[co(Dr(),(function(t){var e=Zx.getCoupled(t,"sandbox");Pc(e.element).isNone()&&lf.close(e)}))]:[]))];return{uid:t.uid,dom:Ex(Wt(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:O(O({},i),Rf(t.typeaheadBehaviours,a)),eventOrder:t.eventOrder}}}),u_=function(t){return O(O({},t),{toCached:function(){return u_(t.toCached())},bindFuture:function(e){return u_(t.bind((function(t){return t.fold((function(t){return Vx(gt.error(t))}),(function(t){return e(t)}))})))},bindResult:function(e){return u_(t.map((function(t){return t.bind(e)})))},mapResult:function(e){return u_(t.map((function(t){return t.map(e)})))},mapError:function(e){return u_(t.map((function(t){return t.mapError(e)})))},foldResult:function(e,n){return t.map((function(t){return t.fold(e,n)}))},withTimeout:function(e,n){return u_(Hx((function(r){var o=!1,i=setTimeout((function(){o=!0,r(gt.error(n()))}),e);t.get((function(t){o||(clearTimeout(i),r(t))}))})))}})},a_=function(t){return u_(Hx(t))},c_=a_,s_={type:"separator"},l_=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:h}},f_=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:h}},d_=function(t,e){return function(t){return q(t,l_)}(function(t,e){return K(e,(function(e){return e.type===t}))}(t,e))},m_=function(t){return d_("header",t.targets)},g_=function(t){return d_("anchor",t.targets)},h_=function(t){return P.from(t.anchorTop).map((function(t){return f_("<top>",t)})).toArray()},p_=function(t){return P.from(t.anchorBottom).map((function(t){return f_("<bottom>",t)})).toArray()},v_=function(t,e){var n=t.toLowerCase();return K(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return dn(e.toLowerCase(),n)||dn(t.value.toLowerCase(),n)}))},b_=function(t,e,n){var r=Af.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold((function(){return[]}),(function(e){var r,i=v_(o,function(t){return q(t,(function(t){return f_(t,t)}))}(n.getHistory(t)));return"file"===t?(r=[i,v_(o,m_(e)),v_(o,Z([h_(e),g_(e),p_(e)]))],Y(r,(function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(s_,e)}),[])):i}))},y_=hi("aria-invalid"),w_=function(t){return function(e,n,r){return Vt(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},x_={bar:w_((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:q(t.items,e.interpreter)}}(t,e.shared)})),collection:w_((function(t,e){return kx(t,e.shared.providers)})),alertbanner:w_((function(t,e){return function(t,e){return nx.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[wp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:Ep(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){to(e,bx,{name:"alert-banner",value:t.url})},buttonBehaviours:Tc([Dp()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})}(t,e.shared.providers)})),input:w_((function(t,e){return function(t,e){return $O({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:P.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),textarea:w_((function(t,e){return function(t,e){return $O({name:t.name,multiline:!0,label:t.label,inputMode:P.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:P.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),label:w_((function(t,e){return function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=q(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:Tc([Ok(),lh.config({}),Lk(P.none()),ih.config({mode:"acyclic"})])}}(t,e.shared)})),iframe:(PO=function(t,e){return Xk(t,e.shared.providers)},function(t,e,n){var r=Wt(e,{source:"dynamic"});return w_(PO)(t,r,n)}),button:w_((function(t,e){return sO(t,e.shared.providers)})),checkbox:w_((function(t,e){return function(t,e){var n=Af.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,e){t.element.dom.checked=e}}}),r=function(t){return t.element.dom.click(),P.some(!0)},o=ux.parts.field({factory:{sketch:b},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:Tc([Ok(),Zd.config({disabled:function(){return t.disabled||e.isDisabled()}}),sx.config({}),ph.config({}),n,ih.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),fh("checkbox-events",[co(wr(),(function(e,n){to(e,hx,{name:t.name})}))])])}),i=ux.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:Tc([wC.config({})])}),u=function(t){return Mp("checked"===t?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},e.icons)},a=xp({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[u("checked"),u("unchecked")]});return ux.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,a.asSpec(),i],fieldBehaviours:Tc([Zd.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){ux.getField(t).each(Zd.disable)},onEnabled:function(t){ux.getField(t).each(Zd.enable)}}),Qb()])})}(t,e.shared.providers)})),colorinput:w_((function(t,e){return kC(t,e.shared,e.colorinput)})),colorpicker:w_((function(t){var e=function(t){return"tox-"+t},n=Tk(Ak,e),r=xp(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){to(t,bx,{name:"hex-valid",value:!0})},onInvalidHex:function(t){to(t,bx,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:Tc([Af.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return Hd.getCurrent(e).bind((function(t){return Af.getValue(t).hex})).map((function(t){return"#"+t})).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(e),o=r.get(t);Hd.getCurrent(o).fold((function(){console.log("Can not find form")}),(function(t){Af.setValue(t,{hex:P.from(n[1]).getOr("")}),bk.getField(t,"hex").each((function(t){Zr(t,yr())}))}))}}}),Ok()])}})),dropzone:w_((function(t,e){return Vk(t,e.shared.providers)})),grid:w_((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:q(t.items,e.interpreter)}}(t,e.shared)})),listbox:w_((function(t,e){return function(t,e){var n=e.shared.providers,r=ct(t.items).filter(FO),o=t.label.map((function(t){return gx(t,n)})),i={dom:{tag:"div",classes:["tox-listboxfield"]},components:[ux.parts.field({dom:{},factory:{sketch:function(n){return $T({uid:n.uid,text:r.map((function(t){return t.text})),icon:P.none(),tooltip:t.label,role:P.none(),fetch:function(n,r){var o=UO(n,t.name,t.items,Af.getValue(n));r(QT(o,xv.CLOSE_ON_EXECUTE,e,!1))},onSetup:v(h),getApi:v({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[sx.config({}),Af.config({store:{mode:"manual",initialValue:r.map((function(t){return t.value})).getOr(""),getValue:function(t){return ii(t.element,jO)},setValue:function(e,n){WO(t.items,n).each((function(t){oi(e.element,jO,t.value),to(e,WT,{text:t.text})}))}}})]},"tox-listbox",e.shared)}}})]};return ux.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Z([o.toArray(),[i]]),fieldBehaviours:Tc([Zd.config({disabled:v(t.disabled),onDisabled:function(t){ux.getField(t).each(Zd.disable)},onEnabled:function(t){ux.getField(t).each(Zd.enable)}})])})}(t,e)})),selectbox:w_((function(t,e){return function(t,e){var n=q(t.items,(function(t){return{text:e.translate(t.text),value:t.value}})),r=t.label.map((function(t){return gx(t,e)})),o=ux.parts.field({dom:{},selectAttributes:{size:t.size},options:n,factory:qO,selectBehaviours:Tc([Zd.config({disabled:function(){return t.disabled||e.isDisabled()}}),sx.config({}),fh("selectbox-change",[co(wr(),(function(e,n){to(e,hx,{name:t.name})}))])])}),i=t.size>1?P.none():P.some(Mp("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},e.icons)),u={dom:{tag:"div",classes:["tox-selectfield"]},components:Z([[o],i.toArray()])};return ux.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Z([r.toArray(),[u]]),fieldBehaviours:Tc([Zd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){ux.getField(t).each(Zd.disable)},onEnabled:function(t){ux.getField(t).each(Zd.enable)}}),Qb()])})}(t,e.shared.providers)})),sizeinput:w_((function(t,e){return bO(t,e.shared.providers)})),urlinput:w_((function(t,e){return function(t,e,n){var r,o=e.shared.providers,i=function(e){var r=Af.getValue(e);n.addToHistory(r.value,t.filetype)},u=ux.parts.field({factory:i_,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":y_,type:"url"},minChars:0,responseTime:0,fetch:function(r){var o=b_(t.filetype,r,n),i=QT(o,xv.BUBBLE_TO_SANDBOX,e,!1);return Vx(i)},getHotspot:function(t){return d.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(Yx)&&Yx.run(t).get(h)},typeaheadBehaviours:Tc(Z([n.getValidationHandler().map((function(e){return Yx.config({getRoot:function(t){return Ro(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){c.getOpt(t).each((function(t){oi(t.element,"title",o.translate(e))}))}},validator:{validate:function(n){var r=Af.getValue(n);return c_((function(n){e({type:t.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=gt.error(t.message);n(e)}else{var r=gt.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[Zd.config({disabled:function(){return t.disabled||o.isDisabled()}}),sx.config({}),fh("urlinput-events",Z(["file"===t.filetype?[co(yr(),(function(e){to(e,hx,{name:t.name})}))]:[],[co(wr(),(function(e){to(e,hx,{name:t.name}),i(e)})),co(Ar(),(function(e){to(e,hx,{name:t.name}),i(e)}))]]))]])),eventOrder:(r={},r[yr()]=["streaming","urlinput-events","invalidating"],r),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:e.shared.getSink,parts:{menu:Hv(0,0,"normal")},onExecute:function(t,e,n){to(e,yx,{})},onItemExecute:function(e,n,r,o){i(e),to(e,hx,{name:t.name})}}),a=t.label.map((function(t){return gx(t,o)})),c=xp(function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),Mp(n,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],attributes:O({title:o.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))},o.icons)}("invalid",P.some(y_),"warning")),s=xp({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[c.asSpec()]}),l=n.getUrlPicker(t.filetype),f=hi("browser.url.event"),d=xp({dom:{tag:"div",classes:["tox-control-wrap"]},components:[u,s.asSpec()],behaviours:Tc([Zd.config({disabled:function(){return t.disabled||o.isDisabled()}})])}),m=xp(uO({name:t.name,icon:P.some("browse"),text:t.label.getOr(""),disabled:t.disabled,primary:!1,borderless:!0},(function(t){return Zr(t,f)}),o,[],["tox-browse-url"]));return ux.sketch({dom:mx([]),components:a.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:Z([[d.asSpec()],l.map((function(){return m.asSpec()})).toArray()])}]),fieldBehaviours:Tc([Zd.config({disabled:function(){return t.disabled||o.isDisabled()},onDisabled:function(t){ux.getField(t).each(Zd.disable),m.getOpt(t).each(Zd.disable)},onEnabled:function(t){ux.getField(t).each(Zd.enable),m.getOpt(t).each(Zd.enable)}}),Qb(),fh("url-input-events",[co(f,(function(e){Hd.getCurrent(e).each((function(n){var r=Af.getValue(n),o=O({fieldname:t.name},r);l.each((function(r){r(o).get((function(r){Af.setValue(n,r),to(e,hx,{name:t.name})}))}))}))}))])])})}(t,e,e.urlinput)})),customeditor:w_((function(t){var e=ns(),n=xp({dom:{tag:t.tag}}),r=ns();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:Tc([fh("custom-editor-events",[vo((function(o){n.getOpt(o).each((function(n){(!function(t){return Ft(t,"init")}(t)?Mk.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)})):t.init(n.element.dom)).then((function(t){r.on((function(e){t.setValue(e)})),r.clear(),e.set(t)}))}))}))]),Af.config({store:{mode:"manual",getValue:function(){return e.get().fold((function(){return r.get().getOr("")}),(function(t){return t.getValue()}))},setValue:function(t,n){e.get().fold((function(){r.set(n)}),(function(t){return t.setValue(n)}))}}}),Ok()]),components:[n.asSpec()]}})),htmlpanel:w_((function(t){return"presentation"===t.presets?nx.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):nx.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:Tc([sx.config({}),ph.config({})])})})),imagetools:w_((function(t,e){return VO(t,e.shared.providers)})),table:w_((function(t,e){return function(t,e){var n,r,o=function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}},i=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}},u=function(t){return{dom:{tag:"tr"},components:q(t,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:q(r,o)}]}),(n=t.cells,{dom:{tag:"tbody"},components:q(n,u)})],behaviours:Tc([sx.config({}),ph.config({})])}}(t,e.shared.providers)})),panel:w_((function(t,e){return function(t,e){return{dom:{tag:"div",classes:t.classes},components:q(t.items,e.shared.interpreter)}}(t,e)}))},C_={field:function(t,e){return e}},S_=function(t,e,n){var r=Wt(n,{shared:{interpreter:function(e){return k_(t,e,r)}}});return k_(t,e,r)},k_=function(t,e,n){return Vt(x_,e.type).fold((function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e}),(function(r){return r(t,e,n)}))},T_={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},O_=function(t,e,n){var r={maxHeightFunction:vs()};return function(){return n()?{type:"node",root:Uo(t()),node:P.from(t()),bubble:xs(12,12,T_),layouts:{onRtl:function(){return[lp]},onLtr:function(){return[sp]}},overrides:r}:{type:"hotspot",hotspot:e(),bubble:xs(-12,12,T_),layouts:{onRtl:function(){return[ic]},onLtr:function(){return[uc]}},overrides:r}}},__=function(t,e,n){return function(){return n()?{type:"node",root:Uo(t()),node:P.from(t()),layouts:{onRtl:function(){return[fp]},onLtr:function(){return[fp]}}}:{type:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[lc]},onLtr:function(){return[lc]}}}}},E_=function(t,e){return function(){return{type:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return P.some(Gs.range(un.fromDom(e.startContainer),e.startOffset,un.fromDom(e.endContainer),e.endOffset))}}}},D_=function(t){return function(e){return{type:"node",root:t(),node:e}}},A_=function(t,e,n){var r=Vb(t),o=function(){return un.fromDom(t.getBody())},i=function(){return un.fromDom(t.getContentAreaContainer())},u=function(){return r||!n()};return{inlineDialog:O_(i,e,u),banner:__(i,e,u),cursor:E_(t,o),node:D_(o)}},M_=function(t){return function(e,n){pw(t)(e,n)}},z_=function(t){return function(){return iw(t)}},R_=function(t){return function(){return uw(t)}},N_=function(t){return function(){return cw(t)}},B_=function(t){return{colorPicker:M_(t),hasCustomColors:z_(t),getColors:R_(t),getColorCols:N_(t)}},P_=function(t){return function(){return function(t){return t.getParam("draggable_modal",!1,"boolean")}(t)}},I_=function(t){return{isDraggableModal:P_(t)}},L_=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],H_=function(t){return Y(t,(function(t,e){if(Ft(e,"items")){var n=H_(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(function(t){return Ft(t,"inline")}(e)||function(t){return Ft(t,"block")}(e)||function(t){return Ft(t,"selector")}(e)){var o="custom-"+(r(e.name)?e.name:e.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:o,format:e}]),formats:t.formats.concat([{title:e.title,format:o,icon:e.icon}])}}return O(O({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},V_=function(t){return function(t){return P.from(t.getParam("style_formats")).filter(i)}(t).map((function(e){var n=function(t,e){var n=H_(e),r=function(e){$(e,(function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)}))};return t.formatter?r(n.customFormats):t.on("init",(function(){r(n.customFormats)})),n.formats}(t,e);return function(t){return t.getParam("style_formats_merge",!1,"boolean")}(t)?L_.concat(n):n})).getOr(L_)},F_=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return Wt(t,r)},j_=function(t,e,n,o){var i=function(e){return q(e,(function(e){var u=Mt(e);if(jt(e,"items")){var a=i(e.items);return Wt(function(t){return Wt(t,{type:"submenu"})}(e),{getStyleItems:v(a)})}return jt(e,"format")?function(t){return F_(t,n,o)}(e):1===u.length&&F(u,"title")?Wt(e,{type:"separator"}):function(e){var i=r(e.name)?e.name:hi(e.title),u="custom-"+i,a={type:"formatter",format:u,isSelected:n(u),getStylePreview:o(u)},c=Wt(e,a);return t.formatter.register(i,c),c}(e)}))};return i(e)},U_=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?P.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):P.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?tt(e,r):[t.format]},o=rn([]),i=rn([]),u=rn([]),a=rn([]),c=rn(!1);t.on("PreInit",(function(u){var a=V_(t),c=j_(t,a,e,n);o.set(c),i.set(tt(c,r))})),t.on("addStyleModifications",(function(o){var i=j_(t,o.items,e,n);u.set(i),c.set(o.replace),a.set(tt(i,r))}));return{getData:function(){var t=c.get()?[]:o.get(),e=u.get();return t.concat(e)},getFlattenedKeys:function(){var t=c.get()?[]:i.get(),e=a.get();return t.concat(e)}}},W_=zk.trim,q_=function(t){return function(e){if(function(t){return f(t)&&1===t.nodeType}(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},$_=q_("true"),G_=q_("false"),K_=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},X_=function(t){return t.innerText||t.textContent},Y_=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&Q_(t)},J_=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},Q_=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return $_(t)}return!1}(t)&&!G_(t)},Z_=function(t){return J_(t)&&Q_(t)},tE=function(t){var e=function(t){return t.id?t.id:hi("h")}(t);return K_("header",X_(t),"#"+e,function(t){return J_(t)?parseInt(t.nodeName.substr(1),10):0}(t),(function(){t.id=e}))},eE=function(t){var e=t.id||t.name,n=X_(t);return K_("anchor",n||"#"+e,"#"+e,0,h)},nE=function(t){var e,n;return e="h1,h2,h3,h4,h5,h6,a:not([href])",n=t,q(cl(un.fromDom(n),e),(function(t){return t.dom}))},rE=function(t){return W_(t.title).length>0},oE=function(t){var e=nE(t);return K(function(t){return q(K(t,Z_),tE)}(e).concat(function(t){return q(K(t,Y_),eE)}(e)),rE)},iE="tinymce-url-history",uE=function(t){return r(t)&&/^https?/.test(t)},aE=function(t){return o(t)&&Lt(t,(function(t){return!(i(e=t)&&e.length<=5&&et(e,uE));var e})).isNone()},cE=function(){var t,e=Qy.getItem(iE);if(null===e)return{};try{t=JSON.parse(e)}catch(n){if(n instanceof SyntaxError)return console.log("Local storage "+iE+" was not valid JSON",n),{};throw n}return aE(t)?t:(console.log("Local storage "+iE+" was not valid format",t),{})},sE=function(t){var e=cE();return Vt(e,t).getOr([])},lE=function(t,e){if(uE(t)){var n=cE(),r=Vt(n,e).getOr([]),o=K(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,5),function(t){if(!aE(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));Qy.setItem(iE,JSON.stringify(t))}(n)}},fE=function(t){return!!t},dE=function(t){return Nt(zk.makeMap(t,/[, ]/),fE)},mE=function(t){return P.from(function(t){return t.getParam("file_picker_callback")}(t)).filter(d)},gE=function(t,e){var n=function(t){var e=P.some(function(t){return t.getParam("file_picker_types")}(t)).filter(fE),n=P.some(function(t){return t.getParam("file_browser_callback_types")}(t)).filter(fE),r=e.or(n).map(dE);return mE(t).fold(S,(function(t){return r.fold(k,(function(t){return Mt(t).length>0&&t}))}))}(t);return a(n)?n?mE(t):P.none():n[e]?mE(t):P.none()},hE=function(t){return P.from(t).filter(r).getOrUndefined()},pE=function(t){return{getHistory:sE,addToHistory:lE,getLinkInformation:function(){return function(t){return function(t){return!1===t.getParam("typeahead_urls")}(t)?P.none():P.some({targets:oE(t.getBody()),anchorTop:hE($b(t)),anchorBottom:hE(Gb(t))})}(t)},getValidationHandler:function(){return function(t){return P.from(function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e}(t))}(t)},getUrlPicker:function(e){return function(t,e){return gE(t,e).map((function(n){return function(i){return Hx((function(u){var a=O({filetype:e,fieldname:i.fieldname},P.from(i.meta).getOr({}));n.call(t,(function(t,e){if(!r(t))throw new Error("Expected value to be string");if(void 0!==e&&!o(e))throw new Error("Expected meta to be a object");u({value:t,meta:e})}),i.value,a)}))}}))}(t,e)}}},vE=function(t,e,n){var r=rn(!1),o=function(t){var e=rn(Lb(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}}(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:Cp.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return function(t,e){return k_(C_,t,e)}(t,i)},anchors:A_(e,n,o.isPositionedAtTop),header:o,getSink:function(){return gt.value(t)}},urlinput:pE(e),styleselect:U_(e),colorinput:B_(e),dialog:I_(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i},bE=Ed,yE=fd,wE=v([Ke("shell",!1),ze("makeItem"),Ke("setupItem",h),Nf("listBehaviours",[lh])]),xE=cd({name:"items",overrides:function(){return{behaviours:Tc([lh.config({})])}}}),CE=v([xE]),SE=v("CustomList"),kE=Bd({name:SE(),configFields:wE(),partFields:CE(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[lh.config({})],components:[]}:{behaviours:[],components:e},i=function(e){return t.shell?P.some(e):wd(e,t,"items")};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:Rf(t.listBehaviours,o.behaviours),apis:{setItems:function(e,n){i(e).fold((function(){throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")}),(function(r){var o=lh.contents(r),i=n.length,u=i-o.length,a=u>0?U(u,(function(){return t.makeItem()})):[],c=o.slice(i);$(c,(function(t){return lh.remove(r,t)})),$(a,(function(t){return lh.append(r,t)}));var s=lh.contents(r);$(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),TE=v([ze("dom"),Ke("shell",!0),Mf("toolbarBehaviours",[lh])]),OE=v([cd({name:"groups",overrides:function(){return{behaviours:Tc([lh.config({})])}}})]),_E=Bd({name:"Toolbar",configFields:TE(),partFields:OE(),factory:function(t,e,n,r){var o=function(e){return t.shell?P.some(e):wd(e,t,"groups")},i=t.shell?{behaviours:[lh.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:Rf(t.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,e){o(t).fold((function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(function(t){lh.set(t,e)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),EE=h,DE=S,AE=v([]),ME=Object.freeze({__proto__:null,setup:EE,isDocked:DE,getBehaviours:AE}),zE=function(t){return(tu(hu(t,"position"),"fixed")?P.none():No(t)).orThunk((function(){var e=un.fromTag("span");return Ro(t).bind((function(t){Yo(t,e);var n=No(e);return Zo(e),n}))}))},RE=function(t){return zE(t).map(Fu).getOrThunk((function(){return Hu(0,0)}))},NE=$n([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),BE=function(t,e){var n=t.element;Ki(n,e.transitionClass),Yi(n,e.fadeOutClass),Ki(n,e.fadeInClass),e.onShow(t)},PE=function(t,e){var n=t.element;Ki(n,e.transitionClass),Yi(n,e.fadeInClass),Ki(n,e.fadeOutClass),e.onHide(t)},IE=function(t,e,n){return et(t,(function(t){switch(t){case"bottom":return function(t,e){return t.bottom<=e.bottom}(e,n);case"top":return function(t,e){return t.y>=e.y}(e,n)}}))},LE=function(t,e){return e.getInitialPos().map((function(e){return na(e.bounds.x,e.bounds.y,Wu(t),Pu(t))}))},HE=function(t,e,n){return n.getInitialPos().bind((function(r){switch(n.clearInitialPos(),r.position){case"static":return P.some(NE.static());case"absolute":var o=zE(t).map(ra).getOrThunk((function(){return ra(uu())}));return P.some(NE.absolute(Lc("absolute",Vt(r.style,"left").map((function(t){return e.x-o.x})),Vt(r.style,"top").map((function(t){return e.y-o.y})),Vt(r.style,"right").map((function(t){return o.right-e.right})),Vt(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return P.none()}}))},VE=function(t,e,n){var r=ra(t);if(IE(n.getModes(),r,e))return P.none();!function(t,e,n){n.setInitialPos({style:pu(t),position:mu(t,"position")||"static",bounds:e})}(t,r,n);var o=ia(),i=r.x-o.x,u=e.y-o.y,a=o.bottom-e.bottom,c=r.y<=e.y;return P.some(NE.fixed(Lc("fixed",P.some(i),c?P.some(u):P.none(),P.none(),c?P.none():P.some(a))))},FE=function(t,e,n){var r=t.element;return tu(hu(r,"position"),"fixed")?function(t,e,n){return LE(t,n).filter((function(t){return IE(n.getModes(),t,e)})).bind((function(e){return HE(t,e,n)}))}(r,e,n):VE(r,e,n)},jE=function(t,e){$(["left","right","top","bottom","position"],(function(e){return bu(t.element,e)})),e.onUndocked(t)},UE=function(t,e,n){Hc(t.element,n),("fixed"===n.position?e.onDocked:e.onUndocked)(t)},WE=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var u=function(t,e){return t.y<e.bottom&&t.bottom>e.y}(i,r);u!==n.isVisible()&&(n.setVisible(u),o&&!u?(Qi(t.element,[e.fadeOutClass]),e.onHide(t)):(u?BE:PE)(t,e))}))}))},qE=function(t,e,n){var r=t.element;n.setDocked(!1),function(t,e){var n=t.element;return LE(n,e).bind((function(t){return HE(n,t,e)}))}(t,n).each((function(n){n.fold((function(){return jE(t,e)}),(function(n){return UE(t,e,n)}),h)})),n.setVisible(!0),e.contextual.each((function(e){Zi(r,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(t)})),$E(t,e,n)},$E=function(t,e,n){t.getSystem().isConnected()&&function(t,e,n){var r=e.lazyViewport(t),o=n.isDocked();o&&WE(t,e,n,r),FE(t,r,n).each((function(i){n.setDocked(!o),i.fold((function(){return jE(t,e)}),(function(n){return UE(t,e,n)}),(function(o){WE(t,e,n,r,!0),UE(t,e,o)}))}))}(t,e,n)},GE=function(t,e,n){n.isDocked()&&qE(t,e,n)},KE=Object.freeze({__proto__:null,refresh:$E,reset:GE,isDocked:function(t,e,n){return n.isDocked()},getModes:function(t,e,n){return n.getModes()},setModes:function(t,e,n,r){return n.setModes(r)}}),XE=Object.freeze({__proto__:null,events:function(t,e){return io([po(Sr(),(function(n,r){t.contextual.each((function(t){Ji(n.element,t.transitionClass)&&(Zi(n.element,[t.transitionClass,t.fadeInClass]),(e.isVisible()?t.onShown:t.onHidden)(n));r.stop()}))})),co(Fr(),(function(n,r){$E(n,t,e)})),co(jr(),(function(n,r){GE(n,t,e)}))])}}),YE=[Ge("contextual",[Be("fadeInClass"),Be("fadeOutClass"),Be("transitionClass"),Ie("lazyContext"),za("onShow"),za("onShown"),za("onHide"),za("onHidden")]),tn("lazyViewport",ia),en("modes",["top","bottom"],he),za("onDocked"),za("onUndocked")],JE=_c({fields:YE,name:"docking",active:XE,apis:KE,state:Object.freeze({__proto__:null,init:function(t){var e=rn(!1),n=rn(!0),r=ns(),o=rn(t.modes);return zi({isDocked:e.get,setDocked:e.set,getInitialPos:r.get,setInitialPos:r.set,clearInitialPos:r.clear,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")}})}})}),QE=v(hi("toolbar-height-change")),ZE={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},tD="tox-tinymce--toolbar-sticky-on",eD="tox-tinymce--toolbar-sticky-off",nD=function(t,e){return F(JE.getModes(t),e)},rD=function(t){var e=t.element;Ro(e).each((function(n){var r,o="padding-"+JE.getModes(t)[0];if(JE.isDocked(t)){var i=Wu(n);lu(e,"width",i+"px"),lu(n,o,Iu(r=e)+(parseInt(mu(r,"margin-top"),10)||0)+(parseInt(mu(r,"margin-bottom"),10)||0)+"px")}else bu(e,"width"),bu(n,o)}))},oD=function(t,e){e?(Yi(t,ZE.fadeOutClass),Qi(t,[ZE.transitionClass,ZE.fadeInClass])):(Yi(t,ZE.fadeInClass),Qi(t,[ZE.fadeOutClass,ZE.transitionClass]))},iD=function(t,e){var n=un.fromDom(t.getContainer());e?(Ki(n,tD),Yi(n,eD)):(Ki(n,eD),Yi(n,tD))},uD=function(t,e){var n,r=ns(),o=e.getSink,i=function(t){o().each((function(e){return t(e.element)}))},u=function(e){t.inline||rD(e),iD(t,JE.isDocked(e)),e.getSystem().broadcastOn([df()],{}),o().each((function(t){return t.getSystem().broadcastOn([df()],{})}))},a=t.inline?[]:[Mc.config({channels:(n={},n[QE()]={onReceive:rD},n)})];return E([ph.config({}),JE.config({contextual:O({lazyContext:function(e){var n=Iu(e.element),r=t.inline?t.getContentAreaContainer():t.getContainer(),o=ra(un.fromDom(r)),i=o.height-n,u=o.y+(nD(e,"top")?0:n);return P.some(na(o.x,u,o.width,i))},onShow:function(){i((function(t){return oD(t,!0)}))},onShown:function(t){i((function(t){return Zi(t,[ZE.transitionClass,ZE.fadeInClass])})),r.get().each((function(e){var n,o,i;n=t.element,i=Do(o=e),Bc(i).filter((function(t){return!Un(o,t)})).filter((function(t){return Un(t,un.fromDom(i.dom.body))||qn(n,t)})).each((function(){return Rc(o)})),r.clear()}))},onHide:function(t){(function(t,e){return Pc(t).orThunk((function(){return e().toOptional().bind((function(t){return Pc(t.element)}))}))})(t.element,o).fold(r.clear,r.set),i((function(t){return oD(t,!1)}))},onHidden:function(){i((function(t){return Zi(t,[ZE.transitionClass])}))}},ZE),lazyViewport:function(e){var n=ia(),r=function(t){return t.getParam("toolbar_sticky_offset",0,"number")}(t),o=n.y+(nD(e,"top")?r:0),i=n.height-(nD(e,"bottom")?r:0);return na(n.x,o,n.width,i)},modes:[e.header.getDockingMode()],onDocked:u,onUndocked:u})],a)},aD=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(JE.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(rD)})),t.on("SkinLoaded",(function(){n().each((function(t){JE.isDocked(t)?JE.reset(t):JE.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(JE.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){JE.refresh(e);var n=e.element;Zm(n)&&function(t,e){var n=Do(e),r=n.dom.defaultView.innerHeight,o=Xu(n),i=un.fromDom(t.elm),u=oa(i),a=Pu(i),c=u.y,s=c+a,l=Fu(e),f=Pu(e),d=l.top,m=d+f,g=Math.abs(d-o.top)<2,h=Math.abs(m-(o.top+r))<2;if(g&&c<m)Yu(o.left,c-f,n);else if(h&&s>d){var p=c-r+a+f;Yu(o.left,p,n)}}(t,n)}))})),t.on("PostRender",(function(){iD(t,!1)}))},isDocked:function(t){return t().map(JE.isDocked).getOr(!1)},getBehaviours:uD}),cD=ae([Be("type"),Re("items",se([fe([Be("name"),Ve("items",he)]),he]))].concat(ov)),sD=[We("text"),We("tooltip"),We("icon"),Ie("fetch"),tn("onSetup",(function(){return h}))],lD=ae(E([Be("type")],sD)),fD=function(t){return ke("menubutton",lD,t)},dD=ae([Be("type"),We("tooltip"),We("icon"),We("text"),qe("select"),Ie("fetch"),tn("onSetup",(function(){return h})),Qe("presets","normal",["normal","color","listpreview"]),Ke("columns",1),Ie("onAction"),Ie("onItemAction")]),mD=Nd({factory:function(t,e){var n={focus:ih.focusIn,setMenus:function(t,n){var r=q(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=fD(n).mapError((function(t){return _e(t)})).getOrDie();return tO(r,"tox-mbtn",e.backstage,P.some("menuitem"))}));lh.set(t,r)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:Tc([lh.config({}),fh("menubar-events",[vo((function(e){t.onSetup(e)})),co(gr(),(function(t,e){ga(t.element,".tox-mbtn--active").each((function(n){ha(e.event.target,".tox-mbtn").each((function(e){Un(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){bC.expand(t),bC.close(n),ph.focus(t)}))}))}))}))})),co(Gr(),(function(t,e){e.event.prevFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(n){e.event.newFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(t){bC.isOpen(n)&&(bC.expand(t),bC.close(n))}))}))}))]),ih.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),P.some(!0)}}),sx.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[ze("dom"),ze("uid"),ze("onEscape"),ze("backstage"),Ke("onSetup",h)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),gD=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},hD=function(t){return t.dimension.property},pD=function(t,e){return t.dimension.getDimension(e)},vD=function(t,e){var n=gD(t,e);Zi(n,[e.shrinkingClass,e.growingClass])},bD=function(t,e){Yi(t.element,e.openClass),Ki(t.element,e.closedClass),lu(t.element,hD(e),"0px"),yu(t.element)},yD=function(t,e){Yi(t.element,e.closedClass),Ki(t.element,e.openClass),bu(t.element,hD(e))},wD=function(t,e,n,r){n.setCollapsed(),lu(t.element,hD(e),pD(e,t.element)),yu(t.element),vD(t,e),bD(t,e),e.onStartShrink(t),e.onShrunk(t)},xD=function(t,e,n,r){var o=r.getOrThunk((function(){return pD(e,t.element)}));n.setCollapsed(),lu(t.element,hD(e),o),yu(t.element);var i=gD(t,e);Yi(i,e.growingClass),Ki(i,e.shrinkingClass),bD(t,e),e.onStartShrink(t)},CD=function(t,e,n){var r=pD(e,t.element);("0px"===r?wD:xD)(t,e,n,P.some(r))},SD=function(t,e,n){var r=gD(t,e),o=Ji(r,e.shrinkingClass),i=pD(e,t.element);yD(t,e);var u=pD(e,t.element);(o?function(){lu(t.element,hD(e),i),yu(t.element)}:function(){bD(t,e)})(),Yi(r,e.shrinkingClass),Ki(r,e.growingClass),yD(t,e),lu(t.element,hD(e),u),n.setExpanded(),e.onStartGrow(t)},kD=function(t,e,n){var r=gD(t,e);return!0===Ji(r,e.growingClass)},TD=function(t,e,n){var r=gD(t,e);return!0===Ji(r,e.shrinkingClass)},OD=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){bu(t.element,hD(e));var r=pD(e,t.element);lu(t.element,hD(e),r)}},grow:function(t,e,n){n.isExpanded()||SD(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&CD(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&wD(t,e,n)},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:kD,isShrinking:TD,isTransitioning:function(t,e,n){return kD(t,e)||TD(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?CD:SD)(t,e,n)},disableTransitions:vD}),_D=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return Ni(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:Xn(e.dimension.property,"0px")})},events:function(t,e){return io([po(Sr(),(function(n,r){r.event.raw.propertyName===t.dimension.property&&(vD(n,t),e.isExpanded()&&bu(n.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))}))])}}),ED=[ze("closedClass"),ze("openClass"),ze("shrinkingClass"),ze("growingClass"),Fe("getAnimationRoot"),za("onShrunk"),za("onStartShrink"),za("onGrown"),za("onStartGrow"),Ke("expanded",!1),Re("dimension",Ee("property",{width:[Pa("property","width"),Pa("getDimension",(function(t){return Wu(t)+"px"}))],height:[Pa("property","height"),Pa("getDimension",(function(t){return Pu(t)+"px"}))]}))],DD=_c({fields:ED,name:"sliding",active:_D,apis:OD,state:Object.freeze({__proto__:null,init:function(t){var e=rn(t.expanded);return zi({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:w(e.set,!1),setExpanded:w(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),AD="container",MD=[Mf("slotBehaviours",[])],zD=function(t){return"<alloy.field."+t+">"},RD=function(t,e){var n,r=function(e){return kd(t)},o=function(e,n){return function(r,o){return wd(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t,e){return"true"!==ii(t.element,"aria-hidden")},u=o(i,!1),a=o((function(t,e){if(i(t)){var n=t.element;lu(n,"display","none"),oi(n,"aria-hidden","true"),to(t,Kr(),{name:e,visible:!1})}})),c=(n=a,function(t,e){$(e,(function(e){return n(t,e)}))}),s=o((function(t,e){if(!i(t)){var n=t.element;bu(n,"display"),ci(n,"aria-hidden"),to(t,Kr(),{name:e,visible:!0})}})),l={getSlotNames:r,getSlot:function(e,n){return wd(e,t,n)},isShowing:u,hideSlot:a,hideAllSlots:function(t){return c(t,r())},showSlot:s};return{uid:t.uid,dom:t.dom,components:e,behaviours:zf(t.slotBehaviours),apis:l}},ND=Nt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},(function(t){return Ai(t)})),BD=O(O({},ND),{sketch:function(t){var e,n={slot:function(t,n){return e.push(t),hd(AD,zD(t),n)},record:v(e=[])},r=t(n),o=n.record(),i=q(o,(function(t){return ud({name:t,pname:zD(t)})}));return Ad(AD,MD,i,RD,r)}}),PD=ae([We("icon"),We("tooltip"),tn("onShow",h),tn("onHide",h),tn("onSetup",(function(){return h}))]),ID=function(t){return{element:function(){return t.element.dom}}},LD=function(t,e){var n=q(Mt(e),(function(t){var n=e[t],r=Te(function(t){return ke("sidebar",PD,t)}(n));return{name:t,getApi:ID,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return q(n,(function(e){var r=rn(h);return t.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:fb([oy(e,r),iy(e,r),co(Kr(),(function(t,e){var r=e.event;J(n,(function(t){return t.name===r.name})).each((function(e){(r.visible?e.onShow:e.onHide)(e.getApi(t))}))}))])})}))},HD=function(t){return BD.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:LD(e,t),slotBehaviours:fb([vo((function(t){return BD.hideAllSlots(t)}))])}}))},VD=function(t){return Hd.getCurrent(t).bind((function(t){return DD.isGrowing(t)||DD.hasGrown(t)?Hd.getCurrent(t).bind((function(t){return J(BD.getSlotNames(t),(function(e){return BD.isShowing(t,e)}))})):P.none()}))},FD=hi("FixSizeEvent"),jD=hi("AutoSizeEvent"),UD=Object.freeze({__proto__:null,block:function(t,e,n,r){oi(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=Tc([ih.config({mode:"special",onTab:function(){return P.some(!0)},onShiftTab:function(){return P.some(!0)}}),ph.config({})]),u=r(o,i),a=o.getSystem().build(u);lh.append(o,Ru(a)),a.hasConfigured(ih)&&e.focus&&ih.focusIn(a),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return lh.remove(o,a)}))},unblock:function(t,e,n){ci(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()}}),WD=[tn("getRoot",P.none),Ze("focus",!0),za("onBlock"),za("onUnblock")],qD=_c({fields:WD,name:"blocking",apis:UD,state:Object.freeze({__proto__:null,init:function(){var t=ts((function(t){return t.destroy()}));return zi({readState:t.isSet,blockWith:function(e){t.set({destroy:e})},clear:t.clear,isBlocked:t.isSet})}})}),$D=function(t){var e=un.fromHtml(t),n=Bo(e),r=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return Y(e,(function(t,e){var n;return"class"===e.name?t:O(O({},t),((n={})[e.name]=e.value,n))}),{})}(e),o=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(e),i=0===n.length?{}:{innerHtml:ei(e)};return O({tag:So(e),classes:o,attributes:r},i)},GD=function(t){return Hd.getCurrent(t).each((function(t){return Rc(t.element)}))},KD=function(t,e,n,r){var o=e.element;if(function(t,e){var n="tabindex",r="data-mce-tabindex";P.from(t.iframeElement).map(un.fromDom).each((function(t){e?(ui(t,n).each((function(e){return oi(t,r,e)})),oi(t,n,-1)):(ci(t,n),ui(t,r).each((function(e){oi(t,n,e),ci(t,r)})))}))}(t,n),n)qD.block(e,function(t){return function(e,n){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:$D('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}}(r)),bu(o,"display"),ci(o,"aria-hidden"),t.hasFocus()&&GD(e);else{var i=Hd.getCurrent(e).exists((function(t){return Nc(t.element)}));qD.unblock(e),lu(o,"display","none"),oi(o,"aria-hidden","true"),i&&t.focus()}},XD=function(t,e,n){var r=rn(!1),o=ns(),i=function(n){var o;!r.get()||function(t){return"focusin"===t.type}(o=n)&&(o.composed?ct(o.composedPath()):P.from(o.target)).map(un.fromDom).filter(To).exists((function(t){return Ji(t,"mce-pastebin")}))||(n.preventDefault(),GD(e()),t.editorManager.setActive(t))};t.inline||t.on("PreInit",(function(){t.dom.bind(t.getWin(),"focusin",i),t.on("BeforeExecCommand",(function(t){"mcefocus"===t.command.toLowerCase()&&!0!==t.value&&i(t)}))}));var u=function(o){o!==r.get()&&(r.set(o),KD(t,e(),o,n.providers),t.fire("AfterProgressState",{state:o}))};t.on("ProgressState",(function(e){if(o.on(yp.clearTimeout),m(e.time)){var n=yp.setEditorTimeout(t,(function(){return u(e.state)}),e.time);o.set(n)}else u(e.state),o.clear()}))},YD=function(t,e,n){return{within:t,extra:e,withinWidth:n}},JD=function(t,e,n){var r,o=(r=function(t,e){var r=n(t);return P.some({element:t,start:e,finish:e+r,width:r})},Y(t,(function(t,e){return r(e,t.len).fold(v(t),(function(e){return{len:e.finish,list:t.list.concat([e])}}))}),{len:0,list:[]}).list),i=K(o,(function(t){return t.finish<=e})),u=X(i,(function(t,e){return t+e.width}),0);return{within:i,extra:o.slice(i.length),withinWidth:u}},QD=function(t){return q(t,(function(t){return t.element}))},ZD=function(t,e,n,r){var o=function(t,e,n){var r=JD(e,t,n);return 0===r.extra.length?P.some(r):P.none()}(t,e,n).getOrThunk((function(){return JD(e,t-n(r),n)})),i=o.within,u=o.extra,a=o.withinWidth;return 1===u.length&&u[0].width<=n(r)?function(t,e,n){var r=QD(t.concat(e));return YD(r,[],n)}(i,u,a):u.length>=1?function(t,e,n,r){var o=QD(t).concat([n]);return YD(o,QD(e),r)}(i,u,r,a):function(t,e,n){return YD(QD(t),[],n)}(i,0,a)},tA=function(t,e){var n=q(e,(function(t){return Ru(t)}));_E.setGroups(t,n)},eA=function(t,e,n){var r=e.builtGroups.get();if(0!==r.length){var o=xd(t,e,"primary"),i=Zx.getCoupled(t,"overflowGroup");lu(o.element,"visibility","hidden");var u=r.concat([i]),a=ft(u,(function(t){return Pc(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}));n([]),tA(o,u);var c=Wu(o.element),s=ZD(c,e.builtGroups.get(),(function(t){return Wu(t.element)}),i);0===s.extra.length?(lh.remove(o,i),n([])):(tA(o,s.within),n(s.extra)),bu(o.element,"visibility"),yu(o.element),a.each(ph.focus)}},nA=v([Mf("splitToolbarBehaviours",[Zx]),Ae("builtGroups",(function(){return rn([])}))]),rA=v([Aa(["overflowToggledClass"]),qe("getOverflowBounds"),ze("lazySink"),Ae("overflowGroups",(function(){return rn([])}))].concat(nA())),oA=v([ud({factory:_E,schema:TE(),name:"primary"}),ad({schema:TE(),name:"overflow"}),ad({name:"overflow-button"}),ad({name:"overflow-group"})]),iA=v((function(t,e){!function(t,e){var n=Uu.max(t,e,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);lu(t,"max-width",n+"px")}(t,Math.floor(e))})),uA=v([Aa(["toggledClass"]),ze("lazySink"),Ie("fetch"),qe("getBounds"),Ge("fireDismissalEventInstead",[Ke("event",qr())]),Es()]),aA=v([ad({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:Tc([Eh.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),ad({factory:_E,schema:TE(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:Tc([ih.config({mode:"cyclic",onEscape:function(e){return wd(e,t,"button").each(ph.focus),P.none()}})])}}})]),cA=function(t,e){var n=Zx.getCoupled(t,"toolbarSandbox");lf.isOpen(n)?lf.close(n):lf.open(n,e.toolbar())},sA=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Fl.positionWithinBounds(i,e,{anchor:{type:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:iA()}}},o)},lA=function(t,e,n,r,o){_E.setGroups(e,o),sA(t,e,n,r),Eh.on(t)},fA=Bd({name:"FloatingToolbarButton",factory:function(t,e,n,r){return O(O({},wp.sketch(O(O({},r.button()),{action:function(t){cA(t,r)},buttonBehaviours:Bf({dump:r.button().buttonBehaviours},[Zx.config({others:{toolbarSandbox:function(e){return function(t,e,n){var r=pa();return{dom:{tag:"div",attributes:{id:r.id}},behaviours:Tc([ih.config({mode:"special",onEscape:function(t){return lf.close(t),P.some(!0)}}),lf.config({onOpen:function(o,i){n.fetch().get((function(o){lA(t,i,n,e.layouts,o),r.link(t.element),ih.focusIn(i)}))},onClose:function(){Eh.off(t),ph.focus(t),r.unlink(t.element)},isPartOf:function(e,n,r){return ba(n,r)||ba(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),Mc.config({channels:O(O({},hf(O({isExtraPart:S},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),vf({doReposition:function(){lf.getState(Zx.getCoupled(t,"toolbarSandbox")).each((function(r){sA(t,r,n,e.layouts)}))}}))})])}}(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){lf.getState(Zx.getCoupled(e,"toolbarSandbox")).each((function(o){lA(e,o,t,n.layouts,r)}))},reposition:function(e){lf.getState(Zx.getCoupled(e,"toolbarSandbox")).each((function(r){sA(e,r,t,n.layouts)}))},toggle:function(t){cA(t,r)},getToolbar:function(t){return lf.getState(Zx.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return lf.isOpen(Zx.getCoupled(t,"toolbarSandbox"))}}})},configFields:uA(),partFields:aA(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)},isOpen:function(t,e){return t.isOpen(e)}}}),dA=v([ze("items"),Aa(["itemSelector"]),Mf("tgroupBehaviours",[ih])]),mA=v([sd({name:"items",unit:"item"})]),gA=Bd({name:"ToolbarGroup",configFields:dA(),partFields:mA(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.tgroupBehaviours,[ih.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),hA=function(t){return q(t,(function(t){return Ru(t)}))},pA=function(t,e,n){eA(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){fA.setGroups(t,hA(r))}))}))},vA=Bd({name:"SplitFloatingToolbar",configFields:rA(),partFields:oA(),factory:function(t,e,n,r){var o=xp(fA.sketch({fetch:function(){return Hx((function(e){e(hA(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[uc,ic]},onRtl:function(){return[ic,uc]},onBottomLtr:function(){return[cc,ac]},onBottomRtl:function(){return[ac,cc]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.splitToolbarBehaviours,[Zx.config({others:{overflowGroup:function(){return gA.sketch(O(O({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(q(n,e.getSystem().build)),pA(e,o,t)},refresh:function(e){return pA(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){fA.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(fA.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){fA.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(fA.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),bA=v([Aa(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),za("onOpened"),za("onClosed")].concat(nA())),yA=v([ud({factory:_E,schema:TE(),name:"primary"}),ud({factory:_E,schema:TE(),name:"overflow",overrides:function(t){return{toolbarBehaviours:Tc([DD.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){wd(e,t,"overflow-button").each((function(t){Eh.off(t),ph.focus(t)})),t.onClosed(e)},onGrown:function(e){ih.focusIn(e),t.onOpened(e)},onStartGrow:function(e){wd(e,t,"overflow-button").each(Eh.on)}}),ih.config({mode:"acyclic",onEscape:function(e){return wd(e,t,"overflow-button").each(ph.focus),P.some(!0)}})])}}}),ad({name:"overflow-button",overrides:function(t){return{buttonBehaviours:Tc([Eh.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),ad({name:"overflow-group"})]),wA=function(t,e){wd(t,e,"overflow-button").bind((function(){return wd(t,e,"overflow")})).each((function(n){xA(t,e),DD.toggleGrow(n)}))},xA=function(t,e){wd(t,e,"overflow").each((function(n){eA(t,e,(function(t){var e=q(t,(function(t){return Ru(t)}));_E.setGroups(n,e)})),wd(t,e,"overflow-button").each((function(t){DD.hasGrown(n)&&Eh.on(t)})),DD.refresh(n)}))},CA=Bd({name:"SplitSlidingToolbar",configFields:bA(),partFields:yA(),factory:function(t,e,n,r){var o="alloy.toolbar.toggle";return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.splitToolbarBehaviours,[Zx.config({others:{overflowGroup:function(t){return gA.sketch(O(O({},r["overflow-group"]()),{items:[wp.sketch(O(O({},r["overflow-button"]()),{action:function(e){Zr(t,o)}}))]}))}}}),fh("toolbar-toggle-events",[co(o,(function(e){wA(e,t)}))])]),apis:{setGroups:function(e,n){!function(e,n){var r=q(n,e.getSystem().build);t.builtGroups.set(r)}(e,n),xA(e,t)},refresh:function(e){return xA(e,t)},toggle:function(e){return wA(e,t)},isOpen:function(e){return function(t,e){return wd(t,e,"overflow").map(DD.hasGrown).getOr(!1)}(e,t)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)}}}),SA=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:O({tag:"div",classes:["tox-toolbar__group"]},e),components:[gA.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:Tc([sx.config({}),ph.config({})])}},kA=function(t){return gA.sketch(SA(t))},TA=function(t,e){var n=vo((function(e){var n=q(t.initGroups,kA);_E.setGroups(e,n)}));return Tc([ny(t.providers.isDisabled),Qb(),ih.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),fh("toolbar-events",[n])])},OA=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":SA({title:P.none(),items:[]}),"overflow-button":rO({name:"more",icon:P.some("more-drawer"),disabled:!1,tooltip:P.some("More..."),primary:!1,borderless:!1},P.none(),t.providers)},splitToolbarBehaviours:TA(t,e)}},_A=function(t){var e=OA(t),n=vA.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return vA.sketch(O(O({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,n=oa(e),r=Mo(e),o=oa(r),i=Math.max(r.dom.scrollHeight,o.height);return na(n.x+4,o.y,n.width-8,i)},parts:O(O({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},EA=function(t){var e=CA.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=CA.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=OA(t);return CA.sketch(O(O({},r),{components:[e,n],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([QE()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([QE()],{type:"closed"})}}))},DA=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return _E.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===yv.scrolling?["tox-toolbar--scrolling"]:[])},components:[_E.parts.groups({})],toolbarBehaviours:TA(t,e)})},AA=yE.optional({factory:mD,name:"menubar",schema:[ze("backstage")]}),MA=yE.optional({factory:{sketch:function(t){return kE.sketch({uid:t.uid,dom:t.dom,listBehaviours:Tc([ih.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return DA({type:t.type,uid:hi("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),P.some(!0)}})},setupItem:function(t,e,n,r){_E.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[ze("dom"),ze("onEscape")]}),zA=yE.optional({factory:{sketch:function(t){return function(t){return t.type===yv.sliding?EA:t.type===yv.floating?_A:DA}(t)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),P.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[ze("dom"),ze("onEscape"),ze("getSink")]}),RA=yE.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?uD:AE;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:Tc(n(e,t.sharedBackstage))}}},name:"header",schema:[ze("dom")]}),NA=yE.optional({name:"socket",schema:[ze("dom")]}),BA=yE.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:Tc([sx.config({}),ph.config({}),DD.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){Hd.getCurrent(t).each(BD.hideAllSlots),Zr(t,jD)},onGrown:function(t){Zr(t,jD)},onStartGrow:function(t){to(t,FD,{width:hu(t.element,"width").getOr("")})},onStartShrink:function(t){to(t,FD,{width:Wu(t.element)+"px"})}}),lh.config({}),Hd.config({find:function(t){var e=lh.contents(t);return ct(e)}})])}],behaviours:Tc([Ek(0),fh("sidebar-sliding-events",[co(FD,(function(t,e){lu(t.element,"width",e.event.width)})),co(jD,(function(t,e){bu(t.element,"width")}))])])}}},name:"sidebar",schema:[ze("dom")]}),PA=yE.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:Tc([lh.config({}),qD.config({focus:!1}),Hd.config({find:function(t){return ct(t.components())}})]),components:[]}}},name:"throbber",schema:[ze("dom")]}),IA=Bd({name:"OuterContainer",factory:function(t,e,n){var r={getSocket:function(e){return bE.getPart(e,t,"socket")},setSidebar:function(e,n){bE.getPart(e,t,"sidebar").each((function(t){return function(t,e){Hd.getCurrent(t).each((function(t){return lh.set(t,[HD(e)])}))}(t,n)}))},toggleSidebar:function(e,n){bE.getPart(e,t,"sidebar").each((function(t){return function(t,e){Hd.getCurrent(t).each((function(t){Hd.getCurrent(t).each((function(n){DD.hasGrown(t)?BD.isShowing(n,e)?DD.shrink(t):(BD.hideAllSlots(n),BD.showSlot(n,e)):(BD.hideAllSlots(n),BD.showSlot(n,e),DD.grow(t))}))}))}(t,n)}))},whichSidebar:function(e){return bE.getPart(e,t,"sidebar").bind(VD).getOrNull()},getHeader:function(e){return bE.getPart(e,t,"header")},getToolbar:function(e){return bE.getPart(e,t,"toolbar")},setToolbar:function(e,n){bE.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){bE.getPart(e,t,"multiple-toolbar").each((function(t){kE.setItems(t,n)}))},refreshToolbar:function(e){bE.getPart(e,t,"toolbar").each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){bE.getPart(e,t,"toolbar").each((function(t){var e,n;e=t.getApis().toggle,n=function(e){return e(t)},null!=e?P.some(n(e)):P.none()}))},isToolbarDrawerToggled:function(e){return bE.getPart(e,t,"toolbar").bind((function(t){return P.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return bE.getPart(e,t,"throbber")},focusToolbar:function(e){bE.getPart(e,t,"toolbar").orThunk((function(){return bE.getPart(e,t,"multiple-toolbar")})).each((function(t){ih.focusIn(t)}))},setMenubar:function(e,n){bE.getPart(e,t,"menubar").each((function(t){mD.setMenus(t,n)}))},focusMenubar:function(e){bE.getPart(e,t,"menubar").each((function(t){mD.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},configFields:[ze("dom"),ze("behaviours")],partFields:[RA,AA,zA,MA,NA,BA,PA],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=q(n,(function(t){return kA(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=q(n,(function(t){return q(t,kA)}));t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},toggleToolbarDrawer:function(t,e){t.toggleToolbarDrawer(e)},isToolbarDrawerToggled:function(t,e){return t.isToolbarDrawerToggled(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),LA={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},HA=function(t){return"string"==typeof t?t.split(" "):t},VA=function(t,e){var n=O(O({},LA),e.menus),r=Mt(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?HA("file edit view insert format tools table help"):HA(!1===e.menubar?"":e.menubar),i=K(o,(function(t){var n=Ft(LA,t);return r?n||Vt(e.menus,t).exists((function(t){return Ft(t,"items")})):n})),u=q(i,(function(r){var o=n[r];return function(t,e,n){var r=function(t){return t.getParam("removed_menuitems","")}(n).split(/[ ,]/);return{text:t.title,getItems:function(){return tt(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length||j(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}}({title:o.title,items:HA(o.items)},e,t)}));return K(u,(function(t){return t.getItems().length>0&&j(t.getItems(),(function(t){return"separator"!==t.type}))}))},FA=function(t){var e=function(){t._skinLoaded=!0,function(t){t.fire("SkinLoaded")}(t)};return function(){t.initialized?e():t.on("init",e)}},jA=function(t,e,n){return new Kp((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},UA=function(t,e){return jA(t,e+"/skin.min.css",t.ui.styleSheetLoader)},WA=function(t,e){var n;return(n=un.fromDom(t.getElement()),Wo(n).isSome())?jA(t,e+"/skin.shadowdom.min.css",wb.DOM.styleSheetLoader):Kp.resolve()},qA=function(t,e){var n=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):xb.baseURL+"/skins/ui/"+r}return n}(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===function(t){return!1===t.getParam("skin")}(e)&&r(n)?Kp.all([UA(e,n),WA(e,n)]).then(FA(e),function(t,e){return function(){return function(t,e){return t.fire("SkinLoadError",e)}(t,{message:e})}}(e,"Skin could not be loaded")):FA(e)()},$A=w(qA,!1),GA=w(qA,!0),KA=function(t,e){return function(n){var r=es(),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive);r.set(o)};return t.initialized?o():t.once("init",o),function(){t.off("init",o),r.clear()}}},XA=function(t,e,n){return function(r){var o=function(){return n(r)},i=function(){n(r),t.on(e,o)};return t.initialized?i():t.once("init",i),function(){t.off("init",i),t.off(e,o)}}},YA=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},JA=function(t,e){return function(){return t.execCommand(e)}},QA=function(t,e,n){var r=function(t,r,i,u){var a=e.shared.providers.translate(t.title);if("separator"===t.type)return P.some({type:"separator",text:a});if("submenu"===t.type){var c=tt(t.getStyleItems(),(function(t){return o(t,r,u)}));return 0===r&&c.length<=0?P.none():P.some({type:"nestedmenuitem",text:a,disabled:c.length<=0,getSubmenuItems:function(){return tt(t.getStyleItems(),(function(t){return o(t,r,u)}))}})}return P.some(O({type:"togglemenuitem",text:a,icon:t.icon,active:t.isSelected(u),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return tt(t,(function(t){return o(t,r,e)}))};return{validateItems:i,getFetch:function(t,e){return function(n,r){var o=e(),u=i(o);r(QT(u,xv.CLOSE_ON_EXECUTE,t,!1))}}}},ZA=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return q(r.data,(function(t){return F_(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:QA(0,e,n),getStyleItems:o}},tM=function(t,e,n){var r=ZA(0,e,n),o=r.items,i=r.getStyleItems,u=XA(t,"NodeChange",(function(t){var e=t.getComponent();n.updateText(e)}));return $T({text:n.icon.isSome()?P.none():n.text,icon:n.icon,tooltip:P.from(n.tooltip),role:P.none(),fetch:o.getFetch(e,i),onSetup:u,getApi:function(t){return{getComponent:v(t)}},columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)};(LO=IO||(IO={}))[LO.SemiColon=0]="SemiColon",LO[LO.Space=1]="Space";var eM,nM,rM,oM,iM,uM,aM=function(t,e,n,r){return{type:"basic",data:function(t){return q(t,(function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}}))}(function(t,e){return e===IO.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.getParam(e,n,"string"),r))}},cM=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],sM=function(t){var e={type:"basic",data:cM};return{tooltip:"Align",text:P.none(),icon:P.some("align-left"),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:P.none,getPreviewFor:function(t){return P.none},onAction:function(e){return function(){return J(cM,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}},updateText:function(e){var n=J(cM,(function(e){return t.formatter.match(e.format)})).fold(v("left"),(function(t){return t.title.toLowerCase()}));to(e,qT,{icon:"align-"+n})},dataset:e,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},lM=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],fM=function(t){var e=t.split(/\s*,\s*/);return q(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},dM=function(t){var e="System Font",n=function(){var n=function(t){return t?fM(t)[0]:""},o=t.queryCommandValue("FontName"),i=r.data,u=o?o.toLowerCase():"";return{matchOpt:J(i,(function(t){var e=t.format;return e.toLowerCase()===u||n(e).toLowerCase()===n(u).toLowerCase()})).orThunk((function(){return ru(function(t){var e;return 0===t.indexOf("-apple-system")&&(e=fM(t.toLowerCase()),et(lM,(function(t){return e.indexOf(t.toLowerCase())>-1})))}(u),{title:e,format:u})})),font:o}},r=aM(t,"font_formats","Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",IO.SemiColon);return{tooltip:"Fonts",text:P.some(e),icon:P.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getCurrentValue:function(){return n().matchOpt},getPreviewFor:function(t){return function(){return P.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},updateText:function(t){var e=n(),r=e.matchOpt,o=e.font,i=r.fold(v(o),(function(t){return t.title}));to(t,WT,{text:i})},dataset:r,shouldHide:!1,isInvalid:S}},mM={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},gM={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},hM=function(t,e){return/[0-9.]+px$/.test(t)?function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}(72*parseInt(t,10)/96,e||0)+"pt":Vt(gM,t).getOr(t)},pM=function(t){var e=function(){var e=P.none(),n=r.data,o=t.queryCommandValue("FontSize");if(o)for(var i=function(t){var r=hM(o,t),i=function(t){return Vt(mM,t).getOr("")}(r);e=J(n,(function(t){return t.format===o||t.format===r||t.format===i}))},u=3;e.isNone()&&u>=0;u--)i(u);return{matchOpt:e,size:o}},n=v(P.none),r=aM(t,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",IO.Space);return{tooltip:"Font sizes",text:P.some("12pt"),icon:P.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getPreviewFor:n,getCurrentValue:function(){return e().matchOpt},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},updateText:function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold(v(o),(function(t){return t.title}));to(t,WT,{text:i})},dataset:r,shouldHide:!1,isInvalid:S}},vM=function(t,e){var n=e(),r=q(n,(function(t){return t.format}));return P.from(t.formatter.closest(r)).bind((function(t){return J(n,(function(e){return e.format===t}))})).orThunk((function(){return ru(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},bM=function(t){var e="Paragraph",n=aM(t,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",IO.SemiColon);return{tooltip:"Blocks",text:P.some(e),icon:P.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:P.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return P.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},onAction:YA(t),updateText:function(r){var o=vM(t,(function(){return n.data})).fold(v(e),(function(t){return t.title}));to(r,WT,{text:o})},dataset:n,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},yM=function(t,e){var n="Paragraph";return{tooltip:"Formats",text:P.some(n),icon:P.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:P.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return void 0!==n?P.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):P.none()}},onAction:YA(t),updateText:function(e){var r=function(t){var e=t.items;return void 0!==e&&e.length>0?tt(e,r):[{title:t.title,format:t.format}]},o=tt(V_(t),r),i=vM(t,v(o)).fold(v(n),(function(t){return t.title}));to(e,WT,{text:i})},shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},wM=Object.freeze({__proto__:null,events:function(t,e){var n=function(n,r){t.updateState.each((function(t){var o=t(n,r);e.set(o)})),t.renderComponents.each((function(t){var o=t(r,e.get()),i=q(o,n.getSystem().build);ql(n,i)}))};return io([co(Mr(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;F(o.channels,i)&&n(e,o.data)}})),vo((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])}}),xM=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),CM=[ze("channel"),Fe("renderComponents"),Fe("updateState"),Fe("initialData")],SM=Object.freeze({__proto__:null,init:function(){var t=rn(P.none());return{readState:function(){return t.get().getOr("none")},get:t.get,set:t.set,clear:function(){return t.set(P.none())}}}}),kM=_c({fields:CM,name:"reflecting",active:wM,apis:xM,state:SM}),TM=v([ze("toggleClass"),ze("fetch"),Na("onExecute"),Ke("getHotspot",P.some),Ke("getAnchorOverrides",v({})),Es(),Na("onItemExecute"),Fe("lazySink"),ze("dom"),za("onOpen"),Mf("splitDropdownBehaviours",[Zx,ih,ph]),Ke("matchWidth",!1),Ke("useMinWidth",!1),Ke("eventOrder",{}),Fe("role")].concat(hC())),OM=ud({factory:wp,schema:[ze("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:Tc([ph.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(eo)},buttonBehaviours:Tc([Eh.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),_M=ud({factory:wp,schema:[ze("dom")],name:"button",defaults:function(){return{buttonBehaviours:Tc([ph.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each((function(n){t.onExecute(n,e)}))}}}}),EM=v([OM,_M,cd({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[ze("text")],name:"aria-descriptor"}),ad({schema:[Da()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),eC()]),DM=Bd({name:"SplitDropdown",configFields:TM(),partFields:EM(),factory:function(t,e,n,r){var o,i=function(t){Hd.getCurrent(t).each((function(t){lm.highlightFirst(t),ih.focusIn(t)}))},u=function(e){sC(t,b,e,r,i,zx.HighlightFirst).get(h)},a=function(e){var n=xd(e,t,"button");return eo(n),P.some(!0)},c=O(O({},io([vo((function(e,n){wd(e,t,"aria-descriptor").each((function(t){var n=hi("aria");oi(t.element,"id",n),oi(e.element,"aria-describedby",n)}))}))])),Ah(P.some(u))),s={repositionMenus:function(t){Eh.isOn(t)&&gC(t)}};return{uid:t.uid,dom:t.dom,components:e,apis:s,eventOrder:O(O({},t.eventOrder),(o={},o[zr()]=["disabling","toggling","alloy.base.behaviour"],o)),events:c,behaviours:Rf(t.splitDropdownBehaviours,[Zx.config({others:{sandbox:function(e){var n=xd(e,t,"arrow");return mC(t,e,{onOpen:function(){Eh.on(n),Eh.on(e)},onClose:function(){Eh.off(n),Eh.off(e)}})}}}),ih.config({mode:"special",onSpace:a,onEnter:a,onDown:function(t){return u(t),P.some(!0)}}),ph.config({}),Eh.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),AM=function(t){return{isDisabled:function(){return Zd.isDisabled(t)},setDisabled:function(e){return Zd.set(t,e)}}},MM=function(t){return{setActive:function(e){Eh.set(t,e)},isActive:function(){return Eh.isOn(t)},isDisabled:function(){return Zd.isDisabled(t)},setDisabled:function(e){return Zd.set(t,e)}}},zM=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},RM=hi("focus-button"),NM=function(t,e,n,r,o,i){var u;return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:zM(n,i)},components:cy([t.map((function(t){return HT(t,i.icons)})),e.map((function(t){return FT(t,"tox-tbtn",i)}))]),eventOrder:(u={},u[lr()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:Tc([ny(i.isDisabled),Qb(),fh("common-button-display-events",[co(lr(),(function(t,e){e.event.prevent(),Zr(t,RM)}))])].concat(r.map((function(n){return kM.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return cy([t.icon.map((function(t){return HT(t,i.icons)})),t.text.map((function(t){return FT(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},BM=function(t,e,n){var r,o=rn(h),i=NM(t.icon,t.text,t.tooltip,P.none(),P.none(),n);return wp.sketch({dom:i.dom,components:i.components,eventOrder:UT,buttonBehaviours:Tc([fh("toolbar-button-events",[(r={onAction:t.onAction,getApi:e.getApi},wo((function(t,e){ry(r,t)((function(e){to(t,jT,{buttonApi:e}),r.onAction(e)}))}))),oy(e,o),iy(e,o)]),ny((function(){return t.disabled||n.isDisabled()})),Qb()].concat(e.toolbarButtonBehaviours))})},PM=function(t,e,n){return BM(t,{toolbarButtonBehaviours:[].concat(n.length>0?[fh("toolbarButtonWith",n)]:[]),getApi:AM,onSetup:t.onSetup},e)},IM=function(t,e,n){return Wt(BM(t,{toolbarButtonBehaviours:[lh.config({}),Eh.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[fh("toolbarToggleButtonWith",n)]:[]),getApi:MM,onSetup:t.onSetup},e))},LM=function(t,e,n){return function(r){return Hx((function(t){return e.fetch(t)})).map((function(o){return P.from(Hw(Wt(vw(hi("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,xv.CLOSE_ON_EXECUTE,e.select.getOr(S),n),{movement:yw(e.columns,e.presets),menuBehaviours:fb("auto"!==e.columns?[]:[vo((function(t,n){sb(t,4,Rv(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;ih.setGridSize(t,n,r)}))}))])})))}))}},HM=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],VM=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return _e(t)})).getOrDie();return e(i,r,o)}},FM={button:VM(uv,(function(t,e){return n=t,r=e.backstage.shared.providers,PM(n,r,[]);var n,r})),togglebutton:VM(sv,(function(t,e){return n=t,r=e.backstage.shared.providers,IM(n,r,[]);var n,r})),menubutton:VM(fD,(function(t,e){return tO(t,"tox-tbtn",e.backstage,P.none())})),splitbutton:VM((function(t){return ke("SplitButton",dD,t)}),(function(t,e){return n=t,r=e.backstage.shared,i=hi("channel-update-split-dropdown-display"),u=function(t){return{isDisabled:function(){return Zd.isDisabled(t)},setDisabled:function(e){return Zd.set(t,e)},setIconFill:function(e,n){ga(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){oi(t,"fill",n)}))},setIconStroke:function(e,n){ga(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){oi(t,"stroke",n)}))},setActive:function(e){oi(t.element,"aria-pressed",e),ga(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return Eh.set(t,e)}))}))},isActive:function(){return ga(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(Eh.isOn)}))}}},a=rn(h),c={getApi:u,onSetup:n.onSetup},DM.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:O({"aria-pressed":!1},zM(n.tooltip,r.providers))},onExecute:function(t){n.onAction(u(t))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:Tc([ey(r.providers.isDisabled),Qb(),fh("split-dropdown-events",[co(RM,ph.focus),oy(c,a),iy(c,a)]),wC.config({})]),eventOrder:(o={},o[Ur()]=["alloy.base.behaviour","split-dropdown-events"],o),toggleClass:"tox-tbtn--enabled",lazySink:r.getSink,fetch:LM(u,n,r.providers),parts:{menu:Hv(0,n.columns,n.presets)},components:[DM.parts.button(NM(n.icon,n.text,P.none(),P.some(i),P.some([Eh.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),r.providers)),DM.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Ep("chevron-down",r.providers.icons)},buttonBehaviours:Tc([ey(r.providers.isDisabled),Qb(),Dp()])}),DM.parts["aria-descriptor"]({text:r.providers.translate("To open the popup, press Shift+Enter")})]});var n,r,o,i,u,a,c})),grouptoolbarbutton:VM((function(t){return ke("GroupToolbarButton",cD,t)}),(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[Os]=e.backstage.shared.header.isPositionedAtTop()?$c.TopToBottom:$c.BottomToTop,r);switch(Nb(n)){case yv.floating:return function(t,e,n,r){var o=e.shared;return fA.sketch({lazySink:o.getSink,fetch:function(){return Hx((function(e){e(q(n(t.items),kA))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:NM(t.icon,t.text,t.tooltip,P.none(),P.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(t,e.backstage,(function(t){return qM(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,P.none())}),i);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return function(t,e){var n=O({type:"advanced"},e.styleselect);return tM(t,e,yM(t,n))}(t,e.backstage)},fontsizeSelectButton:function(t,e){return function(t,e){return tM(t,e,pM(t))}(t,e.backstage)},fontSelectButton:function(t,e){return function(t,e){return tM(t,e,dM(t))}(t,e.backstage)},formatButton:function(t,e){return function(t,e){return tM(t,e,bM(t))}(t,e.backstage)},alignMenuButton:function(t,e){return function(t,e){return tM(t,e,sM(t))}(t,e.backstage)}},jM={styleselect:FM.styleSelectButton,fontsizeselect:FM.fontsizeSelectButton,fontselect:FM.fontSelectButton,formatselect:FM.formatButton,align:FM.alignMenuButton},UM=function(t){var e,n=t.toolbar,o=t.buttons;return!1===n?[]:void 0===n||!0===n?function(t){var e=q(HM,(function(e){var n=K(e.items,(function(e){return Ft(t,e)||Ft(jM,e)}));return{name:e.name,items:n}}));return K(e,(function(t){return t.items.length>0}))}(o):r(n)?(e=n.split("|"),q(e,(function(t){return{items:t.trim().split(" ")}}))):function(t){return g(t,(function(t){return Ft(t,"name")&&Ft(t,"items")}))}(n)?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},WM=function(t,e,n,r,o,i){return Vt(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return ft(t,(function(t){return Vt(e,t+n.toLowerCase())}))}))})).fold((function(){return Vt(jM,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return P.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?function(t,e,n){return Vt(FM,t.type).fold((function(){return console.error("skipping button defined by",t),P.none()}),(function(r){return P.some(r(t,e,n))}))}(e,o,t):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),P.none())}))},qM=function(t,e,n,r){var o=UM(e),i=q(o,(function(o){var i=tt(o.items,(function(o){return 0===o.trim().length?[]:WM(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:P.from(t.translate(o.name)),items:i}}));return K(i,(function(t){return t.items.length>0}))},$M=function(t,e,n,o){var i=e.outerContainer,u=n.toolbar,a=n.buttons;if(g(u,r)){var c=u.map((function(e){var r={toolbar:e,buttons:a,allowToolbarGroups:n.allowToolbarGroups};return qM(t,r,{backstage:o},P.none())}));IA.setToolbars(i,c)}else IA.setToolbar(i,qM(t,n,{backstage:o},P.none()))},GM=Vn(),KM=GM.os.isiOS()&&GM.os.version.major<=12,XM=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=rn(0),a=e.outerContainer;$A(t);var c,s,l=un.fromDom(o.targetNode),f=Uo(jo(l));c=l,s=e.mothership,Ql(c,s,Ko),Jl(f,e.uiMothership),t.on("PostRender",(function(){$M(t,e,n,r),i.set(t.getWin().innerWidth),IA.setMenubar(a,VA(t,n)),IA.setSidebar(a,n.sidebar),function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=rn(Hu(r.innerWidth,r.innerHeight)),u=rn(Hu(o.offsetWidth,o.offsetHeight)),a=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(Hu(r.innerWidth,r.innerHeight)),Gy(t))},c=function(){var e=t.getDoc().documentElement,n=u.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(u.set(Hu(e.offsetWidth,e.offsetHeight)),Gy(t))},s=function(e){return function(t,e){return t.fire("ScrollContent",e)}(t,e)};n.bind(r,"resize",a),n.bind(r,"scroll",s);var l=is(un.fromDom(t.getBody()),"load",c),f=e.uiMothership.element;t.on("hide",(function(){lu(f,"display","none")})),t.on("show",(function(){bu(f,"display")})),t.on("NodeChange",c),t.on("remove",(function(){l.unbind(),n.unbind(r,"resize",a),n.unbind(r,"scroll",s),r=null}))}(t,e)}));var d,m,g,h=IA.getSocket(a).getOrDie("Could not find expected socket element");if(KM){fu(h.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var p=(d=function(){t.fire("ScrollContent")},m=20,g=null,{cancel:function(){u(g)||(clearTimeout(g),g=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];u(g)&&(g=setTimeout((function(){g=null,d.apply(null,t)}),m))}}),v=os(h.element,"scroll",p.throttle);t.on("remove",v.unbind)}Jb(t,e),t.addCommand("ToggleSidebar",(function(e,n){IA.toggleSidebar(a,n),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return IA.whichSidebar(a)}));var b=Nb(t);b!==yv.sliding&&b!==yv.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var n=t.getWin().innerWidth;n!==i.get()&&(IA.refreshToolbar(e.outerContainer),i.set(n))}));var y={enable:function(){Yb(e,!1)},disable:function(){Yb(e,!0)},isDisabled:function(){return Zd.isDisabled(a)}};return{iframeContainer:h.element.dom,editorContainer:a.element.dom,api:y}}}),YM=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?P.some(parseInt(""+t,10)):P.none()},JM=function(t){return m(t)?t+"px":t},QM=function(t,e,n){var r=e.filter((function(e){return t<e})),o=n.filter((function(e){return t>e}));return r.or(o).getOr(t)},ZM=function(t){return function(t){var e=Cb(t),n=Tb(t),r=_b(t);return YM(e).map((function(t){return QM(t,n,r)}))}(t).getOr(Cb(t))},tz=function(t){var e=Sb(t),n=kb(t),r=Ob(t);return YM(e).map((function(t){return QM(t,n,r)}))},ez=function(t,e,n,r,o){var i=n.uiMothership,u=n.outerContainer,a=wb.DOM,c=Vb(t),s=Ub(t),l=Ob(t).or(tz(t)),f=r.shared.header,d=f.isPositionedAtTop,m=Nb(t),g=m===yv.sliding||m===yv.floating,h=rn(!1),p=function(){return h.get()&&!t.removed},b=function(t){return g?t.fold(v(0),(function(t){return t.components().length>1?Pu(t.components()[1].element):0})):0},y=function(){i.broadcastOn([df()],{})},w=function(t){if(void 0===t&&(t=!1),p()){var n,r,i,a,f;if(c||(n=l.getOrThunk((function(){var t=YM(mu(uu(),"margin-left")).getOr(0);return Wu(uu())-Fu(e).left+t})),lu(o.get().element,"max-width",n+"px")),g&&IA.refreshToolbar(u),c||(r=IA.getToolbar(u),i=b(r),a=ra(e),f=d()?Math.max(a.y-Pu(o.get().element)+i,0):a.bottom,fu(u.element,{position:"absolute",top:Math.round(f)+"px",left:Math.round(a.x)+"px"})),s){var m=o.get();t?JE.reset(m):JE.refresh(m)}y()}},x=function(n){if(void 0===n&&(n=!0),!c&&s&&p()){var r=f.getDockingMode(),i=function(n){switch(Ib(t)){case zb.auto:var r=IA.getToolbar(u),o=b(r),i=Pu(n.element)-o,a=ra(e);if(a.y>i)return"top";var c=Mo(e),s=Math.max(c.dom.scrollHeight,Pu(c));return a.bottom<s-i||ia().bottom<a.bottom-i?"bottom":"top";case zb.bottom:return"bottom";case zb.top:default:return"top"}}(o.get());i!==r&&(!function(t){var e=o.get();JE.setModes(e,[t]),f.setDockingMode(t);var n=d()?$c.TopToBottom:$c.BottomToTop;oi(e.element,Os,n)}(i),n&&w(!0))}};return{isVisible:p,isPositionedAtTop:d,show:function(){h.set(!0),lu(u.element,"display","flex"),a.addClass(t.getBody(),"mce-edit-focus"),bu(i.element,"display"),x(!1),w()},hide:function(){h.set(!1),n.outerContainer&&(lu(u.element,"display","none"),a.removeClass(t.getBody(),"mce-edit-focus")),lu(i.element,"display","none")},update:w,updateMode:x,repositionPopups:y}},nz=function(t,e){var n=ra(t);return{pos:e?n.y:n.bottom,bounds:n}},rz=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=e.mothership,u=e.uiMothership,a=e.outerContainer,c=rn(null),s=un.fromDom(o.targetNode),l=ez(t,s,e,r,c),f=function(t){return t.getParam("toolbar_persist",!1,"boolean")}(t);GA(t);var d=function(){if(c.get())l.show();else{c.set(IA.getHeader(a).getOrDie());var o=Fb(t);Jl(o,i),Jl(o,u),$M(t,e,n,r),IA.setMenubar(a,VA(t,n)),l.show(),function(t,e,n,r){var o=rn(nz(e,n.isPositionedAtTop())),i=function(r){var i=nz(e,n.isPositionedAtTop()),u=i.pos,a=i.bounds,c=o.get(),s=c.pos,l=c.bounds,f=a.height!==l.height||a.width!==l.width;o.set({pos:u,bounds:a}),f&&Gy(t,r),n.isVisible()&&(s!==u?n.update(!0):f&&(n.updateMode(),n.repositionPopups()))};r||(t.on("activate",n.show),t.on("deactivate",n.hide)),t.on("SkinLoaded ResizeWindow",(function(){return n.update(!0)})),t.on("NodeChange keydown",(function(t){yp.requestAnimationFrame((function(){return i(t)}))})),t.on("ScrollWindow",(function(){return n.updateMode()}));var u=es();u.set(is(un.fromDom(t.getBody()),"load",i)),t.on("remove",(function(){u.clear()}))}(t,s,l,f),t.nodeChanged()}},m=function(){return yp.setEditorTimeout(t,d,0)};t.on("show",d),t.on("hide",l.hide),f||(t.on("focus",m),t.on("blur",l.hide)),t.on("init",(function(){(t.hasFocus()||f)&&m()})),Jb(t,e);var g={show:function(){l.show()},hide:function(){l.hide()},enable:function(){Yb(e,!1)},disable:function(){Yb(e,!0)},isDisabled:function(){return Zd.isDisabled(a)}};return{editorContainer:a.element.dom,api:g}}}),oz="contexttoolbar-hide",iz=function(t,e){return co(jT,(function(n,r){var o=function(t){return{hide:function(){return Zr(t,Pr())},getValue:function(){return Af.getValue(t)}}}(t.get(n));e.onAction(o,r.event.buttonApi)}))},uz=function(t,e,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?function(t,e,n){var r=e.original;r.primary;var o=_(r,["primary"]),i=Te(sv(O(O({},o),{type:"togglebutton",onAction:h})));return IM(i,n.backstage.shared.providers,[iz(t,e)])}(t,e,r):function(t,e,n){var r=e.original;r.primary;var o=_(r,["primary"]),i=Te(uv(O(O({},o),{type:"button",onAction:h})));return PM(i,n.backstage.shared.providers,[iz(t,e)])}(t,e,r)},az=function(t,e){var n=t.label.fold((function(){return{}}),(function(t){return{"aria-label":t}})),r=xp(Dx.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:Tc([ih.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map((function(t){return eo(t),!0}))},onLeft:function(t,e){return e.cut(),P.none()},onRight:function(t,e){return e.cut(),P.none()}})])})),o=function(t,e,n){var r=q(e,(function(e){return xp(uz(t,e,n))}));return{asSpecs:function(){return q(r,(function(t){return t.asSpec()}))},findPrimary:function(t){return ft(e,(function(e,n){return e.primary?P.from(r[n]).bind((function(e){return e.getOpt(t)})).filter(x(Zd.isDisabled)):P.none()}))}}}(r,t.commands,e);return[{title:P.none(),items:[r.asSpec()]},{title:P.none(),items:o.asSpecs()}]},cz=az,sz=function(t,e,n){return void 0===n&&(n=.01),e.bottom-t.y>=n&&t.bottom-e.y>=n},lz=function(t){var e=function(t){var e=t.getBoundingClientRect();if(e.height<=0&&e.width<=0){var n=Lo(un.fromDom(t.startContainer),t.startOffset).element;return(Oo(n)?Ro(n):P.some(n)).filter(To).map((function(t){return t.dom.getBoundingClientRect()})).getOr(e)}return e}(t.selection.getRng());if(t.inline){var n=Xu();return na(n.left+e.left,n.top+e.top,e.width,e.height)}var r=oa(un.fromDom(t.getBody()));return na(r.x+e.left,r.y+e.top,e.width,e.height)},fz=function(t,e,n,r){void 0===r&&(r=0);var o=Qu(window),i=ra(un.fromDom(t.getContentAreaContainer())),u=Eb(t)||Db(t)||Mb(t),a=function(t,e,n){var r=Math.max(t.x+n,e.x);return{x:r,width:Math.min(t.right-n,e.right)-r}}(i,o,r),c=a.x,s=a.width;if(t.inline&&!u)return na(c,o.y,s,o.height);var l=function(t,e,n,r,o,i){var u=un.fromDom(t.getContainer()),a=ga(u,".tox-editor-header").getOr(u),c=ra(a),s=c.y>=e.bottom,l=r&&!s;if(t.inline&&l)return{y:Math.max(c.bottom+i,n.y),bottom:n.bottom};if(t.inline&&!l)return{y:n.y,bottom:Math.min(c.y-i,n.bottom)};var f="line"===o?ra(u):e;return l?{y:Math.max(c.bottom+i,n.y),bottom:Math.min(f.bottom-i,n.bottom)}:{y:Math.max(f.y+i,n.y),bottom:Math.min(c.y-i,n.bottom)}}(t,i,o,e.header.isPositionedAtTop(),n,r),f=l.y,d=l.bottom;return na(c,f,s,d-f)},dz={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},mz={maxHeightFunction:vs(),maxWidthFunction:iA()},gz=function(t){return"node"===t},hz=function(t,e,n,r,o){var i=lz(t),u=r.lastElement().exists((function(t){return Un(n,t)}));return function(t,e){var n=t.selection.getRng(),r=Lo(un.fromDom(n.startContainer),n.startOffset);return n.startContainer===n.endContainer&&n.startOffset===n.endOffset-1&&Un(r.element,e)}(t,n)?u?pp:fp:u?function(t,e,n){var r=hu(t,"position");lu(t,"position",e);var o=n(t);return r.each((function(e){return lu(t,"position",e)})),o}(e,r.getMode(),(function(){return sz(i,ra(e))&&!r.isReposition()?bp:pp})):("fixed"===r.getMode()?o.y+Xu().top:o.y)+(Pu(e)+12)<=i.y?fp:dp},pz=function(t,e,n,r){var o=function(e){return function(r,o,i,u,a){var c=hz(t,u,e,n,a),s=O(O({},r),{y:a.y,height:a.height});return O(O({},c(s,o,i,u,a)),{alwaysFit:!0})}},i=function(t){return gz(r)?[o(t)]:[]};return e?{onLtr:function(t){return[lc,ic,uc,ac,cc,sc].concat(i(t))},onRtl:function(t){return[lc,uc,ic,cc,ac,sc].concat(i(t))}}:{onLtr:function(t){return[sc,lc,ac,ic,cc,uc].concat(i(t))},onRtl:function(t){return[sc,lc,cc,uc,ac,ic].concat(i(t))}}},vz=function(t,e){var n=K(e,(function(e){return e.predicate(t.dom)})),r=G(n,(function(t){return"contexttoolbar"===t.type}));return{contextToolbars:r.pass,contextForms:r.fail}},bz=function(t,e,n){var r=vz(t,e);if(r.contextForms.length>0)return P.some({elem:t,toolbars:[r.contextForms[0]]});var o=vz(t,n);if(o.contextForms.length>0)return P.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var e=function(e){return j(t,(function(t){return t.position===e}))},n=function(e){return K(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),u=q(n("selection"),(function(t){return O(O({},t),{position:"node"})}));return i.concat(u)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return P.some({elem:t,toolbars:i})}return P.none()},yz=function(t,e,n){return t(e)?P.none():Zn(e,(function(t){if(To(t)){var e=vz(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:function(t){if(t.length<=1)return t;var e=function(e){return J(t,(function(t){return t.position===e}))};return e("selection").orThunk((function(){return e("node")})).orThunk((function(){return e("line")})).map((function(t){return t.position})).fold((function(){return[]}),(function(e){return K(t,(function(t){return t.position===e}))}))}(r);return i.length>0?P.some({elem:t,toolbars:i}):P.none()}return P.none()}),t)},wz=function(t,e){var n={},r=[],o=[],i={},u={},a=function(t,a){var c=Te(ke("ContextForm",pv,a));n[t]=c,c.launch.map((function(n){i["form:"+t]=O(O({},a.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})})),"editor"===c.scope?o.push(c):r.push(c),u[t]=c},c=function(t,e){var n;(n=e,ke("ContextToolbar",vv,n)).each((function(n){"editor"===e.scope?o.push(n):r.push(n),u[t]=n}))},s=Mt(t);return $(s,(function(e){var n=t[e];"contextform"===n.type?a(e,n):"contexttoolbar"===n.type&&c(e,n)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:u,formNavigators:i}},xz=hi("forward-slide"),Cz=hi("backward-slide"),Sz=hi("change-slide-event"),kz="tox-pop--resizing",Tz="tox-pop--transition",Oz=function(t,e,n,r){var o,i,u=r.backstage,a=u.shared,c=Vn().deviceType.isTouch,s=ns(),l=ns(),f=ns(),d=zu((o={sink:n,onEscape:function(){return t.focus(),P.some(!0)}},i=rn([]),Zh.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),Zh.getContent(t).each((function(t){bu(t.element,"visibility")})),Yi(t.element,kz),bu(t.element,"width")},inlineBehaviours:Tc([fh("context-toolbar-events",[po(Sr(),(function(t,e){"width"===e.event.raw.propertyName&&(Yi(t.element,kz),bu(t.element,"width"))})),co(Sz,(function(t,e){var n=t.element;bu(n,"width");var r=Wu(n);Zh.setContent(t,e.event.contents),Ki(n,kz);var o=Wu(n);lu(n,"width",r+"px"),Zh.getContent(t).each((function(t){e.event.focus.bind((function(t){return Rc(t),Pc(n)})).orThunk((function(){return ih.focusIn(t),Bc(jo(n))}))})),yp.setTimeout((function(){lu(t.element,"width",o+"px")}),0)})),co(xz,(function(t,e){Zh.getContent(t).each((function(e){i.set(i.get().concat([{bar:e,focus:Bc(jo(t.element))}]))})),to(t,Sz,{contents:e.event.forwardContents,focus:P.none()})})),co(Cz,(function(t,e){st(i.get()).each((function(e){i.set(i.get().slice(0,i.get().length-1)),to(t,Sz,{contents:Ru(e.bar),focus:e.focus})}))}))]),ih.config({mode:"special",onEscape:function(t){return st(i.get()).fold((function(){return o.onEscape()}),(function(e){return Zr(t,Cz),P.some(!0)}))}})]),lazySink:function(){return gt.value(o.sink)}}))),m=function(){var e=f.get().getOr("node"),n=gz(e)?1:0;return fz(t,a,e,n)},g=function(){return!(t.removed||c()&&u.isContextMenuOpen())},p=function(){if(g()){var e=m(),n=tu(f.get(),"node")?function(t,e){return e.filter(iu).map(oa).getOrThunk((function(){return lz(t)}))}(t,s.get()):lz(t);return e.height<=0||!sz(n,e)}return!0},v=function(){s.clear(),l.clear(),f.clear(),Zh.hide(d)},b=function(){if(Zh.isOpen(d)){var t=d.element;bu(t,"display"),p()?lu(t,"display","none"):(l.set(0),Zh.reposition(d))}},y=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:Tc([ih.config({mode:"acyclic"}),fh("pop-dialog-wrap-events",[vo((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return ih.focusIn(e)}))})),bo((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},w=$t((function(){return wz(e,(function(t){var e=x([t]);to(d,xz,{forwardContents:y(e)})}))})),x=function(e){var n=t.ui.registry.getAll().buttons,o=w(),i=O(O({},n),o.formNavigators),u=Nb(t)===yv.scrolling?yv.scrolling:yv.default,c=Z(q(e,(function(e){return"contexttoolbar"===e.type?function(e,n){return qM(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,P.some(["form:"]))}(i,e):function(t,e){return cz(t,e)}(e,a.providers)})));return DA({type:u,uid:hi("context-toolbar"),initGroups:c,onEscape:P.none,cyclicKeying:!0,providers:a.providers})},C=function(e,r){var o="node"===e?a.anchors.node(r):a.anchors.cursor(),i=function(t,e,n,r){return"line"===e?{bubble:xs(12,0,dz),layouts:{onLtr:function(){return[fc]},onRtl:function(){return[dc]}},overrides:mz}:{bubble:xs(0,12,dz,1/12),layouts:pz(t,n,r,e),overrides:mz}}(t,e,c(),{lastElement:s.get,isReposition:function(){return tu(l.get(),0)},getMode:function(){return Fl.getMode(n)}});return Wt(o,i)},S=function(t,e){if(k.cancel(),g()){var r=x(t),o=t[0].position,i=C(o,e);f.set(o),l.set(1);var u=d.element;bu(u,"display"),function(t){return tu(nu(t,s.get(),Un),!0)}(e)||(Yi(u,Tz),Fl.reset(n,d)),Zh.showWithinBounds(d,y(r),{anchor:i,transition:{classes:[Tz],mode:"placement"}},(function(){return P.some(m())})),e.fold(s.clear,s.set),p()&&lu(u,"display","none")}},k=Ip((function(){t.hasFocus()&&!t.removed&&(Ji(d.element,Tz)?k.throttle():function(t,e){var n,r=un.fromDom(e.getBody()),o=function(t){return Un(t,r)},i=un.fromDom(e.selection.getNode());return o(n=i)||qn(r,n)?bz(i,t.inNodeScope,t.inEditorScope).orThunk((function(){return yz(o,i,t)})):P.none()}(w(),t).fold(v,(function(t){S(t.toolbars,P.some(t.elem))})))}),17);t.on("init",(function(){t.on("remove",v),t.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",b),t.on("click keyup focus SetContent",k.throttle),t.on(oz,v),t.on("contexttoolbar-show",(function(e){var n=w();Vt(n.lookupTable,e.toolbarKey).each((function(n){S([n],ru(e.target!==t,e.target)),Zh.getContent(d).each(ih.focusIn)}))})),t.on("focusout",(function(e){yp.setEditorTimeout(t,(function(){Pc(n.element).isNone()&&Pc(d.element).isNone()&&v()}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&v()})),t.on("AfterProgressState",(function(e){e.state?v():t.hasFocus()&&k.throttle()})),t.on("NodeChange",(function(t){Pc(d.element).fold(k.throttle,h)}))}))},_z={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},Ez=(nM="[eE][+-]?[0-9]+",oM=["Infinity","[0-9]+\\."+(rM=function(t){return"(?:"+t+")?"})(eM="[0-9]+")+rM(nM),"\\.[0-9]+"+rM(nM),eM+rM(nM)].join("|"),new RegExp("^([+-]?(?:"+oM+"))(.*)$")),Dz=function(t,e){return P.from(Ez.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return j(e,(function(e){return j(_z[e],(function(e){return t===e}))}))}(r,e)?P.some({value:n,unit:r}):P.none()}))},Az=function(t,e){var n=function(){var n=e.getOptions(t),r=e.getCurrent(t).map(e.hash),o=ns();return q(n,(function(n){return{type:"togglemenuitem",text:e.display(n),onSetup:function(i){var u=function(t){t&&(o.on((function(t){return t.setActive(!1)})),o.set(i)),i.setActive(t)};u(tu(r,e.hash(n)));var a=e.watcher(t,n,u);return function(){o.clear(),a()}},onAction:function(){return e.setCurrent(t,n)}}}))};t.ui.registry.addMenuButton(e.name,{tooltip:e.text,icon:e.icon,fetch:function(t){return t(n())},onSetup:e.onToolbarSetup}),t.ui.registry.addNestedMenuItem(e.name,{type:"nestedmenuitem",text:e.text,getSubmenuItems:n,onSetup:e.onMenuSetup})},Mz={name:"lineheight",text:"Line height",icon:"line-height",getOptions:function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},hash:function(t){return function(t,e){return Dz(t,e).map((function(t){return t.value+t.unit}))}(t,["fixed","relative","empty"]).getOr(t)},display:b,watcher:function(t,e,n){return t.formatter.formatChanged("lineheight",n,!1,{value:e}).unbind},getCurrent:function(t){return P.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,e){return t.execCommand("LineHeight",!1,e)}},zz=function(t){Az(t,Mz),function(t){return P.from(function(t){return t.getParam("content_langs",void 0,"array")}(t)).map((function(e){return{name:"language",text:"Language",icon:"language",getOptions:v(e),hash:function(t){return c(t.customCode)?t.code:t.code+"/"+t.customCode},display:function(t){return t.title},watcher:function(t,e,n){return t.formatter.formatChanged("lang",n,!1,{value:e.code,customValue:e.customCode}).unbind},getCurrent:function(t){var e=un.fromDom(t.selection.getNode());return tr(e,(function(t){return P.some(t).filter(To).bind((function(t){return ui(t,"lang").map((function(e){return{code:e,customCode:ui(t,"data-mce-lang").getOrUndefined(),title:""}}))}))}))},setCurrent:function(t,e){return t.execCommand("Lang",!1,e)},onToolbarSetup:function(e){var n=es();return e.setActive(t.formatter.match("lang",{},void 0,!0)),n.set(t.formatter.formatChanged("lang",e.setActive,!0)),n.clear}}}))}(t).each((function(e){return Az(t,e)}))},Rz=function(t,e){!function(t,e){var n=ZA(0,e,sM(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=ZA(0,e,dM(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=O({type:"advanced"},e.styleselect),r=ZA(0,e,yM(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(t,e),function(t,e){var n=ZA(0,e,bM(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=ZA(0,e,pM(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e)},Nz=function(t){return XA(t,"NodeChange",(function(e){e.setDisabled(!t.queryCommandState("outdent"))}))},Bz=function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:Nz(t),onAction:JA(t,"outdent")}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:JA(t,"indent")})}(t)},Pz=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},Iz=function(t){!function(t){zk.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:KA(t,e.name),onAction:Pz(t,e.name)})}));for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:KA(t,n),onAction:Pz(t,n)})}}(t),function(t){zk.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],(function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:JA(t,e.action)})}))}(t),function(t){zk.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:JA(t,e.action),onSetup:KA(t,e.name)})}))}(t)},Lz=function(t){Iz(t),function(t){zk.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],(function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:JA(t,e.action)})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:Pz(t,"code")})}(t)},Hz=function(t,e){return XA(t,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(function(n){n.setDisabled(t.mode.isReadOnly()||!t.undoManager[e]())}))},Vz=function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:Hz(t,"hasUndo"),onAction:JA(t,"undo")}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:Hz(t,"hasRedo"),onAction:JA(t,"redo")})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:Hz(t,"hasUndo"),onAction:JA(t,"undo")}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:Hz(t,"hasRedo"),onAction:JA(t,"redo")})}(t)},Fz=function(t){return XA(t,"VisualAid",(function(e){e.setActive(t.hasVisual)}))},jz=function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:JA(t,"mceToggleVisualAid")})}(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:Fz(t),onAction:JA(t,"mceToggleVisualAid")})}(t)},Uz=function(t,e){!function(t){$([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:JA(t,e.cmd),onSetup:KA(t,e.name)})})),t.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:JA(t,"JustifyNone")})}(t),Lz(t),Rz(t,e),Vz(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",(function(e,n){!function(t,e,n){t.undoManager.transact((function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()}))}(t,e,n)})),t.addCommand("mceRemoveTextcolor",(function(e){!function(t,e){t.undoManager.transact((function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}))}(t,e)}))}(t);var e=rn(null),n=rn(null);gw(t,"forecolor","forecolor","Text color",e),gw(t,"backcolor","hilitecolor","Background color",n),hw(t,"forecolor","forecolor","Text color"),hw(t,"backcolor","hilitecolor","Background color")}(t),jz(t),Bz(t),zz(t)},Wz=function(t,e){return{type:"makeshift",x:t,y:e}},qz=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},$z=function(t,e){var n=wb.DOM.getPos(t);return function(t,e,n){return Wz(t.x+e,t.y+n)}(e,n.x,n.y)},Gz=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(qz(t)){var e=t.touches[0];return Wz(e.pageX,e.pageY)}return Wz(t.pageX,t.pageY)}(e):$z(t.getContentAreaContainer(),function(t){if(qz(t)){var e=t.touches[0];return Wz(e.clientX,e.clientY)}return Wz(t.clientX,t.clientY)}(e)):Kz(t)},Kz=function(t){return{type:"selection",root:un.fromDom(t.selection.getNode())}},Xz=function(t,e,n){switch(n){case"node":return function(t){return{type:"node",node:P.some(un.fromDom(t.selection.getNode())),root:un.fromDom(t.getBody())}}(t);case"point":return Gz(t,e);case"selection":return Kz(t)}},Yz=function(t,e,n,r,o,i){var u=n(),a=Xz(t,e,i);QT(u,xv.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),Zh.showMenuAt(o,{anchor:a},{menu:{markers:Pv("normal")},data:t})}))},Jz={onLtr:function(){return[lc,ic,uc,ac,cc,sc,fp,dp,lp,cp,sp,ap]},onRtl:function(){return[lc,uc,ic,cc,ac,sc,fp,dp,sp,ap,lp,cp]}},Qz={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},Zz=function(t,e,n,r,o,i,u){var a=function(t,e,n){var r=Xz(t,e,n);return O({bubble:xs(0,"point"===n?12:0,Qz),layouts:Jz,overrides:{maxWidthFunction:iA(),maxHeightFunction:vs()}},r)}(t,e,i);QT(n,xv.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),Zh.showMenuWithinBounds(o,{anchor:a},{menu:{markers:Pv("normal"),highlightImmediately:u},data:n,type:"horizontal"},(function(){return P.some(fz(t,r.shared,"node"===i?"node":"selection"))})),t.fire(oz)}))},tR=function(t,e,n,r,o,i){var u=Vn(),a=u.os.isiOS(),c=u.os.isOSX(),s=u.os.isAndroid(),l=u.deviceType.isTouch(),f=function(){var u=n();Zz(t,e,u,r,o,i,!(s||a||c&&l))};if((c||a)&&"node"!==i){var d=function(){!function(t){var e=t.selection.getRng(),n=function(){yp.setEditorTimeout(t,(function(){t.selection.setRng(e)}),10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}}(t),f()};!function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng();return ml(t.getWin(),Gs.domRange(o)).exists((function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY}))}(t,e)?(t.once("selectionchange",d),t.once("touchend",(function(){return t.off("selectionchange",d)}))):d()}else f()},eR=function(t){return"string"==typeof t?t.split(/[ ,]/):t},nR=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},rR=function(t){return function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return P.from(t.getParam(e)).map(eR).getOrThunk((function(){return K(eR(n),(function(t){return Ft(r,t)}))}))}(t,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},oR=function(t){return r(t)?"|"===t:"separator"===t.type},iR={type:"separator"},uR=function(t){var e,n=function(t){return{text:t.text,icon:t.icon,disabled:t.disabled,shortcut:t.shortcut}};if(r(t))return t;switch(t.type){case"separator":return iR;case"submenu":return O(O({type:"nestedmenuitem"},n(t)),{getSubmenuItems:function(){var e=t.getSubmenuItems();return r(e)?e:q(e,uR)}});default:return O(O({type:"menuitem"},n(t)),{onAction:(e=t.onAction,function(){return e()})})}},aR=function(t,e){if(0===e.length)return t;var n=st(t).filter((function(t){return!oR(t)})).fold((function(){return[]}),(function(t){return[iR]}));return t.concat(n).concat(e).concat([iR])},cR=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},sR=function(t,e){return cR(t,e)?t.selection.getStart(!0):e.target},lR=function(t,e,n){var o=Vn().deviceType.isTouch,i=zu(Zh.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:Tc([fh("dismissContextMenu",[co(qr(),(function(e,n){lf.close(e),t.focus()}))])])})),u=function(t){return Zh.hide(i)},a=function(e){if(nR(t)&&e.preventDefault(),!function(t,e){return e.ctrlKey&&!nR(t)}(t,e)&&!function(t){return!1===t.getParam("contextmenu")}(t)){var u=function(t,e){var n=function(t){return t.getParam("contextmenu_avoid_overlap","","string")}(t),r=cR(t,e)?"selection":"point";if(pn(n)){var o=sR(t,e);return Fw(un.fromDom(o),n)?"node":r}return r}(t,e);(o()?tR:Yz)(t,e,(function(){var n=sR(t,e),o=t.ui.registry.getAll(),i=rR(t);return function(t,e,n){var o=Y(e,(function(e,o){return Vt(t,o.toLowerCase()).map((function(t){var o=t.update(n);if(r(o))return aR(e,o.split(" "));if(o.length>0){var i=q(o,uR);return aR(e,i)}return e})).getOrThunk((function(){return e.concat([o])}))}),[]);return o.length>0&&oR(o[o.length-1])&&o.pop(),o}(o.contextMenus,i,n)}),n,i,u)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(o()?"":" ResizeWindow");t.on(e,u),t.on("longpress contextmenu",a)}))},fR=$n([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),dR=function(t){return function(e){return e.translate(-t.left,-t.top)}},mR=function(t){return function(e){return e.translate(t.left,t.top)}},gR=function(t){return function(e,n){return Y(t,(function(t,e){return e(t)}),Hu(e,n))}},hR=function(t,e,n){return t.fold(gR([mR(n),dR(e)]),gR([dR(e)]),gR([]))},pR=function(t,e,n){return t.fold(gR([mR(n)]),gR([]),gR([mR(e)]))},vR=function(t,e,n){return t.fold(gR([]),gR([dR(n)]),gR([mR(e),dR(n)]))},bR=function(t,e,n){var r=t.fold((function(t,e){return{position:P.some("absolute"),left:P.some(t+"px"),top:P.some(e+"px")}}),(function(t,e){return{position:P.some("absolute"),left:P.some(t-n.left+"px"),top:P.some(e-n.top+"px")}}),(function(t,e){return{position:P.some("fixed"),left:P.some(t+"px"),top:P.some(e+"px")}}));return O({right:P.none(),bottom:P.none()},r)},yR=function(t,e,n,r){var o=function(t,o){return function(i,u){var a=t(e,n,r);return o(i.getOr(a.left),u.getOr(a.top))}};return t.fold(o(vR,wR),o(pR,xR),o(hR,CR))},wR=fR.offset,xR=fR.absolute,CR=fR.fixed,SR=function(t,e){var n=ii(t,e);return c(n)?NaN:parseInt(n,10)},kR=function(t,e,n,r){return function(t,e){var n=t.element,r=SR(n,e.leftAttr),o=SR(n,e.topAttr);return isNaN(r)||isNaN(o)?P.none():P.some(Hu(r,o))}(t,e).fold((function(){return n}),(function(t){return CR(t.left+r.left,t.top+r.top)}))},TR=function(t,e,n,r,o,i){var u=kR(t,e,n,r),a=e.mustSnap?ER(t,e,u,o,i):DR(t,e,u,o,i),c=hR(u,o,i);return function(t,e,n){var r=t.element;oi(r,e.leftAttr,n.left+"px"),oi(r,e.topAttr,n.top+"px")}(t,e,c),a.fold((function(){return{coord:CR(c.left,c.top),extra:P.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},OR=function(t,e){!function(t,e){var n=t.element;ci(n,e.leftAttr),ci(n,e.topAttr)}(t,e)},_R=function(t,e,n,r){return ft(t,(function(t){var o=t.sensor;return function(t,e,n,r,o,i){var u=pR(t,o,i),a=pR(e,o,i);return Math.abs(u.left-a.left)<=n&&Math.abs(u.top-a.top)<=r}(e,o,t.range.left,t.range.top,n,r)?P.some({output:yR(t.output,e,n,r),extra:t.extra}):P.none()}))},ER=function(t,e,n,r,o){var i=e.getSnapPoints(t);return _R(i,n,r,o).orThunk((function(){return Y(i,(function(t,e){var i=e.sensor,u=function(t,e,n,r,o,i){var u=pR(t,o,i),a=pR(e,o,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top);return Hu(c,s)}(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:P.some(u),snap:P.some(e)}}),(function(n){return(u.left+u.top)/2<=(n.left+n.top)/2?{deltas:P.some(u),snap:P.some(e)}:t}))}),{deltas:P.none(),snap:P.none()}).snap.map((function(t){return{output:yR(t.output,n,r,o),extra:t.extra}}))}))},DR=function(t,e,n,r,o){var i=e.getSnapPoints(t);return _R(i,n,r,o)},AR=Object.freeze({__proto__:null,snapTo:function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=Do(t.element),u=Xu(i),a=RE(o),c=function(t,e,n){return{coord:yR(t.output,t.output,e,n),extra:t.extra}}(r,u,a),s=bR(c.coord,0,a);du(o,s)}}}),MR="data-initial-z-index",zR=function(t,e){t.getSystem().addToGui(e),function(t){Ro(t.element).filter(To).each((function(e){hu(e,"z-index").each((function(t){oi(e,MR,t)})),lu(e,"z-index",mu(t.element,"z-index"))}))}(e)},RR=function(t){!function(t){Ro(t.element).filter(To).each((function(t){ui(t,MR).fold((function(){return bu(t,"z-index")}),(function(e){return lu(t,"z-index",e)})),ci(t,MR)}))}(t),t.getSystem().removeFromGui(t)},NR=function(t,e,n){return t.getSystem().build(nx.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},BR=Ge("snaps",[ze("getSnapPoints"),za("onSensor"),ze("leftAttr"),ze("topAttr"),Ke("lazyViewport",ia),Ke("mustSnap",!1)]),PR=[Ke("useFixed",S),ze("blockerClass"),Ke("getTarget",b),Ke("onDrag",h),Ke("repositionTarget",!0),Ke("onDrop",h),tn("getBounds",ia),BR],IR=function(t){return(e=hu(t,"left"),n=hu(t,"top"),r=hu(t,"position"),o=function(t,e,n){return("fixed"===n?CR:wR)(parseInt(t,10),parseInt(e,10))},e.isSome()&&n.isSome()&&r.isSome()?P.some(o(e.getOrDie(),n.getOrDie(),r.getOrDie())):P.none()).getOrThunk((function(){var e=Fu(t);return xR(e.left,e.top)}));var e,n,r,o},LR=function(t,e,n,r,o,i,u){return function(t,e,n,r,o){var i=o.bounds,u=pR(e,n,r),a=Ya(u.left,i.x,i.x+i.width-o.width),c=Ya(u.top,i.y,i.y+i.height-o.height),s=xR(a,c);return e.fold((function(){var t=vR(s,n,r);return wR(t.left,t.top)}),v(s),(function(){var t=hR(s,n,r);return CR(t.left,t.top)}))}(0,e.fold((function(){var t,e,u,a=(t=n,e=i.left,u=i.top,t.fold((function(t,n){return wR(t+e,n+u)}),(function(t,n){return xR(t+e,n+u)}),(function(t,n){return CR(t+e,n+u)}))),c=hR(a,r,o);return CR(c.left,c.top)}),(function(e){var u=TR(t,e,n,i,r,o);return u.extra.each((function(n){e.onSensor(t,n)})),u.coord})),r,o,u)},HR=function(t,e){return{bounds:t.getBounds(),height:Iu(e.element),width:qu(e.element)}},VR=function(t,e,n,r,o){var i=n.update(r,o),u=n.getStartData().getOrThunk((function(){return HR(e,t)}));i.each((function(n){!function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=Do(t.element),u=Xu(i),a=RE(o),c=IR(o),s=LR(t,e.snaps,c,u,a,r,n),l=bR(s,0,a);du(o,l)}e.onDrag(t,o,r)}(t,e,u,n)}))},FR=function(t,e,n,r){e.each(RR),n.snaps.each((function(e){OR(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},jR=function(t){return function(e,n){var r=function(t){n.setStartData(HR(e,t))};return io(E([co(Fr(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r)))}},UR=Object.freeze({__proto__:null,getData:function(t){return P.from(Hu(t.x,t.y))},getDelta:function(t,e){return Hu(e.left-t.left,e.top-t.top)}}),WR=function(t,e,n){return[co(lr(),(function(r,o){if(0===o.event.raw.button){o.stop();var i=function(){return FR(r,P.some(c),t,e)},u=jw(i,200),a={drop:i,delayDrop:u.schedule,forceDrop:i,move:function(n){u.cancel(),VR(r,t,e,UR,n)}},c=NR(r,t.blockerClass,function(t){return io([co(lr(),t.forceDrop),co(mr(),t.drop),co(fr(),(function(e,n){t.move(n.event)})),co(dr(),t.delayDrop)])}(a));n(r),zR(r,c)}}))]},qR=E(E([],PR),[Pa("dragger",{handlers:jR(WR)})]),$R=Object.freeze({__proto__:null,getData:function(t){var e=t.raw.touches;return 1===e.length?function(t){var e=t[0];return P.some(Hu(e.clientX,e.clientY))}(e):P.none()},getDelta:function(t,e){return Hu(e.left-t.left,e.top-t.top)}}),GR=function(t,e,n){var r=ns(),o=function(n){FR(n,r.get(),t,e),r.clear()};return[co(ur(),(function(i,u){u.stop();var a=function(){return o(i)},c={drop:a,delayDrop:h,forceDrop:a,move:function(n){VR(i,t,e,$R,n)}},s=NR(i,t.blockerClass,function(t){return io([co(ur(),t.forceDrop),co(cr(),t.drop),co(sr(),t.drop),co(ar(),(function(e,n){t.move(n.event)}))])}(c));r.set(s);n(i),zR(i,s)})),co(ar(),(function(n,r){r.stop(),VR(n,t,e,$R,r.event)})),co(cr(),(function(t,e){e.stop(),o(t)})),co(sr(),o)]},KR=qR,XR=E(E([],PR),[Pa("dragger",{handlers:jR(GR)})]),YR=E(E([],PR),[Pa("dragger",{handlers:jR((function(t,e,n){return E(E([],WR(t,e,n)),GR(t,e,n))}))})]),JR=Dc({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:KR,touch:XR,mouseOrTouch:YR}),name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:P.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var t=P.none(),e=P.none(),n=v({});return zi({readState:n,reset:function(){t=P.none(),e=P.none()},update:function(e,n){return e.getData(n).bind((function(n){return function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=P.some(n),r}(e,n)}))},getStartData:function(){return e},setStartData:function(t){e=P.some(t)}})}}),apis:AR}),QR=function(t,e,n,r,o,i){return t.fold((function(){return JR.snap({sensor:xR(n-20,r-20),range:Hu(o,i),output:xR(P.some(n),P.some(r)),extra:{td:e}})}),(function(t){var o=n-20,i=r-20,u=t.element.dom.getBoundingClientRect();return JR.snap({sensor:xR(o,i),range:Hu(40,40),output:xR(P.some(n-u.width/2),P.some(r-u.height/2)),extra:{td:e}})}))},ZR=function(t,e,n){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,r){var o=r.td;(function(t,e){return t.exists((function(t){return Un(t,e)}))})(e.get(),o)||(e.set(o),n(o))},mustSnap:!0}},tN=function(t){return xp(wp.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:Tc([JR.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),wC.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},eN=function(t,e){var n=rn([]),r=rn([]),o=rn(!1),i=ns(),u=ns(),a=function(t){var n=oa(t);return QR(f.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(t){var n=oa(t);return QR(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},s=ZR((function(){return q(n.get(),(function(t){return a(t)}))}),i,(function(e){u.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),l=ZR((function(){return q(r.get(),(function(t){return c(t)}))}),u,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),f=tN(s),d=tN(l),m=zu(f.asSpec()),g=zu(d.asSpec()),h=function(e,n,r,o){var i=r(n);JR.snapTo(e,i);!function(e,n,r,o){var i=n.dom.getBoundingClientRect();bu(e.element,"display");var u=zo(un.fromDom(t.getBody())).dom.innerHeight,a=r(i),c=o(i,u);(a||c)&&lu(e.element,"display","none")}(e,n,(function(t){return t[o]<0}),(function(t,e){return t[o]>e}))},p=function(t){return h(m,t,a,"top")},v=function(t){return h(g,t,c,"bottom")};Vn().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||($l(e,m),$l(e,g),o.set(!0)),i.set(t.start),u.set(t.finish),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),p(t.start),v(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){i.get().each(p),u.get().each(v)})),t.on("TableSelectionClear",(function(){o.get()&&(Xl(m),Xl(g),o.set(!1)),i.clear(),u.clear()})))},nN=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},rN=function(t,e,n){e.delimiter||(e.delimiter="»");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:Tc([ih.config({mode:"flow",selector:"div[role=button]"}),Zd.config({disabled:n.isDisabled}),Qb(),sx.config({}),lh.config({}),fh("elementPathEvents",[vo((function(r,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return ih.focusIn(r)})),t.on("NodeChange",(function(o){var i,u,a=function(e){for(var n=[],r=e.length;r-- >0;){var o=e[r];if(1===o.nodeType&&!nN(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n}(o.parents);a.length>0?lh.set(r,(i=q(a||[],(function(e,r){return wp.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:Tc([ty(n.isDisabled),Qb()])})})),u={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}},Y(i.slice(1),(function(t,e){var n=t;return n.push(u),n.push(e),n}),[i[0]]))):lh.set(r,[])}))}))])]),components:[]}};(uM=iM||(iM={}))[uM.None=0]="None",uM[uM.Both=1]="Both",uM[uM.Vertical=2]="Vertical";var oN,iN,uN=function(t,e,n){var r=un.fromDom(t.getContainer()),o=function(t,e,n,r,o){var i={};return i.height=QM(r+e.top,Tb(t),_b(t)),n===iM.Both&&(i.width=QM(o+e.left,kb(t),Ob(t))),i}(t,e,n,Pu(r),Wu(r));Rt(o,(function(t,e){return lu(r,e,JM(t))})),function(t){t.fire("ResizeEditor")}(t)},aN=function(t,e,n,r){var o=Hu(20*n,20*r);return uN(t,o,e),P.some(!0)},cN=function(t,e){var n=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?iM.None:"both"===n?iM.Both:iM.Vertical}(t);return n===iM.None?P.none():P.some(Mp("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize")},behaviours:[JR.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){return uN(t,o,n)},blockerClass:"tox-blocker"}),ih.config({mode:"special",onLeft:function(){return aN(t,n,-1,0)},onRight:function(){return aN(t,n,1,0)},onUp:function(){return aN(t,n,0,-1)},onDown:function(){return aN(t,n,0,1)}}),sx.config({}),ph.config({})]},e.icons))},sN=function(t,e){var n,r,o=function(){var n,r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(rN(t,{},e)),t.hasPlugin("wordcount")&&r.push(function(t,e){var n,r=function(t,n,r){return lh.set(t,[Du(e.translate(["{0} "+r,n[r]]))])};return wp.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:Tc([ty(e.isDisabled),Qb(),sx.config({}),lh.config({}),Af.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),fh("wordcount-events",[wo((function(t){var e=Af.getValue(t),n="words"===e.mode?"characters":"words";Af.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),vo((function(e){t.on("wordCountUpdate",(function(t){var n=Af.getValue(e).mode;Af.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[zr()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})}(t,e)),t.getParam("branding",!0,"boolean")&&r.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(n=Cp.translate(["Powered by {0}","Tiny"]))+'">'+n+"</a>"}}),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(n=o(),r=cN(t,e),n.concat(r.toArray()))}},lN=function(t){var e,n,r,o,i=t.inline,u=i?rz:XM,a=Ub(t)?aD:ME,c=P.none(),s=Vn(),l=s.browser.isIE()?["tox-platform-ie"]:[],f=s.deviceType.isTouch()?["tox-platform-touch"]:[],d=Lb(t),m=Fb(t),g=Cp.isRtl()?{attributes:{dir:"rtl"}}:{},p={attributes:(e={},e[Os]=d?$c.BottomToTop:$c.TopToBottom,e)},v=function(){return c.bind(IA.getHeader)},b=function(){lu(q.element,"width",document.body.clientWidth+"px")},y=zu((n=Un(uu(),m)&&"grid"===mu(m,"display"),r={dom:O({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(l).concat(f)},g),behaviours:Tc([Fl.config({useFixed:function(){return a.isDocked(v)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:io([co(jr(),b)])},Wt(r,n?o:{}))),w=function(){return gt.value(y)},x=xp({dom:{tag:"div",classes:["tox-anchorbar"]}}),C=function(){return c.bind((function(t){return IA.getThrobber(t)})).getOrDie("Could not find throbber element")},S=vE(y,t,(function(){return c.bind((function(t){return x.getOpt(t)})).getOrDie("Could not find a anchor bar element")})),k=IA.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:S,onEscape:function(){t.focus()}}),T=Nb(t),_=IA.parts.toolbar(O({dom:{tag:"div",classes:["tox-toolbar"]},getSink:w,providers:S.shared.providers,onEscape:function(){t.focus()},type:T,lazyToolbar:function(){return c.bind((function(t){return IA.getToolbar(t)})).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return v().getOrDie("Could not find header element")}},p)),E=IA.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:S.shared.providers,onEscape:function(){t.focus()},type:T}),D=IA.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),A=IA.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),M=IA.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:S}),z=t.getParam("statusbar",!0,"boolean")&&!i?P.some(sN(t,S.shared.providers)):P.none(),R={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[D,A]},N=Mb(t),B=Db(t),I=Eb(t),L=IA.parts.header({dom:O({tag:"div",classes:["tox-editor-header"]},p),components:Z([I?[k]:[],N?[E]:B?[_]:[],Vb(t)?[]:[x.asSpec()]]),sticky:Ub(t),editor:t,sharedBackstage:S.shared}),H=Z([d?[]:[L],i?[]:[R],d?[L]:[]]),V=Z([[{dom:{tag:"div",classes:["tox-editor-container"]},components:H}],i?[]:z.toArray(),[M]]),F=jb(t),j=O(O({role:"application"},Cp.isRtl()?{dir:"rtl"}:{}),F?{"aria-hidden":"true"}:{}),U=zu(IA.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(i?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(f).concat(l),styles:O({visibility:"hidden"},F?{opacity:"0",border:"0"}:{}),attributes:j},components:V,behaviours:Tc([Qb(),Zd.config({disableClass:"tox-tinymce--disabled"}),ih.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])}));c=P.some(U),t.shortcuts.add("alt+F9","focus menubar",(function(){IA.focusMenubar(U)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){IA.focusToolbar(U)})),t.addCommand("ToggleToolbarDrawer",(function(){IA.toggleToolbarDrawer(U)})),t.addQueryStateHandler("ToggleToolbarDrawer",(function(){return IA.isToolbarDrawerToggled(U)}));var W=rx(U),q=rx(y);!function(t,e,n){var r=function(t,r){$([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){$([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(ff(),{target:t.target})},u=os(un.fromDom(document),"touchstart",i),a=os(un.fromDom(document),"touchmove",(function(t){return r(Hr(),t)})),c=os(un.fromDom(document),"touchend",(function(t){return r(Vr(),t)})),s=os(un.fromDom(document),"mousedown",i),l=os(un.fromDom(document),"mouseup",(function(t){0===t.raw.button&&o(mf(),{target:t.target})})),f=function(t){return o(ff(),{target:un.fromDom(t.target)})},d=function(t){0===t.button&&o(mf(),{target:un.fromDom(t.target)})},m=function(){$(t.editorManager.get(),(function(e){t!==e&&e.fire("DismissPopups",{relatedTarget:t})}))},g=function(t){return r(Fr(),us(t))},h=function(t){o(df(),{}),r(jr(),us(t))},p=function(){return o(df(),{})},v=function(e){e.state&&o(ff(),{target:un.fromDom(t.getContainer())})},b=function(t){o(ff(),{target:un.fromDom(t.relatedTarget.getContainer())})};t.on("PostRender",(function(){t.on("click",f),t.on("tap",f),t.on("mouseup",d),t.on("mousedown",m),t.on("ScrollWindow",g),t.on("ResizeWindow",h),t.on("ResizeEditor",p),t.on("AfterProgressState",v),t.on("DismissPopups",b)})),t.on("remove",(function(){t.off("click",f),t.off("tap",f),t.off("mouseup",d),t.off("mousedown",m),t.off("ScrollWindow",g),t.off("ResizeWindow",h),t.off("ResizeEditor",p),t.off("AfterProgressState",v),t.off("DismissPopups",b),s.unbind(),u.unbind(),a.unbind(),c.unbind(),l.unbind()})),t.on("detach",(function(){Zl(e),Zl(n),e.destroy(),n.destroy()}))}(t,W,q);var G=function(){var e=JM(ZM(t)),n=JM(function(t){return tz(t).getOr(Sb(t))}(t));return t.inline||(vu("div","width",n)&&lu(U.element,"width",n),vu("div","height",e)?lu(U.element,"height",e):lu(U.element,"height","200px")),e};return{mothership:W,uiMothership:q,backstage:S,renderUI:function(){a.setup(t,S.shared,v),Uz(t,S),lR(t,w,S),function(t){var e=t.ui.registry.getAll().sidebars;$(Mt(e),(function(n){var r=e[n],o=function(){return tu(P.from(t.queryCommandValue("ToggleSidebar")),n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})}))}(t),XD(t,C,S.shared),Nt(function(t){return t.getParam("toolbar_groups",{},"object")}(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,r=e.menuItems,o=e.contextToolbars,i=e.sidebars,c=Ab(t),s={menuItems:r,menus:Wb(t),menubar:qb(t),toolbar:c.getOrThunk((function(){return function(t){return t.getParam("toolbar",!0)}(t)})),allowToolbarGroups:T===yv.floating,buttons:n,sidebar:i};Oz(t,o,y,{backstage:S}),eN(t,y);var l=t.getElement(),f=G(),d={mothership:W,uiMothership:q,outerContainer:U},m={targetNode:l,height:f};return u.render(t,d,s,S,m)},getUi:function(){return{channels:{broadcastAll:q.broadcast,broadcastOn:q.broadcastOn,register:h}}}}},fN=v([ze("lazySink"),Fe("dragBlockClass"),tn("getBounds",ia),Ke("useTabstopAt",k),Ke("eventOrder",{}),Mf("modalBehaviours",[ih]),Ra("onExecute"),Ba("onEscape")]),dN={sketch:b},mN=v([cd({name:"draghandle",overrides:function(t,e){return{behaviours:Tc([JR.config({mode:"mouse",getTarget:function(t){return da(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),ud({schema:[ze("dom")],name:"title"}),ud({factory:dN,schema:[ze("dom")],name:"close"}),ud({factory:dN,schema:[ze("dom")],name:"body"}),cd({factory:dN,schema:[ze("dom")],name:"footer"}),ad({factory:{sketch:function(t,e){return O(O({},t),{dom:e.dom,components:e.components})}},schema:[Ke("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Ke("components",[])],name:"blocker"})]),gN=Bd({name:"ModalDialog",configFields:fN(),partFields:mN(),factory:function(t,e,n,r){var o,i=ns(),u=hi("modal-events"),a=O(O({},t.eventOrder),((o={})[Ur()]=[u].concat(t.eventOrder["alloy.system.attached"]||[]),o));return{uid:t.uid,dom:t.dom,components:e,apis:{show:function(e){i.set(e);var n=t.lazySink(e).getOrDie(),o=r.blocker(),u=n.getSystem().build(O(O({},o),{components:o.components.concat([Ru(e)]),behaviours:Tc([ph.config({}),fh("dialog-blocker-events",[po(hr(),(function(){ih.focusIn(e)}))])])}));$l(n,u),ih.focusIn(e)},hide:function(t){i.clear(),Ro(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){Xl(t)}))}))},getBody:function(e){return xd(e,t,"body")},getFooter:function(e){return xd(e,t,"footer")},setIdle:function(t){qD.unblock(t)},setBusy:function(t,e){qD.block(t,e)}},eventOrder:a,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Rf(t.modalBehaviours,[lh.config({}),ih.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),qD.config({getRoot:i.get}),fh(u,[vo((function(e){var n,r,o,i,u,a;n=e.element,r=xd(e,t,"title").element,o=ui(n,"id").fold((function(){var t=hi("dialog-label");return oi(r,"id",t),t}),b),oi(n,"aria-labelledby",o),i=e.element,u=xd(e,t,"body").element,a=P.from(ii(i,"id")).fold((function(){var t=hi("dialog-describe");return oi(u,"id",t),t}),b),oi(i,"aria-describedby",a)}))])])}},apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),hN=ae([Be("type"),Be("name")].concat(Zv)),pN=pe,vN=[De("name","name",Gt((function(){return hi("button-name")})),he),We("icon"),Qe("align","end",["start","end"]),Ze("primary",!1),Ze("disabled",!1)],bN=E(E([],vN),[Be("text")]),yN=E([Pe("type",["submit","cancel","custom"])],bN),wN=E([Pe("type",["menu"]),We("text"),We("tooltip"),We("icon"),Ve("items",hN)],vN),xN=Ee("type",{submit:yN,cancel:yN,custom:yN,menu:wN}),CN=[Be("type"),Be("text"),Pe("level",["info","warn","error","success"]),Be("icon"),Ke("url","")],SN=ae(CN),kN=[Be("type"),Be("text"),Ze("disabled",!1),Ze("primary",!1),De("name","name",Gt((function(){return hi("button-name")})),he),We("icon"),Ze("borderless",!1)],TN=ae(kN),ON=[Be("type"),Be("name"),Be("label"),Ze("disabled",!1)],_N=ae(ON),EN=pe,DN=[Be("type"),Be("name")],AN=DN.concat([We("label")]),MN=AN.concat([Ke("columns","auto")]),zN=ae(MN),RN=fe([Be("value"),Be("text"),Be("icon")]),NN=ae(AN),BN=he,PN=ae(AN),IN=he,LN=DN.concat([Je("tag","textarea"),Be("scriptId"),Be("scriptUrl"),function(t,e){return Xe(t,e,ye)}("settings",void 0)]),HN=DN.concat([Je("tag","textarea"),Ie("init")]),VN=Ce((function(t){return ke("customeditor.old",ue(HN),t).orThunk((function(){return ke("customeditor.new",ue(LN),t)}))})),FN=he,jN=ae(AN),UN=ce(ee),WN=function(t){return[Be("type"),Ne("columns"),t]},qN=[Be("type"),Be("html"),Qe("presets","presentation",["presentation","document"])],$N=ae(qN),GN=AN.concat([Ze("sandboxed",!0)]),KN=ae(GN),XN=he,YN=AN.concat([Re("currentState",ae([ze("blob"),Be("url")]))]),JN=ae(YN),QN=AN.concat([We("inputMode"),We("placeholder"),Ze("maximized",!1),Ze("disabled",!1)]),ZN=ae(QN),tB=he,eB=function(t){return[Be("type"),Be("label"),t]},nB=[Be("text"),Be("value")],rB=[Be("text"),Ve("items",(oN=function(){return oB},iN=$t(oN),{extract:function(t,e){return iN().extract(t,e)},toString:function(){return iN().toString()}}))],oB=se([ae(nB),ae(rB)]),iB=AN.concat([Ve("items",oB),Ze("disabled",!1)]),uB=ae(iB),aB=he,cB=AN.concat([He("items",[Be("text"),Be("value")]),Ye("size",1),Ze("disabled",!1)]),sB=ae(cB),lB=he,fB=AN.concat([Ze("constrain",!0),Ze("disabled",!1)]),dB=ae(fB),mB=ae([Be("width"),Be("height")]),gB=[Be("type"),Ve("header",he),Ve("cells",ce(he))],hB=ae(gB),pB=AN.concat([We("placeholder"),Ze("maximized",!1),Ze("disabled",!1)]),vB=ae(pB),bB=he,yB=AN.concat([Qe("filetype","file",["image","media","file"]),Ke("disabled",!1)]),wB=ae(yB),xB=ae([Be("value"),Ke("meta",{})]),CB=function(t){return De("items","items",{tag:"required",process:{}},ce(Ce((function(e){return ke("Checking item of "+t,SB,e).fold((function(t){return gt.error(_e(t))}),(function(t){return gt.value(t)}))}))))},SB=ie((function(){return xe("type",{alertbanner:SN,bar:ae((t=CB("bar"),[Be("type"),t])),button:TN,checkbox:_N,colorinput:NN,colorpicker:PN,dropzone:jN,grid:ae(WN(CB("grid"))),iframe:KN,input:ZN,listbox:uB,selectbox:sB,sizeinput:dB,textarea:vB,urlinput:wB,customeditor:VN,htmlpanel:$N,imagetools:JN,collection:zN,label:ae(eB(CB("label"))),table:hB,panel:TB});var t})),kB=[Be("type"),Ke("classes",[]),Ve("items",SB)],TB=ae(kB),OB=[De("name","name",Gt((function(){return hi("tab-name")})),he),Be("title"),Ve("items",SB)],_B=[Be("type"),He("tabs",OB)],EB=ae(_B),DB=bN,AB=xN,MB=ae([Be("title"),Re("body",xe("type",{panel:TB,tabpanel:EB})),Je("size","normal"),Ve("buttons",AB),Ke("initialData",{}),tn("onAction",h),tn("onChange",h),tn("onSubmit",h),tn("onClose",h),tn("onCancel",h),Ke("onTabChange",h)]),zB=ae(E([Pe("type",["cancel","custom"])],DB)),RB=ae([Be("title"),Be("url"),Ue("height"),Ue("width"),$e("buttons",zB),tn("onAction",h),tn("onCancel",h),tn("onClose",h),tn("onMessage",h)]),NB=function(t){return o(t)?[t].concat(tt(Ht(t),NB)):i(t)?tt(t,NB):[]},BB=function(t){return r(t.type)&&r(t.name)},PB={checkbox:EN,colorinput:BN,colorpicker:IN,dropzone:UN,input:tB,iframe:XN,sizeinput:mB,selectbox:lB,listbox:aB,size:mB,textarea:bB,urlinput:xB,customeditor:FN,collection:RN,togglemenuitem:pN},IB=function(t){var e=function(t){return K(NB(t),BB)}(t),n=tt(e,(function(t){return function(t){return P.from(PB[t.type])}(t).fold((function(){return[]}),(function(e){return[Re(t.name,e)]}))}));return ae(n)},LB=function(t){return{internalDialog:Te(ke("dialog",MB,t)),dataValidator:IB(t),initialData:t.initialData}},HB={open:function(t,e){var n=LB(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(Te(ke("dialog",RB,e)))},redial:function(t){return LB(t)}},VB=function(t){var e=[],n={};return Rt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?gt.error(e):gt.value(n)},FB=function(t,e){var n=xp(bk.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:q(t.items,(function(t){return S_(n,t,e)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:Tc([ih.config({mode:"acyclic",useTabstopAt:x(Gk)}),_k(n),Pk(n,{postprocess:function(t){return VB(t).fold((function(t){return console.error(t),{}}),b)}})])}},jB=Nd({name:"TabButton",configFields:[Ke("uid",void 0),ze("value"),De("dom","dom",Xt((function(){return{attributes:{role:"tab",id:hi("aria"),"aria-selected":"false"}}})),de()),Fe("action"),Ke("domModification",{}),Mf("tabButtonBehaviours",[ph,ih,Af]),ze("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:Ah(t.action),behaviours:Rf(t.tabButtonBehaviours,[ph.config({}),ih.config({mode:"execution",useSpace:!0,useEnter:!0}),Af.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),UB=v([ze("tabs"),ze("dom"),Ke("clickToDismiss",!1),Mf("tabbarBehaviours",[lm,ih]),Aa(["tabClass","selectedClass"])]),WB=sd({factory:jB,name:"tabs",unit:"tab",overrides:function(t){var e=function(t,e){lm.dehighlight(t,e),to(t,Yr(),{tabbar:t,button:e})},n=function(t,e){lm.highlight(t,e),to(t,Xr(),{tabbar:t,button:e})};return{action:function(r){var o=r.getSystem().getByUid(t.uid).getOrDie(),i=lm.isHighlighted(o,r);(i&&t.clickToDismiss?e:i?h:n)(o,r)},domModification:{classes:[t.markers.tabClass]}}}}),qB=v([WB]),$B=Bd({name:"Tabbar",configFields:UB(),partFields:qB(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Rf(t.tabbarBehaviours,[lm.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){oi(e.element,"aria-selected","true")},onDehighlight:function(t,e){oi(e.element,"aria-selected","false")}}),ih.config({mode:"flow",getInitial:function(t){return lm.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),GB=Nd({name:"Tabview",configFields:[Mf("tabviewBehaviours",[lh])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:Rf(t.tabviewBehaviours,[lh.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),KB=v([Ke("selectFirst",!0),za("onChangeTab"),za("onDismissTab"),Ke("tabs",[]),Mf("tabSectionBehaviours",[])]),XB=ud({factory:$B,schema:[ze("dom"),Le("markers",[ze("tabClass"),ze("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),YB=ud({factory:GB,name:"tabview"}),JB=v([XB,YB]),QB=Bd({name:"TabSection",configFields:KB(),partFields:JB(),factory:function(t,e,n,r){var o=function(e,n){wd(e,t,"tabbar").each((function(t){n(t).each(eo)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:zf(t.tabSectionBehaviours),events:io(Z([t.selectFirst?[vo((function(t,e){o(t,lm.getFirst)}))]:[],[co(Xr(),(function(e,n){!function(e){var n=Af.getValue(e);wd(e,t,"tabview").each((function(r){J(t.tabs,(function(t){return t.value===n})).each((function(n){var o=n.view();ui(e.element,"id").each((function(t){oi(r.element,"aria-labelledby",t)})),lh.set(r,o),t.onChangeTab(r,e,o)}))}))}(n.event.button)})),co(Yr(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return wd(e,t,"tabview").map((function(t){return lh.contents(t)})).getOr([])},showTab:function(t,e){o(t,(function(t){var n=lm.getCandidates(t);return J(n,(function(t){return Af.getValue(t)===e})).filter((function(e){return!lm.isHighlighted(t,e)}))}))}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),ZB=function(t,e){lu(t,"height",e+"px"),Vn().browser.isIE()?bu(t,"flex-basis"):lu(t,"flex-basis",e+"px")},tP=function(t,e,n){da(t,'[role="dialog"]').each((function(t){ga(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return lu(e,"height","0"),lu(e,"flex-basis","0"),Math.min(n,function(t,e,n){var r,o=Mo(t).dom,i=da(t,".tox-dialog-wrap").getOr(t);r="fixed"===mu(i,"position")?Math.max(o.clientHeight,window.innerHeight):Math.max(o.offsetHeight,o.scrollHeight);var u=Pu(e),a=e.dom.offsetLeft>=n.dom.offsetLeft+Wu(n)?Math.max(Pu(n),u):u,c=parseInt(mu(t,"margin-top"),10)||0,s=parseInt(mu(t,"margin-bottom"),10)||0;return r-(Pu(t)+c+s-a)}(t,e,r))})).each((function(t){ZB(e,t)}))}))}))},eP=function(t){return ga(t,'[role="tabpanel"]')},nP=function(t){var e;return{smartTabHeight:(e=ns(),{extraEvents:[vo((function(n){var r=n.element;eP(r).each((function(o){lu(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){(function(t){return ct(ut(t,(function(t,e){return t>e?-1:t<e?1:0})))})(function(t,e,n){return q(t,(function(r,o){lh.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return lh.set(n,[]),i.height}))}(t,o,n)).fold(e.clear,e.set)})),tP(r,o,e),bu(o,"visibility"),function(t,e){ct(t).each((function(t){return QB.showTab(e,t.value)}))}(t,n),yp.requestAnimationFrame((function(){tP(r,o,e)}))}))})),co(jr(),(function(t){var n=t.element;eP(n).each((function(t){tP(n,t,e)}))})),co(Sx,(function(t,n){var r=t.element;eP(r).each((function(t){var n=Bc(jo(t));lu(t,"visibility","hidden");var o=hu(t,"height").map((function(t){return parseInt(t,10)}));bu(t,"height"),bu(t,"flex-basis");var i=t.dom.getBoundingClientRect().height;o.forall((function(t){return i>t}))?(e.set(i),tP(r,t,e)):o.each((function(e){ZB(t,e)})),bu(t,"visibility"),n.each(Rc)}))}))],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}},rP="send-data-to-section",oP="send-data-to-view",iP=function(t,e){var n=rn({}),r=function(t){var e=Af.getValue(t),r=VB(e).getOr({}),o=n.get(),i=Wt(o,r);n.set(i)},o=function(t){var e=n.get();Af.setValue(t,e)},i=rn(null),u=q(t.tabs,(function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[bk.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:q(t.items,(function(t){return S_(n,t,e)})),formBehaviours:Tc([ih.config({mode:"acyclic",useTabstopAt:x(Gk)}),fh("TabView.form.events",[vo(o),bo(r)]),Mc.config({channels:Yn([{key:rP,value:{onReceive:r}},{key:oP,value:{onReceive:o}}])})])}}))]}}})),a=nP(u).smartTabHeight;return QB.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=Af.getValue(e);to(t,Cx,{name:r,oldName:i.get()}),i.set(r)},tabs:u,components:[QB.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[$B.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:Tc([sx.config({})])}),QB.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:a.selectFirst,tabSectionBehaviours:Tc([fh("tabpanel",a.extraEvents),ih.config({mode:"acyclic"}),Hd.config({find:function(t){return ct(QB.getViewItems(t))}}),Af.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([rP],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn([oP],{})}}})])})},uP=hi("update-dialog"),aP=hi("update-title"),cP=hi("update-body"),sP=hi("update-footer"),lP=hi("body-send-message"),fP=function(t,e,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:O(O({},e.map((function(t){return{id:t}})).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:Tc([Ek(0),kM.config({channel:cP,updateState:function(t,e){return P.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[iP(t.body,n)];default:return[FB(t.body,n)]}},initialData:t})])}},dP=fy.deviceType.isTouch(),mP=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},gP=function(t,e){return gN.parts.close(wp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:Tc([sx.config({})])}))},hP=function(){return gN.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},pP=function(t,e){return gN.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:$D("<p>"+e.translate(t)+"</p>")}]}]})},vP=function(t){return gN.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},bP=function(t,e){return[nx.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),nx.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},yP=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return gN.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),P.some(!0)},useTabstopAt:function(t){return!Gk(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:O({position:"relative"},t.extraStyles)},components:E([t.header,t.body],t.footer.toArray()),parts:{blocker:{dom:$D('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:dP?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:Tc(E([ph.config({}),fh("dialog-events",t.dialogEvents.concat([po(hr(),(function(t,e){ih.focusIn(t)}))])),fh("scroll-lock",[vo((function(){Ki(uu(),i)})),bo((function(){Yi(uu(),i)}))])],t.extraBehaviours)),eventOrder:O((e={},e[zr()]=["dialog-events"],e[Ur()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[Wr()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},wP=function(t){return wp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[Mp("close",{tag:"div",classes:["tox-icon"]},t.icons)],action:function(t){Zr(t,vx)}})},xP=function(t,e,n){var r=function(t){return[Du(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:O({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:Tc([kM.config({channel:aP,renderComponents:r})])}},CP=function(){return{dom:$D('<div class="tox-dialog__draghandle"></div>')}},SP=function(t,e){return n={title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},r=e.shared.providers,o=gN.parts.title(xP(n,P.none(),r)),i=gN.parts.draghandle(CP()),u=gN.parts.close(wP(r)),a=[o].concat(n.draggable?[i]:[]).concat([u]),nx.sketch({dom:$D('<div class="tox-dialog__header"></div>'),components:a});var n,r,o,i,u,a},kP=function(t,e,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":n.translate(t)},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:$D('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},TP=function(t,e,n){return{onClose:function(){return n.closeWindow()},onBlock:function(n){gN.setBusy(t(),(function(t,r){return kP(n.message,r,e)}))},onUnblock:function(){gN.setIdle(t())}}},OP=function(t,e,n,r){var o;return zu(yP(O(O({},t),{lazySink:r.shared.getSink,extraBehaviours:E([kM.config({channel:uP,updateState:function(t,e){return P.some(e)},initialData:e}),Hk({})],t.extraBehaviours),onEscape:function(t){Zr(t,vx)},dialogEvents:n,eventOrder:(o={},o[Mr()]=[kM.name(),Mc.name()],o[Ur()]=["scroll-lock",kM.name(),"messages","dialog-events","alloy.base.behaviour"],o[Wr()]=["alloy.base.behaviour","dialog-events","messages",kM.name(),"scroll-lock"],o)})))},_P=function(t){return q(t,(function(t){return"menu"===t.type?function(t){var e=q(t.items,(function(t){var e=rn(!1);return O(O({},t),{storage:e})}));return O(O({},t),{items:e})}(t):t}))},EP=function(t){return Y(t,(function(t,e){return"menu"===e.type?Y(e.items,(function(t,e){return t[e.name]=e.storage,t}),t):t}),{})},DP=function(t,e){return[mo(hr(),$k),t(px,(function(t,n){e.onClose(),n.onClose()})),t(vx,(function(t,e,n,r){e.onCancel(t),Zr(r,px)})),co(xx,(function(t,n){return e.onUnblock()})),co(wx,(function(t,n){return e.onBlock(n.event)}))]},AP=function(t,e){var n=function(e,n){return co(e,(function(e,o){r(e,(function(r,i){n(t(),r,o.event,e)}))}))},r=function(t,e){kM.getState(t).get().each((function(n){e(n,t)}))};return E(E([],DP(n,e)),[n(bx,(function(t,e,n){e.onAction(t,{name:n.name})}))])},MP=function(t,e,n){var r=function(e,n){return co(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event,e)}))}))},o=function(t,e){kM.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return E(E([],DP(r,e)),[r(yx,(function(t,e){return e.onSubmit(t)})),r(hx,(function(t,e,n){e.onChange(t,{name:n.name})})),r(bx,(function(t,e,r,o){var i=function(){return ih.focusIn(o)},u=function(t){return ai(t,"disabled")||ui(t,"aria-disabled").exists((function(t){return"true"===t}))},a=jo(o.element),c=Bc(a);e.onAction(t,{name:r.name,value:r.value}),Bc(a).fold(i,(function(t){u(t)||c.exists((function(e){return qn(t,e)&&u(e)}))?i():n().toOptional().filter((function(e){return!qn(e.element,t)})).each(i)}))})),r(Cx,(function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})})),bo((function(e){var n=t();Af.setValue(e,n.getData())}))])},zP=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=G(n,(function(t){return"start"===t.align})),o=function(t,e){return nx.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:q(e,(function(t){return t.memento.asSpec()}))})};return[o("start",r.pass),o("end",r.fail)]},RP=function(t,e){return{dom:$D('<div class="tox-dialog__footer"></div>'),components:[],behaviours:Tc([kM.config({channel:sP,initialData:t,updateState:function(t,n){var r=q(n.buttons,(function(t){var n=xp(function(t,e){return cO(t,t.type,e)}(t,e));return{name:t.name,align:t.align,memento:n}}));return P.some({lookupByName:function(t,e){return function(t,e,n){return J(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))}(t,r,e)},footerButtons:r})},renderComponents:zP})])}},NP=function(t,e){return gN.parts.footer(RP(t,e))},BP=function(t,e){if(t.getRoot().getSystem().isConnected()){var n=Hd.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return bk.getField(n,e).fold((function(){var r=t.getFooter();return kM.getState(r).get().bind((function(t){return t.lookupByName(n,e)}))}),(function(t){return P.some(t)}))}return P.none()},PP=function(t,e,n){var o=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},i={getData:function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=Af.getValue(r),i=Nt(n,(function(t){return t.get()}));return O(O({},o),i)},setData:function(e){o((function(r){var o=i.getData(),u=O(O({},o),e),a=function(t,e){var n=t.getRoot();return kM.getState(n).get().map((function(t){return Te(ke("data",t.dataValidator,e))})).getOr(e)}(t,u),c=t.getFormWrapper();Af.setValue(c,a),Rt(n,(function(t,e){Ft(u,e)&&t.set(u[e])}))}))},disable:function(e){BP(t,e).each(Zd.disable)},enable:function(e){BP(t,e).each(Zd.enable)},focus:function(e){BP(t,e).each(ph.focus)},block:function(t){if(!r(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");o((function(e){to(e,wx,{message:t})}))},unblock:function(){o((function(t){Zr(t,xx)}))},showTab:function(e){o((function(n){var r=t.getBody();kM.getState(r).get().exists((function(t){return t.isTabPanel()}))&&Hd.getCurrent(r).each((function(t){QB.showTab(t,e)}))}))},redial:function(t){o((function(n){var r=e(t);n.getSystem().broadcastOn([uP],r),n.getSystem().broadcastOn([aP],r.internalDialog),n.getSystem().broadcastOn([cP],r.internalDialog),n.getSystem().broadcastOn([sP],r.internalDialog),i.setData(r.initialData)}))},close:function(){o((function(t){Zr(t,px)}))}};return i},IP=function(t,e,n){var r=SP(t.internalDialog.title,n),o=function(t,e){var n=fP(t,P.none(),e,!1);return gN.parts.body(n)}({body:t.internalDialog.body},n),i=_P(t.internalDialog.buttons),u=EP(i),a=NP({buttons:i},n),c=MP((function(){return m}),TP((function(){return f}),n.shared.providers,e),n.shared.getSink),s=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(t.internalDialog.size),l={header:r,body:o,footer:P.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=OP(l,t,c,n),d={getRoot:v(f),getBody:function(){return gN.getBody(f)},getFooter:function(){return gN.getFooter(f)},getFormWrapper:function(){var t=gN.getBody(f);return Hd.getCurrent(t).getOr(t)}},m=PP(d,e.redial,u);return{dialog:f,instanceApi:m}},LP=function(t,e,n,r){var o,i,u,a,c,s=hi("dialog-label"),l=hi("dialog-content"),f=xp((u={title:t.internalDialog.title,draggable:!0},a=s,c=n.shared.providers,nx.sketch({dom:$D('<div class="tox-dialog__header"></div>'),components:[xP(u,P.some(a),c),CP(),wP(c)],containerBehaviours:Tc([JR.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return ha(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=xp(function(t,e,n,r){return fP(t,P.some(e),n,r)}({body:t.internalDialog.body},l,n,r)),m=_P(t.internalDialog.buttons),g=EP(m),h=xp(function(t,e){return RP(t,e)}({buttons:m},n)),p=MP((function(){return y}),{onBlock:function(t){qD.block(b,(function(e,r){return kP(t.message,r,n.shared.providers)}))},onUnblock:function(){qD.unblock(b)},onClose:function(){return e.closeWindow()}},n.shared.getSink),b=zu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=s,o["aria-describedby"]=l,o)},eventOrder:(i={},i[Mr()]=[kM.name(),Mc.name()],i[zr()]=["execute-on-form"],i[Ur()]=["reflecting","execute-on-form"],i),behaviours:Tc([ih.config({mode:"cyclic",onEscape:function(t){return Zr(t,px),P.some(!0)},useTabstopAt:function(t){return!Gk(t)&&("button"!==So(t)||"disabled"!==ii(t,"disabled"))}}),kM.config({channel:uP,updateState:function(t,e){return P.some(e)},initialData:t}),ph.config({}),fh("execute-on-form",p.concat([po(hr(),(function(t,e){ih.focusIn(t)}))])),qD.config({getRoot:function(){return P.some(b)}}),lh.config({}),Hk({})]),components:[f.asSpec(),d.asSpec(),h.asSpec()]}),y=PP({getRoot:v(b),getFooter:function(){return h.get(b)},getBody:function(){return d.get(b)},getFormWrapper:function(){var t=d.get(b);return Hd.getCurrent(t).getOr(t)}},e.redial,g);return{dialog:b,instanceApi:y}},HP=tinymce.util.Tools.resolve("tinymce.util.URI"),VP=["insertContent","setContent","execCommand","close","block","unblock"],FP=function(t){return o(t)&&-1!==VP.indexOf(t.mceAction)},jP=function(t,e,n,i){var u,c,s,l=SP(t.title,i),f=function(t){var e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[Wk({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:Tc([sx.config({}),ph.config({})])})]}],behaviours:Tc([ih.config({mode:"acyclic",useTabstopAt:x(Gk)})])};return gN.parts.body(e)}(t),d=t.buttons.bind((function(t){return 0===t.length?P.none():P.some(NP({buttons:t},i))})),m=AP((function(){return C}),TP((function(){return w}),i.shared.providers,e)),g=O(O({},t.height.fold((function(){return{}}),(function(t){return{height:t+"px","max-height":t+"px"}}))),t.width.fold((function(){return{}}),(function(t){return{width:t+"px","max-width":t+"px"}}))),h=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],p=new HP(t.url,{base_uri:new HP(window.location.href)}),v=p.protocol+"://"+p.host+(p.port?":"+p.port:""),b=es(),y=[fh("messages",[vo((function(){var e=os(un.fromDom(window),"message",(function(e){if(p.isSameOrigin(new HP(e.raw.origin))){var r=e.raw.data;FP(r)?function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!a(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock()}}(n,C,r):function(t){return!FP(t)&&o(t)&&Ft(t,"mceAction")}(r)&&t.onMessage(C,r)}}));b.set(e)})),bo(b.clear)]),Mc.config({channels:(u={},u[lP]={onReceive:function(t,e){ga(t.element,"iframe").each((function(t){t.dom.contentWindow.postMessage(e,v)}))}},u)})],w=OP({header:l,body:f,footer:d,extraClasses:h,extraBehaviours:y,extraStyles:g},t,m,i),C=(c=w,s=function(t){c.getSystem().isConnected()&&t(c)},{block:function(t){if(!r(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");s((function(e){to(e,wx,{message:t})}))},unblock:function(){s((function(t){Zr(t,xx)}))},close:function(){s((function(t){Zr(t,px)}))},sendMessage:function(t){s((function(e){e.getSystem().broadcastOn([lP],t)}))}});return{dialog:w,instanceApi:C}},UP=function(t,e,n){return e&&n?[]:[JE.config({contextual:{lazyContext:function(){return P.some(ra(un.fromDom(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},WP=function(t){var e=t.backstage,n=t.editor,r=Ub(n),o=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(){gN.hide(c),r()},i=xp(cO({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:P.none()},"cancel",t.backstage)),u=hP(),a=gP(o,e.providers),c=zu(yP({lazySink:function(){return e.getSink()},header:mP(u,a),body:pP(n,e.providers),footer:P.some(vP(bP([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[co(vx,o)],eventOrder:{}}));gN.show(c);var s=i.get(c);ph.focus(s)}}}(t),i=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(t){gN.hide(s),r(t)},i=xp(cO({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:P.none()},"submit",t.backstage)),u=cO({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:P.none()},"cancel",t.backstage),a=hP(),c=gP((function(){return o(!1)}),e.providers),s=zu(yP({lazySink:function(){return e.getSink()},header:mP(a,c),body:pP(n,e.providers),footer:P.some(vP(bP([],[u,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[co(vx,(function(){return o(!1)})),co(yx,(function(){return o(!0)}))],eventOrder:{}}));gN.show(s);var l=i.get(s);ph.focus(l)}}}(t),u=function(t,r){return HB.openUrl((function(t){var o=jP(t,{closeWindow:function(){gN.hide(o.dialog),r(o.instanceApi)}},n,e);return gN.show(o.dialog),o.instanceApi}),t)},a=function(t,n){return HB.open((function(t,r,o){var i=r,u=IP({dataValidator:o,initialData:i,internalDialog:t},{redial:HB.redial,closeWindow:function(){gN.hide(u.dialog),n(u.instanceApi)}},e);return gN.show(u.dialog),u.instanceApi.setData(i),u.instanceApi}),t)},c=function(t,o,i,u){return HB.open((function(t,a,c){var s=Te(ke("data",c,a)),l=ns(),f=e.shared.header.isPositionedAtTop(),d=function(){return l.on((function(t){Zh.reposition(t),JE.refresh(t)}))},m=LP({dataValidator:c,initialData:s,internalDialog:t},{redial:HB.redial,closeWindow:function(){l.on(Zh.hide),n.off("ResizeEditor",d),l.clear(),i(m.instanceApi)}},e,u),g=zu(Zh.sketch(O(O({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},f?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:Tc(E([fh("window-manager-inline-events",[co(qr(),(function(t,e){Zr(m.dialog,vx)}))])],UP(n,r,f))),isExtraPart:function(t,e){return function(t){return Fw(t,".tox-alert-dialog")||Fw(t,".tox-confirm-dialog")}(e)}})));return l.set(g),Zh.showWithin(g,Ru(m.dialog),{anchor:o},P.some(uu())),r&&f||(JE.refresh(g),n.on("ResizeEditor",d)),m.instanceApi.setData(s),ih.focusIn(m.dialog),m.instanceApi}),t)};return{open:function(t,n,r){return void 0!==n&&"toolbar"===n.inline?c(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?c(t,e.shared.anchors.cursor(),r,n.ariaAttrs):a(t,r)},openUrl:function(t,e){return u(t,e)},alert:function(t,e){o.open(t,(function(){e()}))},close:function(t){t.close()},confirm:function(t,e){i.open(t,(function(t){e(t)}))}}};T.add("silver",(function(t){var e=lN(t),n=e.uiMothership,r=e.backstage,o=e.renderUI,i=e.getUi;Vw(t,r.shared);var u=WP({editor:t,backstage:r});return{renderUI:o,getWindowManagerImpl:v(u),getNotificationManagerImpl:function(){return Np(0,{backstage:r},n)},ui:i()}}))}(),W=tinymce.util.Tools.resolve("tinymce.PluginManager"),q=function(){return(q=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},G=($=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}})("string"),K=$("object"),X=$("array"),Y=function(t){return!function(t){return null==t}(t)},J=function(){},Z=function(t){return t},tt=(Q=function(t){return function(){return t}})(!1),et=Q(!0),nt=function(){return rt},rt={fold:function(t,e){return t()},isSome:tt,isNone:et,getOr:U=Z,getOrThunk:j=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:Q(null),getOrUndefined:Q(void 0),or:U,orThunk:j,map:nt,each:J,bind:nt,exists:tt,forall:et,filter:function(){return nt()},toArray:function(){return[]},toString:Q("none()")},it={some:ot=function(t){var e=Q(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:et,isNone:tt,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return ot(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:rt},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},none:nt,from:function(t){return null==t?rt:ot(t)}},ut=Array.prototype.push,at=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},ct=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!X(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);ut.apply(e,t[n])}return e},st=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},lt=Object.keys,ft=Object.hasOwnProperty,dt=function(t,e){return mt(t,e)?it.from(t[e]):it.none()},mt=function(t,e){return ft.call(t,e)},gt=function(t){return t.getParam("media_scripts")},ht=function(t){return t.getParam("media_live_embeds",!0)},pt=tinymce.util.Tools.resolve("tinymce.util.Tools"),vt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),bt=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),yt=function(t,e){if(t)for(var n=0;n<t.length;n++)if(-1!==e.indexOf(t[n].filter))return t[n]},wt=vt.DOM,xt=function(t){return t.replace(/px$/,"")},Ct=function(t,e){var n=st(!1),r={};return bt({validate:!1,allow_conditional_comments:!0,start:function(e,o){if(n.get());else if(mt(o.map,"data-ephox-embed-iri"))n.set(!0),r=function(t){var e=t.map.style,n=e?wt.parseStyle(e):{};return{type:"ephox-embed-iri",source:t.map["data-ephox-embed-iri"],altsource:"",poster:"",width:dt(n,"max-width").map(xt).getOr(""),height:dt(n,"max-height").map(xt).getOr("")}}(o);else{if(r.source||"param"!==e||(r.source=o.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(r.type||(r.type=e),r=pt.extend(o.map,r)),"script"===e){var i=yt(t,o.map.src);if(!i)return;r={type:"script",source:o.map.src,width:String(i.width),height:String(i.height)}}"source"===e&&(r.source?r.altsource||(r.altsource=o.map.src):r.source=o.map.src),"img"!==e||r.poster||(r.poster=o.map.src)}}}).parse(e),r.source=r.source||r.src||r.data,r.altsource=r.altsource||"",r.poster=r.poster||"",r},St=function(t){var e={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[t.toLowerCase().split(".").pop()];return e||""},kt=tinymce.util.Tools.resolve("tinymce.html.Schema"),Tt=tinymce.util.Tools.resolve("tinymce.html.Writer"),Ot=vt.DOM,_t=function(t){return/^[0-9.]+$/.test(t)?t+"px":t},Et=function(t,e){!function(t,e){for(var n=lt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(e,(function(e,n){var r=""+e;if(t.map[n])for(var o=t.length;o--;){var i=t[o];i.name===n&&(r?(t.map[n]=r,i.value=r):(delete t.map[n],t.splice(o,1)))}else r&&(t.push({name:n,value:r}),t.map[n]=r)}))},Dt=["source","altsource"],At=function(t,e,n){var r,o=Tt(),i=st(!1),u=0;return bt({validate:!1,allow_conditional_comments:!0,comment:function(t){o.comment(t)},cdata:function(t){o.cdata(t)},text:function(t,e){o.text(t,e)},start:function(t,a,c){if(i.get());else if(mt(a.map,"data-ephox-embed-iri"))i.set(!0),function(t,e){var n=e.map.style,r=n?Ot.parseStyle(n):{};r["max-width"]=_t(t.width),r["max-height"]=_t(t.height),Et(e,{style:Ot.serializeStyle(r)})}(e,a);else{switch(t){case"video":case"object":case"embed":case"img":case"iframe":void 0!==e.height&&void 0!==e.width&&Et(a,{width:e.width,height:e.height})}if(n)switch(t){case"video":Et(a,{poster:e.poster,src:""}),e.altsource&&Et(a,{src:""});break;case"iframe":Et(a,{src:e.source});break;case"source":if(u<2&&(Et(a,{src:e[Dt[u]],type:e[Dt[u]+"mime"]}),!e[Dt[u]]))return;u++;break;case"img":if(!e.poster)return;r=!0}}o.start(t,a,c)},end:function(t){if(!i.get()){if("video"===t&&n)for(var a=0;a<2;a++)if(e[Dt[a]]){var c=[];c.map={},u<=a&&(Et(c,{src:e[Dt[a]],type:e[Dt[a]+"mime"]}),o.start("source",c,!0))}if(e.poster&&"object"===t&&n&&!r){var s=[];s.map={},Et(s,{src:e.poster,width:e.width,height:e.height}),o.start("img",s,!0)}}o.end(t)}},kt({})).parse(t),o.getContent()},Mt=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],zt=function(t,e){for(var n=function(t){var e=t.match(/^(https?:\/\/|www\.)(.+)$/i);return e&&e.length>1?"www."===e[1]?"https://":e[1]:"https://"}(e),r=t.regex.exec(e),o=n+t.url,i=function(t){o=o.replace("$"+t,(function(){return r[t]?r[t]:""}))},u=0;u<r.length;u++)i(u);return o.replace(/\?$/,"")},Rt=function(t,e){var n=pt.extend({},e);if(!n.source&&(pt.extend(n,Ct(gt(t),n.embed)),!n.source))return"";n.altsource||(n.altsource=""),n.poster||(n.poster=""),n.source=t.convertURL(n.source,"source"),n.altsource=t.convertURL(n.altsource,"source"),n.sourcemime=St(n.source),n.altsourcemime=St(n.altsource),n.poster=t.convertURL(n.poster,"poster");var r,o,i=(r=n.source,(o=Mt.filter((function(t){return t.regex.test(r)}))).length>0?pt.extend({},o[0],{url:zt(o[0],r)}):null);if(i&&(n.source=i.url,n.type=i.type,n.allowfullscreen=i.allowFullscreen,n.width=n.width||String(i.w),n.height=n.height||String(i.h)),n.embed)return At(n.embed,n,!0);var u=yt(gt(t),n.source);u&&(n.type="script",n.width=String(u.width),n.height=String(u.height));var a=function(t){return t.getParam("audio_template_callback")}(t),c=function(t){return t.getParam("video_template_callback")}(t);return n.width=n.width||"300",n.height=n.height||"150",pt.each(n,(function(e,r){n[r]=t.dom.encode(""+e)})),"iframe"===n.type?function(t){var e=t.allowfullscreen?' allowFullscreen="1"':"";return'<iframe src="'+t.source+'" width="'+t.width+'" height="'+t.height+'"'+e+"></iframe>"}(n):"application/x-shockwave-flash"===n.sourcemime?function(t){var e='<object data="'+t.source+'" width="'+t.width+'" height="'+t.height+'" type="application/x-shockwave-flash">';return t.poster&&(e+='<img src="'+t.poster+'" width="'+t.width+'" height="'+t.height+'" />'),e+"</object>"}(n):-1!==n.sourcemime.indexOf("audio")?function(t,e){return e?e(t):'<audio controls="controls" src="'+t.source+'">'+(t.altsource?'\n<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</audio>"}(n,a):"script"===n.type?function(t){return'<script src="'+t.source+'"><\/script>'}(n):function(t,e){return e?e(t):'<video width="'+t.width+'" height="'+t.height+'"'+(t.poster?' poster="'+t.poster+'"':"")+' controls="controls">\n<source src="'+t.source+'"'+(t.sourcemime?' type="'+t.sourcemime+'"':"")+" />\n"+(t.altsource?'<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</video>"}(n,c)},Nt=tinymce.util.Tools.resolve("tinymce.util.Promise"),Bt={},Pt=function(t){return function(e){return Rt(t,e)}},It=function(t,e){var n=function(t){return t.getParam("media_url_resolver")}(t);return n?function(t,e,n){return new Nt((function(r,o){var i=function(n){return n.html&&(Bt[t.source]=n),r({url:t.source,html:n.html?n.html:e(t)})};Bt[t.source]?i(Bt[t.source]):n({url:t.source},i,o)}))}(e,Pt(t),n):function(t,e){return Nt.resolve({html:e(t),url:t.source})}(e,Pt(t))},Lt=function(t,e){var n=e?function(t,e){return dt(e,t).bind((function(t){return dt(t,"meta")}))}(e,t).getOr({}):{},r=function(t,e,n){return function(r){var o,i=function(){return dt(t,r)},u=function(){return dt(e,r)},a=function(t){return dt(t,"value").bind((function(t){return t.length>0?it.some(t):it.none()}))};return(o={})[r]=(r===n?i().bind((function(t){return K(t)?a(t).orThunk(u):u().orThunk((function(){return it.from(t)}))})):u().orThunk((function(){return i().bind((function(t){return K(t)?a(t):it.from(t)}))}))).getOr(""),o}}(t,n,e);return q(q(q(q(q({},r("source")),r("altsource")),r("poster")),r("embed")),function(t,e){var n={};return dt(t,"dimensions").each((function(t){at(["width","height"],(function(r){dt(e,r).orThunk((function(){return dt(t,r)})).each((function(t){return n[r]=t}))}))})),n}(t,n))},Ht=function(t){var e=q(q({},t),{source:{value:dt(t,"source").getOr("")},altsource:{value:dt(t,"altsource").getOr("")},poster:{value:dt(t,"poster").getOr("")}});return at(["width","height"],(function(n){dt(t,n).each((function(t){var r=e.dimensions||{};r[n]=t,e.dimensions=r}))})),e},Vt=function(t){return function(e){var n=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";t.notificationManager.open({type:"error",text:n})}},Ft=function(t,e){return Ct(gt(t),e)},jt=function(t,e){return function(n){if(G(n.url)&&n.url.trim().length>0){var r=n.html,o=Ft(e,r),i=q(q({},o),{source:n.url,embed:r});t.setData(Ht(i))}}},Ut=function(t,e){var n=t.dom.select("*[data-mce-object]");t.insertContent(e),function(t,e){for(var n=t.dom.select("*[data-mce-object]"),r=0;r<e.length;r++)for(var o=n.length-1;o>=0;o--)e[r]===n[o]&&n.splice(o,1);t.selection.select(n[0])}(t,n),t.nodeChanged()},Wt=function(t,e,n){var r;e.embed=At(e.embed,e),e.embed&&(t.source===e.source||(r=e.source,mt(Bt,r)))?Ut(n,e.embed):It(n,e).then((function(t){Ut(n,t.html)})).catch(Vt(n))},qt=function(t){var e=function(t){var e=t.selection.getNode(),n=function(t){return t.hasAttribute("data-mce-object")||t.hasAttribute("data-ephox-embed-iri")}(e)?t.serializer.serialize(e,{selection:!0}):"";return q({embed:n},Ct(gt(t),n))}(t),n=st(e),r=Ht(e),o=function(t){return t.getParam("media_dimensions",!0)}(t)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],i={title:"General",name:"general",items:ct([[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],o])},u={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},a=[];(function(t){return t.getParam("media_alt_source",!0)})(t)&&a.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),function(t){return t.getParam("media_poster",!0)}(t)&&a.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var c={title:"Advanced",name:"advanced",items:a},s=[i,u];a.length>0&&s.push(c);var l={type:"tabpanel",tabs:s},f=t.windowManager.open({title:"Insert/Edit Media",size:"normal",body:l,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var r=Lt(e.getData());Wt(n.get(),r,t),e.close()},onChange:function(e,r){switch(r.name){case"source":!function(e,n){var r=Lt(n.getData(),"source");e.source!==r.source&&(jt(f,t)({url:r.source,html:""}),It(t,r).then(jt(f,t)).catch(Vt(t)))}(n.get(),e);break;case"embed":!function(e){var n=Lt(e.getData()),r=Ft(t,n.embed);e.setData(Ht(r))}(e);break;case"dimensions":case"altsource":case"poster":!function(e,n){var r=Lt(e.getData(),n),o=Rt(t,r);e.setData(Ht(q(q({},r),{embed:o})))}(e,r.name)}n.set(Lt(e.getData()))},initialData:r})},$t=tinymce.util.Tools.resolve("tinymce.html.Node"),Gt=tinymce.util.Tools.resolve("tinymce.Env"),Kt=tinymce.util.Tools.resolve("tinymce.html.DomParser"),Xt=function(t,e){if(!1===function(t){return t.getParam("media_filter_html",!0)}(t))return e;var n,r=Tt();return bt({validate:!1,allow_conditional_comments:!1,comment:function(t){n||r.comment(t)},cdata:function(t){n||r.cdata(t)},text:function(t,e){n||r.text(t,e)},start:function(e,o,i){if(n=!0,"script"!==e&&"noscript"!==e&&"svg"!==e){for(var u=o.length-1;u>=0;u--){var a=o[u].name;0===a.indexOf("on")&&(delete o.map[a],o.splice(u,1)),"style"===a&&(o[u].value=t.dom.serializeStyle(t.dom.parseStyle(o[u].value),e))}r.start(e,o,i),n=!1}},end:function(t){n||r.end(t)}},kt({})).parse(e),r.getContent()},Yt=function(t){var e=t.name;return"iframe"===e||"video"===e||"audio"===e},Jt=function(t,e,n,r){void 0===r&&(r=null);var o=t.attr(n);return Y(o)?o:mt(e,n)?null:r},Qt=function(t,e,n){var r="img"===e.name||"video"===t.name,o=r?"300":null,i="audio"===t.name?"30":"150",u=r?i:null;e.attr({width:Jt(t,n,"width",o),height:Jt(t,n,"height",u)})},Zt=function(t,e){var n=e.name,r=new $t("img",1);return r.shortEnded=!0,ee(t,e,r),Qt(e,r,{}),r.attr({style:e.attr("style"),src:Gt.transparentSrc,"data-mce-object":n,class:"mce-object mce-object-"+n}),r},te=function(t,e){var n=e.name,r=new $t("span",1);r.attr({contentEditable:"false",style:e.attr("style"),"data-mce-object":n,class:"mce-preview-object mce-object-"+n}),ee(t,e,r);var o=t.dom.parseStyle(e.attr("style")),i=new $t(n,1);if(Qt(e,i,o),i.attr({src:e.attr("src"),style:e.attr("style"),class:e.attr("class")}),"iframe"===n)i.attr({allowfullscreen:e.attr("allowfullscreen"),frameborder:"0"});else{at(["controls","crossorigin","currentTime","loop","muted","poster","preload"],(function(t){i.attr(t,e.attr(t))}));var u=r.attr("data-mce-html");Y(u)&&function(t,e,n,r){for(var o=Kt({forced_root_block:!1,validate:!1},t.schema).parse(r,{context:e});o.firstChild;)n.append(o.firstChild)}(t,n,i,u)}var a=new $t("span",1);return a.attr("class","mce-shim"),r.append(i),r.append(a),r},ee=function(t,e,n){for(var r=e.attributes,o=r.length;o--;){var i=r[o].name,u=r[o].value;"width"!==i&&"height"!==i&&"style"!==i&&("data"!==i&&"src"!==i||(u=t.convertURL(u,i)),n.attr("data-mce-p-"+i,u))}var a=e.firstChild&&e.firstChild.value;a&&(n.attr("data-mce-html",escape(Xt(t,a))),n.firstChild=null)},ne=function(t){var e=t.attr("class");return e&&/\btiny-pageembed\b/.test(e)},re=function(t){for(;t=t.parent;)if(t.attr("data-ephox-embed-iri")||ne(t))return!0;return!1},oe=function(t){t.on("preInit",(function(){var e=t.schema.getSpecialElements();pt.each("video audio iframe object".split(" "),(function(t){e[t]=new RegExp("</"+t+"[^>]*>","gi")}));var n=t.schema.getBoolAttrs();pt.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),(function(t){n[t]={}})),t.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(t){return function(e){for(var n,r,o=e.length;o--;)(n=e[o]).parent&&(n.parent.attr("data-mce-object")||("script"!==n.name||(r=yt(gt(t),n.attr("src"))))&&(r&&(r.width&&n.attr("width",r.width.toString()),r.height&&n.attr("height",r.height.toString())),Yt(n)&&ht(t)&&Gt.ceFalse?re(n)||n.replace(te(t,n)):re(n)||n.replace(Zt(t,n))))}}(t)),t.serializer.addAttributeFilter("data-mce-object",(function(e,n){for(var r,o,i,u,a,c,s,l,f=e.length;f--;)if((r=e[f]).parent){for(s=r.attr(n),o=new $t(s,1),"audio"!==s&&"script"!==s&&((l=r.attr("class"))&&-1!==l.indexOf("mce-preview-object")?o.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):o.attr({width:r.attr("width"),height:r.attr("height")})),o.attr({style:r.attr("style")}),i=(u=r.attributes).length;i--;){var d=u[i].name;0===d.indexOf("data-mce-p-")&&o.attr(d.substr(11),u[i].value)}"script"===s&&o.attr("type","text/javascript"),(a=r.attr("data-mce-html"))&&((c=new $t("#text",3)).raw=!0,c.value=Xt(t,unescape(a)),o.append(c)),r.replace(o)}}))})),t.on("SetContent",(function(){t.$("span.mce-preview-object").each((function(e,n){var r=t.$(n);0===r.find("span.mce-shim").length&&r.append('<span class="mce-shim"></span>')}))}))},ie=function(t,e){return function(n){return t.selection.selectorChangedWithUnbind(e.join(","),n.setActive).unbind}},W.add("media",(function(t){return function(t){t.addCommand("mceMedia",(function(){qt(t)}))}(t),function(t){var e=function(){return t.execCommand("mceMedia")};t.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:e,onSetup:ie(t,["img[data-mce-object]","span[data-mce-object]","div[data-ephox-embed-iri]"])}),t.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:e})}(t),function(t){t.on("ResolveName",(function(t){var e;1===t.target.nodeType&&(e=t.target.getAttribute("data-mce-object"))&&(t.name=e)}))}(t),oe(t),function(t){t.on("click keyup touchend",(function(){var e=t.selection.getNode();e&&t.dom.hasClass(e,"mce-preview-object")&&t.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")})),t.on("ObjectSelected",(function(t){"script"===t.target.getAttribute("data-mce-object")&&t.preventDefault()})),t.on("ObjectResized",(function(t){var e=t.target;if(e.getAttribute("data-mce-object")){var n=e.getAttribute("data-mce-html");n&&(n=unescape(n),e.setAttribute("data-mce-html",escape(At(n,{width:String(t.width),height:String(t.height)}))))}}))}(t),function(t){return{showDialog:function(){qt(t)}}}(t)})),function(){var t=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},e=function(t){return function(e){return typeof e===t}},n=function(t){return function(e){return t===e}},r=t("string"),o=t("object"),i=t("array"),u=n(null),a=e("boolean"),c=n(void 0),s=function(t){return!function(t){return null==t}(t)},l=e("function"),f=e("number"),d=function(){},m=function(t){return function(){return t}},g=function(t){return t},h=function(t,e){return t===e};function p(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var v=function(t){return function(e){return!t(e)}},b=m(!1),y=m(!0),w=function(){return x},x=function(){var t=function(t){return t()},e=g;return{fold:function(t,e){return t()},isSome:b,isNone:y,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:m(null),getOrUndefined:m(void 0),or:e,orThunk:t,map:w,each:d,bind:w,exists:b,forall:y,filter:function(){return w()},toArray:function(){return[]},toString:m("none()")}}(),C=function(t){var e=m(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:y,isNone:b,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return C(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:x},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},S={some:C,none:w,from:function(t){return null==t?x:C(t)}},k=Array.prototype.slice,T=Array.prototype.indexOf,O=Array.prototype.push,_=function(t,e){return n=t,r=e,T.call(n,r)>-1;var n,r},E=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},D=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},A=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},M=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},z=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},R=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)}(t,(function(t,r){n=e(n,t,r)})),n},N=function(t,e,n){return M(t,(function(t,r){n=e(n,t,r)})),n},B=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return S.some(i);if(n(i,r))break}return S.none()}(t,e,b)},P=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return S.some(n)}return S.none()},I=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!i(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);O.apply(e,t[n])}return e},L=function(t,e){return I(A(t,e))},H=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},V=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},F=function(t){return[t]},j=function(t,e){return e>=0&&e<t.length?S.some(t[e]):S.none()},U=function(t){return j(t,0)},W=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return S.none()},q=function(){return(q=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function $(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var G,K=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},X=function(){return Y(0,0)},Y=function(t,e){return{major:t,minor:e}},J={nu:Y,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?X():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Y(r(1),r(2))}(t,n)},unknown:X},Q=function(t,e){var n=String(e).toLowerCase();return B(t,(function(t){return t.search(n)}))},Z=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},tt=function(t,e){return-1!==t.indexOf(e)},et=function(t,e){return Z(t,e,0)},nt=function(t,e){return Z(t,e,t.length-e.length)},rt=(G=/^\s+|\s+$/g,function(t){return t.replace(G,"")}),ot=function(t){return t.length>0},it=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ut=function(t){return function(e){return tt(e,t)}},at=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return tt(t,"edge/")&&tt(t,"chrome")&&tt(t,"safari")&&tt(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,it],search:function(t){return tt(t,"chrome")&&!tt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return tt(t,"msie")||tt(t,"trident")}},{name:"Opera",versionRegexes:[it,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ut("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ut("firefox")},{name:"Safari",versionRegexes:[it,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(tt(t,"safari")||tt(t,"mobile/"))&&tt(t,"applewebkit")}}],ct=[{name:"Windows",search:ut("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return tt(t,"iphone")||tt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ut("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ut("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ut("linux"),versionRegexes:[]},{name:"Solaris",search:ut("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ut("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ut("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],st={browsers:m(at),oses:m(ct)},lt="Edge",ft="Chrome",dt="Opera",mt="Firefox",gt="Safari",ht=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(lt),isChrome:r(ft),isIE:r("IE"),isOpera:r(dt),isFirefox:r(mt),isSafari:r(gt)}},pt={unknown:function(){return ht({current:void 0,version:J.unknown()})},nu:ht,edge:m(lt),chrome:m(ft),ie:m("IE"),opera:m(dt),firefox:m(mt),safari:m(gt)},vt="Windows",bt="Android",yt="Linux",wt="Solaris",xt="FreeBSD",Ct="ChromeOS",St=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(vt),isiOS:r("iOS"),isAndroid:r(bt),isOSX:r("OSX"),isLinux:r(yt),isSolaris:r(wt),isFreeBSD:r(xt),isChromeOS:r(Ct)}},kt={unknown:function(){return St({current:void 0,version:J.unknown()})},nu:St,windows:m(vt),ios:m("iOS"),android:m(bt),linux:m(yt),osx:m("OSX"),solaris:m(wt),freebsd:m(xt),chromeos:m(Ct)},Tt=function(t,e,n){var r=st.browsers(),o=st.oses(),i=e.bind((function(t){return function(t,e){return W(e.brands,(function(e){var n=e.brand.toLowerCase();return B(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:J.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return Q(t,e).map((function(t){var n=J.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(pt.unknown,pt.nu),u=function(t,e){return Q(t,e).map((function(t){var n=J.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(kt.unknown,kt.nu),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:m(o),isiPhone:m(i),isTablet:m(c),isPhone:m(s),isTouch:m(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:m(l),isDesktop:m(f)}}(u,i,t,n);return{browser:i,os:u,deviceType:a}},Ot=function(t){return window.matchMedia(t).matches},_t=K((function(){return Tt(navigator.userAgent,S.from(navigator.userAgentData),Ot)})),Et=function(){return _t()},Dt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},At={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Dt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Dt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Dt(n)},fromDom:Dt,fromPoint:function(t,e,n){return S.from(t.dom.elementFromPoint(e,n)).map(Dt)}},Mt=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},zt=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Rt=function(t,e){var n=void 0===e?document:e.dom;return zt(n)?S.none():S.from(n.querySelector(t)).map(At.fromDom)},Nt=function(t,e){return t.dom===e.dom},Bt=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},Pt=function(t,e){return Et().browser.isIE()?Bt(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},It=Mt,Lt=Object.keys,Ht=Object.hasOwnProperty,Vt=function(t,e){for(var n=Lt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Ft=function(t,e){return jt(t,(function(t,n){return{k:n,v:e(t,n)}}))},jt=function(t,e){var n={};return Vt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},Ut=function(t,e){var n={};return function(t,e,n,r){Vt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),d),n},Wt=function(t,e){var n=[];return Vt(t,(function(t,r){n.push(e(t,r))})),n},qt=function(t){return Wt(t,g)},$t=function(t){return Lt(t).length},Gt=function(t,e){return Kt(t,e)?S.from(t[e]):S.none()},Kt=function(t,e){return Ht.call(t,e)},Xt=function(t,e){return Kt(t,e)&&void 0!==t[e]&&null!==t[e]},Yt=["tfoot","thead","tbody","colgroup"],Jt=function(t,e,n){return{element:t,rowspan:e,colspan:n}},Qt=function(t,e,n){return{element:t,cells:e,section:n}},Zt=function(t,e,n){return{element:t,isNew:e,isLocked:n}},te=function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}},ee=function(t,e){return{element:t,columns:e}};"undefined"!=typeof window?window:Function("return this;")();var ne=function(t){return t.dom.nodeName.toLowerCase()},re=function(t){return t.dom.nodeType},oe=function(t){return function(e){return re(e)===t}},ie=function(t){return 8===re(t)||"#comment"===ne(t)},ue=oe(1),ae=oe(3),ce=oe(9),se=oe(11),le=function(t){return function(e){return ue(e)&&ne(e)===t}},fe=function(t){return At.fromDom(t.dom.ownerDocument)},de=function(t){return ce(t)?t:fe(t)},me=function(t){return S.from(t.dom.parentNode).map(At.fromDom)},ge=function(t,e){for(var n=l(e)?e:b,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=At.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},he=function(t){return S.from(t.dom.previousSibling).map(At.fromDom)},pe=function(t){return S.from(t.dom.nextSibling).map(At.fromDom)},ve=function(t){return A(t.dom.childNodes,At.fromDom)},be=function(t,e){var n=t.dom.childNodes;return S.from(n[e]).map(At.fromDom)},ye=l(Element.prototype.attachShadow)&&l(Node.prototype.getRootNode),we=m(ye),xe=ye?function(t){return At.fromDom(t.dom.getRootNode())}:de,Ce=function(t){var e,n=xe(t);return se(e=n)&&s(e.dom.host)?S.some(n):S.none()},Se=function(t){return At.fromDom(t.dom.host)},ke=function(t){return s(t.dom.shadowRoot)},Te=function(t){var e=ae(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return Ce(At.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=Te,r=Se,function(t){return n(r(t))}))},Oe=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return At.fromDom(e)},_e=function(t,e){var n=[];return M(ve(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(_e(t,e))})),n},Ee=function(t,e,n){return function(t,e,n){return z(ge(t,n),e)}(t,(function(t){return Mt(t,e)}),n)},De=function(t,e){return function(t,e){return z(ve(t),e)}(t,(function(t){return Mt(t,e)}))},Ae=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return zt(n)?[]:A(n.querySelectorAll(t),At.fromDom)}(e,t)};function Me(t,e,n,r,o){return t(n,r)?S.some(n):l(o)&&o(n)?S.none():e(n,r,o)}var ze,Re,Ne,Be=function(t,e,n){for(var r=t.dom,o=l(n)?n:b;r.parentNode;){r=r.parentNode;var i=At.fromDom(r);if(e(i))return S.some(i);if(o(i))break}return S.none()},Pe=function(t,e,n){return Be(t,(function(t){return Mt(t,e)}),n)},Ie=function(t,e){return function(t,e){return B(t.dom.childNodes,(function(t){return e(At.fromDom(t))})).map(At.fromDom)}(t,(function(t){return Mt(t,e)}))},Le=function(t,e){return Rt(e,t)},He=function(t,e,n){return Me((function(t,e){return Mt(t,e)}),Pe,t,e,n)},Ve=function(t,e,n){if(!(r(n)||a(n)||f(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Fe=function(t,e,n){Ve(t.dom,e,n)},je=function(t,e){var n=t.dom;Vt(e,(function(t,e){Ve(n,e,t)}))},Ue=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},We=function(t,e){return S.from(Ue(t,e))},qe=function(t,e){t.dom.removeAttribute(e)},$e=function(t){return N(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},Ge=function(t,e,n){return void 0===n&&(n=h),t.exists((function(t){return n(t,e)}))},Ke=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},Xe=function(t,e,n){return t.isSome()&&e.isSome()?S.some(n(t.getOrDie(),e.getOrDie())):S.none()},Ye=function(t,e){return t?S.some(e):S.none()},Je=function(t){return void 0!==t.style&&l(t.style.getPropertyValue)},Qe=function(t,e,n){if(!r(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Je(t)&&t.style.setProperty(e,n)},Ze=function(t,e,n){var r=t.dom;Qe(r,e,n)},tn=function(t,e){var n=t.dom;Vt(e,(function(t,e){Qe(n,e,t)}))},en=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Te(t)?r:nn(n,e)},nn=function(t,e){return Je(t)?t.style.getPropertyValue(e):""},rn=function(t,e){var n=t.dom,r=nn(n,e);return S.from(r).filter((function(t){return t.length>0}))},on=function(t,e){!function(t,e){Je(t)&&t.style.removeProperty(e)}(t.dom,e),Ge(We(t,"style").map(rt),"")&&qe(t,"style")},un=function(t,e,n){return void 0===n&&(n=0),We(t,e).map((function(t){return parseInt(t,10)})).getOr(n)},an=function(t,e){return un(t,e,1)},cn=function(t){return an(t,"colspan")>1},sn=function(t){return an(t,"rowspan")>1},ln=function(t,e){return parseInt(en(t,e),10)},fn=m(10),dn=m(10),mn=function(t,e){return gn(t,e,y)},gn=function(t,e,n){return L(ve(t),(function(t){return Mt(t,e)?n(t)?[t]:[]:gn(t,e,n)}))},hn=function(t,e){return function(t,e,n){return void 0===n&&(n=b),n(e)?S.none():_(t,ne(e))?S.some(e):Pe(e,t.join(","),(function(t){return Mt(t,"table")||n(t)}))}(["td","th"],t,e)},pn=function(t){return mn(t,"th,td")},vn=function(t){return Mt(t,"colgroup")?De(t,"col"):L(wn(t),(function(t){return De(t,"col")}))},bn=function(t,e){return He(t,"table",e)},yn=function(t){return mn(t,"tr")},wn=function(t){return bn(t).fold(m([]),(function(t){return De(t,"colgroup")}))},xn=function(t,e){return A(t,(function(t){if("colgroup"===ne(t)){var n=A(vn(t),(function(t){var e=un(t,"span",1);return Jt(t,1,e)}));return Qt(t,n,"colgroup")}n=A(pn(t),(function(t){var e=un(t,"rowspan",1),n=un(t,"colspan",1);return Jt(t,e,n)}));return Qt(t,n,e(t))}))},Cn=function(t){return me(t).map((function(t){var e=ne(t);return function(t){return _(Yt,t)}(e)?e:"tbody"})).getOr("tbody")},Sn=function(t){var e=yn(t),n=$($([],wn(t)),e);return xn(n,Cn)},kn=function(t,e,n){var r=t.cells,o=r.slice(0,e),i=r.slice(e),u=o.concat(n).concat(i);return _n(t,u)},Tn=function(t,e,n){return kn(t,e,[n])},On=function(t,e,n){t.cells[e]=n},_n=function(t,e){return te(t.element,e,t.section,t.isNew)},En=function(t,e){return t.cells[e]},Dn=function(t,e){return En(t,e).element},An=function(t){return t.cells.length},Mn=function(t){var e=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}}(t,(function(t){return"colgroup"===t.section}));return{rows:e.fail,cols:e.pass}},zn=function(t,e,n){var r=A(t.cells,n);return te(e(t.element),r,t.section,!0)},Rn="data-snooker-locked-cols",Nn=function(t){return We(t,Rn).bind((function(t){return S.from(t.match(/\d+/g))})).map((function(t){return V(t,y)}))},Bn=function(t){var e,n,r,o=N(Mn(t).rows,(function(t,e){return M(e.cells,(function(e,n){e.isLocked&&(t[n]=!0)})),t}),{}),i=Wt(o,(function(t,e){return parseInt(e,10)}));return e=i,(r=k.call(e,0)).sort(n),r},Pn=function(t,e){return t+","+e},In=function(t,e){var n=L(t.all,(function(t){return t.cells}));return z(n,e)},Ln=function(t){var e={},n=[],r={},o=[],i=U(t).map((function(t){return t.element})).bind(bn).bind(Nn).getOr({}),u=0,a=0,c=0;return M(t,(function(t){if("colgroup"===t.section)r=function(t){var e={},n=0;return M(t.cells,(function(t){var r=t.colspan;D(r,(function(o){var i=n+o;e[i]=function(t,e,n){return{element:t,colspan:e,column:n}}(t.element,r,i)})),n+=r})),e}(t),o=[ee(t.element,qt(r))];else{var s=[];M(t.cells,(function(t){for(var n=0;void 0!==e[Pn(c,n)];)n++;for(var r=Xt(i,n.toString()),o=function(t,e,n,r,o,i){return{element:t,rowspan:e,colspan:n,row:r,column:o,isLocked:i}}(t.element,t.rowspan,t.colspan,c,n,r),u=0;u<t.colspan;u++)for(var l=0;l<t.rowspan;l++){var f=n+u,d=Pn(c+l,f);e[d]=o,a=Math.max(a,f+1)}s.push(o)})),u++,n.push(Qt(t.element,s,t.section)),c++}})),{grid:function(t,e){return{rows:t,columns:e}}(u,a),access:e,all:n,columns:r,colgroups:o}},Hn={fromTable:function(t){var e=Sn(t);return Ln(e)},generate:Ln,getAt:function(t,e,n){return S.from(t.access[Pn(e,n)])},findItem:function(t,e,n){var r=In(t,(function(t){return n(e,t.element)}));return r.length>0?S.some(r[0]):S.none()},filterItems:In,justCells:function(t){return L(t.all,(function(t){return t.cells}))},justColumns:function(t){return qt(t.columns)},hasColumns:function(t){return Lt(t.columns).length>0},getColumnAt:function(t,e){return S.from(t.columns[e])}},Vn=function(t,e){var n=e.column,r=e.column+e.colspan-1,o=e.row,i=e.row+e.rowspan-1;return n<=t.finishCol&&r>=t.startCol&&o<=t.finishRow&&i>=t.startRow},Fn=function(t,e){return e.column>=t.startCol&&e.column+e.colspan-1<=t.finishCol&&e.row>=t.startRow&&e.row+e.rowspan-1<=t.finishRow},jn=function(t,e,n){var r=Hn.findItem(t,e,Nt),o=Hn.findItem(t,n,Nt);return r.bind((function(t){return o.map((function(e){return n=t,r=e,o=Math.min(n.row,r.row),i=Math.min(n.column,r.column),u=Math.max(n.row+n.rowspan-1,r.row+r.rowspan-1),a=Math.max(n.column+n.colspan-1,r.column+r.colspan-1),{startRow:o,startCol:i,finishRow:u,finishCol:a};var n,r,o,i,u,a}))}))},Un=function(t,e,n){return jn(t,e,n).bind((function(e){return function(t,e){for(var n=!0,r=p(Fn,e),o=e.startRow;o<=e.finishRow;o++)for(var i=e.startCol;i<=e.finishCol;i++)n=n&&Hn.getAt(t,o,i).exists(r);return n?S.some(e):S.none()}(t,e)}))},Wn=function(t,e,n){return jn(t,e,n).map((function(e){var n=Hn.filterItems(t,p(Vn,e));return A(n,(function(t){return t.element}))}))},qn=function(t,e){return Hn.findItem(t,e,(function(t,e){return Pt(e,t)})).map((function(t){return t.element}))},$n=function(t,e,n){return bn(t).bind((function(r){return function(t,e,n,r){return Hn.findItem(t,e,Nt).bind((function(e){var o=n>0?e.row+e.rowspan-1:e.row,i=r>0?e.column+e.colspan-1:e.column;return Hn.getAt(t,o+n,i+r).map((function(t){return t.element}))}))}(Kn(r),t,e,n)}))},Gn=function(t,e,n,r,o){var i=Kn(t),u=Nt(t,n)?S.some(e):qn(i,e),a=Nt(t,o)?S.some(r):qn(i,r);return u.bind((function(t){return a.bind((function(e){return Wn(i,t,e)}))}))},Kn=Hn.fromTable,Xn=function(t,e){me(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Yn=function(t,e){pe(t).fold((function(){me(t).each((function(t){Qn(t,e)}))}),(function(t){Xn(t,e)}))},Jn=function(t,e){(function(t){return be(t,0)})(t).fold((function(){Qn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Qn=function(t,e){t.dom.appendChild(e.dom)},Zn=function(t,e){Xn(t,e),Qn(e,t)},tr=function(t,e){M(e,(function(n,r){var o=0===r?t:e[r-1];Yn(o,n)}))},er=function(t,e){M(e,(function(e){Qn(t,e)}))},nr=function(t){t.dom.textContent="",M(ve(t),(function(t){rr(t)}))},rr=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},or=function(t){var e,n=ve(t);n.length>0&&(e=t,M(n,(function(t){Xn(e,t)}))),rr(t)},ir=(ze=ae,Re="text",{get:function(t){if(!ze(t))throw new Error("Can only get "+Re+" value of a "+Re+" node");return Ne(t).getOr("")},getOption:Ne=function(t){return ze(t)?S.from(t.dom.nodeValue):S.none()},set:function(t,e){if(!ze(t))throw new Error("Can only set raw "+Re+" value of a "+Re+" node");t.dom.nodeValue=e}}),ur=function(t){return ir.get(t)},ar=function(t){return ir.getOption(t)},cr=function(t,e){return ir.set(t,e)},sr=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function lr(){return{up:m({selector:Pe,closest:He,predicate:Be,all:ge}),down:m({selector:Ae,predicate:_e}),styles:m({get:en,getRaw:rn,set:Ze,remove:on}),attrs:m({get:Ue,set:Fe,remove:qe,copyTo:function(t,e){var n=$e(t);je(e,n)}}),insert:m({before:Xn,after:Yn,afterAll:tr,append:Qn,appendAll:er,prepend:Jn,wrap:Zn}),remove:m({unwrap:or,remove:rr}),create:m({nu:At.fromTag,clone:function(t){return At.fromDom(t.dom.cloneNode(!1))},text:At.fromText}),query:m({comparePosition:function(t,e){return t.dom.compareDocumentPosition(e.dom)},prevSibling:he,nextSibling:pe}),property:m({children:ve,name:ne,parent:me,document:function(t){return de(t).dom},isText:ae,isComment:ie,isElement:ue,isSpecial:function(t){var e=ne(t);return _(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],e)},getLanguage:function(t){return ue(t)?We(t,"lang"):S.none()},getText:ur,setText:cr,isBoundary:function(t){return!!ue(t)&&("body"===ne(t)||_(sr,ne(t)))},isEmptyTag:function(t){return!!ue(t)&&_(["br","img","hr","input"],ne(t))},isNonEditable:function(t){return ue(t)&&"false"===Ue(t,"contenteditable")}}),eq:Nt,is:It}}var fr,dr,mr,gr,hr=function(t,e,n,r){var o=e(t,n);return R(r,(function(n,r){var o=e(t,r);return pr(t,n,o)}),o)},pr=function(t,e,n){return e.bind((function(e){return n.filter(p(t.eq,e))}))},vr=function(t,e,n){return n.length>0?function(t,e,n,r){return r(t,e,n[0],n.slice(1))}(t,e,n,hr):S.none()},br=function(t,e,n,r){void 0===r&&(r=b);var o=[e].concat(t.up().all(e)),i=[n].concat(t.up().all(n)),u=function(t){return P(t,r).fold((function(){return t}),(function(e){return t.slice(0,e+1)}))},a=u(o),c=u(i),s=B(a,(function(e){return E(c,function(t,e){return p(t.eq,e)}(t,e))}));return{firstpath:a,secondpath:c,shared:s}},yr=lr(),wr=function(t,e){return vr(yr,(function(e,n){return t(n)}),e)},xr=function(t){return Pe(t,"table")},Cr=function(t,e,n){var r=function(t){return function(e){return void 0!==n&&n(e)||Nt(e,t)}};return Nt(t,e)?S.some({boxes:S.some([t]),start:t,finish:e}):xr(t).bind((function(o){return xr(e).bind((function(i){if(Nt(o,i))return S.some({boxes:(s=o,l=t,f=e,d=Kn(s),Wn(d,l,f)),start:t,finish:e});if(Pt(o,i)){var u=(a=Ee(e,"td,th",r(o))).length>0?a[a.length-1]:e;return S.some({boxes:Gn(o,t,o,e,i),start:t,finish:u})}if(Pt(i,o)){var a,c=(a=Ee(t,"td,th",r(i))).length>0?a[a.length-1]:t;return S.some({boxes:Gn(i,t,o,e,i),start:t,finish:c})}return function(t,e,n){return br(yr,t,e,n)}(t,e).shared.bind((function(u){return He(u,"table",n).bind((function(n){var u=Ee(e,"td,th",r(n)),a=u.length>0?u[u.length-1]:e,c=Ee(t,"td,th",r(n)),s=c.length>0?c[c.length-1]:t;return S.some({boxes:Gn(n,t,o,e,i),start:s,finish:a})}))}));var s,l,f,d}))}))},Sr=function(t,e){var n=Ae(t,e);return n.length>0?S.some(n):S.none()},kr=function(t,e,n){return Le(t,e).bind((function(e){return Le(t,n).bind((function(t){return wr(xr,[e,t]).map((function(n){return{first:e,last:t,table:n}}))}))}))},Tr=function(t,e,n,r,o){return function(t,e){return B(t,(function(t){return Mt(t,e)}))}(t,o).bind((function(t){return $n(t,e,n).bind((function(t){return function(t,e){return Pe(t,"table").bind((function(n){return Le(n,e).bind((function(e){return Cr(e,t).bind((function(t){return t.boxes.map((function(e){return{boxes:e,start:t.start,finish:t.finish}}))}))}))}))}(t,r)}))}))},Or=function(t,e){return Sr(t,e)},_r=function(t,e,n){return kr(t,e,n).bind((function(e){var n=function(e){return Nt(t,e)},r="thead,tfoot,tbody,table",o=Pe(e.first,r,n),i=Pe(e.last,r,n);return o.bind((function(t){return i.bind((function(n){return Nt(t,n)?(r=e.table,o=e.first,i=e.last,u=Kn(r),Un(u,o,i)):S.none();var r,o,i,u}))}))}))},Er=function(t){if(!i(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return M(t,(function(r,o){var u=Lt(r);if(1!==u.length)throw new Error("one and only one name per case");var a=u[0],c=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!i(c))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+i);var u=function(t){var r=Lt(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!H(e,(function(t){return _(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:u,log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}})),n},Dr=Er([{none:[]},{multiple:["elements"]},{single:["element"]}]),Ar=function(t,e,n,r){return t.fold(e,n,r)},Mr=Dr.none,zr=Dr.multiple,Rr=Dr.single,Nr=tinymce.util.Tools.resolve("tinymce.PluginManager"),Br=function(t,e){return At.fromDom(t.dom.cloneNode(e))},Pr=function(t){return Br(t,!1)},Ir=function(t){return Br(t,!0)},Lr=function(t,e){var n=At.fromTag(e),r=$e(t);return je(n,r),n},Hr=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=en(n,t);return parseFloat(o)||0}return r},r=function(t,e){return N(e,(function(e,n){var r=en(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!f(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Je(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}},Vr=Hr("width",(function(t){return t.dom.offsetWidth})),Fr=function(t){return Vr.get(t)},jr=function(t){return Vr.getOuter(t)},Ur=function(t,e){void 0===e&&(e=y);var n=t.grid,r=D(n.columns,g),o=D(n.rows,g);return A(r,(function(n){return Wr((function(){return L(o,(function(e){return Hn.getAt(t,e,n).filter((function(t){return t.column===n})).toArray()}))}),(function(t){return 1===t.colspan&&e(t.element)}),(function(){return Hn.getAt(t,0,n)}))}))},Wr=function(t,e,n){var r=t();return B(r,e).orThunk((function(){return S.from(r[0]).orThunk(n)})).map((function(t){return t.element}))},qr=function(t){var e=t.grid,n=D(e.rows,g),r=D(e.columns,g);return A(n,(function(e){return Wr((function(){return L(r,(function(n){return Hn.getAt(t,e,n).filter((function(t){return t.row===e})).fold(m([]),(function(t){return[t]}))}))}),(function(t){return 1===t.rowspan}),(function(){return Hn.getAt(t,e,0)}))}))},$r=function(t,e){if(e<0||e>=t.length-1)return S.none();var n=t[e].fold((function(){var n=function(t){var e=k.call(t,0);return e.reverse(),e}(t.slice(0,e));return W(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return S.some({value:t,delta:0})})),r=t[e+1].fold((function(){var n=t.slice(e+1);return W(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return S.some({value:t,delta:1})}));return n.bind((function(t){return r.map((function(e){var n=e.delta+t.delta;return Math.abs(e.value-t.value)/n}))}))},Gr=function(t,e){return function(n){return"rtl"===Kr(n)?e:t}},Kr=function(t){return"rtl"===en(t,"direction")?"rtl":"ltr"},Xr=Hr("height",(function(t){var e=t.dom;return Te(t)?e.getBoundingClientRect().height:e.offsetHeight})),Yr=function(t){return Xr.get(t)},Jr=function(t){return Xr.getOuter(t)},Qr=function(t,e){return{left:t,top:e,translate:function(n,r){return Qr(t+n,e+r)}}},Zr=Qr,to=function(t,e){return void 0!==t?t:void 0!==e?e:0},eo=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return Zr(n.offsetLeft,n.offsetTop);var i=to(null==r?void 0:r.pageYOffset,o.scrollTop),u=to(null==r?void 0:r.pageXOffset,o.scrollLeft),a=to(o.clientTop,n.clientTop),c=to(o.clientLeft,n.clientLeft);return no(t).translate(u-c,i-a)},no=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?Zr(n.offsetLeft,n.offsetTop):Te(t)?function(t){var e=t.getBoundingClientRect();return Zr(e.left,e.top)}(e):Zr(0,0)},ro=function(t,e){return{row:t,y:e}},oo=function(t,e){return{col:t,x:e}},io=function(t){return eo(t).left+jr(t)},uo=function(t){return eo(t).left},ao=function(t,e){return oo(t,uo(e))},co=function(t,e){return oo(t,io(e))},so=function(t){return eo(t).top},lo=function(t,e){return ro(t,so(e))},fo=function(t,e){return ro(t,so(e)+Jr(e))},mo=function(t,e,n){if(0===n.length)return[];var r=A(n.slice(1),(function(e,n){return e.map((function(e){return t(n,e)}))})),o=n[n.length-1].map((function(t){return e(n.length-1,t)}));return r.concat([o])},go={delta:g,positions:function(t){return mo(lo,fo,t)},edge:so},ho={delta:g,edge:uo,positions:function(t){return mo(ao,co,t)}},po={delta:function(t){return-t},edge:io,positions:function(t){return mo(co,ao,t)}},vo=Gr(ho,po),bo={delta:function(t,e){return vo(e).delta(t,e)},positions:function(t,e){return vo(e).positions(t,e)},edge:function(t){return vo(t).edge(t)}},yo={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},wo=(fr="[0-9]+",dr="[eE][+-]?[0-9]+",mr=function(t){return"(?:"+t+")?"},gr=["Infinity","[0-9]+\\."+mr(fr)+mr(dr),"\\.[0-9]+"+mr(dr),fr+mr(dr)].join("|"),new RegExp("^([+-]?(?:"+gr+"))(.*)$")),xo=function(t,e){return S.from(wo.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return E(e,(function(e){return E(yo[e],(function(e){return t===e}))}))}(r,e)?S.some({value:n,unit:r}):S.none()}))},Co=function(){var t=Et().browser;return t.isIE()||t.isEdge()},So=function(t,e,n){return function(t,e){var n=parseFloat(t);return isNaN(n)?e:n}(en(t,e),n)},ko=function(t){return Co()?function(t){var e=t.dom.getBoundingClientRect().height;return"border-box"===en(t,"box-sizing")?e:e-So(t,"padding-top",0)-So(t,"padding-bottom",0)-(So(t,"border-top-width",0)+So(t,"border-bottom-width",0))}(t):So(t,"height",Yr(t))},To=function(t){return Co()?function(t){var e=t.dom.getBoundingClientRect().width;return"border-box"===en(t,"box-sizing")?e:e-So(t,"padding-left",0)-So(t,"padding-right",0)-(So(t,"border-left-width",0)+So(t,"border-right-width",0))}(t):So(t,"width",Fr(t))},Oo=/(\d+(\.\d+)?)%/,_o=/(\d+(\.\d+)?)px|em/,Eo=function(t,e){var n,r=(n=t,S.from(n.dom.offsetParent).map(At.fromDom)).getOr(Oe(fe(t)));return e(t)/e(r)*100},Do=function(t,e){Ze(t,"width",e+"px")},Ao=function(t,e){Ze(t,"width",e+"%")},Mo=function(t,e){Ze(t,"height",e+"px")},zo=function(t,e,n,r){var o=parseInt(t,10);return nt(t,"%")&&"table"!==ne(e)?function(t,e,n,r){var o=bn(t).map((function(t){var r=n(t);return Math.floor(e/100*r)})).getOr(e);return r(t,o),o}(e,o,n,r):o},Ro=function(t){var e=function(t){return rn(t,"height").getOrThunk((function(){return ko(t)+"px"}))}(t);return e?zo(e,t,Yr,Mo):Yr(t)},No=function(t){return rn(t,"width").fold((function(){return S.from(Ue(t,"width"))}),(function(t){return S.some(t)}))},Bo=function(t,e){return t/e.pixelWidth()*100},Po=function(t,e){return No(t).fold((function(){var n=Fr(t);return Bo(n,e)}),(function(n){return function(t,e,n){var r=Oo.exec(e);if(null!==r)return parseFloat(r[1]);var o=To(t);return Bo(o,n)}(t,n,e)}))},Io=function(t,e){return No(t).fold((function(){return To(t)}),(function(n){return function(t,e,n){var r=_o.exec(e);if(null!==r)return parseInt(r[1],10);var o=Oo.exec(e);return null!==o?function(t,e){return t/100*e.pixelWidth()}(parseFloat(o[1]),n):To(t)}(t,n,e)}))},Lo=function(t){return function(t,e,n){return n(t)/an(t,e)}(t,"rowspan",Ro)},Ho=function(t,e,n){Ze(t,"width",e+n)},Vo=function(t){return Eo(t,Fr)+"%"},Fo=m(Oo),jo=m(_o),Uo=le("col"),Wo=function(t,e,n){return rn(t,e).getOrThunk((function(){return n(t)+"px"}))},qo=function(t,e){return Wo(t,"width",(function(t){return Uo(t)?Fr(t):Io(t,e)}))},$o=function(t){return Wo(t,"height",Lo)},Go=function(t,e){return rn(t,e).isSome()},Ko=function(t,e,n,r,o,i){return t.filter(r).fold((function(){return i($r(n,e))}),(function(t){return o(t)}))},Xo=function(t,e,n,r,o){var i=Ur(t,(function(t){return Go(t,"width")})),u=Hn.hasColumns(t)?function(t){return A(Hn.justColumns(t),(function(t){return S.from(t.element)}))}(t):i,a=[S.some(bo.edge(e))].concat(A(bo.positions(i,e),(function(t){return t.map((function(t){return t.x}))}))),c=v(cn);return A(u,(function(t,e){return Ko(t,e,a,c,(function(t){if(function(t){return!Uo(t)||Go(t,"width")}(t))return n(t,o);var u,s,l=(u=i[e],s=g,null!=u?s(u):S.none());return Ko(l,e,a,c,(function(t){return r(S.some(Fr(t)))}),r)}),r)}))},Yo=function(t){return t.map((function(t){return t+"px"})).getOr("")},Jo=function(t,e,n){return Xo(t,e,Io,(function(t){return t.getOrThunk(n.minCellWidth)}),n)},Qo=function(t,e,n,r,o){var i=qr(t),u=[S.some(n.edge(e))].concat(A(n.positions(i,e),(function(t){return t.map((function(t){return t.y}))})));return A(i,(function(t,e){return Ko(t,e,u,v(sn),r,o)}))},Zo=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},ti=function(t){var e=function(){return Fr(t)},n=m(0);return{width:e,pixelWidth:e,getWidths:function(e,n){return Jo(e,t,n)},getCellDelta:n,singleColumnWidth:m([0]),minCellWidth:n,setElementWidth:d,adjustTableWidth:d,isRelative:!0,label:"none"}},ei=function(t,e){var n=Zo(parseFloat(t)),r=Zo(Fr(e));return{width:n.get,pixelWidth:r.get,getWidths:function(t,n){return function(t,e,n){return Xo(t,e,Po,(function(t){return t.fold((function(){return n.minCellWidth()}),(function(t){return t/n.pixelWidth()*100}))}),n)}(t,e,n)},getCellDelta:function(t){return t/r.get()*100},singleColumnWidth:function(t,e){return[100-t]},minCellWidth:function(){return fn()/r.get()*100},setElementWidth:Ao,adjustTableWidth:function(t){var o=n.get(),i=o+t/100*o;Ao(e,i),n.set(i),r.set(Fr(e))},isRelative:!0,label:"percent"}},ni=function(t,e){var n=Zo(t),r=n.get;return{width:r,pixelWidth:r,getWidths:function(t,n){return Jo(t,e,n)},getCellDelta:g,singleColumnWidth:function(t,e){return[Math.max(fn(),t+e)-t]},minCellWidth:fn,setElementWidth:Do,adjustTableWidth:function(t){var o=r()+t;Do(e,o),n.set(o)},isRelative:!1,label:"pixel"}},ri=function(t){return No(t).fold((function(){return ti(t)}),(function(e){return function(t,e){var n=Fo().exec(e);if(null!==n)return ei(n[1],t);var r=jo().exec(e);if(null!==r){var o=parseInt(r[1],10);return ni(o,t)}var i=Fr(t);return ni(i,t)}(t,e)}))},oi=ni,ii=ei,ui=function(t,e,n){var r=t[n].element,o=At.fromTag("td");Qn(o,At.fromTag("br")),(e?Qn:Jn)(r,o)},ai=function(t,e){var n=function(t){return Mt(t.element,e)},r=Ir(t),o=Sn(r),i=ri(t),u=Hn.generate(o),a=function(t,e){var n=t.grid.columns,r=t.grid.rows,o=n,i=0,u=0,a=[],c=[];return Vt(t.access,(function(t){if(a.push(t),e(t)){c.push(t);var n=t.row,s=n+t.rowspan-1,l=t.column,f=l+t.colspan-1;n<r?r=n:s>i&&(i=s),l<o?o=l:f>u&&(u=f)}})),function(t,e,n,r,o,i){return{minRow:t,minCol:e,maxRow:n,maxCol:r,allCells:o,selectedCells:i}}(r,o,i,u,a,c)}(u,n),c="th:not("+e+"),td:not("+e+")",s=gn(r,"th,td",(function(t){return Mt(t,c)}));return M(s,rr),function(t,e,n,r){for(var o=e.grid.columns,i=e.grid.rows,u=0;u<i;u++)for(var a=!1,c=0;c<o;c++)u<n.minRow||u>n.maxRow||c<n.minCol||c>n.maxCol||(Hn.getAt(e,u,c).filter(r).isNone()?ui(t,a,u):a=!0)}(o,u,a,n),function(t,e,n,r){Vt(n.columns,(function(t){(t.column<e.minCol||t.column>e.maxCol)&&rr(t.element)}));var o=z(mn(t,"tr"),(function(t){return 0===t.dom.childElementCount}));M(o,rr),e.minCol!==e.maxCol&&e.minRow!==e.maxRow||M(mn(t,"th,td"),(function(t){qe(t,"rowspan"),qe(t,"colspan")})),qe(t,Rn),qe(t,"data-snooker-col-series"),ri(t).adjustTableWidth(r)}(r,a,u,function(t,e,n,r){if(0===r.minCol&&e.grid.columns===r.maxCol+1)return 0;var o=Jo(e,t,n),i=N(o,(function(t,e){return t+e}),0),u=N(o.slice(r.minCol,r.maxCol+1),(function(t,e){return t+e}),0)/i*n.pixelWidth()-n.pixelWidth();return n.getCellDelta(u)}(t,Hn.fromTable(t),i,a)),r},ci=function(t){return"img"===ne(t)?1:ar(t).fold((function(){return ve(t).length}),(function(t){return t.length}))},si=["img","br"],li=function(t){return ar(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||_(si,ne(t))},fi=function(t){return e=li,(n=function(t){for(var r=0;r<t.childNodes.length;r++){var o=At.fromDom(t.childNodes[r]);if(e(o))return S.some(o);var i=n(t.childNodes[r]);if(i.isSome())return i}return S.none()})(t.dom);var e,n},di=function(t){return mi(t,li)},mi=function(t,e){var n=function(t){for(var r=ve(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return S.some(i);var u=n(i);if(u.isSome())return u}return S.none()};return n(t)},gi={scope:["row","col"]},hi=function(t){return function(){var e=At.fromTag("td",t.dom);return Qn(e,At.fromTag("br",t.dom)),e}},pi=function(t){return function(){return At.fromTag("col",t.dom)}},vi=function(t){return function(){return At.fromTag("colgroup",t.dom)}},bi=function(t){return function(){return At.fromTag("tr",t.dom)}},yi=function(t,e,n){var r=function(t,e){var n=Lr(t,e),r=ve(Ir(t));return er(n,r),n}(t,e);return Vt(n,(function(t,e){null===t?qe(r,e):Fe(r,e,t)})),r},wi=function(t){return t},xi=function(t,e,n){var r=function(t,e){var n,r,o,i;n=t.element,r=e,o=n.dom,i=r.dom,Je(o)&&Je(i)&&(i.style.cssText=o.style.cssText),on(e,"height"),1!==t.colspan&&on(e,"width")};return{col:function(n){var o=At.fromTag(ne(n.element),e.dom);return r(n,o),t(n.element,o),o},colgroup:vi(e),row:bi(e),cell:function(o){var i,u,a=At.fromTag(ne(o.element),e.dom),c=n.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),s=c.length>0?function(t,e,n){return fi(t).map((function(r){var o=n.join(","),i=Ee(r,o,(function(e){return Nt(e,t)}));return R(i,(function(t,e){var n=Pr(e);return qe(n,"contenteditable"),Qn(t,n),n}),e)})).getOr(e)}(o.element,a,c):a;return Qn(s,At.fromTag("br")),r(o,a),i=o.element,u=a,Vt(gi,(function(t,e){return We(i,e).filter((function(e){return _(t,e)})).each((function(t){return Fe(u,e,t)}))})),t(o.element,a),a},replace:yi,gap:hi(e)}},Ci=function(t){return{col:pi(t),colgroup:vi(t),row:bi(t),cell:hi(t),replace:wi,gap:hi(t)}},Si=function(t){return A(t,At.fromDom)},ki=function(t){return At.fromDom(t.getBody())},Ti=function(t){return t.getBoundingClientRect().width},Oi=function(t){return t.getBoundingClientRect().height},_i=function(t){return function(e){return Nt(e,ki(t))}},Ei=function(t){return/^\d+(\.\d+)?$/.test(t)?t+"px":t},Di=function(t){qe(t,"data-mce-style");var e=function(t){return qe(t,"data-mce-style")};M(pn(t),e),M(vn(t),e)},Ai=function(t,e){var n=t.dom.getStyle(e,"width")||t.dom.getAttrib(e,"width");return S.from(n).filter(ot)},Mi=function(t){return/^(\d+(\.\d+)?)%$/.test(t)},zi=function(t){return At.fromDom(t.selection.getStart())},Ri=function(t){return Ar(t.get(),m([]),g,F)},Ni=function(t){var e=function(t,e){return We(t,e).exists((function(t){return parseInt(t,10)>1}))},n=Ri(t);return n.length>0&&H(n,(function(t){return e(t,"rowspan")||e(t,"colspan")}))?S.some(n):S.none()},Bi=function(t,e,n){return Ar(e.get(),S.none,(function(e){return e.length<=1?S.none():_r(t,n.firstSelectedSelector,n.lastSelectedSelector).map((function(t){return{bounds:t,cells:e}}))}),S.none)},Pi="data-mce-selected",Ii="data-mce-first-selected",Li="data-mce-last-selected",Hi={selected:Pi,selectedSelector:"td[data-mce-selected],th[data-mce-selected]",firstSelected:Ii,firstSelectedSelector:"td[data-mce-first-selected],th[data-mce-first-selected]",lastSelected:Li,lastSelectedSelector:"td[data-mce-last-selected],th[data-mce-last-selected]"},Vi=function(t,e,n){return{element:n,mergable:Bi(e,t,Hi),unmergable:Ni(t),selection:Ri(t)}},Fi=function(t){return function(e,n){var r,o=ne(e),i="col"===o||"colgroup"===o?bn(r=e).bind((function(t){return Or(t,Hi.firstSelectedSelector)})).fold(m(r),(function(t){return t[0]})):e;return He(i,t,n)}},ji=Fi("th,td,caption"),Ui=Fi("th,td"),Wi=function(t){return Ri(t)},qi=function(t,e,n){t.on("BeforeGetContent",(function(n){!0===n.selection&&Ar(e.get(),d,(function(e){n.preventDefault(),function(t){return bn(t[0]).map((function(t){var e=ai(t,"[data-mce-selected]");return Di(e),[e]}))}(e).each((function(e){n.content="text"===n.format?function(t){return A(t,(function(t){return t.dom.innerText})).join("")}(e):function(t,e){return A(e,(function(e){return t.selection.serializer.serialize(e.dom,{})})).join("")}(t,e)}))}),d)})),t.on("BeforeSetContent",(function(r){if(!0===r.selection&&!0===r.paste){var o=Wi(e);U(o).each((function(e){bn(e).each((function(o){var i,u,a,c=z((i=r.content,(a=(u||document).createElement("div")).innerHTML=i,ve(At.fromDom(a))),(function(t){return"meta"!==ne(t)})),s=le("table");if(1===c.length&&s(c[0])){r.preventDefault();var l=At.fromDom(t.getDoc()),f=Ci(l),d=function(t,e,n){return{element:t,clipboard:e,generators:n}}(e,c[0],f);n.pasteCells(o,d).each((function(){t.focus()}))}}))}))}}))},$i=Er([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Gi=q({},$i),Ki=function(t,e,n,r,o){var i=t.slice(0),u=function(t,e){return 0===t.length?Gi.none():1===t.length?Gi.only(0):0===e?Gi.left(0,1):e===t.length-1?Gi.right(e-1,e):e>0&&e<t.length-1?Gi.middle(e-1,e,e+1):Gi.none()}(t,e),a=m(A(i,m(0)));return u.fold(a,(function(t){return r.singleColumnWidth(i[t],n)}),(function(t,e){return o.calcLeftEdgeDeltas(i,t,e,n,r.minCellWidth(),r.isRelative)}),(function(t,e,u){return o.calcMiddleDeltas(i,t,e,u,n,r.minCellWidth(),r.isRelative)}),(function(t,e){return o.calcRightEdgeDeltas(i,t,e,n,r.minCellWidth(),r.isRelative)}))},Xi=function(t,e,n){for(var r=0,o=t;o<e;o++)r+=void 0!==n[o]?n[o]:0;return r},Yi=function(t,e){return Hn.hasColumns(t)?function(t,e){var n=Hn.justColumns(t);return A(n,(function(t,n){return{element:t.element,width:e[n],colspan:t.colspan}}))}(t,e):function(t,e){var n=Hn.justCells(t);return A(n,(function(t){var n=Xi(t.column,t.column+t.colspan,e);return{element:t.element,width:n,colspan:t.colspan}}))}(t,e)},Ji=function(t,e,n){var r=Yi(t,e);M(r,(function(t){n.setElementWidth(t.element,t.width)}))},Qi=function(t,e,n,r,o){var i=Hn.fromTable(t),u=o.getCellDelta(e),a=o.getWidths(i,o),c=n===i.grid.columns-1,s=r.clampTableDelta(a,n,u,o.minCellWidth(),c),l=Ki(a,n,s,o,r),f=A(l,(function(t,e){return t+a[e]}));Ji(i,f,o),r.resizeTable(o.adjustTableWidth,s,c)},Zi=function(t,e,n,r){var o=Hn.fromTable(t),i=function(t,e,n){return Qo(t,e,n,Lo,(function(t){return t.getOrThunk(dn)}))}(o,t,r),u=A(i,(function(t,r){return n===r?Math.max(e+t,dn()):t})),a=function(t,e){var n=Hn.justCells(t);return A(n,(function(t){var n=Xi(t.row,t.row+t.rowspan,e);return{element:t.element,height:n,rowspan:t.rowspan}}))}(o,u),c=function(t,e){return A(t.all,(function(t,n){return{element:t.element,height:e[n]}}))}(o,u);M(c,(function(t){Mo(t.element,t.height)})),M(a,(function(t){Mo(t.element,t.height)}));var s=R(u,(function(t,e){return t+e}),0);Mo(t,s)},tu=function(t){return A(t,m(0))},eu=function(t,e,n,r,o){return o(t.slice(0,e)).concat(r).concat(o(t.slice(n)))},nu=function(t){return function(e,n,r,o){if(t(r)){var i=Math.max(o,e[n]-Math.abs(r)),u=Math.abs(i-e[n]);return r>=0?u:-u}return r}},ru=nu((function(t){return t<0})),ou=nu(y),iu=function(){var t=function(t,e,n,r){var o=(100+n)/100,i=Math.max(r,(t[e]+n)/o);return A(t,(function(t,n){return(n===e?i:t/o)-t}))},e=function(e,n,r,o,i,u){return u?t(e,n,o,i):function(t,e,n,r,o){var i=ru(t,e,r,o);return eu(t,e,n+1,[i,0],tu)}(e,n,r,o,i)};return{resizeTable:function(t,e){return t(e)},clampTableDelta:ru,calcLeftEdgeDeltas:e,calcMiddleDeltas:function(t,n,r,o,i,u,a){return e(t,r,o,i,u,a)},calcRightEdgeDeltas:function(e,n,r,o,i,u){if(u)return t(e,r,o,i);var a=ru(e,r,o,i);return tu(e.slice(0,r)).concat([a])},calcRedestributedWidths:function(t,e,n,r){if(r){var o=(e+n)/e,i=A(t,(function(t){return t/o}));return{delta:100*o-100,newSizes:i}}return{delta:n,newSizes:t}}}},uu=function(){var t=function(t,e,n,r,o){var i=ou(t,r>=0?n:e,r,o);return eu(t,e,n+1,[i,-i],tu)};return{resizeTable:function(t,e,n){n&&t(e)},clampTableDelta:function(t,e,n,r,o){if(o){if(n>=0)return n;var i=N(t,(function(t,e){return t+e-r}),0);return Math.max(-i,n)}return ru(t,e,n,r)},calcLeftEdgeDeltas:t,calcMiddleDeltas:function(e,n,r,o,i,u){return t(e,r,o,i,u)},calcRightEdgeDeltas:function(t,e,n,r,o,i){if(i)return tu(t);var u=r/t.length;return A(t,m(u))},calcRedestributedWidths:function(t,e,n,r){return{delta:0,newSizes:t}}}},au=function(t,e){var n=S.from(t.dom.documentElement).map(At.fromDom).getOr(t);return{parent:m(n),view:m(t),origin:m(Zr(0,0)),isResizable:e}},cu=function(t,e,n){return{parent:m(e),view:m(t),origin:m(Zr(0,0)),isResizable:n}},su=Er([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),lu=function(t,e,n){var r=n.substring(0,n.length-t.length),o=parseFloat(r);return r===o.toString()?e(o):su.invalid(n)},fu=q(q({},su),{from:function(t){return nt(t,"%")?lu("%",su.percent,t):nt(t,"px")?lu("px",su.pixels,t):su.invalid(t)}}),du=function(t,e,n){return t.fold((function(){return e}),(function(t){return function(t,e,n){var r=n/e;return A(t,(function(t){return fu.from(t).fold((function(){return t}),(function(t){return t*r+"px"}),(function(t){return t/100*n+"px"}))}))}(e,n,t)}),(function(t){return function(t,e){return A(t,(function(t){return fu.from(t).fold((function(){return t}),(function(t){return t/e*100+"%"}),(function(t){return t+"%"}))}))}(e,n)}))},mu=function(t,e,n){var r,o,i,u=fu.from(n),a=H(t,(function(t){return"0px"===t}))?(r=u,o=t.length,i=r.fold((function(){return m("")}),(function(t){return m(t/o+"px")}),(function(){return m(100/o+"%")})),D(o,i)):du(u,t,e);return hu(a)},gu=function(t,e){return 0===t.length?e:R(t,(function(t,e){return fu.from(e).fold(m(0),g,g)+t}),0)},hu=function(t){if(0===t.length)return t;var e,n,r=R(t,(function(t,e){var n=fu.from(e).fold((function(){return{value:e,remainder:0}}),(function(t){return function(t,e){var n=Math.floor(t);return{value:n+e,remainder:t-n}}(t,"px")}),(function(t){return{value:t+"%",remainder:0}}));return{output:[n.value].concat(t.output),remainder:t.remainder+n.remainder}}),{output:[],remainder:0}),o=r.output;return o.slice(0,o.length-1).concat([(e=o[o.length-1],n=Math.round(r.remainder),fu.from(e).fold(m(e),(function(t){return t+n+"px"}),(function(t){return t+n+"%"})))])},pu=fu.from,vu=function(t){return pu(t).fold(m("px"),m("px"),m("%"))},bu=function(t,e,n,r){var o=Hn.fromTable(t),i=o.all,u=Hn.justCells(o),a=Hn.justColumns(o);e.each((function(e){var n=vu(e),i=Fr(t),c=function(t,e,n){return Xo(t,e,qo,Yo,n)}(o,t,r),s=mu(c,i,e);Hn.hasColumns(o)?function(t,e,n){M(e,(function(e,r){var o=gu([t[r]],fn());Ze(e.element,"width",o+n)}))}(s,a,n):function(t,e,n){M(e,(function(e){var r=t.slice(e.column,e.colspan+e.column),o=gu(r,fn());Ze(e.element,"width",o+n)}))}(s,u,n),Ze(t,"width",e)})),n.each((function(e){var n=vu(e),r=Yr(t),a=function(t,e,n){return Qo(t,e,n,$o,Yo)}(o,t,go);!function(t,e,n,r){M(n,(function(e){var n=t.slice(e.row,e.rowspan+e.row),o=gu(n,dn());Ze(e.element,"height",o+r)})),M(e,(function(e,n){Ze(e.element,"height",t[n])}))}(mu(a,r,e),i,u,n),Ze(t,"height",e)}))},yu=function(t){return No(t).exists((function(t){return Oo.test(t)}))},wu=function(t){return No(t).exists((function(t){return _o.test(t)}))},xu=function(t){return No(t).isNone()},Cu=Vo,Su=function(t){return Hn.fromTable(t).grid},ku=function(t){var e=[];return{bind:function(t){if(void 0===t)throw new Error("Event bind error: undefined handler");e.push(t)},unbind:function(t){e=z(e,(function(e){return e!==t}))},trigger:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o={};M(t,(function(t,e){o[t]=n[e]})),M(e,(function(t){t(o)}))}}},Tu=function(t){return{registry:Ft(t,(function(t){return{bind:t.bind,unbind:t.unbind}})),trigger:Ft(t,(function(t){return t.trigger}))}},Ou=function(t){return t.slice(0).sort()},_u=function(t,e,n){if(0===e.length)throw new Error("You must specify at least one required field.");var o;return function(t,e){if(!i(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");M(e,(function(e){if(!r(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")}))}("required",e),o=Ou(e),B(o,(function(t,e){return e<o.length-1&&t===o[e+1]})).each((function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+o.join(", ")+"].")})),function(r){var o=Lt(r);H(e,(function(t){return _(o,t)}))||function(t,e){throw new Error("All required keys ("+Ou(t).join(", ")+") were not specified. Specified keys were: "+Ou(e).join(", ")+".")}(e,o),t(e,o);var i=z(e,(function(t){return!n.validate(r[t],t)}));return i.length>0&&function(t,e){throw new Error("All values need to be of type: "+e+". Keys ("+Ou(t).join(", ")+") were not.")}(i,n.label),r}},Eu=function(t,e){var n=z(e,(function(e){return!_(t,e)}));n.length>0&&function(t){throw new Error("Unsupported keys for object: "+Ou(t).join(", "))}(n)},Du=function(t){return function(t,e){return _u(t,e,{validate:l,label:"function"})}(Eu,t)},Au=Du(["compare","extract","mutate","sink"]),Mu=Du(["element","start","stop","destroy"]),zu=Du(["forceDrop","drop","move","delayDrop"]),Ru=function(){var t=S.none(),e=Tu({move:ku(["info"])});return{onEvent:function(n,r){r.extract(n).each((function(n){(function(e,n){var r=t.map((function(t){return e.compare(t,n)}));return t=S.some(n),r})(r,n).each((function(t){e.trigger.move(t)}))}))},reset:function(){t=S.none()},events:e.registry}},Nu=function(){var t,e=(t=Tu({move:ku(["info"])}),{onEvent:d,reset:d,events:t.registry}),n=Ru(),r=e;return{on:function(){r.reset(),r=n},off:function(){r.reset(),r=e},isOn:function(){return r===n},onEvent:function(t,e){r.onEvent(t,e)},events:n.events}},Bu=function(t,e,n){var r,o,i,a,c=!1,s=Tu({start:ku([]),stop:ku([])}),l=Nu(),f=function(){g.stop(),l.isOn()&&(l.off(),s.trigger.stop())},d=(r=f,o=200,i=null,{cancel:a=function(){u(i)||(clearTimeout(i),i=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];a(),i=setTimeout((function(){i=null,r.apply(null,t)}),o)}});l.events.move.bind((function(n){e.mutate(t,n.info)}));var m=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];c&&t.apply(null,e)}},g=e.sink(zu({forceDrop:f,drop:m(f),move:m((function(t){d.cancel(),l.onEvent(t,e)})),delayDrop:m(d.throttle)}),n);return{element:g.element,go:function(t){g.start(t),l.on(),s.trigger.start()},on:function(){c=!0},off:function(){c=!1},destroy:function(){g.destroy()},events:s.registry}},Pu=function(t){var e,n,r=At.fromDom(function(t){if(we()&&s(t.target)){var e=At.fromDom(t.target);if(ue(e)&&ke(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return U(n)}}return S.from(t.target)}(t).getOr(t.target)),o=function(){return t.stopPropagation()},i=function(){return t.preventDefault()},u=(e=i,n=o,function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e(n.apply(null,t))});return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(r,t.clientX,t.clientY,o,i,u,t)},Iu=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(Pu(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:p(Lu,t,e,i,o)}},Lu=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Hu=y,Vu=function(t,e,n){return function(t,e,n,r){return Iu(t,e,n,r,!1)}(t,e,Hu,n)},Fu=Pu,ju=function(t,e){var n=Ue(t,e);return void 0===n||""===n?[]:n.split(" ")},Uu=function(t){return void 0!==t.dom.classList},Wu=function(t,e){return function(t,e,n){var r=ju(t,e).concat([n]);return Fe(t,e,r.join(" ")),!0}(t,"class",e)},qu=function(t,e){Uu(t)?t.dom.classList.add(e):Wu(t,e)},$u=function(t,e){return Uu(t)&&t.dom.classList.contains(e)},Gu=function(t){var e=t.replace(/\./g,"-");return{resolve:function(t){return e+"-"+t}}},Ku=Gu("ephox-dragster"),Xu=Ku.resolve,Yu=Au({compare:function(t,e){return Zr(e.left-t.left,e.top-t.top)},extract:function(t){return S.some(Zr(t.x,t.y))},sink:function(t,e){var n=function(t){var e=q({layerClass:Xu("blocker")},t),n=At.fromTag("div");return Fe(n,"role","presentation"),tn(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),qu(n,Xu("blocker")),qu(n,e.layerClass),{element:m(n),destroy:function(){rr(n)}}}(e),r=Vu(n.element(),"mousedown",t.forceDrop),o=Vu(n.element(),"mouseup",t.drop),i=Vu(n.element(),"mousemove",t.move),u=Vu(n.element(),"mouseout",t.delayDrop);return Mu({element:n.element,start:function(t){Qn(t,n.element())},stop:function(){rr(n.element())},destroy:function(){n.destroy(),o.unbind(),i.unbind(),u.unbind(),r.unbind()}})},mutate:function(t,e){t.mutate(e.left,e.top)}}),Ju=function(t){return He(t,"[contenteditable]")},Qu=function(t,e){return void 0===e&&(e=!1),!Et().browser.isIE()&&Te(t)?t.dom.isContentEditable:Ju(t).fold(m(e),(function(t){return"true"===Zu(t)}))},Zu=function(t){return t.dom.contentEditable},ta=Gu("ephox-snooker"),ea=ta.resolve,na=function(){var t=Tu({drag:ku(["xDelta","yDelta","target"])}),e=S.none(),n=function(){var t=Tu({drag:ku(["xDelta","yDelta"])});return{mutate:function(e,n){t.trigger.drag(e,n)},events:t.registry}}();n.events.drag.bind((function(n){e.each((function(e){t.trigger.drag(n.xDelta,n.yDelta,e)}))}));return{assign:function(t){e=S.some(t)},get:function(){return e},mutate:n.mutate,events:t.registry}},ra=ea("resizer-bar"),oa=ea("resizer-rows"),ia=ea("resizer-cols"),ua=function(t){var e=Ae(t.parent(),"."+ra);M(e,rr)},aa=function(t,e,n){var r=t.origin();M(e,(function(e){e.each((function(e){var o=n(r,e);qu(o,ra),Qn(t.parent(),o)}))}))},ca=function(t,e,n,r){aa(t,e,(function(t,e){var o,i,u,a,c,s,l=(o=e.col,i=e.x-t.left,u=n.top-t.top,a=7,c=r,s=At.fromTag("div"),tn(s,{position:"absolute",left:i-a/2+"px",top:u+"px",height:c+"px",width:a+"px"}),je(s,{"data-column":o,role:"presentation"}),s);return qu(l,ia),l}))},sa=function(t,e,n,r){aa(t,e,(function(t,e){var o=function(t,e,n,r,o){var i=At.fromTag("div");return tn(i,{position:"absolute",left:e+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),je(i,{"data-row":t,role:"presentation"}),i}(e.row,n.left-t.left,e.y-t.top,r,7);return qu(o,oa),o}))},la=function(t,e,n,r,o){var i=eo(n),u=e.isResizable,a=r.length>0?go.positions(r,n):[],c=a.length>0?function(t,e){return L(t.all,(function(t,n){return e(t.element)?[n]:[]}))}(t,u):[],s=z(a,(function(t,e){return E(c,(function(t){return e===t}))}));sa(e,s,i,jr(n));var l=o.length>0?bo.positions(o,n):[],f=l.length>0?function(t,e){var n=[];return D(t.grid.columns,(function(r){Hn.getColumnAt(t,r).map((function(t){return t.element})).forall(e)&&n.push(r)})),z(n,(function(n){var r=Hn.filterItems(t,(function(t){return t.column===n}));return H(r,(function(t){return e(t.element)}))}))}(t,u):[],d=z(l,(function(t,e){return E(f,(function(t){return e===t}))}));ca(e,d,i,Jr(n))},fa=function(t,e){if(ua(t),t.isResizable(e)){var n=Hn.fromTable(e),r=qr(n),o=Ur(n);la(n,t,e,r,o)}},da=function(t,e){var n=Ae(t.parent(),"."+ra);M(n,e)},ma=function(t){da(t,(function(t){Ze(t,"display","none")}))},ga=function(t){da(t,(function(t){Ze(t,"display","block")}))},ha=ea("resizer-bar-dragging"),pa=function(t){var e=na(),n=function(t,e){void 0===e&&(e={});var n=void 0!==e.mode?e.mode:Yu;return Bu(t,n,e)}(e,{}),r=S.none(),o=function(t,e){return S.from(Ue(t,e))};e.events.drag.bind((function(t){o(t.target,"data-row").each((function(e){var n=ln(t.target,"top");Ze(t.target,"top",n+t.yDelta+"px")})),o(t.target,"data-column").each((function(e){var n=ln(t.target,"left");Ze(t.target,"left",n+t.xDelta+"px")}))}));var i=function(t,e){return ln(t,e)-un(t,"data-initial-"+e,0)};n.events.stop.bind((function(){e.get().each((function(e){r.each((function(n){o(e,"data-row").each((function(t){var r=i(e,"top");qe(e,"data-initial-top"),l.trigger.adjustHeight(n,r,parseInt(t,10))})),o(e,"data-column").each((function(t){var r=i(e,"left");qe(e,"data-initial-left"),l.trigger.adjustWidth(n,r,parseInt(t,10))})),fa(t,n)}))}))}));var u=function(r,o){l.trigger.startAdjust(),e.assign(r),Fe(r,"data-initial-"+o,ln(r,o)),qu(r,ha),Ze(r,"opacity","0.2"),n.go(t.parent())},a=Vu(t.parent(),"mousedown",(function(t){var e;e=t.target,$u(e,oa)&&u(t.target,"top"),function(t){return $u(t,ia)}(t.target)&&u(t.target,"left")})),c=function(e){return Nt(e,t.view())},s=Vu(t.view(),"mouseover",(function(e){var n;(n=e.target,He(n,"table",c).filter(Qu)).fold((function(){Te(e.target)&&ua(t)}),(function(e){r=S.some(e),fa(t,e)}))})),l=Tu({adjustHeight:ku(["table","delta","row"]),adjustWidth:ku(["table","delta","column"]),startAdjust:ku([])});return{destroy:function(){a.unbind(),s.unbind(),n.destroy(),ua(t)},refresh:function(e){fa(t,e)},on:n.on,off:n.off,hideBars:p(ma,t),showBars:p(ga,t),events:l.registry}},va=function(t,e,n){var r=go,o=bo,i=pa(t),u=Tu({beforeResize:ku(["table","type"]),afterResize:ku(["table","type"]),startDrag:ku([])});return i.events.adjustHeight.bind((function(t){var e=t.table;u.trigger.beforeResize(e,"row");var n=r.delta(t.delta,e);Zi(e,n,t.row,r),u.trigger.afterResize(e,"row")})),i.events.startAdjust.bind((function(t){u.trigger.startDrag()})),i.events.adjustWidth.bind((function(t){var r=t.table;u.trigger.beforeResize(r,"col");var i=o.delta(t.delta,r),a=n(r);Qi(r,i,t.column,e,a),u.trigger.afterResize(r,"col")})),{on:i.on,off:i.off,hideBars:i.hideBars,showBars:i.showBars,destroy:i.destroy,events:u.registry}},ba=function(t,e){return t.fire("newrow",{node:e})},ya=function(t,e){return t.fire("newcell",{node:e})},wa=function(t,e,n){t.fire("TableModified",q(q({},n),{table:e}))},xa={structure:!1,style:!0},Ca={structure:!0,style:!1},Sa={structure:!0,style:!0},ka={"border-collapse":"collapse",width:"100%"},Ta=D(5,(function(t){var e=t+1+"px";return{title:e,value:e}})),Oa=A(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],(function(t){return{title:t,value:t.toLowerCase()}})),_a={border:"1"},Ea="preservetable",Da=function(t){return t.getParam("table_sizing_mode","auto")},Aa=function(t){return t.getParam("table_responsive_width")},Ma=function(t){return t.getParam("table_border_widths",Ta,"array")},za=function(t){return t.getParam("table_border_styles",Oa,"array")},Ra=function(t){return t.getParam("table_default_attributes",_a,"object")},Na=function(t){return t.getParam("table_default_styles",function(t){if(ja(t)){var e=t.getBody().offsetWidth;return q(q({},ka),{width:e+"px"})}return Ua(t)?Ut(ka,(function(t,e){return"width"!==e})):ka}(t),"object")},Ba=function(t){return t.getParam("table_cell_advtab",!0,"boolean")},Pa=function(t){return t.getParam("table_row_advtab",!0,"boolean")},Ia=function(t){return t.getParam("table_advtab",!0,"boolean")},La=function(t){return t.getParam("table_style_by_css",!1,"boolean")},Ha=function(t){return t.getParam("table_cell_class_list",[],"array")},Va=function(t){return t.getParam("table_class_list",[],"array")},Fa=function(t){return"relative"===Da(t)||!0===Aa(t)},ja=function(t){return"fixed"===Da(t)||!1===Aa(t)},Ua=function(t){return"responsive"===Da(t)},Wa=function(t){return t.getParam("table_use_colgroups",!1,"boolean")},qa=function(t){var e="section",n=t.getParam("table_header_type",e,"string");return _(["section","cells","sectionCells","auto"],n)?n:e},$a=function(t){var e=t.getParam("table_column_resizing",Ea,"string");return B(["preservetable","resizetable"],(function(t){return t===e})).getOr(Ea)},Ga=function(t){return"preservetable"===$a(t)},Ka=function(t){return"resizetable"===$a(t)},Xa=function(t){var e=t.getParam("table_clone_elements");return r(e)?S.some(e.split(/[ ,]/)):Array.isArray(e)?S.some(e):S.none()},Ya=function(t){return t.getParam("table_background_color_map",[],"array")},Ja=function(t){return t.getParam("table_border_color_map",[],"array")},Qa=function(t,e){if(Fa(t)){var n=Ai(t,e.dom).filter(Mi).getOrThunk((function(){return Cu(e)}));return ii(n,e)}return ja(t)?oi(Fr(e),e):ri(e)},Za=function(t){qe(t,"width")},tc=function(t,e){var n=function(t){return Fr(t)+"px"}(t);bu(t,S.some(n),S.none(),e),Za(t)},ec=function(t,e){!function(t,e){var n=Vo(t);bu(t,S.some(n),S.none(),e),Za(t)}(e,Qa(t,e))},nc=function(t,e){var n=Qa(t,e);tc(e,n)},rc=function(t){on(t,"width");var e=vn(t),n=e.length>0?e:pn(t);M(n,(function(t){on(t,"width"),Za(t)})),Za(t)},oc=function(){var t=At.fromTag("div");return tn(t,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Qn(Oe(At.fromDom(document)),t),t},ic="bar-",uc=function(t){return"false"!==Ue(t,"data-mce-resize")},ac=function(t){var e,n,o=S.none(),i=S.none(),u=S.none(),a=function(t){return"TABLE"===t.nodeName},c=function(){return i},s=function(e){return Qa(t,e)},l=function(){return Ga(t)?uu():iu()},f=function(r,o,i){var u=nt(o,"e");if(""===n&&ec(t,r),i!==e&&""!==n){Ze(r,"width",n);var a=l(),c=s(r),f=Ga(t)||u?function(t){return Su(t).columns}(r)-1:0;Qi(r,i-e,f,a,c)}else if(Mi(n)){var d=parseFloat(n.replace("%",""));Ze(r,"width",i*d/e+"%")}/^(\d+(\.\d+)?)px$/.test(n)&&function(t){var e=Hn.fromTable(t);Hn.hasColumns(e)||M(pn(t),(function(t){var e=en(t,"width");Ze(t,"width",e),qe(t,"width")}))}(r)};return t.on("init",(function(){var e=function(t,e){return t.inline?cu(ki(t),oc(),e):au(At.fromDom(t.getDoc()),e)}(t,uc);if(u=S.some(e),function(t){var e=t.getParam("object_resizing",!0);return r(e)?"table"===e:e}(t)&&function(t){return t.getParam("table_resize_bars",!0,"boolean")}(t)){var n=l(),a=va(e,n,s);a.on(),a.events.startDrag.bind((function(e){o=S.some(t.selection.getRng())})),a.events.beforeResize.bind((function(e){var n=e.table.dom;!function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(t,n,Ti(n),Oi(n),ic+e.type)})),a.events.afterResize.bind((function(e){var n=e.table,r=n.dom;Di(n),o.each((function(e){t.selection.setRng(e),t.focus()})),function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(t,r,Ti(r),Oi(r),ic+e.type),t.undoManager.add()})),i=S.some(a)}})),t.on("ObjectResizeStart",(function(r){var o=r.target;if(a(o)){var i=At.fromDom(o);M(t.dom.select(".mce-clonedresizable"),(function(e){t.dom.addClass(e,"mce-"+$a(t)+"-columns")})),!wu(i)&&ja(t)?nc(t,i):!yu(i)&&Fa(t)&&ec(t,i),xu(i)&&et(r.origin,ic)&&ec(t,i),e=r.width,n=Ua(t)?"":Ai(t,o).getOr("")}})),t.on("ObjectResized",(function(e){var n=e.target;if(a(n)){var r=At.fromDom(n),o=e.origin;et(o,"corner-")&&f(r,o,e.width),Di(r),wa(t,r.dom,xa)}})),t.on("SwitchMode",(function(){c().each((function(e){t.mode.isReadOnly()?e.hideBars():e.showBars()}))})),{lazyResize:c,lazyWire:function(){return u.getOr(au(At.fromDom(t.getBody()),uc))},destroy:function(){i.each((function(t){t.destroy()})),u.each((function(e){!function(t,e){t.inline&&rr(e.parent())}(t,e)}))}}},cc=function(t,e){return{element:t,offset:e}},sc=function(t,e,n){return t.property().isText(e)&&0===t.property().getText(e).trim().length||t.property().isComment(e)?n(e).bind((function(e){return sc(t,e,n).orThunk((function(){return S.some(e)}))})):S.none()},lc=function(t,e){return t.property().isText(e)?t.property().getText(e).length:t.property().children(e).length},fc=function(t,e){var n=sc(t,e,t.query().prevSibling).getOr(e);if(t.property().isText(n))return cc(n,lc(t,n));var r=t.property().children(n);return r.length>0?fc(t,r[r.length-1]):cc(n,lc(t,n))},dc=fc,mc=lr(),gc=function(t,e){1===an(t,"colspan")&&No(t).bind((function(t){return xo(t,["fixed","relative","empty"])})).each((function(n){var r=n.value/2;Ho(t,r,n.unit),Ho(e,r,n.unit)}))},hc=le("th"),pc=function(t,e){return t&&e?"sectionCells":t?"section":"cells"},vc=function(t){var e="thead"===t.section,n=Ge(bc(t.cells),"th");return e||n?{type:"header",subType:pc(e,n)}:"tfoot"===t.section?{type:"footer"}:{type:"body"}},bc=function(t){var e=z(t,(function(t){return hc(t.element)}));return 0===e.length?S.some("td"):e.length===t.length?S.some("th"):S.none()},yc=function(t,e,n){return Zt(n(t.element,e),!0,t.isLocked)},wc=function(t,e){return t.section!==e?te(t.element,t.cells,e,t.isNew):t},xc=function(){return{transformRow:wc,transformCell:function(t,e,n){var r=n(t.element,e),o="td"!==ne(r)?function(t,e){var n=Lr(t,e);Xn(t,n);var r=ve(t);return er(n,r),rr(t),n}(r,"td"):r;return Zt(o,t.isNew,t.isLocked)}}},Cc=function(){return{transformRow:wc,transformCell:yc}},Sc=function(){return{transformRow:function(t,e){return wc(t,"thead"===e?"tbody":e)},transformCell:yc}},kc=function(t,e){switch(function(t){return W(t.all,(function(t){var e=vc(t);return"header"===e.type?S.from(e.subType):S.none()}))}(Hn.fromTable(t)).getOr(e)){case"section":return xc();case"sectionCells":return Cc();case"cells":return Sc()}},Tc=xc,Oc=Cc,_c=Sc,Ec=function(){return{transformRow:g,transformCell:yc}},Dc=function(t,e,n,r){n===r?qe(t,e):Fe(t,e,n)},Ac=function(t,e,n){var r;(r=De(t,e),j(r,r.length-1)).fold((function(){return Jn(t,n)}),(function(t){return Yn(t,n)}))},Mc=function(t,e){var n=[],r=[],o=function(t){return A(t,(function(t){t.isNew&&n.push(t.element);var e=t.element;return nr(e),M(t.cells,(function(t){t.isNew&&r.push(t.element),Dc(t.element,"colspan",t.colspan,1),Dc(t.element,"rowspan",t.rowspan,1),Qn(e,t.element)})),e}))},i=function(t){return L(t,(function(t){return A(t.cells,(function(t){return Dc(t.element,"span",t.colspan,1),t.element}))}))},u=function(e,n){var r=function(t,e){var n=Ie(t,e).getOrThunk((function(){var n=At.fromTag(e,fe(t).dom);return"thead"===e?Ac(t,"caption,colgroup",n):"colgroup"===e?Ac(t,"caption",n):Qn(t,n),n}));return nr(n),n}(t,n),u=("colgroup"===n?i:o)(e);er(r,u)},a=function(e,n){e.length>0?u(e,n):function(e){Ie(t,e).each(rr)}(n)},c=[],s=[],l=[],f=[];return M(e,(function(t){switch(t.section){case"thead":c.push(t);break;case"tbody":s.push(t);break;case"tfoot":l.push(t);break;case"colgroup":f.push(t)}})),a(f,"colgroup"),a(c,"thead"),a(s,"tbody"),a(l,"tfoot"),{newRows:n,newCells:r}},zc=function(t,e){if(0===t.length)return 0;var n=t[0];return P(t,(function(t){return!e(n.element,t.element)})).getOr(t.length)},Rc=function(t,e,n,r){var o=function(t,e){return t[e]}(t,e).cells.slice(n),i=zc(o,r),u=function(t,e){return A(t,(function(t){return En(t,e)}))}(t,n).slice(e);return{colspan:i,rowspan:zc(u,r)}},Nc=function(t,e){var n=A(t,(function(t){return A(t.cells,b)}));return A(t,(function(r,o){var i,u,a,c,s=L(r.cells,(function(r,i){if(!1===n[o][i]){var u=Rc(t,o,i,e);return function(t,e,r,o){for(var i=t;i<t+r;i++)for(var u=e;u<e+o;u++)n[i][u]=!0}(o,i,u.rowspan,u.colspan),[(a=r.element,c=u.rowspan,s=u.colspan,l=r.isNew,{element:a,rowspan:c,colspan:s,isNew:l})]}return[];var a,c,s,l}));return i=r.element,u=s,a=r.section,c=r.isNew,{element:i,cells:u,section:a,isNew:c}}))},Bc=function(t,e,n){var r=[];M(t.colgroups,(function(t){var e=A(t.columns,(function(t){return Zt(t.element,n,!1)}));r.push(te(t.element,e,"colgroup",n))}));for(var o=0;o<t.grid.rows;o++){for(var i=[],u=0;u<t.grid.columns;u++){var a=Hn.getAt(t,o,u).map((function(t){return Zt(t.element,n,t.isLocked)})).getOrThunk((function(){return Zt(e.gap(),!0,!1)}));i.push(a)}var c=t.all[o],s=te(c.element,i,c.section,n);r.push(s)}return r},Pc=function(t){return Nc(t,Nt)},Ic=function(t,e){return W(t.all,(function(t){return B(t.cells,(function(t){return Nt(e,t.element)}))}))},Lc=function(t,e,n){var r=A(e.selection,(function(e){return hn(e).bind((function(e){return Ic(t,e)})).filter(n)})),o=Ke(r);return Ye(o.length>0,o)},Hc=function(t,e,n,r,o){return function(i,u,a,c,s){var l=Hn.fromTable(u),f=S.from(null==s?void 0:s.section).getOrThunk(Ec);return e(l,a).map((function(e){var n=function(t,e){return Bc(t,e,!1)}(l,c),r=t(n,e,Nt,o(c),f),i=Bn(r.grid);return{info:e,grid:Pc(r.grid),cursor:r.cursor,lockedColumns:i}})).bind((function(t){var e=Mc(u,t.grid),o=S.from(null==s?void 0:s.sizing).getOrThunk((function(){return ri(u)})),a=S.from(null==s?void 0:s.resize).getOrThunk(uu);return n(u,t.grid,t.info,{sizing:o,resize:a,section:f}),r(u),fa(i,u),qe(u,Rn),t.lockedColumns.length>0&&Fe(u,Rn,t.lockedColumns.join(",")),S.some({cursor:t.cursor,newRows:e.newRows,newCells:e.newCells})}))}},Vc=function(t,e){return Lc(t,e,y).map((function(t){return{cells:t,generators:e.generators,clipboard:e.clipboard}}))},Fc=function(t,e){return Lc(t,e,y)},jc=function(t,e){return Lc(t,e,(function(t){return!t.isLocked}))},Uc=function(t,e){return H(e,(function(e){return function(t,e){return Ic(t,e).exists((function(t){return!t.isLocked}))}(t,e)}))},Wc=function(t,e){return function(t,e){return e.mergable}(0,e).filter((function(e){return Uc(t,e.cells)}))},qc=function(t,e){return function(t,e){return e.unmergable}(0,e).filter((function(e){return Uc(t,e)}))},$c=function(t,e,n,r){for(var o=Mn(t).rows,i=!0,u=0;u<o.length;u++)for(var a=0;a<An(o[0]);a++){var c=o[u],s=En(c,a),l=n(s.element,e);!0===l&&!1===i?On(c,a,Zt(r(),!0,s.isLocked)):!0===l&&(i=!1)}return t},Gc=function(t,e,n,r){var o=Mn(t).rows;if(e>0&&e<o.length){var i=function(t,e){return N(t,(function(t,n){return E(t,(function(t){return e(t.element,n.element)}))?t:t.concat([n])}),[])}(o[e-1].cells,n);M(i,(function(t){for(var i=S.none(),u=e;u<o.length;u++)for(var a=function(e){var a=o[u],c=En(a,e);n(c.element,t.element)&&(i.isNone()&&(i=S.some(r())),i.each((function(t){On(a,e,Zt(t,!0,c.isLocked))})))},c=0;c<An(o[0]);c++)a(c)}))}return t},Kc=function(t){return{isValue:y,isError:b,getOr:m(t),getOrThunk:m(t),getOrDie:m(t),or:function(e){return Kc(t)},orThunk:function(e){return Kc(t)},fold:function(e,n){return n(t)},map:function(e){return Kc(e(t))},mapError:function(e){return Kc(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return S.some(t)}}},Xc=function(t){return{isValue:b,isError:y,getOr:g,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:g,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return Xc(t)},mapError:function(e){return Xc(e(t))},each:d,bind:function(e){return Xc(t)},exists:b,forall:y,toOptional:S.none}},Yc={value:Kc,error:Xc,fromOption:function(t,e){return t.fold((function(){return Xc(e)}),Kc)}},Jc=function(t,e){return{rowDelta:0,colDelta:An(t[0])-An(e[0])}},Qc=function(t,e){return{rowDelta:t.length-e.length,colDelta:0}},Zc=function(t,e,n,r){var o="colgroup"===e.section?n.col:n.cell;return D(t,(function(t){return Zt(o(),!0,r(t))}))},ts=function(t,e,n,r){var o=t[t.length-1];return t.concat(D(e,(function(){var t="colgroup"===o.section?n.colgroup:n.row,e=zn(o,t,g),i=Zc(e.cells.length,e,n,(function(t){return Kt(r,t.toString())}));return _n(e,i)})))},es=function(t,e,n,r){return A(t,(function(t){var o=Zc(e,t,n,b);return kn(t,r,o)}))},ns=function(t,e,n){var r=e.colDelta<0?es:g,o=e.rowDelta<0?ts:g,i=Bn(t),u=An(t[0]),a=E(i,(function(t){return t===u-1})),c=r(t,Math.abs(e.colDelta),n,a?u-1:u),s=Bn(c);return o(c,Math.abs(e.rowDelta),n,V(s,y))},rs=function(t,e,n,r){var o=p(r,En(t[e],n).element),i=t[e];return t.length>1&&An(i)>1&&(n>0&&o(Dn(i,n-1))||n<i.cells.length-1&&o(Dn(i,n+1))||e>0&&o(Dn(t[e-1],n))||e<t.length-1&&o(Dn(t[e+1],n)))},os=function(t,e,n){return z(n,(function(n){return n>=t.column&&n<=An(e[0])+t.column}))},is=function(t,e,n,r,o){var i=Bn(e),u=function(t,e,n){var r=An(e[0]),o=Mn(e).cols.length+t.row,i=D(r-t.column,(function(e){return e+t.column}));return{row:o,column:B(i,(function(t){return H(n,(function(e){return e!==t}))})).getOr(r-1)}}(t,e,i),a=Mn(n).rows,c=os(u,a,i);return function(t,e,n){if(t.row>=e.length||t.column>An(e[0]))return Yc.error("invalid start address out of table bounds, row: "+t.row+", column: "+t.column);var r=e.slice(t.row),o=r[0].cells.slice(t.column),i=An(n[0]),u=n.length;return Yc.value({rowDelta:r.length-u,colDelta:o.length-i})}(u,e,a).map((function(t){var n=q(q({},t),{colDelta:t.colDelta-c.length}),i=ns(e,n,r),s=Bn(i),l=os(u,a,s);return function(t,e,n,r,o,i){for(var u=t.row,a=t.column,c=u+n.length,s=a+An(n[0])+i.length,l=V(i,y),f=u;f<c;f++)for(var d=0,m=a;m<s;m++)if(l[m])d++;else{rs(e,f,m,o)&&$c(e,Dn(e[f],m),o,r.cell);var g=m-a-d,h=En(n[f-u],g),p=h.element,v=r.replace(p);On(e[f],m,Zt(v,!0,h.isLocked))}return e}(u,i,a,r,o,l)}))},us=function(t,e,n,r,o){!function(t,e,n,r){e>0&&e<t[0].cells.length&&M(t,(function(t){var o=t.cells[e-1],i=t.cells[e];n(i.element,o.element)&&On(t,e,Zt(r(),!0,i.isLocked))}))}(e,t,o,r.cell);var i=Qc(n,e),u=ns(n,i,r),a=Qc(e,u),c=ns(e,a,r);return A(c,(function(e,n){return kn(e,t,u[n].cells)}))},as=function(t,e,n,r,o){Gc(e,t,o,r.cell);var i,u,a=Bn(e),c=Jc(e,n),s=q(q({},c),{colDelta:c.colDelta-a.length}),l=ns(e,s,r),f=Mn(l),d=f.cols,m=f.rows,g=Bn(l),h=Jc(n,e),p=q(q({},h),{colDelta:h.colDelta+g.length}),v=(i=r,u=g,A(n,(function(t){return N(u,(function(e,n){var r=Zc(1,t,i,y)[0];return Tn(e,n,r)}),t)}))),b=ns(v,p,r);return d.concat(m.slice(0,t)).concat(b).concat(m.slice(t,m.length))},cs=function(t,e,n,r,o){var i=Mn(t),u=i.rows,a=i.cols,c=u.slice(0,e),s=u.slice(e),l=function(t,e,n,r){return zn(t,(function(t){return r(t,n)}),e)}(u[n],(function(t,n){return e>0&&e<u.length&&r(Dn(u[e-1],n),Dn(u[e],n))?En(u[e],n):Zt(o(t.element,r),!0,t.isLocked)}),r,o);return a.concat(c).concat([l]).concat(s)},ss=function(t,e,n,r,o){return A(t,(function(t){var i=e>0&&e<An(t)&&r(Dn(t,e-1),Dn(t,e)),u=function(t,e,n,r,o,i,u){if("colgroup"!==n&&r)return En(t,e);var a=En(t,o);return Zt(u(a.element,i),!0,!1)}(t,e,t.section,i,n,r,o);return Tn(t,e,u)}))},ls=function(t,e,n){return Zt(n(t.element,e),!0,t.isLocked)},fs=function(t,e,n,r,o){return A(t,(function(t){return function(t,e){var n=t.cells,r=A(n,e);return te(t.element,r,t.section,t.isNew)}(t,(function(t){return function(t){return E(e,(function(e){return n(t.element,e.element)}))}(t)?o(t,n,r):t}))}))},ds=function(t,e,n,r){return void 0!==Dn(t[e],n)&&e>0&&r(Dn(t[e-1],n),Dn(t[e],n))},ms=function(t,e,n){return e>0&&n(Dn(t,e-1),Dn(t,e))},gs=function(t,e,n,r){var o=Mn(t).rows,i=L(o,(function(t,r){return ds(o,r,e,n)||ms(t,e,n)?[]:[En(t,e)]}));return fs(t,i,n,r,ls)},hs=function(t,e,n,r,o){var i=Mn(t).rows[e],u=En(i,n);return fs(t,[u],r,o,ls)},ps=function(t){return N(t,(function(t,e){return E(t,(function(t){return t.column===e.column}))?t:t.concat([e])}),[]).sort((function(t,e){return t.column-e.column}))},vs=le("col"),bs=le("colgroup"),ys=function(t){return"tr"===ne(t)||bs(t)},ws=function(t){return{element:t,colspan:un(t,"colspan",1),rowspan:un(t,"rowspan",1)}},xs=function(t){return We(t,"scope").map((function(t){return t.substr(0,3)}))},Cs=function(t,e){void 0===e&&(e=ws);var n=function(n){if(ys(n))return bs((o={element:n}).element)?t.colgroup(o):t.row(o);var o,i=function(e){return vs(e.element)?t.col(e):t.cell(e)}(e(n));return r=S.some({item:n,replacement:i}),i},r=S.none();return{getOrInit:function(t,e){return r.fold((function(){return n(t)}),(function(r){return e(t,r.item)?r.replacement:n(t)}))}}},Ss=function(t,e){return function(n){var r=[],o=function(o){var i=c(e)?{}:{scope:e},u=n.replace(o,t,i);return r.push({item:o,sub:u}),u};return{replaceOrInit:function(t,e){return ys(t)||vs(t)?t:function(t,e){return B(r,(function(n){return e(n.item,t)}))}(t,e).fold((function(){return o(t)}),(function(n){return e(t,n.item)?n.sub:o(t)}))}}}},ks=function(t){return{unmerge:function(e){var n=xs(e);return n.each((function(t){return Fe(e,"scope",t)})),function(){var r=t.cell({element:e,colspan:1,rowspan:1});return on(r,"width"),on(e,"width"),n.each((function(t){return Fe(r,"scope",t)})),r}},merge:function(t){return on(t[0],"width"),function(){var e=Ke(A(t,xs));if(0===e.length)return S.none();var n=e[0],r=["row","col"];return E(e,(function(t){return t!==n&&_(r,t)}))?S.none():S.from(n)}().fold((function(){return qe(t[0],"scope")}),(function(e){return Fe(t[0],"scope",e+"group")})),m(t[0])}}},Ts=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Os=lr(),_s=function(t){return e=t,n=Os.property().name(e),_(Ts,n);var e,n},Es=function(t){return e=t,n=Os.property().name(e),_(["ol","ul"],n);var e,n},Ds=function(t){return e=t,_(["br","img","hr","input"],Os.property().name(e));var e},As=function(t){var e,n=function(t){return"br"===ne(t)},r=function(t){return di(t).bind((function(e){var r=pe(e).map((function(t){return!!_s(t)||!!Ds(t)&&"img"!==ne(t)})).getOr(!1);return me(e).map((function(o){return!0===r||function(t){return"li"===ne(t)||Be(t,Es).isSome()}(o)||n(e)||_s(o)&&!Nt(t,o)?[]:[At.fromTag("br")]}))})).getOr([])},o=0===(e=L(t,(function(t){var e=ve(t);return function(t){return H(t,(function(t){return n(t)||ae(t)&&0===ur(t).trim().length}))}(e)?[]:e.concat(r(t))}))).length?[At.fromTag("br")]:e;nr(t[0]),er(t[0],o)},Ms=function(t){return Qu(t,!0)},zs=function(t){0===pn(t).length&&rr(t)},Rs=function(t,e){return{grid:t,cursor:e}},Ns=function(t,e,n){var r,o,i=Mn(t).rows;return S.from(null===(o=null===(r=i[e])||void 0===r?void 0:r.cells[n])||void 0===o?void 0:o.element).filter(Ms).orThunk((function(){return function(t){return W(t,(function(t){return W(t.cells,(function(t){var e=t.element;return Ye(Ms(e),e)}))}))}(i)}))},Bs=function(t,e,n){var r=Ns(t,e,n);return Rs(t,r)},Ps=function(t){return N(t,(function(t,e){return E(t,(function(t){return t.row===e.row}))?t:t.concat([e])}),[]).sort((function(t,e){return t.row-e.row}))},Is=function(t){return function(e,n,r,o,i){var u=Ps(n),a=N(u,(function(e,n){return function(t,e,n,r,o,i){var u=Mn(t),a=u.cols,c=u.rows,s=c[e],l=L(s.cells,(function(t,n){return ds(c,e,n,r)||ms(s,n,r)?[]:[t]})),f=$([],c);return f[e]=i.transformRow(s,n),fs(a.concat(f),l,r,o,i.transformCell)}(e,n.row,t,r,o.replaceOrInit,i)}),e);return Bs(a,n[0].row,n[0].column)}},Ls=Is("thead"),Hs=Is("tbody"),Vs=Is("tfoot"),Fs=function(t,e,n){var r,o,i=(r=t,o=n.section,xn(r,(function(){return o}))),u=Hn.generate(i);return Bc(u,e,!0)},js=function(t,e,n,r){return function(t,e,n,r){var o=Hn.generate(e),i=r.getWidths(o,r);Ji(o,i,r)}(0,e,0,r.sizing)},Us=function(t,e,n,r){return function(t,e,n,r,o){var i=Hn.generate(e),u=r.getWidths(i,r),a=r.pixelWidth(),c=o.calcRedestributedWidths(u,a,n.pixelDelta,r.isRelative),s=c.newSizes,l=c.delta;Ji(i,s,r),r.adjustTableWidth(l)}(0,e,n,r.sizing,r.resize)},Ws=function(t,e){return E(e,(function(t){return 0===t.column&&t.isLocked}))},qs=function(t,e){return E(e,(function(e){return e.column+e.colspan>=t.grid.columns&&e.isLocked}))},$s=function(t,e){var n=Ur(t),r=ps(e);return N(r,(function(t,e){return t+n[e.column].map(jr).getOr(0)}),0)},Gs=function(t){return function(e,n){return Fc(e,n).filter((function(n){return!(t?Ws:qs)(e,n)})).map((function(t){return{details:t,pixelDelta:$s(e,t)}}))}},Ks=function(t){return function(e,n){return Vc(e,n).filter((function(n){return!(t?Ws:qs)(e,n.cells)}))}},Xs=Hc((function(t,e,n,r){var o=e[0].row,i=Ps(e),u=R(i,(function(t,e){return{grid:cs(t.grid,o,e.row+t.delta,n,r.getOrInit),delta:t.delta+1}}),{grid:t,delta:0}).grid;return Bs(u,o,e[0].column)}),Fc,d,d,Cs),Ys=Hc((function(t,e,n,r){var o=Ps(e),i=o[o.length-1],u=i.row+i.rowspan,a=R(o,(function(t,e){return cs(t,u,e.row,n,r.getOrInit)}),t);return Bs(a,u,e[0].column)}),Fc,d,d,Cs),Js=Hc((function(t,e,n,r){var o=e.details,i=ps(o),u=i[0].column,a=R(i,(function(t,e){return{grid:ss(t.grid,u,e.column+t.delta,n,r.getOrInit),delta:t.delta+1}}),{grid:t,delta:0}).grid;return Bs(a,o[0].row,u)}),Gs(!0),Us,d,Cs),Qs=Hc((function(t,e,n,r){var o=e.details,i=o[o.length-1],u=i.column+i.colspan,a=ps(o),c=R(a,(function(t,e){return ss(t,u,e.column,n,r.getOrInit)}),t);return Bs(c,o[0].row,u)}),Gs(!1),Us,d,Cs),Zs=Hc((function(t,e,n,r){var o=ps(e.details),i=function(t,e){return L(t,(function(t){var n=t.cells,r=R(e,(function(t,e){return e>=0&&e<t.length?t.slice(0,e).concat(t.slice(e+1)):t}),n);return r.length>0?[te(t.element,r,t.section,t.isNew)]:[]}))}(t,A(o,(function(t){return t.column}))),u=i.length>0?i[0].cells.length-1:0;return Bs(i,o[0].row,Math.min(o[0].column,u))}),(function(t,e){return jc(t,e).map((function(e){return{details:e,pixelDelta:-$s(t,e)}}))}),Us,zs,Cs),tl=Hc((function(t,e,n,r){var o=Ps(e),i=function(t,e,n){var r=Mn(t),o=r.rows;return r.cols.concat(o.slice(0,e)).concat(o.slice(n+1))}(t,o[0].row,o[o.length-1].row),u=i.length>0?i.length-1:0;return Bs(i,Math.min(e[0].row,u),e[0].column)}),Fc,d,zs,Cs),el=Hc((function(t,e,n,r){var o=ps(e),i=N(o,(function(t,e){return gs(t,e.column,n,r.replaceOrInit)}),t);return Bs(i,e[0].row,e[0].column)}),jc,d,d,Ss("th","row")),nl=Hc((function(t,e,n,r){var o=ps(e),i=N(o,(function(t,e){return gs(t,e.column,n,r.replaceOrInit)}),t);return Bs(i,e[0].row,e[0].column)}),jc,d,d,Ss("td",null)),rl=Hc(Ls,jc,d,d,Ss("th","col")),ol=Hc(Hs,jc,d,d,Ss("td",null)),il=Hc(Vs,jc,d,d,Ss("td",null)),ul=Hc((function(t,e,n,r){var o=N(e,(function(t,e){return hs(t,e.row,e.column,n,r.replaceOrInit)}),t);return Bs(o,e[0].row,e[0].column)}),jc,d,d,Ss("th")),al=Hc((function(t,e,n,r){var o=N(e,(function(t,e){return hs(t,e.row,e.column,n,r.replaceOrInit)}),t);return Bs(o,e[0].row,e[0].column)}),jc,d,d,Ss("td")),cl=Hc((function(t,e,n,r){var o=e.cells;As(o);var i=function(t,e,n,r){var o=Mn(t).rows;if(0===o.length)return t;for(var i=e.startRow;i<=e.finishRow;i++)for(var u=e.startCol;u<=e.finishCol;u++){var a=o[i],c=En(a,u).isLocked;On(a,u,Zt(r(),!1,c))}return t}(t,e.bounds,0,r.merge(o));return Rs(i,S.from(o[0]))}),Wc,js,d,ks),sl=Hc((function(t,e,n,r){var o=R(e,(function(t,e){return $c(t,e,n,r.unmerge(e))}),t);return Rs(o,S.from(e[0]))}),qc,js,d,ks),ll=Hc((function(t,e,n,r){var o,i,u,a,c,s=(o=e.clipboard,i=e.generators,u=Hn.fromTable(o),Bc(u,i,!0)),l=(a=e.row,c=e.column,{row:a,column:c});return is(l,t,s,e.generators,n).fold((function(){return Rs(t,S.some(e.element))}),(function(t){return Bs(t,e.row,e.column)}))}),(function(t,e){return hn(e.element).bind((function(n){return Ic(t,n).map((function(t){return q(q({},t),{generators:e.generators,clipboard:e.clipboard})}))}))}),js,d,Cs),fl=Hc((function(t,e,n,r){var o=Mn(t).rows,i=e.cells[0].column,u=o[e.cells[0].row],a=Fs(e.clipboard,e.generators,u),c=us(i,t,a,e.generators,n);return Bs(c,e.cells[0].row,e.cells[0].column)}),Ks(!0),d,d,Cs),dl=Hc((function(t,e,n,r){var o=Mn(t).rows,i=e.cells[e.cells.length-1].column+e.cells[e.cells.length-1].colspan,u=o[e.cells[0].row],a=Fs(e.clipboard,e.generators,u),c=us(i,t,a,e.generators,n);return Bs(c,e.cells[0].row,e.cells[0].column)}),Ks(!1),d,d,Cs),ml=Hc((function(t,e,n,r){var o=Mn(t).rows,i=e.cells[0].row,u=o[i],a=Fs(e.clipboard,e.generators,u),c=as(i,t,a,e.generators,n);return Bs(c,e.cells[0].row,e.cells[0].column)}),Vc,d,d,Cs),gl=Hc((function(t,e,n,r){var o=Mn(t).rows,i=e.cells[e.cells.length-1].row+e.cells[e.cells.length-1].rowspan,u=o[e.cells[0].row],a=Fs(e.clipboard,e.generators,u),c=as(i,t,a,e.generators,n);return Bs(c,e.cells[0].row,e.cells[0].column)}),Vc,d,d,Cs),hl=function(t,e){var n=Hn.fromTable(t);return Fc(n,e).bind((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=I(A(n.all,(function(t){return z(t.cells,(function(t){return t.column>=r&&t.column<o}))})));return bc(i)})).getOr("")},pl=function(t,e){var n=Hn.fromTable(t);return Fc(n,e).bind(bc).getOr("")},vl=function(t,e){var n=Hn.fromTable(t);return Fc(n,e).bind((function(t){var e=t[t.length-1],r=t[0].row,o=e.row+e.rowspan;return function(t){var e=A(t,(function(t){return vc(t).type})),n=_(e,"header"),r=_(e,"footer");if(n||r){var o=_(e,"body");return!n||o||r?n||o||!r?S.none():S.some("footer"):S.some("header")}return S.some("body")}(n.all.slice(r,o))})).getOr("")},bl=function(t,e,n){var r=function(t){return"table"===ne(ki(t))},o=Xa(t),i=Ka(t)?d:gc,u=function(e){switch(qa(t)){case"section":return Tc();case"sectionCells":return Oc();case"cells":return _c();default:return kc(e,"section")}},a=function(n,r){return r.cursor.fold((function(){var r=pn(n);return U(r).filter(Te).map((function(r){e.clear(n);var o=t.dom.createRng();return o.selectNode(r.dom),t.selection.setRng(o),Fe(r,"data-mce-selected","1"),o}))}),(function(r){var o=dc(mc,r),i=t.dom.createRng();return i.setStart(o.element.dom,o.offset),i.setEnd(o.element.dom,o.offset),t.selection.setRng(i),e.clear(n),S.some(i)}))},c=function(e,n,r,i,c){return function(s,l,f){void 0===f&&(f=!1),Di(s);var d=i(),m=At.fromDom(t.getDoc()),g=xi(r,m,o),h={sizing:Qa(t,s),resize:Ka(t)?iu():uu(),section:u(s)};return n(s)?e(d,s,l,g,h).bind((function(e){M(e.newRows,(function(e){ba(t,e.dom)})),M(e.newCells,(function(e){ya(t,e.dom)}));var n=a(s,e);return Te(s)&&(Di(s),f||wa(t,s.dom,c)),n.map((function(t){return{rng:t,effect:c}}))})):S.none()}};return{deleteRow:c(tl,(function(e){return!1===r(t)||Su(e).rows>1}),d,n,Ca),deleteColumn:c(Zs,(function(e){return!1===r(t)||Su(e).columns>1}),d,n,Ca),insertRowsBefore:c(Xs,y,d,n,Ca),insertRowsAfter:c(Ys,y,d,n,Ca),insertColumnsBefore:c(Js,y,i,n,Ca),insertColumnsAfter:c(Qs,y,i,n,Ca),mergeCells:c(cl,y,d,n,Ca),unmergeCells:c(sl,y,d,n,Ca),pasteColsBefore:c(fl,y,d,n,Ca),pasteColsAfter:c(dl,y,d,n,Ca),pasteRowsBefore:c(ml,y,d,n,Ca),pasteRowsAfter:c(gl,y,d,n,Ca),pasteCells:c(ll,y,d,n,Sa),makeCellsHeader:c(ul,y,d,n,Ca),unmakeCellsHeader:c(al,y,d,n,Ca),makeColumnsHeader:c(el,y,d,n,Ca),unmakeColumnsHeader:c(nl,y,d,n,Ca),makeRowsHeader:c(rl,y,d,n,Ca),makeRowsBody:c(ol,y,d,n,Ca),makeRowsFooter:c(il,y,d,n,Ca),getTableRowType:vl,getTableCellType:pl,getTableColType:hl}},yl={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},wl=function(t){var e=At.fromTag("colgroup");return D(t,(function(){return Qn(e,At.fromTag("col"))})),e},xl=function(t,e,n,r){return D(t,(function(t){return function(t,e,n,r){for(var o=At.fromTag("tr"),i=0;i<t;i++){var u=r<e||i<n?At.fromTag("th"):At.fromTag("td");i<n&&Fe(u,"scope","row"),r<e&&Fe(u,"scope","col"),Qn(u,At.fromTag("br")),Qn(o,u)}return o}(e,n,r,t)}))},Cl=function(t,e){t.selection.select(e.dom,!0),t.selection.collapse(!0)},Sl=function(t,e,n,o,i){var u=Na(t),a={styles:u,attributes:Ra(t),colGroups:Wa(t)};return t.undoManager.ignore((function(){var r=function(t,e,n,r,o,i){void 0===i&&(i=yl);var u=At.fromTag("table"),a="cells"!==o;tn(u,i.styles),je(u,i.attributes),i.colGroups&&Qn(u,wl(e));var c=Math.min(t,n);if(a&&n>0){var s=At.fromTag("thead");Qn(u,s);var l=xl(n,e,"sectionCells"===o?c:0,r);er(s,l)}var f=At.fromTag("tbody");Qn(u,f);var d=xl(a?t-c:t,e,a?0:n,r);return er(f,d),u}(n,e,i,o,qa(t),a);Fe(r,"data-mce-id","__mce");var u,c,s,l=(u=r,c=At.fromTag("div"),s=At.fromDom(u.dom.cloneNode(!0)),Qn(c,s),function(t){return t.dom.innerHTML}(c));t.insertContent(l),t.addVisual()})),Le(ki(t),'table[data-mce-id="__mce"]').map((function(e){var n;return ja(t)?nc(t,e):Ua(t)?rc(e):(Fa(t)||(n=u.width,r(n)&&-1!==n.indexOf("%")))&&ec(t,e),Di(e),qe(e,"data-mce-id"),function(t,e){M(Ae(e,"tr"),(function(e){ba(t,e.dom),M(Ae(e,"th,td"),(function(e){ya(t,e.dom)}))}))}(t,e),function(t,e){Le(e,"td,th").each(p(Cl,t))}(t,e),e.dom})).getOr(null)},kl=function(t,e,n,r,o){void 0===r&&(r={});var i=function(t){return f(t)&&t>0};if(i(e)&&i(n)){var u=r.headerRows||0,a=r.headerColumns||0;return Sl(t,n,e,a,u)}return console.error(o),null},Tl=function(t){return function(){return t().fold((function(){return[]}),(function(t){return A(t,(function(t){return t.dom}))}))}},Ol=function(t){return function(e){var n=e.length>0?S.some(Si(e)):S.none();t(n)}},_l=function(t){return function(e,n,r){void 0===r&&(r={});var o=kl(t,n,e,r,"Invalid values for insertTable - rows and columns values are required to insert a table.");return t.undoManager.add(),o}},El=function(t,e,n){var r=un(t,e,1);1===n||r<=1?qe(t,e):Fe(t,e,Math.min(n,r))},Dl=function(t,e){var n=Hn.fromTable(t);return jc(n,e).map((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=function(t,e,n){if(Hn.hasColumns(t)){var r=z(Hn.justColumns(t),(function(t){return t.column>=e&&t.column<n})),o=A(r,(function(t){var r=Ir(t.element);return El(r,"span",n-e),r})),i=At.fromTag("colgroup");return er(i,o),[i]}return[]}(n,r,o),u=function(t,e,n){return A(t.all,(function(t){var r=z(t.cells,(function(t){return t.column>=e&&t.column<n})),o=A(r,(function(t){var r=Ir(t.element);return El(r,"colspan",n-e),r})),i=At.fromTag("tr");return er(i,o),i}))}(n,r,o);return $($([],i),u)}))},Al=function(t,e,n){var r=Hn.fromTable(t);return Fc(r,e).bind((function(t){var e=Bc(r,n,!1),o=Mn(e).rows.slice(t[0].row,t[t.length-1].row+t[t.length-1].rowspan),i=L(o,(function(t){var e=z(t.cells,(function(t){return!t.isLocked}));return e.length>0?[q(q({},t),{cells:e})]:[]})),u=Pc(i);return Ye(u.length>0,u)})).map((function(t){return A(t,(function(t){var e=Pr(t.element);return M(t.cells,(function(t){var n=Ir(t.element);Dc(n,"colspan",t.colspan,1),Dc(n,"rowspan",t.rowspan,1),Qn(e,n)})),e}))}))},Ml=tinymce.util.Tools.resolve("tinymce.util.Tools"),zl=function(t,e,n){return function(e,r){for(var o=0;o<r.length;o++){var i=t.getStyle(r[o],n);if(void 0===e&&(e=i),e!==i)return""}return e}(undefined,t.select("td,th",e))},Rl=function(t,e,n){n&&t.formatter.apply("align"+n,{},e)},Nl=function(t,e){Ml.each("left center right".split(" "),(function(n){t.formatter.remove("align"+n,{},e)}))},Bl=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],Pl=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Il=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Ll=function(t){return(e=t,n="#",et(e,n)?function(t,e){return t.substring(e)}(e,n.length):e).toUpperCase();var e,n},Hl=function(t){return function(t){return Pl.test(t)||Il.test(t)}(t)?S.some({value:Ll(t)}):S.none()},Vl=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},Fl=function(t){return function(t){return{value:t}}(Vl(t.red)+Vl(t.green)+Vl(t.blue))},jl=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Ul=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Wl=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},ql=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return Wl(o,i,u,a)},$l=function(t){return Hl(t).orThunk((function(){return function(t){if("transparent"===t)return S.some(Wl(0,0,0,0));var e=jl.exec(t);if(null!==e)return S.some(ql(e[1],e[2],e[3],"1"));var n=Ul.exec(t);return null!==n?S.some(ql(n[1],n[2],n[3],n[4])):S.none()}(t).map(Fl)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],u=r[2],a=r[3];return Fl(Wl(o,i,u,a))}))},Gl=function(t){var e=Zo(S.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(S.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(S.some(t))}}},Kl=function(){var t=Gl(d);return q(q({},t),{on:function(e){return t.get().each(e)}})},Xl=function(t,e,n,r){return function(o){var i=Gl((function(t){return t.unbind()})),u=!ot(r),a=function(){var a=Wi(e),c=function(e){return t.formatter.match(n,{value:r},e.dom,u)};u?(o.setActive(!E(a,c)),i.set(t.formatter.formatChanged(n,(function(t){return o.setActive(!t)}),!0))):(o.setActive(H(a,c)),i.set(t.formatter.formatChanged(n,o.setActive,!1,{value:r})))};return t.initialized?a():t.on("init",a),i.clear}},Yl=function(t){return Xt(t,"menu")},Jl=function(t){return A(t,(function(t){var e=t.text||t.title;return Yl(t)?{text:e,items:Jl(t.menu)}:{text:e,value:t.value}}))},Ql=function(t,e,n,r,o){return A(n,(function(n){var i=n.text||n.title;return Yl(n)?{type:"nestedmenuitem",text:i,getSubmenuItems:function(){return Ql(t,e,n.menu,r,o)}}:{text:i,type:"togglemenuitem",onAction:function(){return o(n.value)},onSetup:Xl(t,e,r,n.value)}}))},Zl=function(t,e){return function(n){var r;t.execCommand("mceTableApplyCellStyle",!1,((r={})[e]=n,r))}},tf=function(t){return L(t,(function(t){return Yl(t)?[q(q({},t),{menu:tf(t.menu)})]:ot(t.value)?[t]:[]}))},ef=function(t,e,n,r,o){return function(i){return i(Ql(t,e,n,r,o))}},nf=function(t,e,n){var r=A(e,(function(t){return{text:t.title,value:"#"+$l(t.value).value,type:"choiceitem"}}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:r.length>0?r:void 0,allowCustomColors:!1},onAction:function(e){var r,o="remove"===e.value?"":e.value;t.execCommand("mceTableApplyCellStyle",!1,((r={})[n]=o,r))}}]},rf=function(t){return function(){var e="header"===t.queryCommandValue("mceTableRowType")?"body":"header";t.execCommand("mceTableRowType",!1,{type:e})}},of=function(t){return function(){var e="th"===t.queryCommandValue("mceTableColType")?"td":"th";t.execCommand("mceTableColType",!1,{type:e})}},uf=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:Bl}],af=function(t){return uf.concat(function(t){var e=Jl(Ha(t));return e.length>0?S.some({name:"class",type:"listbox",label:"Class",items:e}):S.none()}(t).toArray())},cf=function(t,e){var n=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(Jl(za(t)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===e?[{name:"borderwidth",type:"input",label:"Border width"}].concat(n):n}},sf=function(t){return function(e,n){var r=e.dom;return{setAttrib:function(e,o){t&&!o||r.setAttrib(n,e,o)},setStyle:function(e,o){t&&!o||r.setStyle(n,e,o)},setFormat:function(r,o){t&&!o||(""===o?e.formatter.remove(r,{value:null},n,!0):e.formatter.apply(r,{value:o},n))}}}},lf={normal:sf(!1),ifTruthy:sf(!0)},ff=function(t){return function(e){return et(e,"rgb")?t.toHex(e):e}},df=function(t,e){var n=At.fromDom(e);return{borderwidth:rn(n,"border-width").getOr(""),borderstyle:rn(n,"border-style").getOr(""),bordercolor:rn(n,"border-color").map(ff(t)).getOr(""),backgroundcolor:rn(n,"background-color").map(ff(t)).getOr("")}},mf=function(t){var e=t[0],n=t.slice(1);return M(n,(function(t){M(Lt(e),(function(n){Vt(t,(function(t,r){var o=e[n];""!==o&&n===r&&o!==t&&(e[n]="")}))}))})),e},gf=function(t,e,n,r){return B(t,(function(t){return!c(n.formatter.matchNode(r,e+t))})).getOr("")},hf=p(gf,["left","center","right"],"align"),pf=p(gf,["top","middle","bottom"],"valign"),vf=function(t){return bn(At.fromDom(t)).map((function(e){var n={selection:Si(t.cells)};return vl(e,n)})).getOr("")},bf=function(t,e){var n=Hn.fromTable(t),r=Hn.justCells(n),o=z(r,(function(t){return E(e,(function(e){return Nt(t.element,e)}))}));return A(o,(function(t){return{element:t.element.dom,column:Hn.getColumnAt(n,t.column).map((function(t){return t.element.dom}))}}))},yf=function(t,e,n){var r=1===e.length;M(e,(function(e){var o=e.element,i=r?lf.normal(t,o):lf.ifTruthy(t,o);!function(t,e,n){t.setAttrib("scope",n.scope),t.setAttrib("class",n.class),t.setStyle("height",Ei(n.height)),e.setStyle("width",Ei(n.width))}(i,e.column.map((function(e){return r?lf.normal(t,e):lf.ifTruthy(t,e)})).getOr(i),n),Ba(t)&&function(t,e){t.setFormat("tablecellbackgroundcolor",e.backgroundcolor),t.setFormat("tablecellbordercolor",e.bordercolor),t.setFormat("tablecellborderstyle",e.borderstyle),t.setFormat("tablecellborderwidth",Ei(e.borderwidth))}(i,n),r&&(Nl(t,o),function(t,e){Ml.each("top middle bottom".split(" "),(function(n){t.formatter.remove("valign"+n,{},e)}))}(t,o)),n.halign&&Rl(t,o,n.halign),n.valign&&function(t,e,n){n&&t.formatter.apply("valign"+n,{},e)}(t,o,n.valign)}))},wf=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){!function(t,e,n,r){var o=Ut(r,(function(t,e){return n[e]!==t}));$t(o)>0&&e.length>=1&&bn(e[0]).each((function(n){var i=bf(n,e),u=$t(Ut(o,(function(t,e){return"scope"!==e&&"celltype"!==e})))>0,a=Kt(o,"celltype");(u||Kt(o,"scope"))&&yf(t,i,r),a&&function(t,e){t.execCommand("mceTableCellType",!1,{type:e.celltype,no_events:!0})}(t,r),wa(t,n.dom,{structure:a,style:u})}))}(t,e,n,o),t.focus()}))},xf=function(t,e){var n=bn(e[0]).map((function(n){return A(bf(n,e),(function(e){return function(t,e,n,r){var o,i=t.dom,u=r.getOr(e),a=function(t,e){return i.getStyle(t,e)||i.getAttrib(t,e)};return q({width:a(u,"width"),height:a(e,"height"),scope:i.getAttrib(e,"scope"),celltype:(o=e,o.nodeName.toLowerCase()),class:i.getAttrib(e,"class",""),halign:hf(t,e),valign:pf(t,e)},n?df(i,e):{})}(t,e.element,Ba(t),e.column)}))}));return mf(n.getOrDie())},Cf=function(t,e){var n=Wi(e);if(0!==n.length){var r=xf(t,n),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:af(t)},cf(t,"cell")]},i={type:"panel",items:[{type:"grid",columns:2,items:af(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:Ba(t)?o:i,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onSubmit:p(wf,t,n,r)})}},Sf=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],kf=function(t){return Sf.concat(function(t){var e=Jl(function(t){return t.getParam("table_row_class_list",[],"array")}(t));return e.length>0?S.some({name:"class",type:"listbox",label:"Class",items:e}):S.none()}(t).toArray())},Tf=function(t,e,n,r){var o=1===e.length;M(e,(function(e){var i=o?lf.normal(t,e):lf.ifTruthy(t,e);!function(t,e){t.setAttrib("class",e.class),t.setStyle("height",Ei(e.height))}(i,n),Pa(t)&&function(t,e){t.setStyle("background-color",e.backgroundcolor),t.setStyle("border-color",e.bordercolor),t.setStyle("border-style",e.borderstyle)}(i,n),n.align!==r.align&&(Nl(t,e),Rl(t,e,n.align))}))},Of=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){!function(t,e,n,r){var o=Ut(r,(function(t,e){return n[e]!==t}));if($t(o)>0){var i=Kt(o,"type"),u=!i||$t(o)>1;u&&Tf(t,e,r,n),i&&function(t,e){t.execCommand("mceTableRowType",!1,{type:e.type,no_events:!0})}(t,r),bn(At.fromDom(e[0])).each((function(e){return wa(t,e.dom,{structure:i,style:u})}))}}(t,e,n,o),t.focus()}))},_f=function(t){var e,n,r,o,i=(e=zi(t),n=Hi.selected,r=Ui(e),o=r.bind((function(t){return bn(t)})).map((function(t){return yn(t)})),Xe(r,o,(function(t,e){return z(e,(function(e){return E(Si(e.dom.cells),(function(e){return"1"===Ue(e,n)||Nt(e,t)}))}))})).getOr([]));if(0!==i.length){var u=A(i,(function(e){return function(t,e,n){var r=t.dom;return q({height:r.getStyle(e,"height")||r.getAttrib(e,"height"),class:r.getAttrib(e,"class",""),type:vf(e),align:hf(t,e)},n?df(r,e):{})}(t,e.dom,Pa(t))})),a=mf(u),c={type:"tabpanel",tabs:[{title:"General",name:"general",items:kf(t)},cf(t,"row")]},s={type:"panel",items:[{type:"grid",columns:2,items:kf(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:Pa(t)?c:s,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:a,onSubmit:p(Of,t,A(i,(function(t){return t.dom})),a)})}},Ef=function(t,e,n){var r=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],o=function(t){return t.getParam("table_appearance_options",!0,"boolean")}(t)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],i=e.length>0?[{type:"listbox",name:"class",label:"Class",items:e}]:[];return r.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(o).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(i)},Df=function(t,e,n,o){if("TD"===e.tagName||"TH"===e.tagName)r(n)?t.setStyle(e,n,o):t.setStyle(e,n);else if(e.children)for(var i=0;i<e.children.length;i++)Df(t,e.children[i],n,o)},Af=function(t,e,n,r){var o=t.dom,i=r.getData(),u=Ut(i,(function(t,e){return n[e]!==t}));r.close(),""===i.class&&delete i.class,t.undoManager.transact((function(){if(!e){var n=parseInt(i.cols,10)||1,r=parseInt(i.rows,10)||1;e=Sl(t,n,r,0,0)}if($t(u)>0){!function(t,e,n){var r,o=t.dom,i={},u={};if(i.class=n.class,u.height=Ei(n.height),o.getAttrib(e,"width")&&!La(t)?i.width=(r=n.width)?r.replace(/px$/,""):"":u.width=Ei(n.width),La(t)?(u["border-width"]=Ei(n.border),u["border-spacing"]=Ei(n.cellspacing)):(i.border=n.border,i.cellpadding=n.cellpadding,i.cellspacing=n.cellspacing),La(t)&&e.children)for(var a=0;a<e.children.length;a++)Df(o,e.children[a],{"border-width":Ei(n.border),padding:Ei(n.cellpadding)}),Ia(t)&&Df(o,e.children[a],{"border-color":n.bordercolor});Ia(t)&&(u["background-color"]=n.backgroundcolor,u["border-color"]=n.bordercolor,u["border-style"]=n.borderstyle),i.style=o.serializeStyle(q(q({},Na(t)),u)),o.setAttribs(e,q(q({},Ra(t)),i))}(t,e,i);var a=o.select("caption",e)[0];(a&&!i.caption||!a&&i.caption)&&t.execCommand("mceTableToggleCaption"),""===i.align?Nl(t,e):Rl(t,e,i.align)}if(t.focus(),t.addVisual(),$t(u)>0){var c=Kt(u,"caption"),s=!c||$t(u)>1;wa(t,e,{structure:c,style:s})}}))},Mf=function(t,e){var n,r=t.dom,o=function(t,e){var n,r,o,i,u=Na(t),a=Ra(t),c=e?(n=t.dom,{borderstyle:Gt(u,"border-style").getOr(""),bordercolor:ff(n)(Gt(u,"border-color").getOr("")),backgroundcolor:ff(n)(Gt(u,"background-color").getOr(""))}):{};return q(q(q(q(q(q({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),u),a),c),(i=u["border-width"],La(t)&&i?{border:i}:Gt(a,"border").fold((function(){return{}}),(function(t){return{border:t}})))),(r=Gt(u,"border-spacing").or(Gt(a,"cellspacing")).fold((function(){return{}}),(function(t){return{cellspacing:t}})),o=Gt(u,"border-padding").or(Gt(a,"cellpadding")).fold((function(){return{}}),(function(t){return{cellpadding:t}})),q(q({},r),o)))}(t,Ia(t));!1===e?(n=r.getParent(t.selection.getStart(),"table",t.getBody()))?o=function(t,e,n){var r,o,i,u=t.dom,a=La(t)?u.getStyle(e,"border-spacing")||u.getAttrib(e,"cellspacing"):u.getAttrib(e,"cellspacing")||u.getStyle(e,"border-spacing"),c=La(t)?zl(u,e,"padding")||u.getAttrib(e,"cellpadding"):u.getAttrib(e,"cellpadding")||zl(u,e,"padding");return q({width:u.getStyle(e,"width")||u.getAttrib(e,"width"),height:u.getStyle(e,"height")||u.getAttrib(e,"height"),cellspacing:a,cellpadding:c,border:(r=u,o=e,i=rn(At.fromDom(o),"border-width"),La(t)&&i.isSome()?i.getOr(""):r.getAttrib(o,"border")||zl(t.dom,o,"border-width")||zl(t.dom,o,"border")),caption:!!u.select("caption",e)[0],class:u.getAttrib(e,"class",""),align:hf(t,e)},n?df(u,e):{})}(t,n,Ia(t)):Ia(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""):(o.cols="1",o.rows="1",Ia(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""));var i=Jl(Va(t));i.length>0&&o.class&&(o.class=o.class.replace(/\s*mce\-item\-table\s*/g,""));var u={type:"grid",columns:2,items:Ef(t,i,e)},a=Ia(t)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[u]},cf(t,"table")]}:{type:"panel",items:[u]};t.windowManager.open({title:"Table Properties",size:"normal",body:a,onSubmit:p(Af,t,n,o),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o})},zf=function(t){return ji(zi(t),_i(t))},Rf=function(t,e,n,i,u){var a=_i(t),c=function(t){return bn(t,a)},s=function(e){return function(t){return Ui(zi(t),_i(t))}(t).bind((function(t){return c(t).map((function(n){return e(n,t)}))}))},l=function(e){t.focus()},f=function(t,e){return void 0===e&&(e=!1),s((function(n,r){var o=Vi(i,n,r);t(n,o,e).each(l)}))},m=function(){return s((function(e,n){var r=Vi(i,e,n),o=xi(d,At.fromDom(t.getDoc()),S.none());return Al(e,r,o)}))},g=function(){return s((function(t,e){var n=Vi(i,t,e);return Dl(t,n)}))},h=function(e,n){return n().each((function(n){var r=A(n,(function(t){return Ir(t)}));s((function(n,o){var u=Ci(At.fromDom(t.getDoc())),a=function(t,e,n,r){return{selection:Ri(t),clipboard:n,generators:r}}(i,0,r,u);e(n,a).each(l)}))}))},b=function(t){return function(e,n){return Gt(n,"type").each((function(e){f(t(e),n.no_events)}))}};Vt({mceTableSplitCells:function(){return f(e.unmergeCells)},mceTableMergeCells:function(){return f(e.mergeCells)},mceTableInsertRowBefore:function(){return f(e.insertRowsBefore)},mceTableInsertRowAfter:function(){return f(e.insertRowsAfter)},mceTableInsertColBefore:function(){return f(e.insertColumnsBefore)},mceTableInsertColAfter:function(){return f(e.insertColumnsAfter)},mceTableDeleteCol:function(){return f(e.deleteColumn)},mceTableDeleteRow:function(){return f(e.deleteRow)},mceTableCutCol:function(){return g().each((function(t){u.setColumns(t),f(e.deleteColumn)}))},mceTableCutRow:function(){return m().each((function(t){u.setRows(t),f(e.deleteRow)}))},mceTableCopyCol:function(){return g().each((function(t){return u.setColumns(t)}))},mceTableCopyRow:function(){return m().each((function(t){return u.setRows(t)}))},mceTablePasteColBefore:function(){return h(e.pasteColsBefore,u.getColumns)},mceTablePasteColAfter:function(){return h(e.pasteColsAfter,u.getColumns)},mceTablePasteRowBefore:function(){return h(e.pasteRowsBefore,u.getRows)},mceTablePasteRowAfter:function(){return h(e.pasteRowsAfter,u.getRows)},mceTableDelete:function(){return zf(t).each((function(e){bn(e,a).filter(v(a)).each((function(e){var n=At.fromText("");if(Yn(e,n),rr(e),t.dom.isEmpty(t.getBody()))t.setContent(""),t.selection.setCursorLocation();else{var r=t.dom.createRng();r.setStart(n.dom,0),r.setEnd(n.dom,0),t.selection.setRng(r),t.nodeChanged()}}))}))},mceTableCellToggleClass:function(e,n){s((function(e){var r=Wi(i),o=H(r,(function(e){return t.formatter.match("tablecellclass",{value:n},e.dom)}))?t.formatter.remove:t.formatter.apply;M(r,(function(t){return o("tablecellclass",{value:n},t.dom)})),wa(t,e.dom,xa)}))},mceTableToggleClass:function(e,n){s((function(e){t.formatter.toggle("tableclass",{value:n},e.dom),wa(t,e.dom,xa)}))},mceTableToggleCaption:function(){zf(t).each((function(e){bn(e,a).each((function(n){Ie(n,"caption").fold((function(){var e,r,o=At.fromTag("caption");Qn(o,At.fromText("Caption")),r=o,be(e=n,0).fold((function(){Qn(e,r)}),(function(t){Xn(t,r)})),t.selection.setCursorLocation(o.dom,0)}),(function(r){le("caption")(e)&&Rt("td",n).each((function(e){return t.selection.setCursorLocation(e.dom,0)})),rr(r)})),wa(t,n.dom,Ca)}))}))},mceTableSizingMode:function(e,n){return function(e){return zf(t).each((function(n){Ua(t)||ja(t)||Fa(t)||bn(n,a).each((function(n){"relative"!==e||yu(n)?"fixed"!==e||wu(n)?"responsive"!==e||xu(n)||rc(n):nc(t,n):ec(t,n),Di(n),wa(t,n.dom,Ca)}))}))}(n)},mceTableCellType:b((function(t){return"th"===t?e.makeCellsHeader:e.unmakeCellsHeader})),mceTableColType:b((function(t){return"th"===t?e.makeColumnsHeader:e.unmakeColumnsHeader})),mceTableRowType:b((function(t){switch(t){case"header":return e.makeRowsHeader;case"footer":return e.makeRowsFooter;default:return e.makeRowsBody}}))},(function(e,n){return t.addCommand(n,e)})),Vt({mceTableProps:p(Mf,t,!1),mceTableRowProps:p(_f,t),mceTableCellProps:p(Cf,t,i)},(function(e,n){return t.addCommand(n,(function(){return e()}))})),t.addCommand("mceInsertTable",(function(e,n){o(n)&&Lt(n).length>0?kl(t,n.rows,n.columns,n.options,"Invalid values for mceInsertTable - rows and columns values are required to insert a table."):Mf(t,!0)})),t.addCommand("mceTableApplyCellStyle",(function(e,n){var u=function(t){return"tablecell"+t.toLowerCase().replace("-","")};if(o(n)){var a=Wi(i);if(0!==a.length){var s=Ut(n,(function(e,n){return t.formatter.has(u(n))&&r(e)}));(function(t){for(var e in t)if(Ht.call(t,e))return!1;return!0})(s)||(Vt(s,(function(e,n){M(a,(function(r){lf.normal(t,r.dom).setFormat(u(n),e)}))})),c(a[0]).each((function(e){return wa(t,e.dom,xa)})))}}}))},Nf={remove_similar:!0,inherit:!1},Bf=q({selector:"td,th"},Nf),Pf={tablecellbackgroundcolor:q({styles:{backgroundColor:"%value"}},Bf),tablecellverticalalign:q({styles:{"vertical-align":"%value"}},Bf),tablecellbordercolor:q({styles:{borderColor:"%value"}},Bf),tablecellclass:q({classes:["%value"]},Bf),tableclass:q({selector:"table",classes:["%value"]},Nf),tablecellborderstyle:q({styles:{borderStyle:"%value"}},Bf),tablecellborderwidth:q({styles:{borderWidth:"%value"}},Bf)},If=Er([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),Lf=q(q({},If),{none:function(t){return void 0===t&&(t=void 0),If.none(t)}}),Hf=function(t,e,n,r,o){void 0===o&&(o=y);var i=1===r;if(!i&&n<=0)return Lf.first(t[0]);if(i&&n>=t.length-1)return Lf.last(t[t.length-1]);var u=n+r,a=t[u];return o(a)?Lf.middle(e,a):Hf(t,e,u,r,o)},Vf=function(t,e){return bn(t,e).bind((function(e){var n=pn(e);return P(n,(function(e){return Nt(t,e)})).map((function(t){return{index:t,all:n}}))}))},Ff=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},jf=Er([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Uf={before:jf.before,on:jf.on,after:jf.after,cata:function(t,e,n,r){return t.fold(e,n,r)},getStart:function(t){return t.fold(g,g,g)}},Wf=Er([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),qf={domRange:Wf.domRange,relative:Wf.relative,exact:Wf.exact,exactFromRange:function(t){return Wf.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e,n=function(t){return t.match({domRange:function(t){return At.fromDom(t.startContainer)},relative:function(t,e){return Uf.getStart(t)},exact:function(t,e,n,r){return t}})}(t);return e=n,At.fromDom(de(e).dom.defaultView)},range:Ff},$f=function(t,e){var n=t.document.createRange();return n.selectNode(e.dom),n},Gf=function(t,e){var n=t.document.createRange();return Kf(n,e),n},Kf=function(t,e){return t.selectNodeContents(e.dom)},Xf=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},Yf=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Jf=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Qf=Er([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Zf=function(t,e,n){return e(At.fromDom(n.startContainer),n.startOffset,At.fromDom(n.endContainer),n.endOffset)},td=function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return Qf.rtl(At.fromDom(t.endContainer),t.endOffset,At.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Zf(0,Qf.ltr,n)})):Zf(0,Qf.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:m(t),rtl:S.none}},relative:function(e,n){return{ltr:K((function(){return Xf(t,e,n)})),rtl:K((function(){return S.some(Xf(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:K((function(){return Yf(t,e,n,r,o)})),rtl:K((function(){return S.some(Yf(t,r,o,e,n))}))}}})}(t,e))},ed=function(t,e){return td(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})};Qf.ltr,Qf.rtl;var nd=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},rd=function(t,e,n,r,o){var i=function(n){var r=t.dom.createRange();return r.setStart(e.dom,n),r.collapse(!0),r},u=ur(e).length,a=function(t,e,n,r,o){if(0===o)return 0;if(e===r)return o-1;for(var i=r,u=1;u<o;u++){var a=t(u),c=Math.abs(e-a.left);if(n<=a.bottom){if(n<a.top||c>i)return u-1;i=c}}return 0}((function(t){return i(t).getBoundingClientRect()}),n,r,o.right,u);return i(a)},od=function(t,e,n,r){return ae(e)?function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getClientRects();return W(i,(function(t){return nd(t,n,r)?S.some(t):S.none()})).map((function(o){return rd(t,e,n,r,o)}))}(t,e,n,r):function(t,e,n,r){var o=t.dom.createRange(),i=ve(e);return W(i,(function(e){return o.selectNode(e.dom),nd(o.getBoundingClientRect(),n,r)?od(t,e,n,r):S.none()}))}(t,e,n,r)},id=function(t,e){return e-t.left<t.right-e},ud=function(t,e,n){var r=t.dom.createRange();return r.selectNode(e.dom),r.collapse(n),r},ad=function(t,e,n){var r=t.dom.createRange();r.selectNode(e.dom);var o=r.getBoundingClientRect(),i=id(o,n);return(true===i?fi:di)(e).map((function(e){return ud(t,e,i)}))},cd=function(t,e,n){var r=e.dom.getBoundingClientRect(),o=id(r,n);return S.some(ud(t,e,o))},sd=function(t,e,n){var r,o;return S.from(null===(o=(r=t.dom).caretPositionFromPoint)||void 0===o?void 0:o.call(r,e,n)).bind((function(e){if(null===e.offsetNode)return S.none();var n=t.dom.createRange();return n.setStart(e.offsetNode,e.offset),n.collapse(),S.some(n)}))},ld=function(t,e,n){var r,o;return S.from(null===(o=(r=t.dom).caretRangeFromPoint)||void 0===o?void 0:o.call(r,e,n))},fd=function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect();return function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return od(t,e,u,a)}(t,e,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))},dd=function(t,e,n){return At.fromPoint(t,e,n).bind((function(r){var o=function(){return function(t,e,n){return(0===ve(e).length?cd:ad)(t,e,n)}(t,r,e)};return 0===ve(r).length?o():fd(t,r,e,n).orThunk(o)}))},md=document.caretPositionFromPoint?sd:document.caretRangeFromPoint?ld:dd,gd=function(t,e){var n=ne(t);return"input"===n?Uf.after(t):_(["br","img"],n)?0===e?Uf.before(t):Uf.after(t):Uf.on(t,e)},hd=function(t,e){var n=t.fold(Uf.before,gd,Uf.after),r=e.fold(Uf.before,gd,Uf.after);return qf.relative(n,r)},pd=function(t,e,n,r){var o=gd(t,e),i=gd(n,r);return qf.relative(o,i)},vd=function(t,e,n,r){var o=function(t,e,n,r){var o=fe(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=Nt(t,n)&&e===r;return o.collapsed&&!i},bd=function(t){return S.from(t.getSelection())},yd=function(t,e){bd(t).each((function(t){t.removeAllRanges(),t.addRange(e)}))},wd=function(t,e,n,r,o){var i=Yf(t,e,n,r,o);yd(t,i)},xd=function(t,e){return td(t,e).match({ltr:function(e,n,r,o){wd(t,e,n,r,o)},rtl:function(e,n,r,o){bd(t).each((function(i){if(i.setBaseAndExtent)i.setBaseAndExtent(e.dom,n,r.dom,o);else if(i.extend)try{!function(t,e,n,r,o,i){e.collapse(n.dom,r),e.extend(o.dom,i)}(0,i,e,n,r,o)}catch(u){wd(t,r,o,e,n)}else wd(t,r,o,e,n)}))}})},Cd=function(t,e,n,r,o){var i=pd(e,n,r,o);xd(t,i)},Sd=function(t,e,n){var r=hd(e,n);xd(t,r)},kd=function(t){var e=qf.getWin(t).dom,n=function(t,n,r,o){return Yf(e,t,n,r,o)},r=function(t){return t.match({domRange:function(t){var e=At.fromDom(t.startContainer),n=At.fromDom(t.endContainer);return pd(e,t.startOffset,n,t.endOffset)},relative:hd,exact:pd})}(t);return td(e,r).match({ltr:n,rtl:n})},Td=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return S.some(Ff(At.fromDom(e.startContainer),e.startOffset,At.fromDom(n.endContainer),n.endOffset))}return S.none()},Od=function(t){if(null===t.anchorNode||null===t.focusNode)return Td(t);var e=At.fromDom(t.anchorNode),n=At.fromDom(t.focusNode);return vd(e,t.anchorOffset,n,t.focusOffset)?S.some(Ff(e,t.anchorOffset,n,t.focusOffset)):Td(t)},_d=function(t,e,n){void 0===n&&(n=!0);var r=(n?Gf:$f)(t,e);yd(t,r)},Ed=function(t){return function(t){return bd(t).filter((function(t){return t.rangeCount>0})).bind(Od)}(t).map((function(t){return qf.exact(t.start,t.soffset,t.finish,t.foffset)}))},Dd=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?S.some(n).map(Jf):S.none()}(ed(t,e))},Ad=function(t,e,n){return function(t,e,n){var r=At.fromDom(t.document);return md(r,e,n).map((function(t){return Ff(At.fromDom(t.startContainer),t.startOffset,At.fromDom(t.endContainer),t.endOffset)}))}(t,e,n)},Md=tinymce.util.Tools.resolve("tinymce.util.VK"),zd=function(t,e,n){return Nd(t,e,function(t,e,n){return Vf(t,n).fold((function(){return Lf.none(t)}),(function(n){return Hf(n.all,t,n.index,1,e)}))}(n,Qu))},Rd=function(t,e,n){return Nd(t,e,function(t,e,n){return Vf(t,n).fold((function(){return Lf.none()}),(function(n){return Hf(n.all,t,n.index,-1,e)}))}(n,Qu))},Nd=function(t,e,n){return n.fold(S.none,S.none,(function(t,e){return fi(e).map((function(t){return function(t,e){var n=qf.exact(e,0,e,0);return kd(n)}(0,t)}))}),(function(n){return t.execCommand("mceTableInsertRowAfter"),zd(t,e,n)}))},Bd=["table","li","dl"],Pd=function(t,e){return{selection:t,kill:e}},Id=function(t,e,n,r){return{start:Uf.on(t,e),finish:Uf.on(n,r)}},Ld=function(t,e){var n=ed(t,e);return Ff(At.fromDom(n.startContainer),n.startOffset,At.fromDom(n.endContainer),n.endOffset)},Hd=Id,Vd=function(t,e,n,r,o){return Nt(n,r)?S.none():Cr(n,r,e).bind((function(e){var r=e.boxes.getOr([]);return r.length>1?(o(t,r,e.start,e.finish),S.some(Pd(S.some(Hd(n,0,n,ci(n))),!0))):S.none()}))},Fd=function(t,e){return{item:t,mode:e}},jd=function(t,e,n,r){return void 0===r&&(r=Ud),t.property().parent(e).map((function(t){return Fd(t,r)}))},Ud=function(t,e,n,r){return void 0===r&&(r=Wd),n.sibling(t,e).map((function(t){return Fd(t,r)}))},Wd=function(t,e,n,r){void 0===r&&(r=Wd);var o=t.property().children(e);return n.first(o).map((function(t){return Fd(t,r)}))},qd=[{current:jd,next:Ud,fallback:S.none()},{current:Ud,next:Wd,fallback:S.some(jd)},{current:Wd,next:Wd,fallback:S.some(Ud)}],$d=function(t,e,n,r,o){return void 0===o&&(o=qd),B(o,(function(t){return t.current===n})).bind((function(n){return n.current(t,e,r,n.next).orThunk((function(){return n.fallback.bind((function(n){return $d(t,e,n,r)}))}))}))},Gd=function(){return{sibling:function(t,e){return t.query().prevSibling(e)},first:function(t){return t.length>0?S.some(t[t.length-1]):S.none()}}},Kd=function(){return{sibling:function(t,e){return t.query().nextSibling(e)},first:function(t){return t.length>0?S.some(t[0]):S.none()}}},Xd=function(t,e,n,r,o,i){return $d(t,e,r,o).bind((function(e){return i(e.item)?S.none():n(e.item)?S.some(e.item):Xd(t,e.item,n,e.mode,o,i)}))},Yd=function(t){return function(e){return 0===t.property().children(e).length}},Jd=function(t,e,n,r){return Xd(t,e,n,Ud,Gd(),r)},Qd=function(t,e,n,r){return Xd(t,e,n,Ud,Kd(),r)},Zd=lr(),tm=function(t,e){return function(t,e,n){return Jd(t,e,Yd(t),n)}(Zd,t,e)},em=function(t,e){return function(t,e,n){return Qd(t,e,Yd(t),n)}(Zd,t,e)},nm=Er([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),rm=function(t){return He(t,"tr")},om=q(q({},nm),{verify:function(t,e,n,r,o,i,u){return He(r,"td,th",u).bind((function(n){return He(e,"td,th",u).map((function(e){return Nt(n,e)?Nt(r,n)&&ci(n)===o?i(e):nm.none("in same cell"):wr(rm,[n,e]).fold((function(){return function(t,e,n){var r=t.getRect(e),o=t.getRect(n);return o.right>r.left&&o.left<r.right}(t,e,n)?nm.success():i(e)}),(function(t){return i(e)}))}))})).getOr(nm.none("default"))},cata:function(t,e,n,r,o){return t.fold(e,n,r,o)}}),im=function(t,e){return P(t,p(Nt,e))},um=function(t){return"br"===ne(t)},am=function(t,e,n){return e(t,n).bind((function(t){return ae(t)&&0===ur(t).trim().length?am(t,e,n):S.some(t)}))},cm=function(t,e,n,r){return function(t,e){return be(t,e).filter(um).orThunk((function(){return be(t,e-1).filter(um)}))}(e,n).bind((function(e){return r.traverse(e).fold((function(){return am(e,r.gather,t).map(r.relative)}),(function(t){return function(t){return me(t).bind((function(e){var n=ve(e);return im(n,t).map((function(r){return function(t,e,n,r){return{parent:t,children:e,element:n,index:r}}(e,n,t,r)}))}))}(t).map((function(t){return Uf.on(t.parent,t.index)}))}))}))},sm=function(t,e,n,r){return(um(e)?function(t,e,n){return n.traverse(e).orThunk((function(){return am(e,n.gather,t)})).map(n.relative)}(t,e,r):cm(t,e,n,r)).map((function(t){return{start:t,finish:t}}))},lm=function(t,e){return{left:t.left,top:t.top+e,right:t.right,bottom:t.bottom+e}},fm=function(t,e){return{left:t.left,top:t.top-e,right:t.right,bottom:t.bottom-e}},dm=function(t,e,n){return{left:t.left+e,top:t.top+n,right:t.right+e,bottom:t.bottom+n}},mm=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}},gm=function(t,e){return S.some(t.getRect(e))},hm=function(t,e,n){return ue(e)?gm(t,e).map(mm):ae(e)?function(t,e,n){return n>=0&&n<ci(e)?t.getRangedRect(e,n,e,n+1):n>0?t.getRangedRect(e,n-1,e,n):S.none()}(t,e,n).map(mm):S.none()},pm=function(t,e){return ue(e)?gm(t,e).map(mm):ae(e)?t.getRangedRect(e,0,e,ci(e)).map(mm):S.none()},vm=Er([{none:[]},{retry:["caret"]}]),bm=function(t,e,n){return(r=e,o=_s,Me((function(t,e){return e(t)}),Be,r,o,i)).fold(b,(function(e){return pm(t,e).exists((function(t){return function(t,e){return t.left<e.left||Math.abs(e.right-t.left)<1||t.left>e.right}(n,t)}))}));var r,o,i},ym={point:function(t){return t.bottom},adjuster:function(t,e,n,r,o){var i=lm(o,5);return Math.abs(n.bottom-r.bottom)<1||n.top>o.bottom?vm.retry(i):n.top===o.bottom?vm.retry(lm(o,1)):bm(t,e,o)?vm.retry(dm(i,5,0)):vm.none()},move:lm,gather:em},wm=function(t,e,n,r,o){return 0===o?S.some(r):function(t,e,n){return t.elementFromPoint(e,n).filter((function(t){return"table"===ne(t)})).isSome()}(t,r.left,e.point(r))?function(t,e,n,r,o){return wm(t,e,n,e.move(r,5),o)}(t,e,n,r,o-1):t.situsFromPoint(r.left,e.point(r)).bind((function(i){return i.start.fold(S.none,(function(i){return pm(t,i).bind((function(u){return e.adjuster(t,i,u,n,r).fold(S.none,(function(r){return wm(t,e,n,r,o-1)}))})).orThunk((function(){return S.some(r)}))}),S.none)}))},xm=function(t,e,n){var r=t.move(n,5),o=wm(e,t,n,r,100).getOr(r);return function(t,e,n){return t.point(e)>n.getInnerHeight()?S.some(t.point(e)-n.getInnerHeight()):t.point(e)<0?S.some(-t.point(e)):S.none()}(t,o,e).fold((function(){return e.situsFromPoint(o.left,t.point(o))}),(function(n){return e.scrollBy(0,n),e.situsFromPoint(o.left,t.point(o)-n)}))},Cm={tryUp:p(xm,{point:function(t){return t.top},adjuster:function(t,e,n,r,o){var i=fm(o,5);return Math.abs(n.top-r.top)<1||n.bottom<o.top?vm.retry(i):n.bottom===o.top?vm.retry(fm(o,1)):bm(t,e,o)?vm.retry(dm(i,5,0)):vm.none()},move:fm,gather:tm}),tryDown:p(xm,ym),ieTryUp:function(t,e){return t.situsFromPoint(e.left,e.top-5)},ieTryDown:function(t,e){return t.situsFromPoint(e.left,e.bottom+5)},getJumpSize:m(5)},Sm=function(t,e,n){return t.getSelection().bind((function(r){return sm(e,r.finish,r.foffset,n).fold((function(){return S.some(cc(r.finish,r.foffset))}),(function(o){var i=t.fromSitus(o);return function(t){return om.cata(t,(function(t){return S.none()}),(function(){return S.none()}),(function(t){return S.some(cc(t,0))}),(function(t){return S.some(cc(t,ci(t)))}))}(om.verify(t,r.finish,r.foffset,i.finish,i.foffset,n.failure,e))}))}))},km=function(t,e,n,r,o,i){return 0===i?S.none():_m(t,e,n,r,o).bind((function(u){var a=t.fromSitus(u),c=om.verify(t,n,r,a.finish,a.foffset,o.failure,e);return om.cata(c,(function(){return S.none()}),(function(){return S.some(u)}),(function(u){return Nt(n,u)&&0===r?Tm(t,n,r,fm,o):km(t,e,u,0,o,i-1)}),(function(u){return Nt(n,u)&&r===ci(u)?Tm(t,n,r,lm,o):km(t,e,u,ci(u),o,i-1)}))}))},Tm=function(t,e,n,r,o){return hm(t,e,n).bind((function(e){return Om(t,o,r(e,Cm.getJumpSize()))}))},Om=function(t,e,n){var r=Et().browser;return r.isChrome()||r.isSafari()||r.isFirefox()||r.isEdge()?e.otherRetry(t,n):r.isIE()?e.ieRetry(t,n):S.none()},_m=function(t,e,n,r,o){return hm(t,n,r).bind((function(e){return Om(t,o,e)}))},Em=function(t,e){return Be(t,(function(t){return me(t).exists((function(t){return Nt(t,e)}))}),n).isSome();var n},Dm=function(t,e,n,r,o){return He(r,"td,th",e).bind((function(r){return He(r,"table",e).bind((function(i){return Em(o,i)?function(t,e,n){return Sm(t,e,n).bind((function(r){return km(t,e,r.element,r.offset,n,20).map(t.fromSitus)}))}(t,e,n).bind((function(t){return He(t.finish,"td,th",e).map((function(e){return{start:r,finish:e,range:t}}))})):S.none()}))}))},Am=function(t,e,n,r,o,i){return Et().browser.isIE()?S.none():i(r,e).orThunk((function(){return Dm(t,e,n,r,o).map((function(t){var e=t.range;return Pd(S.some(Hd(e.start,e.soffset,e.finish,e.foffset)),!0)}))}))},Mm=function(t,e){return He(t,"tr",e).bind((function(t){return He(t,"table",e).bind((function(n){var r=Ae(n,"tr");return Nt(t,r[0])?function(t,e,n){return Jd(Zd,t,e,n)}(n,(function(t){return di(t).isSome()}),e).map((function(t){var e=ci(t);return Pd(S.some(Hd(t,e,t,e)),!0)})):S.none()}))}))},zm=function(t,e){return He(t,"tr",e).bind((function(t){return He(t,"table",e).bind((function(n){var r=Ae(n,"tr");return Nt(t,r[r.length-1])?function(t,e,n){return Qd(Zd,t,e,n)}(n,(function(t){return fi(t).isSome()}),e).map((function(t){return Pd(S.some(Hd(t,0,t,0)),!0)})):S.none()}))}))},Rm=function(t,e,n,r,o,i,u){return Dm(t,n,r,o,i).bind((function(t){return Vd(e,n,t.start,t.finish,u)}))},Nm=function(t,e){return He(t,"td,th",e)},Bm={traverse:pe,gather:em,relative:Uf.before,otherRetry:Cm.tryDown,ieRetry:Cm.ieTryDown,failure:om.failedDown},Pm={traverse:he,gather:tm,relative:Uf.before,otherRetry:Cm.tryUp,ieRetry:Cm.ieTryUp,failure:om.failedUp},Im=function(t){return function(e){return e===t}},Lm=Im(38),Hm=Im(40),Vm=function(t){return t>=37&&t<=40},Fm={isBackward:Im(37),isForward:Im(39)},jm={isBackward:Im(39),isForward:Im(37)},Um=function(t){return{elementFromPoint:function(e,n){return At.fromPoint(At.fromDom(t.document),e,n)},getRect:function(t){return t.dom.getBoundingClientRect()},getRangedRect:function(e,n,r,o){var i=qf.exact(e,n,r,o);return Dd(t,i)},getSelection:function(){return Ed(t).map((function(e){return Ld(t,e)}))},fromSitus:function(e){var n=qf.relative(e.start,e.finish);return Ld(t,n)},situsFromPoint:function(e,n){return Ad(t,e,n).map((function(t){return Id(t.start,t.soffset,t.finish,t.foffset)}))},clearSelection:function(){!function(t){bd(t).each((function(t){return t.removeAllRanges()}))}(t)},collapseSelection:function(e){void 0===e&&(e=!1),Ed(t).each((function(n){return n.fold((function(t){return t.collapse(e)}),(function(n,r){var o=e?n:r;Sd(t,o,o)}),(function(n,r,o,i){var u=e?n:o,a=e?r:i;Cd(t,u,a,u,a)}))}))},setSelection:function(e){Cd(t,e.start,e.soffset,e.finish,e.foffset)},setRelativeSelection:function(e,n){Sd(t,e,n)},selectNode:function(e){_d(t,e,!1)},selectContents:function(e){_d(t,e)},getInnerHeight:function(){return t.innerHeight},getScrollY:function(){var e,n,r,o;return(e=At.fromDom(t.document),n=void 0!==e?e.dom:document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop,Zr(r,o)).top},scrollBy:function(e,n){!function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollBy(t,e)}(e,n,At.fromDom(t.document))}}},Wm=function(t,e){return{rows:t,cols:e}},qm=function(t,e,n,r){var o=function(t,e,n,r){var o=Kl(),i=o.clear,u=function(i){o.on((function(o){r.clearBeforeUpdate(e),Nm(i.target,n).each((function(u){Cr(o,u,n).each((function(n){var o=n.boxes.getOr([]);if(1===o.length){var a=o[0],c="false"===Zu(a),s=Ge(Ju(i.target),a,Nt);c&&s&&(r.selectRange(e,o,a,a),t.selectContents(a))}else o.length>1&&(r.selectRange(e,o,n.start,n.finish),t.selectContents(u))}))}))}))};return{clearstate:i,mousedown:function(t){r.clear(e),Nm(t.target,n).each(o.set)},mouseover:function(t){u(t)},mouseup:function(t){u(t),i()}}}(Um(t),e,n,r);return{clearstate:o.clearstate,mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}},$m=function(t,e,n,r){var o=Um(t),i=function(){return r.clear(e),S.none()};return{keydown:function(t,u,a,c,s,l){var f=t.raw,d=f.which,m=!0===f.shiftKey;return Sr(e,r.selectedSelector).fold((function(){return Hm(d)&&m?p(Rm,o,e,n,Bm,c,u,r.selectRange):Lm(d)&&m?p(Rm,o,e,n,Pm,c,u,r.selectRange):Hm(d)?p(Am,o,n,Bm,c,u,zm):Lm(d)?p(Am,o,n,Pm,c,u,Mm):S.none}),(function(t){var n=function(n){return function(){return W(n,(function(n){return function(t,e,n,r,o){return Tr(r,t,e,o.firstSelectedSelector,o.lastSelectedSelector).map((function(t){return o.clearBeforeUpdate(n),o.selectRange(n,t.boxes,t.start,t.finish),t.boxes}))}(n.rows,n.cols,e,t,r)})).fold((function(){return kr(e,r.firstSelectedSelector,r.lastSelectedSelector).map((function(t){var n=Hm(d)||l.isForward(d)?Uf.after:Uf.before;return o.setRelativeSelection(Uf.on(t.first,0),n(t.table)),r.clear(e),Pd(S.none(),!0)}))}),(function(t){return S.some(Pd(S.none(),!0))}))}};return Hm(d)&&m?n([Wm(1,0)]):Lm(d)&&m?n([Wm(-1,0)]):l.isBackward(d)&&m?n([Wm(0,-1),Wm(-1,0)]):l.isForward(d)&&m?n([Wm(0,1),Wm(1,0)]):Vm(d)&&!1===m?i:S.none}))()},keyup:function(t,o,i,u,a){return Sr(e,r.selectedSelector).fold((function(){var c=t.raw,s=c.which;return!1===(!0===c.shiftKey)?S.none():Vm(s)?function(t,e,n,r,o,i,u){return Nt(n,o)&&r===i?S.none():He(n,"td,th",e).bind((function(n){return He(o,"td,th",e).bind((function(r){return Vd(t,e,n,r,u)}))}))}(e,n,o,i,u,a,r.selectRange):S.none()}),S.none)}}},Gm=function(t,e,n){var r=function(e){qe(e,t.selected),qe(e,t.firstSelected),qe(e,t.lastSelected)},o=function(e){Fe(e,t.selected,"1")},i=function(t){u(t),n()},u=function(e){var n=Ae(e,t.selectedSelector);M(n,r)};return{clearBeforeUpdate:u,clear:i,selectRange:function(n,r,u,a){i(n),M(r,o),Fe(u,t.firstSelected,"1"),Fe(a,t.lastSelected,"1"),e(r,u,a)},selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}},Km=function(t,e,n){var r=Hn.fromTable(t);return Fc(r,e).map((function(t){var e=Bc(r,n,!1);return{upOrLeftCells:function(t,e){var n=t.slice(0,e[e.length-1].row+1),r=Pc(n);return L(r,(function(t){var n=t.cells.slice(0,e[e.length-1].column+1);return A(n,(function(t){return t.element}))}))}(e,t),downOrRightCells:function(t,e){var n=t.slice(e[0].row+e[0].rowspan-1,t.length),r=Pc(n);return L(r,(function(t){var n=t.cells.slice(e[0].column+e[0].colspan-1,t.cells.length);return A(n,(function(t){return t.element}))}))}(e,t)}}))},Xm=tinymce.util.Tools.resolve("tinymce.Env"),Ym=function(t){return!1===$u(At.fromDom(t.target),"ephox-snooker-resizer-bar")};function Jm(t,e,n){var r=Gm(Hi,(function(e,r,o){n.targets().each((function(n){bn(r).each((function(i){var u=Xa(t),a=xi(d,At.fromDom(t.getDoc()),u),c=Km(i,n,a);!function(t,e,n,r,o){t.fire("TableSelectionChange",{cells:e,start:n,finish:r,otherCells:o})}(t,e,r,o,c)}))}))}),(function(){return function(t){t.fire("TableSelectionClear")}(t)}));return t.on("init",(function(n){var o=t.getWin(),i=ki(t),u=_i(t),a=qm(o,i,u,r),c=$m(o,i,u,r),s=function(t,e,n,r){var o=Um(t);return function(t,i){r.clearBeforeUpdate(e),Cr(t,i,n).each((function(t){var n=t.boxes.getOr([]);r.selectRange(e,n,t.start,t.finish),o.selectContents(i),o.collapseSelection()}))}}(o,i,u,r);t.on("TableSelectorChange",(function(t){return s(t.start,t.finish)}));var l,f,m=function(e,n){(function(t){return!0===t.raw.shiftKey})(e)&&(n.kill&&e.kill(),n.selection.each((function(e){var n=qf.relative(e.start,e.finish),r=ed(o,n);t.selection.setRng(r)})))},g=function(t){return 0===t.button},h=(l=Zo(At.fromDom(i)),f=Zo(0),{touchEnd:function(t){var e=At.fromDom(t.target);if("td"===ne(e)||"th"===ne(e)){var n=l.get(),r=f.get();Nt(n,e)&&t.timeStamp-r<300&&(t.preventDefault(),s(e,e))}l.set(e),f.set(t.timeStamp)}});t.on("dragstart",(function(t){a.clearstate()})),t.on("mousedown",(function(t){g(t)&&Ym(t)&&a.mousedown(Fu(t))})),t.on("mouseover",(function(t){var e;(void 0===(e=t).buttons||Xm.browser.isEdge()&&0===e.buttons||0!=(1&e.buttons))&&Ym(t)&&a.mouseover(Fu(t))})),t.on("mouseup",(function(t){g(t)&&Ym(t)&&a.mouseup(Fu(t))})),t.on("touchend",h.touchEnd),t.on("keyup",(function(e){var n=Fu(e);if(n.raw.shiftKey&&Vm(n.raw.which)){var r=t.selection.getRng(),o=At.fromDom(r.startContainer),i=At.fromDom(r.endContainer);c.keyup(n,o,r.startOffset,i,r.endOffset).each((function(t){m(n,t)}))}})),t.on("keydown",(function(n){var r=Fu(n);e().each((function(t){return t.hideBars()}));var o=t.selection.getRng(),i=At.fromDom(o.startContainer),u=At.fromDom(o.endContainer),a=Gr(Fm,jm)(At.fromDom(t.selection.getStart()));c.keydown(r,i,o.startOffset,u,o.endOffset,a).each((function(t){m(r,t)})),e().each((function(t){return t.showBars()}))})),t.on("NodeChange",(function(){var e=t.selection,n=At.fromDom(e.getStart()),o=At.fromDom(e.getEnd());wr(bn,[n,o]).fold((function(){return r.clear(i)}),d)}))})),{clear:r.clear}}var Qm=function(t,e){var n=Zo(S.none()),r=Zo([]),o=S.none(),i=le("caption"),u=function(t){return o.forall((function(e){return!e[t]}))},a=function(){return ji(function(t){return At.fromDom(t.selection.getEnd())}(t),_i(t))},c=function(){return ji(zi(t),_i(t)).bind((function(t){return Xe(bn(t),a().bind(bn),(function(n,r){return Nt(n,r)?i(t)?S.some({element:o=t,mergable:S.none(),unmergable:S.none(),selection:[o]}):S.some(Vi(e,n,t)):S.none();var o})).bind(g)}))},s=function(t){return bn(t.element).map((function(e){var n=Hn.fromTable(e),r=Fc(n,t).getOr([]),o=N(r,(function(t,e){return e.isLocked&&(t.onAny=!0,0===e.column?t.onFirst=!0:e.column+e.colspan>=n.grid.columns&&(t.onLast=!0)),t}),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:Wc(n,t).isSome(),unmergeable:qc(n,t).isSome(),locked:o}}))},l=function(){n.set(K(c)()),o=n.get().bind(s),M(r.get(),(function(t){return t()}))},f=function(t){return t(),r.set(r.get().concat([t])),function(){r.set(z(r.get(),(function(e){return e!==t})))}},d=function(t,e){return f((function(){return n.get().fold((function(){t.setDisabled(!0)}),(function(n){t.setDisabled(e(n))}))}))},m=function(t,e,r){return f((function(){return n.get().fold((function(){t.setDisabled(!0),t.setActive(!1)}),(function(n){t.setDisabled(e(n)),t.setActive(r(n))}))}))},h=function(t){return o.exists((function(e){return e.locked[t]}))},p=function(e,n){return function(r){return m(r,(function(t){return i(t.element)}),(function(){return t.queryCommandValue(e)===n}))}},v=p("mceTableRowType","header"),y=p("mceTableColType","th");return t.on("NodeChange ExecCommand TableSelectorChange",l),{onSetupTable:function(t){return d(t,(function(t){return!1}))},onSetupCellOrRow:function(t){return d(t,(function(t){return i(t.element)}))},onSetupColumn:function(t){return function(e){return d(e,(function(e){return i(e.element)||h(t)}))}},onSetupPasteable:function(t){return function(e){return d(e,(function(e){return i(e.element)||t().isNone()}))}},onSetupPasteableColumn:function(t,e){return function(n){return d(n,(function(n){return i(n.element)||t().isNone()||h(e)}))}},onSetupMergeable:function(t){return d(t,(function(t){return u("mergeable")}))},onSetupUnmergeable:function(t){return d(t,(function(t){return u("unmergeable")}))},resetTargets:l,onSetupTableWithCaption:function(e){return m(e,b,(function(e){return bn(e.element,_i(t)).exists((function(t){return Ie(t,"caption").isSome()}))}))},onSetupTableRowHeaders:v,onSetupTableColumnHeaders:y,targets:n.get}},Zm=function(t){var e,n,r,o,i,u=(e=function(){return ki(t)},n=function(){return Ui(zi(t),_i(t))},r=Hi.selectedSelector,{get:function(){return Or(e(),r).fold((function(){return n().fold(Mr,Rr)}),(function(t){return zr(t)}))}}),a=Qm(t,u),c=ac(t),s=Jm(t,c.lazyResize,a),l=bl(t,s,c.lazyWire),f=(o=Kl(),i=Kl(),{getRows:o.get,setRows:function(t){t.fold(o.clear,o.set),i.clear()},clearRows:o.clear,getColumns:i.get,setColumns:function(t){t.fold(i.clear,i.set),o.clear()},clearColumns:i.clear});return Rf(t,l,0,u,f),function(t,e,n){var r=_i(t),o=function(e){return Ui(zi(t)).bind((function(t){return bn(t,r).map((function(r){var o=Vi(n,r,t);return e(r,o)}))})).getOr("")};Vt({mceTableRowType:function(){return o(e.getTableRowType)},mceTableCellType:function(){return o(e.getTableCellType)},mceTableColType:function(){return o(e.getTableColType)}},(function(e,n){return t.addQueryValueHandler(n,e)}))}(t,l,u),qi(t,u,l),function(t,e,n,r){var o=function(e){return function(){return t.execCommand(e)}},i=function(e){t.execCommand("mceInsertTable",!1,{rows:e.numRows,columns:e.numColumns})},u={text:"Table properties",onSetup:n.onSetupTable,onAction:o("mceTableProps")},a={text:"Delete table",icon:"table-delete-table",onSetup:n.onSetupTable,onAction:o("mceTableDelete")};t.ui.registry.addMenuItem("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",onAction:o("mceTableInsertRowBefore"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",onAction:o("mceTableInsertRowAfter"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeleterow",{text:"Delete row",icon:"table-delete-row",onAction:o("mceTableDeleteRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablerowprops",{text:"Row properties",icon:"table-row-properties",onAction:o("mceTableRowProps"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutrow",{text:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopyrow",{text:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addMenuItem("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(r.getRows)});var c={type:"nestedmenuitem",text:"Row",getSubmenuItems:m("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")};t.ui.registry.addMenuItem("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",onAction:o("mceTableInsertColBefore"),onSetup:n.onSetupColumn("onFirst")}),t.ui.registry.addMenuItem("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",onAction:o("mceTableInsertColAfter"),onSetup:n.onSetupColumn("onLast")}),t.ui.registry.addMenuItem("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",onAction:o("mceTableDeleteCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablecutcolumn",{text:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onFirst")}),t.ui.registry.addMenuItem("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onLast")});var s={type:"nestedmenuitem",text:"Column",getSubmenuItems:m("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")};t.ui.registry.addMenuItem("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",onAction:o("mceTableCellProps"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",onAction:o("mceTableMergeCells"),onSetup:n.onSetupMergeable}),t.ui.registry.addMenuItem("tablesplitcells",{text:"Split cell",icon:"table-split-cells",onAction:o("mceTableSplitCells"),onSetup:n.onSetupUnmergeable});var l={type:"nestedmenuitem",text:"Cell",getSubmenuItems:m("tablecellprops tablemergecells tablesplitcells")};!1===function(t){return t.getParam("table_grid",!0,"boolean")}(t)?t.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTable")}):t.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:i}]}}),t.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTable")}),t.ui.registry.addMenuItem("tableprops",u),t.ui.registry.addMenuItem("deletetable",a),t.ui.registry.addNestedMenuItem("row",c),t.ui.registry.addNestedMenuItem("column",s),t.ui.registry.addNestedMenuItem("cell",l),t.ui.registry.addContextMenu("table",{update:function(){return n.resetTargets(),n.targets().fold(m(""),(function(t){return"caption"===ne(t.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}});var f=tf(Va(t));0!==f.length&&t.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:function(){return Ql(t,e,f,"tableclass",(function(e){return t.execCommand("mceTableToggleClass",!1,e)}))},onSetup:n.onSetupTable});var d=tf(Ha(t));0!==d.length&&t.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:function(){return Ql(t,e,d,"tablecellclass",(function(e){return t.execCommand("mceTableCellToggleClass",!1,e)}))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:function(){return Ql(t,e,Bl,"tablecellverticalalign",Zl(t,"vertical-align"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:function(){return Ql(t,e,Ma(t),"tablecellborderwidth",Zl(t,"border-width"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:function(){return Ql(t,e,za(t),"tablecellborderstyle",Zl(t,"border-style"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleMenuItem("tablecaption",{icon:"table-caption",text:"Table caption",onAction:o("mceTableToggleCaption"),onSetup:n.onSetupTableWithCaption}),t.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:function(){return nf(t,Ya(t),"background-color")},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:function(){return nf(t,Ja(t),"border-color")},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleMenuItem("tablerowheader",{text:"Row header",icon:"table-top-header",onAction:rf(t),onSetup:n.onSetupTableRowHeaders}),t.ui.registry.addToggleMenuItem("tablecolheader",{text:"Column header",icon:"table-left-header",onAction:of(t),onSetup:n.onSetupTableColumnHeaders})}(t,u,a,f),function(t,e,n,r){t.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(t){return t("inserttable | cell row column | advtablesort | tableprops deletetable")}});var o=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:o("mceTableProps"),icon:"table",onSetup:n.onSetupTable}),t.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:o("mceTableDelete"),icon:"table-delete-table",onSetup:n.onSetupTable}),t.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:o("mceTableCellProps"),icon:"table-cell-properties",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:o("mceTableMergeCells"),icon:"table-merge-cells",onSetup:n.onSetupMergeable}),t.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:o("mceTableSplitCells"),icon:"table-split-cells",onSetup:n.onSetupUnmergeable}),t.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:o("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:o("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:o("mceTableDeleteRow"),icon:"table-delete-row",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:o("mceTableRowProps"),icon:"table-row-properties",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:o("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:n.onSetupColumn("onFirst")}),t.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:o("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:n.onSetupColumn("onLast")}),t.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:o("mceTableDeleteCol"),icon:"table-delete-column",onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addButton("tablecutcol",{tooltip:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablecopycol",{tooltip:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablepastecolbefore",{tooltip:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onFirst")}),t.ui.registry.addButton("tablepastecolafter",{tooltip:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onLast")}),t.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:o("mceInsertTable"),icon:"table"});var i=tf(Va(t));0!==i.length&&t.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:ef(t,e,i,"tableclass",(function(e){return t.execCommand("mceTableToggleClass",!1,e)})),onSetup:n.onSetupTable});var u=tf(Ha(t));0!==u.length&&t.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:ef(t,e,u,"tablecellclass",(function(e){return t.execCommand("mceTableCellToggleClass",!1,e)})),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:ef(t,e,Bl,"tablecellverticalalign",Zl(t,"vertical-align")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:ef(t,e,Ma(t),"tablecellborderwidth",Zl(t,"border-width")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:ef(t,e,za(t),"tablecellborderstyle",Zl(t,"border-style")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleButton("tablecaption",{tooltip:"Table caption",onAction:o("mceTableToggleCaption"),icon:"table-caption",onSetup:n.onSetupTableWithCaption}),t.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:function(e){return e(nf(t,Ya(t),"background-color"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:function(e){return e(nf(t,Ja(t),"border-color"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleButton("tablerowheader",{tooltip:"Row header",icon:"table-top-header",onAction:rf(t),onSetup:n.onSetupTableRowHeaders}),t.ui.registry.addToggleButton("tablecolheader",{tooltip:"Column header",icon:"table-left-header",onAction:of(t),onSetup:n.onSetupTableColumnHeaders})}(t,u,a,f),function(t){var e=function(t){return t.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol")}(t);e.length>0&&t.ui.registry.addContextToolbar("table",{predicate:function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},items:e,scope:"node",position:"node"})}(t),t.on("PreInit",(function(){t.serializer.addTempAttr(Hi.firstSelected),t.serializer.addTempAttr(Hi.lastSelected),function(t){t.formatter.register(Pf)}(t)})),function(t){return t.getParam("table_tab_navigation",!0,"boolean")}(t)&&t.on("keydown",(function(e){!function(t,e,n){if(t.keyCode===Md.TAB){var r=ki(e),o=function(t){var e=ne(t);return Nt(t,r)||_(Bd,e)},i=e.selection.getRng(),u=At.fromDom(t.shiftKey?i.startContainer:i.endContainer);hn(u,o).each((function(r){t.preventDefault(),bn(r,o).each(n.clear),e.selection.collapse(t.shiftKey),(t.shiftKey?Rd:zd)(e,o,r).each((function(t){e.selection.setRng(t)}))}))}}(e,t,s)})),t.on("remove",(function(){c.destroy()})),function(t,e,n,r){return{insertTable:_l(t),setClipboardRows:Ol(e.setRows),getClipboardRows:Tl(e.getRows),setClipboardCols:Ol(e.setColumns),getClipboardCols:Tl(e.getColumns),resizeHandler:n,selectionTargets:r}}(t,f,c,a)};Nr.add("table",Zm)}(),function(){var t=tinymce.util.Tools.resolve("tinymce.PluginManager");t.add("hr",(function(t){!function(t){t.addCommand("InsertHorizontalRule",(function(){t.execCommand("mceInsertContent",!1,"<hr />")}))}(t),function(t){var e=function(){return t.execCommand("InsertHorizontalRule")};t.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:e}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:e})}(t)}))}(),function(){var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},n=function(t){return function(e){return typeof e===t}},r=e("string"),o=e("object"),i=e("array"),u=n("boolean"),a=n("function"),c=n("number"),s=function(){},l=function(t){return function(){return t}},f=function(t){return t},d=function(t,e){return t===e},m=function(t){return function(e){return!t(e)}},g=l(!1),h=l(!0),p=function(){return v},v=function(){var t=function(t){return t()},e=f;return{fold:function(t,e){return t()},isSome:g,isNone:h,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:e,orThunk:t,map:p,each:s,bind:p,exists:g,forall:h,filter:function(){return p()},toArray:function(){return[]},toString:l("none()")}}(),b=function(t){var e=l(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:h,isNone:g,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return b(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:v},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},y={some:b,none:p,from:function(t){return null==t?v:b(t)}},w=Array.prototype.slice,x=Array.prototype.push,C=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},S=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},k=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},T=function(t,e,n){return S(t,(function(t,r){n=e(n,t,r)})),n},O=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return y.some(i);if(n(i,r))break}return y.none()},_=function(t,e){return O(t,e,g)},E=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!i(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);x.apply(e,t[n])}return e}(C(t,e))},D=function(t){var e=w.call(t,0);return e.reverse(),e},A=function(t,e){return e>=0&&e<t.length?y.some(t[e]):y.none()},M=function(t){return A(t,0)},z=function(t){return A(t,t.length-1)},R=function(){return(R=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};var N,B=function(){return P(0,0)},P=function(t,e){return{major:t,minor:e}},I={nu:P,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?B():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return P(r(1),r(2))}(t,n)},unknown:B},L=function(t,e){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return y.none()}(e.brands,(function(e){var n=e.brand.toLowerCase();return _(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:I.nu(parseInt(e.version,10),0)}}))}))},H=function(t,e){var n=String(e).toLowerCase();return _(t,(function(t){return t.search(n)}))},V=function(t,e){return-1!==t.indexOf(e)},F=(N=/^\s+|\s+$/g,function(t){return t.replace(N,"")}),j=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,U=function(t){return function(e){return V(e,t)}},W=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return V(t,"edge/")&&V(t,"chrome")&&V(t,"safari")&&V(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,j],search:function(t){return V(t,"chrome")&&!V(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return V(t,"msie")||V(t,"trident")}},{name:"Opera",versionRegexes:[j,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:U("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:U("firefox")},{name:"Safari",versionRegexes:[j,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(V(t,"safari")||V(t,"mobile/"))&&V(t,"applewebkit")}}],q=[{name:"Windows",search:U("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return V(t,"iphone")||V(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:U("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:U("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:U("linux"),versionRegexes:[]},{name:"Solaris",search:U("sunos"),versionRegexes:[]},{name:"FreeBSD",search:U("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:U("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],$={browsers:l(W),oses:l(q)},G="Edge",K="Chrome",X="Opera",Y="Firefox",J="Safari",Q=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(G),isChrome:r(K),isIE:r("IE"),isOpera:r(X),isFirefox:r(Y),isSafari:r(J)}},Z={unknown:function(){return Q({current:void 0,version:I.unknown()})},nu:Q,edge:l(G),chrome:l(K),ie:l("IE"),opera:l(X),firefox:l(Y),safari:l(J)},tt="Windows",et="Android",nt="Linux",rt="Solaris",ot="FreeBSD",it="ChromeOS",ut=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(tt),isiOS:r("iOS"),isAndroid:r(et),isOSX:r("OSX"),isLinux:r(nt),isSolaris:r(rt),isFreeBSD:r(ot),isChromeOS:r(it)}},at={unknown:function(){return ut({current:void 0,version:I.unknown()})},nu:ut,windows:l(tt),ios:l("iOS"),android:l(et),linux:l(nt),osx:l("OSX"),solaris:l(rt),freebsd:l(ot),chromeos:l(it)},ct=function(t,e,n){var r=$.browsers(),o=$.oses(),i=e.bind((function(t){return L(r,t)})).orThunk((function(){return function(t,e){return H(t,e).map((function(t){var n=I.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(Z.unknown,Z.nu),u=function(t,e){return H(t,e).map((function(t){var n=I.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(at.unknown,at.nu),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!s&&!c&&!f;return{isiPad:l(o),isiPhone:l(i),isTablet:l(c),isPhone:l(s),isTouch:l(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:l(f),isDesktop:l(d)}}(u,i,t,n);return{browser:i,os:u,deviceType:a}},st=function(t){return window.matchMedia(t).matches},lt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}}((function(){return ct(navigator.userAgent,y.from(navigator.userAgentData),st)})),ft=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},dt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return ft(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return ft(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return ft(n)},fromDom:ft,fromPoint:function(t,e,n){return y.from(t.dom.elementFromPoint(e,n)).map(ft)}},mt=function(t,e){return t.dom===e.dom},gt=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},ht=function(t,e){return lt().browser.isIE()?gt(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},pt=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},vt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),bt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),yt=tinymce.util.Tools.resolve("tinymce.util.VK"),wt=Object.keys,xt=function(t,e){for(var n=wt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Ct=function(t,e){var n={};return function(t,e,n,r){xt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),s),n};"undefined"!=typeof window?window:Function("return this;")();var St,kt=function(t){return t.dom.nodeName.toLowerCase()},Tt=(St=1,function(t){return function(t){return t.dom.nodeType}(t)===St}),Ot=function(t){return function(e){return Tt(e)&&kt(e)===t}},_t=function(t,e){var n=t.dom;xt(e,(function(t,e){!function(t,e,n){if(!(r(n)||u(n)||c(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(n,e,t)}))},Et=function(t){return T(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},Dt=function(t){return y.from(t.dom.parentNode).map(dt.fromDom)},At=function(t){return C(t.dom.childNodes,dt.fromDom)},Mt=function(t,e){var n=t.dom.childNodes;return y.from(n[e]).map(dt.fromDom)},zt=function(t){return Mt(t,0)},Rt=function(t){return Mt(t,t.dom.childNodes.length-1)},Nt=function(t,e){Dt(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Bt=function(t,e){t.dom.appendChild(e.dom)},Pt=function(t,e){S(e,(function(e){Bt(t,e)}))},It=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Lt=function(t){return function(t,e){return dt.fromDom(t.dom.cloneNode(e))}(t,!0)},Ht=function(t,e){var n=function(t,e){var n=dt.fromTag(e),r=Et(t);return _t(n,r),n}(t,e);Nt(t,n);var r=At(t);return Pt(n,r),It(t),n},Vt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Ft=tinymce.util.Tools.resolve("tinymce.util.Tools"),jt=function(t){return function(e){return e&&e.nodeName.toLowerCase()===t}},Ut=function(t){return function(e){return e&&t.test(e.nodeName)}},Wt=function(t){return t&&3===t.nodeType},qt=Ut(/^(OL|UL|DL)$/),$t=Ut(/^(OL|UL)$/),Gt=jt("ol"),Kt=Ut(/^(LI|DT|DD)$/),Xt=Ut(/^(DT|DD)$/),Yt=Ut(/^(TH|TD)$/),Jt=jt("br"),Qt=function(t,e){return e&&!!t.schema.getTextBlockElements()[e.nodeName]},Zt=function(t,e){return t&&t.nodeName in e},te=function(t,e,n){var r=t.isEmpty(e);return!(n&&t.select("span[data-mce-type=bookmark]",e).length>0)&&r},ee=function(t,e){return t.isChildOf(e,t.getRoot())},ne=function(t,e){var n,r,o,i=t.dom,u=t.schema.getBlockElements(),a=i.createFragment(),c=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e}(t);if(c&&((r=i.create(c)).tagName===c.toUpperCase()&&i.setAttribs(r,function(t){return t.getParam("forced_root_block_attrs",{})}(t)),Zt(e.firstChild,u)||a.appendChild(r)),e)for(;n=e.firstChild;){var s=n.nodeName;o||"SPAN"===s&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),Zt(n,u)?(a.appendChild(n),r=null):c?(r||(r=i.create(c),a.appendChild(r)),r.appendChild(n)):a.appendChild(n)}return c?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):a.appendChild(i.create("br")),a},re=Vt.DOM,oe=Ot("dd"),ie=Ot("dt"),ue=function(t,e){oe(e)?Ht(e,"dt"):ie(e)&&Dt(e).each((function(n){return function(t,e,n){var r=re.select('span[data-mce-type="bookmark"]',e),o=ne(t,n),i=re.createRng();i.setStartAfter(n),i.setEndAfter(e);for(var u,a=i.extractContents(),c=a.firstChild;c;c=c.firstChild)if("LI"===c.nodeName&&t.dom.isEmpty(c)){re.remove(c);break}t.dom.isEmpty(a)||re.insertAfter(a,e),re.insertAfter(o,e),te(t.dom,n.parentNode)&&(u=n.parentNode,Ft.each(r,(function(t){u.parentNode.insertBefore(t,n.parentNode)})),re.remove(u)),re.remove(n),te(t.dom,e)&&re.remove(e)}(t,n.dom,e.dom)}))},ae=function(t){ie(t)&&Ht(t,"dd")},ce=function(t,e){if(Wt(t))return{container:t,offset:e};var n=vt.getNode(t,e);return Wt(n)?{container:n,offset:e>=t.childNodes.length?n.data.length:0}:n.previousSibling&&Wt(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&Wt(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:t,offset:e}},se=function(t){var e=t.cloneRange(),n=ce(t.startContainer,t.startOffset);e.setStart(n.container,n.offset);var r=ce(t.endContainer,t.endOffset);return e.setEnd(r.container,r.offset),e},le=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),fe=function(t,e){var n=e||t.selection.getStart(!0);return t.dom.getParent(n,"OL,UL,DL",ge(t,n))},de=function(t){var e=fe(t),n=t.selection.getSelectedBlocks();return function(t,e){return t&&1===e.length&&e[0]===t}(e,n)?function(t){return k(t.querySelectorAll("ol,ul,dl"),qt)}(e):k(n,(function(t){return qt(t)&&e!==t}))},me=function(t){var e=t.selection.getSelectedBlocks();return k(function(t,e){var n=Ft.map(e,(function(e){return t.dom.getParent(e,"li,dd,dt",ge(t,e))||e}));return le.unique(n)}(t,e),Kt)},ge=function(t,e){var n=t.dom.getParents(e,"TD,TH");return n.length>0?n[0]:t.getBody()},he=function(t,e){var n=t.dom.getParents(e,"ol,ul",ge(t,e));return z(n)},pe=function(t){var e=function(t){var e=he(t,t.selection.getStart()),n=k(t.selection.getSelectedBlocks(),$t);return e.toArray().concat(n)}(t);return ve(t,e)},ve=function(t,e){var n=C(e,(function(e){return he(t,e).getOr(e)}));return le.unique(n)},be=function(t,e,n){return void 0===n&&(n=d),t.exists((function(t){return n(t,e)}))},ye=function(t,e,n){return t.isSome()&&e.isSome()?y.some(n(t.getOrDie(),e.getOrDie())):y.none()},we=function(t,e,n){return t.fire("ListMutation",{action:e,element:n})},xe=function(t,e,n){if(!r(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);(function(t){return void 0!==t.style&&a(t.style.getPropertyValue)})(t)&&t.style.setProperty(e,n)},Ce=function(t,e){Bt(t.item,e.list)},Se=function(t,e){var n={list:dt.fromTag(e,t),item:dt.fromTag("li",t)};return Bt(n.list,n.item),n},ke=function(t,e,n){var r=e.slice(0,n.depth);return z(r).each((function(e){!function(t,e){Bt(t.list,e),t.item=e}(e,function(t,e,n){var r=dt.fromTag("li",t);return _t(r,e),Pt(r,n),r}(t,n.itemAttributes,n.content)),function(t,e){kt(t.list)!==e.listType&&(t.list=Ht(t.list,e.listType)),_t(t.list,e.listAttributes)}(e,n)})),r},Te=function(t,e,n){var r,o=function(t,e,n){for(var r=[],o=0;o<n;o++)r.push(Se(t,e.listType));return r}(t,n,n.depth-e.length);return function(t){for(var e=1;e<t.length;e++)Ce(t[e-1],t[e])}(o),function(t,e){for(var n=0;n<t.length-1;n++)r=t[n].item,o="list-style-type",i="none",u=void 0,u=r.dom,xe(u,o,i);var r,o,i,u;z(t).each((function(t){_t(t.list,e.listAttributes),_t(t.item,e.itemAttributes),Pt(t.item,e.content)}))}(o,n),r=o,ye(z(e),M(r),Ce),e.concat(o)},Oe=function(t){return pt(t,"OL,UL")},_e=function(t){return zt(t).exists(Oe)},Ee=function(t){return t.depth>0},De=function(t){return t.isSelected},Ae=function(t){var e=At(t),n=Rt(t).exists(Oe)?e.slice(0,-1):e;return C(n,Lt)},Me=function(t){return S(t,(function(e,n){(function(t,e){var n=t[e].depth,r=function(t){return t.depth===n&&!t.dirty},o=function(t){return t.depth<n};return O(D(t.slice(0,e)),r,o).orThunk((function(){return O(t.slice(e+1),r,o)}))})(t,n).fold((function(){e.dirty&&function(t){t.listAttributes=Ct(t.listAttributes,(function(t,e){return"start"!==e}))}(e)}),(function(t){return r=t,(n=e).listType=r.listType,void(n.listAttributes=R({},r.listAttributes));var n,r}))})),t},ze=function(t,e,n,r){return zt(r).filter(Oe).fold((function(){e.each((function(t){mt(t.start,r)&&n.set(!0)}));var o=function(t,e,n){return Dt(t).filter(Tt).map((function(r){return{depth:e,dirty:!1,isSelected:n,content:Ae(t),itemAttributes:Et(t),listAttributes:Et(r),listType:kt(r)}}))}(r,t,n.get());e.each((function(t){mt(t.end,r)&&n.set(!1)}));var i=Rt(r).filter(Oe).map((function(r){return Re(t,e,n,r)})).getOr([]);return o.toArray().concat(i)}),(function(r){return Re(t,e,n,r)}))},Re=function(t,e,n,r){return E(At(r),(function(r){return(Oe(r)?Re:ze)(t+1,e,n,r)}))},Ne=function(t,e){var n=Me(e);return C(n,(function(e){var n,r,o,i=(n=e.content,o=(r||document).createDocumentFragment(),S(n,(function(t){o.appendChild(t.dom)})),dt.fromDom(o));return dt.fromDom(ne(t,i.dom))}))},Be=function(t,e){var n=Me(e);return function(t,e){var n=T(e,(function(e,n){return n.depth>e.length?Te(t,e,n):ke(t,e,n)}),[]);return M(n).map((function(t){return t.list}))}(t.contentDocument,n).toArray()},Pe=function(t,e,n){var r=function(t,e){var n,r=(n=!1,{get:function(){return n},set:function(t){n=t}});return C(t,(function(t){return{sourceList:t,entries:Re(0,e,r,t)}}))}(e,function(t){var e=C(me(t),dt.fromDom);return ye(_(e,m(_e)),_(D(e),m(_e)),(function(t,e){return{start:t,end:e}}))}(t));S(r,(function(e){!function(t,e){S(k(t,De),(function(t){return function(t,e){switch(t){case"Indent":e.depth++;break;case"Outdent":e.depth--;break;case"Flatten":e.depth=0}e.dirty=!0}(e,t)}))}(e.entries,n);var r,o=function(t,e){return E(function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=e(a);c!==n&&(r.push(o),o=[]),n=c,o.push(a)}return 0!==o.length&&r.push(o),r}(e,Ee),(function(e){return M(e).exists(Ee)?Be(t,e):Ne(t,e)}))}(t,e.entries);S(o,(function(e){we(t,"Indent"===n?"IndentList":"OutdentList",e.dom)})),r=e.sourceList,S(o,(function(t){Nt(r,t)})),It(e.sourceList)}))},Ie=function(t,e){var n=C(pe(t),dt.fromDom),r=C(function(t){return k(me(t),Xt)}(t),dt.fromDom),o=!1;if(n.length||r.length){var i=t.selection.getBookmark();Pe(t,n,e),function(t,e,n){S(n,"Indent"===e?ae:function(e){return ue(t,e)})}(t,e,r),t.selection.moveToBookmark(i),t.selection.setRng(se(t.selection.getRng())),t.nodeChanged(),o=!0}return o},Le=function(t){return Ie(t,"Indent")},He=function(t){return Ie(t,"Outdent")},Ve=function(t){return Ie(t,"Flatten")},Fe=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),je=Vt.DOM,Ue=function(t){var e={},n=function(n){var r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"];if(1===r.nodeType){var i=je.create("span",{"data-mce-type":"bookmark"});r.hasChildNodes()?(o=Math.min(o,r.childNodes.length-1),n?r.insertBefore(i,r.childNodes[o]):je.insertAfter(i,r.childNodes[o])):r.appendChild(i),r=i,o=0}e[n?"startContainer":"endContainer"]=r,e[n?"startOffset":"endOffset"]=o};return n(!0),t.collapsed||n(),e},We=function(t){var e=function(e){var n,r=n=t[e?"startContainer":"endContainer"],o=t[e?"startOffset":"endOffset"];r&&(1===r.nodeType&&(o=function(t){for(var e=t.parentNode.firstChild,n=0;e;){if(e===t)return n;1===e.nodeType&&"bookmark"===e.getAttribute("data-mce-type")||n++,e=e.nextSibling}return-1}(r),r=r.parentNode,je.remove(n),!r.hasChildNodes()&&je.isBlock(r)&&r.appendChild(je.create("br"))),t[e?"startContainer":"endContainer"]=r,t[e?"startOffset":"endOffset"]=o)};e(!0),e();var n=je.createRng();return n.setStart(t.startContainer,t.startOffset),t.endContainer&&n.setEnd(t.endContainer,t.endOffset),se(n)},qe=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},$e=function(t){return/\btox\-/.test(t.className)},Ge=function(t,e,n){var r=function(t){var r=O(t.parents,qt,Yt).filter((function(t){return t.nodeName===e&&!$e(t)})).isSome();n(r)},o=t.dom.getParents(t.selection.getNode());return r({parents:o}),t.on("NodeChange",r),function(){return t.off("NodeChange",r)}},Ke=function(t,e){Ft.each(e,(function(e,n){t.setAttribute(n,e)}))},Xe=function(t,e,n){!function(t,e,n){var r=n["list-style-type"]?n["list-style-type"]:null;t.setStyle(e,"list-style-type",r)}(t,e,n),function(t,e,n){Ke(e,n["list-attributes"]),Ft.each(t.select("li",e),(function(t){Ke(t,n["list-item-attributes"])}))}(t,e,n)},Ye=function(t,e,n,r){var o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"];for(1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&Jt(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Qt(t,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},Je=function(t,e,n){var r=t.selection.getRng(),o="LI",i=ge(t,t.selection.getStart(!0)),u=t.dom;if("false"!==u.getContentEditable(t.selection.getNode())){"DL"===(e=e.toUpperCase())&&(o="DT");var a=Ue(r),c=function(t,e,n){for(var r,o=[],i=t.dom,u=Ye(t,e,!0,n),a=Ye(t,e,!1,n),c=[],s=u;s&&(c.push(s),s!==a);s=s.nextSibling);return Ft.each(c,(function(e){if(Qt(t,e))return o.push(e),void(r=null);if(i.isBlock(e)||Jt(e))return Jt(e)&&i.remove(e),void(r=null);var u=e.nextSibling;Fe.isBookmarkNode(e)&&(qt(u)||Qt(t,u)||!u&&e.parentNode===n)?r=null:(r||(r=i.create("p"),e.parentNode.insertBefore(r,e),o.push(r)),r.appendChild(e))})),o}(t,r,i);Ft.each(c,(function(r){var i,a=r.previousSibling,c=r.parentNode;Kt(c)||(a&&qt(a)&&a.nodeName===e&&function(t,e,n){var r=t.getStyle(e,"list-style-type"),o=n?n["list-style-type"]:"";return r===(null===o?"":o)}(u,a,n)?(i=a,r=u.rename(r,o),a.appendChild(r)):(i=u.create(e),r.parentNode.insertBefore(i,r),i.appendChild(r),r=u.rename(r,o)),function(t,e,n){Ft.each(n,(function(n){var r;return t.setStyle(e,((r={})[n]="",r))}))}(u,r,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),Xe(u,i,n),Ze(t.dom,i))})),t.selection.setRng(We(a))}},Qe=function(t,e,n){return function(t,e){return t&&e&&qt(t)&&t.nodeName===e.nodeName}(e,n)&&function(t,e,n){return t.getStyle(e,"list-style-type",!0)===t.getStyle(n,"list-style-type",!0)}(t,e,n)&&(r=n,e.className===r.className);var r},Ze=function(t,e){var n,r;if(n=e.nextSibling,Qe(t,e,n)){for(;r=n.firstChild;)e.appendChild(r);t.remove(n)}if(n=e.previousSibling,Qe(t,e,n)){for(;r=n.lastChild;)e.insertBefore(r,e.firstChild);t.remove(n)}},tn=function(t,e,n,r,o){var i=qt(e);if(i&&e.nodeName===r&&!en(o))Ve(t);else{Je(t,r,o);var u=Ue(t.selection.getRng()),a=i?function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([e],n):n;Ft.each(a,(function(e){!function(t,e,n,r){if(e.nodeName!==n){var o=t.dom.rename(e,n);Xe(t.dom,o,r),we(t,qe(n),o)}else Xe(t.dom,e,r),we(t,qe(n),e)}(t,e,r,o)})),t.selection.setRng(We(u))}},en=function(t){return"list-style-type"in t},nn=function(t,e,n){var r=fe(t),i=de(t),u=o(n)?n:{};i.length>0?tn(t,r,i,e,u):function(t,e,n,r){if(e!==t.getBody())if(e)if(e.nodeName!==n||en(r)||$e(e)){var o=Ue(t.selection.getRng());Xe(t.dom,e,r);var i=t.dom.rename(e,n);Ze(t.dom,i),t.selection.setRng(We(o)),Je(t,n,r),we(t,qe(n),i)}else Ve(t);else Je(t,n,r),we(t,qe(n),e)}(t,r,e,u)},rn=Vt.DOM,on=function(t,e){var n=Ft.grep(t.select("ol,ul",e));Ft.each(n,(function(e){!function(t,e){var n,r=e.parentNode;"LI"===r.nodeName&&r.firstChild===e&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(e),te(t,r)&&rn.remove(r)):rn.setStyle(r,"listStyleType","none")),qt(r)&&(n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(e)}(t,e)}))},un=function(t,e,n,r){var o=e.startContainer,i=e.startOffset;if(Wt(o)&&(n?i<o.data.length:i>0))return o;var u=t.schema.getNonEmptyElements();1===o.nodeType&&(o=vt.getNode(o,i));var a=new bt(o,r);for(n&&function(t,e){return!!Jt(e)&&t.isBlock(e.nextSibling)&&!Jt(e.previousSibling)}(t.dom,o)&&a.next();o=a[n?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if(Wt(o)&&o.data.length>0)return o}},an=function(t,e){var n=e.childNodes;return 1===n.length&&!qt(n[0])&&t.isBlock(n[0])},cn=function(t,e,n){var r,o=an(t,n)?n.firstChild:n;if(function(t,e){an(t,e)&&t.remove(e.firstChild,!0)}(t,e),!te(t,e,!0))for(;r=e.firstChild;)o.appendChild(r)},sn=function(t,e,n){var r,o=e.parentNode;if(ee(t,e)&&ee(t,n)){qt(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&Jt(o.previousSibling)&&t.remove(o.previousSibling);var i=n.lastChild;i&&Jt(i)&&e.hasChildNodes()&&t.remove(i),te(t,n,!0)&&t.$(n).empty(),cn(t,e,n),r&&n.appendChild(r);var u=ht(dt.fromDom(n),dt.fromDom(e))?t.getParents(e,qt,n):[];t.remove(e),S(u,(function(e){te(t,e)&&e!==t.getRoot()&&t.remove(e)}))}},ln=function(t,e,n,r){var o=t.dom;if(o.isEmpty(r))!function(t,e,n){t.dom.$(n).empty(),sn(t.dom,e,n),t.selection.setCursorLocation(n,0)}(t,n,r);else{var i=Ue(e);sn(o,n,r),t.selection.setRng(We(i))}},fn=function(t,e){var n=t.dom,r=t.selection,o=r.getStart(),i=ge(t,o),u=n.getParent(r.getStart(),"LI",i);if(u){var a=u.parentNode;if(a===t.getBody()&&te(n,a))return!0;var c=se(r.getRng()),s=n.getParent(un(t,c,e,i),"LI",i);if(s&&s!==u)return t.undoManager.transact((function(){var n;e?ln(t,c,s,u):(n=u).parentNode.firstChild===n?He(t):function(t,e,n,r){var o=Ue(e);sn(t.dom,n,r);var i=We(o);t.selection.setRng(i)}(t,c,u,s)})),!0;if(!s&&!e&&0===c.startOffset&&0===c.endOffset)return t.undoManager.transact((function(){Ve(t)})),!0}return!1},dn=function(t,e){return fn(t,e)||function(t,e){var n=t.dom,r=t.selection.getStart(),o=ge(t,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var u=se(t.selection.getRng()),a=n.getParent(un(t,u,e,o),"LI",o);if(a)return t.undoManager.transact((function(){!function(t,e,n){var r=t.getParent(e.parentNode,t.isBlock,n);t.remove(e),r&&t.isEmpty(r)&&t.remove(r)}(n,i,o),Ze(n,a.parentNode),t.selection.select(a,!0),t.selection.collapse(e)})),!0}return!1}(t,e)},mn=function(t,e){return t.selection.isCollapsed()?dn(t,e):function(t){var e=t.selection.getStart(),n=ge(t,e);return!!(t.dom.getParent(e,"LI,DT,DD",n)||me(t).length>0)&&(t.undoManager.transact((function(){t.execCommand("Delete"),on(t.dom,t.getBody())})),!0)}(t)},gn=function(t){var e=D(F(t).split("")),n=C(e,(function(t,e){var n=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,e)*n}));return T(n,(function(t,e){return t+e}),0)},hn=function(t){if(--t<0)return"";var e=t%26,n=Math.floor(t/26);return hn(n)+String.fromCharCode("A".charCodeAt(0)+e)},pn=function(t){var e,n,r=fe(t);Gt(r)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:(e={start:t.dom.getAttrib(r,"start","1"),listStyleType:y.some(t.dom.getStyle(r,"list-style-type"))},n=parseInt(e.start,10),be(e.listStyleType,"upper-alpha")?hn(n):be(e.listStyleType,"lower-alpha")?hn(n).toLowerCase():e.start)},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){(function(t){switch(function(t){return/^[0-9]+$/.test(t)?2:/^[A-Z]+$/.test(t)?0:function(t){return/^[a-z]+$/.test(t)}(t)?1:t.length>0?4:3}(t)){case 2:return y.some({listStyleType:y.none(),start:t});case 0:return y.some({listStyleType:y.some("upper-alpha"),start:gn(t).toString()});case 1:return y.some({listStyleType:y.some("lower-alpha"),start:gn(t).toString()});case 3:return y.some({listStyleType:y.none(),start:""});case 4:return y.none()}})(e.getData().start).each((function(e){t.execCommand("mceListUpdate",!1,{attrs:{start:"1"===e.start?"":e.start},styles:{"list-style-type":e.listStyleType.getOr("")}})})),e.close()}})},vn=function(t,e){return function(){var n=fe(t);return n&&n.nodeName===e}},bn=function(t){t.addCommand("mceListProps",(function(){pn(t)}))},yn=function(t){t.on("BeforeExecCommand",(function(e){var n=e.command.toLowerCase();"indent"===n?Le(t):"outdent"===n&&He(t)})),t.addCommand("InsertUnorderedList",(function(e,n){nn(t,"UL",n)})),t.addCommand("InsertOrderedList",(function(e,n){nn(t,"OL",n)})),t.addCommand("InsertDefinitionList",(function(e,n){nn(t,"DL",n)})),t.addCommand("RemoveList",(function(){Ve(t)})),bn(t),t.addCommand("mceListUpdate",(function(e,n){o(n)&&function(t,e){var n=fe(t);t.undoManager.transact((function(){o(e.styles)&&t.dom.setStyles(n,e.styles),o(e.attrs)&&xt(e.attrs,(function(e,r){return t.dom.setAttrib(n,r,e)}))}))}(t,n)})),t.addQueryStateHandler("InsertUnorderedList",vn(t,"UL")),t.addQueryStateHandler("InsertOrderedList",vn(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",vn(t,"DL"))},wn=function(t){(function(t){return t.getParam("lists_indent_on_tab",!0)})(t)&&function(t){t.on("keydown",(function(e){e.keyCode!==yt.TAB||yt.metaKeyPressed(e)||t.undoManager.transact((function(){(e.shiftKey?He(t):Le(t))&&e.preventDefault()}))}))}(t),function(t){t.on("keydown",(function(e){e.keyCode===yt.BACKSPACE?mn(t,!1)&&e.preventDefault():e.keyCode===yt.DELETE&&mn(t,!0)&&e.preventDefault()}))}(t)};t.add("lists",(function(t){return!1===t.hasPlugin("rtc",!0)?(wn(t),yn(t)):bn(t),function(t){var e=function(e){return function(){return t.execCommand(e)}};t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:function(e){return Ge(t,"OL",e.setActive)}}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:function(e){return Ge(t,"UL",e.setActive)}}))}(t),function(t){var e={text:"List properties...",icon:"ordered-list",onAction:function(){return t.execCommand("mceListProps")},onSetup:function(e){return Ge(t,"OL",(function(t){return e.setDisabled(!t)}))}};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:function(e){var n=fe(t,e);return Gt(n)?["listprops"]:[]}})}(t),function(t){return{backspaceDelete:function(e){mn(t,e)}}}(t)}))}(),function(){var t,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(){return(n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},r=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},o=function(t){return function(e){return typeof e===t}},i=r("string"),u=r("object"),a=r("array"),c=(t=null,function(e){return t===e}),s=o("boolean"),l=function(t){return!function(t){return null==t}(t)},f=o("function"),d=o("number"),m=function(){},g=function(t){return function(){return t}},h=function(t){return t},p=g(!1),v=g(!0),b=function(){return y},y=function(){var t=function(t){return t()},e=h;return{fold:function(t,e){return t()},isSome:p,isNone:v,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:g(null),getOrUndefined:g(void 0),or:e,orThunk:t,map:b,each:m,bind:b,exists:p,forall:v,filter:function(){return b()},toArray:function(){return[]},toString:g("none()")}}(),w=function(t){var e=g(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=Object.keys,S=Object.hasOwnProperty,k=function(t,e,n,r){return function(t,e){for(var n=C(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},T=function(t,e){return S.call(t,e)},O=Array.prototype.push,_=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!a(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);O.apply(e,t[n])}return e},E=function(t){return function(t,e){return e>=0&&e<t.length?x.some(t[e]):x.none()}(t,0)};"undefined"!=typeof window?window:Function("return this;")();var D,A=function(t,e,n){!function(t,e,n){if(!(i(n)||s(n)||d(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)},M=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},z={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return M(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return M(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return M(n)},fromDom:M,fromPoint:function(t,e,n){return x.from(t.dom.elementFromPoint(e,n)).map(M)}},R=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),N=tinymce.util.Tools.resolve("tinymce.util.Promise"),B=tinymce.util.Tools.resolve("tinymce.util.XHR"),P=function(t){return t.getParam("image_dimensions",!0,"boolean")},I=function(t,e){return Math.max(parseInt(t,10),parseInt(e,10))},L=function(t){return t&&(t=t.replace(/px$/,"")),t},H=function(t){return t.length>0&&/^[0-9]+$/.test(t)&&(t+="px"),t},V=function(t){if(t.margin){var e=String(t.margin).split(" ");switch(e.length){case 1:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[0],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[0];break;case 2:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[1];break;case 3:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[1];break;case 4:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[3]}delete t.margin}return t},F=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},j=R.DOM,U=function(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?L(t.style.marginLeft):""},W=function(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?L(t.style.marginTop):""},q=function(t){return t.style.borderWidth?L(t.style.borderWidth):""},$=function(t,e){return t.hasAttribute(e)?t.getAttribute(e):""},G=function(t,e){return t.style[e]?t.style[e]:""},K=function(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName},X=function(t,e,n){""===n?t.removeAttribute(e):t.setAttribute(e,n)},Y=function(t){K(t)?function(t){var e=t.parentNode;j.insertAfter(t,e),j.remove(e)}(t):function(t){var e=j.create("figure",{class:"image"});j.insertAfter(e,t),e.appendChild(t),e.appendChild(j.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false"}(t)},J=function(t,e){var n=t.getAttribute("style"),r=e(null!==n?n:"");r.length>0?(t.setAttribute("style",r),t.setAttribute("data-mce-style",r)):t.removeAttribute("style")},Q=function(t,e){return function(t,n,r){t.style[n]?(t.style[n]=H(r),J(t,e)):X(t,n,r)}},Z=function(t,e){return t.style[e]?L(t.style[e]):$(t,e)},tt=function(t,e){var n=H(e);t.style.marginLeft=n,t.style.marginRight=n},et=function(t,e){var n=H(e);t.style.marginTop=n,t.style.marginBottom=n},nt=function(t,e){var n=H(e);t.style.borderWidth=n},rt=function(t,e){t.style.borderStyle=e},ot=function(t){return"FIGURE"===t.nodeName},it=function(t){return 0===j.getAttrib(t,"alt").length&&"presentation"===j.getAttrib(t,"role")},ut=function(t){return it(t)?"":$(t,"alt")},at=function(t,e){var n=document.createElement("img");return X(n,"style",e.style),(U(n)||""!==e.hspace)&&tt(n,e.hspace),(W(n)||""!==e.vspace)&&et(n,e.vspace),(q(n)||""!==e.border)&&nt(n,e.border),(function(t){return G(t,"borderStyle")}(n)||""!==e.borderStyle)&&rt(n,e.borderStyle),t(n.getAttribute("style"))},ct=function(t,e){return{src:$(e,"src"),alt:ut(e),title:$(e,"title"),width:Z(e,"width"),height:Z(e,"height"),class:$(e,"class"),style:t($(e,"style")),caption:K(e),hspace:U(e),vspace:W(e),border:q(e),borderStyle:G(e,"borderStyle"),isDecorative:it(e)}},st=function(t,e,n,r,o){n[r]!==e[r]&&o(t,r,n[r])},lt=function(t,e,n){if(n){j.setAttrib(t,"role","presentation");var r=z.fromDom(t);A(r,"alt","")}else{if(c(e)){r=z.fromDom(t);o="alt",r.dom.removeAttribute(o)}else{r=z.fromDom(t);A(r,"alt",e)}"presentation"===j.getAttrib(t,"role")&&j.setAttrib(t,"role","")}var o},ft=function(t,e){return function(n,r,o){t(n,o),J(n,e)}},dt=function(t,e,n){var r=ct(t,n);st(n,r,e,"caption",(function(t,e,n){return Y(t)})),st(n,r,e,"src",X),st(n,r,e,"title",X),st(n,r,e,"width",Q(0,t)),st(n,r,e,"height",Q(0,t)),st(n,r,e,"class",X),st(n,r,e,"style",ft((function(t,e){return X(t,"style",e)}),t)),st(n,r,e,"hspace",ft(tt,t)),st(n,r,e,"vspace",ft(et,t)),st(n,r,e,"border",ft(nt,t)),st(n,r,e,"borderStyle",ft(rt,t)),function(t,e,n){n.alt===e.alt&&n.isDecorative===e.isDecorative||lt(t,n.alt,n.isDecorative)}(n,r,e)},mt=function(t,e){var n=t.dom.styles.parse(e),r=V(n),o=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(o)},gt=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return n?t.dom.select("img",n)[0]:e&&("IMG"!==e.nodeName||F(e))?null:e},ht=function(t,e){var n=t.dom,r=function(t,e){var n,r={};return k(t,e,(n=r,function(t,e){n[e]=t}),m),r}(t.schema.getTextBlockElements(),(function(e,n){return!t.schema.isValidChild(n,"figure")})),o=n.getParent(e.parentNode,(function(t){return e=r,n=t.nodeName,T(e,n)&&void 0!==e[n]&&null!==e[n];var e,n}),t.getBody());return o?n.split(o,e):e},pt=function(t,e){var r=function(t,e){var r=document.createElement("img");if(dt(t,n(n({},e),{caption:!1}),r),lt(r,e.alt,e.isDecorative),e.caption){var o=j.create("figure",{class:"image"});return o.appendChild(r),o.appendChild(j.create("figcaption",{contentEditable:"true"},"Caption")),o.contentEditable="false",o}return r}((function(e){return mt(t,e)}),e);t.dom.setAttrib(r,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(r.outerHTML);var o=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(o,"data-mce-id",null),ot(o)){var i=ht(t,o);t.selection.select(i)}else t.selection.select(o)},vt=function(t,e){var n=gt(t);if(dt((function(e){return mt(t,e)}),e,n),function(t,e){t.dom.setAttrib(e,"src",e.getAttribute("src"))}(t,n),ot(n.parentNode)){var r=n.parentNode;ht(t,r),t.selection.select(n.parentNode)}else t.selection.select(n),function(t,e,n){var r=function(){n.onload=n.onerror=null,t.selection&&(t.selection.select(n),t.nodeChanged())};n.onload=function(){e.width||e.height||!P(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r}(t,e,n)},bt=(D=function(t,e){return u(t)&&u(e)?bt(t,e):e},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)T(o,i)&&(n[i]=D(n[i],o[i]))}return n}),yt=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),wt=tinymce.util.Tools.resolve("tinymce.util.Tools"),xt=function(t){return i(t.value)?t.value:""},Ct=function(t,e){var n=[];return wt.each(t,(function(t){var r=function(t){return i(t.text)?t.text:i(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=Ct(t.menu,e);n.push({text:r,items:o})}else{var u=e(t);n.push({text:r,value:u})}})),n},St=function(t){return void 0===t&&(t=xt),function(e){return e?x.from(e).map((function(e){return Ct(e,t)})):x.none()}},kt=function(t,e){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()}(t,(function(t){return function(t){return T(t,"items")}(t)?kt(t.items,e):t.value===e?x.some(t):x.none()}))},Tt=St,Ot=function(t){return St(xt)(t)},_t=function(t,e){return t.bind((function(t){return kt(t,e)}))},Et=function(t){return{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}},Dt=function(t){var e=Tt((function(e){return t.convertURL(e.value||e.url,"src")})),n=new N((function(n){!function(t,e){var n=function(t){return t.getParam("image_list",!1)}(t);i(n)?B.send({url:n,success:function(t){e(JSON.parse(t))}}):f(n)?n(e):e(n)}(t,(function(t){n(e(t).map((function(t){return _([[{text:"None",value:""}],t])})))}))})),r=Ot(function(t){return t.getParam("image_class_list")}(t)),o=function(t){return t.getParam("image_advtab",!1,"boolean")}(t),u=function(t){return t.getParam("image_uploadtab",!0,"boolean")}(t),a=function(t){return l(t.getParam("images_upload_url"))}(t),c=function(t){return l(t.getParam("images_upload_handler"))}(t),s=function(t){var e=gt(t);return e?ct((function(e){return mt(t,e)}),e):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}}(t),d=function(t){return t.getParam("image_description",!0,"boolean")}(t),m=function(t){return t.getParam("image_title",!1,"boolean")}(t),g=P(t),h=function(t){return t.getParam("image_caption",!1,"boolean")}(t),p=function(t){return t.getParam("a11y_advanced_options",!1,"boolean")}(t),v=function(t){return t.getParam("automatic_uploads",!0,"boolean")}(t),b=x.some(function(t){return t.getParam("image_prepend_url","","string")}(t)).filter((function(t){return i(t)&&t.length>0}));return n.then((function(t){return{image:s,imageList:t,classList:r,hasAdvTab:o,hasUploadTab:u,hasUploadUrl:a,hasUploadHandler:c,hasDescription:d,hasImageTitle:m,hasDimensions:g,hasImageCaption:h,prependURL:b,hasAccessibilityOptions:p,automaticUploads:v}}))},At=function(t){var e,r=t.imageList.map((function(t){return{name:"images",type:"listbox",label:"Image list",items:t}})),o={name:"alt",type:"input",label:"Alternative description",disabled:t.hasAccessibilityOptions&&t.image.isDecorative},i=t.classList.map((function(t){return{name:"classes",type:"listbox",label:"Class",items:t}}));return _([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],r.toArray(),t.hasAccessibilityOptions&&t.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],t.hasDescription?[o]:[],t.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],t.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[n(n({},(e=t.classList.isSome()&&t.hasImageCaption,e?{type:"grid",columns:2}:{type:"panel"})),{items:_([i.toArray(),t.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])})]])},Mt=function(t){return{title:"General",name:"general",items:At(t)}},zt=At,Rt=function(t){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}},Nt=function(t){return{src:{value:t.src,meta:{}},images:t.src,alt:t.alt,title:t.title,dimensions:{width:t.width,height:t.height},classes:t.class,caption:t.caption,style:t.style,vspace:t.vspace,border:t.border,hspace:t.hspace,borderstyle:t.borderStyle,fileinput:[],isDecorative:t.isDecorative}},Bt=function(t,e){return{src:t.src.value,alt:0===t.alt.length&&e?null:t.alt,title:t.title,width:t.dimensions.width,height:t.dimensions.height,class:t.classes,style:t.style,caption:t.caption,hspace:t.hspace,vspace:t.vspace,border:t.border,borderStyle:t.borderstyle,isDecorative:t.isDecorative}},Pt=function(t,e){var n=e.getData();(function(t,e){return/^(?:[a-zA-Z]+:)?\/\//.test(e)?x.none():t.prependURL.bind((function(t){return e.substring(0,t.length)!==t?x.some(t+e):x.none()}))})(t,n.src.value).each((function(t){e.setData({src:{value:t,meta:n.src.meta}})}))},It=function(t,e){var n=e.getData(),r=n.src.meta;if(void 0!==r){var o=bt({},n);!function(t,e,n){t.hasDescription&&i(n.alt)&&(e.alt=n.alt),t.hasAccessibilityOptions&&(e.isDecorative=n.isDecorative||e.isDecorative||!1),t.hasImageTitle&&i(n.title)&&(e.title=n.title),t.hasDimensions&&(i(n.width)&&(e.dimensions.width=n.width),i(n.height)&&(e.dimensions.height=n.height)),i(n.class)&&_t(t.classList,n.class).each((function(t){e.classes=t.value})),t.hasImageCaption&&s(n.caption)&&(e.caption=n.caption),t.hasAdvTab&&(i(n.style)&&(e.style=n.style),i(n.vspace)&&(e.vspace=n.vspace),i(n.border)&&(e.border=n.border),i(n.hspace)&&(e.hspace=n.hspace),i(n.borderstyle)&&(e.borderstyle=n.borderstyle))}(t,o,r),e.setData(o)}},Lt=function(t,e,n,r){Pt(e,r),It(e,r),function(t,e,n,r){var o=r.getData(),i=o.src.value,u=o.src.meta||{};u.width||u.height||!e.hasDimensions||(i.length>0?t.imageSize(i).then((function(t){n.open&&r.setData({dimensions:t})})).catch((function(t){return console.error(t)})):r.setData({dimensions:{width:"",height:""}}))}(t,e,n,r),function(t,e,n){var r=n.getData(),o=_t(t.imageList,r.src.value);e.prevImage=o,n.setData({images:o.map((function(t){return t.value})).getOr("")})}(e,n,r)},Ht=function(t,e,n){var r=V(t(n.style)),o=bt({},n);return o.vspace=function(t){return t["margin-top"]&&t["margin-bottom"]&&t["margin-top"]===t["margin-bottom"]?L(String(t["margin-top"])):""}(r),o.hspace=function(t){return t["margin-right"]&&t["margin-left"]&&t["margin-right"]===t["margin-left"]?L(String(t["margin-right"])):""}(r),o.border=function(t){return t["border-width"]?L(String(t["border-width"])):""}(r),o.borderstyle=function(t){return t["border-style"]?String(t["border-style"]):""}(r),o.style=function(t,e,n){return e(t(e(n)))}(t,e,r),o},Vt=function(t,e,n,r){var o=r.getData();r.block("Uploading image"),E(o.fileinput).fold((function(){r.unblock()}),(function(o){var i,u=URL.createObjectURL(o),a=function(){r.unblock(),URL.revokeObjectURL(u)},c=function(o){r.setData({src:{value:o,meta:{}}}),r.showTab("general"),Lt(t,e,n,r)};(i=o,new N((function(t,e){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(){e(n.error.message)},n.readAsDataURL(i)}))).then((function(n){var i=t.createBlobCache(o,u,n);e.automaticUploads?t.uploadImage(i).then((function(t){c(t.url),a()})).catch((function(e){a(),t.alertErr(e)})):(t.addToBlobCache(i),c(i.blobUri()),r.unblock())}))}))},Ft=function(t,e,n){return function(r,o){"src"===o.name?Lt(t,e,n,r):"images"===o.name?function(t,e,n,r){var o=r.getData(),i=_t(e.imageList,o.images);i.each((function(t){""===o.alt||n.prevImage.map((function(t){return t.text===o.alt})).getOr(!1)?""===t.value?r.setData({src:t,alt:n.prevAlt}):r.setData({src:t,alt:t.text}):r.setData({src:t})})),n.prevImage=i,Lt(t,e,n,r)}(t,e,n,r):"alt"===o.name?n.prevAlt=r.getData().alt:"style"===o.name?function(t,e){var n=e.getData(),r=Ht(t.parseStyle,t.serializeStyle,n);e.setData(r)}(t,r):"vspace"===o.name||"hspace"===o.name||"border"===o.name||"borderstyle"===o.name?function(t,e,n){var r=bt(Nt(e.image),n.getData()),o=at(t.normalizeCss,Bt(r,!1));n.setData({style:o})}(t,e,r):"fileinput"===o.name?Vt(t,e,n,r):"isDecorative"===o.name&&(r.getData().isDecorative?r.disable("alt"):r.enable("alt"))}},jt=function(t){return function(){t.open=!1}},Ut=function(t){return t.hasAdvTab||t.hasUploadUrl||t.hasUploadHandler?{type:"tabpanel",tabs:_([[Mt(t)],t.hasAdvTab?[Et(t)]:[],t.hasUploadTab&&(t.hasUploadUrl||t.hasUploadHandler)?[Rt(t)]:[]])}:{type:"panel",items:zt(t)}},Wt=function(t){return function(e){var n=function(t){return{prevImage:_t(t.imageList,t.image.src),prevAlt:t.image.alt,open:!0}}(e);return{title:"Insert/Edit Image",size:"normal",body:Ut(e),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Nt(e.image),onSubmit:t.onSubmit(e),onChange:Ft(t,e,n),onClose:jt(n)}}},qt=function(t){return function(e){return function(n){var r=bt(Nt(e.image),n.getData());t.execCommand("mceUpdateImage",!1,Bt(r,e.hasAccessibilityOptions)),t.editorUpload.uploadImagesAuto(),n.close()}}},$t=function(t){return function(e){return function(t){return new N((function(e){var n=document.createElement("img"),r=function(t){n.onload=n.onerror=null,n.parentNode&&n.parentNode.removeChild(n),e(t)};n.onload=function(){var t={width:I(n.width,n.clientWidth),height:I(n.height,n.clientHeight)};r(N.resolve(t))},n.onerror=function(){r(N.reject("Failed to get image dimensions for: "+t))};var o=n.style;o.visibility="hidden",o.position="fixed",o.bottom=o.left="0px",o.width=o.height="auto",document.body.appendChild(n),n.src=t}))}(t.documentBaseURI.toAbsolute(e)).then((function(t){return{width:String(t.width),height:String(t.height)}}))}},Gt=function(t){return function(e,n,r){return t.editorUpload.blobCache.create({blob:e,blobUri:n,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,filename:e.name,base64:r.split(",")[1]})}},Kt=function(t){return function(e){t.editorUpload.blobCache.add(e)}},Xt=function(t){return function(e){t.windowManager.alert(e)}},Yt=function(t){return function(e){return mt(t,e)}},Jt=function(t){return function(e){return t.dom.parseStyle(e)}},Qt=function(t){return function(e,n){return t.dom.serializeStyle(e,n)}},Zt=function(t){return function(e){return yt(t).upload([e],!1).then((function(t){return 0===t.length?N.reject("Failed to upload image"):!1===t[0].status?N.reject(t[0].error.message):t[0]}))}},te=function(t){var e={onSubmit:qt(t),imageSize:$t(t),addToBlobCache:Kt(t),createBlobCache:Gt(t),alertErr:Xt(t),normalizeCss:Yt(t),parseStyle:Jt(t),serializeStyle:Qt(t),uploadImage:Zt(t)};return{open:function(){Dt(t).then(Wt(e)).then(t.windowManager.open)}}},ee=function(t){t.addCommand("mceImage",te(t).open),t.addCommand("mceUpdateImage",(function(e,r){t.undoManager.transact((function(){return function(t,e){var r=gt(t);if(r){var o=ct((function(e){return mt(t,e)}),r),i=n(n({},o),e);i.src?vt(t,i):function(t,e){if(e){var n=t.dom.is(e.parentNode,"figure.image")?e.parentNode:e;t.dom.remove(n),t.focus(),t.nodeChanged(),t.dom.isEmpty(t.getBody())&&(t.setContent(""),t.selection.setCursorLocation())}}(t,r)}else e.src&&pt(t,n(n({},{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),e))}(t,r)}))}))},ne=function(t){var e=t.attr("class");return e&&/\bimage\b/.test(e)},re=function(t){return function(e){for(var n=e.length,r=function(e){e.attr("contenteditable",t?"true":null)};n--;){var o=e[n];ne(o)&&(o.attr("contenteditable",t?"false":null),wt.each(o.getAll("figcaption"),r))}}};e.add("image",(function(t){!function(t){t.on("PreInit",(function(){t.parser.addNodeFilter("figure",re(!0)),t.serializer.addNodeFilter("figure",re(!1))}))}(t),function(t){t.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:te(t).open,onSetup:function(e){return t.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),t.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:te(t).open}),t.ui.registry.addContextMenu("image",{update:function(t){return ot(t)||"IMG"===t.nodeName&&!F(t)?["image"]:[]}})}(t),ee(t)}))}(),function(){var t,e=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=(t="array",function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}),i=function(t){return!function(t){return null==t}(t)},u=function(t){return function(e){return typeof e===t}}("function"),a=function(){},c=function(t){return function(){return t}},s=function(t){return t},l=c(!1),f=c(!0),d=function(){return m},m=function(){var t=function(t){return t()},e=s;return{fold:function(t,e){return t()},isSome:l,isNone:f,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:c(null),getOrUndefined:c(void 0),or:e,orThunk:t,map:d,each:a,bind:d,exists:l,forall:f,filter:function(){return d()},toArray:function(){return[]},toString:c("none()")}}(),g=function(t){var e=c(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:f,isNone:l,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return g(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:m},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},h={some:g,none:d,from:function(t){return null==t?m:g(t)}},p=function(t,e){return y(document.createElement("canvas"),t,e)},v=function(t){var e=p(t.width,t.height);return b(e).drawImage(t,0,0),e},b=function(t){return t.getContext("2d")},y=function(t,e,n){return t.width=e,t.height=n,t},w=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(u,this),r(a,this))},e=window,n=t.immediateFn||"function"==typeof e.setImmediate&&e.setImmediate||function(t){return setTimeout(t,1)},r=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.apply(e,n)}},o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(o){return void t.reject(o)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void l(r(e,t),r(u,this),r(a,this))}this._state=!0,this._value=t,c.call(this)}catch(n){a.call(this,n)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function s(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}var l=function(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(o){if(r)return;r=!0,n(o)}};return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new s(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(t,e){if(0===r.length)return t([]);for(var n=r.length,o=function(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),e)}r[i]=u,0==--n&&t(r)}catch(c){e(c)}},i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++){o[r].then(t,n)}}))},t}(),x=function(t){return new w((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)},u=function(){i(),e(o)},a=function(){i(),n("Unable to load data of type "+t.type+": "+r)};o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&setTimeout(u,0)}))},C=function(t){return new w((function(e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="blob",r.onload=function(){200===this.status&&e(this.response)},r.onerror=function(){var t,e=this;n(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+e.status+" downloading image"))},r.send()}))},S=function(t){return new w((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return h.none();for(var r=n[1],o=e[1],i=1024,u=atob(o),a=u.length,c=Math.ceil(a/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,d=Math.min(f+i,a),m=new Array(d-f),g=f,p=0;g<d;++p,++g)m[p]=u[g].charCodeAt(0);s[l]=new Uint8Array(m)}return h.some(new Blob(s,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))},k=function(t,e,n){return e=e||"image/png",u(HTMLCanvasElement.prototype.toBlob)?new w((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):S(t.toDataURL(e,n))},T=function(t){URL.revokeObjectURL(t.src)},O=function(t){return function(t){var e=t.src;return 0===e.indexOf("data:")?S(e):C(e)}(t)},_=Array.prototype.indexOf,E=function(t,e){return n=t,r=e,_.call(n,r)>-1;var n,r},D=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},A=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return h.some(i);if(n(i,r))break}return h.none()}(t,e,l)},M=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},z=Object.keys;(function(t){if(!o(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};D(t,(function(r,i){var u=z(r);if(1!==u.length)throw new Error("one and only one name per case");var a=u[0],c=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!o(c))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=n.length;if(o!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+o);var u=function(t){var r=z(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!M(e,(function(t){return E(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var o=e[i];return o.apply(null,n)},match:u,log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}}))})([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var R=function(t,e,n){var r=e.type,o=c(r),i=c(n),u=function(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))};return{getType:o,toBlob:function(){return w.resolve(e)},toDataURL:i,toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return k(t,e,n)}))},toAdjustedDataURL:u,toAdjustedBase64:function(t,e){return u(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(v)}}},N=function(t){return function(t){return new w((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return R(function(t){return x(t).then((function(t){T(t);var e=p(function(t){return t.naturalWidth||t.width}(t),function(t){return t.naturalHeight||t.height}(t));return b(e).drawImage(t,0,0),e}))}(t),t,e)}))},B=function(t,e){return k(t,e).then((function(e){return R(w.resolve(t),e,t.toDataURL())}))},P=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},I=function(t,e,n){var r=(n<0?360+n:n)*Math.PI/180,o=t.width,i=t.height,u=Math.sin(r),a=Math.cos(r),c=P(Math.abs(o*a)+Math.abs(i*u)),s=P(Math.abs(o*u)+Math.abs(i*a)),l=p(c,s),f=b(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(t,-o/2,-i/2),B(l,e)},L=function(t,e,n){var r=p(t.width,t.height),o=b(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),B(r,e)},H=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return L(n,t.getType(),e)}))}(t,e)},V=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return I(n,t.getType(),e)}))}(t,e)},F=function(t,e,n){return void 0===n&&(n=!1),new w((function(r){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&r({status:o.status,blob:o.response})},o.open("GET",t,!0),o.withCredentials=n,function(t,e){for(var n=z(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(e,(function(t,e){o.setRequestHeader(e,t)})),o.responseType="blob",o.send()}))},j=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],U=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],W=function(t,e){var n,r,o=(n=function(t,e){return i(t)?t[e]:void 0},r=t,D(e,(function(t,e){r=n(r,t,e)})),r);return h.from(o)},q=function(t){var e=function(t){return"ImageProxy HTTP error: "+A(j,(function(e){return t===e.code})).fold(c("Unknown ImageProxy error"),(function(t){return t.message}))}(t);return w.reject(e)},$=function(t){return A(U,(function(e){return e.type===t})).fold(c("Unknown service error"),(function(t){return t.message}))},G=function(t){return"ImageProxy Service error: "+function(t){try{return h.some(JSON.parse(t))}catch(e){return h.none()}}(t).bind((function(t){return W(t,["error","type"]).map($)})).getOr("Invalid JSON in service error message")},K=function(t){return function(t){return new w((function(e,n){var r=new FileReader;r.onload=function(){e(r.result)},r.onerror=function(t){n(t)},r.readAsText(t)}))}(t).then((function(t){var e=G(t);return w.reject(e)}))},X=function(t){return t<200||t>=300},Y=function(t,e){var n={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return F(function(t,e){var n=-1===t.indexOf("?")?"?":"&";return/[?&]apiKey=/.test(t)?t:t+n+"apiKey="+encodeURIComponent(e)}(t,e),n).then((function(t){return X(t.status)?(e=t.status,n=t.blob,function(t,e){return"application/json"===(null==e?void 0:e.type)&&(400===t||403===t||404===t||500===t)}(e,n)?K(n):q(e)):w.resolve(t.blob);var e,n}))},J=function(t,e,n){return void 0===n&&(n=!1),e?Y(t,e):function(t,e){return F(t,{},e).then((function(t){return X(t.status)?q(t.status):w.resolve(t.blob)}))}(t,n)},Q=function(t){return N(t)},Z=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},tt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Z(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Z(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Z(n)},fromDom:Z,fromPoint:function(t,e,n){return h.from(t.dom.elementFromPoint(e,n)).map(Z)}};"undefined"!=typeof window?window:Function("return this;")();var et=function(t,e){return function(t,e){return A(t.dom.childNodes,(function(t){return e(tt.fromDom(t))})).map(tt.fromDom)}(t,(function(t){return function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(t,e)}))},nt=tinymce.util.Tools.resolve("tinymce.util.Delay"),rt=tinymce.util.Tools.resolve("tinymce.util.Promise"),ot=tinymce.util.Tools.resolve("tinymce.util.URI"),it=function(t){return t.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions")},ut=function(t){return t.getParam("imagetools_proxy")},at=function(t){var e,n,r=function(t){return/^[0-9\.]+px$/.test(t)};return e=t.style.width,n=t.style.height,e||n?r(e)&&r(n)?{w:parseInt(e,10),h:parseInt(n,10)}:null:(e=t.width,n=t.height,e&&n?{w:parseInt(e,10),h:parseInt(n,10)}:null)},ct=function(t){return{w:t.naturalWidth,h:t.naturalHeight}},st=0,lt=function(t){return et(tt.fromDom(t),"img")},ft=function(t,e){return t.dom.is(e,"figure")},dt=function(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")},mt=function(t,e){var n=function(e){return dt(t,e)&&(vt(t,e)||bt(t,e)||i(ut(t)))};return ft(t,e)?lt(e).bind((function(t){return n(t.dom)?h.some(t.dom):h.none()})):n(e)?h.some(e):h.none()},gt=function(t,e){t.notificationManager.open({text:e,type:"error"})},ht=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return null!==n&&ft(t,n)?lt(n):dt(t,e)?h.some(tt.fromDom(e)):h.none()},pt=function(t,e,n){var r=e.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return i(r)?t.dom.encode(r[n]):null},vt=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new ot(n).host===t.documentBaseURI.host},bt=function(t,e){return-1!==r.inArray(function(t){return t.getParam("imagetools_cors_hosts",[],"string[]")}(t),new ot(e.src).host)},yt=function(t,e){if(bt(t,e))return J(e.src,null,function(t,e){return-1!==r.inArray(function(t){return t.getParam("imagetools_credentials_hosts",[],"string[]")}(t),new ot(e.src).host)}(t,e));if(!vt(t,e)){var n=ut(t),o=n+(-1===n.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),i=function(t){return t.getParam("api_key",t.getParam("imagetools_api_key","","string"),"string")}(t);return J(o,i,!1)}return O(e)},wt=function(t,e){return function(t){return h.from(t.getParam("imagetools_fetch_image",null,"function"))}(t).fold((function(){return yt(t,e)}),(function(t){return t(e)}))},xt=function(t,e){var n=t.editorUpload.blobCache.getByUri(e.src);return n?rt.resolve(n.blob()):wt(t,e)},Ct=function(t){nt.clearTimeout(t.get())},St=function(t,e,n,r,o,u,a){return n.toBlob().then((function(c){var s,l,f,d,m=t.editorUpload.blobCache;s=u.src;var g=e.type===c.type;return function(t){return t.getParam("images_reuse_filename",!1,"boolean")}(t)&&(d=m.getByUri(s),i(d)?(s=d.uri(),l=d.name(),f=d.filename()):(l=pt(t,s,2),f=pt(t,s,1))),d=m.create({id:"imagetools"+st++,blob:c,base64:n.toBase64(),uri:s,name:l,filename:g?f:void 0}),m.add(d),t.undoManager.transact((function(){var e=function(){t.$(u).off("load",e),t.nodeChanged(),r?t.editorUpload.uploadImagesAuto():(Ct(o),function(t,e){var n=nt.setEditorTimeout(t,(function(){t.editorUpload.uploadImagesAuto()}),function(t){return t.getParam("images_upload_timeout",3e4,"number")}(t));e.set(n)}(t,o))};t.$(u).on("load",e),a&&t.$(u).attr({width:a.w,height:a.h}),t.$(u).attr({src:d.blobUri()}).removeAttr("data-mce-src")})),d}))},kt=function(t,e,n,r){return function(){return ht(t).fold((function(){gt(t,"Could not find selected image")}),(function(o){return t._scanForImages().then((function(){return xt(t,o.dom)})).then((function(i){return Q(i).then(n).then((function(n){return St(t,i,n,!1,e,o.dom,r)}))})).catch((function(e){gt(t,e)}))}))}},Tt=function(t,e,n){return function(){var r=ht(t).map((function(t){var e=at(t.dom);return e?{w:e.h,h:e.w}:null})).getOrNull();return kt(t,e,(function(t){return V(t,n)}),r)()}},Ot=function(t,e,n){return function(){return kt(t,e,(function(t){return H(t,n)}))()}},_t=function(t,e,n,r,o){return function(t){return x(t)}(o).then((function(t){var e=ct(t);return r.w===e.w&&r.h===e.h||at(n)&&function(t,e){var n,r;e&&(n=t.style.width,r=t.style.height,(n||r)&&(t.style.width=e.w+"px",t.style.height=e.h+"px",t.removeAttribute("data-mce-style")),n=t.width,r=t.height,(n||r)&&(t.setAttribute("width",String(e.w)),t.setAttribute("height",String(e.h))))}(n,e),URL.revokeObjectURL(t.src),o})).then(Q).then((function(r){return St(t,o,r,!0,e,n)}))},Et=function(t,e){return function(){var n=ht(t),r=n.map((function(t){return ct(t.dom)}));n.each((function(o){mt(t,o.dom).each((function(i){xt(t,o.dom).then((function(o){var i=function(t){return{blob:t,url:URL.createObjectURL(t)}}(o);t.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:i}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(o){var i=o.getData().imagetools.blob;n.each((function(n){r.each((function(r){_t(t,e,n.dom,r,i)}))})),o.close()},onCancel:a,onAction:function(t,e){switch(e.name){case"save-state":e.value?t.enable("save"):t.disable("save");break;case"disable":t.disable("save"),t.disable("cancel");break;case"enable":t.enable("cancel")}}})}))}))}))}};n.add("imagetools",(function(t){var n=e(0),o=e(null);!function(t,e){r.each({mceImageRotateLeft:Tt(t,e,-90),mceImageRotateRight:Tt(t,e,90),mceImageFlipVertical:Ot(t,e,"v"),mceImageFlipHorizontal:Ot(t,e,"h"),mceEditImage:Et(t,e)},(function(e,n){t.addCommand(n,e)}))}(t,n),function(t){var e=[],n=function(e){return function(){return t.execCommand(e)}},r=function(){return ht(t).exists((function(e){return mt(t,e.dom).isSome()}))},o=function(t){var n=function(e){return t.setDisabled(!e)};return n(r()),e=e.concat([n]),function(){e=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(e,(function(t){return t!==n}))}};t.on("NodeChange",(function(){var t=r();D(e,(function(e){return e(t)}))})),t.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:n("mceImageRotateLeft"),onSetup:o}),t.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:n("mceImageRotateRight"),onSetup:o}),t.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:n("mceImageFlipVertical"),onSetup:o}),t.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:n("mceImageFlipHorizontal"),onSetup:o}),t.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:n("mceEditImage"),onSetup:o}),t.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:n("mceImage")}),t.ui.registry.addContextMenu("imagetools",{update:function(e){return mt(t,e).map((function(t){return{text:"Edit image",icon:"edit-image",onAction:n("mceEditImage")}})).toArray()}})}(t),function(t){t.ui.registry.addContextToolbar("imagetools",{items:it(t),predicate:function(e){return mt(t,e).isSome()},position:"node",scope:"node"})}(t),function(t,e,n){t.on("NodeChange",(function(r){var o=n.get(),i=mt(t,r.element);o&&!i.exists((function(t){return o.src===t.src}))&&(Ct(e),t.editorUpload.uploadImagesAuto(),n.set(null)),i.each(n.set)}))}(t,n,o)}))}(),function(){var t,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.VK"),r=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},o=function(t){return function(e){return typeof e===t}},i=r("string"),u=r("array"),a=(t=null,function(e){return t===e}),c=o("boolean"),s=o("function"),l=function(){},f=function(t){return function(){return t}},d=function(t){return t},m=function(t,e){return t===e},g=f(!1),h=f(!0),p=function(){return v},v=function(){var t=function(t){return t()},e=d;return{fold:function(t,e){return t()},isSome:g,isNone:h,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:f(null),getOrUndefined:f(void 0),or:e,orThunk:t,map:p,each:l,bind:p,exists:g,forall:h,filter:function(){return p()},toArray:function(){return[]},toString:f("none()")}}(),b=function(t){var e=f(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:h,isNone:g,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return b(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:v},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},y={some:b,none:p,from:function(t){return null==t?v:b(t)}},w=Array.prototype.indexOf,x=Array.prototype.push,C=function(t,e){return function(t,e){return w.call(t,e)}(t,e)>-1},S=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!u(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);x.apply(e,t[n])}return e},k=function(t,e){return S(function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(t,e))},T=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return y.none()},O=function(t,e,n){return void 0===n&&(n=m),t.exists((function(t){return n(t,e)}))},_=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},E=function(t,e){return t?y.some(e):y.none()},D=function(t){var e=t.getParam("link_assume_external_targets",!1);return c(e)&&e?1:!i(e)||"http"!==e&&"https"!==e?0:e},A=function(t){return t.getParam("default_link_target")},M=function(t){return t.getParam("target_list",!0)},z=function(t){return t.getParam("rel_list",[],"array")},R=function(t){return t.getParam("link_title",!0,"boolean")},N=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},B=function(t){return t.getParam("link_default_protocol","http","string")},P=tinymce.util.Tools.resolve("tinymce.util.Tools"),I=function(t){return i(t.value)?t.value:""},L=function(t,e){var n=[];return P.each(t,(function(t){var r=function(t){return i(t.text)?t.text:i(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=L(t.menu,e);n.push({text:r,items:o})}else{var u=e(t);n.push({text:r,value:u})}})),n},H=function(t){return void 0===t&&(t=I),function(e){return y.from(e).map((function(e){return L(e,t)}))}},V={sanitize:function(t){return H(I)(t)},sanitizeWith:H,createUi:function(t,e){return function(n){return{name:t,type:"listbox",label:e,items:n}}},getValue:I},F=function(){return(F=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},j=Object.keys,U=Object.hasOwnProperty,W=function(t,e,n,r){return function(t,e){for(var n=j(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},q=function(t,e){return U.call(t,e)},$=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),G=function(t){return t&&"a"===t.nodeName.toLowerCase()},K=function(t){return G(t)&&!!J(t)},X=function(t,e){if(t.collapsed)return[];var n=t.cloneContents(),r=new $(n.firstChild,n),o=[],i=n.firstChild;do{e(i)&&o.push(i)}while(i=r.next());return o},Y=function(t){return/^\w+:/i.test(t)},J=function(t){var e=t.getAttribute("data-mce-href");return e||t.getAttribute("href")},Q=function(t,e){var n,r=["noopener"],o=t?t.split(/\s+/):[],i=function(t){return t.filter((function(t){return-1===P.inArray(r,t)}))},u=e?(n=i(n=o)).length>0?n.concat(r):r:i(o);return u.length>0?function(t){return P.trim(t.sort().join(" "))}(u):""},Z=function(t,e){return e=e||t.selection.getNode(),rt(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},tt=function(t,e){return function(t){return t.replace(/\uFEFF/g,"")}(e?e.innerText||e.textContent:t.getContent({format:"text"}))},et=function(t){return P.grep(t,K).length>0},nt=function(t){var e=t.schema.getTextInlineElements();return 0===X(t.selection.getRng(),(function(t){return 1===t.nodeType&&!G(t)&&!q(e,t.nodeName.toLowerCase())})).length},rt=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},ot=function(t,e){var n,r,o=F({},e);if(!(z(t).length>0)&&!1===N(t)){var i=Q(o.rel,"_blank"===o.target);o.rel=i||null}return y.from(o.target).isNone()&&!1===M(t)&&(o.target=A(t)),o.href=(n=o.href,"http"!==(r=D(t))&&"https"!==r||Y(n)?n:r+"://"+n),o},it=function(t,e,n){var r=t.selection.getNode(),o=Z(t,r),i=ot(t,function(t){var e,n,r;return e=["title","rel","class","target"],n=function(e,n){return t[n].each((function(t){e[n]=t.length>0?t:null})),e},r={href:t.href},function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)}(e,(function(t,e){r=n(r,t,e)})),r}(n));t.undoManager.transact((function(){n.href===e.href&&e.attach(),o?(t.focus(),function(t,e,n,r){n.each((function(t){q(e,"innerText")?e.innerText=t:e.textContent=t})),t.dom.setAttribs(e,r),t.selection.select(e)}(t,o,n.text,i)):function(t,e,n,r){rt(e)?lt(t,e,r):n.fold((function(){t.execCommand("mceInsertLink",!1,r)}),(function(e){t.insertContent(t.dom.createHTML("a",r,t.dom.encode(e)))}))}(t,r,n.text,i)}))},ut=function(t){var e=t.class,n=t.href,r=t.rel,o=t.target,i=t.text,u=t.title;return function(t,e){var n,r={};return W(t,e,(n=r,function(t,e){n[e]=t}),l),r}({class:e.getOrNull(),href:n,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:u.getOrNull()},(function(t,e){return!1===a(t)}))},at=function(t,e,n){t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,ut(n)):it(t,e,n)},ct=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):function(t){t.undoManager.transact((function(){var e=t.selection.getNode();rt(e)?st(t,e):function(t){var e=t.dom,n=t.selection,r=n.getBookmark(),o=n.getRng().cloneRange(),i=e.getParent(o.startContainer,"a[href]",t.getBody()),u=e.getParent(o.endContainer,"a[href]",t.getBody());i&&o.setStartBefore(i),u&&o.setEndAfter(u),n.setRng(o),t.execCommand("unlink"),n.moveToBookmark(r)}(t),t.focus()}))}(t)},st=function(t,e){var n=t.dom.select("img",e)[0];if(n){var r=t.dom.getParents(n,"a[href]",e)[0];r&&(r.parentNode.insertBefore(n,r),t.dom.remove(r))}},lt=function(t,e,n){var r=t.dom.select("img",e)[0];if(r){var o=t.dom.create("a",n);r.parentNode.insertBefore(o,r),o.appendChild(r)}},ft=function(t){return q(e=t,n="items")&&void 0!==e[n]&&null!==e[n];var e,n},dt=function(t,e){return T(e,(function(e){return ft(e)?dt(t,e.items):E(e.value===t,e)}))},mt=function(t,e,n,r){var o=r[e],i=t.length>0;return void 0!==o?dt(o,n).map((function(e){return{url:{value:e.value,meta:{text:i?t:e.text,attach:l}},text:i?t:e.text}})):y.none()},gt=function(t,e){var n={text:t.text,title:t.title},r=function(t){var e,r=(e=t.url,E(n.text.length<=0,y.from(e.meta.text).getOr(e.value))),o=function(t){return E(n.title.length<=0,y.from(t.meta.title).getOr(""))}(t.url);return r.isSome()||o.isSome()?y.some(F(F({},r.map((function(t){return{text:t}})).getOr({})),o.map((function(t){return{title:t}})).getOr({}))):y.none()},o=function(t,r){var o,i,u=(o=e,i=r.name,"link"===i?o.link:"anchor"===i?o.anchor:y.none()).getOr([]);return mt(n.text,r.name,u,t)};return{onChange:function(t,e){var i=e.name;return"url"===i?r(t()):C(["anchor","link"],i)?o(t(),e):"text"===i||"title"===i?(n[i]=t()[i],y.none()):y.none()}}},ht=tinymce.util.Tools.resolve("tinymce.util.Delay"),pt=tinymce.util.Tools.resolve("tinymce.util.Promise"),vt=function(t){var e=t.href;return e.indexOf("@")>0&&-1===e.indexOf("/")&&-1===e.indexOf("mailto:")?y.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return F(F({},t),{href:"mailto:"+e})}}):y.none()},bt=function(t,e){return T([vt,(n=D(t),r=B(t),function(t){var e=t.href;return 1===n&&!Y(e)||0===n&&/^\s*www(\.|\d\.)/i.test(e)?y.some({message:"The URL you entered seems to be an external link. Do you want to add the required "+r+":// prefix?",preprocess:function(t){return F(F({},t),{href:r+"://"+e})}}):y.none()})],(function(t){return t(e)})).fold((function(){return pt.resolve(e)}),(function(n){return new pt((function(r){!function(t,e,n){var r=t.selection.getRng();ht.setEditorTimeout(t,(function(){t.windowManager.confirm(e,(function(e){t.selection.setRng(r),n(e)}))}))}(t,n.message,(function(t){r(t?n.preprocess(e):e)}))}))}));var n,r},yt=function(t){var e=t.dom.select("a:not([href])"),n=k(e,(function(t){var e=t.name||t.id;return e?[{text:e,value:"#"+e}]:[]}));return n.length>0?y.some([{text:"None",value:""}].concat(n)):y.none()},wt=function(t){var e=function(t){return t.getParam("link_class_list",[],"array")}(t);return e.length>0?V.sanitize(e):y.none()},xt=tinymce.util.Tools.resolve("tinymce.util.XHR"),Ct=function(t){var e=function(e){return t.convertURL(e.value||e.url,"href")},n=function(t){return t.getParam("link_list")}(t);return new pt((function(t){i(n)?xt.send({url:n,success:function(e){return t(function(t){try{return y.some(JSON.parse(t))}catch(e){return y.none()}}(e))},error:function(e){return t(y.none())}}):s(n)?n((function(e){return t(y.some(e))})):t(y.from(n))})).then((function(t){return t.bind(V.sanitizeWith(e)).map((function(t){if(t.length>0){return[{text:"None",value:""}].concat(t)}return t}))}))},St=function(t,e){var n=z(t);if(n.length>0){var r=O(e,"_blank");return(!1===N(t)?V.sanitizeWith((function(t){return Q(V.getValue(t),r)})):V.sanitize)(n)}return y.none()},kt=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Tt=function(t){var e=M(t);return u(e)?V.sanitize(e).orThunk((function(){return y.some(kt)})):!1===e?y.none():y.some(kt)},Ot=function(t,e,n){var r=t.getAttrib(e,n);return null!==r&&r.length>0?y.some(r):y.none()},_t=function(t,e){return Ct(t).then((function(n){var r=function(t,e){var n=t.dom,r=nt(t)?y.some(tt(t.selection,e)):y.none(),o=e?y.some(n.getAttrib(e,"href")):y.none(),i=e?y.from(n.getAttrib(e,"target")):y.none(),u=Ot(n,e,"rel"),a=Ot(n,e,"class");return{url:o,text:r,title:Ot(n,e,"title"),target:i,rel:u,linkClass:a}}(t,e);return{anchor:r,catalogs:{targets:Tt(t),rels:St(t,r.target),classes:wt(t),anchor:yt(t),link:n},optNode:y.from(e),flags:{titleEnabled:R(t)}}}))},Et=function(t){(function(t){var e=Z(t);return _t(t,e)})(t).then((function(e){return function(t,e,n){var r=t.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),o=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(t,e){var n=t.anchor,r=n.url.getOr("");return{url:{value:r,meta:{original:{value:r}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:r,link:r,rel:n.rel.getOr(""),target:n.target.or(e).getOr(""),linkClass:n.linkClass.getOr("")}}(t,y.from(A(n))),u=t.catalogs,a=gt(i,u);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:S([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],r,o,_([u.anchor.map(V.createUi("anchor","Anchors")),u.rels.map(V.createUi("rel","Rel")),u.targets.map(V.createUi("target","Open link in...")),u.link.map(V.createUi("link","Link list")),u.classes.map(V.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(t,e){var n=e.name;a.onChange(t.getData,{name:n}).each((function(e){t.setData(e)}))},onSubmit:e}}(e,function(t,e){return function(n){var r=n.getData();if(!r.url.value)return ct(t),void n.close();var o=function(t){return y.from(r[t]).filter((function(n){return!O(e.anchor[t],n)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},u={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:l};bt(t,i).then((function(e){at(t,u,e)})),n.close()}}(t,e),t)})).then((function(e){t.windowManager.open(e)}))},Dt=function(t){var e=document.createElement("a");e.target="_blank",e.href=t,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(t,e){document.body.appendChild(t),t.dispatchEvent(e),document.body.removeChild(t)}(e,n)},At=function(t,e){return t.dom.getParent(e,"a[href]")},Mt=function(t){return At(t,t.selection.getStart())},zt=function(t,e){if(e){var n=J(e);if(/^#/.test(n)){var r=t.$(n);r.length&&t.selection.scrollIntoView(r[0],!0)}else Dt(e.href)}},Rt=function(t){return function(){Et(t)}},Nt=function(t){return function(){zt(t,Mt(t))}},Bt=function(t,e){return t.on("NodeChange",e),function(){return t.off("NodeChange",e)}},Pt=function(t){return function(e){var n=function(){return e.setActive(!t.mode.isReadOnly()&&null!==Z(t,t.selection.getNode()))};return n(),Bt(t,n)}},It=function(t){return function(e){var n=function(){return e.setDisabled(null===Z(t,t.selection.getNode()))};return n(),Bt(t,n)}},Lt=function(t){return function(e){var n=function(e){return et(e)||(n=t.selection.getRng(),X(n,K).length>0);var n},r=t.dom.getParents(t.selection.getStart());return e.setDisabled(!n(r)),Bt(t,(function(t){return e.setDisabled(!n(t.parents))}))}},Ht=function(t){var e=function(e){var n=t.selection.getNode();return e.setDisabled(!Z(t,n)),l};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Pt(t)},label:"Link",predicate:function(e){return!!Z(t,e)&&function(t){return t.getParam("link_context_toolbar",!1,"boolean")}(t)},initValue:function(){var e=Z(t);return e?J(e):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(e){var n=t.selection.getNode();return e.setActive(!!Z(t,n)),Pt(t)(e)},onAction:function(e){var n=e.getValue(),r=function(e){var n=Z(t),r=nt(t);if(!n&&r){var o=tt(t.selection,n);return y.some(o.length>0?o:e)}return y.none()}(n);at(t,{href:n,attach:l},{href:n,text:r,title:y.none(),rel:y.none(),target:y.none(),class:y.none()}),t.selection.collapse(!1),e.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:e,onAction:function(e){ct(t),e.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:e,onAction:function(e){Nt(t)(),e.hide()}}]})};e.add("link",(function(t){!function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Rt(t),onSetup:Pt(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Nt(t),onSetup:It(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return ct(t)},onSetup:Lt(t)})}(t),function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Nt(t),onSetup:It(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Rt(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return ct(t)},onSetup:Lt(t)})}(t),function(t){t.ui.registry.addContextMenu("link",{update:function(e){return et(t.dom.getParents(e,"a"))?"link unlink openlink":"link"}})}(t),Ht(t),function(t){t.on("click",(function(e){var r=At(t,e.target);r&&n.metaKeyPressed(e)&&(e.preventDefault(),zt(t,r))})),t.on("keydown",(function(e){var n=Mt(t);n&&13===e.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(e)&&(e.preventDefault(),zt(t,n))}))}(t),function(t){t.addCommand("mceLink",(function(){!function(t){return t.getParam("link_quicklink",!1,"boolean")}(t)?Rt(t)():t.fire("contexttoolbar-show",{toolbarKey:"quicklink"})}))}(t),function(t){t.addShortcut("Meta+K","",(function(){t.execCommand("mceLink")}))}(t)}))}(),function(){var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env"),n=function(t){return t.getParam("pagebreak_split_block",!1)},r="mce-pagebreak",o=function(t){var n='<img src="'+e.transparentSrc+'" class="'+'mce-pagebreak" data-mce-resize="false" data-mce-placeholder />';return t?"<p>"+n+"</p>":n};t.add("pagebreak",(function(t){!function(t){t.addCommand("mcePageBreak",(function(){t.insertContent(o(n(t)))}))}(t),function(t){var e=function(){return t.execCommand("mcePageBreak")};t.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:e}),t.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:e})}(t),function(t){var e=function(t){return t.getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e")}(t),i=function(){return n(t)},u=new RegExp(e.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,(function(t){return"\\"+t})),"gi");t.on("BeforeSetContent",(function(t){t.content=t.content.replace(u,o(i()))})),t.on("PreInit",(function(){t.serializer.addNodeFilter("img",(function(n){for(var o,u,a=n.length;a--;)if((u=(o=n[a]).attr("class"))&&-1!==u.indexOf(r)){var c=o.parent;if(t.schema.getBlockElements()[c.name]&&i()){c.type=3,c.value=e,c.raw=!0,o.remove();continue}o.type=3,o.value=e,o.raw=!0}}))}))}(t),function(t){t.on("ResolveName",(function(e){"IMG"===e.target.nodeName&&t.dom.hasClass(e.target,r)&&(e.name="pagebreak")}))}(t)}))}(),function(){var t=tinymce.util.Tools.resolve("tinymce.PluginManager");t.add("code",(function(t){return function(t){t.addCommand("mceCodeEditor",(function(){!function(t){var e=function(t){return t.getContent({source_view:!0})}(t);t.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){!function(t,e){t.focus(),t.undoManager.transact((function(){t.setContent(e)})),t.selection.setCursorLocation(),t.nodeChanged()}(t,e.getData().code),e.close()}})}(t)}))}(t),function(t){var e=function(){return t.execCommand("mceCodeEditor")};t.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:e}),t.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:e})}(t),{}}))}(),function(){var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t){return t.getParam("insertdatetime_timeformat",t.translate("%H:%M:%S"))},n=function(t){return t.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},r="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),o="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),i="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),u="January February March April May June July August September October November December".split(" "),a=function(t,e){if((t=""+t).length<e)for(var n=0;n<e-t.length;n++)t="0"+t;return t},c=function(t,e,n){return void 0===n&&(n=new Date),e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",a(n.getMonth()+1,2))).replace("%d",a(n.getDate(),2))).replace("%H",""+a(n.getHours(),2))).replace("%M",""+a(n.getMinutes(),2))).replace("%S",""+a(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+t.translate(u[n.getMonth()]))).replace("%b",""+t.translate(i[n.getMonth()]))).replace("%A",""+t.translate(o[n.getDay()]))).replace("%a",""+t.translate(r[n.getDay()]))).replace("%%","%")},s=function(t,e){if(function(t){return t.getParam("insertdatetime_element",!1)}(t)){var n=c(t,e),r=void 0;r=/%[HMSIp]/.test(e)?c(t,"%Y-%m-%dT%H:%M"):c(t,"%Y-%m-%d");var o=t.dom.getParent(t.selection.getStart(),"time");o?function(t,e,n,r){var o=t.dom.create("time",{datetime:n},r);e.parentNode.insertBefore(o,e),t.dom.remove(e),t.selection.select(o,!0),t.selection.collapse(!1)}(t,o,r,n):t.insertContent('<time datetime="'+r+'">'+n+"</time>")}else t.insertContent(c(t,e))},l=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=function(t){var r,o,i=n(t),u=(r=function(t){var r=n(t);return r.length>0?r[0]:e(t)}(t),o=r,{get:function(){return o},set:function(t){o=t}});t.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(t){return t===u.get()},fetch:function(e){e(l.map(i,(function(e){return{type:"choiceitem",text:c(t,e),value:e}})))},onAction:function(e){s(t,u.get())},onItemAction:function(e,n){u.set(n),s(t,n)}});var a=function(e){return function(){u.set(e),s(t,e)}};t.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return l.map(i,(function(e){return{type:"menuitem",text:c(t,e),onAction:a(e)}}))}})};t.add("insertdatetime",(function(t){!function(t){t.addCommand("mceInsertDate",(function(){s(t,function(t){return t.getParam("insertdatetime_dateformat",t.translate("%Y-%m-%d"))}(t))})),t.addCommand("mceInsertTime",(function(){s(t,e(t))}))}(t),f(t)}))}(),function(){var t=Object.hasOwnProperty,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),o=function(t){return t.getParam("min_height",t.getElement().offsetHeight,"number")},i=function(t,e,n,o,u){r.setEditorTimeout(t,(function(){c(t,e),n--?i(t,e,n,o,u):u&&u()}),o)},u=function(t,e){var n=t.getBody();n&&(n.style.overflowY=e?"":"hidden",e||(n.scrollTop=0))},a=function(t,e,n,r){var o=parseInt(t.getStyle(e,n,r),10);return isNaN(o)?0:o},c=function(t,e){var r=t.dom,i=t.getDoc();if(i)if(function(t){return t.plugins.fullscreen&&t.plugins.fullscreen.isFullscreen()}(t))u(t,!0);else{var s=i.documentElement,l=function(t){return t.getParam("autoresize_bottom_margin",50,"number")}(t),f=o(t),d=a(r,s,"margin-top",!0),m=a(r,s,"margin-bottom",!0),g=s.offsetHeight+d+m+l;g<0&&(g=0);var h=t.getContainer().offsetHeight-t.getContentAreaContainer().offsetHeight;g+h>o(t)&&(f=g+h);var p=function(t){return t.getParam("max_height",0,"number")}(t);if(p&&f>p?(f=p,u(t,!0)):u(t,!1),f!==e.get()){var v=f-e.get();if(r.setStyle(t.getContainer(),"height",f+"px"),e.set(f),function(t){t.fire("ResizeEditor")}(t),n.browser.isSafari()&&n.mac){var b=t.getWin();b.scrollTo(b.pageXOffset,b.pageYOffset)}t.hasFocus()&&t.selection.scrollIntoView(t.selection.getNode()),n.webkit&&v<0&&c(t,e)}}};e.add("autoresize",(function(e){var n,r,o;if(n=e.settings,r="resize",t.call(n,r)||(e.settings.resize=!1),!e.inline){var u=(o=0,{get:function(){return o},set:function(t){o=t}});!function(t,e){t.addCommand("mceAutoResize",(function(){c(t,e)}))}(e,u),function(t,e){t.on("init",(function(){var e=function(t){return t.getParam("autoresize_overflow_padding",1,"number")}(t),n=t.dom;n.setStyles(t.getDoc().documentElement,{height:"auto"}),n.setStyles(t.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})})),t.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(function(){c(t,e)})),function(t){return t.getParam("autoresize_on_init",!0,"boolean")}(t)&&t.on("init",(function(){i(t,e,20,100,(function(){i(t,e,5,1e3)}))}))}(e,u)}}))}(),function(){var t,e,n,r=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t){return!function(t){return null==t}(t)},u=(t="function",function(e){return typeof e===t}),a=function(){},c=function(t){return function(){return t}},s=function(t){return t},l=c(!1),f=c(!0),d=function(){return m},m=function(){var t=function(t){return t()},e=s;return{fold:function(t,e){return t()},isSome:l,isNone:f,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:c(null),getOrUndefined:c(void 0),or:e,orThunk:t,map:d,each:a,bind:d,exists:l,forall:f,filter:function(){return d()},toArray:function(){return[]},toString:c("none()")}}(),g=function(t){var e=c(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:f,isNone:l,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return g(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:m},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},h={some:g,none:d,from:function(t){return null==t?m:g(t)}},p=Array.prototype.slice,v=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},b=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},y=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},w=u(Array.from)?Array.from:function(t){return p.call(t)},x=function(){return(x=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},C=function(){var t=function(t){var e=r(h.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(h.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(h.some(t))}}}(a);return x(x({},t),{on:function(e){return t.get().each(e)}})},S=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},k=tinymce.util.Tools.resolve("tinymce.Env"),T=tinymce.util.Tools.resolve("tinymce.util.Delay"),O=tinymce.util.Tools.resolve("tinymce.util.Promise"),_=tinymce.util.Tools.resolve("tinymce.util.VK"),E=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},D=tinymce.util.Tools.resolve("tinymce.util.Tools"),A=function(t){return t.getParam("paste_data_images",!1)},M=function(t){return t.getParam("paste_merge_formats",!0)},z=function(t){return t.getParam("paste_retain_style_properties")},R=function(t){return t.getParam("validate")},N=function(t){return t.getParam("allow_html_data_urls",!1,"boolean")},B=function(t){return t.getParam("paste_data_images",!1,"boolean")},P=function(t){return D.explode(t.getParam("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"))},I="x-tinymce/html",L="\x3c!-- x-tinymce/html --\x3e",H=function(t){return-1!==t.indexOf(L)},V=c(I),F=Object.hasOwnProperty,j=function(t,e){return F.call(t,e)},U=tinymce.util.Tools.resolve("tinymce.html.Entities"),W=function(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n=[],r="<"+t;if("object"==typeof e){for(var o in e)j(e,o)&&n.push(o+'="'+U.encodeAllRaw(e[o])+'"');n.length&&(r+=" "+n.join(" "))}return r+">"}(e,n),i="</"+e+">",u=D.map(r,(function(t){return t.split(/\n/).join("<br />")}));return 1===u.length?u[0]:D.map(u,(function(t){return o+t+i})).join("")},q=tinymce.util.Tools.resolve("tinymce.html.DomParser"),$=tinymce.util.Tools.resolve("tinymce.html.Serializer"),G=" ",K=tinymce.util.Tools.resolve("tinymce.html.Node"),X=tinymce.util.Tools.resolve("tinymce.html.Schema"),Y=function(t,e){return D.each(e,(function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])})),t},J=function(t){return t=Y(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(t,e,n){return e||n?G:" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},Q=function(t){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(t)||/class="OutlineElement/.test(t)||/id="?docs\-internal\-guid\-/.test(t)},Z=function(t){var e=!1;return t=t.replace(/^[\u00a0 ]+/,""),D.each([/^[IVXLMCD]+\.[ \u00a0]/,/^[ivxlmcd]+\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],(function(n){if(n.test(t))return e=!0,!1})),e},tt=function(t,e,n,r){var o={},i=t.dom.parseStyle(r);D.each(i,(function(i,u){switch(u){case"mso-list":var a=/\w+ \w+([0-9]+)/i.exec(r);a&&(n._listLevel=parseInt(a[1],10)),/Ignore/i.test(i)&&n.firstChild&&(n._listIgnore=!0,n.firstChild._listIgnore=!0);break;case"horiz-align":u="text-align";break;case"vert-align":u="vertical-align";break;case"font-color":case"mso-foreground":u="color";break;case"mso-background":case"mso-highlight":u="background";break;case"font-weight":case"font-style":return void("normal"!==i&&(o[u]=i));case"mso-element":if(/^(comment|comment-list)$/i.test(i))return void n.remove()}0!==u.indexOf("mso-comment")?0!==u.indexOf("mso-")&&("all"===z(t)||e&&e[u])&&(o[u]=i):n.remove()})),/(bold)/i.test(o["font-weight"])&&(delete o["font-weight"],n.wrap(new K("b",1))),/(italic)/i.test(o["font-style"])&&(delete o["font-style"],n.wrap(new K("i",1)));var u=t.dom.serializeStyle(o,n.name);return u||null},et=function(t,e){var n,r=z(t);r&&(n=D.makeMap(r.split(/[, ]/))),e=Y(e,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,G],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return e.length>0?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join(G):""}]]);var o=function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")}(t),i=X({valid_elements:o,valid_children:"-li[p]"});D.each(i.elements,(function(t){t.attributes.class||(t.attributes.class={},t.attributesOrder.push("class")),t.attributes.style||(t.attributes.style={},t.attributesOrder.push("style"))}));var u=q({},i);u.addAttributeFilter("style",(function(e){for(var r,o=e.length;o--;)(r=e[o]).attr("style",tt(t,n,r,r.attr("style"))),"span"===r.name&&r.parent&&!r.attributes.length&&r.unwrap()})),u.addAttributeFilter("class",(function(t){for(var e,n,r=t.length;r--;)n=(e=t[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&e.remove(),e.attr("class",null)})),u.addNodeFilter("del",(function(t){for(var e=t.length;e--;)t[e].remove()})),u.addNodeFilter("a",(function(t){for(var e,n,r,o=t.length;o--;)if(n=(e=t[o]).attr("href"),r=e.attr("name"),n&&-1!==n.indexOf("#_msocom_"))e.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){e.unwrap();continue}e.attr({href:n,name:r})}else e.unwrap()}));var a=u.parse(e);return function(t){return t.getParam("paste_convert_word_fake_lists",!0)}(t)&&function(t){for(var e,n,r=1,o=function(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)do{e+=o(t)}while(t=t.next);return e},i=function(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!i(t,e))return!1}while(t=t.next);return!0},u=function(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)do{u(t)}while(t=t.next)},a=function(t,o,a){var c=t._listLevel||r;c!==r&&(c<r?e&&(e=e.parent.parent):(n=e,e=null)),e&&e.name===o?e.append(t):(n=n||e,e=new K(o,1),a>1&&e.attr("start",""+a),t.wrap(e)),t.name="li",c>r&&n&&n.lastChild.append(e),r=c,u(t),i(t,/^\u00a0+/),i(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),i(t,/^\u00a0+/)},c=[],s=t.firstChild;null!=s;)if(c.push(s),null!==(s=s.walk()))for(;void 0!==s&&s.parent!==t;)s=s.walk();for(var l=0;l<c.length;l++)if("p"===(t=c[l]).name&&t.firstChild){var f=o(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(f)){a(t,"ul");continue}if(Z(f)){var d=/([0-9]+)\./.exec(f),m=1;d&&(m=parseInt(d[1],10)),a(t,"ol",m);continue}if(t._listLevel){a(t,"ul",1);continue}e=null}else n=e,e=null}(a),e=$({validate:R(t)},i).serialize(a)},nt=function(t,e){return{content:t,cancelled:e}},rt=function(t,e,n,r){var o=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})}(t,e,n,r),i=function(t,e){var n=q({},t.schema);n.addNodeFilter("meta",(function(t){D.each(t,(function(t){t.remove()}))}));var r=n.parse(e,{forced_root_block:!1,isRootContent:!0});return $({validate:R(t)},t.schema).serialize(r)}(t,o.content);return t.hasEventListeners("PastePostProcess")&&!o.isDefaultPrevented()?function(t,e,n,r){var o=t.dom.create("div",{style:"display:none"},e),i=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})}(t,o,n,r);return nt(i.node.innerHTML,i.isDefaultPrevented())}(t,i,n,r):nt(i,o.isDefaultPrevented())},ot=function(t,e,n){var r=Q(e),o=r?function(t,e){return function(t){return t.getParam("paste_enable_default_filters",!0)}(t)?et(t,e):e}(t,e):e;return rt(t,o,n,r)},it=function(t,e){return t.insertContent(e,{merge:M(t),paste:!0}),!0},ut=function(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)},at=function(t,e){return ut(e)&&v(P(t),(function(t){return n=e.toLowerCase(),r="."+t.toLowerCase(),S(n,r,n.length-r.length);var n,r}))},ct=function(t,e,n){return!(!1!==t.selection.isCollapsed()||!ut(e))&&function(t,e,n){return t.undoManager.extra((function(){n(t,e)}),(function(){t.execCommand("mceInsertLink",!1,e)})),!0}(t,e,n)},st=function(t,e,n){return!!at(t,e)&&function(t,e,n){return t.undoManager.extra((function(){n(t,e)}),(function(){t.insertContent('<img src="'+e+'">')})),!0}(t,e,n)},lt=function(t,e,n){n||!1===function(t){return t.getParam("smart_paste",!0)}(t)?it(t,e):function(t,e){D.each([ct,st,it],(function(n){return!0!==n(t,e,it)}))}(t,e)},ft=function(t){return"\n"===t||"\r"===t},dt=function(t,e){var n,r,o,i,u=(n=" ",(r=function(t){return t.getParam("paste_tab_spaces",4,"number")}(t))<=0?"":new Array(r+1).join(n)),a=e.replace(/\t/g,u);return(o=function(t,e){return function(t){return-1!==" \f\t\v".indexOf(t)}(e)||e===G?t.pcIsSpace||""===t.str||t.str.length===a.length-1||function(t,e){return e<t.length&&e>=0&&ft(t[e])}(a,t.str.length+1)?{pcIsSpace:!1,str:t.str+G}:{pcIsSpace:!0,str:t.str+" "}:{pcIsSpace:ft(e),str:t.str+e}},i={pcIsSpace:!1,str:""},y(a,(function(t,e){i=o(i,t,e)})),i).str},mt=function(t,e,n,r){var o=ot(t,e,n);!1===o.cancelled&<(t,o.content,r)},gt=function(t,e,n){var r=n||H(e);mt(t,function(t){return t.replace(L,"")}(e),r,!1)},ht=function(t,e){var n=t.dom.encode(e).replace(/\r\n/g,"\n"),r=function(t,e,n){return e?W(t,!0===e?"p":e,n):function(t){return t.replace(/\r?\n/g,"<br>")}(t)}(dt(t,n),function(t){return t.getParam("forced_root_block")}(t),function(t){return t.getParam("forced_root_block_attrs")}(t));mt(t,r,!1,!0)},pt=function(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&n.length>0&&-1===n.indexOf("data:text/mce-internal,")&&(e["text/plain"]=n)}if(t.types)for(var r=0;r<t.types.length;r++){var o=t.types[r];try{e[o]=t.getData(o)}catch(i){e[o]=""}}}return e},vt=function(t,e){return e in t&&t[e].length>0},bt=function(t){return vt(t,"text/html")||vt(t,"text/plain")},yt=(e="mceclip",n=0,function(){return e+n++}),wt=function(t,e){var n,r,o=(n=e.uri,(r=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(n))?{type:r[1],data:decodeURIComponent(r[2])}:{type:null,data:null}),u=o.data,a=o.type,c=yt(),s=e.blob,l=new Image;if(l.src=e.uri,function(t,e){var n=function(t){return t.getParam("images_dataimg_filter")}(t);return!n||n(e)}(t,l)){var f=t.editorUpload.blobCache,d=void 0,m=f.getByData(u,a);if(m)d=m;else{var g=function(t){return t.getParam("images_reuse_filename")}(t)&&i(s.name),h=g?function(t,e){var n=e.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return i(n)?t.dom.encode(n[1]):null}(t,s.name):c,p=g?s.name:void 0;d=f.create(c,s,u,h,p),f.add(d)}gt(t,'<img src="'+d.blobUri()+'">',!1)}else gt(t,'<img src="'+e.uri+'">',!1)},xt=function(t){return O.all(b(t,(function(t){return new O((function(e){var n=function(t){return i(t.getAsFile)}(t)?t.getAsFile():t,r=new window.FileReader;r.onload=function(){e({blob:n,uri:r.result})},r.readAsDataURL(n)}))})))},Ct=function(t){var e=P(t);return function(t){return function(t,e){return S(t,e,0)}(t.type,"image/")&&v(e,(function(e){return n=e.toLowerCase(),r={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"},(D.hasOwn(r,n)?"image/"+r[n]:"image/"+n)===t.type;var n,r}))}},St=function(t,e,n){var r="paste"===e.type?e.clipboardData:e.dataTransfer;if(B(t)&&r){var o=function(t,e){var n=e.items?b(w(e.items),(function(t){return t.getAsFile()})):[],r=e.files?w(e.files):[];return function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(n.length>0?n:r,Ct(t))}(t,r);if(o.length>0)return e.preventDefault(),xt(o).then((function(e){n&&t.selection.setRng(n),y(e,(function(e){wt(t,e)}))})),!0}return!1},kt=function(t){return _.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode},Tt=function(t,e,n){var r,o=C(),i=C();t.on("keyup",i.clear),t.on("keydown",(function(n){var u=function(t){kt(t)&&!t.isDefaultPrevented()&&e.remove()};if(kt(n)&&!n.isDefaultPrevented()){if((r=n.shiftKey&&86===n.keyCode)&&k.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(n.stopImmediatePropagation(),o.set(n),i.set(!0),k.ie&&r)return n.preventDefault(),void function(t,e){t.fire("paste",{ieFake:e})}(t,!0);e.remove(),e.create(),t.once("keyup",u),t.once("paste",(function(){t.off("keyup",u)}))}}));var u=function(t,n,r,o,i){var u;vt(n,"text/html")?u=n["text/html"]:(u=e.getHtml(),i=i||H(u),e.isDefaultContent(u)&&(o=!0)),u=J(u),e.remove();var a=!1===i&&!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(u),c=ut(u);(!u.length||a&&!c)&&(o=!0),(o||c)&&(u=vt(n,"text/plain")&&a?n["text/plain"]:function(t){var e=X(),n=q({},e),r="",o=e.getShortEndedElements(),i=D.makeMap("script noscript style textarea video audio iframe object"," "),u=e.getBlockElements(),a=function(t){var e=t.name,n=t;if("br"!==e){if("wbr"!==e)if(o[e]&&(r+=" "),i[e])r+=" ";else{if(3===t.type&&(r+=t.value),!t.shortEnded&&(t=t.firstChild))do{a(t)}while(t=t.next);u[e]&&n.next&&(r+="\n","p"===e&&(r+="\n"))}}else r+="\n"};return t=Y(t,[/<!\[[^\]]+\]>/g]),a(n.parse(t)),r}(u)),e.isDefaultContent(u)?r||t.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):o?ht(t,u):gt(t,u,i)};t.on("paste",(function(a){var c=o.isSet()||i.isSet();c&&o.clear();var s=function(t,e){return pt(e.clipboardData||t.getDoc().dataTransfer)}(t,a),l="text"===n.get()||r,f=vt(s,V());r=!1,a.isDefaultPrevented()||function(t){var e=t.clipboardData;return-1!==navigator.userAgent.indexOf("Android")&&e&&e.items&&0===e.items.length}(a)?e.remove():bt(s)||!St(t,a,e.getLastRng()||t.selection.getRng())?(c||a.preventDefault(),!k.ie||c&&!a.ieFake||vt(s,"text/html")||(e.create(),t.dom.bind(e.getEl(),"paste",(function(t){t.stopPropagation()})),t.getDoc().execCommand("Paste",!1,null),s["text/html"]=e.getHtml()),vt(s,"text/html")?(a.preventDefault(),f||(f=H(s["text/html"])),u(t,s,c,l,f)):T.setEditorTimeout(t,(function(){u(t,s,c,l,f)}),0)):e.remove()}))},Ot=function(t){return k.ie&&t.inline?document.body:t.getBody()},_t=function(t,e,n){(function(t){return Ot(t)!==t.getBody()})(t)&&t.dom.bind(e,"paste keyup",(function(e){At(t,n)||t.fire("paste")}))},Et=function(t){return t.dom.get("mcepastebin")},Dt=function(t,e){return e===t},At=function(t,e){var n,r=Et(t);return(n=r)&&"mcepastebin"===n.id&&Dt(e,r.innerHTML)},Mt=function(t){var e=r(null),n="%MCEPASTEBIN%";return{create:function(){return function(t,e,n){var r=t.dom,o=t.getBody();e.set(t.selection.getRng());var i=t.dom.add(Ot(t),"div",{id:"mcepastebin",class:"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n);(k.ie||k.gecko)&&r.setStyle(i,"left","rtl"===r.getStyle(o,"direction",!0)?65535:-65535),r.bind(i,"beforedeactivate focusin focusout",(function(t){t.stopPropagation()})),_t(t,i,n),i.focus(),t.selection.select(i,!0)}(t,e,n)},remove:function(){return function(t,e){if(Et(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(t,e)},getEl:function(){return Et(t)},getHtml:function(){return function(t){var e=function(e,n){e.appendChild(n),t.dom.remove(n,!0)},n=D.grep(Ot(t).childNodes,(function(t){return"mcepastebin"===t.id})),r=n.shift();D.each(n,(function(t){e(r,t)}));for(var o=t.dom.select("div[id=mcepastebin]",r),i=o.length-1;i>=0;i--){var u=t.dom.create("div");r.insertBefore(u,o[i]),e(u,o[i])}return r?r.innerHTML:""}(t)},getLastRng:e.get,isDefault:function(){return At(t,n)},isDefaultContent:function(t){return Dt(n,t)}}},zt=function(t,e){var n=Mt(t);return t.on("PreInit",(function(){return function(t,e,n){var r;Tt(t,e,n),t.parser.addNodeFilter("img",(function(e,n,o){var i,u=function(t){t.attr("data-mce-object")||r===k.transparentSrc||t.remove()},a=function(t){return 0===t.indexOf("data:")};if(!B(t)&&(i=o).data&&!0===i.data.paste)for(var c=e.length;c--;)(r=e[c].attr("src"))&&(0===r.indexOf("webkit-fake-url")||!N(t)&&a(r))&&u(e[c])}))}(t,n,e)})),{pasteFormat:e,pasteHtml:function(e,n){return gt(t,e,n)},pasteText:function(e){return ht(t,e)},pasteImageData:function(e,n){return St(t,e,n)},getDataTransferItems:pt,hasHtmlOrText:bt,hasContentType:vt}},Rt=function(t,e){t.addCommand("mceTogglePlainTextPaste",(function(){!function(t,e){"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),E(t,!1)):(e.pasteFormat.set("text"),E(t,!0)),t.focus()}(t,e)})),t.addCommand("mceInsertClipboardContent",(function(t,n){n.content&&e.pasteHtml(n.content,n.internal),n.text&&e.pasteText(n.text)}))},Nt=function(t,e,n){if(!function(t){return!1===k.iOS&&"function"==typeof(null==t?void 0:t.setData)}(t))return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData(V(),e),!0}catch(r){return!1}},Bt=function(t,e,n,r){Nt(t.clipboardData,e.html,e.text)?(t.preventDefault(),r()):n(e.html,r)},Pt=function(t){return function(e,n){var r=function(t){return L+t}(e),o=t.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),i=t.dom.create("div",{contenteditable:"true"},r);t.dom.setStyles(o,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),o.appendChild(i),t.dom.add(t.getBody(),o);var u=t.selection.getRng();i.focus();var a=t.dom.createRng();a.selectNodeContents(i),t.selection.setRng(a),T.setTimeout((function(){t.selection.setRng(u),o.parentNode.removeChild(o),n()}),0)}},It=function(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}},Lt=function(t){return!t.selection.isCollapsed()||function(t){return!!t.dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody())}(t)},Ht=function(t){t.on("cut",function(t){return function(e){Lt(t)&&Bt(e,It(t),Pt(t),(function(){if(k.browser.isChrome()||k.browser.isFirefox()){var e=t.selection.getRng();T.setEditorTimeout(t,(function(){t.selection.setRng(e),t.execCommand("Delete")}),0)}else t.execCommand("Delete")}))}}(t)),t.on("copy",function(t){return function(e){Lt(t)&&Bt(e,It(t),Pt(t),a)}}(t))},Vt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Ft=function(t,e){return Vt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())},jt=function(t,e){t.focus(),t.selection.setRng(e)},Ut=function(t,e){t.on("PastePreProcess",(function(n){n.content=e(t,n.content,n.internal,n.wordContent)}))},Wt=function(t,e){if(!Q(e))return e;var n=[];D.each(t.schema.getBlockElements(),(function(t,e){n.push(e)}));var r=new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g");return e=Y(e,[[r,"$1"]]),e=Y(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])},qt=function(t,e,n,r){if(r||n)return e;var o,i=function(t){return t.getParam("paste_webkit_styles")}(t);if(!1===function(t){return t.getParam("paste_remove_styles_if_webkit",!0)}(t)||"all"===i)return e;if(i&&(o=i.split(/[, ]/)),o){var u=t.dom,a=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,(function(t,e,n,r){var i=u.parseStyle(u.decode(n)),c={};if("none"===o)return e+r;for(var s=0;s<o.length;s++){var l=i[o[s]],f=u.getStyle(a,o[s],!0);/color/.test(o[s])&&(l=u.toHex(l),f=u.toHex(f)),f!==l&&(c[o[s]]=l)}var d=u.serializeStyle(c,"span");return d?e+' style="'+d+'"'+r:e+r}))}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,(function(t,e,n,r){return e+' style="'+n+'"'+r}))},$t=function(t,e){t.$("a",e).find("font,u").each((function(e,n){t.dom.remove(n,!0)}))},Gt=function(t,e){return function(n){n.setActive("text"===e.pasteFormat.get());var r=function(t){return n.setActive(t.state)};return t.on("PastePlainTextToggle",r),function(){return t.off("PastePlainTextToggle",r)}}};o.add("paste",(function(t){if(!1===function(t){return!!t.hasPlugin("powerpaste",!0)&&(void 0!==window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0)}(t)){var e=r(!1),n=r(function(t){return t.getParam("paste_as_text",!1)}(t)?"text":"html"),o=zt(t,n);return function(t){k.webkit&&Ut(t,qt),k.ie&&(Ut(t,Wt),function(t,e){t.on("PastePostProcess",(function(n){e(t,n.node)}))}(t,$t))}(t),function(t,e){var n=function(){return t.execCommand("mceTogglePlainTextPaste")};t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:n,onSetup:Gt(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:n,onSetup:Gt(t,e)})}(t,o),Rt(t,o),function(t){var e=t.plugins.paste,n=function(t){return t.getParam("paste_preprocess")}(t);n&&t.on("PastePreProcess",(function(t){n.call(e,e,t)}));var r=function(t){return t.getParam("paste_postprocess")}(t);r&&t.on("PastePostProcess",(function(t){r.call(e,e,t)}))}(t),Ht(t),function(t,e,n){(function(t){return t.getParam("paste_block_drop",!1)})(t)&&t.on("dragend dragover draggesture dragdrop drop drag",(function(t){t.preventDefault(),t.stopPropagation()})),A(t)||t.on("drop",(function(t){var e=t.dataTransfer;e&&e.files&&e.files.length>0&&t.preventDefault()})),t.on("drop",(function(r){var o=Ft(t,r);if(!r.isDefaultPrevented()&&!n.get()){var i,u=e.getDataTransferItems(r.dataTransfer),a=e.hasContentType(u,V());if((e.hasHtmlOrText(u)&&(!(i=u["text/plain"])||0!==i.indexOf("file://"))||!e.pasteImageData(r,o))&&o&&function(t){return t.getParam("paste_filter_drop",!0)}(t)){var c=u["mce-internal"]||u["text/html"]||u["text/plain"];c&&(r.preventDefault(),T.setEditorTimeout(t,(function(){t.undoManager.transact((function(){u["mce-internal"]&&t.execCommand("Delete"),jt(t,o),c=J(c),u["text/html"]?e.pasteHtml(c,a):e.pasteText(c)}))})))}}})),t.on("dragstart",(function(t){n.set(!0)})),t.on("dragover dragend",(function(e){A(t)&&!1===n.get()&&(e.preventDefault(),jt(t,Ft(t,e))),"dragend"===e.type&&n.set(!1)}))}(t,o,e),function(t){return{clipboard:t}}(o)}}))}(),function(){var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env"),n=tinymce.util.Tools.resolve("tinymce.util.Tools"),r=function(t){var r=function(t){var r="",o=t.dom.encode,i=function(t){return t.getParam("content_style","","string")}(t);r+='<base href="'+o(t.documentBaseURI.getURI())+'">';var u=function(t){return t.getParam("content_css_cors",!1,"boolean")}(t)?' crossorigin="anonymous"':"";n.each(t.contentCSS,(function(e){r+='<link type="text/css" rel="stylesheet" href="'+o(t.documentBaseURI.toAbsolute(e))+'"'+u+">"})),i&&(r+='<style type="text/css">'+i+"</style>");var a=function(t){var e=t.getParam("body_id","tinymce","string");return-1===e.indexOf("=")?e:function(t){var e=t.getParam("body_id","","hash");return e[t.id]||e}(t)}(t),c=function(t){var e=t.getParam("body_class","","string");return-1===e.indexOf("=")?e:function(t){return t.getParam("body_class","","hash")[t.id]||""}(t)}(t),s='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(e.mac?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",l=t.getBody().dir,f=l?' dir="'+o(l)+'"':"";return"<!DOCTYPE html><html><head>"+r+'</head><body id="'+o(a)+'" class="mce-content-body '+o(c)+'"'+f+">"+t.getContent()+s+"</body></html>"}(t);t.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:r}}).focus("close")};t.add("preview",(function(t){!function(t){t.addCommand("mcePreview",(function(){r(t)}))}(t),function(t){var e=function(){return t.execCommand("mcePreview")};t.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:e}),t.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:e})}(t)}))}(),function(){var t=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){return{isFullscreen:function(){return null!==t.get()}}},r=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},o=function(t){return function(e){return typeof e===t}},i=r("string"),u=r("array"),a=o("boolean"),c=function(t){return!function(t){return null==t}(t)},s=o("function"),l=o("number"),f=function(){},d=function(t){return function(){return t}},m=function(t){return t};function g(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var h=d(!1),p=d(!0),v=function(){return b},b=function(){var t=function(t){return t()},e=m;return{fold:function(t,e){return t()},isSome:h,isNone:p,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(void 0),or:e,orThunk:t,map:v,each:f,bind:v,exists:h,forall:p,filter:function(){return v()},toArray:function(){return[]},toString:d("none()")}}(),y=function(t){var e=d(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:p,isNone:h,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return y(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:b},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},w={some:y,none:v,from:function(t){return null==t?b:y(t)}},x=function(){return(x=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},C=function(e){var n=t(w.none()),r=function(){return n.get().each(e)};return{clear:function(){r(),n.set(w.none())},isSet:function(){return n.get().isSome()},get:function(){return n.get()},set:function(t){r(),n.set(w.some(t))}}},S=function(){return C((function(t){return t.unbind()}))},k=Array.prototype.push,T=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},O=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},_=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},E=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!u(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);k.apply(e,t[n])}return e}(T(t,e))},D=function(t){return function(t,e){return e>=0&&e<t.length?w.some(t[e]):w.none()}(t,0)},A=Object.keys,M=function(t){return void 0!==t.style&&s(t.style.getPropertyValue)},z=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},R={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return z(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return z(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return z(n)},fromDom:z,fromPoint:function(t,e,n){return w.from(t.dom.elementFromPoint(e,n)).map(z)}};"undefined"!=typeof window?window:Function("return this;")();var N=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},B=N(1),P=N(3),I=N(9),L=N(11),H=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},V=function(t){return R.fromDom(t.dom.ownerDocument)},F=function(t){return function(t){return w.from(t.dom.parentNode).map(R.fromDom)}(t).map(j).map((function(e){return _(e,(function(e){return n=e,!(t.dom===n.dom);var n}))})).getOr([])},j=function(t){return T(t.dom.childNodes,R.fromDom)},U=s(Element.prototype.attachShadow)&&s(Node.prototype.getRootNode),W=d(U),q=U?function(t){return R.fromDom(t.dom.getRootNode())}:function(t){return I(t)?t:V(t)},$=function(t){var e,n=q(t);return L(e=n)&&c(e.dom.host)?w.some(n):w.none()},G=function(t){return R.fromDom(t.dom.host)},K=function(t){return c(t.dom.shadowRoot)},X=function(t){var e=P(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return $(R.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=X,r=G,function(t){return n(r(t))}))},Y=function(t,e,n){!function(t,e,n){if(!(i(n)||a(n)||l(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)},J=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Q=function(t,e){t.dom.removeAttribute(e)},Z=function(t,e){var n=t.dom;!function(t,e){for(var n=A(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(e,(function(t,e){!function(t,e,n){if(!i(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);M(t)&&t.style.setProperty(e,n)}(n,e,t)}))},tt=function(t,e){return M(t)?t.style.getPropertyValue(e):""},et=function(t){var e,n,r=R.fromDom(function(t){if(W()&&c(t.target)){var e=R.fromDom(t.target);if(B(e)&&K(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return D(n)}}return w.from(t.target)}(t).getOr(t.target)),o=function(){return t.stopPropagation()},i=function(){return t.preventDefault()},u=(e=i,n=o,function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e(n.apply(null,t))});return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(r,t.clientX,t.clientY,o,i,u,t)},nt=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(et(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:g(rt,t,e,i,o)}},rt=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},ot=p,it=function(t,e,n){return function(t,e,n,r){return nt(t,e,n,r,!1)}(t,e,ot,n)},ut=function(t,e){return{left:t,top:e,translate:function(n,r){return ut(t+n,e+r)}}},at=ut,ct=function(t){var e=void 0===t?window:t;return w.from(e.visualViewport)},st=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},lt=function(t){var e=void 0===t?window:t,n=e.document,r=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return at(n,r)}(R.fromDom(n));return ct(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return st(r.left,r.top,n,o)}),(function(t){return st(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},ft=function(t,e,n){return ct(n).map((function(n){var r=function(t){return e(et(t))};return n.addEventListener(t,r),{unbind:function(){return n.removeEventListener(t,r)}}})).getOrThunk((function(){return{unbind:f}}))},dt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),mt=tinymce.util.Tools.resolve("tinymce.Env"),gt=tinymce.util.Tools.resolve("tinymce.util.Delay"),ht=function(t,e){t.fire("FullscreenStateChanged",{state:e})},pt=function(t){return t.getParam("fullscreen_native",!1,"boolean")},vt=function(t){var e=R.fromDom(t.getElement());return $(e).map(G).getOrThunk((function(){return function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return R.fromDom(e)}(V(e))}))},bt=function(t){return t.dom===(void 0!==(e=V(t).dom).fullscreenElement?e.fullscreenElement:void 0!==e.msFullscreenElement?e.msFullscreenElement:void 0!==e.webkitFullscreenElement?e.webkitFullscreenElement:null);var e},yt=function(t,e,n){return _(function(t,e){for(var n=s(e)?e:h,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=R.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o}(t,n),e)},wt=function(t){return function(t,e){var n,r=void 0===e?document:e.dom;return 1!==(n=r).nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount?[]:T(r.querySelectorAll(t),R.fromDom)}(t)},xt=function(t,e){return function(t,e){return _(F(t),e)}(t,(function(t){return H(t,e)}))},Ct="data-ephox-mobile-fullscreen-style",St="position:absolute!important;",kt="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",Tt=mt.os.isAndroid(),Ot=function(t){var e,n,r,o,i=(n="background-color",r=(e=t).dom,""!==(o=window.getComputedStyle(r).getPropertyValue(n))||X(e)?o:tt(r,n));return void 0!==i&&""!==i?"background-color:"+i+"!important":"background-color:rgb(255,255,255)!important;"},_t=function(t,e,n){var r,o,i=function(e){return function(n){var r=J(n,"style"),o=void 0===r?"no-styles":r.trim();o!==e&&(Y(n,Ct,o),Z(n,t.parseStyle(e)))}},u=(r="*",yt(e,(function(t){return H(t,r)}),o)),a=E(u,(function(t){return xt(t,"*:not(.tox-silver-sink)")})),c=Ot(n);O(a,i("display:none!important;")),O(u,i(St+kt+c)),i((!0===Tt?"":St)+kt+c)(e)},Et=dt.DOM,Dt=ct().fold((function(){return{bind:f,unbind:f}}),(function(t){var e,n=(e=C(f),x(x({},e),{on:function(t){return e.get().each(t)}})),r=S(),o=S(),i=gt.throttle((function(){document.body.scrollTop=0,document.documentElement.scrollTop=0,window.requestAnimationFrame((function(){n.on((function(e){return Z(e,{top:t.offsetTop+"px",left:t.offsetLeft+"px",height:t.height+"px",width:t.width+"px"})}))}))}),50);return{bind:function(t){n.set(t),i(),r.set(ft("resize",i)),o.set(ft("scroll",i))},unbind:function(){n.on((function(){r.clear(),o.clear()})),n.clear()}}})),At=function(t,e){var n,r,o,i,u=document.body,a=document.documentElement,c=t.getContainer(),s=R.fromDom(c),l=vt(t),f=e.get(),d=R.fromDom(t.getBody()),m=mt.deviceType.isTouch(),g=c.style,h=t.iframeElement.style,p=function(t){t(u,"tox-fullscreen"),t(a,"tox-fullscreen"),t(c,"tox-fullscreen"),$(s).map((function(t){return G(t).dom})).each((function(e){t(e,"tox-fullscreen"),t(e,"tox-shadowhost")}))},v=function(){var n,r;m&&(n=t.dom,r=wt("["+Ct+"]"),O(r,(function(t){var e=J(t,Ct);"no-styles"!==e?Z(t,n.parseStyle(e)):Q(t,"style"),Q(t,Ct)}))),p(Et.removeClass),Dt.unbind(),w.from(e.get()).each((function(t){return t.fullscreenChangeHandler.unbind()}))};if(f)f.fullscreenChangeHandler.unbind(),pt(t)&&bt(l)&&(r=V(l),(o=r.dom).exitFullscreen?o.exitFullscreen():o.msExitFullscreen?o.msExitFullscreen():o.webkitCancelFullScreen&&o.webkitCancelFullScreen()),h.width=f.iframeWidth,h.height=f.iframeHeight,g.width=f.containerWidth,g.height=f.containerHeight,g.top=f.containerTop,g.left=f.containerLeft,n=f.scrollPos,window.scrollTo(n.x,n.y),e.set(null),ht(t,!1),v(),t.off("remove",v);else{var b=it(V(l),void 0!==document.fullscreenElement?"fullscreenchange":void 0!==document.msFullscreenElement?"MSFullscreenChange":void 0!==document.webkitFullscreenElement?"webkitfullscreenchange":"fullscreenchange",(function(n){pt(t)&&(bt(l)||null===e.get()||At(t,e))})),y={scrollPos:lt(window),containerWidth:g.width,containerHeight:g.height,containerTop:g.top,containerLeft:g.left,iframeWidth:h.width,iframeHeight:h.height,fullscreenChangeHandler:b};m&&_t(t.dom,s,d),h.width=h.height="100%",g.width=g.height="",p(Et.addClass),Dt.bind(s),t.on("remove",v),e.set(y),pt(t)&&((i=l.dom).requestFullscreen?i.requestFullscreen():i.msRequestFullscreen?i.msRequestFullscreen():i.webkitRequestFullScreen&&i.webkitRequestFullScreen()),ht(t,!0)}},Mt=function(t,e){return function(n){n.setActive(null!==e.get());var r=function(t){return n.setActive(t.state)};return t.on("FullscreenStateChanged",r),function(){return t.off("FullscreenStateChanged",r)}}};e.add("fullscreen",(function(e){var r=t(null);return e.inline||(function(t,e){t.addCommand("mceFullScreen",(function(){At(t,e)}))}(e,r),function(t,e){var n=function(){return t.execCommand("mceFullScreen")};t.ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",icon:"fullscreen",shortcut:"Meta+Shift+F",onAction:n,onSetup:Mt(t,e)}),t.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:n,onSetup:Mt(t,e)})}(e,r),e.addShortcut("Meta+Shift+F","","mceFullScreen")),n(r)}))}(),function(){var t,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){return function(e){return typeof e===t}},r=(t="string",function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}),o=n("boolean"),i=n("function"),u=n("number"),a=function(){},c=function(t){return function(){return t}},s=function(t){return t},l=c(!1),f=c(!0),d=function(){return m},m=function(){var t=function(t){return t()},e=s;return{fold:function(t,e){return t()},isSome:l,isNone:f,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:c(null),getOrUndefined:c(void 0),or:e,orThunk:t,map:d,each:a,bind:d,exists:l,forall:f,filter:function(){return d()},toArray:function(){return[]},toString:c("none()")}}(),g=function(t){var e=c(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:f,isNone:l,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return g(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:m},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},h={some:g,none:d,from:function(t){return null==t?m:g(t)}},p=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},v=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},b={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return v(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return v(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return v(n)},fromDom:v,fromPoint:function(t,e,n){return h.from(t.dom.elementFromPoint(e,n)).map(v)}},y=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")};"undefined"!=typeof window?window:Function("return this;")();var w,x=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},C=x(1),S=x(3),k=x(9),T=x(11),O=function(t){return function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(t.dom.childNodes,b.fromDom)},_=function(t,e,n){!function(t,e,n){if(!(r(n)||o(n)||u(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)},E=function(t,e){t.dom.removeAttribute(e)},D=i(Element.prototype.attachShadow)&&i(Node.prototype.getRootNode)?function(t){return b.fromDom(t.dom.getRootNode())}:function(t){return k(t)?t:(e=t,b.fromDom(e.dom.ownerDocument));var e},A=function(t){var e,n=D(t);return T(e=n)&&null!=e.dom.host?h.some(n):h.none()},M=function(t){return b.fromDom(t.dom.host)},z=function(t){var e=S(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return A(b.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=z,r=M,function(t){return n(r(t))}))},R=function(t,e,n){return function(t,e,n){for(var r=t.dom,o=i(n)?n:l;r.parentNode;){r=r.parentNode;var u=b.fromDom(r);if(e(u))return h.some(u);if(o(u))break}return h.none()}(t,(function(t){return y(t,e)}),n)},N=function(t,e){return function(t){return void 0!==t.style&&i(t.style.getPropertyValue)}(t)?t.style.getPropertyValue(e):""},B=function(t){return"rtl"===function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||z(t)?r:N(n,e)}(t,"direction")?"rtl":"ltr"},P=function(t,e){return function(t,e){return function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(O(t),e)}(t,(function(t){return y(t,e)}))},I=function(t){return function(t){return h.from(t.dom.parentNode).map(b.fromDom)}(t).filter(C)},L=(w="li",function(t){return C(t)&&t.dom.nodeName.toLowerCase()===w}),H=function(t,e){var n=t.selection.getSelectedBlocks();n.length>0&&(p(n,(function(t){var n,r=b.fromDom(t),o=L(r),i=(n=r,(o?R(n,"ol,ul"):h.some(n)).getOr(n));I(i).each((function(t){if(B(t)!==e?_(i,"dir",e):B(i)!==e&&E(i,"dir"),o){var n=P(i,"li[dir]");p(n,(function(t){return E(t,"dir")}))}}))})),t.nodeChanged())},V=function(t,e){return function(n){var r=function(t){var r=b.fromDom(t.element);n.setActive(B(r)===e)};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}};e.add("directionality",(function(t){!function(t){t.addCommand("mceDirectionLTR",(function(){H(t,"ltr")})),t.addCommand("mceDirectionRTL",(function(){H(t,"rtl")}))}(t),function(t){t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return t.execCommand("mceDirectionLTR")},onSetup:V(t,"ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return t.execCommand("mceDirectionRTL")},onSetup:V(t,"rtl")})}(t)}))}(),tinymce.IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 01-1-1v-5c0-.6-.4-1-1-1a1 1 0 00-1 1v5c0 .6-.4 1-1 1a1 1 0 01-1-1V9H4a1 1 0 110-2h16c.6 0 1 .4 1 1s-.4 1-1 1z" fill-rule="nonzero"/></svg>',"action-next":'<svg width="24" height="24"><path fill-rule="nonzero" d="M5.7 7.3a1 1 0 00-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 10-1.4-1.4L12 13.6 5.7 7.3z"/></svg>',"action-prev":'<svg width="24" height="24"><path fill-rule="nonzero" d="M18.3 15.7a1 1 0 001.4-1.4L12 6.6l-7.7 7.7a1 1 0 001.4 1.4L12 9.4l6.3 6.3z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-justify":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-left":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5L13 7H5a1 1 0 110-2h9.2zm4 0h.8a1 1 0 010 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h6.8zm4 0H19a1 1 0 010 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h4.4zm4 0H19a1 1 0 010 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 010-2h2zm4 0h8a1 1 0 010 2H9.8l1.2-2zm5.2-13.5l1.3.7-9.7 16.3-1.3-.7 9.7-16.3z" fill-rule="evenodd"/></svg>',"align-right":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="M5.6 13l12 6a1 1 0 001.4-1V6a1 1 0 00-1.4-.9l-12 6a1 1 0 000 1.8z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 015 18V6a1 1 0 011.4-.9l12 6a1 1 0 010 1.8z" fill-rule="evenodd"/></svg>',bold:'<svg width="24" height="24"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 01-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4z" fill-rule="evenodd"/></svg>',bookmark:'<svg width="24" height="24"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 00-1 1z" fill-rule="nonzero"/></svg>',"border-style":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="2" x="3" y="6" rx="1"/><rect width="2.8" height="2" x="3" y="16" rx="1"/><rect width="2.8" height="2" x="6.8" y="16" rx="1"/><rect width="2.8" height="2" x="10.6" y="16" rx="1"/><rect width="2.8" height="2" x="14.4" y="16" rx="1"/><rect width="2.8" height="2" x="18.2" y="16" rx="1"/><rect width="8" height="2" x="3" y="11" rx="1"/><rect width="8" height="2" x="13" y="11" rx="1"/></g></svg>',"border-width":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="5" x="3" y="5" rx="1"/><rect width="18" height="3.5" x="3" y="11.5" rx="1"/><rect width="18" height="2" x="3" y="17" rx="1"/></g></svg>',brightness:'<svg width="24" height="24"><path d="M12 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 01-.7-.3A1 1 0 0111 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 01-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3h-1a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 01-.7.3H5a1 1 0 01-.7-.3A1 1 0 014 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7zm10 3.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 01-.8.3 1 1 0 01-.6-.3l-.8-.7a1 1 0 01-.3-.8c0-.2.1-.5.3-.7a1 1 0 011.4 0zm-10-7l-.7-.8a1 1 0 01-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.8-.3zm10 0a1 1 0 01-.8.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 010 1.4l-.8.8a1 1 0 01-.6.3 1 1 0 01-.8-.3 1 1 0 01-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 013.7 2.4 4 4 0 010 3.2A4 4 0 0112 16a4 4 0 01-3.7-2.4 4 4 0 010-3.2A4 4 0 0112 8zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7z" fill-rule="evenodd"/></svg>',browse:'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 11-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 01-1.4 1.4L13 13.4V20a1 1 0 01-2 0v-6.6z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 110 14.8 7.4 7.4 0 010-14.8zM12 3a9 9 0 100 18 9 9 0 000-18zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7z" fill-rule="nonzero"/></svg>',"cell-background-color":'<svg width="24" height="24"><path d="M15.7 2l1.6 1.6-2.7 2.6 5.9 5.8c.7.7.7 1.7 0 2.4l-6.3 6.1a1.7 1.7 0 01-2.4 0l-6.3-6.1c-.7-.7-.7-1.7 0-2.4L15.7 2zM18 12l-4.5-4L9 12h9zM4 16s2 2.4 2 3.8C6 21 5.1 22 4 22s-2-1-2-2.2C2 18.4 4 16 4 16z"/></svg>',"cell-border-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M5 13v5h2v2H5a2 2 0 01-2-2v-5h2zm8-7V4h6a2 2 0 012 2h-8z" opacity=".2"/><path fill-rule="nonzero" d="M13 4v2H5v7H3V6c0-1.1.9-2 2-2h8zm-2.6 14.1l.1-.1.1.1.2.3.2.2.2.2c.4.6.8 1.2.8 1.7 0 .8-.7 1.5-1.5 1.5S9 21.3 9 20.5c0-.5.4-1.1.8-1.7l.2-.2.2-.2.2-.3z"/><path d="M13 11l-2 2H5v-2h6V6h2z"/><path fill-rule="nonzero" d="M18.4 8l1 1-1.8 1.9 4 4c.5.4.5 1.1 0 1.6l-4.3 4.2a1.2 1.2 0 01-1.6 0l-4.4-4.2c-.4-.5-.4-1.2 0-1.7l7-6.8zm1.6 7l-3-3-3 3h6z"/></g></svg>',"change-case":'<svg width="24" height="24"><path d="M18.4 18.2v-.6c-.5.8-1.3 1.2-2.4 1.2-2.2 0-3.3-1.6-3.3-4.8 0-3.1 1-4.7 3.3-4.7 1.1 0 1.8.3 2.4 1.1v-.6c0-.5.4-.8.8-.8s.8.3.8.8v8.4c0 .5-.4.8-.8.8a.8.8 0 01-.8-.8zm-2-7.4c-1.3 0-1.8.9-1.8 3.2 0 2.4.5 3.3 1.7 3.3 1.3 0 1.8-.9 1.8-3.2 0-2.4-.5-3.3-1.7-3.3zM10 15.7H5.5l-.8 2.6a1 1 0 01-1 .7h-.2a.7.7 0 01-.7-1l4-12a1 1 0 012 0l4 12a.7.7 0 01-.8 1h-.2a1 1 0 01-1-.7l-.8-2.6zm-.3-1.5l-2-6.5-1.9 6.5h3.9z" fill-rule="evenodd"/></svg>',"character-count":'<svg width="24" height="24"><path d="M4 11.5h16v1H4v-1zm4.8-6.8V10H7.7V5.8h-1v-1h2zM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1zM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 01-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 00-.5-.1 1 1 0 00-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 00-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 001.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 00-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 00-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 01-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 01-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1z" fill-rule="evenodd"/></svg>',"checklist-rtl":'<svg width="24" height="24"><path d="M5 17h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm14.2 11c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 8c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checklist:'<svg width="24" height="24"><path d="M11 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8a1 1 0 010 2h-8a1 1 0 010-2zM7.2 16c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 8c-.2.3-.7.4-1 0L3.8 6.9a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checkmark:'<svg width="24" height="24"><path d="M18.2 5.4a1 1 0 011.6 1.2l-8 12a1 1 0 01-1.5.1l-5-5a1 1 0 111.4-1.4l4.1 4.1 7.4-11z" fill-rule="nonzero"/></svg>',"chevron-down":'<svg width="10" height="10"><path d="M8.7 2.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2L5.7 7.8c-.3.3-.9.3-1.2 0L.2 3.4a.8.8 0 010-1.2c.3-.3.8-.3 1.1 0L5 6l3.7-3.8z" fill-rule="nonzero"/></svg>',"chevron-left":'<svg width="10" height="10"><path d="M7.8 1.3L4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 010-1.2L6.6.2C7 0 7.4 0 7.8.2c.3.3.3.8 0 1.1z" fill-rule="nonzero"/></svg>',"chevron-right":'<svg width="10" height="10"><path d="M2.2 1.3a.8.8 0 010-1c.4-.4.9-.4 1.2 0l4.4 4.1c.3.4.3.9 0 1.2L3.4 9.8c-.3.3-.8.3-1.2 0a.8.8 0 010-1.1L6 5 2.2 1.3z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8L5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 010-1.2l4.1-4.4c.3-.3.9-.3 1.2 0l4.2 4.4c.3.3.3.9 0 1.2-.3.3-.8.3-1.1 0z" fill-rule="nonzero"/></svg>',close:'<svg width="24" height="24"><path d="M17.3 8.2L13.4 12l3.9 3.8a1 1 0 01-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 01-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 011.5-1.5l3.8 3.9 3.8-3.9a1 1 0 011.5 1.5z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 01-.8 2 2.8 2.8 0 01.8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 01-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 01-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 01-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 01.8-2 2.8 2.8 0 01-.8-2zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2zM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 01-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 01-.5-.5V17a3 3 0 001-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5z" fill-rule="evenodd"/></svg>',"color-levels":'<svg width="24" height="24"><path d="M17.5 11.4A9 9 0 0118 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 01-3.7 3 5.7 5.7 0 01-3.2 0A5.9 5.9 0 017.6 18a6.2 6.2 0 01-1.4-2.6 6.7 6.7 0 010-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 012.3-4A20 20 0 0112 4a26.4 26.4 0 013.2 3.4 18.2 18.2 0 012.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 00-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 01-1.3 3 5.3 5.3 0 01-2.3 1.5 4.9 4.9 0 01-2 .1 4.3 4.3 0 002.4.8 4 4 0 002-.6 4 4 0 001.5-1.5z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 000 18 1.5 1.5 0 001.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 005-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3-4a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm5 0a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3 4a1.5 1.5 0 110-3 1.5 1.5 0 010 3z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3L3 21" fill-rule="evenodd"/></svg>',"color-swatch":'<svg width="24" height="24"><rect x="3" y="3" width="18" height="18" rx="1" fill-rule="evenodd"/></svg>',"comment-add":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/><path d="M13 10h2a1 1 0 010 2h-2v2a1 1 0 01-2 0v-2H9a1 1 0 010-2h2V8a1 1 0 012 0v2z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-6 8a6 6 0 006 6V6a6 6 0 00-6 6z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 00-2 2v11h2V5h10V3zm1 4a2 2 0 012 2v10a2 2 0 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7zm0 12V9h-7v10h7z" fill-rule="nonzero"/></svg>',crop:'<svg width="24" height="24"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 01-1-1v-2H7V9H5a1 1 0 110-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3zM9 9v5l5-5H9zm1 6h5v-5l-5 5z" fill-rule="evenodd"/></svg>',"cut-column":'<svg width="24" height="24"><path fill-rule="evenodd" d="M7.2 4.5c.9 0 1.6.4 2.2 1A3.7 3.7 0 0110.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 012 0c.4 0 .7.3 1 .5L17 8h4v13h-6V10l-1.5 1.5.5.5v4l-2.5-2.5-1 1v.5c0 .4 0 .8-.3 1.2-.2.5-.4.9-.8 1.2-.6.7-1.3 1-2.2 1-.8.2-1.5 0-2-.6l-.5-.8-.2-1c0-.4 0-.8.3-1.2A3.9 3.9 0 017 12.7c.5-.2 1-.3 1.5-.2l1-1-1-1c-.5 0-1 0-1.5-.2-.5-.1-1-.4-1.4-.9-.4-.3-.6-.7-.8-1.2L4.5 7c0-.4 0-.7.2-1 0-.3.3-.6.5-.8.5-.5 1.2-.8 2-.7zm12.3 5h-3v10h3v-10zM8 13.8h-.3l-.4.2a2.8 2.8 0 00-.7.4v.1a2.8 2.8 0 00-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 00.8-.3 2.4 2.4 0 00.7-.7 2.5 2.5 0 00.3-.8 1.5 1.5 0 000-.8 1 1 0 00-.2-.4 1 1 0 00-.5-.2H8zm3.5-3.7c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zM7 5.8h-.4a1 1 0 00-.5.3 1 1 0 00-.2.5v.7a2.5 2.5 0 00.3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 000-.8 2.6 2.6 0 00-.3-.8A2.5 2.5 0 007.7 6l-.4-.1H7z"/></svg>',"cut-row":'<svg width="24" height="24"><path fill-rule="evenodd" d="M22 3v5H9l3 3 2-2h4l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8.7.6 1 1.3 1 2.2.2.8 0 1.5-.6 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 01-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l2 2V3h14zM8.5 15.3h-.3a2.6 2.6 0 00-.8.4 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3L9 18V18l.4-.4.2-.4.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2h-.5zm7 0H15a1 1 0 00-.4.3 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4a2.8 2.8 0 00.5.7h.1a2.8 2.8 0 00.8.6l.4.1h.7l.5-.2.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3h-.3zM12 11.6c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zm8.5-7.1h-11v2h11v-2z"/></svg>',cut:'<svg width="24" height="24"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 01-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 010 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8zm-8.5 2.2l.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2 1.6 1.6 0 00-.8 0 2.6 2.6 0 00-.8.3 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3 2.8 2.8 0 001-1zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4zm5.4 4l.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3 1.5 1.5 0 00-.8 0 1 1 0 00-.4.2 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4l.3.4.3.4a2.8 2.8 0 00.8.5l.4.1h.7l.5-.2z" fill-rule="evenodd"/></svg>',"document-properties":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',drag:'<svg width="24" height="24"><path d="M13 5h2v2h-2V5zm0 4h2v2h-2V9zM9 9h2v2H9V9zm4 4h2v2h-2v-2zm-4 0h2v2H9v-2zm0 4h2v2H9v-2zm4 0h2v2h-2v-2zM9 5h2v2H9V5z" fill-rule="evenodd"/></svg>',"duplicate-column":'<svg width="24" height="24"><path d="M17 6v16h-7V6h7zm-2 2h-3v12h3V8zm-2-6v2H8v15H6V2h7z"/></svg>',"duplicate-row":'<svg width="24" height="24"><path d="M22 11v7H6v-7h16zm-2 2H8v3h12v-3zm-1-6v2H4v5H2V7h17z"/></svg>',duplicate:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10zm3 8h-2V9h-7v10h9a2 2 0 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7a2 2 0 012 2v2z"/><path d="M17 14h1a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1h-1a1 1 0 010-2h1v-1a1 1 0 012 0v1z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19.8 8.8l-9.4 9.4c-.2.2-.5.4-.9.4l-5.4 1.2 1.2-5.4.5-.8 9.4-9.4c.7-.7 1.8-.7 2.5 0l2.1 2.1c.7.7.7 1.8 0 2.5zm-2-.2l1-.9v-.3l-2.2-2.2a.3.3 0 00-.3 0l-1 1L18 8.5zm-1 1l-2.5-2.4-6 6 2.5 2.5 6-6zm-7 7.1l-2.6-2.4-.3.3-.1.2-.7 3 3.1-.6h.1l.4-.5z"/></svg>',"edit-image":'<svg width="24" height="24"><path d="M18 16h2V7a2 2 0 00-2-2H7v2h11v9zM6 17h15a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1H6a2 2 0 01-2-2V7H3a1 1 0 110-2h1V4a1 1 0 112 0v13zm3-5.3l1.3 2 3-4.7 3.7 6H7l2-3.3z" fill-rule="nonzero"/></svg>',"embed-page":'<svg width="24" height="24"><path d="M19 6V5H5v14h2A13 13 0 0119 6zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 008 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 00-4 4.5h2.2zm-3.4 0a12 12 0 012.8-4 12 12 0 00-5 4h2.2z" fill-rule="nonzero"/></svg>',embed:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 010 .8l-5.6 4A.5.5 0 019 16V8a.5.5 0 01.8-.4z" fill-rule="nonzero"/></svg>',emoji:'<svg width="24" height="24"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-1 1c0 .6.4 1 1 1zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5zM12 4a8 8 0 100 16 8 8 0 000-16zm0 14.5a6.5 6.5 0 110-13 6.5 6.5 0 010 13z" fill-rule="nonzero"/></svg>',export:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3L18 7v1h-5V5H7v14h9a1 1 0 012 0c0 1-.8 2-1.9 2H7c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h7.5z"/><path d="M18.1 12c.5 0 .9.4.9 1 0 .5-.3 1-.8 1h-7.3c-.5 0-.9-.4-.9-1 0-.5.3-1 .8-1h7.3z"/><path d="M16.4 9.2a1 1 0 011.4.2l2.4 3.6-2.4 3.6a1 1 0 01-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 01.2-1.4z"/></g></svg>',fill:'<svg width="24" height="26"><path d="M16.6 12l-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 002.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 002-2c0-1.3-2-3.5-2-3.5z" fill-rule="nonzero"/></svg>',"flip-horizontally":'<svg width="24" height="24"><path d="M14 19h2v-2h-2v2zm4-8h2V9h-2v2zM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 00-2 2zm14-2v2h2a2 2 0 00-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 002-2h-2v2z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 00-2 2v3h2V6h10v3h2V6a2 2 0 00-2-2zm2 14h-2v2a2 2 0 002-2zM3 11v2h18v-2H3zm6 7v2h2v-2H9zm8-4v2h2v-2h-2zM5 18c0 1.1.9 2 2 2v-2H5z" fill-rule="nonzero"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 00-1 1v4c0 .6.5 1 1 1h12c.6 0 1-.4 1-1V7h1v4H9v9c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7h8V5h-3z" fill-rule="nonzero"/></svg>',format:'<svg width="24" height="24"><path fill-rule="evenodd" d="M17 5a1 1 0 010 2h-4v11a1 1 0 01-2 0V7H7a1 1 0 110-2h10z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 110-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 11-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 111.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 110-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 110 1.7H5a.9.9 0 01-.9-.9v-4.4a.9.9 0 111.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 01-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 010 1.8H7l3 2.9-1.3 1.2z" fill-rule="nonzero"/></svg>',gallery:'<svg width="24" height="24"><path fill-rule="nonzero" d="M5 15.7l2.3-2.2c.3-.3.7-.3 1 0L11 16l5.1-5c.3-.4.8-.4 1 0l2 1.9V8H5v7.7zM5 18V19h3l1.8-1.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 01-1-1V7c0-.6.4-1 1-1zm6 7a2 2 0 110-4 2 2 0 010 4zM4.5 4h15a.5.5 0 110 1h-15a.5.5 0 010-1zm2-2h11a.5.5 0 110 1h-11a.5.5 0 010-1z"/></svg>',gamma:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 00-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 01.6.5l.1.3a8.5 8.5 0 01.3.6l1.9 4.6 2-5.2a1 1 0 011-.6.5.5 0 01.5.6L13 14v2.8a.7.7 0 01-1.4 0z" fill-rule="nonzero"/></svg>',help:'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M12 5.5a6.5 6.5 0 00-6 9 6.3 6.3 0 001.4 2l1 1a6.3 6.3 0 003.6 1 6.5 6.5 0 006-9 6.3 6.3 0 00-1.4-2l-1-1a6.3 6.3 0 00-3.6-1zM12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4z"/><path d="M9.6 9.7a.7.7 0 01-.7-.8c0-1.1 1.5-1.8 3.2-1.8 1.8 0 3.2.8 3.2 2.4 0 1.4-.4 2.1-1.5 2.8-.2 0-.3.1-.3.2a2 2 0 00-.8.8.8.8 0 01-1.4-.6c.3-.7.8-1 1.3-1.5l.4-.2c.7-.4.8-.6.8-1.5 0-.5-.6-.9-1.7-.9-.5 0-1 .1-1.4.3-.2 0-.3.1-.3.2v-.2c0 .4-.4.8-.8.8z" fill-rule="nonzero"/><circle cx="12" cy="16" r="1"/></g></svg>',"highlight-bg-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-highlight-bg-color__color" d="M3 18h18v3H3z"/><path fill-rule="nonzero" d="M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zm5-7.5L11 7.4l3-2.9a2 2 0 012.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6"/></g></svg>',home:'<svg width="24" height="24"><path fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>',"horizontal-rule":'<svg width="24" height="24"><path d="M4 11h16v2H4z" fill-rule="evenodd"/></svg>',"image-options":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="M5 15.7l3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7zM5 18V19h3l2.8-2.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 100-4 2 2 0 000 4z" fill-rule="nonzero"/></svg>',indent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-1 3v2h2V7h-2zm3 10v-1h-1v-5h-3v1h1v4h-1v1h4z" fill-rule="evenodd"/></svg>',"insert-character":'<svg width="24" height="24"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 001.8-2.9 6.3 6.3 0 00-.1-4.1 5.8 5.8 0 00-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 00-3.9 1.8 6.3 6.3 0 00-1.3 6 6.2 6.2 0 001.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 014 11c0-1 .2-1.9.6-2.7A7 7 0 016.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 015.7 2 7 7 0 011.7 2.3 6 6 0 01.2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 01-3.6 2.5v.5z" fill-rule="evenodd"/></svg>',"insert-time":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M12 19a7 7 0 100-14 7 7 0 000 14zm0 2a9 9 0 110-18 9 9 0 010 18z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 00-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3L16.5 18a5.8 5.8 0 01-3.1 1.9 6.1 6.1 0 01-5.5-1.6A5.8 5.8 0 016 14v-.3l.1-1.2A13.9 13.9 0 017.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 00.2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 00-3-4.2L12 6a26.1 26.1 0 00-2.2 2.5l-1-1a20.9 20.9 0 012.9-3.3L12 4l1 .8a22.2 22.2 0 014 5.4c.6 1.2 1 2.4 1 3.6z" fill-rule="evenodd"/></svg>',italic:'<svg width="24" height="24"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8z" fill-rule="evenodd"/></svg>',language:'<svg width="24" height="24"><path d="M12 3a9 9 0 110 18 9 9 0 010-18zm4.3 13.3c-.5 1-1.2 2-2 2.9a7.5 7.5 0 003.2-2.1l-.2-.2a6 6 0 00-1-.6zm-8.6 0c-.5.2-.9.5-1.2.8.9 1 2 1.7 3.2 2a10 10 0 01-2-2.8zm3.6-.8c-.8 0-1.6.1-2.2.3.5 1 1.2 1.9 2.1 2.7zm1.5 0v3c.9-.8 1.6-1.7 2.1-2.7-.6-.2-1.4-.3-2.1-.3zm-6-2.7H4.5c.2 1 .5 2.1 1 3h.3l1.3-1a10 10 0 01-.3-2zm12.7 0h-2.3c0 .7-.1 1.4-.3 2l1.6 1.1c.5-1 .9-2 1-3.1zm-3.8 0h-3V14c1 0 2 .1 2.7.4.2-.5.3-1 .3-1.6zm-4.4 0h-3l.3 1.6c.8-.3 1.7-.4 2.7-.4v-1.3zm-5.5-5c-.7 1-1.1 2.2-1.3 3.5h2.3c0-1 .2-1.8.5-2.6l-1.5-1zm2.9 1.4v.1c-.2.6-.4 1.3-.4 2h3V9.4c-1 0-1.8-.1-2.6-.3zm6.6 0h-.1l-2.4.3v1.8h3l-.5-2.1zm3-1.4l-.3.1-1.3.8c.3.8.5 1.6.5 2.6h2.3a7.5 7.5 0 00-1.3-3.5zm-9 0l2 .2V5.5a9 9 0 00-2 2.2zm3.5-2.3V8c.6 0 1.3 0 1.9-.2a9 9 0 00-2-2.3zm-3-.7h-.1c-1.1.4-2.1 1-3 1.8l1.2.7a10 10 0 011.9-2.5zm4.4 0l.1.1a10 10 0 011.8 2.4l1.1-.7a7.5 7.5 0 00-3-1.8z"/></svg>',"line-height":'<svg width="24" height="24"><path d="M21 5a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zM7 3.6l3.7 3.7a1 1 0 01-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 011.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 011.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 01-1.3 0h-.1a1 1 0 010-1.3v-.1L7 3.6z"/></svg>',line:'<svg width="24" height="24"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1zM4 18h16v2H4v-2z" fill-rule="evenodd"/></svg>',link:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2.1 2a2 2 0 102.7 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2-2a2 2 0 10-2.6-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2z" fill-rule="nonzero"/></svg>',"list-bull-circle":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M11 16a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 26a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 36a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6z" fill-rule="nonzero"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-default":'<svg width="48" height="48"><g fill-rule="evenodd"><circle cx="11" cy="14" r="3"/><circle cx="11" cy="24" r="3"/><circle cx="11" cy="34" r="3"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-square":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M8 11h6v6H8zM8 21h6v6H8zM8 31h6v6H8z"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-num-default-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 17v-4.8l-1.6 1v-1.1l1.6-1h1.2V17zM33.3 17.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm1.7 5.7c0-1.2 1-2 2.2-2 1.3 0 2.1.8 2.1 1.8 0 .7-.3 1.2-1.3 2.2l-1.2 1v.2h2.6v1h-4.3v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H35zm-1.7 4.3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm3.2 7.3v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H35c0-1.1 1-1.8 2.2-1.8 1.2 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.7.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .6 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm-3.3 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-default":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10 17v-4.8l-1.5 1v-1.1l1.6-1h1.2V17h-1.2zm3.6.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-5 5.7c0-1.2.8-2 2.1-2s2.1.8 2.1 1.8c0 .7-.3 1.2-1.4 2.2l-1.1 1v.2h2.6v1H8.6v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H8.5zm6.3 4.3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM10 34.4v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H8.6c0-1.1 1-1.8 2.2-1.8 1.3 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.8.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .7 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm4.7 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-lower-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M36.5 16c-.9 0-1.5-.5-1.5-1.3s.6-1.3 1.8-1.4h1v-.4c0-.4-.2-.6-.7-.6-.4 0-.7.1-.8.4h-1.1c0-.8.8-1.4 2-1.4S39 12 39 13V16h-1.2v-.6c-.3.4-.8.7-1.4.7zm.4-.8c.6 0 1-.4 1-.9V14h-1c-.5.1-.7.3-.7.6 0 .4.3.6.7.6zM33.1 16.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zM37.7 26c-.7 0-1.2-.2-1.5-.7v.7H35v-6.3h1.2v2.5c.3-.5.8-.9 1.5-.9 1.1 0 1.8 1 1.8 2.4 0 1.5-.7 2.4-1.8 2.4zm-.5-3.6c-.6 0-1 .5-1 1.3s.4 1.4 1 1.4c.7 0 1-.6 1-1.4 0-.8-.3-1.3-1-1.3zM33.2 26.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm6 7h-1c-.1-.5-.4-.8-1-.8s-1 .5-1 1.4c0 1 .4 1.4 1 1.4.5 0 .9-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm-6.1 3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.3 15.2c.5 0 1-.4 1-.9V14h-1c-.5.1-.8.3-.8.6 0 .4.3.6.8.6zm-.4.9c-1 0-1.5-.6-1.5-1.4 0-.8.6-1.3 1.7-1.4h1.1v-.4c0-.4-.2-.6-.7-.6-.5 0-.8.1-.9.4h-1c0-.8.8-1.4 2-1.4 1.1 0 1.8.6 1.8 1.6V16h-1.1v-.6h-.1c-.2.4-.7.7-1.3.7zm4.6 0c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-3.2 10c-.6 0-1.2-.3-1.4-.8v.7H8.5v-6.3H10v2.5c.3-.5.8-.9 1.4-.9 1.2 0 1.9 1 1.9 2.4 0 1.5-.7 2.4-1.9 2.4zm-.4-3.7c-.7 0-1 .5-1 1.3s.3 1.4 1 1.4c.6 0 1-.6 1-1.4 0-.8-.4-1.3-1-1.3zm4 3.7c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-2.2 7h-1.2c0-.5-.4-.8-.9-.8-.6 0-1 .5-1 1.4 0 1 .4 1.4 1 1.4.5 0 .8-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm1.8 3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-greek-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 16c-1.2 0-2-.8-2-2.3 0-1.5.8-2.4 2-2.4.6 0 1 .4 1.3 1v-.9H40v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1-.7h-.2c-.2.4-.7.8-1.3.8zm.3-1c.6 0 1-.5 1-1.3s-.4-1.3-1-1.3-1 .5-1 1.3.4 1.4 1 1.4zM33.3 16.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM36 21.9c0-1.5.8-2.3 2.1-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.9 1.3.9.3 1.3.8 1.3 1.7 0 1.2-.7 1.9-1.8 1.9-.6 0-1.1-.3-1.4-.8v2.2H36V22zm1.8 1.2v-1h.3c.5 0 .9-.2.9-.7 0-.5-.3-.8-.9-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1 1.3s1-.4 1-1-.4-1-1.2-1h-.3zM33.3 26.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM37.1 34.6L34.8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.2.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 00-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zM33.3 36.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-greek":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.5 15c.7 0 1-.5 1-1.3s-.3-1.3-1-1.3c-.5 0-.9.5-.9 1.3s.4 1.4 1 1.4zm-.3 1c-1.1 0-1.8-.8-1.8-2.3 0-1.5.7-2.4 1.8-2.4.7 0 1.1.4 1.3 1h.1v-.9h1.2v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1.1-.7h-.1c-.2.4-.7.8-1.4.8zm5 .1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm-4.9 7v-1h.3c.6 0 1-.2 1-.7 0-.5-.4-.8-1-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1.1 1.3.6 0 1-.4 1-1s-.5-1-1.3-1h-.3zM8.6 22c0-1.5.7-2.3 2-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.8 1.3.8.3 1.3.8 1.3 1.7 0 1.2-.8 1.9-1.9 1.9-.6 0-1.1-.3-1.3-.8v2.2H8.5V22zm6.2 4.2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-4.5 8.5L8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.1.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 00-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zm4.5.5c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M32.9 16v-1.2h-1.3V16H33zm0 10v-1.2h-1.3V26H33zm0 10v-1.2h-1.3V36H33z"/><path fill-rule="nonzero" d="M36 21h-1.5v5H36zM36 31h-1.5v5H36zM39 21h-1.5v5H39zM39 31h-1.5v5H39zM42 31h-1.5v5H42zM36 11h-1.5v5H36zM36 19h-1.5v1H36zM36 29h-1.5v1H36zM39 19h-1.5v1H39zM39 29h-1.5v1H39zM42 29h-1.5v1H42zM36 9h-1.5v1H36z"/></g></svg>',"list-num-lower-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15zm0 10v-1.2h1.3V26H15zm0 10v-1.2h1.3V36H15z"/><path fill-rule="nonzero" d="M12 21h1.5v5H12zM12 31h1.5v5H12zM9 21h1.5v5H9zM9 31h1.5v5H9zM6 31h1.5v5H6zM12 11h1.5v5H12zM12 19h1.5v1H12zM12 29h1.5v1H12zM9 19h1.5v1H9zM9 29h1.5v1H9zM6 29h1.5v1H6zM12 9h1.5v1H12z"/></g></svg>',"list-num-upper-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M39.3 17l-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3zm-1.6-4.7l-.7 2.3h1.6l-.8-2.3zM33.4 17c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm4.7 9.9h-2.7v-6H38c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zm-1.4-5v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4h1.1c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9h-1.1V26zM33 27.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm4.9 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm-4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-upper-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M12.6 17l-.5-1.4h-2L9.5 17H8.3l2-6H12l2 6h-1.3zM11 12.3l-.7 2.3h1.6l-.8-2.3zm4.7 4.8c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zM11.4 27H8.7v-6h2.6c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zM10 22v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4H11c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9H10V26zm5.4 1.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-4.1 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-upper-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M31.6 17v-1.2H33V17h-1.3zm0 10v-1.2H33V27h-1.3zm0 10v-1.2H33V37h-1.3z"/><path fill-rule="nonzero" d="M34.5 20H36v7h-1.5zM34.5 30H36v7h-1.5zM37.5 20H39v7h-1.5zM37.5 30H39v7h-1.5zM40.5 30H42v7h-1.5zM34.5 10H36v7h-1.5z"/></g></svg>',"list-num-upper-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15zm0 10v-1.2h1.3V27H15zm0 10v-1.2h1.3V37H15z"/><path fill-rule="nonzero" d="M12 20h1.5v7H12zM12 30h1.5v7H12zM9 20h1.5v7H9zM9 30h1.5v7H9zM6 30h1.5v7H6zM12 10h1.5v7H12z"/></g></svg>',lock:'<svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3zM10 8v3h4V8a1 1 0 00-.3-.7A1 1 0 0013 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 017.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="M15 13l2-2v8H5V7h8l-2 2H7v8h8v-4zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19z" fill-rule="evenodd"/></svg>',"non-breaking":'<svg width="24" height="24"><path d="M11 11H8a1 1 0 110-2h3V6c0-.6.4-1 1-1s1 .4 1 1v3h3c.6 0 1 .4 1 1s-.4 1-1 1h-3v3c0 .6-.4 1-1 1a1 1 0 01-1-1v-3zm10 4v5H3v-5c0-.6.4-1 1-1s1 .4 1 1v3h14v-3c0-.6.4-1 1-1s1 .4 1 1z" fill-rule="evenodd"/></svg>',notice:'<svg width="24" height="24"><path d="M17.8 9.8L15.4 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7l2.3 5.8zm0 0l2.2 5.7-2.3-5.8zM13 17v-2h-2v2h2zm0-4V7h-2v6h2z" fill-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 110-2zm13-1v3.5a.5.5 0 11-1 0V5h-.5a.5.5 0 110-1H19zm-1 8.8l.2.2h1.3a.5.5 0 110 1h-1.6a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2h-1.3a.5.5 0 01-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zm2 4.2v2c0 .6-.4 1-1 1h-1.5a.5.5 0 010-1h1.2a.3.3 0 100-.6h-1.3a.4.4 0 110-.8h1.3a.3.3 0 000-.6h-1.2a.5.5 0 110-1H19c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',"ordered-list":'<svg width="24" height="24"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 110-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 01-.5-.5V5h-.5a.5.5 0 010-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2H4.5a.5.5 0 01-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 010-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 110-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 110-1H6c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4L1 13l6.4 6.5 6.5-6.5-6.5-6.5zM3.7 13l3.6-3.7L11 13l-3.7 3.7-3.6-3.7zM12 6l2.8 2.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0L9.2 5.7a.8.8 0 010-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 11-4.3 16.9l1.5-1.5A7 7 0 1013 6h-1z" fill-rule="nonzero"/></svg>',outdent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm1.6-3.8a1 1 0 01-1.2 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 011.2 1.6L6.8 12l1.8 1.2z" fill-rule="evenodd"/></svg>',"page-break":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 22a1 1 0 01-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 01-1-1v-5H7v5c0 .6-.4 1-1 1z"/></g></svg>',paragraph:'<svg width="24" height="24"><path fill-rule="evenodd" d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm8 7v12h-6V8h6zm-1.5 1.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm-2 7v12H4V8h6zM8.5 9.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 11v5H8v-5h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h12v-4h2v4c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 7v5H8V8h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2z" fill-rule="nonzero"/></svg>',paste:'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1z" fill-rule="nonzero"/></svg>',"permanent-pen":'<svg width="24" height="24"><path d="M10.5 17.5L8 20H3v-3l3.5-3.5a2 2 0 010-3L14 3l1 1-7.3 7.3a1 1 0 000 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 01-2.8 0l-.1-.1z" fill-rule="nonzero"/></svg>',plus:'<svg width="24" height="24"><path d="M12 4c.5 0 1 .4 1 .9V11h6a1 1 0 01.1 2H13v6a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H11V5c0-.6.4-1 1-1z"/></svg>',preferences:'<svg width="24" height="24"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 01-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 01-1.4 0l-1.5-1.2a6.2 6.2 0 01-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 01-1-.9l-.2-1.9a5.8 5.8 0 01-1.5-.6l-1.5 1.2a1 1 0 01-1.4 0l-.7-.7a1 1 0 010-1.4l1.2-1.5a6.2 6.2 0 01-.6-1.5l-1.9-.2a1 1 0 01-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 01.6-1.5L5.2 7.3a1 1 0 010-1.4l.7-.7a1 1 0 011.4 0l1.5 1.2a6.2 6.2 0 011.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 011.5.6l1.5-1.2a1 1 0 011.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 01.6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 100-6 3 3 0 000 6z" fill-rule="evenodd"/></svg>',preview:'<svg width="24" height="24"><path d="M3.5 12.5c.5.8 1.1 1.6 1.8 2.3 2 2 4.2 3.2 6.7 3.2s4.7-1.2 6.7-3.2a16.2 16.2 0 002.1-2.8 15.7 15.7 0 00-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 00-6.7 3.2A16.2 16.2 0 003.2 12c0 .2.2.3.3.5zm-2.4-1l.7-1.2L4 7.8C6.2 5.4 8.9 4 12 4c3 0 5.8 1.4 8.1 3.8a18.2 18.2 0 012.8 3.7v1l-.7 1.2-2.1 2.5c-2.3 2.4-5 3.8-8.1 3.8-3 0-5.8-1.4-8.1-3.8a18.2 18.2 0 01-2.8-3.7 1 1 0 010-1zm12-3.3a2 2 0 102.7 2.6 4 4 0 11-2.6-2.6z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 00-3 3v6h2v3h14v-3h2v-6a3 3 0 00-3-3zm-1 10H7v-4h10v4zm.5-5c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5zm.5-8H6v2h12V5z" fill-rule="nonzero"/></svg>',quote:'<svg width="24" height="24"><path d="M7.5 17h.9c.4 0 .7-.2.9-.6L11 13V8c0-.6-.4-1-1-1H6a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3z" fill-rule="nonzero"/></svg>',redo:'<svg width="24" height="24"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 11-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 111.4-1.4l5 5a1 1 0 010 1.4l-5 5a1 1 0 01-1.4-1.4l3.3-3.3z" fill-rule="nonzero"/></svg>',reload:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M5 22.1l-1.2-4.7v-.2a1 1 0 011-1l5 .4a1 1 0 11-.2 2l-2.2-.2a7.8 7.8 0 008.4.2 7.5 7.5 0 003.5-6.4 1 1 0 112 0 9.5 9.5 0 01-4.5 8 9.9 9.9 0 01-10.2 0l.4 1.4a1 1 0 11-2 .5zM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 00-9.5-1 7.5 7.5 0 00-3.6 7 1 1 0 01-2 0 9.5 9.5 0 014.5-8.6 10 10 0 0110.9.3l-.3-1a1 1 0 012-.5l1.1 4.8a1 1 0 01-1 1.2l-5-.4a1 1 0 01-.9-1z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 010 .2l-2.6 10a1 1 0 01-1 .8h-.2a.8.8 0 01-.8-1l2.6-10H8a1 1 0 110-2h9a1 1 0 010 2h-3.8zM5 18h7a1 1 0 010 2H5a1 1 0 010-2zm13 1.5L16.5 18 15 19.5a.7.7 0 01-1-1l1.5-1.5-1.5-1.5a.7.7 0 011-1l1.5 1.5 1.5-1.5a.7.7 0 011 1L17.5 17l1.5 1.5a.7.7 0 01-1 1z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 010 2h-1v9a3 3 0 01-3 3H9a3 3 0 01-3-3V9H5a1 1 0 110-2h3V6a3 3 0 013-3h2a3 3 0 013 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 00-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 012 0v4a1 1 0 01-2 0v-4zm4 0a1 1 0 012 0v4a1 1 0 01-2 0v-4z" fill-rule="nonzero"/></svg>',"resize-handle":'<svg width="10" height="10"><g fill-rule="nonzero"><path d="M8.1 1.1A.5.5 0 119 2l-7 7A.5.5 0 111 8l7-7zM8.1 5.1A.5.5 0 119 6l-3 3A.5.5 0 115 8l3-3z"/></g></svg>',resize:'<svg width="24" height="24"><path d="M4 5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h6c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3H7.4L18 16.6V13c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v6c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-6a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3A1 1 0 014 11V5z" fill-rule="evenodd"/></svg>',"restore-draft":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1z"/><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 012 0v6c0 .6-.4 1-1 1h-6a1 1 0 010-2h4.3L16 7A7.2 7.2 0 007.7 6a7 7 0 003 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 011.4 1.5A9.2 9.2 0 012.2 14c-.9-3.9 1-8 4.5-9.9 3.5-1.9 8-1.3 10.8 1.5L20 8z" fill-rule="nonzero"/></svg>',rtl:'<svg width="24" height="24"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 014.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L8 5zm12 11.2a1 1 0 11-1 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 111 1.6L18.4 15l1.8 1.2z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 10-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 10-1.4-1.4L13 11.6V4a1 1 0 00-2 0v7.6z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 00-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 00-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 002-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2zM7 17h10V7H7v10zm2-8h6v6H9V9z" fill-rule="nonzero"/></svg>',selected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm3.6 10.9L7 12.3a.7.7 0 00-1 1L9.6 17 18 8.6a.7.7 0 000-1 .7.7 0 00-1 0l-7.4 7.3z"/></svg>',settings:'<svg width="24" height="24"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V8H5a1 1 0 110-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6zM8 8h2V6H8v2zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V13H5a1 1 0 010-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6zM14 13h2v-2h-2v2zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V18H5a1 1 0 010-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6zM8 18h2v-2H8v2z" fill-rule="evenodd"/></svg>',sharpen:'<svg width="24" height="24"><path d="M16 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2z" fill-rule="evenodd"/></svg>',sourcecode:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 010-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7zM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 00-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7z"/></g></svg>',"spell-check":'<svg width="24" height="24"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6zm0-3v2h2V5H6zm13 0h-3v5h3v1h-3a1 1 0 01-.7-.3 1 1 0 01-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12z" fill-rule="evenodd"/></svg>',"strike-through":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 017 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1z"/><path d="M5 11h14a1 1 0 010 2H5a1 1 0 010-2z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="M10.4 10l4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10zM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 00-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 01-1.3 1.3l-.6.6h2.6V19z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4L10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11z" fill-rule="nonzero"/></svg>',"table-caption":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="12" height="2" x="3" y="4" rx="1"/><path d="M19 8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2v-8c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-5h-6v3h6v-3zM5 13h6v-3H5v3z"/></g></svg>',"table-cell-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M13 4v9H3V6c0-1.1.9-2 2-2h8zm-2 2H5v5h6V6z"/><path fill-rule="nonzero" d="M13 4h6a2 2 0 012 2v7h-8v-2h6V6h-6V4z" opacity=".2"/><path d="M18 20l-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3 .2-2.3 2 .7 3z"/><path fill-rule="nonzero" d="M3 13v5c0 1.1.9 2 2 2h8v-7h-2v5H5v-5H3z" opacity=".2"/></g></svg>',"table-cell-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9H5v5h6v-5zm8 0h-6v5h6v-5zm-8-7H5v5h6V6z"/></svg>',"table-cell-select-all":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z" opacity=".2"/></g></svg>',"table-cell-select-inner":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z"/></g></svg>',"table-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v7h-8v7H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9H5v5h6v-5zm8-7h-6v5h6V6zm-8 0H5v5h6V6z"/><path d="M18 20l-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3 .2-2.3 2 .7 3z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2zm.3.5l1 1.2-3 2.3 3 2.3-1 1.2L12 13l-3.3 2.6-1-1.2 3-2.3-3-2.3 1-1.2L12 11l3.3-2.5z"/></svg>',"table-delete-row":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6zm-4.7 1.8l1.2 1L13 12l2.6 3.3-1.2 1-2.3-3-2.3 3-1.2-1L11 12 8.5 8.7l1.2-1 2.3 3 2.3-3z"/></svg>',"table-delete-table":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 6v12h14V6H5z"/><path d="M14.4 8.6l1 1-2.3 2.4 2.3 2.4-1 1-2.4-2.3-2.4 2.3-1-1 2.3-2.4-2.3-2.4 1-1 2.4 2.3z"/></g></svg>',"table-insert-column-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M20 4c.6 0 1 .4 1 1v2a1 1 0 01-2 0V6h-8v12h8v-1a1 1 0 012 0v2c0 .5-.4 1-.9 1H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h15zM9 13H5v5h4v-5zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H17v2a1 1 0 01-2 .1V13h-2a1 1 0 01-.1-2H15V9c0-.6.4-1 1-1zM9 6H5v5h4V6z"/></svg>',"table-insert-column-before":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H4a1 1 0 01-1-1v-2a1 1 0 012 0v1h8V6H5v1a1 1 0 11-2 0V5c0-.6.4-1 1-1h15zm0 9h-4v5h4v-5zM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H9v2a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H7V9c0-.6.4-1 1-1zm11-2h-4v5h4V6z"/></svg>',"table-insert-row-above":'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4a1 1 0 110 2H5v6h14V6h-1a1 1 0 010-2h2c.6 0 1 .4 1 1v13a2 2 0 01-2 2H5a2 2 0 01-2-2V5c0-.6.4-1 1-1h2zm5 10H5v4h6v-4zm8 0h-6v4h6v-4zM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 010 2h-2v2a1 1 0 01-2 .1V8H9a1 1 0 010-2h2V4c0-.6.4-1 1-1z"/></svg>',"table-insert-row-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M12 13c.5 0 1 .4 1 .9V16h2a1 1 0 01.1 2H13v2a1 1 0 01-2 .1V18H9a1 1 0 01-.1-2H11v-2c0-.6.4-1 1-1zm6 7a1 1 0 010-2h1v-6H5v6h1a1 1 0 010 2H4a1 1 0 01-1-1V6c0-1.1.9-2 2-2h14a2 2 0 012 2v13c0 .5-.4 1-.9 1H18zM11 6H5v4h6V6zm8 0h-6v4h6V6z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 9h-4v5h4v-5zm-6 0H9v5h4v-5zm0-7H9v5h4V6zm6 0h-4v5h4V6z"/></svg>',"table-merge-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 15.5V18h3v-2.5H5zm14-5h-9V18h9v-7.5zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6zm-8 7.5h3v-3H5v3z"/></svg>',"table-row-numbering-rtl":'<svg width="24" height="24"><path d="M6 4a2 2 0 00-2 2v13c0 1.1.9 2 2 2h12a2 2 0 002-2V6a2 2 0 00-2-2H6zm0 12h8v3H6v-3zm11 0c.6 0 1 .4 1 1v1a1 1 0 01-2 0v-1c0-.6.4-1 1-1zM6 11h8v3H6v-3zm11 0c.6 0 1 .4 1 1v1a1 1 0 01-2 0v-1c0-.6.4-1 1-1zM6 6h8v3H6V6zm11 0c.6 0 1 .4 1 1v1a1 1 0 11-2 0V7c0-.6.4-1 1-1z"/></svg>',"table-row-numbering":'<svg width="24" height="24"><path d="M18 4a2 2 0 012 2v13a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2h12zm0 12h-8v3h8v-3zM7 16a1 1 0 00-1 1v1a1 1 0 002 0v-1c0-.6-.4-1-1-1zm11-5h-8v3h8v-3zM7 11a1 1 0 00-1 1v1a1 1 0 002 0v-1c0-.6-.4-1-1-1zm11-5h-8v3h8V6zM7 6a1 1 0 00-1 1v1a1 1 0 102 0V7c0-.6-.4-1-1-1z"/></svg>',"table-row-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-9h-6v3h6V6zM5 9h6V6H5v3z"/></svg>',"table-split-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM8 15.5H5V18h3v-2.5zm11-5h-9V18h9v-7.5zm-2.5 1l1 1-2 2 2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2zm-8.5-1H5v3h3v-3zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6z"/></svg>',"table-top-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 11H5v3h6v-3zm8 0h-6v3h6v-3zm0-5h-6v3h6v-3zM5 13h6v-3H5v3z"/></svg>',table:'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 14v4h6v-4H5zm14 0h-6v4h6v-4zm0-6h-6v4h6V8zM5 12h6V8H5v4z"/></svg>',template:'<svg width="24" height="24"><path d="M19 19v-1H5v1h14zM9 16v-4a5 5 0 116 0v4h4a2 2 0 012 2v3H3v-3c0-1.1.9-2 2-2h4zm4 0v-5l.8-.6a3 3 0 10-3.6 0l.8.6v5h2z" fill-rule="nonzero"/></svg>',"temporary-placeholder":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M9 7.6V6h2.5V4.5a.5.5 0 111 0V6H15v1.6a8 8 0 11-6 0zm-2.6 5.3a.5.5 0 00.3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 013.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 00-4.1 3.7z"/><circle cx="14" cy="4" r="1"/><circle cx="12" cy="2" r="1"/><circle cx="10" cy="4" r="1"/></g></svg>',"text-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-text-color__color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z"/></g></svg>',toc:'<svg width="24" height="24"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="M12.7 14.3l-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 010-1l3.1-3A12.4 12.4 0 016.7 9H8a10.1 10.1 0 001.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 110-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 01-1 2.4 13.5 13.5 0 01-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 01-.4.7 1 1 0 01-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 01-1 .7.5.5 0 01-.4-.7l2.7-7.4a1 1 0 012 0zm-2.2 4.4h2.4L16 12.5l-1.2 3.2z" fill-rule="evenodd"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 01-.4 1.8l-1 1.4a5.3 5.3 0 01-5.5 1 5 5 0 01-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 01-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 002.2.8 3.4 3.4 0 002.2-.8c.3-.2.4-.5.6-.8l.2-.9V6c0-.6.4-1 1-1zM8 17h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',undo:'<svg width="24" height="24"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 01-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 11-1.4 1.4l-5-5a1 1 0 010-1.4l5-5a1 1 0 011.4 1.4L6.4 8z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2 2a2 2 0 102.6 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2.1-2a2 2 0 10-2.7-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2zM7.6 6.3a.8.8 0 01-1 1.1L3.3 4.2a.7.7 0 111-1l3.2 3.1zM5.1 8.6a.8.8 0 010 1.5H3a.8.8 0 010-1.5H5zm5-3.5a.8.8 0 01-1.5 0V3a.8.8 0 011.5 0V5zm6 11.8a.8.8 0 011-1l3.2 3.2a.8.8 0 01-1 1L16 17zm-2.2 2a.8.8 0 011.5 0V21a.8.8 0 01-1.5 0V19zm5-3.5a.7.7 0 110-1.5H21a.8.8 0 010 1.5H19z" fill-rule="nonzero"/></svg>',unlock:'<svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 00-.3-.7A1 1 0 0016 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2z" fill-rule="evenodd"/></svg>',"unordered-list":'<svg width="24" height="24"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1z" fill-rule="evenodd"/></svg>',unselected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm0 1a1 1 0 00-1 1v12c0 .6.4 1 1 1h12c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H6z"/></svg>',upload:'<svg width="24" height="24"><path d="M18 19v-2a1 1 0 012 0v3c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-3a1 1 0 012 0v2h12zM11 6.4L8.7 8.7a1 1 0 01-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 11-1.4 1.4L13 6.4V16a1 1 0 01-2 0V6.4z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 110-24 12 12 0 010 24zm-8.7-5.3a11 11 0 0017.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7zM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13z" fill-rule="nonzero"/></svg>',"vertical-align":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="18" height="2" x="3" y="11" rx="1"/><path d="M12 2c.6 0 1 .4 1 1v4l2-1.3a1 1 0 011.2 1.5l-.1.1-4.1 3-4-3a1 1 0 011-1.7l2 1.5V3c0-.6.4-1 1-1zm0 11.8l4 2.9a1 1 0 01-1 1.7l-2-1.5V21c0 .5-.4 1-.9 1H12a1 1 0 01-1-1v-4l-2 1.3a1 1 0 01-1.2-.1l-.1-.1a1 1 0 01.1-1.3l.1-.1 4.1-3z"/></g></svg>',visualblocks:'<svg width="24" height="24"><path d="M9 19v2H7v-2h2zm-4 0v2a2 2 0 01-2-2h2zm8 0v2h-2v-2h2zm8 0a2 2 0 01-2 2v-2h2zm-4 0v2h-2v-2h2zM15 7a1 1 0 010 2v7a1 1 0 01-2 0V9h-1v7a1 1 0 01-2 0v-4a2.5 2.5 0 01-.2-5H15zM5 15v2H3v-2h2zm16 0v2h-2v-2h2zM5 11v2H3v-2h2zm16 0v2h-2v-2h2zM5 7v2H3V7h2zm16 0v2h-2V7h2zM5 3v2H3c0-1.1.9-2 2-2zm8 0v2h-2V3h2zm6 0a2 2 0 012 2h-2V3zM9 3v2H7V3h2zm8 0v2h-2V3h2z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z" fill-rule="evenodd"/></svg>',warning:'<svg width="24" height="24"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6zM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7l.3 4h1.4z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-1-9a1 1 0 012 0v6a1 1 0 01-2 0V8zm-2 4a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-3-5a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>'}});var ue,ae=["onActivate","onAddUndo","onBeforeAddUndo","onBeforeExecCommand","onBeforeGetContent","onBeforeRenderUI","onBeforeSetContent","onBeforePaste","onBlur","onChange","onClearUndos","onClick","onContextMenu","onCopy","onCut","onDblclick","onDeactivate","onDirty","onDrag","onDragDrop","onDragEnd","onDragGesture","onDragOver","onDrop","onExecCommand","onFocus","onFocusIn","onFocusOut","onGetContent","onHide","onInit","onKeyDown","onKeyPress","onKeyUp","onLoadContent","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onNodeChange","onObjectResizeStart","onObjectResized","onObjectSelected","onPaste","onPostProcess","onPostRender","onPreProcess","onProgressState","onRedo","onRemove","onReset","onSaveContent","onSelectionChange","onSetAttrib","onSetContent","onShow","onSubmit","onUndo","onVisualAid"],ce=function(t){return-1!==ae.map((function(t){return t.toLowerCase()})).indexOf(t.toLowerCase())},se=function(t,e,n,r,o,i){r.setContent(i()),n.attrs["onUpdate:modelValue"]&&function(t,e,n,r){var o=t.modelEvents?t.modelEvents:null,i=Array.isArray(o)?o.join(" "):o;l(r,(function(e,r){n&&"string"==typeof e&&e!==r&&e!==n.getContent({format:t.outputFormat})&&n.setContent(e)})),n.on(i||"change input undo redo",(function(){e.emit("update:modelValue",n.getContent({format:t.outputFormat}))}))}(e,n,r,o),function(t,e,n){Object.keys(e).filter(ce).forEach((function(r){var o=e[r];"function"==typeof o&&("onInit"===r?o(t,n):n.on(r.substring(2),(function(t){return o(t,n)})))}))}(t,n.attrs,r)},le=0,fe=function(t){var e=Date.now();return t+"_"+Math.floor(1e9*Math.random())+ ++le+String(e)},de=function(t){return void 0===t||""===t?[]:Array.isArray(t)?t:t.split(" ")},me=function(){return{listeners:[],scriptId:fe("tiny-script"),scriptLoaded:!1}},ge=(ue=me(),{load:function(t,e,n){ue.scriptLoaded?n():(ue.listeners.push(n),t.getElementById(ue.scriptId)||function(t,e,n,r){var o=e.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.id=t,o.src=n;var i=function(){o.removeEventListener("load",i),r()};o.addEventListener("load",i),e.head&&e.head.appendChild(o)}(ue.scriptId,t,e,(function(){ue.listeners.forEach((function(t){return t()})),ue.scriptLoaded=!0})))},reinitialize:function(){ue=me()}}),he=function(){var t="undefined"!=typeof window?window:global;return t&&t.tinymce?t.tinymce:null},pe={apiKey:String,cloudChannel:String,id:String,init:Object,initialValue:String,inline:Boolean,modelEvents:[String,Array],plugins:[String,Array],tagName:String,toolbar:[String,Array],modelValue:String,disabled:Boolean,tinymceScriptSrc:String,outputFormat:{type:String,validator:function(t){return"html"===t||"text"===t}}},ve=function(){return(ve=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},be=f({props:pe,setup:function(t,e){var n=d(t),r=n.disabled,o=n.modelValue,i=m(null),u=null,a=t.id||fe("tiny-vue"),c=t.init&&t.init.inline||t.inline,s=!!e.attrs["onUpdate:modelValue"],f=!0,y=t.initialValue?t.initialValue:"",w="",x=function(){var n,r,l,d=(n=f,s?function(){return(null==o?void 0:o.value)?o.value:""}:function(){return n?y:w}),m=ve(ve({},t.init),{readonly:t.disabled,selector:"#"+a,plugins:(r=t.init&&t.init.plugins,l=t.plugins,de(r).concat(de(l))),toolbar:t.toolbar||t.init&&t.init.toolbar,inline:c,setup:function(n){u=n,n.on("init",(function(r){return se(r,t,e,n,o,d)})),t.init&&"function"==typeof t.init.setup&&t.init.setup(n)}});(function(t){return null!==t&&"textarea"===t.tagName.toLowerCase()})(i.value)&&(i.value.style.visibility=""),he().init(m),f=!1};return l(r,(function(t){null!==u&&u.setMode(t?"readonly":"design")})),g((function(){if(null!==he())x();else if(i.value&&i.value.ownerDocument){var e=t.cloudChannel?t.cloudChannel:"5",n=t.apiKey?t.apiKey:"no-api-key",r=null==t.tinymceScriptSrc?"https://cdn.tiny.cloud/1/"+n+"/tinymce/"+e+"/tinymce.min.js":t.tinymceScriptSrc;ge.load(i.value.ownerDocument,r,x)}})),h((function(){null!==he()&&he().remove(u)})),c||(p((function(){f||x()})),v((function(){var t;s||(w=u.getContent()),null===(t=he())||void 0===t||t.remove(u)}))),function(){return c?function(t,e,n,r){return t(r||"div",{id:e,ref:n})}(b,a,i,t.tagName):function(t,e,n){return t("textarea",{id:e,visibility:"hidden",ref:n})}(b,a,i)}}});function ye(t){return getComputedStyle(document.body).getPropertyValue(t)}var we=f({components:{Editor:be},props:{value:{type:String,default:""},toolbar:{type:Array,default:()=>["bold","italic","underline","removeformat","customLink","bullist","numlist","blockquote","h1","h2","h3","customImage","customMedia","hr","code","fullscreen"]},font:{type:String,default:"sans-serif"},customFormats:{type:Array,default:()=>[]},tinymceOverrides:{type:Object,default:null},disabled:{type:Boolean,default:!0},imageToken:{type:String,default:void 0}},emits:["input"],setup(t,{emit:e}){const{t:n}=w(),r=m(null),o=m(null),{imageToken:i}=d(t),{imageDrawerOpen:u,imageSelection:s,closeImageDrawer:f,onImageSelect:g,saveImage:h,imageButton:p}=function(t,e){const n=m(!1),r=m(null),o={icon:"image",tooltip:I.global.t("wysiwyg_options.image"),onAction:e=>{if(n.value=!0,e.isActive()){const e=t.value.selection.getNode(),n=e.getAttribute("src"),o=e.getAttribute("alt");if(null===n||null===o)return;r.value={imageUrl:n,alt:o,width:Number(e.getAttribute("width"))||void 0,height:Number(e.getAttribute("height"))||void 0,previewUrl:L(n)}}else r.value=null},onSetup:e=>{const n=t=>{e.setActive("IMG"===t.element.tagName)};return t.value.on("NodeChange",n),function(){t.value.off("NodeChange",n)}}};return{imageDrawerOpen:n,imageSelection:r,closeImageDrawer:i,onImageSelect:function(t){let n=H()+"assets/"+t.id;e.value&&(n=L(n,e.value)),r.value={imageUrl:n,alt:t.title,width:t.width,height:t.height,previewUrl:L(n)}},saveImage:function(){const e=r.value;if(null===e)return;const n=`<img src="${e.imageUrl}" alt="${e.alt}" width="${e.width}" height="${e.height}" />`;t.value.selection.setContent(n),i()},imageButton:o};function i(){r.value=null,n.value=!1}}(r,i),{mediaDrawerOpen:v,mediaSelection:b,closeMediaDrawer:C,openMediaTab:S,onMediaSelect:k,embed:T,saveMedia:O,mediaHeight:_,mediaWidth:E,mediaSource:D,mediaButton:A}=function(t,e){const n=m(!1),r=m(null),o=m(["video","audio"]),i=m(""),u=m(""),s={icon:"embed",tooltip:I.global.t("wysiwyg_options.media"),onAction:e=>{if(n.value=!0,e.isActive()){if(null===t.value.selection.getContent())return;i.value=t.value.selection.getContent(),u.value=i.value}else r.value=null},onSetup:e=>{const n=t=>{e.setActive("SPAN"===t.element.tagName&&t.element.classList.contains("mce-preview-object"))};return t.value.on("NodeChange",n),function(){t.value.off("NodeChange",n)}}},f=y({get(){var t;return null==(t=r.value)?void 0:t.source},set(t){r.value=c(a({},r.value),{source:t})}}),d=y({get(){var t;return null==(t=r.value)?void 0:t.width},set(t){null!==r.value&&(r.value=c(a({},r.value),{width:t}))}}),g=y({get(){var t;return null==(t=r.value)?void 0:t.height},set(t){null!==r.value&&(r.value=c(a({},r.value),{height:t}))}});return l(r,(t=>{if(""===i.value){if(null===t)return;i.value=`<${t.tag} width="${t.width}" height="${t.height}" controls><source src="${t.source}" type="${t.type}" /></${t.tag}>`}else i.value=i.value.replace(/src=".*?"/g,`src="${null==t?void 0:t.source}"`).replace(/width=".*?"/g,`width="${null==t?void 0:t.width}"`).replace(/height=".*?"/g,`height="${null==t?void 0:t.height}"`).replace(/type=".*?"/g,`type="${null==t?void 0:t.type}"`).replaceAll(/<(video|audio)/g,`<${null==t?void 0:t.tag}`).replaceAll(/<\/(video|audio)/g,`</${null==t?void 0:t.tag}`)})),l(i,(t=>{var e,n,o,i,u;if(""===t)r.value=null;else{const a=null==(e=/<(video|audio)/g.exec(t))?void 0:e[1],c=(null==(n=/src="(.*?)"/g.exec(t))?void 0:n[1])||void 0,s=Number(null==(o=/width="(.*?)"/g.exec(t))?void 0:o[1])||void 0,l=Number(null==(i=/height="(.*?)"/g.exec(t))?void 0:i[1])||void 0,f=(null==(u=/type="(.*?)"/g.exec(t))?void 0:u[1])||void 0;if(void 0===c)return;r.value={tag:"audio"===a?"audio":"video",source:c,width:s,height:l,type:f}}})),{mediaDrawerOpen:n,mediaSelection:r,closeMediaDrawer:h,openMediaTab:o,onMediaSelect:function(t){const n=H()+"assets/"+t.id,o=t.type.startsWith("audio")?"audio":"video",i=e.value?L(n,e.value):n;r.value={source:i,width:t.width||300,height:t.height||150,tag:o,type:t.type}},embed:i,saveMedia:function(){if(""!==i.value){if(""!==u.value){const e=t.value.getContent().replace(u.value,i.value);t.value.setContent(e)}else t.value.selection.setContent(i.value);h()}},startEmbed:u,mediaHeight:g,mediaWidth:d,mediaSource:f,mediaButton:s};function h(){i.value="",u.value="",r.value=null,n.value=!1,o.value=["video"]}}(r,i),{linkButton:M,linkDrawerOpen:z,closeLinkDrawer:R,saveLink:N,linkSelection:B}=function(t){const e=m(!1),n=m({url:null,displayText:null,title:null,newTab:!0}),r={icon:"link",tooltip:I.global.t("wysiwyg_options.link"),onAction:r=>{if(e.value=!0,r.isActive()){const e=t.value.selection.getNode();t.value.selection.select(e);const r=e.getAttribute("href"),o=e.getAttribute("title"),i=e.innerText,u=e.getAttribute("target");if(null===r||null===i)return;n.value={url:r,displayText:i,title:o||null,newTab:"_blank"===u}}else o()},onSetup:e=>{const n=t=>{e.setActive("A"===t.element.tagName)};return t.value.on("NodeChange",n),function(){t.value.off("NodeChange",n)}}};return{linkDrawerOpen:e,linkSelection:n,closeLinkDrawer:i,saveLink:function(){const e=n.value;if(null===e.url)return;const r=`<a href="${e.url}" title="${e.title||""}" target="${e.newTab?"_blank":"_self"}" >${e.displayText||e.url}</a>`;t.value.selection.setContent(r),i()},linkButton:r};function o(){n.value={url:null,displayText:null,title:null,newTab:!0}}function i(){o(),e.value=!1}}(r),{codeDrawerOpen:P,code:F,closeCodeDrawer:j,saveCode:U,sourceCodeButton:W}=function(t){const e=m(!1),n=m(),r={icon:"sourcecode",tooltip:I.global.t("wysiwyg_options.source_code"),onAction:()=>{e.value=!0,n.value=t.value.getContent()}};return{codeDrawerOpen:e,code:n,closeCodeDrawer:o,saveCode:function(){t.value.setContent(n.value),o()},sourceCodeButton:r};function o(){e.value=!1}}(r),q=(t,e)=>{const n=H(),r=new RegExp(`(<[^=]+=")(${x.exports.escapeRegExp(n)}assets/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}(?:\\?[^#"]*)?(?:#[^"]*)?)("[^>]*>)`,"gi");return t.replace(r,((t,n,r,o)=>{const i=new URL(r),u=new URLSearchParams(i.search);e?u.set("access_token",e):u.delete("access_token");const a=u.toString().length>0?`?${u.toString()}`:"";return`${n}${i.origin}${i.pathname}${a}${o}`}))},$=y({get:()=>t.value?q(t.value,V()):"",set(n){var r;if(n!==t.value&&!1==(null===t.value&&""===n)){const o=q(n,null!=(r=t.imageToken)?r:null);e("input",o)}}}),G=y((()=>{let e=null;Array.isArray(t.customFormats)&&t.customFormats.length>0&&(e=t.customFormats);let n=t.toolbar.map((t=>t.replace(/^link$/g,"customLink").replace(/^media$/g,"customMedia").replace(/^code$/g,"customCode").replace(/^image$/g,"customImage"))).join(" ");return e&&(n+=" styleselect"),a({skin:!1,skin_url:!1,content_css:!1,content_style:(r=t.font,`\nbody {\n\tcolor: ${ye("--foreground-normal")};\n\tbackground-color: ${ye("--background-input")};\n\tmargin: 20px;\n\tfont-family: ${ye("--family-sans-serif")};\n\t-webkit-font-smoothing: antialiased;\n\ttext-rendering: optimizeLegibility;\n\t-moz-osx-font-smoothing: grayscale;\n}\nbody.mce-content-readonly {\n\tcolor: ${ye("--foreground-subdued")};\n\tbackground-color: ${ye("--background-subdued")};\n}\nh1, h2, h3, h4, h5, h6 {\n\tfont-family: ${ye(`--family-${r}`)}, serif;\n\tcolor: ${ye("--foreground-normal-alt")};\n\tfont-weight: 700;\n\tmargin-bottom: 0;\n}\nh1 + p, h2 + p, h3 + p, h4 + p, h5 + p, h6 + p {\n\tmargin-top: 0.5em;\n}\nh1 {\n\tfont-size: 36px;\n\tline-height: 46px;\n\tmargin-top: 1em;\n}\nh2 {\n\tfont-size: 24px;\n\tline-height: 34px;\n\tmargin-top: 1.25em;\n}\nh3 {\n\tfont-size: 19px;\n\tline-height: 29px;\n\tmargin-top: 1.25em;\n}\nh4 {\n\tfont-size: 16px;\n\tline-height: 26px;\n\tmargin-top: 1.5em;\n}\nh5 {\n\tfont-size: 14px;\n\tline-height: 24px;\n\tmargin-top: 2em;\n}\nh6 {\n\tfont-size: 12px;\n\tline-height: 22px;\n\tmargin-top: 2em;\n}\np {\n\tfont-family: ${ye(`--family-${r}`)}, serif;\n\tfont-size: 15px;\n\tline-height: 24px;\n\tfont-weight: 500;\n\tmargin: 1.5em 0;\n}\na {\n\tcolor: ${ye("--primary-125")};\n\ttext-decoration: none;\n}\nul, ol {\n\tfont-family: ${ye(`--family-${r}`)}, serif;\n\tfont-size: 15px;\n\tline-height: 24px;\n\tfont-weight: 500;\n\tmargin: 1.5em 0;\n}\nul ul,\n\tol ol,\n\t\tul ol,\n\t\t\tol ul {\n\tmargin: 0;\n}\nb, strong {\n\tfont-weight: 700;\n}\ncode {\n\tfont-size: 15px;\n\tline-height: 24px;\n\tfont-weight: 500;\n\tpadding: 2px 4px;\n\tfont-family: ${ye("--family-monospace")}, monospace;\n\tbackground-color: ${ye("--background-normal")};\n\tborder-radius: ${ye("--border-radius")};\n\toverflow-wrap: break-word;\n}\npre {\n\tfont-size: 15px;\n\tline-height: 24px;\n\tfont-weight: 500;\n\tpadding: 1em;\n\tfont-family: ${ye("--family-monospace")}, monospace;\n\tbackground-color: ${ye("--background-normal")};\n\tborder-radius: ${ye("--border-radius")};\n\toverflow: auto;\n}\nblockquote {\n\tfont-family: ${ye(`--family-${r}`)}, serif;\n\tfont-size: 15px;\n\tline-height: 24px;\n\tfont-weight: 500;\n\tborder-left: 2px solid ${ye("--border-normal")};\n\tpadding-left: 1em;\n\tmargin-left: 0px;\n}\nvideo,\niframe,\nimg {\n\tmax-width: 100%;\n\tborder-radius: ${ye("--border-radius")};\n\theight: auto;\n}\nhr {\n\tbackground-color: ${ye("--border-normal")};\n\theight: 1px;\n\tborder: none;\n\tmargin-top: 2em;\n\tmargin-bottom: 2em;\n}\ntable {\n\tborder-collapse: collapse;\n\tfont-size: 15px;\n\tline-height: 24px;\n\tfont-weight: 500;\n}\ntable th,\ntable td {\n\tborder: 1px solid ${ye("--border-normal")};\n\tpadding: 0.4rem;\n}\nfigure {\n\tdisplay: table;\n\tmargin: 1rem auto;\n}\nfigure figcaption {\n\tcolor: #999;\n\tdisplay: block;\n\tmargin-top: 0.25rem;\n\ttext-align: center;\n}`),plugins:"media table hr lists image link pagebreak code insertdatetime autoresize paste preview fullscreen directionality",branding:!1,max_height:1e3,elementpath:!1,statusbar:!1,menubar:!1,convert_urls:!1,extended_valid_elements:"audio[loop],source",toolbar:n,style_formats:e,file_picker_types:"customImage customMedia image media",link_default_protocol:"https",setup:K},t.tinymceOverrides||{});var r}));return{t:n,editorElement:o,editorOptions:G,internalValue:$,setFocus:function(t){var e;if(null==o.value)return;const n=null==(e=o.value.$el.parentElement)?void 0:e.querySelector(".tox-tinymce");if(null==n)return;t?n.classList.add("focus"):n.classList.remove("focus")},onImageSelect:g,saveImage:h,imageDrawerOpen:u,closeImageDrawer:f,imageSelection:s,mediaDrawerOpen:v,mediaSelection:b,closeMediaDrawer:C,openMediaTab:S,embed:T,onMediaSelect:k,saveMedia:O,mediaHeight:_,mediaWidth:E,mediaSource:D,linkButton:M,linkDrawerOpen:z,closeLinkDrawer:R,saveLink:N,linkSelection:B,codeDrawerOpen:P,code:F,closeCodeDrawer:j,saveCode:U,sourceCodeButton:W};function K(t){r.value=t,t.ui.registry.addToggleButton("customImage",p),t.ui.registry.addToggleButton("customMedia",A),t.ui.registry.addToggleButton("customLink",M),t.ui.registry.addButton("customCode",W)}}});C("data-v-be4ffeee");const xe={class:"grid"},Ce={class:"field"},Se={class:"type-label"},ke={class:"field"},Te={class:"type-label"},Oe={class:"field half"},_e={class:"type-label"},Ee={class:"field half-right"},De={class:"type-label"},Ae={class:"content"},Me={class:"content"},ze=["src"],Re={class:"grid"},Ne={class:"field half"},Be={class:"type-label"},Pe={class:"field half-right"},Ie={class:"type-label"},Le={class:"field half"},He={class:"type-label"},Ve={class:"field half-right"},Fe={class:"type-label"},je={class:"content"},Ue={class:"media-preview",controls:"controls"},We=["src"],qe={class:"grid"},$e={class:"field"},Ge={class:"type-label"},Ke={class:"field half"},Xe={class:"type-label"},Ye={class:"field half-right"},Je={class:"type-label"},Qe={class:"grid"},Ze={class:"field"},tn={class:"type-label"};S(),we.render=function(t,e,n,r,o,i){const u=k("editor"),a=k("v-card-title"),c=k("v-input"),s=k("v-checkbox"),l=k("v-card-text"),f=k("v-button"),d=k("v-card-actions"),m=k("v-card"),g=k("v-dialog"),h=k("interface-input-code"),p=k("v-icon"),v=k("v-drawer"),b=k("v-upload"),y=k("v-tab"),w=k("v-tabs"),x=k("v-tab-item"),C=k("v-textarea"),S=k("v-tabs-items"),I=T("tooltip");return O(),_("div",{class:P(["wysiwyg",{disabled:t.disabled}])},[E(u,{ref:"editorElement",modelValue:t.internalValue,"onUpdate:modelValue":e[0]||(e[0]=e=>t.internalValue=e),init:t.editorOptions,disabled:t.disabled,"model-events":"change keydown blur focus paste ExecCommand SetContent",onFocusin:e[1]||(e[1]=e=>t.setFocus(!0)),onFocusout:e[2]||(e[2]=e=>t.setFocus(!1))},null,8,["modelValue","init","disabled"]),E(g,{modelValue:t.linkDrawerOpen,"onUpdate:modelValue":e[7]||(e[7]=e=>t.linkDrawerOpen=e)},{default:D((()=>[E(m,null,{default:D((()=>[E(a,{class:"card-title"},{default:D((()=>[A(M(t.t("wysiwyg_options.link")),1)])),_:1}),E(l,null,{default:D((()=>[z("div",xe,[z("div",Ce,[z("div",Se,M(t.t("url")),1),E(c,{modelValue:t.linkSelection.url,"onUpdate:modelValue":e[3]||(e[3]=e=>t.linkSelection.url=e),placeholder:t.t("url_placeholder")},null,8,["modelValue","placeholder"])]),z("div",ke,[z("div",Te,M(t.t("display_text")),1),E(c,{modelValue:t.linkSelection.displayText,"onUpdate:modelValue":e[4]||(e[4]=e=>t.linkSelection.displayText=e),placeholder:t.t("display_text_placeholder")},null,8,["modelValue","placeholder"])]),z("div",Oe,[z("div",_e,M(t.t("tooltip")),1),E(c,{modelValue:t.linkSelection.title,"onUpdate:modelValue":e[5]||(e[5]=e=>t.linkSelection.title=e),placeholder:t.t("tooltip_placeholder")},null,8,["modelValue","placeholder"])]),z("div",Ee,[z("div",De,M(t.t("open_link_in")),1),E(s,{modelValue:t.linkSelection.newTab,"onUpdate:modelValue":e[6]||(e[6]=e=>t.linkSelection.newTab=e),block:"",label:t.t(t.linkSelection.newTab?"new_tab":"current_tab")},null,8,["modelValue","label"])])])])),_:1}),E(d,null,{default:D((()=>[E(f,{secondary:"",onClick:t.closeLinkDrawer},{default:D((()=>[A(M(t.t("cancel")),1)])),_:1},8,["onClick"]),E(f,{disabled:null===t.linkSelection.url,onClick:t.saveLink},{default:D((()=>[A(M(t.t("save")),1)])),_:1},8,["disabled","onClick"])])),_:1})])),_:1})])),_:1},8,["modelValue"]),E(v,{modelValue:t.codeDrawerOpen,"onUpdate:modelValue":e[9]||(e[9]=e=>t.codeDrawerOpen=e),title:t.t("wysiwyg_options.source_code"),icon:"code",onCancel:t.closeCodeDrawer},{actions:D((()=>[E(f,{icon:"",rounded:"",onClick:t.saveCode},{default:D((()=>[E(p,{name:"check"})])),_:1},8,["onClick"])])),default:D((()=>[z("div",Ae,[E(h,{value:t.code,language:"htmlmixed",onInput:e[8]||(e[8]=e=>t.code=e)},null,8,["value"])])])),_:1},8,["modelValue","title","onCancel"]),E(v,{modelValue:t.imageDrawerOpen,"onUpdate:modelValue":e[14]||(e[14]=e=>t.imageDrawerOpen=e),title:t.t("wysiwyg_options.image"),icon:"image",onCancel:t.closeImageDrawer},{actions:D((()=>[R(E(f,{icon:"",rounded:"",onClick:t.saveImage},{default:D((()=>[E(p,{name:"check"})])),_:1},8,["onClick"]),[[I,t.t("save_image"),void 0,{bottom:!0}]])])),default:D((()=>[z("div",Me,[t.imageSelection?(O(),_(N,{key:0},[z("img",{class:"image-preview",src:t.imageSelection.previewUrl},null,8,ze),z("div",Re,[z("div",Ne,[z("div",Be,M(t.t("image_url")),1),E(c,{modelValue:t.imageSelection.imageUrl,"onUpdate:modelValue":e[10]||(e[10]=e=>t.imageSelection.imageUrl=e)},null,8,["modelValue"])]),z("div",Pe,[z("div",Ie,M(t.t("alt_text")),1),E(c,{modelValue:t.imageSelection.alt,"onUpdate:modelValue":e[11]||(e[11]=e=>t.imageSelection.alt=e)},null,8,["modelValue"])]),z("div",Le,[z("div",He,M(t.t("width")),1),E(c,{modelValue:t.imageSelection.width,"onUpdate:modelValue":e[12]||(e[12]=e=>t.imageSelection.width=e)},null,8,["modelValue"])]),z("div",Ve,[z("div",Fe,M(t.t("height")),1),E(c,{modelValue:t.imageSelection.height,"onUpdate:modelValue":e[13]||(e[13]=e=>t.imageSelection.height=e)},null,8,["modelValue"])])])],64)):(O(),B(b,{key:1,multiple:!1,"from-library":"","from-url":"",onInput:t.onImageSelect},null,8,["onInput"]))])])),_:1},8,["modelValue","title","onCancel"]),E(v,{modelValue:t.mediaDrawerOpen,"onUpdate:modelValue":e[21]||(e[21]=e=>t.mediaDrawerOpen=e),title:t.t("wysiwyg_options.media"),icon:"slideshow",onCancel:t.closeMediaDrawer},{sidebar:D((()=>[E(w,{modelValue:t.openMediaTab,"onUpdate:modelValue":e[15]||(e[15]=e=>t.openMediaTab=e),vertical:""},{default:D((()=>[E(y,{value:"video"},{default:D((()=>[A(M(t.t("media")),1)])),_:1}),E(y,{value:"embed"},{default:D((()=>[A(M(t.t("embed")),1)])),_:1})])),_:1},8,["modelValue"])])),actions:D((()=>[R(E(f,{icon:"",rounded:"",onClick:t.saveMedia},{default:D((()=>[E(p,{name:"check"})])),_:1},8,["onClick"]),[[I,t.t("save_media"),void 0,{bottom:!0}]])])),default:D((()=>[z("div",je,[E(S,{modelValue:t.openMediaTab,"onUpdate:modelValue":e[20]||(e[20]=e=>t.openMediaTab=e)},{default:D((()=>[E(x,{value:"video"},{default:D((()=>[t.mediaSelection?(O(),_(N,{key:0},[z("video",Ue,[z("source",{src:t.mediaSelection.source},null,8,We)]),z("div",qe,[z("div",$e,[z("div",Ge,M(t.t("source")),1),E(c,{modelValue:t.mediaSource,"onUpdate:modelValue":e[16]||(e[16]=e=>t.mediaSource=e)},null,8,["modelValue"])]),z("div",Ke,[z("div",Xe,M(t.t("width")),1),E(c,{modelValue:t.mediaWidth,"onUpdate:modelValue":e[17]||(e[17]=e=>t.mediaWidth=e)},null,8,["modelValue"])]),z("div",Ye,[z("div",Je,M(t.t("height")),1),E(c,{modelValue:t.mediaHeight,"onUpdate:modelValue":e[18]||(e[18]=e=>t.mediaHeight=e)},null,8,["modelValue"])])])],64)):(O(),B(b,{key:1,multiple:!1,"from-library":"","from-url":"",onInput:t.onMediaSelect},null,8,["onInput"]))])),_:1}),E(x,{value:"embed"},{default:D((()=>[z("div",Qe,[z("div",Ze,[z("div",tn,M(t.t("embed")),1),E(C,{modelValue:t.embed,"onUpdate:modelValue":e[19]||(e[19]=e=>t.embed=e),nullable:!1},null,8,["modelValue"])])])])),_:1})])),_:1},8,["modelValue"])])])),_:1},8,["modelValue","title","onCancel"])],2)},we.__scopeId="data-v-be4ffeee";export{we as default};
|