[
  {
    "path": ".gitattributes",
    "content": "# Enforce Unix newlines\n* text=auto eol=lf\n\n# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored\n/.yarn/releases/** binary\n/.yarn/plugins/** binary\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\ntype: bug\nassignees: ''\n---\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\nSteps to reproduce the behavior:\n\n1. Go to '…'\n2. Click on '…'\n3. Scroll down to '…'\n4. See error\n\n**Expected behavior**\nA clear and concise description of what you expected to happen.\n\n**Screenshots**\nIf applicable, add screenshots to help explain your problem.\n\n**Desktop (please complete the following information):**\n\n- SVGO Version [e.g. 3.3.2]\n- Node.js Version [e.g 16.16.0]\n- OS: [e.g. iOS]\n\n**Additional context**\nAdd any other context about the problem here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\ncontact_links:\n  - name: Questions\n    url: https://discord.gg/z8jX8NYxrE\n    about: Please ask questions in our Discord server.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\ntype: feature\nassignees: ''\n---\n\n**Is your feature request related to a problem? Please describe.**\nA clear and concise description of what the problem is. Ex. I'm always frustrated when […]\n\n**Describe the solution you'd like**\nA clear and concise description of what you want to happen.\n\n**Describe alternatives you've considered**\nA clear and concise description of any alternative solutions or features you've considered.\n\n**Additional context**\nAdd any other context or screenshots about the feature request here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/plugin_request.md",
    "content": "---\nname: Plugin request\nabout: Suggest a plugin for this project\ntitle: ''\nlabels: 'new plugin'\ntype: feature\nassignees: ''\n---\n\n**Is your plugin request related to a problem? Please describe.**\nA clear and concise description of what the problem is. Ex. I'm always frustrated when […]\n\n**Describe what the plugin should do**\nA clear and concise description of what you want to happen.\n\n<!-- Please include a sample SVG and a resulting SVG -->\n\n**Additional context**\nInclude any links pointing to relevant specs or general knowledge that may validate your plugin idea.\n\n**Implementation**\n\n- [ ] Are you volunteering to work on this plugin?\n"
  },
  {
    "path": ".github/dependabot.yml",
    "content": "version: 2\nupdates:\n  - package-ecosystem: 'github-actions'\n    directory: '/'\n    schedule:\n      interval: monthly\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "name: CI\n\non:\n  pull_request:\n    branches:\n      - main\n\npermissions:\n  contents: read\n\njobs:\n  lint:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - run: corepack enable\n      - uses: actions/setup-node@v6\n        with: &setup-node-config\n          node-version: 24\n          cache: yarn\n      - run: yarn install\n      - run: yarn lint\n  types:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - run: corepack enable\n      - uses: actions/setup-node@v6\n        with: *setup-node-config\n      - run: yarn install\n      - run: yarn test:types\n  spellcheck:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - run: corepack enable\n      - uses: actions/setup-node@v6\n        with: *setup-node-config\n      - run: yarn install\n      - run: yarn spellcheck\n  test:\n    name: test - ${{ matrix.os }} - Node.js v${{ matrix.node-version }}\n    strategy:\n      fail-fast: false\n      matrix:\n        node-version:\n          - 24\n          - 22\n          - 20\n          - 18\n          - 16\n        os:\n          - ubuntu-latest\n          - windows-latest\n    runs-on: ${{ matrix.os }}\n    steps:\n      - uses: actions/checkout@v6\n      - run: npm install -g corepack@0.20.0 --force\n      - run: corepack enable\n      - uses: actions/setup-node@v6\n        with:\n          node-version: ${{ matrix.node-version }}\n          cache: yarn\n      - run: yarn install\n      - run: yarn playwright install --with-deps chromium\n      - run: yarn test\n      - run: yarn test:bundles\n"
  },
  {
    "path": ".github/workflows/codeql.yml",
    "content": "name: 'CodeQL'\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n    branches:\n      - main\n  schedule:\n    - cron: '0 0 * * 0'\n  workflow_dispatch:\n\njobs:\n  analyze:\n    runs-on: ubuntu-latest\n    permissions:\n      actions: read\n      contents: read\n      security-events: write\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n      - uses: github/codeql-action/init@v4\n        with:\n          languages: 'javascript'\n          queries: +security-and-quality\n      - uses: github/codeql-action/autobuild@v4\n      - uses: github/codeql-action/analyze@v4\n        with:\n          category: '/language:javascript'\n"
  },
  {
    "path": ".github/workflows/publish.yml",
    "content": "on:\n  release:\n    types: [created]\n  workflow_dispatch:\n\npermissions:\n  id-token: write\n  contents: read\n\njobs:\n  publish-npm:\n    runs-on: ubuntu-latest\n    env:\n      GH_TOKEN: ${{ github.token }}\n    steps:\n      - uses: actions/checkout@v6\n      - run: corepack enable\n      - uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          registry-url: https://registry.npmjs.org\n      - run: yarn install\n      - run: |\n          VERSION=$(jq -r .version <package.json)\n          if [[ \"$VERSION\" = *\"-rc.\"* ]]; then\n            yarn npm publish --access public --tag rc\n          else\n            LATEST_VERSION=\"$(gh release view --json tagName -q '.tagName' --repo ${{ github.repository }})\"\n            if [[ \"${{ github.ref_name }}\" = \"$LATEST_VERSION\" ]]; then\n              yarn npm publish --access public\n            else\n              MAJOR=\"$(awk -F '.' '{ print $1 }' <<< \"$VERSION\")\"\n              yarn npm publish --access public --tag \"v$MAJOR\"\n            fi\n          fi\n"
  },
  {
    "path": ".github/workflows/regression.yml",
    "content": "name: Regression Test\n\nenv:\n  # For debugging, you can override this to your fork to test.\n  REPO: 'svg/svgo'\n\non:\n  pull_request:\n    branches:\n      - main\n\npermissions:\n  contents: read\n\njobs:\n  regression:\n    runs-on: ubuntu-latest\n    concurrency:\n      group: ${{ github.workflow }}-${{ github.ref }}\n      cancel-in-progress: true\n    steps:\n      - uses: actions/checkout@v6\n      - run: corepack enable\n      - uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          cache: yarn\n      - run: yarn install\n      - run: yarn playwright install --with-deps chromium\n      - run: yarn test:regression\n      # We use upload/artifacts instead of outputs because our regression test\n      # report can exceed 1 MB which is a limit GitHub imposes.\n      - uses: actions/upload-artifact@v7\n        if: success() || failure()\n        with:\n          name: svgo-test-report-${{ github.sha }}\n          path: /tmp/svgo.${{ github.sha }}/svgo-test-report.json\n          if-no-files-found: error\n          retention-days: 1\n  delta:\n    if: success() || failure()\n    runs-on: ubuntu-latest\n    needs:\n      - regression\n    env:\n      GH_TOKEN: ${{ github.token }}\n    steps:\n      - uses: actions/checkout@v6\n      - run: corepack enable\n      - uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          cache: yarn\n      - run: yarn install\n      - run: gh run download -R ${{ env.REPO }} -n svgo-test-report-${{ github.sha }} -D /tmp/svgo.${{ github.sha }}/\n      - run: gh run download -R ${{ env.REPO }} -n svgo-test-report -D /tmp/svgo.main/\n      - run: ./test/regression/delta.js /tmp/svgo.main/svgo-test-report.json /tmp/svgo.${{ github.sha }}/svgo-test-report.json\n"
  },
  {
    "path": ".github/workflows/test-report.yml",
    "content": "name: Test Report\n\non:\n  push:\n    branches:\n      - main\n  workflow_dispatch:\n\npermissions:\n  contents: read\n\njobs:\n  test-report:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - run: corepack enable\n      - uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          cache: yarn\n      - run: yarn install\n      - run: yarn playwright install --with-deps chromium\n      - run: yarn test:regression\n      - uses: actions/upload-artifact@v7\n        with:\n          name: svgo-test-report\n          path: /tmp/svgo.${{ github.sha }}/svgo-test-report.json\n          if-no-files-found: error\n"
  },
  {
    "path": ".gitignore",
    "content": "# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored\n.yarn/*\n!.yarn/patches\n!.yarn/plugins\n!.yarn/releases\n!.yarn/sdks\n!.yarn/versions\n\n# https://github.com/github/gitignore/blob/main/Global/Vim.gitignore\n[._]*.s[a-v][a-z]\n!*.svg\n[._]*.sw[a-p]\n[._]s[a-rt-v][a-z]\n[._]ss[a-gi-z]\n[._]sw[a-p]\nSession.vim\nSessionx.vim\n.netrwhist\n*~\ntags\n[._]*.un~\n\n# Ignore generated files for browser, CommonJS, or types\ndist\ntypes\n\nnode_modules\ntest/cli/output\ncoverage\n.DS_Store\n.vscode\n*.log\npackage-lock.json\n"
  },
  {
    "path": ".prettierignore",
    "content": ".yarn/\n.yarnrc.yml\n"
  },
  {
    "path": ".prettierrc",
    "content": "{\n  \"singleQuote\": true\n}\n"
  },
  {
    "path": ".yarn/patches/sax-npm-1.5.0-d40bca2226.patch",
    "content": "diff --git a/lib/sax.js b/lib/sax.js\nindex d35adf1a319b7f064d7a7e43c46630ed5ef587ff..4c5a08844f3be4ddceb12285d3fd133213dcc7e0 100644\n--- a/lib/sax.js\n+++ b/lib/sax.js\n@@ -4,8 +4,6 @@\n     return new SAXParser(strict, opt)\n   }\n   sax.SAXParser = SAXParser\n-  sax.SAXStream = SAXStream\n-  sax.createStream = createStream\n \n   // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.\n   // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),\n@@ -191,123 +189,6 @@\n     },\n   }\n \n-  var Stream\n-  try {\n-    Stream = require('stream').Stream\n-  } catch (ex) {\n-    Stream = function () {}\n-  }\n-  if (!Stream) Stream = function () {}\n-\n-  var streamWraps = sax.EVENTS.filter(function (ev) {\n-    return ev !== 'error' && ev !== 'end'\n-  })\n-\n-  function createStream(strict, opt) {\n-    return new SAXStream(strict, opt)\n-  }\n-\n-  function SAXStream(strict, opt) {\n-    if (!(this instanceof SAXStream)) {\n-      return new SAXStream(strict, opt)\n-    }\n-\n-    Stream.apply(this)\n-\n-    this._parser = new SAXParser(strict, opt)\n-    this.writable = true\n-    this.readable = true\n-\n-    var me = this\n-\n-    this._parser.onend = function () {\n-      me.emit('end')\n-    }\n-\n-    this._parser.onerror = function (er) {\n-      me.emit('error', er)\n-\n-      // if didn't throw, then means error was handled.\n-      // go ahead and clear error, so we can write again.\n-      me._parser.error = null\n-    }\n-\n-    this._decoder = null\n-\n-    streamWraps.forEach(function (ev) {\n-      Object.defineProperty(me, 'on' + ev, {\n-        get: function () {\n-          return me._parser['on' + ev]\n-        },\n-        set: function (h) {\n-          if (!h) {\n-            me.removeAllListeners(ev)\n-            me._parser['on' + ev] = h\n-            return h\n-          }\n-          me.on(ev, h)\n-        },\n-        enumerable: true,\n-        configurable: false,\n-      })\n-    })\n-  }\n-\n-  SAXStream.prototype = Object.create(Stream.prototype, {\n-    constructor: {\n-      value: SAXStream,\n-    },\n-  })\n-\n-  SAXStream.prototype.write = function (data) {\n-    if (\n-      typeof Buffer === 'function' &&\n-      typeof Buffer.isBuffer === 'function' &&\n-      Buffer.isBuffer(data)\n-    ) {\n-      if (!this._decoder) {\n-        this._decoder = new TextDecoder('utf8')\n-      }\n-      data = this._decoder.decode(data, { stream: true })\n-    }\n-\n-    this._parser.write(data.toString())\n-    this.emit('data', data)\n-    return true\n-  }\n-\n-  SAXStream.prototype.end = function (chunk) {\n-    if (chunk && chunk.length) {\n-      this.write(chunk)\n-    }\n-    // Flush any remaining decoded data from the TextDecoder\n-    if (this._decoder) {\n-      var remaining = this._decoder.decode()\n-      if (remaining) {\n-        this._parser.write(remaining)\n-        this.emit('data', remaining)\n-      }\n-    }\n-    this._parser.end()\n-    return true\n-  }\n-\n-  SAXStream.prototype.on = function (ev, handler) {\n-    var me = this\n-    if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {\n-      me._parser['on' + ev] = function () {\n-        var args =\n-          arguments.length === 1 ?\n-            [arguments[0]]\n-          : Array.apply(null, arguments)\n-        args.splice(0, 0, ev)\n-        me.emit.apply(me, args)\n-      }\n-    }\n-\n-    return Stream.prototype.on.call(me, ev, handler)\n-  }\n-\n   // this really needs to be replaced with character classes.\n   // XML allows all manner of ridiculous numbers and digits.\n   var CDATA = '[CDATA['\n"
  },
  {
    "path": ".yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs",
    "content": "/* eslint-disable */\n//prettier-ignore\nmodule.exports = {\nname: \"@yarnpkg/plugin-interactive-tools\",\nfactory: function (require) {\nvar plugin=(()=>{var PR=Object.create,J1=Object.defineProperty,MR=Object.defineProperties,FR=Object.getOwnPropertyDescriptor,LR=Object.getOwnPropertyDescriptors,RR=Object.getOwnPropertyNames,hh=Object.getOwnPropertySymbols,NR=Object.getPrototypeOf,Z4=Object.prototype.hasOwnProperty,aD=Object.prototype.propertyIsEnumerable;var dD=(i,u,f)=>u in i?J1(i,u,{enumerable:!0,configurable:!0,writable:!0,value:f}):i[u]=f,dt=(i,u)=>{for(var f in u||(u={}))Z4.call(u,f)&&dD(i,f,u[f]);if(hh)for(var f of hh(u))aD.call(u,f)&&dD(i,f,u[f]);return i},zn=(i,u)=>MR(i,LR(u)),BR=i=>J1(i,\"__esModule\",{value:!0});var Si=(i,u)=>{var f={};for(var c in i)Z4.call(i,c)&&u.indexOf(c)<0&&(f[c]=i[c]);if(i!=null&&hh)for(var c of hh(i))u.indexOf(c)<0&&aD.call(i,c)&&(f[c]=i[c]);return f};var Me=(i,u)=>()=>(u||i((u={exports:{}}).exports,u),u.exports),jR=(i,u)=>{for(var f in u)J1(i,f,{get:u[f],enumerable:!0})},UR=(i,u,f)=>{if(u&&typeof u==\"object\"||typeof u==\"function\")for(let c of RR(u))!Z4.call(i,c)&&c!==\"default\"&&J1(i,c,{get:()=>u[c],enumerable:!(f=FR(u,c))||f.enumerable});return i},Er=i=>UR(BR(J1(i!=null?PR(NR(i)):{},\"default\",i&&i.__esModule&&\"default\"in i?{get:()=>i.default,enumerable:!0}:{value:i,enumerable:!0})),i);var ey=Me((YH,pD)=>{\"use strict\";var hD=Object.getOwnPropertySymbols,qR=Object.prototype.hasOwnProperty,zR=Object.prototype.propertyIsEnumerable;function WR(i){if(i==null)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(i)}function HR(){try{if(!Object.assign)return!1;var i=new String(\"abc\");if(i[5]=\"de\",Object.getOwnPropertyNames(i)[0]===\"5\")return!1;for(var u={},f=0;f<10;f++)u[\"_\"+String.fromCharCode(f)]=f;var c=Object.getOwnPropertyNames(u).map(function(t){return u[t]});if(c.join(\"\")!==\"0123456789\")return!1;var g={};return\"abcdefghijklmnopqrst\".split(\"\").forEach(function(t){g[t]=t}),Object.keys(Object.assign({},g)).join(\"\")===\"abcdefghijklmnopqrst\"}catch(t){return!1}}pD.exports=HR()?Object.assign:function(i,u){for(var f,c=WR(i),g,t=1;t<arguments.length;t++){f=Object(arguments[t]);for(var C in f)qR.call(f,C)&&(c[C]=f[C]);if(hD){g=hD(f);for(var A=0;A<g.length;A++)zR.call(f,g[A])&&(c[g[A]]=f[g[A]])}}return c}});var xD=Me(Ir=>{\"use strict\";var ty=ey(),as=typeof Symbol==\"function\"&&Symbol.for,Q1=as?Symbol.for(\"react.element\"):60103,bR=as?Symbol.for(\"react.portal\"):60106,GR=as?Symbol.for(\"react.fragment\"):60107,VR=as?Symbol.for(\"react.strict_mode\"):60108,YR=as?Symbol.for(\"react.profiler\"):60114,$R=as?Symbol.for(\"react.provider\"):60109,KR=as?Symbol.for(\"react.context\"):60110,XR=as?Symbol.for(\"react.forward_ref\"):60112,JR=as?Symbol.for(\"react.suspense\"):60113,QR=as?Symbol.for(\"react.memo\"):60115,ZR=as?Symbol.for(\"react.lazy\"):60116,mD=typeof Symbol==\"function\"&&Symbol.iterator;function Z1(i){for(var u=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+i,f=1;f<arguments.length;f++)u+=\"&args[]=\"+encodeURIComponent(arguments[f]);return\"Minified React error #\"+i+\"; visit \"+u+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}var vD={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},gD={};function va(i,u,f){this.props=i,this.context=u,this.refs=gD,this.updater=f||vD}va.prototype.isReactComponent={};va.prototype.setState=function(i,u){if(typeof i!=\"object\"&&typeof i!=\"function\"&&i!=null)throw Error(Z1(85));this.updater.enqueueSetState(this,i,u,\"setState\")};va.prototype.forceUpdate=function(i){this.updater.enqueueForceUpdate(this,i,\"forceUpdate\")};function _D(){}_D.prototype=va.prototype;function ny(i,u,f){this.props=i,this.context=u,this.refs=gD,this.updater=f||vD}var ry=ny.prototype=new _D;ry.constructor=ny;ty(ry,va.prototype);ry.isPureReactComponent=!0;var iy={current:null},yD=Object.prototype.hasOwnProperty,wD={key:!0,ref:!0,__self:!0,__source:!0};function DD(i,u,f){var c,g={},t=null,C=null;if(u!=null)for(c in u.ref!==void 0&&(C=u.ref),u.key!==void 0&&(t=\"\"+u.key),u)yD.call(u,c)&&!wD.hasOwnProperty(c)&&(g[c]=u[c]);var A=arguments.length-2;if(A===1)g.children=f;else if(1<A){for(var x=Array(A),D=0;D<A;D++)x[D]=arguments[D+2];g.children=x}if(i&&i.defaultProps)for(c in A=i.defaultProps,A)g[c]===void 0&&(g[c]=A[c]);return{$$typeof:Q1,type:i,key:t,ref:C,props:g,_owner:iy.current}}function eN(i,u){return{$$typeof:Q1,type:i.type,key:u,ref:i.ref,props:i.props,_owner:i._owner}}function oy(i){return typeof i==\"object\"&&i!==null&&i.$$typeof===Q1}function tN(i){var u={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+(\"\"+i).replace(/[=:]/g,function(f){return u[f]})}var ED=/\\/+/g,mh=[];function SD(i,u,f,c){if(mh.length){var g=mh.pop();return g.result=i,g.keyPrefix=u,g.func=f,g.context=c,g.count=0,g}return{result:i,keyPrefix:u,func:f,context:c,count:0}}function CD(i){i.result=null,i.keyPrefix=null,i.func=null,i.context=null,i.count=0,10>mh.length&&mh.push(i)}function uy(i,u,f,c){var g=typeof i;(g===\"undefined\"||g===\"boolean\")&&(i=null);var t=!1;if(i===null)t=!0;else switch(g){case\"string\":case\"number\":t=!0;break;case\"object\":switch(i.$$typeof){case Q1:case bR:t=!0}}if(t)return f(c,i,u===\"\"?\".\"+sy(i,0):u),1;if(t=0,u=u===\"\"?\".\":u+\":\",Array.isArray(i))for(var C=0;C<i.length;C++){g=i[C];var A=u+sy(g,C);t+=uy(g,A,f,c)}else if(i===null||typeof i!=\"object\"?A=null:(A=mD&&i[mD]||i[\"@@iterator\"],A=typeof A==\"function\"?A:null),typeof A==\"function\")for(i=A.call(i),C=0;!(g=i.next()).done;)g=g.value,A=u+sy(g,C++),t+=uy(g,A,f,c);else if(g===\"object\")throw f=\"\"+i,Error(Z1(31,f===\"[object Object]\"?\"object with keys {\"+Object.keys(i).join(\", \")+\"}\":f,\"\"));return t}function ly(i,u,f){return i==null?0:uy(i,\"\",u,f)}function sy(i,u){return typeof i==\"object\"&&i!==null&&i.key!=null?tN(i.key):u.toString(36)}function nN(i,u){i.func.call(i.context,u,i.count++)}function rN(i,u,f){var c=i.result,g=i.keyPrefix;i=i.func.call(i.context,u,i.count++),Array.isArray(i)?fy(i,c,f,function(t){return t}):i!=null&&(oy(i)&&(i=eN(i,g+(!i.key||u&&u.key===i.key?\"\":(\"\"+i.key).replace(ED,\"$&/\")+\"/\")+f)),c.push(i))}function fy(i,u,f,c,g){var t=\"\";f!=null&&(t=(\"\"+f).replace(ED,\"$&/\")+\"/\"),u=SD(u,t,c,g),ly(i,rN,u),CD(u)}var TD={current:null};function Kl(){var i=TD.current;if(i===null)throw Error(Z1(321));return i}var iN={ReactCurrentDispatcher:TD,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:iy,IsSomeRendererActing:{current:!1},assign:ty};Ir.Children={map:function(i,u,f){if(i==null)return i;var c=[];return fy(i,c,null,u,f),c},forEach:function(i,u,f){if(i==null)return i;u=SD(null,null,u,f),ly(i,nN,u),CD(u)},count:function(i){return ly(i,function(){return null},null)},toArray:function(i){var u=[];return fy(i,u,null,function(f){return f}),u},only:function(i){if(!oy(i))throw Error(Z1(143));return i}};Ir.Component=va;Ir.Fragment=GR;Ir.Profiler=YR;Ir.PureComponent=ny;Ir.StrictMode=VR;Ir.Suspense=JR;Ir.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=iN;Ir.cloneElement=function(i,u,f){if(i==null)throw Error(Z1(267,i));var c=ty({},i.props),g=i.key,t=i.ref,C=i._owner;if(u!=null){if(u.ref!==void 0&&(t=u.ref,C=iy.current),u.key!==void 0&&(g=\"\"+u.key),i.type&&i.type.defaultProps)var A=i.type.defaultProps;for(x in u)yD.call(u,x)&&!wD.hasOwnProperty(x)&&(c[x]=u[x]===void 0&&A!==void 0?A[x]:u[x])}var x=arguments.length-2;if(x===1)c.children=f;else if(1<x){A=Array(x);for(var D=0;D<x;D++)A[D]=arguments[D+2];c.children=A}return{$$typeof:Q1,type:i.type,key:g,ref:t,props:c,_owner:C}};Ir.createContext=function(i,u){return u===void 0&&(u=null),i={$$typeof:KR,_calculateChangedBits:u,_currentValue:i,_currentValue2:i,_threadCount:0,Provider:null,Consumer:null},i.Provider={$$typeof:$R,_context:i},i.Consumer=i};Ir.createElement=DD;Ir.createFactory=function(i){var u=DD.bind(null,i);return u.type=i,u};Ir.createRef=function(){return{current:null}};Ir.forwardRef=function(i){return{$$typeof:XR,render:i}};Ir.isValidElement=oy;Ir.lazy=function(i){return{$$typeof:ZR,_ctor:i,_status:-1,_result:null}};Ir.memo=function(i,u){return{$$typeof:QR,type:i,compare:u===void 0?null:u}};Ir.useCallback=function(i,u){return Kl().useCallback(i,u)};Ir.useContext=function(i,u){return Kl().useContext(i,u)};Ir.useDebugValue=function(){};Ir.useEffect=function(i,u){return Kl().useEffect(i,u)};Ir.useImperativeHandle=function(i,u,f){return Kl().useImperativeHandle(i,u,f)};Ir.useLayoutEffect=function(i,u){return Kl().useLayoutEffect(i,u)};Ir.useMemo=function(i,u){return Kl().useMemo(i,u)};Ir.useReducer=function(i,u,f){return Kl().useReducer(i,u,f)};Ir.useRef=function(i){return Kl().useRef(i)};Ir.useState=function(i){return Kl().useState(i)};Ir.version=\"16.13.1\"});var lr=Me((KH,kD)=>{\"use strict\";kD.exports=xD()});var AD=Me((ga,e2)=>{(function(){var i,u=\"4.17.21\",f=200,c=\"Unsupported core-js use. Try https://npms.io/search?q=ponyfill.\",g=\"Expected a function\",t=\"Invalid `variable` option passed into `_.template`\",C=\"__lodash_hash_undefined__\",A=500,x=\"__lodash_placeholder__\",D=1,L=2,N=4,j=1,$=2,h=1,re=2,ce=4,Q=8,oe=16,Se=32,me=64,De=128,J=256,Te=512,Oe=30,Le=\"...\",ot=800,ct=16,Ue=1,be=2,At=3,Ot=1/0,Nt=9007199254740991,Je=17976931348623157e292,V=0/0,ne=4294967295,ge=ne-1,Z=ne>>>1,Ae=[[\"ary\",De],[\"bind\",h],[\"bindKey\",re],[\"curry\",Q],[\"curryRight\",oe],[\"flip\",Te],[\"partial\",Se],[\"partialRight\",me],[\"rearg\",J]],at=\"[object Arguments]\",it=\"[object Array]\",Ft=\"[object AsyncFunction]\",jt=\"[object Boolean]\",hn=\"[object Date]\",Un=\"[object DOMException]\",Jt=\"[object Error]\",Yt=\"[object Function]\",cr=\"[object GeneratorFunction]\",w=\"[object Map]\",pt=\"[object Number]\",Mn=\"[object Null]\",Bn=\"[object Object]\",Xn=\"[object Promise]\",vr=\"[object Proxy]\",gr=\"[object RegExp]\",r0=\"[object Set]\",Ci=\"[object String]\",yo=\"[object Symbol]\",Ds=\"[object Undefined]\",Mu=\"[object WeakMap]\",Gf=\"[object WeakSet]\",iu=\"[object ArrayBuffer]\",ou=\"[object DataView]\",ol=\"[object Float32Array]\",ul=\"[object Float64Array]\",Es=\"[object Int8Array]\",Uo=\"[object Int16Array]\",sl=\"[object Int32Array]\",Ss=\"[object Uint8Array]\",Cs=\"[object Uint8ClampedArray]\",Ti=\"[object Uint16Array]\",Fu=\"[object Uint32Array]\",ll=/\\b__p \\+= '';/g,fl=/\\b(__p \\+=) '' \\+/g,cl=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g,al=/&(?:amp|lt|gt|quot|#39);/g,Ui=/[&<>\"']/g,Mr=RegExp(al.source),Ac=RegExp(Ui.source),of=/<%-([\\s\\S]+?)%>/g,Ts=/<%([\\s\\S]+?)%>/g,xs=/<%=([\\s\\S]+?)%>/g,dl=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,qi=/^\\w*$/,qo=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,kr=/[\\\\^$.*+?()[\\]{}|]/g,Fr=RegExp(kr.source),si=/^\\s+/,H0=/\\s/,b0=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,Bt=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,Lu=/,? & /,c0=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,Ru=/[()=,{}\\[\\]\\/\\s]/,ks=/\\\\(\\\\)?/g,As=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,uu=/\\w*$/,wo=/^[-+]0x[0-9a-f]+$/i,zo=/^0b[01]+$/i,Os=/^\\[object .+?Constructor\\]$/,Is=/^0o[0-7]+$/i,uf=/^(?:0|[1-9]\\d*)$/,_n=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,Nu=/($^)/,Wo=/['\\n\\r\\u2028\\u2029\\\\]/g,su=\"\\\\ud800-\\\\udfff\",Ps=\"\\\\u0300-\\\\u036f\",pl=\"\\\\ufe20-\\\\ufe2f\",Vf=\"\\\\u20d0-\\\\u20ff\",hl=Ps+pl+Vf,Bu=\"\\\\u2700-\\\\u27bf\",ju=\"a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff\",sf=\"\\\\xac\\\\xb1\\\\xd7\\\\xf7\",ro=\"\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf\",Ms=\"\\\\u2000-\\\\u206f\",ml=\" \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000\",Uu=\"A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde\",G0=\"\\\\ufe0e\\\\ufe0f\",Fs=sf+ro+Ms+ml,tt=\"['\\u2019]\",zi=\"[\"+su+\"]\",lu=\"[\"+Fs+\"]\",Ho=\"[\"+hl+\"]\",O0=\"\\\\d+\",vl=\"[\"+Bu+\"]\",gl=\"[\"+ju+\"]\",fu=\"[^\"+su+Fs+O0+Bu+ju+Uu+\"]\",_l=\"\\\\ud83c[\\\\udffb-\\\\udfff]\",Sn=\"(?:\"+Ho+\"|\"+_l+\")\",gt=\"[^\"+su+\"]\",en=\"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",I0=\"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",li=\"[\"+Uu+\"]\",qu=\"\\\\u200d\",Wi=\"(?:\"+gl+\"|\"+fu+\")\",zu=\"(?:\"+li+\"|\"+fu+\")\",Wu=\"(?:\"+tt+\"(?:d|ll|m|re|s|t|ve))?\",Ls=\"(?:\"+tt+\"(?:D|LL|M|RE|S|T|VE))?\",fi=Sn+\"?\",e0=\"[\"+G0+\"]?\",io=\"(?:\"+qu+\"(?:\"+[gt,en,I0].join(\"|\")+\")\"+e0+fi+\")*\",D0=\"\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])\",Do=\"\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])\",i0=e0+fi+io,Rs=\"(?:\"+[vl,en,I0].join(\"|\")+\")\"+i0,a0=\"(?:\"+[gt+Ho+\"?\",Ho,en,I0,zi].join(\"|\")+\")\",Hu=RegExp(tt,\"g\"),V0=RegExp(Ho,\"g\"),bu=RegExp(_l+\"(?=\"+_l+\")|\"+a0+i0,\"g\"),Ns=RegExp([li+\"?\"+gl+\"+\"+Wu+\"(?=\"+[lu,li,\"$\"].join(\"|\")+\")\",zu+\"+\"+Ls+\"(?=\"+[lu,li+Wi,\"$\"].join(\"|\")+\")\",li+\"?\"+Wi+\"+\"+Wu,li+\"+\"+Ls,Do,D0,O0,Rs].join(\"|\"),\"g\"),bo=RegExp(\"[\"+qu+su+hl+G0+\"]\"),P0=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ln=[\"Array\",\"Buffer\",\"DataView\",\"Date\",\"Error\",\"Float32Array\",\"Float64Array\",\"Function\",\"Int8Array\",\"Int16Array\",\"Int32Array\",\"Map\",\"Math\",\"Object\",\"Promise\",\"RegExp\",\"Set\",\"String\",\"Symbol\",\"TypeError\",\"Uint8Array\",\"Uint8ClampedArray\",\"Uint16Array\",\"Uint32Array\",\"WeakMap\",\"_\",\"clearTimeout\",\"isFinite\",\"parseInt\",\"setTimeout\"],lf=-1,nr={};nr[ol]=nr[ul]=nr[Es]=nr[Uo]=nr[sl]=nr[Ss]=nr[Cs]=nr[Ti]=nr[Fu]=!0,nr[at]=nr[it]=nr[iu]=nr[jt]=nr[ou]=nr[hn]=nr[Jt]=nr[Yt]=nr[w]=nr[pt]=nr[Bn]=nr[gr]=nr[r0]=nr[Ci]=nr[Mu]=!1;var rr={};rr[at]=rr[it]=rr[iu]=rr[ou]=rr[jt]=rr[hn]=rr[ol]=rr[ul]=rr[Es]=rr[Uo]=rr[sl]=rr[w]=rr[pt]=rr[Bn]=rr[gr]=rr[r0]=rr[Ci]=rr[yo]=rr[Ss]=rr[Cs]=rr[Ti]=rr[Fu]=!0,rr[Jt]=rr[Yt]=rr[Mu]=!1;var Go={\\u00C0:\"A\",\\u00C1:\"A\",\\u00C2:\"A\",\\u00C3:\"A\",\\u00C4:\"A\",\\u00C5:\"A\",\\u00E0:\"a\",\\u00E1:\"a\",\\u00E2:\"a\",\\u00E3:\"a\",\\u00E4:\"a\",\\u00E5:\"a\",\\u00C7:\"C\",\\u00E7:\"c\",\\u00D0:\"D\",\\u00F0:\"d\",\\u00C8:\"E\",\\u00C9:\"E\",\\u00CA:\"E\",\\u00CB:\"E\",\\u00E8:\"e\",\\u00E9:\"e\",\\u00EA:\"e\",\\u00EB:\"e\",\\u00CC:\"I\",\\u00CD:\"I\",\\u00CE:\"I\",\\u00CF:\"I\",\\u00EC:\"i\",\\u00ED:\"i\",\\u00EE:\"i\",\\u00EF:\"i\",\\u00D1:\"N\",\\u00F1:\"n\",\\u00D2:\"O\",\\u00D3:\"O\",\\u00D4:\"O\",\\u00D5:\"O\",\\u00D6:\"O\",\\u00D8:\"O\",\\u00F2:\"o\",\\u00F3:\"o\",\\u00F4:\"o\",\\u00F5:\"o\",\\u00F6:\"o\",\\u00F8:\"o\",\\u00D9:\"U\",\\u00DA:\"U\",\\u00DB:\"U\",\\u00DC:\"U\",\\u00F9:\"u\",\\u00FA:\"u\",\\u00FB:\"u\",\\u00FC:\"u\",\\u00DD:\"Y\",\\u00FD:\"y\",\\u00FF:\"y\",\\u00C6:\"Ae\",\\u00E6:\"ae\",\\u00DE:\"Th\",\\u00FE:\"th\",\\u00DF:\"ss\",\\u0100:\"A\",\\u0102:\"A\",\\u0104:\"A\",\\u0101:\"a\",\\u0103:\"a\",\\u0105:\"a\",\\u0106:\"C\",\\u0108:\"C\",\\u010A:\"C\",\\u010C:\"C\",\\u0107:\"c\",\\u0109:\"c\",\\u010B:\"c\",\\u010D:\"c\",\\u010E:\"D\",\\u0110:\"D\",\\u010F:\"d\",\\u0111:\"d\",\\u0112:\"E\",\\u0114:\"E\",\\u0116:\"E\",\\u0118:\"E\",\\u011A:\"E\",\\u0113:\"e\",\\u0115:\"e\",\\u0117:\"e\",\\u0119:\"e\",\\u011B:\"e\",\\u011C:\"G\",\\u011E:\"G\",\\u0120:\"G\",\\u0122:\"G\",\\u011D:\"g\",\\u011F:\"g\",\\u0121:\"g\",\\u0123:\"g\",\\u0124:\"H\",\\u0126:\"H\",\\u0125:\"h\",\\u0127:\"h\",\\u0128:\"I\",\\u012A:\"I\",\\u012C:\"I\",\\u012E:\"I\",\\u0130:\"I\",\\u0129:\"i\",\\u012B:\"i\",\\u012D:\"i\",\\u012F:\"i\",\\u0131:\"i\",\\u0134:\"J\",\\u0135:\"j\",\\u0136:\"K\",\\u0137:\"k\",\\u0138:\"k\",\\u0139:\"L\",\\u013B:\"L\",\\u013D:\"L\",\\u013F:\"L\",\\u0141:\"L\",\\u013A:\"l\",\\u013C:\"l\",\\u013E:\"l\",\\u0140:\"l\",\\u0142:\"l\",\\u0143:\"N\",\\u0145:\"N\",\\u0147:\"N\",\\u014A:\"N\",\\u0144:\"n\",\\u0146:\"n\",\\u0148:\"n\",\\u014B:\"n\",\\u014C:\"O\",\\u014E:\"O\",\\u0150:\"O\",\\u014D:\"o\",\\u014F:\"o\",\\u0151:\"o\",\\u0154:\"R\",\\u0156:\"R\",\\u0158:\"R\",\\u0155:\"r\",\\u0157:\"r\",\\u0159:\"r\",\\u015A:\"S\",\\u015C:\"S\",\\u015E:\"S\",\\u0160:\"S\",\\u015B:\"s\",\\u015D:\"s\",\\u015F:\"s\",\\u0161:\"s\",\\u0162:\"T\",\\u0164:\"T\",\\u0166:\"T\",\\u0163:\"t\",\\u0165:\"t\",\\u0167:\"t\",\\u0168:\"U\",\\u016A:\"U\",\\u016C:\"U\",\\u016E:\"U\",\\u0170:\"U\",\\u0172:\"U\",\\u0169:\"u\",\\u016B:\"u\",\\u016D:\"u\",\\u016F:\"u\",\\u0171:\"u\",\\u0173:\"u\",\\u0174:\"W\",\\u0175:\"w\",\\u0176:\"Y\",\\u0177:\"y\",\\u0178:\"Y\",\\u0179:\"Z\",\\u017B:\"Z\",\\u017D:\"Z\",\\u017A:\"z\",\\u017C:\"z\",\\u017E:\"z\",\\u0132:\"IJ\",\\u0133:\"ij\",\\u0152:\"Oe\",\\u0153:\"oe\",\\u0149:\"'n\",\\u017F:\"s\"},Gu={\"&\":\"&amp;\",\"<\":\"&lt;\",\">\":\"&gt;\",'\"':\"&quot;\",\"'\":\"&#39;\"},yl={\"&amp;\":\"&\",\"&lt;\":\"<\",\"&gt;\":\">\",\"&quot;\":'\"',\"&#39;\":\"'\"},cu={\"\\\\\":\"\\\\\",\"'\":\"'\",\"\\n\":\"n\",\"\\r\":\"r\",\"\\u2028\":\"u2028\",\"\\u2029\":\"u2029\"},Bs=parseFloat,Vu=parseInt,M0=typeof global==\"object\"&&global&&global.Object===Object&&global,au=typeof self==\"object\"&&self&&self.Object===Object&&self,Lr=M0||au||Function(\"return this\")(),F=typeof ga==\"object\"&&ga&&!ga.nodeType&&ga,R=F&&typeof e2==\"object\"&&e2&&!e2.nodeType&&e2,U=R&&R.exports===F,H=U&&M0.process,fe=function(){try{var ae=R&&R.require&&R.require(\"util\").types;return ae||H&&H.binding&&H.binding(\"util\")}catch(Be){}}(),ue=fe&&fe.isArrayBuffer,de=fe&&fe.isDate,W=fe&&fe.isMap,ve=fe&&fe.isRegExp,Fe=fe&&fe.isSet,Ge=fe&&fe.isTypedArray;function K(ae,Be,Ie){switch(Ie.length){case 0:return ae.call(Be);case 1:return ae.call(Be,Ie[0]);case 2:return ae.call(Be,Ie[0],Ie[1]);case 3:return ae.call(Be,Ie[0],Ie[1],Ie[2])}return ae.apply(Be,Ie)}function xe(ae,Be,Ie,ht){for(var mt=-1,wn=ae==null?0:ae.length;++mt<wn;){var Gn=ae[mt];Be(ht,Gn,Ie(Gn),ae)}return ht}function je(ae,Be){for(var Ie=-1,ht=ae==null?0:ae.length;++Ie<ht&&Be(ae[Ie],Ie,ae)!==!1;);return ae}function Xe(ae,Be){for(var Ie=ae==null?0:ae.length;Ie--&&Be(ae[Ie],Ie,ae)!==!1;);return ae}function rt(ae,Be){for(var Ie=-1,ht=ae==null?0:ae.length;++Ie<ht;)if(!Be(ae[Ie],Ie,ae))return!1;return!0}function st(ae,Be){for(var Ie=-1,ht=ae==null?0:ae.length,mt=0,wn=[];++Ie<ht;){var Gn=ae[Ie];Be(Gn,Ie,ae)&&(wn[mt++]=Gn)}return wn}function xt(ae,Be){var Ie=ae==null?0:ae.length;return!!Ie&&Qe(ae,Be,0)>-1}function wt(ae,Be,Ie){for(var ht=-1,mt=ae==null?0:ae.length;++ht<mt;)if(Ie(Be,ae[ht]))return!0;return!1}function lt(ae,Be){for(var Ie=-1,ht=ae==null?0:ae.length,mt=Array(ht);++Ie<ht;)mt[Ie]=Be(ae[Ie],Ie,ae);return mt}function Rt(ae,Be){for(var Ie=-1,ht=Be.length,mt=ae.length;++Ie<ht;)ae[mt+Ie]=Be[Ie];return ae}function yn(ae,Be,Ie,ht){var mt=-1,wn=ae==null?0:ae.length;for(ht&&wn&&(Ie=ae[++mt]);++mt<wn;)Ie=Be(Ie,ae[mt],mt,ae);return Ie}function sn(ae,Be,Ie,ht){var mt=ae==null?0:ae.length;for(ht&&mt&&(Ie=ae[--mt]);mt--;)Ie=Be(Ie,ae[mt],mt,ae);return Ie}function ar(ae,Be){for(var Ie=-1,ht=ae==null?0:ae.length;++Ie<ht;)if(Be(ae[Ie],Ie,ae))return!0;return!1}var rn=Qt(\"length\");function Hn(ae){return ae.split(\"\")}function d0(ae){return ae.match(c0)||[]}function Cr(ae,Be,Ie){var ht;return Ie(ae,function(mt,wn,Gn){if(Be(mt,wn,Gn))return ht=wn,!1}),ht}function He(ae,Be,Ie,ht){for(var mt=ae.length,wn=Ie+(ht?1:-1);ht?wn--:++wn<mt;)if(Be(ae[wn],wn,ae))return wn;return-1}function Qe(ae,Be,Ie){return Be===Be?$u(ae,Be,Ie):He(ae,ft,Ie)}function Ne(ae,Be,Ie,ht){for(var mt=Ie-1,wn=ae.length;++mt<wn;)if(ht(ae[mt],Be))return mt;return-1}function ft(ae){return ae!==ae}function St(ae,Be){var Ie=ae==null?0:ae.length;return Ie?h0(ae,Be)/Ie:V}function Qt(ae){return function(Be){return Be==null?i:Be[ae]}}function Cn(ae){return function(Be){return ae==null?i:ae[Be]}}function bn(ae,Be,Ie,ht,mt){return mt(ae,function(wn,Gn,$t){Ie=ht?(ht=!1,wn):Be(Ie,wn,Gn,$t)}),Ie}function p0(ae,Be){var Ie=ae.length;for(ae.sort(Be);Ie--;)ae[Ie]=ae[Ie].value;return ae}function h0(ae,Be){for(var Ie,ht=-1,mt=ae.length;++ht<mt;){var wn=Be(ae[ht]);wn!==i&&(Ie=Ie===i?wn:Ie+wn)}return Ie}function ci(ae,Be){for(var Ie=-1,ht=Array(ae);++Ie<ae;)ht[Ie]=Be(Ie);return ht}function xi(ae,Be){return lt(Be,function(Ie){return[Ie,ae[Ie]]})}function E0(ae){return ae&&ae.slice(0,ai(ae)+1).replace(si,\"\")}function qr(ae){return function(Be){return ae(Be)}}function Eo(ae,Be){return lt(Be,function(Ie){return ae[Ie]})}function So(ae,Be){return ae.has(Be)}function wl(ae,Be){for(var Ie=-1,ht=ae.length;++Ie<ht&&Qe(Be,ae[Ie],0)>-1;);return Ie}function js(ae,Be){for(var Ie=ae.length;Ie--&&Qe(Be,ae[Ie],0)>-1;);return Ie}function Dl(ae,Be){for(var Ie=ae.length,ht=0;Ie--;)ae[Ie]===Be&&++ht;return ht}var du=Cn(Go),Yu=Cn(Gu);function Us(ae){return\"\\\\\"+cu[ae]}function oo(ae,Be){return ae==null?i:ae[Be]}function Hi(ae){return bo.test(ae)}function qs(ae){return P0.test(ae)}function F0(ae){for(var Be,Ie=[];!(Be=ae.next()).done;)Ie.push(Be.value);return Ie}function Gr(ae){var Be=-1,Ie=Array(ae.size);return ae.forEach(function(ht,mt){Ie[++Be]=[mt,ht]}),Ie}function ir(ae,Be){return function(Ie){return ae(Be(Ie))}}function L0(ae,Be){for(var Ie=-1,ht=ae.length,mt=0,wn=[];++Ie<ht;){var Gn=ae[Ie];(Gn===Be||Gn===x)&&(ae[Ie]=x,wn[mt++]=Ie)}return wn}function Y0(ae){var Be=-1,Ie=Array(ae.size);return ae.forEach(function(ht){Ie[++Be]=ht}),Ie}function Co(ae){var Be=-1,Ie=Array(ae.size);return ae.forEach(function(ht){Ie[++Be]=[ht,ht]}),Ie}function $u(ae,Be,Ie){for(var ht=Ie-1,mt=ae.length;++ht<mt;)if(ae[ht]===Be)return ht;return-1}function Vo(ae,Be,Ie){for(var ht=Ie+1;ht--;)if(ae[ht]===Be)return ht;return ht}function Rr(ae){return Hi(ae)?Vr(ae):rn(ae)}function Jn(ae){return Hi(ae)?ff(ae):Hn(ae)}function ai(ae){for(var Be=ae.length;Be--&&H0.test(ae.charAt(Be)););return Be}var o0=Cn(yl);function Vr(ae){for(var Be=bu.lastIndex=0;bu.test(ae);)++Be;return Be}function ff(ae){return ae.match(bu)||[]}function cf(ae){return ae.match(Ns)||[]}var $0=function ae(Be){Be=Be==null?Lr:K0.defaults(Lr.Object(),Be,K0.pick(Lr,ln));var Ie=Be.Array,ht=Be.Date,mt=Be.Error,wn=Be.Function,Gn=Be.Math,$t=Be.Object,X0=Be.RegExp,ki=Be.String,Yr=Be.TypeError,$r=Ie.prototype,m0=wn.prototype,Tn=$t.prototype,Yo=Be[\"__core-js_shared__\"],bi=m0.toString,or=Tn.hasOwnProperty,zs=0,Ku=function(){var a=/[^.]+$/.exec(Yo&&Yo.keys&&Yo.keys.IE_PROTO||\"\");return a?\"Symbol(src)_1.\"+a:\"\"}(),J0=Tn.toString,af=bi.call($t),S0=Lr._,El=X0(\"^\"+bi.call(or).replace(kr,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\"),Q0=U?Be.Buffer:i,Tr=Be.Symbol,R0=Be.Uint8Array,Nr=Q0?Q0.allocUnsafe:i,uo=ir($t.getPrototypeOf,$t),so=$t.create,N0=Tn.propertyIsEnumerable,C0=$r.splice,di=Tr?Tr.isConcatSpreadable:i,u0=Tr?Tr.iterator:i,v0=Tr?Tr.toStringTag:i,To=function(){try{var a=Il($t,\"defineProperty\");return a({},\"\",{}),a}catch(p){}}(),pu=Be.clearTimeout!==Lr.clearTimeout&&Be.clearTimeout,Sl=ht&&ht.now!==Lr.Date.now&&ht.now,Cl=Be.setTimeout!==Lr.setTimeout&&Be.setTimeout,B0=Gn.ceil,hu=Gn.floor,Fn=$t.getOwnPropertySymbols,pi=Q0?Q0.isBuffer:i,Br=Be.isFinite,zr=$r.join,lo=ir($t.keys,$t),wr=Gn.max,kn=Gn.min,T0=ht.now,hi=Be.parseInt,Ai=Gn.random,Kt=$r.reverse,X=Il(Be,\"DataView\"),Y=Il(Be,\"Map\"),ye=Il(Be,\"Promise\"),he=Il(Be,\"Set\"),We=Il(Be,\"WeakMap\"),et=Il($t,\"create\"),Dt=We&&new We,bt={},Zt=Pl(X),qt=Pl(Y),Ut=Pl(ye),fn=Pl(he),_t=Pl(We),_r=Tr?Tr.prototype:i,Wr=_r?_r.valueOf:i,Ar=_r?_r.toString:i;function z(a){if(n0(a)&&!On(a)&&!(a instanceof nn)){if(a instanceof Qn)return a;if(or.call(a,\"__wrapped__\"))return Jd(a)}return new Qn(a)}var dr=function(){function a(){}return function(p){if(!Jr(p))return{};if(so)return so(p);a.prototype=p;var E=new a;return a.prototype=i,E}}();function Or(){}function Qn(a,p){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=i}z.templateSettings={escape:of,evaluate:Ts,interpolate:xs,variable:\"\",imports:{_:z}},z.prototype=Or.prototype,z.prototype.constructor=z,Qn.prototype=dr(Or.prototype),Qn.prototype.constructor=Qn;function nn(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ne,this.__views__=[]}function s0(){var a=new nn(this.__wrapped__);return a.__actions__=Xr(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Xr(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Xr(this.__views__),a}function t0(){if(this.__filtered__){var a=new nn(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function g0(){var a=this.__wrapped__.value(),p=this.__dir__,E=On(a),I=p<0,B=E?a.length:0,G=s1(0,B,this.__views__),te=G.start,se=G.end,Ee=se-te,$e=I?se:te-1,Ke=this.__iteratees__,nt=Ke.length,Ct=0,Gt=kn(Ee,this.__takeCount__);if(!E||!I&&B==Ee&&Gt==Ee)return xd(a,this.__actions__);var an=[];e:for(;Ee--&&Ct<Gt;){$e+=p;for(var qn=-1,dn=a[$e];++qn<nt;){var Yn=Ke[qn],er=Yn.iteratee,vo=Yn.type,Pi=er(dn);if(vo==be)dn=Pi;else if(!Pi){if(vo==Ue)continue e;break e}}an[Ct++]=dn}return an}nn.prototype=dr(Or.prototype),nn.prototype.constructor=nn;function Kr(a){var p=-1,E=a==null?0:a.length;for(this.clear();++p<E;){var I=a[p];this.set(I[0],I[1])}}function _0(){this.__data__=et?et(null):{},this.size=0}function Gi(a){var p=this.has(a)&&delete this.__data__[a];return this.size-=p?1:0,p}function fo(a){var p=this.__data__;if(et){var E=p[a];return E===C?i:E}return or.call(p,a)?p[a]:i}function x0(a){var p=this.__data__;return et?p[a]!==i:or.call(p,a)}function Xu(a,p){var E=this.__data__;return this.size+=this.has(a)?0:1,E[a]=et&&p===i?C:p,this}Kr.prototype.clear=_0,Kr.prototype.delete=Gi,Kr.prototype.get=fo,Kr.prototype.has=x0,Kr.prototype.set=Xu;function Z0(a){var p=-1,E=a==null?0:a.length;for(this.clear();++p<E;){var I=a[p];this.set(I[0],I[1])}}function df(){this.__data__=[],this.size=0}function Ba(a){var p=this.__data__,E=hf(p,a);if(E<0)return!1;var I=p.length-1;return E==I?p.pop():C0.call(p,E,1),--this.size,!0}function Oc(a){var p=this.__data__,E=hf(p,a);return E<0?i:p[E][1]}function mu(a){return hf(this.__data__,a)>-1}function Ju(a,p){var E=this.__data__,I=hf(E,a);return I<0?(++this.size,E.push([a,p])):E[I][1]=p,this}Z0.prototype.clear=df,Z0.prototype.delete=Ba,Z0.prototype.get=Oc,Z0.prototype.has=mu,Z0.prototype.set=Ju;function ei(a){var p=-1,E=a==null?0:a.length;for(this.clear();++p<E;){var I=a[p];this.set(I[0],I[1])}}function Yf(){this.size=0,this.__data__={hash:new Kr,map:new(Y||Z0),string:new Kr}}function pf(a){var p=Vc(this,a).delete(a);return this.size-=p?1:0,p}function ja(a){return Vc(this,a).get(a)}function Ua(a){return Vc(this,a).has(a)}function Ic(a,p){var E=Vc(this,a),I=E.size;return E.set(a,p),this.size+=E.size==I?0:1,this}ei.prototype.clear=Yf,ei.prototype.delete=pf,ei.prototype.get=ja,ei.prototype.has=Ua,ei.prototype.set=Ic;function vu(a){var p=-1,E=a==null?0:a.length;for(this.__data__=new ei;++p<E;)this.add(a[p])}function $f(a){return this.__data__.set(a,C),this}function gu(a){return this.__data__.has(a)}vu.prototype.add=vu.prototype.push=$f,vu.prototype.has=gu;function co(a){var p=this.__data__=new Z0(a);this.size=p.size}function qa(){this.__data__=new Z0,this.size=0}function Ws(a){var p=this.__data__,E=p.delete(a);return this.size=p.size,E}function za(a){return this.__data__.get(a)}function Pc(a){return this.__data__.has(a)}function Qu(a,p){var E=this.__data__;if(E instanceof Z0){var I=E.__data__;if(!Y||I.length<f-1)return I.push([a,p]),this.size=++E.size,this;E=this.__data__=new ei(I)}return E.set(a,p),this.size=E.size,this}co.prototype.clear=qa,co.prototype.delete=Ws,co.prototype.get=za,co.prototype.has=Pc,co.prototype.set=Qu;function Mc(a,p){var E=On(a),I=!E&&Ll(a),B=!E&&!I&&Eu(a),G=!E&&!I&&!B&&Df(a),te=E||I||B||G,se=te?ci(a.length,ki):[],Ee=se.length;for(var $e in a)(p||or.call(a,$e))&&!(te&&($e==\"length\"||B&&($e==\"offset\"||$e==\"parent\")||G&&($e==\"buffer\"||$e==\"byteLength\"||$e==\"byteOffset\")||es($e,Ee)))&&se.push($e);return se}function Fc(a){var p=a.length;return p?a[Ga(0,p-1)]:i}function Lc(a,p){return Yc(Xr(a),mi(p,0,a.length))}function Kf(a){return Yc(Xr(a))}function Tl(a,p,E){(E!==i&&!Mo(a[p],E)||E===i&&!(p in a))&&ti(a,p,E)}function xl(a,p,E){var I=a[p];(!(or.call(a,p)&&Mo(I,E))||E===i&&!(p in a))&&ti(a,p,E)}function hf(a,p){for(var E=a.length;E--;)if(Mo(a[E][0],p))return E;return-1}function xo(a,p,E,I){return $o(a,function(B,G,te){p(I,B,E(B),te)}),I}function mf(a,p){return a&&yi(p,q0(p),a)}function Wa(a,p){return a&&yi(p,Yi(p),a)}function ti(a,p,E){p==\"__proto__\"&&To?To(a,p,{configurable:!0,enumerable:!0,value:E,writable:!0}):a[p]=E}function Hs(a,p){for(var E=-1,I=p.length,B=Ie(I),G=a==null;++E<I;)B[E]=G?i:oc(a,p[E]);return B}function mi(a,p,E){return a===a&&(E!==i&&(a=a<=E?a:E),p!==i&&(a=a>=p?a:p)),a}function vi(a,p,E,I,B,G){var te,se=p&D,Ee=p&L,$e=p&N;if(E&&(te=B?E(a,I,B,G):E(a)),te!==i)return te;if(!Jr(a))return a;var Ke=On(a);if(Ke){if(te=f1(a),!se)return Xr(a,te)}else{var nt=U0(a),Ct=nt==Yt||nt==cr;if(Eu(a))return Od(a,se);if(nt==Bn||nt==at||Ct&&!B){if(te=Ee||Ct?{}:zd(a),!se)return Ee?Zu(a,Wa(te,a)):j0(a,mf(te,a))}else{if(!rr[nt])return B?a:{};te=Wd(a,nt,se)}}G||(G=new co);var Gt=G.get(a);if(Gt)return Gt;G.set(a,te),kp(a)?a.forEach(function(dn){te.add(vi(dn,p,E,dn,a,G))}):Tp(a)&&a.forEach(function(dn,Yn){te.set(Yn,vi(dn,p,E,Yn,a,G))});var an=$e?Ee?Dn:r1:Ee?Yi:q0,qn=Ke?i:an(a);return je(qn||a,function(dn,Yn){qn&&(Yn=dn,dn=a[Yn]),xl(te,Yn,vi(dn,p,E,Yn,a,G))}),te}function Xf(a){var p=q0(a);return function(E){return Rc(E,a,p)}}function Rc(a,p,E){var I=E.length;if(a==null)return!I;for(a=$t(a);I--;){var B=E[I],G=p[B],te=a[B];if(te===i&&!(B in a)||!G(te))return!1}return!0}function Jf(a,p,E){if(typeof a!=\"function\")throw new Yr(g);return wf(function(){a.apply(i,E)},p)}function ao(a,p,E,I){var B=-1,G=xt,te=!0,se=a.length,Ee=[],$e=p.length;if(!se)return Ee;E&&(p=lt(p,qr(E))),I?(G=wt,te=!1):p.length>=f&&(G=So,te=!1,p=new vu(p));e:for(;++B<se;){var Ke=a[B],nt=E==null?Ke:E(Ke);if(Ke=I||Ke!==0?Ke:0,te&&nt===nt){for(var Ct=$e;Ct--;)if(p[Ct]===nt)continue e;Ee.push(Ke)}else G(p,nt,I)||Ee.push(Ke)}return Ee}var $o=_u(S),kl=_u(O,!0);function Nc(a,p){var E=!0;return $o(a,function(I,B,G){return E=!!p(I,B,G),E}),E}function Al(a,p,E){for(var I=-1,B=a.length;++I<B;){var G=a[I],te=p(G);if(te!=null&&(se===i?te===te&&!mo(te):E(te,se)))var se=te,Ee=G}return Ee}function vf(a,p,E,I){var B=a.length;for(E=jn(E),E<0&&(E=-E>B?0:B+E),I=I===i||I>B?B:jn(I),I<0&&(I+=B),I=E>I?0:Ip(I);E<I;)a[E++]=p;return a}function Qf(a,p){var E=[];return $o(a,function(I,B,G){p(I,B,G)&&E.push(I)}),E}function k0(a,p,E,I,B){var G=-1,te=a.length;for(E||(E=Xm),B||(B=[]);++G<te;){var se=a[G];p>0&&E(se)?p>1?k0(se,p-1,E,I,B):Rt(B,se):I||(B[B.length]=se)}return B}var v=ec(),m=ec(!0);function S(a,p){return a&&v(a,p,q0)}function O(a,p){return a&&m(a,p,q0)}function M(a,p){return st(p,function(E){return rs(a[E])})}function b(a,p){p=Gs(p,a);for(var E=0,I=p.length;a!=null&&E<I;)a=a[Xo(p[E++])];return E&&E==I?a:i}function ee(a,p,E){var I=p(a);return On(a)?I:Rt(I,E(a))}function Ye(a){return a==null?a===i?Ds:Mn:v0&&v0 in $t(a)?$m(a):Ys(a)}function Ze(a,p){return a>p}function ut(a,p){return a!=null&&or.call(a,p)}function In(a,p){return a!=null&&p in $t(a)}function A0(a,p,E){return a>=kn(p,E)&&a<wr(p,E)}function jr(a,p,E){for(var I=E?wt:xt,B=a[0].length,G=a.length,te=G,se=Ie(G),Ee=Infinity,$e=[];te--;){var Ke=a[te];te&&p&&(Ke=lt(Ke,qr(p))),Ee=kn(Ke.length,Ee),se[te]=!E&&(p||B>=120&&Ke.length>=120)?new vu(te&&Ke):i}Ke=a[0];var nt=-1,Ct=se[0];e:for(;++nt<B&&$e.length<Ee;){var Gt=Ke[nt],an=p?p(Gt):Gt;if(Gt=E||Gt!==0?Gt:0,!(Ct?So(Ct,an):I($e,an,E))){for(te=G;--te;){var qn=se[te];if(!(qn?So(qn,an):I(a[te],an,E)))continue e}Ct&&Ct.push(an),$e.push(Gt)}}return $e}function gi(a,p,E,I){return S(a,function(B,G,te){p(I,E(B),G,te)}),I}function po(a,p,E){p=Gs(p,a),a=Vd(a,p);var I=a==null?a:a[Xo(Po(p))];return I==null?i:K(I,a,E)}function _i(a){return n0(a)&&Ye(a)==at}function Re(a){return n0(a)&&Ye(a)==iu}function Ce(a){return n0(a)&&Ye(a)==hn}function ze(a,p,E,I,B){return a===p?!0:a==null||p==null||!n0(a)&&!n0(p)?a!==a&&p!==p:Et(a,p,E,I,ze,B)}function Et(a,p,E,I,B,G){var te=On(a),se=On(p),Ee=te?it:U0(a),$e=se?it:U0(p);Ee=Ee==at?Bn:Ee,$e=$e==at?Bn:$e;var Ke=Ee==Bn,nt=$e==Bn,Ct=Ee==$e;if(Ct&&Eu(a)){if(!Eu(p))return!1;te=!0,Ke=!1}if(Ct&&!Ke)return G||(G=new co),te||Df(a)?Ud(a,p,E,I,B,G):Vm(a,p,Ee,E,I,B,G);if(!(E&j)){var Gt=Ke&&or.call(a,\"__wrapped__\"),an=nt&&or.call(p,\"__wrapped__\");if(Gt||an){var qn=Gt?a.value():a,dn=an?p.value():p;return G||(G=new co),B(qn,dn,E,I,G)}}return Ct?(G||(G=new co),Ym(a,p,E,I,B,G)):!1}function on(a){return n0(a)&&U0(a)==w}function sr(a,p,E,I){var B=E.length,G=B,te=!I;if(a==null)return!G;for(a=$t(a);B--;){var se=E[B];if(te&&se[2]?se[1]!==a[se[0]]:!(se[0]in a))return!1}for(;++B<G;){se=E[B];var Ee=se[0],$e=a[Ee],Ke=se[1];if(te&&se[2]){if($e===i&&!(Ee in a))return!1}else{var nt=new co;if(I)var Ct=I($e,Ke,Ee,a,p,nt);if(!(Ct===i?ze(Ke,$e,j|$,I,nt):Ct))return!1}}return!0}function mn(a){if(!Jr(a)||Qm(a))return!1;var p=rs(a)?El:Os;return p.test(Pl(a))}function pr(a){return n0(a)&&Ye(a)==gr}function Hr(a){return n0(a)&&U0(a)==r0}function Vn(a){return n0(a)&&na(a.length)&&!!nr[Ye(a)]}function ni(a){return typeof a==\"function\"?a:a==null?$i:typeof a==\"object\"?On(a)?ba(a[0],a[1]):gd(a):q1(a)}function Zf(a){if(!nc(a))return lo(a);var p=[];for(var E in $t(a))or.call(a,E)&&E!=\"constructor\"&&p.push(E);return p}function Pm(a){if(!Jr(a))return tv(a);var p=nc(a),E=[];for(var I in a)I==\"constructor\"&&(p||!or.call(a,I))||E.push(I);return E}function Ha(a,p){return a<p}function vd(a,p){var E=-1,I=Vi(a)?Ie(a.length):[];return $o(a,function(B,G,te){I[++E]=p(B,G,te)}),I}function gd(a){var p=Nn(a);return p.length==1&&p[0][2]?d1(p[0][0],p[0][1]):function(E){return E===a||sr(E,a,p)}}function ba(a,p){return c1(a)&&Hd(p)?d1(Xo(a),p):function(E){var I=oc(E,a);return I===i&&I===p?I1(E,a):ze(p,I,j|$)}}function Bc(a,p,E,I,B){a!==p&&v(p,function(G,te){if(B||(B=new co),Jr(G))Mm(a,p,te,E,Bc,I,B);else{var se=I?I(h1(a,te),G,te+\"\",a,p,B):i;se===i&&(se=G),Tl(a,te,se)}},Yi)}function Mm(a,p,E,I,B,G,te){var se=h1(a,E),Ee=h1(p,E),$e=te.get(Ee);if($e){Tl(a,E,$e);return}var Ke=G?G(se,Ee,E+\"\",a,p,te):i,nt=Ke===i;if(nt){var Ct=On(Ee),Gt=!Ct&&Eu(Ee),an=!Ct&&!Gt&&Df(Ee);Ke=Ee,Ct||Gt||an?On(se)?Ke=se:l0(se)?Ke=Xr(se):Gt?(nt=!1,Ke=Od(Ee,!0)):an?(nt=!1,Ke=Id(Ee,!0)):Ke=[]:ic(Ee)||Ll(Ee)?(Ke=se,Ll(se)?Ke=oa(se):(!Jr(se)||rs(se))&&(Ke=zd(Ee))):nt=!1}nt&&(te.set(Ee,Ke),B(Ke,Ee,I,G,te),te.delete(Ee)),Tl(a,E,Ke)}function _d(a,p){var E=a.length;if(!!E)return p+=p<0?E:0,es(p,E)?a[p]:i}function Oi(a,p,E){p.length?p=lt(p,function(G){return On(G)?function(te){return b(te,G.length===1?G[0]:G)}:G}):p=[$i];var I=-1;p=lt(p,qr(cn()));var B=vd(a,function(G,te,se){var Ee=lt(p,function($e){return $e(G)});return{criteria:Ee,index:++I,value:G}});return p0(B,function(G,te){return zm(G,te,E)})}function Fm(a,p){return yd(a,p,function(E,I){return I1(a,I)})}function yd(a,p,E){for(var I=-1,B=p.length,G={};++I<B;){var te=p[I],se=b(a,te);E(se,te)&&Ol(G,Gs(te,a),se)}return G}function ko(a){return function(p){return b(p,a)}}function Ko(a,p,E,I){var B=I?Ne:Qe,G=-1,te=p.length,se=a;for(a===p&&(p=Xr(p)),E&&(se=lt(a,qr(E)));++G<te;)for(var Ee=0,$e=p[G],Ke=E?E($e):$e;(Ee=B(se,Ke,Ee,I))>-1;)se!==a&&C0.call(se,Ee,1),C0.call(a,Ee,1);return a}function jc(a,p){for(var E=a?p.length:0,I=E-1;E--;){var B=p[E];if(E==I||B!==G){var G=B;es(B)?C0.call(a,B,1):$a(a,B)}}return a}function Ga(a,p){return a+hu(Ai()*(p-a+1))}function Lm(a,p,E,I){for(var B=-1,G=wr(B0((p-a)/(E||1)),0),te=Ie(G);G--;)te[I?G:++B]=a,a+=E;return te}function Va(a,p){var E=\"\";if(!a||p<1||p>Nt)return E;do p%2&&(E+=a),p=hu(p/2),p&&(a+=a);while(p);return E}function Wn(a,p){return m1(Gd(a,p,$i),a+\"\")}function wd(a){return Fc(Ef(a))}function Dd(a,p){var E=Ef(a);return Yc(E,mi(p,0,E.length))}function Ol(a,p,E,I){if(!Jr(a))return a;p=Gs(p,a);for(var B=-1,G=p.length,te=G-1,se=a;se!=null&&++B<G;){var Ee=Xo(p[B]),$e=E;if(Ee===\"__proto__\"||Ee===\"constructor\"||Ee===\"prototype\")return a;if(B!=te){var Ke=se[Ee];$e=I?I(Ke,Ee,se):i,$e===i&&($e=Jr(Ke)?Ke:es(p[B+1])?[]:{})}xl(se,Ee,$e),se=se[Ee]}return a}var Ed=Dt?function(a,p){return Dt.set(a,p),a}:$i,Rm=To?function(a,p){return To(a,\"toString\",{configurable:!0,enumerable:!1,value:R1(p),writable:!0})}:$i;function Ao(a){return Yc(Ef(a))}function Oo(a,p,E){var I=-1,B=a.length;p<0&&(p=-p>B?0:B+p),E=E>B?B:E,E<0&&(E+=B),B=p>E?0:E-p>>>0,p>>>=0;for(var G=Ie(B);++I<B;)G[I]=a[I+p];return G}function Nm(a,p){var E;return $o(a,function(I,B,G){return E=p(I,B,G),!E}),!!E}function Uc(a,p,E){var I=0,B=a==null?I:a.length;if(typeof p==\"number\"&&p===p&&B<=Z){for(;I<B;){var G=I+B>>>1,te=a[G];te!==null&&!mo(te)&&(E?te<=p:te<p)?I=G+1:B=G}return B}return Ya(a,p,$i,E)}function Ya(a,p,E,I){var B=0,G=a==null?0:a.length;if(G===0)return 0;p=E(p);for(var te=p!==p,se=p===null,Ee=mo(p),$e=p===i;B<G;){var Ke=hu((B+G)/2),nt=E(a[Ke]),Ct=nt!==i,Gt=nt===null,an=nt===nt,qn=mo(nt);if(te)var dn=I||an;else $e?dn=an&&(I||Ct):se?dn=an&&Ct&&(I||!Gt):Ee?dn=an&&Ct&&!Gt&&(I||!qn):Gt||qn?dn=!1:dn=I?nt<=p:nt<p;dn?B=Ke+1:G=Ke}return kn(G,ge)}function Sd(a,p){for(var E=-1,I=a.length,B=0,G=[];++E<I;){var te=a[E],se=p?p(te):te;if(!E||!Mo(se,Ee)){var Ee=se;G[B++]=te===0?0:te}}return G}function Cd(a){return typeof a==\"number\"?a:mo(a)?V:+a}function ho(a){if(typeof a==\"string\")return a;if(On(a))return lt(a,ho)+\"\";if(mo(a))return Ar?Ar.call(a):\"\";var p=a+\"\";return p==\"0\"&&1/a==-Ot?\"-0\":p}function bs(a,p,E){var I=-1,B=xt,G=a.length,te=!0,se=[],Ee=se;if(E)te=!1,B=wt;else if(G>=f){var $e=p?null:bm(a);if($e)return Y0($e);te=!1,B=So,Ee=new vu}else Ee=p?[]:se;e:for(;++I<G;){var Ke=a[I],nt=p?p(Ke):Ke;if(Ke=E||Ke!==0?Ke:0,te&&nt===nt){for(var Ct=Ee.length;Ct--;)if(Ee[Ct]===nt)continue e;p&&Ee.push(nt),se.push(Ke)}else B(Ee,nt,E)||(Ee!==se&&Ee.push(nt),se.push(Ke))}return se}function $a(a,p){return p=Gs(p,a),a=Vd(a,p),a==null||delete a[Xo(Po(p))]}function Td(a,p,E,I){return Ol(a,p,E(b(a,p)),I)}function qc(a,p,E,I){for(var B=a.length,G=I?B:-1;(I?G--:++G<B)&&p(a[G],G,a););return E?Oo(a,I?0:G,I?G+1:B):Oo(a,I?G+1:0,I?B:G)}function xd(a,p){var E=a;return E instanceof nn&&(E=E.value()),yn(p,function(I,B){return B.func.apply(B.thisArg,Rt([I],B.args))},E)}function Ka(a,p,E){var I=a.length;if(I<2)return I?bs(a[0]):[];for(var B=-1,G=Ie(I);++B<I;)for(var te=a[B],se=-1;++se<I;)se!=B&&(G[B]=ao(G[B]||te,a[se],p,E));return bs(k0(G,1),p,E)}function kd(a,p,E){for(var I=-1,B=a.length,G=p.length,te={};++I<B;){var se=I<G?p[I]:i;E(te,a[I],se)}return te}function Xa(a){return l0(a)?a:[]}function Ja(a){return typeof a==\"function\"?a:$i}function Gs(a,p){return On(a)?a:c1(a,p)?[a]:Xd(yr(a))}var Bm=Wn;function Vs(a,p,E){var I=a.length;return E=E===i?I:E,!p&&E>=I?a:Oo(a,p,E)}var Ad=pu||function(a){return Lr.clearTimeout(a)};function Od(a,p){if(p)return a.slice();var E=a.length,I=Nr?Nr(E):new a.constructor(E);return a.copy(I),I}function Qa(a){var p=new a.constructor(a.byteLength);return new R0(p).set(new R0(a)),p}function jm(a,p){var E=p?Qa(a.buffer):a.buffer;return new a.constructor(E,a.byteOffset,a.byteLength)}function Um(a){var p=new a.constructor(a.source,uu.exec(a));return p.lastIndex=a.lastIndex,p}function qm(a){return Wr?$t(Wr.call(a)):{}}function Id(a,p){var E=p?Qa(a.buffer):a.buffer;return new a.constructor(E,a.byteOffset,a.length)}function Pd(a,p){if(a!==p){var E=a!==i,I=a===null,B=a===a,G=mo(a),te=p!==i,se=p===null,Ee=p===p,$e=mo(p);if(!se&&!$e&&!G&&a>p||G&&te&&Ee&&!se&&!$e||I&&te&&Ee||!E&&Ee||!B)return 1;if(!I&&!G&&!$e&&a<p||$e&&E&&B&&!I&&!G||se&&E&&B||!te&&B||!Ee)return-1}return 0}function zm(a,p,E){for(var I=-1,B=a.criteria,G=p.criteria,te=B.length,se=E.length;++I<te;){var Ee=Pd(B[I],G[I]);if(Ee){if(I>=se)return Ee;var $e=E[I];return Ee*($e==\"desc\"?-1:1)}}return a.index-p.index}function gf(a,p,E,I){for(var B=-1,G=a.length,te=E.length,se=-1,Ee=p.length,$e=wr(G-te,0),Ke=Ie(Ee+$e),nt=!I;++se<Ee;)Ke[se]=p[se];for(;++B<te;)(nt||B<G)&&(Ke[E[B]]=a[B]);for(;$e--;)Ke[se++]=a[B++];return Ke}function Md(a,p,E,I){for(var B=-1,G=a.length,te=-1,se=E.length,Ee=-1,$e=p.length,Ke=wr(G-se,0),nt=Ie(Ke+$e),Ct=!I;++B<Ke;)nt[B]=a[B];for(var Gt=B;++Ee<$e;)nt[Gt+Ee]=p[Ee];for(;++te<se;)(Ct||B<G)&&(nt[Gt+E[te]]=a[B++]);return nt}function Xr(a,p){var E=-1,I=a.length;for(p||(p=Ie(I));++E<I;)p[E]=a[E];return p}function yi(a,p,E,I){var B=!E;E||(E={});for(var G=-1,te=p.length;++G<te;){var se=p[G],Ee=I?I(E[se],a[se],se,E,a):i;Ee===i&&(Ee=a[se]),B?ti(E,se,Ee):xl(E,se,Ee)}return E}function j0(a,p){return yi(a,o1(a),p)}function Zu(a,p){return yi(a,u1(a),p)}function _f(a,p){return function(E,I){var B=On(E)?xe:xo,G=p?p():{};return B(E,a,cn(I,2),G)}}function Io(a){return Wn(function(p,E){var I=-1,B=E.length,G=B>1?E[B-1]:i,te=B>2?E[2]:i;for(G=a.length>3&&typeof G==\"function\"?(B--,G):i,te&&Ii(E[0],E[1],te)&&(G=B<3?i:G,B=1),p=$t(p);++I<B;){var se=E[I];se&&a(p,se,I,G)}return p})}function _u(a,p){return function(E,I){if(E==null)return E;if(!Vi(E))return a(E,I);for(var B=E.length,G=p?B:-1,te=$t(E);(p?G--:++G<B)&&I(te[G],G,te)!==!1;);return E}}function ec(a){return function(p,E,I){for(var B=-1,G=$t(p),te=I(p),se=te.length;se--;){var Ee=te[a?se:++B];if(E(G[Ee],Ee,G)===!1)break}return p}}function Wm(a,p,E){var I=p&h,B=tc(a);function G(){var te=this&&this!==Lr&&this instanceof G?B:a;return te.apply(I?E:this,arguments)}return G}function Fd(a){return function(p){p=yr(p);var E=Hi(p)?Jn(p):i,I=E?E[0]:p.charAt(0),B=E?Vs(E,1).join(\"\"):p.slice(1);return I[a]()+B}}function yf(a){return function(p){return yn(Yp(Hp(p).replace(Hu,\"\")),a,\"\")}}function tc(a){return function(){var p=arguments;switch(p.length){case 0:return new a;case 1:return new a(p[0]);case 2:return new a(p[0],p[1]);case 3:return new a(p[0],p[1],p[2]);case 4:return new a(p[0],p[1],p[2],p[3]);case 5:return new a(p[0],p[1],p[2],p[3],p[4]);case 6:return new a(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new a(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var E=dr(a.prototype),I=a.apply(E,p);return Jr(I)?I:E}}function Hm(a,p,E){var I=tc(a);function B(){for(var G=arguments.length,te=Ie(G),se=G,Ee=An(B);se--;)te[se]=arguments[se];var $e=G<3&&te[0]!==Ee&&te[G-1]!==Ee?[]:L0(te,Ee);if(G-=$e.length,G<E)return ur(a,p,zc,B.placeholder,i,te,$e,i,i,E-G);var Ke=this&&this!==Lr&&this instanceof B?I:a;return K(Ke,this,te)}return B}function Ld(a){return function(p,E,I){var B=$t(p);if(!Vi(p)){var G=cn(E,3);p=q0(p),E=function(se){return G(B[se],se,B)}}var te=a(p,E,I);return te>-1?B[G?p[te]:te]:i}}function Rd(a){return yu(function(p){var E=p.length,I=E,B=Qn.prototype.thru;for(a&&p.reverse();I--;){var G=p[I];if(typeof G!=\"function\")throw new Yr(g);if(B&&!te&&Gc(G)==\"wrapper\")var te=new Qn([],!0)}for(I=te?I:E;++I<E;){G=p[I];var se=Gc(G),Ee=se==\"wrapper\"?i1(G):i;Ee&&a1(Ee[0])&&Ee[1]==(De|Q|Se|J)&&!Ee[4].length&&Ee[9]==1?te=te[Gc(Ee[0])].apply(te,Ee[3]):te=G.length==1&&a1(G)?te[se]():te.thru(G)}return function(){var $e=arguments,Ke=$e[0];if(te&&$e.length==1&&On(Ke))return te.plant(Ke).value();for(var nt=0,Ct=E?p[nt].apply(this,$e):Ke;++nt<E;)Ct=p[nt].call(this,Ct);return Ct}})}function zc(a,p,E,I,B,G,te,se,Ee,$e){var Ke=p&De,nt=p&h,Ct=p&re,Gt=p&(Q|oe),an=p&Te,qn=Ct?i:tc(a);function dn(){for(var Yn=arguments.length,er=Ie(Yn),vo=Yn;vo--;)er[vo]=arguments[vo];if(Gt)var Pi=An(dn),Mi=Dl(er,Pi);if(I&&(er=gf(er,I,B,Gt)),G&&(er=Md(er,G,te,Gt)),Yn-=Mi,Gt&&Yn<$e){var f0=L0(er,Pi);return ur(a,p,zc,dn.placeholder,E,er,f0,se,Ee,$e-Yn)}var Jo=nt?E:this,Su=Ct?Jo[a]:a;return Yn=er.length,se?er=p1(er,se):an&&Yn>1&&er.reverse(),Ke&&Ee<Yn&&(er.length=Ee),this&&this!==Lr&&this instanceof dn&&(Su=qn||tc(Su)),Su.apply(Jo,er)}return dn}function Nd(a,p){return function(E,I){return gi(E,a,p(I),{})}}function Wc(a,p){return function(E,I){var B;if(E===i&&I===i)return p;if(E!==i&&(B=E),I!==i){if(B===i)return I;typeof E==\"string\"||typeof I==\"string\"?(E=ho(E),I=ho(I)):(E=Cd(E),I=Cd(I)),B=a(E,I)}return B}}function Zn(a){return yu(function(p){return p=lt(p,qr(cn())),Wn(function(E){var I=this;return a(p,function(B){return K(B,I,E)})})})}function Hc(a,p){p=p===i?\" \":ho(p);var E=p.length;if(E<2)return E?Va(p,a):p;var I=Va(p,B0(a/Rr(p)));return Hi(p)?Vs(Jn(I),0,a).join(\"\"):I.slice(0,a)}function Za(a,p,E,I){var B=p&h,G=tc(a);function te(){for(var se=-1,Ee=arguments.length,$e=-1,Ke=I.length,nt=Ie(Ke+Ee),Ct=this&&this!==Lr&&this instanceof te?G:a;++$e<Ke;)nt[$e]=I[$e];for(;Ee--;)nt[$e++]=arguments[++se];return K(Ct,B?E:this,nt)}return te}function Bd(a){return function(p,E,I){return I&&typeof I!=\"number\"&&Ii(p,E,I)&&(E=I=i),p=is(p),E===i?(E=p,p=0):E=is(E),I=I===i?p<E?1:-1:is(I),Lm(p,E,I,a)}}function bc(a){return function(p,E){return typeof p==\"string\"&&typeof E==\"string\"||(p=Fo(p),E=Fo(E)),a(p,E)}}function ur(a,p,E,I,B,G,te,se,Ee,$e){var Ke=p&Q,nt=Ke?te:i,Ct=Ke?i:te,Gt=Ke?G:i,an=Ke?i:G;p|=Ke?Se:me,p&=~(Ke?me:Se),p&ce||(p&=~(h|re));var qn=[a,p,B,Gt,nt,an,Ct,se,Ee,$e],dn=E.apply(i,qn);return a1(a)&&Yd(dn,qn),dn.placeholder=I,$d(dn,a,p)}function e1(a){var p=Gn[a];return function(E,I){if(E=Fo(E),I=I==null?0:kn(jn(I),292),I&&Br(E)){var B=(yr(E)+\"e\").split(\"e\"),G=p(B[0]+\"e\"+(+B[1]+I));return B=(yr(G)+\"e\").split(\"e\"),+(B[0]+\"e\"+(+B[1]-I))}return p(E)}}var bm=he&&1/Y0(new he([,-0]))[1]==Ot?function(a){return new he(a)}:U1;function t1(a){return function(p){var E=U0(p);return E==w?Gr(p):E==r0?Co(p):xi(p,a(p))}}function Lt(a,p,E,I,B,G,te,se){var Ee=p&re;if(!Ee&&typeof a!=\"function\")throw new Yr(g);var $e=I?I.length:0;if($e||(p&=~(Se|me),I=B=i),te=te===i?te:wr(jn(te),0),se=se===i?se:jn(se),$e-=B?B.length:0,p&me){var Ke=I,nt=B;I=B=i}var Ct=Ee?i:i1(a),Gt=[a,p,E,I,B,Ke,nt,G,te,se];if(Ct&&ev(Gt,Ct),a=Gt[0],p=Gt[1],E=Gt[2],I=Gt[3],B=Gt[4],se=Gt[9]=Gt[9]===i?Ee?0:a.length:wr(Gt[9]-$e,0),!se&&p&(Q|oe)&&(p&=~(Q|oe)),!p||p==h)var an=Wm(a,p,E);else p==Q||p==oe?an=Hm(a,p,se):(p==Se||p==(h|Se))&&!B.length?an=Za(a,p,E,I):an=zc.apply(i,Gt);var qn=Ct?Ed:Yd;return $d(qn(an,Gt),a,p)}function n1(a,p,E,I){return a===i||Mo(a,Tn[E])&&!or.call(I,E)?p:a}function jd(a,p,E,I,B,G){return Jr(a)&&Jr(p)&&(G.set(p,a),Bc(a,p,i,jd,G),G.delete(p)),a}function Gm(a){return ic(a)?i:a}function Ud(a,p,E,I,B,G){var te=E&j,se=a.length,Ee=p.length;if(se!=Ee&&!(te&&Ee>se))return!1;var $e=G.get(a),Ke=G.get(p);if($e&&Ke)return $e==p&&Ke==a;var nt=-1,Ct=!0,Gt=E&$?new vu:i;for(G.set(a,p),G.set(p,a);++nt<se;){var an=a[nt],qn=p[nt];if(I)var dn=te?I(qn,an,nt,p,a,G):I(an,qn,nt,a,p,G);if(dn!==i){if(dn)continue;Ct=!1;break}if(Gt){if(!ar(p,function(Yn,er){if(!So(Gt,er)&&(an===Yn||B(an,Yn,E,I,G)))return Gt.push(er)})){Ct=!1;break}}else if(!(an===qn||B(an,qn,E,I,G))){Ct=!1;break}}return G.delete(a),G.delete(p),Ct}function Vm(a,p,E,I,B,G,te){switch(E){case ou:if(a.byteLength!=p.byteLength||a.byteOffset!=p.byteOffset)return!1;a=a.buffer,p=p.buffer;case iu:return!(a.byteLength!=p.byteLength||!G(new R0(a),new R0(p)));case jt:case hn:case pt:return Mo(+a,+p);case Jt:return a.name==p.name&&a.message==p.message;case gr:case Ci:return a==p+\"\";case w:var se=Gr;case r0:var Ee=I&j;if(se||(se=Y0),a.size!=p.size&&!Ee)return!1;var $e=te.get(a);if($e)return $e==p;I|=$,te.set(a,p);var Ke=Ud(se(a),se(p),I,B,G,te);return te.delete(a),Ke;case yo:if(Wr)return Wr.call(a)==Wr.call(p)}return!1}function Ym(a,p,E,I,B,G){var te=E&j,se=r1(a),Ee=se.length,$e=r1(p),Ke=$e.length;if(Ee!=Ke&&!te)return!1;for(var nt=Ee;nt--;){var Ct=se[nt];if(!(te?Ct in p:or.call(p,Ct)))return!1}var Gt=G.get(a),an=G.get(p);if(Gt&&an)return Gt==p&&an==a;var qn=!0;G.set(a,p),G.set(p,a);for(var dn=te;++nt<Ee;){Ct=se[nt];var Yn=a[Ct],er=p[Ct];if(I)var vo=te?I(er,Yn,Ct,p,a,G):I(Yn,er,Ct,a,p,G);if(!(vo===i?Yn===er||B(Yn,er,E,I,G):vo)){qn=!1;break}dn||(dn=Ct==\"constructor\")}if(qn&&!dn){var Pi=a.constructor,Mi=p.constructor;Pi!=Mi&&\"constructor\"in a&&\"constructor\"in p&&!(typeof Pi==\"function\"&&Pi instanceof Pi&&typeof Mi==\"function\"&&Mi instanceof Mi)&&(qn=!1)}return G.delete(a),G.delete(p),qn}function yu(a){return m1(Gd(a,i,Zd),a+\"\")}function r1(a){return ee(a,q0,o1)}function Dn(a){return ee(a,Yi,u1)}var i1=Dt?function(a){return Dt.get(a)}:U1;function Gc(a){for(var p=a.name+\"\",E=bt[p],I=or.call(bt,p)?E.length:0;I--;){var B=E[I],G=B.func;if(G==null||G==a)return B.name}return p}function An(a){var p=or.call(z,\"placeholder\")?z:a;return p.placeholder}function cn(){var a=z.iteratee||N1;return a=a===N1?ni:a,arguments.length?a(arguments[0],arguments[1]):a}function Vc(a,p){var E=a.__data__;return Jm(p)?E[typeof p==\"string\"?\"string\":\"hash\"]:E.map}function Nn(a){for(var p=q0(a),E=p.length;E--;){var I=p[E],B=a[I];p[E]=[I,B,Hd(B)]}return p}function Il(a,p){var E=oo(a,p);return mn(E)?E:i}function $m(a){var p=or.call(a,v0),E=a[v0];try{a[v0]=i;var I=!0}catch(G){}var B=J0.call(a);return I&&(p?a[v0]=E:delete a[v0]),B}var o1=Fn?function(a){return a==null?[]:(a=$t(a),st(Fn(a),function(p){return N0.call(a,p)}))}:z1,u1=Fn?function(a){for(var p=[];a;)Rt(p,o1(a)),a=uo(a);return p}:z1,U0=Ye;(X&&U0(new X(new ArrayBuffer(1)))!=ou||Y&&U0(new Y)!=w||ye&&U0(ye.resolve())!=Xn||he&&U0(new he)!=r0||We&&U0(new We)!=Mu)&&(U0=function(a){var p=Ye(a),E=p==Bn?a.constructor:i,I=E?Pl(E):\"\";if(I)switch(I){case Zt:return ou;case qt:return w;case Ut:return Xn;case fn:return r0;case _t:return Mu}return p});function s1(a,p,E){for(var I=-1,B=E.length;++I<B;){var G=E[I],te=G.size;switch(G.type){case\"drop\":a+=te;break;case\"dropRight\":p-=te;break;case\"take\":p=kn(p,a+te);break;case\"takeRight\":a=wr(a,p-te);break}}return{start:a,end:p}}function l1(a){var p=a.match(Bt);return p?p[1].split(Lu):[]}function qd(a,p,E){p=Gs(p,a);for(var I=-1,B=p.length,G=!1;++I<B;){var te=Xo(p[I]);if(!(G=a!=null&&E(a,te)))break;a=a[te]}return G||++I!=B?G:(B=a==null?0:a.length,!!B&&na(B)&&es(te,B)&&(On(a)||Ll(a)))}function f1(a){var p=a.length,E=new a.constructor(p);return p&&typeof a[0]==\"string\"&&or.call(a,\"index\")&&(E.index=a.index,E.input=a.input),E}function zd(a){return typeof a.constructor==\"function\"&&!nc(a)?dr(uo(a)):{}}function Wd(a,p,E){var I=a.constructor;switch(p){case iu:return Qa(a);case jt:case hn:return new I(+a);case ou:return jm(a,E);case ol:case ul:case Es:case Uo:case sl:case Ss:case Cs:case Ti:case Fu:return Id(a,E);case w:return new I;case pt:case Ci:return new I(a);case gr:return Um(a);case r0:return new I;case yo:return qm(a)}}function Km(a,p){var E=p.length;if(!E)return a;var I=E-1;return p[I]=(E>1?\"& \":\"\")+p[I],p=p.join(E>2?\", \":\" \"),a.replace(b0,`{\n/* [wrapped with `+p+`] */\n`)}function Xm(a){return On(a)||Ll(a)||!!(di&&a&&a[di])}function es(a,p){var E=typeof a;return p=p==null?Nt:p,!!p&&(E==\"number\"||E!=\"symbol\"&&uf.test(a))&&a>-1&&a%1==0&&a<p}function Ii(a,p,E){if(!Jr(E))return!1;var I=typeof p;return(I==\"number\"?Vi(E)&&es(p,E.length):I==\"string\"&&p in E)?Mo(E[p],a):!1}function c1(a,p){if(On(a))return!1;var E=typeof a;return E==\"number\"||E==\"symbol\"||E==\"boolean\"||a==null||mo(a)?!0:qi.test(a)||!dl.test(a)||p!=null&&a in $t(p)}function Jm(a){var p=typeof a;return p==\"string\"||p==\"number\"||p==\"symbol\"||p==\"boolean\"?a!==\"__proto__\":a===null}function a1(a){var p=Gc(a),E=z[p];if(typeof E!=\"function\"||!(p in nn.prototype))return!1;if(a===E)return!0;var I=i1(E);return!!I&&a===I[0]}function Qm(a){return!!Ku&&Ku in a}var Zm=Yo?rs:W1;function nc(a){var p=a&&a.constructor,E=typeof p==\"function\"&&p.prototype||Tn;return a===E}function Hd(a){return a===a&&!Jr(a)}function d1(a,p){return function(E){return E==null?!1:E[a]===p&&(p!==i||a in $t(E))}}function bd(a){var p=Qc(a,function(I){return E.size===A&&E.clear(),I}),E=p.cache;return p}function ev(a,p){var E=a[1],I=p[1],B=E|I,G=B<(h|re|De),te=I==De&&E==Q||I==De&&E==J&&a[7].length<=p[8]||I==(De|J)&&p[7].length<=p[8]&&E==Q;if(!(G||te))return a;I&h&&(a[2]=p[2],B|=E&h?0:ce);var se=p[3];if(se){var Ee=a[3];a[3]=Ee?gf(Ee,se,p[4]):se,a[4]=Ee?L0(a[3],x):p[4]}return se=p[5],se&&(Ee=a[5],a[5]=Ee?Md(Ee,se,p[6]):se,a[6]=Ee?L0(a[5],x):p[6]),se=p[7],se&&(a[7]=se),I&De&&(a[8]=a[8]==null?p[8]:kn(a[8],p[8])),a[9]==null&&(a[9]=p[9]),a[0]=p[0],a[1]=B,a}function tv(a){var p=[];if(a!=null)for(var E in $t(a))p.push(E);return p}function Ys(a){return J0.call(a)}function Gd(a,p,E){return p=wr(p===i?a.length-1:p,0),function(){for(var I=arguments,B=-1,G=wr(I.length-p,0),te=Ie(G);++B<G;)te[B]=I[p+B];B=-1;for(var se=Ie(p+1);++B<p;)se[B]=I[B];return se[p]=E(te),K(a,this,se)}}function Vd(a,p){return p.length<2?a:b(a,Oo(p,0,-1))}function p1(a,p){for(var E=a.length,I=kn(p.length,E),B=Xr(a);I--;){var G=p[I];a[I]=es(G,E)?B[G]:i}return a}function h1(a,p){if(!(p===\"constructor\"&&typeof a[p]==\"function\")&&p!=\"__proto__\")return a[p]}var Yd=Kd(Ed),wf=Cl||function(a,p){return Lr.setTimeout(a,p)},m1=Kd(Rm);function $d(a,p,E){var I=p+\"\";return m1(a,Km(I,nv(l1(I),E)))}function Kd(a){var p=0,E=0;return function(){var I=T0(),B=ct-(I-E);if(E=I,B>0){if(++p>=ot)return arguments[0]}else p=0;return a.apply(i,arguments)}}function Yc(a,p){var E=-1,I=a.length,B=I-1;for(p=p===i?I:p;++E<p;){var G=Ga(E,B),te=a[G];a[G]=a[E],a[E]=te}return a.length=p,a}var Xd=bd(function(a){var p=[];return a.charCodeAt(0)===46&&p.push(\"\"),a.replace(qo,function(E,I,B,G){p.push(B?G.replace(ks,\"$1\"):I||E)}),p});function Xo(a){if(typeof a==\"string\"||mo(a))return a;var p=a+\"\";return p==\"0\"&&1/a==-Ot?\"-0\":p}function Pl(a){if(a!=null){try{return bi.call(a)}catch(p){}try{return a+\"\"}catch(p){}}return\"\"}function nv(a,p){return je(Ae,function(E){var I=\"_.\"+E[0];p&E[1]&&!xt(a,I)&&a.push(I)}),a.sort()}function Jd(a){if(a instanceof nn)return a.clone();var p=new Qn(a.__wrapped__,a.__chain__);return p.__actions__=Xr(a.__actions__),p.__index__=a.__index__,p.__values__=a.__values__,p}function rv(a,p,E){(E?Ii(a,p,E):p===i)?p=1:p=wr(jn(p),0);var I=a==null?0:a.length;if(!I||p<1)return[];for(var B=0,G=0,te=Ie(B0(I/p));B<I;)te[G++]=Oo(a,B,B+=p);return te}function iv(a){for(var p=-1,E=a==null?0:a.length,I=0,B=[];++p<E;){var G=a[p];G&&(B[I++]=G)}return B}function ov(){var a=arguments.length;if(!a)return[];for(var p=Ie(a-1),E=arguments[0],I=a;I--;)p[I-1]=arguments[I];return Rt(On(E)?Xr(E):[E],k0(p,1))}var uv=Wn(function(a,p){return l0(a)?ao(a,k0(p,1,l0,!0)):[]}),wu=Wn(function(a,p){var E=Po(p);return l0(E)&&(E=i),l0(a)?ao(a,k0(p,1,l0,!0),cn(E,2)):[]}),Du=Wn(function(a,p){var E=Po(p);return l0(E)&&(E=i),l0(a)?ao(a,k0(p,1,l0,!0),i,E):[]});function ts(a,p,E){var I=a==null?0:a.length;return I?(p=E||p===i?1:jn(p),Oo(a,p<0?0:p,I)):[]}function ns(a,p,E){var I=a==null?0:a.length;return I?(p=E||p===i?1:jn(p),p=I-p,Oo(a,0,p<0?0:p)):[]}function sv(a,p){return a&&a.length?qc(a,cn(p,3),!0,!0):[]}function lv(a,p){return a&&a.length?qc(a,cn(p,3),!0):[]}function fv(a,p,E,I){var B=a==null?0:a.length;return B?(E&&typeof E!=\"number\"&&Ii(a,p,E)&&(E=0,I=B),vf(a,p,E,I)):[]}function Qd(a,p,E){var I=a==null?0:a.length;if(!I)return-1;var B=E==null?0:jn(E);return B<0&&(B=wr(I+B,0)),He(a,cn(p,3),B)}function $c(a,p,E){var I=a==null?0:a.length;if(!I)return-1;var B=I-1;return E!==i&&(B=jn(E),B=E<0?wr(I+B,0):kn(B,I-1)),He(a,cn(p,3),B,!0)}function Zd(a){var p=a==null?0:a.length;return p?k0(a,1):[]}function cv(a){var p=a==null?0:a.length;return p?k0(a,Ot):[]}function ep(a,p){var E=a==null?0:a.length;return E?(p=p===i?1:jn(p),k0(a,p)):[]}function av(a){for(var p=-1,E=a==null?0:a.length,I={};++p<E;){var B=a[p];I[B[0]]=B[1]}return I}function tp(a){return a&&a.length?a[0]:i}function dv(a,p,E){var I=a==null?0:a.length;if(!I)return-1;var B=E==null?0:jn(E);return B<0&&(B=wr(I+B,0)),Qe(a,p,B)}function pv(a){var p=a==null?0:a.length;return p?Oo(a,0,-1):[]}var hv=Wn(function(a){var p=lt(a,Xa);return p.length&&p[0]===a[0]?jr(p):[]}),np=Wn(function(a){var p=Po(a),E=lt(a,Xa);return p===Po(E)?p=i:E.pop(),E.length&&E[0]===a[0]?jr(E,cn(p,2)):[]}),mv=Wn(function(a){var p=Po(a),E=lt(a,Xa);return p=typeof p==\"function\"?p:i,p&&E.pop(),E.length&&E[0]===a[0]?jr(E,i,p):[]});function vv(a,p){return a==null?\"\":zr.call(a,p)}function Po(a){var p=a==null?0:a.length;return p?a[p-1]:i}function gv(a,p,E){var I=a==null?0:a.length;if(!I)return-1;var B=I;return E!==i&&(B=jn(E),B=B<0?wr(I+B,0):kn(B,I-1)),p===p?Vo(a,p,B):He(a,ft,B,!0)}function _v(a,p){return a&&a.length?_d(a,jn(p)):i}var yv=Wn(rp);function rp(a,p){return a&&a.length&&p&&p.length?Ko(a,p):a}function ip(a,p,E){return a&&a.length&&p&&p.length?Ko(a,p,cn(E,2)):a}function wv(a,p,E){return a&&a.length&&p&&p.length?Ko(a,p,i,E):a}var Dv=yu(function(a,p){var E=a==null?0:a.length,I=Hs(a,p);return jc(a,lt(p,function(B){return es(B,E)?+B:B}).sort(Pd)),I});function v1(a,p){var E=[];if(!(a&&a.length))return E;var I=-1,B=[],G=a.length;for(p=cn(p,3);++I<G;){var te=a[I];p(te,I,a)&&(E.push(te),B.push(I))}return jc(a,B),E}function g1(a){return a==null?a:Kt.call(a)}function Ev(a,p,E){var I=a==null?0:a.length;return I?(E&&typeof E!=\"number\"&&Ii(a,p,E)?(p=0,E=I):(p=p==null?0:jn(p),E=E===i?I:jn(E)),Oo(a,p,E)):[]}function op(a,p){return Uc(a,p)}function Sv(a,p,E){return Ya(a,p,cn(E,2))}function Cv(a,p){var E=a==null?0:a.length;if(E){var I=Uc(a,p);if(I<E&&Mo(a[I],p))return I}return-1}function Tv(a,p){return Uc(a,p,!0)}function xv(a,p,E){return Ya(a,p,cn(E,2),!0)}function kv(a,p){var E=a==null?0:a.length;if(E){var I=Uc(a,p,!0)-1;if(Mo(a[I],p))return I}return-1}function up(a){return a&&a.length?Sd(a):[]}function Av(a,p){return a&&a.length?Sd(a,cn(p,2)):[]}function Ov(a){var p=a==null?0:a.length;return p?Oo(a,1,p):[]}function Iv(a,p,E){return a&&a.length?(p=E||p===i?1:jn(p),Oo(a,0,p<0?0:p)):[]}function Pv(a,p,E){var I=a==null?0:a.length;return I?(p=E||p===i?1:jn(p),p=I-p,Oo(a,p<0?0:p,I)):[]}function Mv(a,p){return a&&a.length?qc(a,cn(p,3),!1,!0):[]}function Fv(a,p){return a&&a.length?qc(a,cn(p,3)):[]}var Lv=Wn(function(a){return bs(k0(a,1,l0,!0))}),$s=Wn(function(a){var p=Po(a);return l0(p)&&(p=i),bs(k0(a,1,l0,!0),cn(p,2))}),Ks=Wn(function(a){var p=Po(a);return p=typeof p==\"function\"?p:i,bs(k0(a,1,l0,!0),i,p)});function Xs(a){return a&&a.length?bs(a):[]}function Rv(a,p){return a&&a.length?bs(a,cn(p,2)):[]}function _1(a,p){return p=typeof p==\"function\"?p:i,a&&a.length?bs(a,i,p):[]}function y1(a){if(!(a&&a.length))return[];var p=0;return a=st(a,function(E){if(l0(E))return p=wr(E.length,p),!0}),ci(p,function(E){return lt(a,Qt(E))})}function sp(a,p){if(!(a&&a.length))return[];var E=y1(a);return p==null?E:lt(E,function(I){return K(p,i,I)})}var w1=Wn(function(a,p){return l0(a)?ao(a,p):[]}),Nv=Wn(function(a){return Ka(st(a,l0))}),Bv=Wn(function(a){var p=Po(a);return l0(p)&&(p=i),Ka(st(a,l0),cn(p,2))}),lp=Wn(function(a){var p=Po(a);return p=typeof p==\"function\"?p:i,Ka(st(a,l0),i,p)}),jv=Wn(y1);function Uv(a,p){return kd(a||[],p||[],xl)}function qv(a,p){return kd(a||[],p||[],Ol)}var zv=Wn(function(a){var p=a.length,E=p>1?a[p-1]:i;return E=typeof E==\"function\"?(a.pop(),E):i,sp(a,E)});function fp(a){var p=z(a);return p.__chain__=!0,p}function cp(a,p){return p(a),a}function Kc(a,p){return p(a)}var Wv=yu(function(a){var p=a.length,E=p?a[0]:0,I=this.__wrapped__,B=function(G){return Hs(G,a)};return p>1||this.__actions__.length||!(I instanceof nn)||!es(E)?this.thru(B):(I=I.slice(E,+E+(p?1:0)),I.__actions__.push({func:Kc,args:[B],thisArg:i}),new Qn(I,this.__chain__).thru(function(G){return p&&!G.length&&G.push(i),G}))});function Hv(){return fp(this)}function bv(){return new Qn(this.value(),this.__chain__)}function Gv(){this.__values__===i&&(this.__values__=Op(this.value()));var a=this.__index__>=this.__values__.length,p=a?i:this.__values__[this.__index__++];return{done:a,value:p}}function Vv(){return this}function Yv(a){for(var p,E=this;E instanceof Or;){var I=Jd(E);I.__index__=0,I.__values__=i,p?B.__wrapped__=I:p=I;var B=I;E=E.__wrapped__}return B.__wrapped__=a,p}function Ml(){var a=this.__wrapped__;if(a instanceof nn){var p=a;return this.__actions__.length&&(p=new nn(this)),p=p.reverse(),p.__actions__.push({func:Kc,args:[g1],thisArg:i}),new Qn(p,this.__chain__)}return this.thru(g1)}function Fl(){return xd(this.__wrapped__,this.__actions__)}var Xc=_f(function(a,p,E){or.call(a,E)?++a[E]:ti(a,E,1)});function $v(a,p,E){var I=On(a)?rt:Nc;return E&&Ii(a,p,E)&&(p=i),I(a,cn(p,3))}function Kv(a,p){var E=On(a)?st:Qf;return E(a,cn(p,3))}var Xv=Ld(Qd),D1=Ld($c);function Jv(a,p){return k0(Jc(a,p),1)}function Qv(a,p){return k0(Jc(a,p),Ot)}function ap(a,p,E){return E=E===i?1:jn(E),k0(Jc(a,p),E)}function dp(a,p){var E=On(a)?je:$o;return E(a,cn(p,3))}function pp(a,p){var E=On(a)?Xe:kl;return E(a,cn(p,3))}var Zv=_f(function(a,p,E){or.call(a,E)?a[E].push(p):ti(a,E,[p])});function eg(a,p,E,I){a=Vi(a)?a:Ef(a),E=E&&!I?jn(E):0;var B=a.length;return E<0&&(E=wr(B+E,0)),ia(a)?E<=B&&a.indexOf(p,E)>-1:!!B&&Qe(a,p,E)>-1}var tg=Wn(function(a,p,E){var I=-1,B=typeof p==\"function\",G=Vi(a)?Ie(a.length):[];return $o(a,function(te){G[++I]=B?K(p,te,E):po(te,p,E)}),G}),hp=_f(function(a,p,E){ti(a,E,p)});function Jc(a,p){var E=On(a)?lt:vd;return E(a,cn(p,3))}function ng(a,p,E,I){return a==null?[]:(On(p)||(p=p==null?[]:[p]),E=I?i:E,On(E)||(E=E==null?[]:[E]),Oi(a,p,E))}var rg=_f(function(a,p,E){a[E?0:1].push(p)},function(){return[[],[]]});function mp(a,p,E){var I=On(a)?yn:bn,B=arguments.length<3;return I(a,cn(p,4),E,B,$o)}function ig(a,p,E){var I=On(a)?sn:bn,B=arguments.length<3;return I(a,cn(p,4),E,B,kl)}function og(a,p){var E=On(a)?st:Qf;return E(a,Zc(cn(p,3)))}function ug(a){var p=On(a)?Fc:wd;return p(a)}function sg(a,p,E){(E?Ii(a,p,E):p===i)?p=1:p=jn(p);var I=On(a)?Lc:Dd;return I(a,p)}function lg(a){var p=On(a)?Kf:Ao;return p(a)}function E1(a){if(a==null)return 0;if(Vi(a))return ia(a)?Rr(a):a.length;var p=U0(a);return p==w||p==r0?a.size:Zf(a).length}function fg(a,p,E){var I=On(a)?ar:Nm;return E&&Ii(a,p,E)&&(p=i),I(a,cn(p,3))}var cg=Wn(function(a,p){if(a==null)return[];var E=p.length;return E>1&&Ii(a,p[0],p[1])?p=[]:E>2&&Ii(p[0],p[1],p[2])&&(p=[p[0]]),Oi(a,k0(p,1),[])}),rc=Sl||function(){return Lr.Date.now()};function ag(a,p){if(typeof p!=\"function\")throw new Yr(g);return a=jn(a),function(){if(--a<1)return p.apply(this,arguments)}}function vp(a,p,E){return p=E?i:p,p=a&&p==null?a.length:p,Lt(a,De,i,i,i,i,p)}function gp(a,p){var E;if(typeof p!=\"function\")throw new Yr(g);return a=jn(a),function(){return--a>0&&(E=p.apply(this,arguments)),a<=1&&(p=i),E}}var S1=Wn(function(a,p,E){var I=h;if(E.length){var B=L0(E,An(S1));I|=Se}return Lt(a,I,p,E,B)}),_p=Wn(function(a,p,E){var I=h|re;if(E.length){var B=L0(E,An(_p));I|=Se}return Lt(p,I,a,E,B)});function C1(a,p,E){p=E?i:p;var I=Lt(a,Q,i,i,i,i,i,p);return I.placeholder=C1.placeholder,I}function yp(a,p,E){p=E?i:p;var I=Lt(a,oe,i,i,i,i,i,p);return I.placeholder=yp.placeholder,I}function wp(a,p,E){var I,B,G,te,se,Ee,$e=0,Ke=!1,nt=!1,Ct=!0;if(typeof a!=\"function\")throw new Yr(g);p=Fo(p)||0,Jr(E)&&(Ke=!!E.leading,nt=\"maxWait\"in E,G=nt?wr(Fo(E.maxWait)||0,p):G,Ct=\"trailing\"in E?!!E.trailing:Ct);function Gt(f0){var Jo=I,Su=B;return I=B=i,$e=f0,te=a.apply(Su,Jo),te}function an(f0){return $e=f0,se=wf(Yn,p),Ke?Gt(f0):te}function qn(f0){var Jo=f0-Ee,Su=f0-$e,Zp=p-Jo;return nt?kn(Zp,G-Su):Zp}function dn(f0){var Jo=f0-Ee,Su=f0-$e;return Ee===i||Jo>=p||Jo<0||nt&&Su>=G}function Yn(){var f0=rc();if(dn(f0))return er(f0);se=wf(Yn,qn(f0))}function er(f0){return se=i,Ct&&I?Gt(f0):(I=B=i,te)}function vo(){se!==i&&Ad(se),$e=0,I=Ee=B=se=i}function Pi(){return se===i?te:er(rc())}function Mi(){var f0=rc(),Jo=dn(f0);if(I=arguments,B=this,Ee=f0,Jo){if(se===i)return an(Ee);if(nt)return Ad(se),se=wf(Yn,p),Gt(Ee)}return se===i&&(se=wf(Yn,p)),te}return Mi.cancel=vo,Mi.flush=Pi,Mi}var dg=Wn(function(a,p){return Jf(a,1,p)}),Dp=Wn(function(a,p,E){return Jf(a,Fo(p)||0,E)});function pg(a){return Lt(a,Te)}function Qc(a,p){if(typeof a!=\"function\"||p!=null&&typeof p!=\"function\")throw new Yr(g);var E=function(){var I=arguments,B=p?p.apply(this,I):I[0],G=E.cache;if(G.has(B))return G.get(B);var te=a.apply(this,I);return E.cache=G.set(B,te)||G,te};return E.cache=new(Qc.Cache||ei),E}Qc.Cache=ei;function Zc(a){if(typeof a!=\"function\")throw new Yr(g);return function(){var p=arguments;switch(p.length){case 0:return!a.call(this);case 1:return!a.call(this,p[0]);case 2:return!a.call(this,p[0],p[1]);case 3:return!a.call(this,p[0],p[1],p[2])}return!a.apply(this,p)}}function ea(a){return gp(2,a)}var hg=Bm(function(a,p){p=p.length==1&&On(p[0])?lt(p[0],qr(cn())):lt(k0(p,1),qr(cn()));var E=p.length;return Wn(function(I){for(var B=-1,G=kn(I.length,E);++B<G;)I[B]=p[B].call(this,I[B]);return K(a,this,I)})}),T1=Wn(function(a,p){var E=L0(p,An(T1));return Lt(a,Se,i,p,E)}),ta=Wn(function(a,p){var E=L0(p,An(ta));return Lt(a,me,i,p,E)}),mg=yu(function(a,p){return Lt(a,J,i,i,i,p)});function vg(a,p){if(typeof a!=\"function\")throw new Yr(g);return p=p===i?p:jn(p),Wn(a,p)}function Ep(a,p){if(typeof a!=\"function\")throw new Yr(g);return p=p==null?0:wr(jn(p),0),Wn(function(E){var I=E[p],B=Vs(E,0,p);return I&&Rt(B,I),K(a,this,B)})}function gg(a,p,E){var I=!0,B=!0;if(typeof a!=\"function\")throw new Yr(g);return Jr(E)&&(I=\"leading\"in E?!!E.leading:I,B=\"trailing\"in E?!!E.trailing:B),wp(a,p,{leading:I,maxWait:p,trailing:B})}function _g(a){return vp(a,1)}function yg(a,p){return T1(Ja(p),a)}function wg(){if(!arguments.length)return[];var a=arguments[0];return On(a)?a:[a]}function Dg(a){return vi(a,N)}function Sp(a,p){return p=typeof p==\"function\"?p:i,vi(a,N,p)}function Eg(a){return vi(a,D|N)}function Sg(a,p){return p=typeof p==\"function\"?p:i,vi(a,D|N,p)}function Cg(a,p){return p==null||Rc(a,p,q0(p))}function Mo(a,p){return a===p||a!==a&&p!==p}var Tg=bc(Ze),xg=bc(function(a,p){return a>=p}),Ll=_i(function(){return arguments}())?_i:function(a){return n0(a)&&or.call(a,\"callee\")&&!N0.call(a,\"callee\")},On=Ie.isArray,x1=ue?qr(ue):Re;function Vi(a){return a!=null&&na(a.length)&&!rs(a)}function l0(a){return n0(a)&&Vi(a)}function kg(a){return a===!0||a===!1||n0(a)&&Ye(a)==jt}var Eu=pi||W1,Ag=de?qr(de):Ce;function Og(a){return n0(a)&&a.nodeType===1&&!ic(a)}function Cp(a){if(a==null)return!0;if(Vi(a)&&(On(a)||typeof a==\"string\"||typeof a.splice==\"function\"||Eu(a)||Df(a)||Ll(a)))return!a.length;var p=U0(a);if(p==w||p==r0)return!a.size;if(nc(a))return!Zf(a).length;for(var E in a)if(or.call(a,E))return!1;return!0}function Ig(a,p){return ze(a,p)}function Pg(a,p,E){E=typeof E==\"function\"?E:i;var I=E?E(a,p):i;return I===i?ze(a,p,i,E):!!I}function k1(a){if(!n0(a))return!1;var p=Ye(a);return p==Jt||p==Un||typeof a.message==\"string\"&&typeof a.name==\"string\"&&!ic(a)}function Mg(a){return typeof a==\"number\"&&Br(a)}function rs(a){if(!Jr(a))return!1;var p=Ye(a);return p==Yt||p==cr||p==Ft||p==vr}function A1(a){return typeof a==\"number\"&&a==jn(a)}function na(a){return typeof a==\"number\"&&a>-1&&a%1==0&&a<=Nt}function Jr(a){var p=typeof a;return a!=null&&(p==\"object\"||p==\"function\")}function n0(a){return a!=null&&typeof a==\"object\"}var Tp=W?qr(W):on;function Fg(a,p){return a===p||sr(a,p,Nn(p))}function Lg(a,p,E){return E=typeof E==\"function\"?E:i,sr(a,p,Nn(p),E)}function Rg(a){return xp(a)&&a!=+a}function Ng(a){if(Zm(a))throw new mt(c);return mn(a)}function Bg(a){return a===null}function O1(a){return a==null}function xp(a){return typeof a==\"number\"||n0(a)&&Ye(a)==pt}function ic(a){if(!n0(a)||Ye(a)!=Bn)return!1;var p=uo(a);if(p===null)return!0;var E=or.call(p,\"constructor\")&&p.constructor;return typeof E==\"function\"&&E instanceof E&&bi.call(E)==af}var ra=ve?qr(ve):pr;function jg(a){return A1(a)&&a>=-Nt&&a<=Nt}var kp=Fe?qr(Fe):Hr;function ia(a){return typeof a==\"string\"||!On(a)&&n0(a)&&Ye(a)==Ci}function mo(a){return typeof a==\"symbol\"||n0(a)&&Ye(a)==yo}var Df=Ge?qr(Ge):Vn;function Ap(a){return a===i}function Ug(a){return n0(a)&&U0(a)==Mu}function qg(a){return n0(a)&&Ye(a)==Gf}var zg=bc(Ha),Wg=bc(function(a,p){return a<=p});function Op(a){if(!a)return[];if(Vi(a))return ia(a)?Jn(a):Xr(a);if(u0&&a[u0])return F0(a[u0]());var p=U0(a),E=p==w?Gr:p==r0?Y0:Ef;return E(a)}function is(a){if(!a)return a===0?a:0;if(a=Fo(a),a===Ot||a===-Ot){var p=a<0?-1:1;return p*Je}return a===a?a:0}function jn(a){var p=is(a),E=p%1;return p===p?E?p-E:p:0}function Ip(a){return a?mi(jn(a),0,ne):0}function Fo(a){if(typeof a==\"number\")return a;if(mo(a))return V;if(Jr(a)){var p=typeof a.valueOf==\"function\"?a.valueOf():a;a=Jr(p)?p+\"\":p}if(typeof a!=\"string\")return a===0?a:+a;a=E0(a);var E=zo.test(a);return E||Is.test(a)?Vu(a.slice(2),E?2:8):wo.test(a)?V:+a}function oa(a){return yi(a,Yi(a))}function Hg(a){return a?mi(jn(a),-Nt,Nt):a===0?a:0}function yr(a){return a==null?\"\":ho(a)}var Pp=Io(function(a,p){if(nc(p)||Vi(p)){yi(p,q0(p),a);return}for(var E in p)or.call(p,E)&&xl(a,E,p[E])}),Mp=Io(function(a,p){yi(p,Yi(p),a)}),ua=Io(function(a,p,E,I){yi(p,Yi(p),a,I)}),bg=Io(function(a,p,E,I){yi(p,q0(p),a,I)}),Gg=yu(Hs);function Vg(a,p){var E=dr(a);return p==null?E:mf(E,p)}var Fp=Wn(function(a,p){a=$t(a);var E=-1,I=p.length,B=I>2?p[2]:i;for(B&&Ii(p[0],p[1],B)&&(I=1);++E<I;)for(var G=p[E],te=Yi(G),se=-1,Ee=te.length;++se<Ee;){var $e=te[se],Ke=a[$e];(Ke===i||Mo(Ke,Tn[$e])&&!or.call(a,$e))&&(a[$e]=G[$e])}return a}),Yg=Wn(function(a){return a.push(i,jd),K(Np,i,a)});function $g(a,p){return Cr(a,cn(p,3),S)}function Kg(a,p){return Cr(a,cn(p,3),O)}function Xg(a,p){return a==null?a:v(a,cn(p,3),Yi)}function Jg(a,p){return a==null?a:m(a,cn(p,3),Yi)}function Qg(a,p){return a&&S(a,cn(p,3))}function Zg(a,p){return a&&O(a,cn(p,3))}function e_(a){return a==null?[]:M(a,q0(a))}function t_(a){return a==null?[]:M(a,Yi(a))}function oc(a,p,E){var I=a==null?i:b(a,p);return I===i?E:I}function n_(a,p){return a!=null&&qd(a,p,ut)}function I1(a,p){return a!=null&&qd(a,p,In)}var Lp=Nd(function(a,p,E){p!=null&&typeof p.toString!=\"function\"&&(p=J0.call(p)),a[p]=E},R1($i)),r_=Nd(function(a,p,E){p!=null&&typeof p.toString!=\"function\"&&(p=J0.call(p)),or.call(a,p)?a[p].push(E):a[p]=[E]},cn),i_=Wn(po);function q0(a){return Vi(a)?Mc(a):Zf(a)}function Yi(a){return Vi(a)?Mc(a,!0):Pm(a)}function o_(a,p){var E={};return p=cn(p,3),S(a,function(I,B,G){ti(E,p(I,B,G),I)}),E}function Rp(a,p){var E={};return p=cn(p,3),S(a,function(I,B,G){ti(E,B,p(I,B,G))}),E}var u_=Io(function(a,p,E){Bc(a,p,E)}),Np=Io(function(a,p,E,I){Bc(a,p,E,I)}),s_=yu(function(a,p){var E={};if(a==null)return E;var I=!1;p=lt(p,function(G){return G=Gs(G,a),I||(I=G.length>1),G}),yi(a,Dn(a),E),I&&(E=vi(E,D|L|N,Gm));for(var B=p.length;B--;)$a(E,p[B]);return E});function l_(a,p){return Bp(a,Zc(cn(p)))}var f_=yu(function(a,p){return a==null?{}:Fm(a,p)});function Bp(a,p){if(a==null)return{};var E=lt(Dn(a),function(I){return[I]});return p=cn(p),yd(a,E,function(I,B){return p(I,B[0])})}function c_(a,p,E){p=Gs(p,a);var I=-1,B=p.length;for(B||(B=1,a=i);++I<B;){var G=a==null?i:a[Xo(p[I])];G===i&&(I=B,G=E),a=rs(G)?G.call(a):G}return a}function jp(a,p,E){return a==null?a:Ol(a,p,E)}function Up(a,p,E,I){return I=typeof I==\"function\"?I:i,a==null?a:Ol(a,p,E,I)}var qp=t1(q0),zp=t1(Yi);function P1(a,p,E){var I=On(a),B=I||Eu(a)||Df(a);if(p=cn(p,4),E==null){var G=a&&a.constructor;B?E=I?new G:[]:Jr(a)?E=rs(G)?dr(uo(a)):{}:E={}}return(B?je:S)(a,function(te,se,Ee){return p(E,te,se,Ee)}),E}function a_(a,p){return a==null?!0:$a(a,p)}function d_(a,p,E){return a==null?a:Td(a,p,Ja(E))}function p_(a,p,E,I){return I=typeof I==\"function\"?I:i,a==null?a:Td(a,p,Ja(E),I)}function Ef(a){return a==null?[]:Eo(a,q0(a))}function h_(a){return a==null?[]:Eo(a,Yi(a))}function m_(a,p,E){return E===i&&(E=p,p=i),E!==i&&(E=Fo(E),E=E===E?E:0),p!==i&&(p=Fo(p),p=p===p?p:0),mi(Fo(a),p,E)}function v_(a,p,E){return p=is(p),E===i?(E=p,p=0):E=is(E),a=Fo(a),A0(a,p,E)}function g_(a,p,E){if(E&&typeof E!=\"boolean\"&&Ii(a,p,E)&&(p=E=i),E===i&&(typeof p==\"boolean\"?(E=p,p=i):typeof a==\"boolean\"&&(E=a,a=i)),a===i&&p===i?(a=0,p=1):(a=is(a),p===i?(p=a,a=0):p=is(p)),a>p){var I=a;a=p,p=I}if(E||a%1||p%1){var B=Ai();return kn(a+B*(p-a+Bs(\"1e-\"+((B+\"\").length-1))),p)}return Ga(a,p)}var __=yf(function(a,p,E){return p=p.toLowerCase(),a+(E?Wp(p):p)});function Wp(a){return L1(yr(a).toLowerCase())}function Hp(a){return a=yr(a),a&&a.replace(_n,du).replace(V0,\"\")}function y_(a,p,E){a=yr(a),p=ho(p);var I=a.length;E=E===i?I:mi(jn(E),0,I);var B=E;return E-=p.length,E>=0&&a.slice(E,B)==p}function M1(a){return a=yr(a),a&&Ac.test(a)?a.replace(Ui,Yu):a}function w_(a){return a=yr(a),a&&Fr.test(a)?a.replace(kr,\"\\\\$&\"):a}var D_=yf(function(a,p,E){return a+(E?\"-\":\"\")+p.toLowerCase()}),bp=yf(function(a,p,E){return a+(E?\" \":\"\")+p.toLowerCase()}),E_=Fd(\"toLowerCase\");function S_(a,p,E){a=yr(a),p=jn(p);var I=p?Rr(a):0;if(!p||I>=p)return a;var B=(p-I)/2;return Hc(hu(B),E)+a+Hc(B0(B),E)}function C_(a,p,E){a=yr(a),p=jn(p);var I=p?Rr(a):0;return p&&I<p?a+Hc(p-I,E):a}function T_(a,p,E){a=yr(a),p=jn(p);var I=p?Rr(a):0;return p&&I<p?Hc(p-I,E)+a:a}function x_(a,p,E){return E||p==null?p=0:p&&(p=+p),hi(yr(a).replace(si,\"\"),p||0)}function Gp(a,p,E){return(E?Ii(a,p,E):p===i)?p=1:p=jn(p),Va(yr(a),p)}function k_(){var a=arguments,p=yr(a[0]);return a.length<3?p:p.replace(a[1],a[2])}var A_=yf(function(a,p,E){return a+(E?\"_\":\"\")+p.toLowerCase()});function O_(a,p,E){return E&&typeof E!=\"number\"&&Ii(a,p,E)&&(p=E=i),E=E===i?ne:E>>>0,E?(a=yr(a),a&&(typeof p==\"string\"||p!=null&&!ra(p))&&(p=ho(p),!p&&Hi(a))?Vs(Jn(a),0,E):a.split(p,E)):[]}var I_=yf(function(a,p,E){return a+(E?\" \":\"\")+L1(p)});function P_(a,p,E){return a=yr(a),E=E==null?0:mi(jn(E),0,a.length),p=ho(p),a.slice(E,E+p.length)==p}function M_(a,p,E){var I=z.templateSettings;E&&Ii(a,p,E)&&(p=i),a=yr(a),p=ua({},p,I,n1);var B=ua({},p.imports,I.imports,n1),G=q0(B),te=Eo(B,G),se,Ee,$e=0,Ke=p.interpolate||Nu,nt=\"__p += '\",Ct=X0((p.escape||Nu).source+\"|\"+Ke.source+\"|\"+(Ke===xs?As:Nu).source+\"|\"+(p.evaluate||Nu).source+\"|$\",\"g\"),Gt=\"//# sourceURL=\"+(or.call(p,\"sourceURL\")?(p.sourceURL+\"\").replace(/\\s/g,\" \"):\"lodash.templateSources[\"+ ++lf+\"]\")+`\n`;a.replace(Ct,function(dn,Yn,er,vo,Pi,Mi){return er||(er=vo),nt+=a.slice($e,Mi).replace(Wo,Us),Yn&&(se=!0,nt+=`' +\n__e(`+Yn+`) +\n'`),Pi&&(Ee=!0,nt+=`';\n`+Pi+`;\n__p += '`),er&&(nt+=`' +\n((__t = (`+er+`)) == null ? '' : __t) +\n'`),$e=Mi+dn.length,dn}),nt+=`';\n`;var an=or.call(p,\"variable\")&&p.variable;if(!an)nt=`with (obj) {\n`+nt+`\n}\n`;else if(Ru.test(an))throw new mt(t);nt=(Ee?nt.replace(ll,\"\"):nt).replace(fl,\"$1\").replace(cl,\"$1;\"),nt=\"function(\"+(an||\"obj\")+`) {\n`+(an?\"\":`obj || (obj = {});\n`)+\"var __t, __p = ''\"+(se?\", __e = _.escape\":\"\")+(Ee?`, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n`:`;\n`)+nt+`return __p\n}`;var qn=$p(function(){return wn(G,Gt+\"return \"+nt).apply(i,te)});if(qn.source=nt,k1(qn))throw qn;return qn}function F_(a){return yr(a).toLowerCase()}function L_(a){return yr(a).toUpperCase()}function R_(a,p,E){if(a=yr(a),a&&(E||p===i))return E0(a);if(!a||!(p=ho(p)))return a;var I=Jn(a),B=Jn(p),G=wl(I,B),te=js(I,B)+1;return Vs(I,G,te).join(\"\")}function F1(a,p,E){if(a=yr(a),a&&(E||p===i))return a.slice(0,ai(a)+1);if(!a||!(p=ho(p)))return a;var I=Jn(a),B=js(I,Jn(p))+1;return Vs(I,0,B).join(\"\")}function N_(a,p,E){if(a=yr(a),a&&(E||p===i))return a.replace(si,\"\");if(!a||!(p=ho(p)))return a;var I=Jn(a),B=wl(I,Jn(p));return Vs(I,B).join(\"\")}function B_(a,p){var E=Oe,I=Le;if(Jr(p)){var B=\"separator\"in p?p.separator:B;E=\"length\"in p?jn(p.length):E,I=\"omission\"in p?ho(p.omission):I}a=yr(a);var G=a.length;if(Hi(a)){var te=Jn(a);G=te.length}if(E>=G)return a;var se=E-Rr(I);if(se<1)return I;var Ee=te?Vs(te,0,se).join(\"\"):a.slice(0,se);if(B===i)return Ee+I;if(te&&(se+=Ee.length-se),ra(B)){if(a.slice(se).search(B)){var $e,Ke=Ee;for(B.global||(B=X0(B.source,yr(uu.exec(B))+\"g\")),B.lastIndex=0;$e=B.exec(Ke);)var nt=$e.index;Ee=Ee.slice(0,nt===i?se:nt)}}else if(a.indexOf(ho(B),se)!=se){var Ct=Ee.lastIndexOf(B);Ct>-1&&(Ee=Ee.slice(0,Ct))}return Ee+I}function Vp(a){return a=yr(a),a&&Mr.test(a)?a.replace(al,o0):a}var j_=yf(function(a,p,E){return a+(E?\" \":\"\")+p.toUpperCase()}),L1=Fd(\"toUpperCase\");function Yp(a,p,E){return a=yr(a),p=E?i:p,p===i?qs(a)?cf(a):d0(a):a.match(p)||[]}var $p=Wn(function(a,p){try{return K(a,i,p)}catch(E){return k1(E)?E:new mt(E)}}),U_=yu(function(a,p){return je(p,function(E){E=Xo(E),ti(a,E,S1(a[E],a))}),a});function Kp(a){var p=a==null?0:a.length,E=cn();return a=p?lt(a,function(I){if(typeof I[1]!=\"function\")throw new Yr(g);return[E(I[0]),I[1]]}):[],Wn(function(I){for(var B=-1;++B<p;){var G=a[B];if(K(G[0],this,I))return K(G[1],this,I)}})}function q_(a){return Xf(vi(a,D))}function R1(a){return function(){return a}}function z_(a,p){return a==null||a!==a?p:a}var W_=Rd(),H_=Rd(!0);function $i(a){return a}function N1(a){return ni(typeof a==\"function\"?a:vi(a,D))}function b_(a){return gd(vi(a,D))}function G_(a,p){return ba(a,vi(p,D))}var B1=Wn(function(a,p){return function(E){return po(E,a,p)}}),V_=Wn(function(a,p){return function(E){return po(a,E,p)}});function j1(a,p,E){var I=q0(p),B=M(p,I);E==null&&!(Jr(p)&&(B.length||!I.length))&&(E=p,p=a,a=this,B=M(p,q0(p)));var G=!(Jr(E)&&\"chain\"in E)||!!E.chain,te=rs(a);return je(B,function(se){var Ee=p[se];a[se]=Ee,te&&(a.prototype[se]=function(){var $e=this.__chain__;if(G||$e){var Ke=a(this.__wrapped__),nt=Ke.__actions__=Xr(this.__actions__);return nt.push({func:Ee,args:arguments,thisArg:a}),Ke.__chain__=$e,Ke}return Ee.apply(a,Rt([this.value()],arguments))})}),a}function Xp(){return Lr._===this&&(Lr._=S0),this}function U1(){}function Y_(a){return a=jn(a),Wn(function(p){return _d(p,a)})}var $_=Zn(lt),K_=Zn(rt),X_=Zn(ar);function q1(a){return c1(a)?Qt(Xo(a)):ko(a)}function J_(a){return function(p){return a==null?i:b(a,p)}}var Q_=Bd(),Z_=Bd(!0);function z1(){return[]}function W1(){return!1}function e4(){return{}}function t4(){return\"\"}function n4(){return!0}function r4(a,p){if(a=jn(a),a<1||a>Nt)return[];var E=ne,I=kn(a,ne);p=cn(p),a-=ne;for(var B=ci(I,p);++E<a;)p(E);return B}function H1(a){return On(a)?lt(a,Xo):mo(a)?[a]:Xr(Xd(yr(a)))}function i4(a){var p=++zs;return yr(a)+p}var o4=Wc(function(a,p){return a+p},0),Jp=e1(\"ceil\"),u4=Wc(function(a,p){return a/p},1),s4=e1(\"floor\");function l4(a){return a&&a.length?Al(a,$i,Ze):i}function f4(a,p){return a&&a.length?Al(a,cn(p,2),Ze):i}function c4(a){return St(a,$i)}function Qp(a,p){return St(a,cn(p,2))}function a4(a){return a&&a.length?Al(a,$i,Ha):i}function d4(a,p){return a&&a.length?Al(a,cn(p,2),Ha):i}var p4=Wc(function(a,p){return a*p},1),h4=e1(\"round\"),m4=Wc(function(a,p){return a-p},0);function v4(a){return a&&a.length?h0(a,$i):0}function g4(a,p){return a&&a.length?h0(a,cn(p,2)):0}return z.after=ag,z.ary=vp,z.assign=Pp,z.assignIn=Mp,z.assignInWith=ua,z.assignWith=bg,z.at=Gg,z.before=gp,z.bind=S1,z.bindAll=U_,z.bindKey=_p,z.castArray=wg,z.chain=fp,z.chunk=rv,z.compact=iv,z.concat=ov,z.cond=Kp,z.conforms=q_,z.constant=R1,z.countBy=Xc,z.create=Vg,z.curry=C1,z.curryRight=yp,z.debounce=wp,z.defaults=Fp,z.defaultsDeep=Yg,z.defer=dg,z.delay=Dp,z.difference=uv,z.differenceBy=wu,z.differenceWith=Du,z.drop=ts,z.dropRight=ns,z.dropRightWhile=sv,z.dropWhile=lv,z.fill=fv,z.filter=Kv,z.flatMap=Jv,z.flatMapDeep=Qv,z.flatMapDepth=ap,z.flatten=Zd,z.flattenDeep=cv,z.flattenDepth=ep,z.flip=pg,z.flow=W_,z.flowRight=H_,z.fromPairs=av,z.functions=e_,z.functionsIn=t_,z.groupBy=Zv,z.initial=pv,z.intersection=hv,z.intersectionBy=np,z.intersectionWith=mv,z.invert=Lp,z.invertBy=r_,z.invokeMap=tg,z.iteratee=N1,z.keyBy=hp,z.keys=q0,z.keysIn=Yi,z.map=Jc,z.mapKeys=o_,z.mapValues=Rp,z.matches=b_,z.matchesProperty=G_,z.memoize=Qc,z.merge=u_,z.mergeWith=Np,z.method=B1,z.methodOf=V_,z.mixin=j1,z.negate=Zc,z.nthArg=Y_,z.omit=s_,z.omitBy=l_,z.once=ea,z.orderBy=ng,z.over=$_,z.overArgs=hg,z.overEvery=K_,z.overSome=X_,z.partial=T1,z.partialRight=ta,z.partition=rg,z.pick=f_,z.pickBy=Bp,z.property=q1,z.propertyOf=J_,z.pull=yv,z.pullAll=rp,z.pullAllBy=ip,z.pullAllWith=wv,z.pullAt=Dv,z.range=Q_,z.rangeRight=Z_,z.rearg=mg,z.reject=og,z.remove=v1,z.rest=vg,z.reverse=g1,z.sampleSize=sg,z.set=jp,z.setWith=Up,z.shuffle=lg,z.slice=Ev,z.sortBy=cg,z.sortedUniq=up,z.sortedUniqBy=Av,z.split=O_,z.spread=Ep,z.tail=Ov,z.take=Iv,z.takeRight=Pv,z.takeRightWhile=Mv,z.takeWhile=Fv,z.tap=cp,z.throttle=gg,z.thru=Kc,z.toArray=Op,z.toPairs=qp,z.toPairsIn=zp,z.toPath=H1,z.toPlainObject=oa,z.transform=P1,z.unary=_g,z.union=Lv,z.unionBy=$s,z.unionWith=Ks,z.uniq=Xs,z.uniqBy=Rv,z.uniqWith=_1,z.unset=a_,z.unzip=y1,z.unzipWith=sp,z.update=d_,z.updateWith=p_,z.values=Ef,z.valuesIn=h_,z.without=w1,z.words=Yp,z.wrap=yg,z.xor=Nv,z.xorBy=Bv,z.xorWith=lp,z.zip=jv,z.zipObject=Uv,z.zipObjectDeep=qv,z.zipWith=zv,z.entries=qp,z.entriesIn=zp,z.extend=Mp,z.extendWith=ua,j1(z,z),z.add=o4,z.attempt=$p,z.camelCase=__,z.capitalize=Wp,z.ceil=Jp,z.clamp=m_,z.clone=Dg,z.cloneDeep=Eg,z.cloneDeepWith=Sg,z.cloneWith=Sp,z.conformsTo=Cg,z.deburr=Hp,z.defaultTo=z_,z.divide=u4,z.endsWith=y_,z.eq=Mo,z.escape=M1,z.escapeRegExp=w_,z.every=$v,z.find=Xv,z.findIndex=Qd,z.findKey=$g,z.findLast=D1,z.findLastIndex=$c,z.findLastKey=Kg,z.floor=s4,z.forEach=dp,z.forEachRight=pp,z.forIn=Xg,z.forInRight=Jg,z.forOwn=Qg,z.forOwnRight=Zg,z.get=oc,z.gt=Tg,z.gte=xg,z.has=n_,z.hasIn=I1,z.head=tp,z.identity=$i,z.includes=eg,z.indexOf=dv,z.inRange=v_,z.invoke=i_,z.isArguments=Ll,z.isArray=On,z.isArrayBuffer=x1,z.isArrayLike=Vi,z.isArrayLikeObject=l0,z.isBoolean=kg,z.isBuffer=Eu,z.isDate=Ag,z.isElement=Og,z.isEmpty=Cp,z.isEqual=Ig,z.isEqualWith=Pg,z.isError=k1,z.isFinite=Mg,z.isFunction=rs,z.isInteger=A1,z.isLength=na,z.isMap=Tp,z.isMatch=Fg,z.isMatchWith=Lg,z.isNaN=Rg,z.isNative=Ng,z.isNil=O1,z.isNull=Bg,z.isNumber=xp,z.isObject=Jr,z.isObjectLike=n0,z.isPlainObject=ic,z.isRegExp=ra,z.isSafeInteger=jg,z.isSet=kp,z.isString=ia,z.isSymbol=mo,z.isTypedArray=Df,z.isUndefined=Ap,z.isWeakMap=Ug,z.isWeakSet=qg,z.join=vv,z.kebabCase=D_,z.last=Po,z.lastIndexOf=gv,z.lowerCase=bp,z.lowerFirst=E_,z.lt=zg,z.lte=Wg,z.max=l4,z.maxBy=f4,z.mean=c4,z.meanBy=Qp,z.min=a4,z.minBy=d4,z.stubArray=z1,z.stubFalse=W1,z.stubObject=e4,z.stubString=t4,z.stubTrue=n4,z.multiply=p4,z.nth=_v,z.noConflict=Xp,z.noop=U1,z.now=rc,z.pad=S_,z.padEnd=C_,z.padStart=T_,z.parseInt=x_,z.random=g_,z.reduce=mp,z.reduceRight=ig,z.repeat=Gp,z.replace=k_,z.result=c_,z.round=h4,z.runInContext=ae,z.sample=ug,z.size=E1,z.snakeCase=A_,z.some=fg,z.sortedIndex=op,z.sortedIndexBy=Sv,z.sortedIndexOf=Cv,z.sortedLastIndex=Tv,z.sortedLastIndexBy=xv,z.sortedLastIndexOf=kv,z.startCase=I_,z.startsWith=P_,z.subtract=m4,z.sum=v4,z.sumBy=g4,z.template=M_,z.times=r4,z.toFinite=is,z.toInteger=jn,z.toLength=Ip,z.toLower=F_,z.toNumber=Fo,z.toSafeInteger=Hg,z.toString=yr,z.toUpper=L_,z.trim=R_,z.trimEnd=F1,z.trimStart=N_,z.truncate=B_,z.unescape=Vp,z.uniqueId=i4,z.upperCase=j_,z.upperFirst=L1,z.each=dp,z.eachRight=pp,z.first=tp,j1(z,function(){var a={};return S(z,function(p,E){or.call(z.prototype,E)||(a[E]=p)}),a}(),{chain:!1}),z.VERSION=u,je([\"bind\",\"bindKey\",\"curry\",\"curryRight\",\"partial\",\"partialRight\"],function(a){z[a].placeholder=z}),je([\"drop\",\"take\"],function(a,p){nn.prototype[a]=function(E){E=E===i?1:wr(jn(E),0);var I=this.__filtered__&&!p?new nn(this):this.clone();return I.__filtered__?I.__takeCount__=kn(E,I.__takeCount__):I.__views__.push({size:kn(E,ne),type:a+(I.__dir__<0?\"Right\":\"\")}),I},nn.prototype[a+\"Right\"]=function(E){return this.reverse()[a](E).reverse()}}),je([\"filter\",\"map\",\"takeWhile\"],function(a,p){var E=p+1,I=E==Ue||E==At;nn.prototype[a]=function(B){var G=this.clone();return G.__iteratees__.push({iteratee:cn(B,3),type:E}),G.__filtered__=G.__filtered__||I,G}}),je([\"head\",\"last\"],function(a,p){var E=\"take\"+(p?\"Right\":\"\");nn.prototype[a]=function(){return this[E](1).value()[0]}}),je([\"initial\",\"tail\"],function(a,p){var E=\"drop\"+(p?\"\":\"Right\");nn.prototype[a]=function(){return this.__filtered__?new nn(this):this[E](1)}}),nn.prototype.compact=function(){return this.filter($i)},nn.prototype.find=function(a){return this.filter(a).head()},nn.prototype.findLast=function(a){return this.reverse().find(a)},nn.prototype.invokeMap=Wn(function(a,p){return typeof a==\"function\"?new nn(this):this.map(function(E){return po(E,a,p)})}),nn.prototype.reject=function(a){return this.filter(Zc(cn(a)))},nn.prototype.slice=function(a,p){a=jn(a);var E=this;return E.__filtered__&&(a>0||p<0)?new nn(E):(a<0?E=E.takeRight(-a):a&&(E=E.drop(a)),p!==i&&(p=jn(p),E=p<0?E.dropRight(-p):E.take(p-a)),E)},nn.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},nn.prototype.toArray=function(){return this.take(ne)},S(nn.prototype,function(a,p){var E=/^(?:filter|find|map|reject)|While$/.test(p),I=/^(?:head|last)$/.test(p),B=z[I?\"take\"+(p==\"last\"?\"Right\":\"\"):p],G=I||/^find/.test(p);!B||(z.prototype[p]=function(){var te=this.__wrapped__,se=I?[1]:arguments,Ee=te instanceof nn,$e=se[0],Ke=Ee||On(te),nt=function(Yn){var er=B.apply(z,Rt([Yn],se));return I&&Ct?er[0]:er};Ke&&E&&typeof $e==\"function\"&&$e.length!=1&&(Ee=Ke=!1);var Ct=this.__chain__,Gt=!!this.__actions__.length,an=G&&!Ct,qn=Ee&&!Gt;if(!G&&Ke){te=qn?te:new nn(this);var dn=a.apply(te,se);return dn.__actions__.push({func:Kc,args:[nt],thisArg:i}),new Qn(dn,Ct)}return an&&qn?a.apply(this,se):(dn=this.thru(nt),an?I?dn.value()[0]:dn.value():dn)})}),je([\"pop\",\"push\",\"shift\",\"sort\",\"splice\",\"unshift\"],function(a){var p=$r[a],E=/^(?:push|sort|unshift)$/.test(a)?\"tap\":\"thru\",I=/^(?:pop|shift)$/.test(a);z.prototype[a]=function(){var B=arguments;if(I&&!this.__chain__){var G=this.value();return p.apply(On(G)?G:[],B)}return this[E](function(te){return p.apply(On(te)?te:[],B)})}}),S(nn.prototype,function(a,p){var E=z[p];if(E){var I=E.name+\"\";or.call(bt,I)||(bt[I]=[]),bt[I].push({name:p,func:E})}}),bt[zc(i,re).name]=[{name:\"wrapper\",func:i}],nn.prototype.clone=s0,nn.prototype.reverse=t0,nn.prototype.value=g0,z.prototype.at=Wv,z.prototype.chain=Hv,z.prototype.commit=bv,z.prototype.next=Gv,z.prototype.plant=Yv,z.prototype.reverse=Ml,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=Fl,z.prototype.first=z.prototype.head,u0&&(z.prototype[u0]=Vv),z},K0=$0();typeof define==\"function\"&&typeof define.amd==\"object\"&&define.amd?(Lr._=K0,define(function(){return K0})):R?((R.exports=K0)._=K0,F._=K0):Lr._=K0}).call(ga)});var ay=Me((XH,cy)=>{\"use strict\";var fr=cy.exports;cy.exports.default=fr;var Pr=\"\u001b[\",t2=\"\u001b]\",ya=\"\\x07\",vh=\";\",OD=process.env.TERM_PROGRAM===\"Apple_Terminal\";fr.cursorTo=(i,u)=>{if(typeof i!=\"number\")throw new TypeError(\"The `x` argument is required\");return typeof u!=\"number\"?Pr+(i+1)+\"G\":Pr+(u+1)+\";\"+(i+1)+\"H\"};fr.cursorMove=(i,u)=>{if(typeof i!=\"number\")throw new TypeError(\"The `x` argument is required\");let f=\"\";return i<0?f+=Pr+-i+\"D\":i>0&&(f+=Pr+i+\"C\"),u<0?f+=Pr+-u+\"A\":u>0&&(f+=Pr+u+\"B\"),f};fr.cursorUp=(i=1)=>Pr+i+\"A\";fr.cursorDown=(i=1)=>Pr+i+\"B\";fr.cursorForward=(i=1)=>Pr+i+\"C\";fr.cursorBackward=(i=1)=>Pr+i+\"D\";fr.cursorLeft=Pr+\"G\";fr.cursorSavePosition=OD?\"\u001b7\":Pr+\"s\";fr.cursorRestorePosition=OD?\"\u001b8\":Pr+\"u\";fr.cursorGetPosition=Pr+\"6n\";fr.cursorNextLine=Pr+\"E\";fr.cursorPrevLine=Pr+\"F\";fr.cursorHide=Pr+\"?25l\";fr.cursorShow=Pr+\"?25h\";fr.eraseLines=i=>{let u=\"\";for(let f=0;f<i;f++)u+=fr.eraseLine+(f<i-1?fr.cursorUp():\"\");return i&&(u+=fr.cursorLeft),u};fr.eraseEndLine=Pr+\"K\";fr.eraseStartLine=Pr+\"1K\";fr.eraseLine=Pr+\"2K\";fr.eraseDown=Pr+\"J\";fr.eraseUp=Pr+\"1J\";fr.eraseScreen=Pr+\"2J\";fr.scrollUp=Pr+\"S\";fr.scrollDown=Pr+\"T\";fr.clearScreen=\"\u001bc\";fr.clearTerminal=process.platform===\"win32\"?`${fr.eraseScreen}${Pr}0f`:`${fr.eraseScreen}${Pr}3J${Pr}H`;fr.beep=ya;fr.link=(i,u)=>[t2,\"8\",vh,vh,u,ya,i,t2,\"8\",vh,vh,ya].join(\"\");fr.image=(i,u={})=>{let f=`${t2}1337;File=inline=1`;return u.width&&(f+=`;width=${u.width}`),u.height&&(f+=`;height=${u.height}`),u.preserveAspectRatio===!1&&(f+=\";preserveAspectRatio=0\"),f+\":\"+i.toString(\"base64\")+ya};fr.iTerm={setCwd:(i=process.cwd())=>`${t2}50;CurrentDir=${i}${ya}`,annotation:(i,u={})=>{let f=`${t2}1337;`,c=typeof u.x!=\"undefined\",g=typeof u.y!=\"undefined\";if((c||g)&&!(c&&g&&typeof u.length!=\"undefined\"))throw new Error(\"`x`, `y` and `length` must be defined when `x` or `y` is defined\");return i=i.replace(/\\|/g,\"\"),f+=u.isHidden?\"AddHiddenAnnotation=\":\"AddAnnotation=\",u.length>0?f+=(c?[i,u.length,u.x,u.y]:[u.length,i]).join(\"|\"):f+=i,f+ya}}});var PD=Me((JH,dy)=>{\"use strict\";var ID=(i,u)=>{for(let f of Reflect.ownKeys(u))Object.defineProperty(i,f,Object.getOwnPropertyDescriptor(u,f));return i};dy.exports=ID;dy.exports.default=ID});var FD=Me((QH,gh)=>{\"use strict\";var oN=PD(),_h=new WeakMap,MD=(i,u={})=>{if(typeof i!=\"function\")throw new TypeError(\"Expected a function\");let f,c=!1,g=0,t=i.displayName||i.name||\"<anonymous>\",C=function(...A){if(_h.set(C,++g),c){if(u.throw===!0)throw new Error(`Function \\`${t}\\` can only be called once`);return f}return c=!0,f=i.apply(this,A),i=null,f};return oN(C,i),_h.set(C,g),C};gh.exports=MD;gh.exports.default=MD;gh.exports.callCount=i=>{if(!_h.has(i))throw new Error(`The given function \\`${i.name}\\` is not wrapped by the \\`onetime\\` package`);return _h.get(i)}});var LD=Me((ZH,yh)=>{yh.exports=[\"SIGABRT\",\"SIGALRM\",\"SIGHUP\",\"SIGINT\",\"SIGTERM\"];process.platform!==\"win32\"&&yh.exports.push(\"SIGVTALRM\",\"SIGXCPU\",\"SIGXFSZ\",\"SIGUSR2\",\"SIGTRAP\",\"SIGSYS\",\"SIGQUIT\",\"SIGIOT\");process.platform===\"linux\"&&yh.exports.push(\"SIGIO\",\"SIGPOLL\",\"SIGPWR\",\"SIGSTKFLT\",\"SIGUNUSED\")});var vy=Me((eb,n2)=>{var uN=require(\"assert\"),r2=LD(),sN=/^win/i.test(process.platform),wh=require(\"events\");typeof wh!=\"function\"&&(wh=wh.EventEmitter);var Bi;process.__signal_exit_emitter__?Bi=process.__signal_exit_emitter__:(Bi=process.__signal_exit_emitter__=new wh,Bi.count=0,Bi.emitted={});Bi.infinite||(Bi.setMaxListeners(Infinity),Bi.infinite=!0);n2.exports=function(i,u){uN.equal(typeof i,\"function\",\"a callback must be provided for exit handler\"),i2===!1&&RD();var f=\"exit\";u&&u.alwaysLast&&(f=\"afterexit\");var c=function(){Bi.removeListener(f,i),Bi.listeners(\"exit\").length===0&&Bi.listeners(\"afterexit\").length===0&&py()};return Bi.on(f,i),c};n2.exports.unload=py;function py(){!i2||(i2=!1,r2.forEach(function(i){try{process.removeListener(i,hy[i])}catch(u){}}),process.emit=my,process.reallyExit=ND,Bi.count-=1)}function wa(i,u,f){Bi.emitted[i]||(Bi.emitted[i]=!0,Bi.emit(i,u,f))}var hy={};r2.forEach(function(i){hy[i]=function(){var f=process.listeners(i);f.length===Bi.count&&(py(),wa(\"exit\",null,i),wa(\"afterexit\",null,i),sN&&i===\"SIGHUP\"&&(i=\"SIGINT\"),process.kill(process.pid,i))}});n2.exports.signals=function(){return r2};n2.exports.load=RD;var i2=!1;function RD(){i2||(i2=!0,Bi.count+=1,r2=r2.filter(function(i){try{return process.on(i,hy[i]),!0}catch(u){return!1}}),process.emit=fN,process.reallyExit=lN)}var ND=process.reallyExit;function lN(i){process.exitCode=i||0,wa(\"exit\",process.exitCode,null),wa(\"afterexit\",process.exitCode,null),ND.call(process,process.exitCode)}var my=process.emit;function fN(i,u){if(i===\"exit\"){u!==void 0&&(process.exitCode=u);var f=my.apply(this,arguments);return wa(\"exit\",process.exitCode,null),wa(\"afterexit\",process.exitCode,null),f}else return my.apply(this,arguments)}});var jD=Me((tb,BD)=>{\"use strict\";var cN=FD(),aN=vy();BD.exports=cN(()=>{aN(()=>{process.stderr.write(\"\u001b[?25h\")},{alwaysLast:!0})})});var gy=Me(Da=>{\"use strict\";var dN=jD(),Dh=!1;Da.show=(i=process.stderr)=>{!i.isTTY||(Dh=!1,i.write(\"\u001b[?25h\"))};Da.hide=(i=process.stderr)=>{!i.isTTY||(dN(),Dh=!0,i.write(\"\u001b[?25l\"))};Da.toggle=(i,u)=>{i!==void 0&&(Dh=i),Dh?Da.show(u):Da.hide(u)}});var WD=Me(o2=>{\"use strict\";var UD=o2&&o2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(o2,\"__esModule\",{value:!0});var qD=UD(ay()),zD=UD(gy()),pN=(i,{showCursor:u=!1}={})=>{let f=0,c=\"\",g=!1,t=C=>{!u&&!g&&(zD.default.hide(),g=!0);let A=C+`\n`;A!==c&&(c=A,i.write(qD.default.eraseLines(f)+A),f=A.split(`\n`).length)};return t.clear=()=>{i.write(qD.default.eraseLines(f)),c=\"\",f=0},t.done=()=>{c=\"\",f=0,u||(zD.default.show(),g=!1)},t};o2.default={create:pN}});var bD=Me((ib,HD)=>{HD.exports=[{name:\"AppVeyor\",constant:\"APPVEYOR\",env:\"APPVEYOR\",pr:\"APPVEYOR_PULL_REQUEST_NUMBER\"},{name:\"Azure Pipelines\",constant:\"AZURE_PIPELINES\",env:\"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI\",pr:\"SYSTEM_PULLREQUEST_PULLREQUESTID\"},{name:\"Bamboo\",constant:\"BAMBOO\",env:\"bamboo_planKey\"},{name:\"Bitbucket Pipelines\",constant:\"BITBUCKET\",env:\"BITBUCKET_COMMIT\",pr:\"BITBUCKET_PR_ID\"},{name:\"Bitrise\",constant:\"BITRISE\",env:\"BITRISE_IO\",pr:\"BITRISE_PULL_REQUEST\"},{name:\"Buddy\",constant:\"BUDDY\",env:\"BUDDY_WORKSPACE_ID\",pr:\"BUDDY_EXECUTION_PULL_REQUEST_ID\"},{name:\"Buildkite\",constant:\"BUILDKITE\",env:\"BUILDKITE\",pr:{env:\"BUILDKITE_PULL_REQUEST\",ne:\"false\"}},{name:\"CircleCI\",constant:\"CIRCLE\",env:\"CIRCLECI\",pr:\"CIRCLE_PULL_REQUEST\"},{name:\"Cirrus CI\",constant:\"CIRRUS\",env:\"CIRRUS_CI\",pr:\"CIRRUS_PR\"},{name:\"AWS CodeBuild\",constant:\"CODEBUILD\",env:\"CODEBUILD_BUILD_ARN\"},{name:\"Codeship\",constant:\"CODESHIP\",env:{CI_NAME:\"codeship\"}},{name:\"Drone\",constant:\"DRONE\",env:\"DRONE\",pr:{DRONE_BUILD_EVENT:\"pull_request\"}},{name:\"dsari\",constant:\"DSARI\",env:\"DSARI\"},{name:\"GitLab CI\",constant:\"GITLAB\",env:\"GITLAB_CI\"},{name:\"GoCD\",constant:\"GOCD\",env:\"GO_PIPELINE_LABEL\"},{name:\"Hudson\",constant:\"HUDSON\",env:\"HUDSON_URL\"},{name:\"Jenkins\",constant:\"JENKINS\",env:[\"JENKINS_URL\",\"BUILD_ID\"],pr:{any:[\"ghprbPullId\",\"CHANGE_ID\"]}},{name:\"Magnum CI\",constant:\"MAGNUM\",env:\"MAGNUM\"},{name:\"Netlify CI\",constant:\"NETLIFY\",env:\"NETLIFY_BUILD_BASE\",pr:{env:\"PULL_REQUEST\",ne:\"false\"}},{name:\"Sail CI\",constant:\"SAIL\",env:\"SAILCI\",pr:\"SAIL_PULL_REQUEST_NUMBER\"},{name:\"Semaphore\",constant:\"SEMAPHORE\",env:\"SEMAPHORE\",pr:\"PULL_REQUEST_NUMBER\"},{name:\"Shippable\",constant:\"SHIPPABLE\",env:\"SHIPPABLE\",pr:{IS_PULL_REQUEST:\"true\"}},{name:\"Solano CI\",constant:\"SOLANO\",env:\"TDDIUM\",pr:\"TDDIUM_PR_ID\"},{name:\"Strider CD\",constant:\"STRIDER\",env:\"STRIDER\"},{name:\"TaskCluster\",constant:\"TASKCLUSTER\",env:[\"TASK_ID\",\"RUN_ID\"]},{name:\"TeamCity\",constant:\"TEAMCITY\",env:\"TEAMCITY_VERSION\"},{name:\"Travis CI\",constant:\"TRAVIS\",env:\"TRAVIS\",pr:{env:\"TRAVIS_PULL_REQUEST\",ne:\"false\"}}]});var YD=Me(ru=>{\"use strict\";var GD=bD(),nl=process.env;Object.defineProperty(ru,\"_vendors\",{value:GD.map(function(i){return i.constant})});ru.name=null;ru.isPR=null;GD.forEach(function(i){var u=Array.isArray(i.env)?i.env:[i.env],f=u.every(function(c){return VD(c)});if(ru[i.constant]=f,f)switch(ru.name=i.name,typeof i.pr){case\"string\":ru.isPR=!!nl[i.pr];break;case\"object\":\"env\"in i.pr?ru.isPR=i.pr.env in nl&&nl[i.pr.env]!==i.pr.ne:\"any\"in i.pr?ru.isPR=i.pr.any.some(function(c){return!!nl[c]}):ru.isPR=VD(i.pr);break;default:ru.isPR=null}});ru.isCI=!!(nl.CI||nl.CONTINUOUS_INTEGRATION||nl.BUILD_NUMBER||nl.RUN_ID||ru.name);function VD(i){return typeof i==\"string\"?!!nl[i]:Object.keys(i).every(function(u){return nl[u]===i[u]})}});var KD=Me((ub,$D)=>{\"use strict\";$D.exports=YD().isCI});var JD=Me((sb,XD)=>{\"use strict\";var hN=i=>{let u=new Set;do for(let f of Reflect.ownKeys(i))u.add([i,f]);while((i=Reflect.getPrototypeOf(i))&&i!==Object.prototype);return u};XD.exports=(i,{include:u,exclude:f}={})=>{let c=g=>{let t=C=>typeof C==\"string\"?g===C:C.test(g);return u?u.some(t):f?!f.some(t):!0};for(let[g,t]of hN(i.constructor.prototype)){if(t===\"constructor\"||!c(t))continue;let C=Reflect.getOwnPropertyDescriptor(g,t);C&&typeof C.value==\"function\"&&(i[t]=i[t].bind(i))}return i}});var iE=Me(Sr=>{\"use strict\";Object.defineProperty(Sr,\"__esModule\",{value:!0});var Ea,u2,Eh,Sh,_y;typeof window==\"undefined\"||typeof MessageChannel!=\"function\"?(Sa=null,yy=null,wy=function(){if(Sa!==null)try{var i=Sr.unstable_now();Sa(!0,i),Sa=null}catch(u){throw setTimeout(wy,0),u}},QD=Date.now(),Sr.unstable_now=function(){return Date.now()-QD},Ea=function(i){Sa!==null?setTimeout(Ea,0,i):(Sa=i,setTimeout(wy,0))},u2=function(i,u){yy=setTimeout(i,u)},Eh=function(){clearTimeout(yy)},Sh=function(){return!1},_y=Sr.unstable_forceFrameRate=function(){}):(Ch=window.performance,Dy=window.Date,ZD=window.setTimeout,eE=window.clearTimeout,typeof console!=\"undefined\"&&(tE=window.cancelAnimationFrame,typeof window.requestAnimationFrame!=\"function\"&&console.error(\"This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills\"),typeof tE!=\"function\"&&console.error(\"This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills\")),typeof Ch==\"object\"&&typeof Ch.now==\"function\"?Sr.unstable_now=function(){return Ch.now()}:(nE=Dy.now(),Sr.unstable_now=function(){return Dy.now()-nE}),s2=!1,l2=null,Th=-1,Ey=5,Sy=0,Sh=function(){return Sr.unstable_now()>=Sy},_y=function(){},Sr.unstable_forceFrameRate=function(i){0>i||125<i?console.error(\"forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported\"):Ey=0<i?Math.floor(1e3/i):5},Cy=new MessageChannel,xh=Cy.port2,Cy.port1.onmessage=function(){if(l2!==null){var i=Sr.unstable_now();Sy=i+Ey;try{l2(!0,i)?xh.postMessage(null):(s2=!1,l2=null)}catch(u){throw xh.postMessage(null),u}}else s2=!1},Ea=function(i){l2=i,s2||(s2=!0,xh.postMessage(null))},u2=function(i,u){Th=ZD(function(){i(Sr.unstable_now())},u)},Eh=function(){eE(Th),Th=-1});var Sa,yy,wy,QD,Ch,Dy,ZD,eE,tE,nE,s2,l2,Th,Ey,Sy,Cy,xh;function Ty(i,u){var f=i.length;i.push(u);e:for(;;){var c=Math.floor((f-1)/2),g=i[c];if(g!==void 0&&0<kh(g,u))i[c]=u,i[f]=g,f=c;else break e}}function Iu(i){return i=i[0],i===void 0?null:i}function Ah(i){var u=i[0];if(u!==void 0){var f=i.pop();if(f!==u){i[0]=f;e:for(var c=0,g=i.length;c<g;){var t=2*(c+1)-1,C=i[t],A=t+1,x=i[A];if(C!==void 0&&0>kh(C,f))x!==void 0&&0>kh(x,C)?(i[c]=x,i[A]=f,c=A):(i[c]=C,i[t]=f,c=t);else if(x!==void 0&&0>kh(x,f))i[c]=x,i[A]=f,c=A;else break e}}return u}return null}function kh(i,u){var f=i.sortIndex-u.sortIndex;return f!==0?f:i.id-u.id}var ds=[],Nf=[],mN=1,_o=null,to=3,Oh=!1,pc=!1,f2=!1;function Ih(i){for(var u=Iu(Nf);u!==null;){if(u.callback===null)Ah(Nf);else if(u.startTime<=i)Ah(Nf),u.sortIndex=u.expirationTime,Ty(ds,u);else break;u=Iu(Nf)}}function xy(i){if(f2=!1,Ih(i),!pc)if(Iu(ds)!==null)pc=!0,Ea(ky);else{var u=Iu(Nf);u!==null&&u2(xy,u.startTime-i)}}function ky(i,u){pc=!1,f2&&(f2=!1,Eh()),Oh=!0;var f=to;try{for(Ih(u),_o=Iu(ds);_o!==null&&(!(_o.expirationTime>u)||i&&!Sh());){var c=_o.callback;if(c!==null){_o.callback=null,to=_o.priorityLevel;var g=c(_o.expirationTime<=u);u=Sr.unstable_now(),typeof g==\"function\"?_o.callback=g:_o===Iu(ds)&&Ah(ds),Ih(u)}else Ah(ds);_o=Iu(ds)}if(_o!==null)var t=!0;else{var C=Iu(Nf);C!==null&&u2(xy,C.startTime-u),t=!1}return t}finally{_o=null,to=f,Oh=!1}}function rE(i){switch(i){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var vN=_y;Sr.unstable_ImmediatePriority=1;Sr.unstable_UserBlockingPriority=2;Sr.unstable_NormalPriority=3;Sr.unstable_IdlePriority=5;Sr.unstable_LowPriority=4;Sr.unstable_runWithPriority=function(i,u){switch(i){case 1:case 2:case 3:case 4:case 5:break;default:i=3}var f=to;to=i;try{return u()}finally{to=f}};Sr.unstable_next=function(i){switch(to){case 1:case 2:case 3:var u=3;break;default:u=to}var f=to;to=u;try{return i()}finally{to=f}};Sr.unstable_scheduleCallback=function(i,u,f){var c=Sr.unstable_now();if(typeof f==\"object\"&&f!==null){var g=f.delay;g=typeof g==\"number\"&&0<g?c+g:c,f=typeof f.timeout==\"number\"?f.timeout:rE(i)}else f=rE(i),g=c;return f=g+f,i={id:mN++,callback:u,priorityLevel:i,startTime:g,expirationTime:f,sortIndex:-1},g>c?(i.sortIndex=g,Ty(Nf,i),Iu(ds)===null&&i===Iu(Nf)&&(f2?Eh():f2=!0,u2(xy,g-c))):(i.sortIndex=f,Ty(ds,i),pc||Oh||(pc=!0,Ea(ky))),i};Sr.unstable_cancelCallback=function(i){i.callback=null};Sr.unstable_wrapCallback=function(i){var u=to;return function(){var f=to;to=u;try{return i.apply(this,arguments)}finally{to=f}}};Sr.unstable_getCurrentPriorityLevel=function(){return to};Sr.unstable_shouldYield=function(){var i=Sr.unstable_now();Ih(i);var u=Iu(ds);return u!==_o&&_o!==null&&u!==null&&u.callback!==null&&u.startTime<=i&&u.expirationTime<_o.expirationTime||Sh()};Sr.unstable_requestPaint=vN;Sr.unstable_continueExecution=function(){pc||Oh||(pc=!0,Ea(ky))};Sr.unstable_pauseExecution=function(){};Sr.unstable_getFirstCallbackNode=function(){return Iu(ds)};Sr.unstable_Profiling=null});var Ay=Me((fb,oE)=>{\"use strict\";oE.exports=iE()});var uE=Me((cb,c2)=>{c2.exports=function i(u){\"use strict\";var f=ey(),c=lr(),g=Ay();function t(v){for(var m=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+v,S=1;S<arguments.length;S++)m+=\"&args[]=\"+encodeURIComponent(arguments[S]);return\"Minified React error #\"+v+\"; visit \"+m+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}var C=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;C.hasOwnProperty(\"ReactCurrentDispatcher\")||(C.ReactCurrentDispatcher={current:null}),C.hasOwnProperty(\"ReactCurrentBatchConfig\")||(C.ReactCurrentBatchConfig={suspense:null});var A=typeof Symbol==\"function\"&&Symbol.for,x=A?Symbol.for(\"react.element\"):60103,D=A?Symbol.for(\"react.portal\"):60106,L=A?Symbol.for(\"react.fragment\"):60107,N=A?Symbol.for(\"react.strict_mode\"):60108,j=A?Symbol.for(\"react.profiler\"):60114,$=A?Symbol.for(\"react.provider\"):60109,h=A?Symbol.for(\"react.context\"):60110,re=A?Symbol.for(\"react.concurrent_mode\"):60111,ce=A?Symbol.for(\"react.forward_ref\"):60112,Q=A?Symbol.for(\"react.suspense\"):60113,oe=A?Symbol.for(\"react.suspense_list\"):60120,Se=A?Symbol.for(\"react.memo\"):60115,me=A?Symbol.for(\"react.lazy\"):60116;A&&Symbol.for(\"react.fundamental\"),A&&Symbol.for(\"react.responder\"),A&&Symbol.for(\"react.scope\");var De=typeof Symbol==\"function\"&&Symbol.iterator;function J(v){return v===null||typeof v!=\"object\"?null:(v=De&&v[De]||v[\"@@iterator\"],typeof v==\"function\"?v:null)}function Te(v){if(v._status===-1){v._status=0;var m=v._ctor;m=m(),v._result=m,m.then(function(S){v._status===0&&(S=S.default,v._status=1,v._result=S)},function(S){v._status===0&&(v._status=2,v._result=S)})}}function Oe(v){if(v==null)return null;if(typeof v==\"function\")return v.displayName||v.name||null;if(typeof v==\"string\")return v;switch(v){case L:return\"Fragment\";case D:return\"Portal\";case j:return\"Profiler\";case N:return\"StrictMode\";case Q:return\"Suspense\";case oe:return\"SuspenseList\"}if(typeof v==\"object\")switch(v.$$typeof){case h:return\"Context.Consumer\";case $:return\"Context.Provider\";case ce:var m=v.render;return m=m.displayName||m.name||\"\",v.displayName||(m!==\"\"?\"ForwardRef(\"+m+\")\":\"ForwardRef\");case Se:return Oe(v.type);case me:if(v=v._status===1?v._result:null)return Oe(v)}return null}function Le(v){var m=v,S=v;if(v.alternate)for(;m.return;)m=m.return;else{v=m;do m=v,(m.effectTag&1026)!=0&&(S=m.return),v=m.return;while(v)}return m.tag===3?S:null}function ot(v){if(Le(v)!==v)throw Error(t(188))}function ct(v){var m=v.alternate;if(!m){if(m=Le(v),m===null)throw Error(t(188));return m!==v?null:v}for(var S=v,O=m;;){var M=S.return;if(M===null)break;var b=M.alternate;if(b===null){if(O=M.return,O!==null){S=O;continue}break}if(M.child===b.child){for(b=M.child;b;){if(b===S)return ot(M),v;if(b===O)return ot(M),m;b=b.sibling}throw Error(t(188))}if(S.return!==O.return)S=M,O=b;else{for(var ee=!1,Ye=M.child;Ye;){if(Ye===S){ee=!0,S=M,O=b;break}if(Ye===O){ee=!0,O=M,S=b;break}Ye=Ye.sibling}if(!ee){for(Ye=b.child;Ye;){if(Ye===S){ee=!0,S=b,O=M;break}if(Ye===O){ee=!0,O=b,S=M;break}Ye=Ye.sibling}if(!ee)throw Error(t(189))}}if(S.alternate!==O)throw Error(t(190))}if(S.tag!==3)throw Error(t(188));return S.stateNode.current===S?v:m}function Ue(v){if(v=ct(v),!v)return null;for(var m=v;;){if(m.tag===5||m.tag===6)return m;if(m.child)m.child.return=m,m=m.child;else{if(m===v)break;for(;!m.sibling;){if(!m.return||m.return===v)return null;m=m.return}m.sibling.return=m.return,m=m.sibling}}return null}function be(v){if(v=ct(v),!v)return null;for(var m=v;;){if(m.tag===5||m.tag===6)return m;if(m.child&&m.tag!==4)m.child.return=m,m=m.child;else{if(m===v)break;for(;!m.sibling;){if(!m.return||m.return===v)return null;m=m.return}m.sibling.return=m.return,m=m.sibling}}return null}var At=u.getPublicInstance,Ot=u.getRootHostContext,Nt=u.getChildHostContext,Je=u.prepareForCommit,V=u.resetAfterCommit,ne=u.createInstance,ge=u.appendInitialChild,Z=u.finalizeInitialChildren,Ae=u.prepareUpdate,at=u.shouldSetTextContent,it=u.shouldDeprioritizeSubtree,Ft=u.createTextInstance,jt=u.setTimeout,hn=u.clearTimeout,Un=u.noTimeout,Jt=u.isPrimaryRenderer,Yt=u.supportsMutation,cr=u.supportsPersistence,w=u.supportsHydration,pt=u.appendChild,Mn=u.appendChildToContainer,Bn=u.commitTextUpdate,Xn=u.commitMount,vr=u.commitUpdate,gr=u.insertBefore,r0=u.insertInContainerBefore,Ci=u.removeChild,yo=u.removeChildFromContainer,Ds=u.resetTextContent,Mu=u.hideInstance,Gf=u.hideTextInstance,iu=u.unhideInstance,ou=u.unhideTextInstance,ol=u.cloneInstance,ul=u.createContainerChildSet,Es=u.appendChildToContainerChildSet,Uo=u.finalizeContainerChildren,sl=u.replaceContainerChildren,Ss=u.cloneHiddenInstance,Cs=u.cloneHiddenTextInstance,Ti=u.canHydrateInstance,Fu=u.canHydrateTextInstance,ll=u.isSuspenseInstancePending,fl=u.isSuspenseInstanceFallback,cl=u.getNextHydratableSibling,al=u.getFirstHydratableChild,Ui=u.hydrateInstance,Mr=u.hydrateTextInstance,Ac=u.getNextHydratableInstanceAfterSuspenseInstance,of=u.commitHydratedContainer,Ts=u.commitHydratedSuspenseInstance,xs=/^(.*)[\\\\\\/]/;function dl(v){var m=\"\";do{e:switch(v.tag){case 3:case 4:case 6:case 7:case 10:case 9:var S=\"\";break e;default:var O=v._debugOwner,M=v._debugSource,b=Oe(v.type);S=null,O&&(S=Oe(O.type)),O=b,b=\"\",M?b=\" (at \"+M.fileName.replace(xs,\"\")+\":\"+M.lineNumber+\")\":S&&(b=\" (created by \"+S+\")\"),S=`\n    in `+(O||\"Unknown\")+b}m+=S,v=v.return}while(v);return m}new Set;var qi=[],qo=-1;function kr(v){0>qo||(v.current=qi[qo],qi[qo]=null,qo--)}function Fr(v,m){qo++,qi[qo]=v.current,v.current=m}var si={},H0={current:si},b0={current:!1},Bt=si;function Lu(v,m){var S=v.type.contextTypes;if(!S)return si;var O=v.stateNode;if(O&&O.__reactInternalMemoizedUnmaskedChildContext===m)return O.__reactInternalMemoizedMaskedChildContext;var M={},b;for(b in S)M[b]=m[b];return O&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=m,v.__reactInternalMemoizedMaskedChildContext=M),M}function c0(v){return v=v.childContextTypes,v!=null}function Ru(v){kr(b0,v),kr(H0,v)}function ks(v){kr(b0,v),kr(H0,v)}function As(v,m,S){if(H0.current!==si)throw Error(t(168));Fr(H0,m,v),Fr(b0,S,v)}function uu(v,m,S){var O=v.stateNode;if(v=m.childContextTypes,typeof O.getChildContext!=\"function\")return S;O=O.getChildContext();for(var M in O)if(!(M in v))throw Error(t(108,Oe(m)||\"Unknown\",M));return f({},S,{},O)}function wo(v){var m=v.stateNode;return m=m&&m.__reactInternalMemoizedMergedChildContext||si,Bt=H0.current,Fr(H0,m,v),Fr(b0,b0.current,v),!0}function zo(v,m,S){var O=v.stateNode;if(!O)throw Error(t(169));S?(m=uu(v,m,Bt),O.__reactInternalMemoizedMergedChildContext=m,kr(b0,v),kr(H0,v),Fr(H0,m,v)):kr(b0,v),Fr(b0,S,v)}var Os=g.unstable_runWithPriority,Is=g.unstable_scheduleCallback,uf=g.unstable_cancelCallback,_n=g.unstable_shouldYield,Nu=g.unstable_requestPaint,Wo=g.unstable_now,su=g.unstable_getCurrentPriorityLevel,Ps=g.unstable_ImmediatePriority,pl=g.unstable_UserBlockingPriority,Vf=g.unstable_NormalPriority,hl=g.unstable_LowPriority,Bu=g.unstable_IdlePriority,ju={},sf=Nu!==void 0?Nu:function(){},ro=null,Ms=null,ml=!1,Uu=Wo(),G0=1e4>Uu?Wo:function(){return Wo()-Uu};function Fs(){switch(su()){case Ps:return 99;case pl:return 98;case Vf:return 97;case hl:return 96;case Bu:return 95;default:throw Error(t(332))}}function tt(v){switch(v){case 99:return Ps;case 98:return pl;case 97:return Vf;case 96:return hl;case 95:return Bu;default:throw Error(t(332))}}function zi(v,m){return v=tt(v),Os(v,m)}function lu(v,m,S){return v=tt(v),Is(v,m,S)}function Ho(v){return ro===null?(ro=[v],Ms=Is(Ps,vl)):ro.push(v),ju}function O0(){if(Ms!==null){var v=Ms;Ms=null,uf(v)}vl()}function vl(){if(!ml&&ro!==null){ml=!0;var v=0;try{var m=ro;zi(99,function(){for(;v<m.length;v++){var S=m[v];do S=S(!0);while(S!==null)}}),ro=null}catch(S){throw ro!==null&&(ro=ro.slice(v+1)),Is(Ps,O0),S}finally{ml=!1}}}var gl=3;function fu(v,m,S){return S/=10,1073741821-(((1073741821-v+m/10)/S|0)+1)*S}function _l(v,m){return v===m&&(v!==0||1/v==1/m)||v!==v&&m!==m}var Sn=typeof Object.is==\"function\"?Object.is:_l,gt=Object.prototype.hasOwnProperty;function en(v,m){if(Sn(v,m))return!0;if(typeof v!=\"object\"||v===null||typeof m!=\"object\"||m===null)return!1;var S=Object.keys(v),O=Object.keys(m);if(S.length!==O.length)return!1;for(O=0;O<S.length;O++)if(!gt.call(m,S[O])||!Sn(v[S[O]],m[S[O]]))return!1;return!0}function I0(v,m){if(v&&v.defaultProps){m=f({},m),v=v.defaultProps;for(var S in v)m[S]===void 0&&(m[S]=v[S])}return m}var li={current:null},qu=null,Wi=null,zu=null;function Wu(){zu=Wi=qu=null}function Ls(v,m){var S=v.type._context;Jt?(Fr(li,S._currentValue,v),S._currentValue=m):(Fr(li,S._currentValue2,v),S._currentValue2=m)}function fi(v){var m=li.current;kr(li,v),v=v.type._context,Jt?v._currentValue=m:v._currentValue2=m}function e0(v,m){for(;v!==null;){var S=v.alternate;if(v.childExpirationTime<m)v.childExpirationTime=m,S!==null&&S.childExpirationTime<m&&(S.childExpirationTime=m);else if(S!==null&&S.childExpirationTime<m)S.childExpirationTime=m;else break;v=v.return}}function io(v,m){qu=v,zu=Wi=null,v=v.dependencies,v!==null&&v.firstContext!==null&&(v.expirationTime>=m&&(ai=!0),v.firstContext=null)}function D0(v,m){if(zu!==v&&m!==!1&&m!==0)if((typeof m!=\"number\"||m===1073741823)&&(zu=v,m=1073741823),m={context:v,observedBits:m,next:null},Wi===null){if(qu===null)throw Error(t(308));Wi=m,qu.dependencies={expirationTime:0,firstContext:m,responders:null}}else Wi=Wi.next=m;return Jt?v._currentValue:v._currentValue2}var Do=!1;function i0(v){return{baseState:v,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Rs(v){return{baseState:v.baseState,firstUpdate:v.firstUpdate,lastUpdate:v.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function a0(v,m){return{expirationTime:v,suspenseConfig:m,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function Hu(v,m){v.lastUpdate===null?v.firstUpdate=v.lastUpdate=m:(v.lastUpdate.next=m,v.lastUpdate=m)}function V0(v,m){var S=v.alternate;if(S===null){var O=v.updateQueue,M=null;O===null&&(O=v.updateQueue=i0(v.memoizedState))}else O=v.updateQueue,M=S.updateQueue,O===null?M===null?(O=v.updateQueue=i0(v.memoizedState),M=S.updateQueue=i0(S.memoizedState)):O=v.updateQueue=Rs(M):M===null&&(M=S.updateQueue=Rs(O));M===null||O===M?Hu(O,m):O.lastUpdate===null||M.lastUpdate===null?(Hu(O,m),Hu(M,m)):(Hu(O,m),M.lastUpdate=m)}function bu(v,m){var S=v.updateQueue;S=S===null?v.updateQueue=i0(v.memoizedState):Ns(v,S),S.lastCapturedUpdate===null?S.firstCapturedUpdate=S.lastCapturedUpdate=m:(S.lastCapturedUpdate.next=m,S.lastCapturedUpdate=m)}function Ns(v,m){var S=v.alternate;return S!==null&&m===S.updateQueue&&(m=v.updateQueue=Rs(m)),m}function bo(v,m,S,O,M,b){switch(S.tag){case 1:return v=S.payload,typeof v==\"function\"?v.call(b,O,M):v;case 3:v.effectTag=v.effectTag&-4097|64;case 0:if(v=S.payload,M=typeof v==\"function\"?v.call(b,O,M):v,M==null)break;return f({},O,M);case 2:Do=!0}return O}function P0(v,m,S,O,M){Do=!1,m=Ns(v,m);for(var b=m.baseState,ee=null,Ye=0,Ze=m.firstUpdate,ut=b;Ze!==null;){var In=Ze.expirationTime;In<M?(ee===null&&(ee=Ze,b=ut),Ye<In&&(Ye=In)):(Yf(In,Ze.suspenseConfig),ut=bo(v,m,Ze,ut,S,O),Ze.callback!==null&&(v.effectTag|=32,Ze.nextEffect=null,m.lastEffect===null?m.firstEffect=m.lastEffect=Ze:(m.lastEffect.nextEffect=Ze,m.lastEffect=Ze))),Ze=Ze.next}for(In=null,Ze=m.firstCapturedUpdate;Ze!==null;){var A0=Ze.expirationTime;A0<M?(In===null&&(In=Ze,ee===null&&(b=ut)),Ye<A0&&(Ye=A0)):(ut=bo(v,m,Ze,ut,S,O),Ze.callback!==null&&(v.effectTag|=32,Ze.nextEffect=null,m.lastCapturedEffect===null?m.firstCapturedEffect=m.lastCapturedEffect=Ze:(m.lastCapturedEffect.nextEffect=Ze,m.lastCapturedEffect=Ze))),Ze=Ze.next}ee===null&&(m.lastUpdate=null),In===null?m.lastCapturedUpdate=null:v.effectTag|=32,ee===null&&In===null&&(b=ut),m.baseState=b,m.firstUpdate=ee,m.firstCapturedUpdate=In,pf(Ye),v.expirationTime=Ye,v.memoizedState=ut}function ln(v,m,S){m.firstCapturedUpdate!==null&&(m.lastUpdate!==null&&(m.lastUpdate.next=m.firstCapturedUpdate,m.lastUpdate=m.lastCapturedUpdate),m.firstCapturedUpdate=m.lastCapturedUpdate=null),lf(m.firstEffect,S),m.firstEffect=m.lastEffect=null,lf(m.firstCapturedEffect,S),m.firstCapturedEffect=m.lastCapturedEffect=null}function lf(v,m){for(;v!==null;){var S=v.callback;if(S!==null){v.callback=null;var O=m;if(typeof S!=\"function\")throw Error(t(191,S));S.call(O)}v=v.nextEffect}}var nr=C.ReactCurrentBatchConfig,rr=new c.Component().refs;function Go(v,m,S,O){m=v.memoizedState,S=S(O,m),S=S==null?m:f({},m,S),v.memoizedState=S,O=v.updateQueue,O!==null&&v.expirationTime===0&&(O.baseState=S)}var Gu={isMounted:function(v){return(v=v._reactInternalFiber)?Le(v)===v:!1},enqueueSetState:function(v,m,S){v=v._reactInternalFiber;var O=g0(),M=nr.suspense;O=Kr(O,v,M),M=a0(O,M),M.payload=m,S!=null&&(M.callback=S),V0(v,M),_0(v,O)},enqueueReplaceState:function(v,m,S){v=v._reactInternalFiber;var O=g0(),M=nr.suspense;O=Kr(O,v,M),M=a0(O,M),M.tag=1,M.payload=m,S!=null&&(M.callback=S),V0(v,M),_0(v,O)},enqueueForceUpdate:function(v,m){v=v._reactInternalFiber;var S=g0(),O=nr.suspense;S=Kr(S,v,O),O=a0(S,O),O.tag=2,m!=null&&(O.callback=m),V0(v,O),_0(v,S)}};function yl(v,m,S,O,M,b,ee){return v=v.stateNode,typeof v.shouldComponentUpdate==\"function\"?v.shouldComponentUpdate(O,b,ee):m.prototype&&m.prototype.isPureReactComponent?!en(S,O)||!en(M,b):!0}function cu(v,m,S){var O=!1,M=si,b=m.contextType;return typeof b==\"object\"&&b!==null?b=D0(b):(M=c0(m)?Bt:H0.current,O=m.contextTypes,b=(O=O!=null)?Lu(v,M):si),m=new m(S,b),v.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Gu,v.stateNode=m,m._reactInternalFiber=v,O&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=M,v.__reactInternalMemoizedMaskedChildContext=b),m}function Bs(v,m,S,O){v=m.state,typeof m.componentWillReceiveProps==\"function\"&&m.componentWillReceiveProps(S,O),typeof m.UNSAFE_componentWillReceiveProps==\"function\"&&m.UNSAFE_componentWillReceiveProps(S,O),m.state!==v&&Gu.enqueueReplaceState(m,m.state,null)}function Vu(v,m,S,O){var M=v.stateNode;M.props=S,M.state=v.memoizedState,M.refs=rr;var b=m.contextType;typeof b==\"object\"&&b!==null?M.context=D0(b):(b=c0(m)?Bt:H0.current,M.context=Lu(v,b)),b=v.updateQueue,b!==null&&(P0(v,b,S,M,O),M.state=v.memoizedState),b=m.getDerivedStateFromProps,typeof b==\"function\"&&(Go(v,m,b,S),M.state=v.memoizedState),typeof m.getDerivedStateFromProps==\"function\"||typeof M.getSnapshotBeforeUpdate==\"function\"||typeof M.UNSAFE_componentWillMount!=\"function\"&&typeof M.componentWillMount!=\"function\"||(m=M.state,typeof M.componentWillMount==\"function\"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount==\"function\"&&M.UNSAFE_componentWillMount(),m!==M.state&&Gu.enqueueReplaceState(M,M.state,null),b=v.updateQueue,b!==null&&(P0(v,b,S,M,O),M.state=v.memoizedState)),typeof M.componentDidMount==\"function\"&&(v.effectTag|=4)}var M0=Array.isArray;function au(v,m,S){if(v=S.ref,v!==null&&typeof v!=\"function\"&&typeof v!=\"object\"){if(S._owner){if(S=S._owner,S){if(S.tag!==1)throw Error(t(309));var O=S.stateNode}if(!O)throw Error(t(147,v));var M=\"\"+v;return m!==null&&m.ref!==null&&typeof m.ref==\"function\"&&m.ref._stringRef===M?m.ref:(m=function(b){var ee=O.refs;ee===rr&&(ee=O.refs={}),b===null?delete ee[M]:ee[M]=b},m._stringRef=M,m)}if(typeof v!=\"string\")throw Error(t(284));if(!S._owner)throw Error(t(290,v))}return v}function Lr(v,m){if(v.type!==\"textarea\")throw Error(t(31,Object.prototype.toString.call(m)===\"[object Object]\"?\"object with keys {\"+Object.keys(m).join(\", \")+\"}\":m,\"\"))}function F(v){function m(Re,Ce){if(v){var ze=Re.lastEffect;ze!==null?(ze.nextEffect=Ce,Re.lastEffect=Ce):Re.firstEffect=Re.lastEffect=Ce,Ce.nextEffect=null,Ce.effectTag=8}}function S(Re,Ce){if(!v)return null;for(;Ce!==null;)m(Re,Ce),Ce=Ce.sibling;return null}function O(Re,Ce){for(Re=new Map;Ce!==null;)Ce.key!==null?Re.set(Ce.key,Ce):Re.set(Ce.index,Ce),Ce=Ce.sibling;return Re}function M(Re,Ce,ze){return Re=ti(Re,Ce,ze),Re.index=0,Re.sibling=null,Re}function b(Re,Ce,ze){return Re.index=ze,v?(ze=Re.alternate,ze!==null?(ze=ze.index,ze<Ce?(Re.effectTag=2,Ce):ze):(Re.effectTag=2,Ce)):Ce}function ee(Re){return v&&Re.alternate===null&&(Re.effectTag=2),Re}function Ye(Re,Ce,ze,Et){return Ce===null||Ce.tag!==6?(Ce=vi(ze,Re.mode,Et),Ce.return=Re,Ce):(Ce=M(Ce,ze,Et),Ce.return=Re,Ce)}function Ze(Re,Ce,ze,Et){return Ce!==null&&Ce.elementType===ze.type?(Et=M(Ce,ze.props,Et),Et.ref=au(Re,Ce,ze),Et.return=Re,Et):(Et=Hs(ze.type,ze.key,ze.props,null,Re.mode,Et),Et.ref=au(Re,Ce,ze),Et.return=Re,Et)}function ut(Re,Ce,ze,Et){return Ce===null||Ce.tag!==4||Ce.stateNode.containerInfo!==ze.containerInfo||Ce.stateNode.implementation!==ze.implementation?(Ce=Xf(ze,Re.mode,Et),Ce.return=Re,Ce):(Ce=M(Ce,ze.children||[],Et),Ce.return=Re,Ce)}function In(Re,Ce,ze,Et,on){return Ce===null||Ce.tag!==7?(Ce=mi(ze,Re.mode,Et,on),Ce.return=Re,Ce):(Ce=M(Ce,ze,Et),Ce.return=Re,Ce)}function A0(Re,Ce,ze){if(typeof Ce==\"string\"||typeof Ce==\"number\")return Ce=vi(\"\"+Ce,Re.mode,ze),Ce.return=Re,Ce;if(typeof Ce==\"object\"&&Ce!==null){switch(Ce.$$typeof){case x:return ze=Hs(Ce.type,Ce.key,Ce.props,null,Re.mode,ze),ze.ref=au(Re,null,Ce),ze.return=Re,ze;case D:return Ce=Xf(Ce,Re.mode,ze),Ce.return=Re,Ce}if(M0(Ce)||J(Ce))return Ce=mi(Ce,Re.mode,ze,null),Ce.return=Re,Ce;Lr(Re,Ce)}return null}function jr(Re,Ce,ze,Et){var on=Ce!==null?Ce.key:null;if(typeof ze==\"string\"||typeof ze==\"number\")return on!==null?null:Ye(Re,Ce,\"\"+ze,Et);if(typeof ze==\"object\"&&ze!==null){switch(ze.$$typeof){case x:return ze.key===on?ze.type===L?In(Re,Ce,ze.props.children,Et,on):Ze(Re,Ce,ze,Et):null;case D:return ze.key===on?ut(Re,Ce,ze,Et):null}if(M0(ze)||J(ze))return on!==null?null:In(Re,Ce,ze,Et,null);Lr(Re,ze)}return null}function gi(Re,Ce,ze,Et,on){if(typeof Et==\"string\"||typeof Et==\"number\")return Re=Re.get(ze)||null,Ye(Ce,Re,\"\"+Et,on);if(typeof Et==\"object\"&&Et!==null){switch(Et.$$typeof){case x:return Re=Re.get(Et.key===null?ze:Et.key)||null,Et.type===L?In(Ce,Re,Et.props.children,on,Et.key):Ze(Ce,Re,Et,on);case D:return Re=Re.get(Et.key===null?ze:Et.key)||null,ut(Ce,Re,Et,on)}if(M0(Et)||J(Et))return Re=Re.get(ze)||null,In(Ce,Re,Et,on,null);Lr(Ce,Et)}return null}function po(Re,Ce,ze,Et){for(var on=null,sr=null,mn=Ce,pr=Ce=0,Hr=null;mn!==null&&pr<ze.length;pr++){mn.index>pr?(Hr=mn,mn=null):Hr=mn.sibling;var Vn=jr(Re,mn,ze[pr],Et);if(Vn===null){mn===null&&(mn=Hr);break}v&&mn&&Vn.alternate===null&&m(Re,mn),Ce=b(Vn,Ce,pr),sr===null?on=Vn:sr.sibling=Vn,sr=Vn,mn=Hr}if(pr===ze.length)return S(Re,mn),on;if(mn===null){for(;pr<ze.length;pr++)mn=A0(Re,ze[pr],Et),mn!==null&&(Ce=b(mn,Ce,pr),sr===null?on=mn:sr.sibling=mn,sr=mn);return on}for(mn=O(Re,mn);pr<ze.length;pr++)Hr=gi(mn,Re,pr,ze[pr],Et),Hr!==null&&(v&&Hr.alternate!==null&&mn.delete(Hr.key===null?pr:Hr.key),Ce=b(Hr,Ce,pr),sr===null?on=Hr:sr.sibling=Hr,sr=Hr);return v&&mn.forEach(function(ni){return m(Re,ni)}),on}function _i(Re,Ce,ze,Et){var on=J(ze);if(typeof on!=\"function\")throw Error(t(150));if(ze=on.call(ze),ze==null)throw Error(t(151));for(var sr=on=null,mn=Ce,pr=Ce=0,Hr=null,Vn=ze.next();mn!==null&&!Vn.done;pr++,Vn=ze.next()){mn.index>pr?(Hr=mn,mn=null):Hr=mn.sibling;var ni=jr(Re,mn,Vn.value,Et);if(ni===null){mn===null&&(mn=Hr);break}v&&mn&&ni.alternate===null&&m(Re,mn),Ce=b(ni,Ce,pr),sr===null?on=ni:sr.sibling=ni,sr=ni,mn=Hr}if(Vn.done)return S(Re,mn),on;if(mn===null){for(;!Vn.done;pr++,Vn=ze.next())Vn=A0(Re,Vn.value,Et),Vn!==null&&(Ce=b(Vn,Ce,pr),sr===null?on=Vn:sr.sibling=Vn,sr=Vn);return on}for(mn=O(Re,mn);!Vn.done;pr++,Vn=ze.next())Vn=gi(mn,Re,pr,Vn.value,Et),Vn!==null&&(v&&Vn.alternate!==null&&mn.delete(Vn.key===null?pr:Vn.key),Ce=b(Vn,Ce,pr),sr===null?on=Vn:sr.sibling=Vn,sr=Vn);return v&&mn.forEach(function(Zf){return m(Re,Zf)}),on}return function(Re,Ce,ze,Et){var on=typeof ze==\"object\"&&ze!==null&&ze.type===L&&ze.key===null;on&&(ze=ze.props.children);var sr=typeof ze==\"object\"&&ze!==null;if(sr)switch(ze.$$typeof){case x:e:{for(sr=ze.key,on=Ce;on!==null;){if(on.key===sr)if(on.tag===7?ze.type===L:on.elementType===ze.type){S(Re,on.sibling),Ce=M(on,ze.type===L?ze.props.children:ze.props,Et),Ce.ref=au(Re,on,ze),Ce.return=Re,Re=Ce;break e}else{S(Re,on);break}else m(Re,on);on=on.sibling}ze.type===L?(Ce=mi(ze.props.children,Re.mode,Et,ze.key),Ce.return=Re,Re=Ce):(Et=Hs(ze.type,ze.key,ze.props,null,Re.mode,Et),Et.ref=au(Re,Ce,ze),Et.return=Re,Re=Et)}return ee(Re);case D:e:{for(on=ze.key;Ce!==null;){if(Ce.key===on)if(Ce.tag===4&&Ce.stateNode.containerInfo===ze.containerInfo&&Ce.stateNode.implementation===ze.implementation){S(Re,Ce.sibling),Ce=M(Ce,ze.children||[],Et),Ce.return=Re,Re=Ce;break e}else{S(Re,Ce);break}else m(Re,Ce);Ce=Ce.sibling}Ce=Xf(ze,Re.mode,Et),Ce.return=Re,Re=Ce}return ee(Re)}if(typeof ze==\"string\"||typeof ze==\"number\")return ze=\"\"+ze,Ce!==null&&Ce.tag===6?(S(Re,Ce.sibling),Ce=M(Ce,ze,Et),Ce.return=Re,Re=Ce):(S(Re,Ce),Ce=vi(ze,Re.mode,Et),Ce.return=Re,Re=Ce),ee(Re);if(M0(ze))return po(Re,Ce,ze,Et);if(J(ze))return _i(Re,Ce,ze,Et);if(sr&&Lr(Re,ze),typeof ze==\"undefined\"&&!on)switch(Re.tag){case 1:case 0:throw Re=Re.type,Error(t(152,Re.displayName||Re.name||\"Component\"))}return S(Re,Ce)}}var R=F(!0),U=F(!1),H={},fe={current:H},ue={current:H},de={current:H};function W(v){if(v===H)throw Error(t(174));return v}function ve(v,m){Fr(de,m,v),Fr(ue,v,v),Fr(fe,H,v),m=Ot(m),kr(fe,v),Fr(fe,m,v)}function Fe(v){kr(fe,v),kr(ue,v),kr(de,v)}function Ge(v){var m=W(de.current),S=W(fe.current);m=Nt(S,v.type,m),S!==m&&(Fr(ue,v,v),Fr(fe,m,v))}function K(v){ue.current===v&&(kr(fe,v),kr(ue,v))}var xe={current:0};function je(v){for(var m=v;m!==null;){if(m.tag===13){var S=m.memoizedState;if(S!==null&&(S=S.dehydrated,S===null||ll(S)||fl(S)))return m}else if(m.tag===19&&m.memoizedProps.revealOrder!==void 0){if((m.effectTag&64)!=0)return m}else if(m.child!==null){m.child.return=m,m=m.child;continue}if(m===v)break;for(;m.sibling===null;){if(m.return===null||m.return===v)return null;m=m.return}m.sibling.return=m.return,m=m.sibling}return null}function Xe(v,m){return{responder:v,props:m}}var rt=C.ReactCurrentDispatcher,st=C.ReactCurrentBatchConfig,xt=0,wt=null,lt=null,Rt=null,yn=null,sn=null,ar=null,rn=0,Hn=null,d0=0,Cr=!1,He=null,Qe=0;function Ne(){throw Error(t(321))}function ft(v,m){if(m===null)return!1;for(var S=0;S<m.length&&S<v.length;S++)if(!Sn(v[S],m[S]))return!1;return!0}function St(v,m,S,O,M,b){if(xt=b,wt=m,Rt=v!==null?v.memoizedState:null,rt.current=Rt===null?Hi:qs,m=S(O,M),Cr){do Cr=!1,Qe+=1,Rt=v!==null?v.memoizedState:null,ar=yn,Hn=sn=lt=null,rt.current=qs,m=S(O,M);while(Cr);He=null,Qe=0}if(rt.current=oo,v=wt,v.memoizedState=yn,v.expirationTime=rn,v.updateQueue=Hn,v.effectTag|=d0,v=lt!==null&&lt.next!==null,xt=0,ar=sn=yn=Rt=lt=wt=null,rn=0,Hn=null,d0=0,v)throw Error(t(300));return m}function Qt(){rt.current=oo,xt=0,ar=sn=yn=Rt=lt=wt=null,rn=0,Hn=null,d0=0,Cr=!1,He=null,Qe=0}function Cn(){var v={memoizedState:null,baseState:null,queue:null,baseUpdate:null,next:null};return sn===null?yn=sn=v:sn=sn.next=v,sn}function bn(){if(ar!==null)sn=ar,ar=sn.next,lt=Rt,Rt=lt!==null?lt.next:null;else{if(Rt===null)throw Error(t(310));lt=Rt;var v={memoizedState:lt.memoizedState,baseState:lt.baseState,queue:lt.queue,baseUpdate:lt.baseUpdate,next:null};sn=sn===null?yn=v:sn.next=v,Rt=lt.next}return sn}function p0(v,m){return typeof m==\"function\"?m(v):m}function h0(v){var m=bn(),S=m.queue;if(S===null)throw Error(t(311));if(S.lastRenderedReducer=v,0<Qe){var O=S.dispatch;if(He!==null){var M=He.get(S);if(M!==void 0){He.delete(S);var b=m.memoizedState;do b=v(b,M.action),M=M.next;while(M!==null);return Sn(b,m.memoizedState)||(ai=!0),m.memoizedState=b,m.baseUpdate===S.last&&(m.baseState=b),S.lastRenderedState=b,[b,O]}}return[m.memoizedState,O]}O=S.last;var ee=m.baseUpdate;if(b=m.baseState,ee!==null?(O!==null&&(O.next=null),O=ee.next):O=O!==null?O.next:null,O!==null){var Ye=M=null,Ze=O,ut=!1;do{var In=Ze.expirationTime;In<xt?(ut||(ut=!0,Ye=ee,M=b),In>rn&&(rn=In,pf(rn))):(Yf(In,Ze.suspenseConfig),b=Ze.eagerReducer===v?Ze.eagerState:v(b,Ze.action)),ee=Ze,Ze=Ze.next}while(Ze!==null&&Ze!==O);ut||(Ye=ee,M=b),Sn(b,m.memoizedState)||(ai=!0),m.memoizedState=b,m.baseUpdate=Ye,m.baseState=M,S.lastRenderedState=b}return[m.memoizedState,S.dispatch]}function ci(v){var m=Cn();return typeof v==\"function\"&&(v=v()),m.memoizedState=m.baseState=v,v=m.queue={last:null,dispatch:null,lastRenderedReducer:p0,lastRenderedState:v},v=v.dispatch=Us.bind(null,wt,v),[m.memoizedState,v]}function xi(v){return h0(p0,v)}function E0(v,m,S,O){return v={tag:v,create:m,destroy:S,deps:O,next:null},Hn===null?(Hn={lastEffect:null},Hn.lastEffect=v.next=v):(m=Hn.lastEffect,m===null?Hn.lastEffect=v.next=v:(S=m.next,m.next=v,v.next=S,Hn.lastEffect=v)),v}function qr(v,m,S,O){var M=Cn();d0|=v,M.memoizedState=E0(m,S,void 0,O===void 0?null:O)}function Eo(v,m,S,O){var M=bn();O=O===void 0?null:O;var b=void 0;if(lt!==null){var ee=lt.memoizedState;if(b=ee.destroy,O!==null&&ft(O,ee.deps)){E0(0,S,b,O);return}}d0|=v,M.memoizedState=E0(m,S,b,O)}function So(v,m){return qr(516,192,v,m)}function wl(v,m){return Eo(516,192,v,m)}function js(v,m){if(typeof m==\"function\")return v=v(),m(v),function(){m(null)};if(m!=null)return v=v(),m.current=v,function(){m.current=null}}function Dl(){}function du(v,m){return Cn().memoizedState=[v,m===void 0?null:m],v}function Yu(v,m){var S=bn();m=m===void 0?null:m;var O=S.memoizedState;return O!==null&&m!==null&&ft(m,O[1])?O[0]:(S.memoizedState=[v,m],v)}function Us(v,m,S){if(!(25>Qe))throw Error(t(301));var O=v.alternate;if(v===wt||O!==null&&O===wt)if(Cr=!0,v={expirationTime:xt,suspenseConfig:null,action:S,eagerReducer:null,eagerState:null,next:null},He===null&&(He=new Map),S=He.get(m),S===void 0)He.set(m,v);else{for(m=S;m.next!==null;)m=m.next;m.next=v}else{var M=g0(),b=nr.suspense;M=Kr(M,v,b),b={expirationTime:M,suspenseConfig:b,action:S,eagerReducer:null,eagerState:null,next:null};var ee=m.last;if(ee===null)b.next=b;else{var Ye=ee.next;Ye!==null&&(b.next=Ye),ee.next=b}if(m.last=b,v.expirationTime===0&&(O===null||O.expirationTime===0)&&(O=m.lastRenderedReducer,O!==null))try{var Ze=m.lastRenderedState,ut=O(Ze,S);if(b.eagerReducer=O,b.eagerState=ut,Sn(ut,Ze))return}catch(In){}finally{}_0(v,M)}}var oo={readContext:D0,useCallback:Ne,useContext:Ne,useEffect:Ne,useImperativeHandle:Ne,useLayoutEffect:Ne,useMemo:Ne,useReducer:Ne,useRef:Ne,useState:Ne,useDebugValue:Ne,useResponder:Ne,useDeferredValue:Ne,useTransition:Ne},Hi={readContext:D0,useCallback:du,useContext:D0,useEffect:So,useImperativeHandle:function(v,m,S){return S=S!=null?S.concat([v]):null,qr(4,36,js.bind(null,m,v),S)},useLayoutEffect:function(v,m){return qr(4,36,v,m)},useMemo:function(v,m){var S=Cn();return m=m===void 0?null:m,v=v(),S.memoizedState=[v,m],v},useReducer:function(v,m,S){var O=Cn();return m=S!==void 0?S(m):m,O.memoizedState=O.baseState=m,v=O.queue={last:null,dispatch:null,lastRenderedReducer:v,lastRenderedState:m},v=v.dispatch=Us.bind(null,wt,v),[O.memoizedState,v]},useRef:function(v){var m=Cn();return v={current:v},m.memoizedState=v},useState:ci,useDebugValue:Dl,useResponder:Xe,useDeferredValue:function(v,m){var S=ci(v),O=S[0],M=S[1];return So(function(){g.unstable_next(function(){var b=st.suspense;st.suspense=m===void 0?null:m;try{M(v)}finally{st.suspense=b}})},[v,m]),O},useTransition:function(v){var m=ci(!1),S=m[0],O=m[1];return[du(function(M){O(!0),g.unstable_next(function(){var b=st.suspense;st.suspense=v===void 0?null:v;try{O(!1),M()}finally{st.suspense=b}})},[v,S]),S]}},qs={readContext:D0,useCallback:Yu,useContext:D0,useEffect:wl,useImperativeHandle:function(v,m,S){return S=S!=null?S.concat([v]):null,Eo(4,36,js.bind(null,m,v),S)},useLayoutEffect:function(v,m){return Eo(4,36,v,m)},useMemo:function(v,m){var S=bn();m=m===void 0?null:m;var O=S.memoizedState;return O!==null&&m!==null&&ft(m,O[1])?O[0]:(v=v(),S.memoizedState=[v,m],v)},useReducer:h0,useRef:function(){return bn().memoizedState},useState:xi,useDebugValue:Dl,useResponder:Xe,useDeferredValue:function(v,m){var S=xi(v),O=S[0],M=S[1];return wl(function(){g.unstable_next(function(){var b=st.suspense;st.suspense=m===void 0?null:m;try{M(v)}finally{st.suspense=b}})},[v,m]),O},useTransition:function(v){var m=xi(!1),S=m[0],O=m[1];return[Yu(function(M){O(!0),g.unstable_next(function(){var b=st.suspense;st.suspense=v===void 0?null:v;try{O(!1),M()}finally{st.suspense=b}})},[v,S]),S]}},F0=null,Gr=null,ir=!1;function L0(v,m){var S=xo(5,null,null,0);S.elementType=\"DELETED\",S.type=\"DELETED\",S.stateNode=m,S.return=v,S.effectTag=8,v.lastEffect!==null?(v.lastEffect.nextEffect=S,v.lastEffect=S):v.firstEffect=v.lastEffect=S}function Y0(v,m){switch(v.tag){case 5:return m=Ti(m,v.type,v.pendingProps),m!==null?(v.stateNode=m,!0):!1;case 6:return m=Fu(m,v.pendingProps),m!==null?(v.stateNode=m,!0):!1;case 13:return!1;default:return!1}}function Co(v){if(ir){var m=Gr;if(m){var S=m;if(!Y0(v,m)){if(m=cl(S),!m||!Y0(v,m)){v.effectTag=v.effectTag&-1025|2,ir=!1,F0=v;return}L0(F0,S)}F0=v,Gr=al(m)}else v.effectTag=v.effectTag&-1025|2,ir=!1,F0=v}}function $u(v){for(v=v.return;v!==null&&v.tag!==5&&v.tag!==3&&v.tag!==13;)v=v.return;F0=v}function Vo(v){if(!w||v!==F0)return!1;if(!ir)return $u(v),ir=!0,!1;var m=v.type;if(v.tag!==5||m!==\"head\"&&m!==\"body\"&&!at(m,v.memoizedProps))for(m=Gr;m;)L0(v,m),m=cl(m);if($u(v),v.tag===13){if(!w)throw Error(t(316));if(v=v.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(t(317));Gr=Ac(v)}else Gr=F0?cl(v.stateNode):null;return!0}function Rr(){w&&(Gr=F0=null,ir=!1)}var Jn=C.ReactCurrentOwner,ai=!1;function o0(v,m,S,O){m.child=v===null?U(m,null,S,O):R(m,v.child,S,O)}function Vr(v,m,S,O,M){S=S.render;var b=m.ref;return io(m,M),O=St(v,m,S,O,b,M),v!==null&&!ai?(m.updateQueue=v.updateQueue,m.effectTag&=-517,v.expirationTime<=M&&(v.expirationTime=0),X0(v,m,M)):(m.effectTag|=1,o0(v,m,O,M),m.child)}function ff(v,m,S,O,M,b){if(v===null){var ee=S.type;return typeof ee==\"function\"&&!mf(ee)&&ee.defaultProps===void 0&&S.compare===null&&S.defaultProps===void 0?(m.tag=15,m.type=ee,cf(v,m,ee,O,M,b)):(v=Hs(S.type,null,O,null,m.mode,b),v.ref=m.ref,v.return=m,m.child=v)}return ee=v.child,M<b&&(M=ee.memoizedProps,S=S.compare,S=S!==null?S:en,S(M,O)&&v.ref===m.ref)?X0(v,m,b):(m.effectTag|=1,v=ti(ee,O,b),v.ref=m.ref,v.return=m,m.child=v)}function cf(v,m,S,O,M,b){return v!==null&&en(v.memoizedProps,O)&&v.ref===m.ref&&(ai=!1,M<b)?X0(v,m,b):K0(v,m,S,O,b)}function $0(v,m){var S=m.ref;(v===null&&S!==null||v!==null&&v.ref!==S)&&(m.effectTag|=128)}function K0(v,m,S,O,M){var b=c0(S)?Bt:H0.current;return b=Lu(m,b),io(m,M),S=St(v,m,S,O,b,M),v!==null&&!ai?(m.updateQueue=v.updateQueue,m.effectTag&=-517,v.expirationTime<=M&&(v.expirationTime=0),X0(v,m,M)):(m.effectTag|=1,o0(v,m,S,M),m.child)}function ae(v,m,S,O,M){if(c0(S)){var b=!0;wo(m)}else b=!1;if(io(m,M),m.stateNode===null)v!==null&&(v.alternate=null,m.alternate=null,m.effectTag|=2),cu(m,S,O,M),Vu(m,S,O,M),O=!0;else if(v===null){var ee=m.stateNode,Ye=m.memoizedProps;ee.props=Ye;var Ze=ee.context,ut=S.contextType;typeof ut==\"object\"&&ut!==null?ut=D0(ut):(ut=c0(S)?Bt:H0.current,ut=Lu(m,ut));var In=S.getDerivedStateFromProps,A0=typeof In==\"function\"||typeof ee.getSnapshotBeforeUpdate==\"function\";A0||typeof ee.UNSAFE_componentWillReceiveProps!=\"function\"&&typeof ee.componentWillReceiveProps!=\"function\"||(Ye!==O||Ze!==ut)&&Bs(m,ee,O,ut),Do=!1;var jr=m.memoizedState;Ze=ee.state=jr;var gi=m.updateQueue;gi!==null&&(P0(m,gi,O,ee,M),Ze=m.memoizedState),Ye!==O||jr!==Ze||b0.current||Do?(typeof In==\"function\"&&(Go(m,S,In,O),Ze=m.memoizedState),(Ye=Do||yl(m,S,Ye,O,jr,Ze,ut))?(A0||typeof ee.UNSAFE_componentWillMount!=\"function\"&&typeof ee.componentWillMount!=\"function\"||(typeof ee.componentWillMount==\"function\"&&ee.componentWillMount(),typeof ee.UNSAFE_componentWillMount==\"function\"&&ee.UNSAFE_componentWillMount()),typeof ee.componentDidMount==\"function\"&&(m.effectTag|=4)):(typeof ee.componentDidMount==\"function\"&&(m.effectTag|=4),m.memoizedProps=O,m.memoizedState=Ze),ee.props=O,ee.state=Ze,ee.context=ut,O=Ye):(typeof ee.componentDidMount==\"function\"&&(m.effectTag|=4),O=!1)}else ee=m.stateNode,Ye=m.memoizedProps,ee.props=m.type===m.elementType?Ye:I0(m.type,Ye),Ze=ee.context,ut=S.contextType,typeof ut==\"object\"&&ut!==null?ut=D0(ut):(ut=c0(S)?Bt:H0.current,ut=Lu(m,ut)),In=S.getDerivedStateFromProps,(A0=typeof In==\"function\"||typeof ee.getSnapshotBeforeUpdate==\"function\")||typeof ee.UNSAFE_componentWillReceiveProps!=\"function\"&&typeof ee.componentWillReceiveProps!=\"function\"||(Ye!==O||Ze!==ut)&&Bs(m,ee,O,ut),Do=!1,Ze=m.memoizedState,jr=ee.state=Ze,gi=m.updateQueue,gi!==null&&(P0(m,gi,O,ee,M),jr=m.memoizedState),Ye!==O||Ze!==jr||b0.current||Do?(typeof In==\"function\"&&(Go(m,S,In,O),jr=m.memoizedState),(In=Do||yl(m,S,Ye,O,Ze,jr,ut))?(A0||typeof ee.UNSAFE_componentWillUpdate!=\"function\"&&typeof ee.componentWillUpdate!=\"function\"||(typeof ee.componentWillUpdate==\"function\"&&ee.componentWillUpdate(O,jr,ut),typeof ee.UNSAFE_componentWillUpdate==\"function\"&&ee.UNSAFE_componentWillUpdate(O,jr,ut)),typeof ee.componentDidUpdate==\"function\"&&(m.effectTag|=4),typeof ee.getSnapshotBeforeUpdate==\"function\"&&(m.effectTag|=256)):(typeof ee.componentDidUpdate!=\"function\"||Ye===v.memoizedProps&&Ze===v.memoizedState||(m.effectTag|=4),typeof ee.getSnapshotBeforeUpdate!=\"function\"||Ye===v.memoizedProps&&Ze===v.memoizedState||(m.effectTag|=256),m.memoizedProps=O,m.memoizedState=jr),ee.props=O,ee.state=jr,ee.context=ut,O=In):(typeof ee.componentDidUpdate!=\"function\"||Ye===v.memoizedProps&&Ze===v.memoizedState||(m.effectTag|=4),typeof ee.getSnapshotBeforeUpdate!=\"function\"||Ye===v.memoizedProps&&Ze===v.memoizedState||(m.effectTag|=256),O=!1);return Be(v,m,S,O,b,M)}function Be(v,m,S,O,M,b){$0(v,m);var ee=(m.effectTag&64)!=0;if(!O&&!ee)return M&&zo(m,S,!1),X0(v,m,b);O=m.stateNode,Jn.current=m;var Ye=ee&&typeof S.getDerivedStateFromError!=\"function\"?null:O.render();return m.effectTag|=1,v!==null&&ee?(m.child=R(m,v.child,null,b),m.child=R(m,null,Ye,b)):o0(v,m,Ye,b),m.memoizedState=O.state,M&&zo(m,S,!0),m.child}function Ie(v){var m=v.stateNode;m.pendingContext?As(v,m.pendingContext,m.pendingContext!==m.context):m.context&&As(v,m.context,!1),ve(v,m.containerInfo)}var ht={dehydrated:null,retryTime:0};function mt(v,m,S){var O=m.mode,M=m.pendingProps,b=xe.current,ee=!1,Ye;if((Ye=(m.effectTag&64)!=0)||(Ye=(b&2)!=0&&(v===null||v.memoizedState!==null)),Ye?(ee=!0,m.effectTag&=-65):v!==null&&v.memoizedState===null||M.fallback===void 0||M.unstable_avoidThisFallback===!0||(b|=1),Fr(xe,b&1,m),v===null){if(M.fallback!==void 0&&Co(m),ee){if(ee=M.fallback,M=mi(null,O,0,null),M.return=m,(m.mode&2)==0)for(v=m.memoizedState!==null?m.child.child:m.child,M.child=v;v!==null;)v.return=M,v=v.sibling;return S=mi(ee,O,S,null),S.return=m,M.sibling=S,m.memoizedState=ht,m.child=M,S}return O=M.children,m.memoizedState=null,m.child=U(m,null,O,S)}if(v.memoizedState!==null){if(v=v.child,O=v.sibling,ee){if(M=M.fallback,S=ti(v,v.pendingProps,0),S.return=m,(m.mode&2)==0&&(ee=m.memoizedState!==null?m.child.child:m.child,ee!==v.child))for(S.child=ee;ee!==null;)ee.return=S,ee=ee.sibling;return O=ti(O,M,O.expirationTime),O.return=m,S.sibling=O,S.childExpirationTime=0,m.memoizedState=ht,m.child=S,O}return S=R(m,v.child,M.children,S),m.memoizedState=null,m.child=S}if(v=v.child,ee){if(ee=M.fallback,M=mi(null,O,0,null),M.return=m,M.child=v,v!==null&&(v.return=M),(m.mode&2)==0)for(v=m.memoizedState!==null?m.child.child:m.child,M.child=v;v!==null;)v.return=M,v=v.sibling;return S=mi(ee,O,S,null),S.return=m,M.sibling=S,S.effectTag|=2,M.childExpirationTime=0,m.memoizedState=ht,m.child=M,S}return m.memoizedState=null,m.child=R(m,v,M.children,S)}function wn(v,m){v.expirationTime<m&&(v.expirationTime=m);var S=v.alternate;S!==null&&S.expirationTime<m&&(S.expirationTime=m),e0(v.return,m)}function Gn(v,m,S,O,M,b){var ee=v.memoizedState;ee===null?v.memoizedState={isBackwards:m,rendering:null,last:O,tail:S,tailExpiration:0,tailMode:M,lastEffect:b}:(ee.isBackwards=m,ee.rendering=null,ee.last=O,ee.tail=S,ee.tailExpiration=0,ee.tailMode=M,ee.lastEffect=b)}function $t(v,m,S){var O=m.pendingProps,M=O.revealOrder,b=O.tail;if(o0(v,m,O.children,S),O=xe.current,(O&2)!=0)O=O&1|2,m.effectTag|=64;else{if(v!==null&&(v.effectTag&64)!=0)e:for(v=m.child;v!==null;){if(v.tag===13)v.memoizedState!==null&&wn(v,S);else if(v.tag===19)wn(v,S);else if(v.child!==null){v.child.return=v,v=v.child;continue}if(v===m)break e;for(;v.sibling===null;){if(v.return===null||v.return===m)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}O&=1}if(Fr(xe,O,m),(m.mode&2)==0)m.memoizedState=null;else switch(M){case\"forwards\":for(S=m.child,M=null;S!==null;)v=S.alternate,v!==null&&je(v)===null&&(M=S),S=S.sibling;S=M,S===null?(M=m.child,m.child=null):(M=S.sibling,S.sibling=null),Gn(m,!1,M,S,b,m.lastEffect);break;case\"backwards\":for(S=null,M=m.child,m.child=null;M!==null;){if(v=M.alternate,v!==null&&je(v)===null){m.child=M;break}v=M.sibling,M.sibling=S,S=M,M=v}Gn(m,!0,S,null,b,m.lastEffect);break;case\"together\":Gn(m,!1,null,null,void 0,m.lastEffect);break;default:m.memoizedState=null}return m.child}function X0(v,m,S){v!==null&&(m.dependencies=v.dependencies);var O=m.expirationTime;if(O!==0&&pf(O),m.childExpirationTime<S)return null;if(v!==null&&m.child!==v.child)throw Error(t(153));if(m.child!==null){for(v=m.child,S=ti(v,v.pendingProps,v.expirationTime),m.child=S,S.return=m;v.sibling!==null;)v=v.sibling,S=S.sibling=ti(v,v.pendingProps,v.expirationTime),S.return=m;S.sibling=null}return m.child}function ki(v){v.effectTag|=4}var Yr,$r,m0,Tn;if(Yt)Yr=function(v,m){for(var S=m.child;S!==null;){if(S.tag===5||S.tag===6)ge(v,S.stateNode);else if(S.tag!==4&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===m)break;for(;S.sibling===null;){if(S.return===null||S.return===m)return;S=S.return}S.sibling.return=S.return,S=S.sibling}},$r=function(){},m0=function(v,m,S,O,M){if(v=v.memoizedProps,v!==O){var b=m.stateNode,ee=W(fe.current);S=Ae(b,S,v,O,M,ee),(m.updateQueue=S)&&ki(m)}},Tn=function(v,m,S,O){S!==O&&ki(m)};else if(cr){Yr=function(v,m,S,O){for(var M=m.child;M!==null;){if(M.tag===5){var b=M.stateNode;S&&O&&(b=Ss(b,M.type,M.memoizedProps,M)),ge(v,b)}else if(M.tag===6)b=M.stateNode,S&&O&&(b=Cs(b,M.memoizedProps,M)),ge(v,b);else if(M.tag!==4){if(M.tag===13&&(M.effectTag&4)!=0&&(b=M.memoizedState!==null)){var ee=M.child;if(ee!==null&&(ee.child!==null&&(ee.child.return=ee,Yr(v,ee,!0,b)),b=ee.sibling,b!==null)){b.return=M,M=b;continue}}if(M.child!==null){M.child.return=M,M=M.child;continue}}if(M===m)break;for(;M.sibling===null;){if(M.return===null||M.return===m)return;M=M.return}M.sibling.return=M.return,M=M.sibling}};var Yo=function(v,m,S,O){for(var M=m.child;M!==null;){if(M.tag===5){var b=M.stateNode;S&&O&&(b=Ss(b,M.type,M.memoizedProps,M)),Es(v,b)}else if(M.tag===6)b=M.stateNode,S&&O&&(b=Cs(b,M.memoizedProps,M)),Es(v,b);else if(M.tag!==4){if(M.tag===13&&(M.effectTag&4)!=0&&(b=M.memoizedState!==null)){var ee=M.child;if(ee!==null&&(ee.child!==null&&(ee.child.return=ee,Yo(v,ee,!0,b)),b=ee.sibling,b!==null)){b.return=M,M=b;continue}}if(M.child!==null){M.child.return=M,M=M.child;continue}}if(M===m)break;for(;M.sibling===null;){if(M.return===null||M.return===m)return;M=M.return}M.sibling.return=M.return,M=M.sibling}};$r=function(v){var m=v.stateNode;if(v.firstEffect!==null){var S=m.containerInfo,O=ul(S);Yo(O,v,!1,!1),m.pendingChildren=O,ki(v),Uo(S,O)}},m0=function(v,m,S,O,M){var b=v.stateNode,ee=v.memoizedProps;if((v=m.firstEffect===null)&&ee===O)m.stateNode=b;else{var Ye=m.stateNode,Ze=W(fe.current),ut=null;ee!==O&&(ut=Ae(Ye,S,ee,O,M,Ze)),v&&ut===null?m.stateNode=b:(b=ol(b,ut,S,ee,O,m,v,Ye),Z(b,S,O,M,Ze)&&ki(m),m.stateNode=b,v?ki(m):Yr(b,m,!1,!1))}},Tn=function(v,m,S,O){S!==O&&(v=W(de.current),S=W(fe.current),m.stateNode=Ft(O,v,S,m),ki(m))}}else $r=function(){},m0=function(){},Tn=function(){};function bi(v,m){switch(v.tailMode){case\"hidden\":m=v.tail;for(var S=null;m!==null;)m.alternate!==null&&(S=m),m=m.sibling;S===null?v.tail=null:S.sibling=null;break;case\"collapsed\":S=v.tail;for(var O=null;S!==null;)S.alternate!==null&&(O=S),S=S.sibling;O===null?m||v.tail===null?v.tail=null:v.tail.sibling=null:O.sibling=null}}function or(v){switch(v.tag){case 1:c0(v.type)&&Ru(v);var m=v.effectTag;return m&4096?(v.effectTag=m&-4097|64,v):null;case 3:if(Fe(v),ks(v),m=v.effectTag,(m&64)!=0)throw Error(t(285));return v.effectTag=m&-4097|64,v;case 5:return K(v),null;case 13:return kr(xe,v),m=v.effectTag,m&4096?(v.effectTag=m&-4097|64,v):null;case 19:return kr(xe,v),null;case 4:return Fe(v),null;case 10:return fi(v),null;default:return null}}function zs(v,m){return{value:v,source:m,stack:dl(m)}}var Ku=typeof WeakSet==\"function\"?WeakSet:Set;function J0(v,m){var S=m.source,O=m.stack;O===null&&S!==null&&(O=dl(S)),S!==null&&Oe(S.type),m=m.value,v!==null&&v.tag===1&&Oe(v.type);try{console.error(m)}catch(M){setTimeout(function(){throw M})}}function af(v,m){try{m.props=v.memoizedProps,m.state=v.memoizedState,m.componentWillUnmount()}catch(S){Qu(v,S)}}function S0(v){var m=v.ref;if(m!==null)if(typeof m==\"function\")try{m(null)}catch(S){Qu(v,S)}else m.current=null}function El(v,m){switch(m.tag){case 0:case 11:case 15:Q0(2,0,m);break;case 1:if(m.effectTag&256&&v!==null){var S=v.memoizedProps,O=v.memoizedState;v=m.stateNode,m=v.getSnapshotBeforeUpdate(m.elementType===m.type?S:I0(m.type,S),O),v.__reactInternalSnapshotBeforeUpdate=m}break;case 3:case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}function Q0(v,m,S){if(S=S.updateQueue,S=S!==null?S.lastEffect:null,S!==null){var O=S=S.next;do{if((O.tag&v)!=0){var M=O.destroy;O.destroy=void 0,M!==void 0&&M()}(O.tag&m)!=0&&(M=O.create,O.destroy=M()),O=O.next}while(O!==S)}}function Tr(v,m,S){switch(typeof Tl==\"function\"&&Tl(m),m.tag){case 0:case 11:case 14:case 15:if(v=m.updateQueue,v!==null&&(v=v.lastEffect,v!==null)){var O=v.next;zi(97<S?97:S,function(){var M=O;do{var b=M.destroy;if(b!==void 0){var ee=m;try{b()}catch(Ye){Qu(ee,Ye)}}M=M.next}while(M!==O)})}break;case 1:S0(m),S=m.stateNode,typeof S.componentWillUnmount==\"function\"&&af(m,S);break;case 5:S0(m);break;case 4:Yt?C0(v,m,S):cr&&uo(m)}}function R0(v,m,S){for(var O=m;;)if(Tr(v,O,S),O.child===null||Yt&&O.tag===4){if(O===m)break;for(;O.sibling===null;){if(O.return===null||O.return===m)return;O=O.return}O.sibling.return=O.return,O=O.sibling}else O.child.return=O,O=O.child}function Nr(v){var m=v.alternate;v.return=null,v.child=null,v.memoizedState=null,v.updateQueue=null,v.dependencies=null,v.alternate=null,v.firstEffect=null,v.lastEffect=null,v.pendingProps=null,v.memoizedProps=null,m!==null&&Nr(m)}function uo(v){if(cr){v=v.stateNode.containerInfo;var m=ul(v);sl(v,m)}}function so(v){return v.tag===5||v.tag===3||v.tag===4}function N0(v){if(Yt){e:{for(var m=v.return;m!==null;){if(so(m)){var S=m;break e}m=m.return}throw Error(t(160))}switch(m=S.stateNode,S.tag){case 5:var O=!1;break;case 3:m=m.containerInfo,O=!0;break;case 4:m=m.containerInfo,O=!0;break;default:throw Error(t(161))}S.effectTag&16&&(Ds(m),S.effectTag&=-17);e:t:for(S=v;;){for(;S.sibling===null;){if(S.return===null||so(S.return)){S=null;break e}S=S.return}for(S.sibling.return=S.return,S=S.sibling;S.tag!==5&&S.tag!==6&&S.tag!==18;){if(S.effectTag&2||S.child===null||S.tag===4)continue t;S.child.return=S,S=S.child}if(!(S.effectTag&2)){S=S.stateNode;break e}}for(var M=v;;){var b=M.tag===5||M.tag===6;if(b)b=b?M.stateNode:M.stateNode.instance,S?O?r0(m,b,S):gr(m,b,S):O?Mn(m,b):pt(m,b);else if(M.tag!==4&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===v)break;for(;M.sibling===null;){if(M.return===null||M.return===v)return;M=M.return}M.sibling.return=M.return,M=M.sibling}}}function C0(v,m,S){for(var O=m,M=!1,b,ee;;){if(!M){M=O.return;e:for(;;){if(M===null)throw Error(t(160));switch(b=M.stateNode,M.tag){case 5:ee=!1;break e;case 3:b=b.containerInfo,ee=!0;break e;case 4:b=b.containerInfo,ee=!0;break e}M=M.return}M=!0}if(O.tag===5||O.tag===6)R0(v,O,S),ee?yo(b,O.stateNode):Ci(b,O.stateNode);else if(O.tag===4){if(O.child!==null){b=O.stateNode.containerInfo,ee=!0,O.child.return=O,O=O.child;continue}}else if(Tr(v,O,S),O.child!==null){O.child.return=O,O=O.child;continue}if(O===m)break;for(;O.sibling===null;){if(O.return===null||O.return===m)return;O=O.return,O.tag===4&&(M=!1)}O.sibling.return=O.return,O=O.sibling}}function di(v,m){if(Yt)switch(m.tag){case 0:case 11:case 14:case 15:Q0(4,8,m);break;case 1:break;case 5:var S=m.stateNode;if(S!=null){var O=m.memoizedProps;v=v!==null?v.memoizedProps:O;var M=m.type,b=m.updateQueue;m.updateQueue=null,b!==null&&vr(S,b,M,v,O,m)}break;case 6:if(m.stateNode===null)throw Error(t(162));S=m.memoizedProps,Bn(m.stateNode,v!==null?v.memoizedProps:S,S);break;case 3:w&&(m=m.stateNode,m.hydrate&&(m.hydrate=!1,of(m.containerInfo)));break;case 12:break;case 13:u0(m),v0(m);break;case 19:v0(m);break;case 17:break;case 20:break;case 21:break;default:throw Error(t(163))}else{switch(m.tag){case 0:case 11:case 14:case 15:Q0(4,8,m);return;case 12:return;case 13:u0(m),v0(m);return;case 19:v0(m);return;case 3:w&&(S=m.stateNode,S.hydrate&&(S.hydrate=!1,of(S.containerInfo)))}e:if(cr)switch(m.tag){case 1:case 5:case 6:case 20:break e;case 3:case 4:m=m.stateNode,sl(m.containerInfo,m.pendingChildren);break e;default:throw Error(t(163))}}}function u0(v){var m=v;if(v.memoizedState===null)var S=!1;else S=!0,m=v.child,Ut=G0();if(Yt&&m!==null)e:if(v=m,Yt)for(m=v;;){if(m.tag===5){var O=m.stateNode;S?Mu(O):iu(m.stateNode,m.memoizedProps)}else if(m.tag===6)O=m.stateNode,S?Gf(O):ou(O,m.memoizedProps);else if(m.tag===13&&m.memoizedState!==null&&m.memoizedState.dehydrated===null){O=m.child.sibling,O.return=m,m=O;continue}else if(m.child!==null){m.child.return=m,m=m.child;continue}if(m===v)break e;for(;m.sibling===null;){if(m.return===null||m.return===v)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}}function v0(v){var m=v.updateQueue;if(m!==null){v.updateQueue=null;var S=v.stateNode;S===null&&(S=v.stateNode=new Ku),m.forEach(function(O){var M=Fc.bind(null,v,O);S.has(O)||(S.add(O),O.then(M,M))})}}var To=typeof WeakMap==\"function\"?WeakMap:Map;function pu(v,m,S){S=a0(S,null),S.tag=3,S.payload={element:null};var O=m.value;return S.callback=function(){_r||(_r=!0,Wr=O),J0(v,m)},S}function Sl(v,m,S){S=a0(S,null),S.tag=3;var O=v.type.getDerivedStateFromError;if(typeof O==\"function\"){var M=m.value;S.payload=function(){return J0(v,m),O(M)}}var b=v.stateNode;return b!==null&&typeof b.componentDidCatch==\"function\"&&(S.callback=function(){typeof O!=\"function\"&&(Ar===null?Ar=new Set([this]):Ar.add(this),J0(v,m));var ee=m.stack;this.componentDidCatch(m.value,{componentStack:ee!==null?ee:\"\"})}),S}var Cl=Math.ceil,B0=C.ReactCurrentDispatcher,hu=C.ReactCurrentOwner,Fn=0,pi=8,Br=16,zr=32,lo=0,wr=1,kn=2,T0=3,hi=4,Ai=5,Kt=Fn,X=null,Y=null,ye=0,he=lo,We=null,et=1073741823,Dt=1073741823,bt=null,Zt=0,qt=!1,Ut=0,fn=500,_t=null,_r=!1,Wr=null,Ar=null,z=!1,dr=null,Or=90,Qn=null,nn=0,s0=null,t0=0;function g0(){return(Kt&(Br|zr))!==Fn?1073741821-(G0()/10|0):t0!==0?t0:t0=1073741821-(G0()/10|0)}function Kr(v,m,S){if(m=m.mode,(m&2)==0)return 1073741823;var O=Fs();if((m&4)==0)return O===99?1073741823:1073741822;if((Kt&Br)!==Fn)return ye;if(S!==null)v=fu(v,S.timeoutMs|0||5e3,250);else switch(O){case 99:v=1073741823;break;case 98:v=fu(v,150,100);break;case 97:case 96:v=fu(v,5e3,250);break;case 95:v=2;break;default:throw Error(t(326))}return X!==null&&v===ye&&--v,v}function _0(v,m){if(50<nn)throw nn=0,s0=null,Error(t(185));if(v=Gi(v,m),v!==null){var S=Fs();m===1073741823?(Kt&pi)!==Fn&&(Kt&(Br|zr))===Fn?Z0(v):(x0(v),Kt===Fn&&O0()):x0(v),(Kt&4)===Fn||S!==98&&S!==99||(Qn===null?Qn=new Map([[v,m]]):(S=Qn.get(v),(S===void 0||S>m)&&Qn.set(v,m)))}}function Gi(v,m){v.expirationTime<m&&(v.expirationTime=m);var S=v.alternate;S!==null&&S.expirationTime<m&&(S.expirationTime=m);var O=v.return,M=null;if(O===null&&v.tag===3)M=v.stateNode;else for(;O!==null;){if(S=O.alternate,O.childExpirationTime<m&&(O.childExpirationTime=m),S!==null&&S.childExpirationTime<m&&(S.childExpirationTime=m),O.return===null&&O.tag===3){M=O.stateNode;break}O=O.return}return M!==null&&(X===M&&(pf(m),he===hi&&ao(M,ye)),$o(M,m)),M}function fo(v){var m=v.lastExpiredTime;return m!==0||(m=v.firstPendingTime,!Jf(v,m))?m:(m=v.lastPingedTime,v=v.nextKnownPendingLevel,m>v?m:v)}function x0(v){if(v.lastExpiredTime!==0)v.callbackExpirationTime=1073741823,v.callbackPriority=99,v.callbackNode=Ho(Z0.bind(null,v));else{var m=fo(v),S=v.callbackNode;if(m===0)S!==null&&(v.callbackNode=null,v.callbackExpirationTime=0,v.callbackPriority=90);else{var O=g0();if(m===1073741823?O=99:m===1||m===2?O=95:(O=10*(1073741821-m)-10*(1073741821-O),O=0>=O?99:250>=O?98:5250>=O?97:95),S!==null){var M=v.callbackPriority;if(v.callbackExpirationTime===m&&M>=O)return;S!==ju&&uf(S)}v.callbackExpirationTime=m,v.callbackPriority=O,m=m===1073741823?Ho(Z0.bind(null,v)):lu(O,Xu.bind(null,v),{timeout:10*(1073741821-m)-G0()}),v.callbackNode=m}}}function Xu(v,m){if(t0=0,m)return m=g0(),kl(v,m),x0(v),null;var S=fo(v);if(S!==0){if(m=v.callbackNode,(Kt&(Br|zr))!==Fn)throw Error(t(327));if(Ws(),v===X&&S===ye||mu(v,S),Y!==null){var O=Kt;Kt|=Br;var M=ei(v);do try{Ua();break}catch(Ye){Ju(v,Ye)}while(1);if(Wu(),Kt=O,B0.current=M,he===wr)throw m=We,mu(v,S),ao(v,S),x0(v),m;if(Y===null)switch(M=v.finishedWork=v.current.alternate,v.finishedExpirationTime=S,O=he,X=null,O){case lo:case wr:throw Error(t(345));case kn:kl(v,2<S?2:S);break;case T0:if(ao(v,S),O=v.lastSuspendedTime,S===O&&(v.nextKnownPendingLevel=$f(M)),et===1073741823&&(M=Ut+fn-G0(),10<M)){if(qt){var b=v.lastPingedTime;if(b===0||b>=S){v.lastPingedTime=S,mu(v,S);break}}if(b=fo(v),b!==0&&b!==S)break;if(O!==0&&O!==S){v.lastPingedTime=O;break}v.timeoutHandle=jt(gu.bind(null,v),M);break}gu(v);break;case hi:if(ao(v,S),O=v.lastSuspendedTime,S===O&&(v.nextKnownPendingLevel=$f(M)),qt&&(M=v.lastPingedTime,M===0||M>=S)){v.lastPingedTime=S,mu(v,S);break}if(M=fo(v),M!==0&&M!==S)break;if(O!==0&&O!==S){v.lastPingedTime=O;break}if(Dt!==1073741823?O=10*(1073741821-Dt)-G0():et===1073741823?O=0:(O=10*(1073741821-et)-5e3,M=G0(),S=10*(1073741821-S)-M,O=M-O,0>O&&(O=0),O=(120>O?120:480>O?480:1080>O?1080:1920>O?1920:3e3>O?3e3:4320>O?4320:1960*Cl(O/1960))-O,S<O&&(O=S)),10<O){v.timeoutHandle=jt(gu.bind(null,v),O);break}gu(v);break;case Ai:if(et!==1073741823&&bt!==null){b=et;var ee=bt;if(O=ee.busyMinDurationMs|0,0>=O?O=0:(M=ee.busyDelayMs|0,b=G0()-(10*(1073741821-b)-(ee.timeoutMs|0||5e3)),O=b<=M?0:M+O-b),10<O){ao(v,S),v.timeoutHandle=jt(gu.bind(null,v),O);break}}gu(v);break;default:throw Error(t(329))}if(x0(v),v.callbackNode===m)return Xu.bind(null,v)}}return null}function Z0(v){var m=v.lastExpiredTime;if(m=m!==0?m:1073741823,v.finishedExpirationTime===m)gu(v);else{if((Kt&(Br|zr))!==Fn)throw Error(t(327));if(Ws(),v===X&&m===ye||mu(v,m),Y!==null){var S=Kt;Kt|=Br;var O=ei(v);do try{ja();break}catch(M){Ju(v,M)}while(1);if(Wu(),Kt=S,B0.current=O,he===wr)throw S=We,mu(v,m),ao(v,m),x0(v),S;if(Y!==null)throw Error(t(261));v.finishedWork=v.current.alternate,v.finishedExpirationTime=m,X=null,gu(v),x0(v)}}return null}function df(v,m){kl(v,m),x0(v),(Kt&(Br|zr))===Fn&&O0()}function Ba(){if(Qn!==null){var v=Qn;Qn=null,v.forEach(function(m,S){kl(S,m),x0(S)}),O0()}}function Oc(v,m){if((Kt&(Br|zr))!==Fn)throw Error(t(187));var S=Kt;Kt|=1;try{return zi(99,v.bind(null,m))}finally{Kt=S,O0()}}function mu(v,m){v.finishedWork=null,v.finishedExpirationTime=0;var S=v.timeoutHandle;if(S!==Un&&(v.timeoutHandle=Un,hn(S)),Y!==null)for(S=Y.return;S!==null;){var O=S;switch(O.tag){case 1:var M=O.type.childContextTypes;M!=null&&Ru(O);break;case 3:Fe(O),ks(O);break;case 5:K(O);break;case 4:Fe(O);break;case 13:kr(xe,O);break;case 19:kr(xe,O);break;case 10:fi(O)}S=S.return}X=v,Y=ti(v.current,null,m),ye=m,he=lo,We=null,Dt=et=1073741823,bt=null,Zt=0,qt=!1}function Ju(v,m){do{try{if(Wu(),Qt(),Y===null||Y.return===null)return he=wr,We=m,null;e:{var S=v,O=Y.return,M=Y,b=m;if(m=ye,M.effectTag|=2048,M.firstEffect=M.lastEffect=null,b!==null&&typeof b==\"object\"&&typeof b.then==\"function\"){var ee=b,Ye=(xe.current&1)!=0,Ze=O;do{var ut;if(ut=Ze.tag===13){var In=Ze.memoizedState;if(In!==null)ut=In.dehydrated!==null;else{var A0=Ze.memoizedProps;ut=A0.fallback===void 0?!1:A0.unstable_avoidThisFallback!==!0?!0:!Ye}}if(ut){var jr=Ze.updateQueue;if(jr===null){var gi=new Set;gi.add(ee),Ze.updateQueue=gi}else jr.add(ee);if((Ze.mode&2)==0){if(Ze.effectTag|=64,M.effectTag&=-2981,M.tag===1)if(M.alternate===null)M.tag=17;else{var po=a0(1073741823,null);po.tag=2,V0(M,po)}M.expirationTime=1073741823;break e}b=void 0,M=m;var _i=S.pingCache;if(_i===null?(_i=S.pingCache=new To,b=new Set,_i.set(ee,b)):(b=_i.get(ee),b===void 0&&(b=new Set,_i.set(ee,b))),!b.has(M)){b.add(M);var Re=Mc.bind(null,S,ee,M);ee.then(Re,Re)}Ze.effectTag|=4096,Ze.expirationTime=m;break e}Ze=Ze.return}while(Ze!==null);b=Error((Oe(M.type)||\"A React component\")+` suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`+dl(M))}he!==Ai&&(he=kn),b=zs(b,M),Ze=O;do{switch(Ze.tag){case 3:ee=b,Ze.effectTag|=4096,Ze.expirationTime=m;var Ce=pu(Ze,ee,m);bu(Ze,Ce);break e;case 1:ee=b;var ze=Ze.type,Et=Ze.stateNode;if((Ze.effectTag&64)==0&&(typeof ze.getDerivedStateFromError==\"function\"||Et!==null&&typeof Et.componentDidCatch==\"function\"&&(Ar===null||!Ar.has(Et)))){Ze.effectTag|=4096,Ze.expirationTime=m;var on=Sl(Ze,ee,m);bu(Ze,on);break e}}Ze=Ze.return}while(Ze!==null)}Y=vu(Y)}catch(sr){m=sr;continue}break}while(1)}function ei(){var v=B0.current;return B0.current=oo,v===null?oo:v}function Yf(v,m){v<et&&2<v&&(et=v),m!==null&&v<Dt&&2<v&&(Dt=v,bt=m)}function pf(v){v>Zt&&(Zt=v)}function ja(){for(;Y!==null;)Y=Ic(Y)}function Ua(){for(;Y!==null&&!_n();)Y=Ic(Y)}function Ic(v){var m=Lc(v.alternate,v,ye);return v.memoizedProps=v.pendingProps,m===null&&(m=vu(v)),hu.current=null,m}function vu(v){Y=v;do{var m=Y.alternate;if(v=Y.return,(Y.effectTag&2048)==0){e:{var S=m;m=Y;var O=ye,M=m.pendingProps;switch(m.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:c0(m.type)&&Ru(m);break;case 3:Fe(m),ks(m),M=m.stateNode,M.pendingContext&&(M.context=M.pendingContext,M.pendingContext=null),(S===null||S.child===null)&&Vo(m)&&ki(m),$r(m);break;case 5:K(m);var b=W(de.current);if(O=m.type,S!==null&&m.stateNode!=null)m0(S,m,O,M,b),S.ref!==m.ref&&(m.effectTag|=128);else if(M){if(S=W(fe.current),Vo(m)){if(M=m,!w)throw Error(t(175));S=Ui(M.stateNode,M.type,M.memoizedProps,b,S,M),M.updateQueue=S,S=S!==null,S&&ki(m)}else{var ee=ne(O,M,b,S,m);Yr(ee,m,!1,!1),m.stateNode=ee,Z(ee,O,M,b,S)&&ki(m)}m.ref!==null&&(m.effectTag|=128)}else if(m.stateNode===null)throw Error(t(166));break;case 6:if(S&&m.stateNode!=null)Tn(S,m,S.memoizedProps,M);else{if(typeof M!=\"string\"&&m.stateNode===null)throw Error(t(166));if(S=W(de.current),b=W(fe.current),Vo(m)){if(S=m,!w)throw Error(t(176));(S=Mr(S.stateNode,S.memoizedProps,S))&&ki(m)}else m.stateNode=Ft(M,S,b,m)}break;case 11:break;case 13:if(kr(xe,m),M=m.memoizedState,(m.effectTag&64)!=0){m.expirationTime=O;break e}M=M!==null,b=!1,S===null?m.memoizedProps.fallback!==void 0&&Vo(m):(O=S.memoizedState,b=O!==null,M||O===null||(O=S.child.sibling,O!==null&&(ee=m.firstEffect,ee!==null?(m.firstEffect=O,O.nextEffect=ee):(m.firstEffect=m.lastEffect=O,O.nextEffect=null),O.effectTag=8))),M&&!b&&(m.mode&2)!=0&&(S===null&&m.memoizedProps.unstable_avoidThisFallback!==!0||(xe.current&1)!=0?he===lo&&(he=T0):((he===lo||he===T0)&&(he=hi),Zt!==0&&X!==null&&(ao(X,ye),$o(X,Zt)))),cr&&M&&(m.effectTag|=4),Yt&&(M||b)&&(m.effectTag|=4);break;case 7:break;case 8:break;case 12:break;case 4:Fe(m),$r(m);break;case 10:fi(m);break;case 9:break;case 14:break;case 17:c0(m.type)&&Ru(m);break;case 19:if(kr(xe,m),M=m.memoizedState,M===null)break;if(b=(m.effectTag&64)!=0,ee=M.rendering,ee===null){if(b)bi(M,!1);else if(he!==lo||S!==null&&(S.effectTag&64)!=0)for(S=m.child;S!==null;){if(ee=je(S),ee!==null){for(m.effectTag|=64,bi(M,!1),S=ee.updateQueue,S!==null&&(m.updateQueue=S,m.effectTag|=4),M.lastEffect===null&&(m.firstEffect=null),m.lastEffect=M.lastEffect,S=O,M=m.child;M!==null;)b=M,O=S,b.effectTag&=2,b.nextEffect=null,b.firstEffect=null,b.lastEffect=null,ee=b.alternate,ee===null?(b.childExpirationTime=0,b.expirationTime=O,b.child=null,b.memoizedProps=null,b.memoizedState=null,b.updateQueue=null,b.dependencies=null):(b.childExpirationTime=ee.childExpirationTime,b.expirationTime=ee.expirationTime,b.child=ee.child,b.memoizedProps=ee.memoizedProps,b.memoizedState=ee.memoizedState,b.updateQueue=ee.updateQueue,O=ee.dependencies,b.dependencies=O===null?null:{expirationTime:O.expirationTime,firstContext:O.firstContext,responders:O.responders}),M=M.sibling;Fr(xe,xe.current&1|2,m),m=m.child;break e}S=S.sibling}}else{if(!b)if(S=je(ee),S!==null){if(m.effectTag|=64,b=!0,S=S.updateQueue,S!==null&&(m.updateQueue=S,m.effectTag|=4),bi(M,!0),M.tail===null&&M.tailMode===\"hidden\"&&!ee.alternate){m=m.lastEffect=M.lastEffect,m!==null&&(m.nextEffect=null);break}}else G0()>M.tailExpiration&&1<O&&(m.effectTag|=64,b=!0,bi(M,!1),m.expirationTime=m.childExpirationTime=O-1);M.isBackwards?(ee.sibling=m.child,m.child=ee):(S=M.last,S!==null?S.sibling=ee:m.child=ee,M.last=ee)}if(M.tail!==null){M.tailExpiration===0&&(M.tailExpiration=G0()+500),S=M.tail,M.rendering=S,M.tail=S.sibling,M.lastEffect=m.lastEffect,S.sibling=null,M=xe.current,M=b?M&1|2:M&1,Fr(xe,M,m),m=S;break e}break;case 20:break;case 21:break;default:throw Error(t(156,m.tag))}m=null}if(S=Y,ye===1||S.childExpirationTime!==1){for(M=0,b=S.child;b!==null;)O=b.expirationTime,ee=b.childExpirationTime,O>M&&(M=O),ee>M&&(M=ee),b=b.sibling;S.childExpirationTime=M}if(m!==null)return m;v!==null&&(v.effectTag&2048)==0&&(v.firstEffect===null&&(v.firstEffect=Y.firstEffect),Y.lastEffect!==null&&(v.lastEffect!==null&&(v.lastEffect.nextEffect=Y.firstEffect),v.lastEffect=Y.lastEffect),1<Y.effectTag&&(v.lastEffect!==null?v.lastEffect.nextEffect=Y:v.firstEffect=Y,v.lastEffect=Y))}else{if(m=or(Y,ye),m!==null)return m.effectTag&=2047,m;v!==null&&(v.firstEffect=v.lastEffect=null,v.effectTag|=2048)}if(m=Y.sibling,m!==null)return m;Y=v}while(Y!==null);return he===lo&&(he=Ai),null}function $f(v){var m=v.expirationTime;return v=v.childExpirationTime,m>v?m:v}function gu(v){var m=Fs();return zi(99,co.bind(null,v,m)),null}function co(v,m){do Ws();while(dr!==null);if((Kt&(Br|zr))!==Fn)throw Error(t(327));var S=v.finishedWork,O=v.finishedExpirationTime;if(S===null)return null;if(v.finishedWork=null,v.finishedExpirationTime=0,S===v.current)throw Error(t(177));v.callbackNode=null,v.callbackExpirationTime=0,v.callbackPriority=90,v.nextKnownPendingLevel=0;var M=$f(S);if(v.firstPendingTime=M,O<=v.lastSuspendedTime?v.firstSuspendedTime=v.lastSuspendedTime=v.nextKnownPendingLevel=0:O<=v.firstSuspendedTime&&(v.firstSuspendedTime=O-1),O<=v.lastPingedTime&&(v.lastPingedTime=0),O<=v.lastExpiredTime&&(v.lastExpiredTime=0),v===X&&(Y=X=null,ye=0),1<S.effectTag?S.lastEffect!==null?(S.lastEffect.nextEffect=S,M=S.firstEffect):M=S:M=S.firstEffect,M!==null){var b=Kt;Kt|=zr,hu.current=null,Je(v.containerInfo),_t=M;do try{qa()}catch(ni){if(_t===null)throw Error(t(330));Qu(_t,ni),_t=_t.nextEffect}while(_t!==null);_t=M;do try{for(var ee=v,Ye=m;_t!==null;){var Ze=_t.effectTag;if(Ze&16&&Yt&&Ds(_t.stateNode),Ze&128){var ut=_t.alternate;if(ut!==null){var In=ut.ref;In!==null&&(typeof In==\"function\"?In(null):In.current=null)}}switch(Ze&1038){case 2:N0(_t),_t.effectTag&=-3;break;case 6:N0(_t),_t.effectTag&=-3,di(_t.alternate,_t);break;case 1024:_t.effectTag&=-1025;break;case 1028:_t.effectTag&=-1025,di(_t.alternate,_t);break;case 4:di(_t.alternate,_t);break;case 8:var A0=ee,jr=_t,gi=Ye;Yt?C0(A0,jr,gi):R0(A0,jr,gi),Nr(jr)}_t=_t.nextEffect}}catch(ni){if(_t===null)throw Error(t(330));Qu(_t,ni),_t=_t.nextEffect}while(_t!==null);V(v.containerInfo),v.current=S,_t=M;do try{for(Ze=O;_t!==null;){var po=_t.effectTag;if(po&36){var _i=_t.alternate;switch(ut=_t,In=Ze,ut.tag){case 0:case 11:case 15:Q0(16,32,ut);break;case 1:var Re=ut.stateNode;if(ut.effectTag&4)if(_i===null)Re.componentDidMount();else{var Ce=ut.elementType===ut.type?_i.memoizedProps:I0(ut.type,_i.memoizedProps);Re.componentDidUpdate(Ce,_i.memoizedState,Re.__reactInternalSnapshotBeforeUpdate)}var ze=ut.updateQueue;ze!==null&&ln(ut,ze,Re,In);break;case 3:var Et=ut.updateQueue;if(Et!==null){if(ee=null,ut.child!==null)switch(ut.child.tag){case 5:ee=At(ut.child.stateNode);break;case 1:ee=ut.child.stateNode}ln(ut,Et,ee,In)}break;case 5:var on=ut.stateNode;_i===null&&ut.effectTag&4&&Xn(on,ut.type,ut.memoizedProps,ut);break;case 6:break;case 4:break;case 12:break;case 13:if(w&&ut.memoizedState===null){var sr=ut.alternate;if(sr!==null){var mn=sr.memoizedState;if(mn!==null){var pr=mn.dehydrated;pr!==null&&Ts(pr)}}}break;case 19:case 17:case 20:case 21:break;default:throw Error(t(163))}}if(po&128){ut=void 0;var Hr=_t.ref;if(Hr!==null){var Vn=_t.stateNode;switch(_t.tag){case 5:ut=At(Vn);break;default:ut=Vn}typeof Hr==\"function\"?Hr(ut):Hr.current=ut}}_t=_t.nextEffect}}catch(ni){if(_t===null)throw Error(t(330));Qu(_t,ni),_t=_t.nextEffect}while(_t!==null);_t=null,sf(),Kt=b}else v.current=S;if(z)z=!1,dr=v,Or=m;else for(_t=M;_t!==null;)m=_t.nextEffect,_t.nextEffect=null,_t=m;if(m=v.firstPendingTime,m===0&&(Ar=null),m===1073741823?v===s0?nn++:(nn=0,s0=v):nn=0,typeof Kf==\"function\"&&Kf(S.stateNode,O),x0(v),_r)throw _r=!1,v=Wr,Wr=null,v;return(Kt&pi)!==Fn||O0(),null}function qa(){for(;_t!==null;){var v=_t.effectTag;(v&256)!=0&&El(_t.alternate,_t),(v&512)==0||z||(z=!0,lu(97,function(){return Ws(),null})),_t=_t.nextEffect}}function Ws(){if(Or!==90){var v=97<Or?97:Or;return Or=90,zi(v,za)}}function za(){if(dr===null)return!1;var v=dr;if(dr=null,(Kt&(Br|zr))!==Fn)throw Error(t(331));var m=Kt;for(Kt|=zr,v=v.current.firstEffect;v!==null;){try{var S=v;if((S.effectTag&512)!=0)switch(S.tag){case 0:case 11:case 15:Q0(128,0,S),Q0(0,64,S)}}catch(O){if(v===null)throw Error(t(330));Qu(v,O)}S=v.nextEffect,v.nextEffect=null,v=S}return Kt=m,O0(),!0}function Pc(v,m,S){m=zs(S,m),m=pu(v,m,1073741823),V0(v,m),v=Gi(v,1073741823),v!==null&&x0(v)}function Qu(v,m){if(v.tag===3)Pc(v,v,m);else for(var S=v.return;S!==null;){if(S.tag===3){Pc(S,v,m);break}else if(S.tag===1){var O=S.stateNode;if(typeof S.type.getDerivedStateFromError==\"function\"||typeof O.componentDidCatch==\"function\"&&(Ar===null||!Ar.has(O))){v=zs(m,v),v=Sl(S,v,1073741823),V0(S,v),S=Gi(S,1073741823),S!==null&&x0(S);break}}S=S.return}}function Mc(v,m,S){var O=v.pingCache;O!==null&&O.delete(m),X===v&&ye===S?he===hi||he===T0&&et===1073741823&&G0()-Ut<fn?mu(v,ye):qt=!0:Jf(v,S)&&(m=v.lastPingedTime,m!==0&&m<S||(v.lastPingedTime=S,v.finishedExpirationTime===S&&(v.finishedExpirationTime=0,v.finishedWork=null),x0(v)))}function Fc(v,m){var S=v.stateNode;S!==null&&S.delete(m),m=0,m===0&&(m=g0(),m=Kr(m,v,null)),v=Gi(v,m),v!==null&&x0(v)}var Lc;Lc=function(v,m,S){var O=m.expirationTime;if(v!==null){var M=m.pendingProps;if(v.memoizedProps!==M||b0.current)ai=!0;else{if(O<S){switch(ai=!1,m.tag){case 3:Ie(m),Rr();break;case 5:if(Ge(m),m.mode&4&&S!==1&&it(m.type,M))return m.expirationTime=m.childExpirationTime=1,null;break;case 1:c0(m.type)&&wo(m);break;case 4:ve(m,m.stateNode.containerInfo);break;case 10:Ls(m,m.memoizedProps.value);break;case 13:if(m.memoizedState!==null)return O=m.child.childExpirationTime,O!==0&&O>=S?mt(v,m,S):(Fr(xe,xe.current&1,m),m=X0(v,m,S),m!==null?m.sibling:null);Fr(xe,xe.current&1,m);break;case 19:if(O=m.childExpirationTime>=S,(v.effectTag&64)!=0){if(O)return $t(v,m,S);m.effectTag|=64}if(M=m.memoizedState,M!==null&&(M.rendering=null,M.tail=null),Fr(xe,xe.current,m),!O)return null}return X0(v,m,S)}ai=!1}}else ai=!1;switch(m.expirationTime=0,m.tag){case 2:if(O=m.type,v!==null&&(v.alternate=null,m.alternate=null,m.effectTag|=2),v=m.pendingProps,M=Lu(m,H0.current),io(m,S),M=St(null,m,O,v,M,S),m.effectTag|=1,typeof M==\"object\"&&M!==null&&typeof M.render==\"function\"&&M.$$typeof===void 0){if(m.tag=1,Qt(),c0(O)){var b=!0;wo(m)}else b=!1;m.memoizedState=M.state!==null&&M.state!==void 0?M.state:null;var ee=O.getDerivedStateFromProps;typeof ee==\"function\"&&Go(m,O,ee,v),M.updater=Gu,m.stateNode=M,M._reactInternalFiber=m,Vu(m,O,v,S),m=Be(null,m,O,!0,b,S)}else m.tag=0,o0(null,m,M,S),m=m.child;return m;case 16:if(M=m.elementType,v!==null&&(v.alternate=null,m.alternate=null,m.effectTag|=2),v=m.pendingProps,Te(M),M._status!==1)throw M._result;switch(M=M._result,m.type=M,b=m.tag=Wa(M),v=I0(M,v),b){case 0:m=K0(null,m,M,v,S);break;case 1:m=ae(null,m,M,v,S);break;case 11:m=Vr(null,m,M,v,S);break;case 14:m=ff(null,m,M,I0(M.type,v),O,S);break;default:throw Error(t(306,M,\"\"))}return m;case 0:return O=m.type,M=m.pendingProps,M=m.elementType===O?M:I0(O,M),K0(v,m,O,M,S);case 1:return O=m.type,M=m.pendingProps,M=m.elementType===O?M:I0(O,M),ae(v,m,O,M,S);case 3:if(Ie(m),O=m.updateQueue,O===null)throw Error(t(282));if(M=m.memoizedState,M=M!==null?M.element:null,P0(m,O,m.pendingProps,null,S),O=m.memoizedState.element,O===M)Rr(),m=X0(v,m,S);else{if((M=m.stateNode.hydrate)&&(w?(Gr=al(m.stateNode.containerInfo),F0=m,M=ir=!0):M=!1),M)for(S=U(m,null,O,S),m.child=S;S;)S.effectTag=S.effectTag&-3|1024,S=S.sibling;else o0(v,m,O,S),Rr();m=m.child}return m;case 5:return Ge(m),v===null&&Co(m),O=m.type,M=m.pendingProps,b=v!==null?v.memoizedProps:null,ee=M.children,at(O,M)?ee=null:b!==null&&at(O,b)&&(m.effectTag|=16),$0(v,m),m.mode&4&&S!==1&&it(O,M)?(m.expirationTime=m.childExpirationTime=1,m=null):(o0(v,m,ee,S),m=m.child),m;case 6:return v===null&&Co(m),null;case 13:return mt(v,m,S);case 4:return ve(m,m.stateNode.containerInfo),O=m.pendingProps,v===null?m.child=R(m,null,O,S):o0(v,m,O,S),m.child;case 11:return O=m.type,M=m.pendingProps,M=m.elementType===O?M:I0(O,M),Vr(v,m,O,M,S);case 7:return o0(v,m,m.pendingProps,S),m.child;case 8:return o0(v,m,m.pendingProps.children,S),m.child;case 12:return o0(v,m,m.pendingProps.children,S),m.child;case 10:e:{if(O=m.type._context,M=m.pendingProps,ee=m.memoizedProps,b=M.value,Ls(m,b),ee!==null){var Ye=ee.value;if(b=Sn(Ye,b)?0:(typeof O._calculateChangedBits==\"function\"?O._calculateChangedBits(Ye,b):1073741823)|0,b===0){if(ee.children===M.children&&!b0.current){m=X0(v,m,S);break e}}else for(Ye=m.child,Ye!==null&&(Ye.return=m);Ye!==null;){var Ze=Ye.dependencies;if(Ze!==null){ee=Ye.child;for(var ut=Ze.firstContext;ut!==null;){if(ut.context===O&&(ut.observedBits&b)!=0){Ye.tag===1&&(ut=a0(S,null),ut.tag=2,V0(Ye,ut)),Ye.expirationTime<S&&(Ye.expirationTime=S),ut=Ye.alternate,ut!==null&&ut.expirationTime<S&&(ut.expirationTime=S),e0(Ye.return,S),Ze.expirationTime<S&&(Ze.expirationTime=S);break}ut=ut.next}}else ee=Ye.tag===10&&Ye.type===m.type?null:Ye.child;if(ee!==null)ee.return=Ye;else for(ee=Ye;ee!==null;){if(ee===m){ee=null;break}if(Ye=ee.sibling,Ye!==null){Ye.return=ee.return,ee=Ye;break}ee=ee.return}Ye=ee}}o0(v,m,M.children,S),m=m.child}return m;case 9:return M=m.type,b=m.pendingProps,O=b.children,io(m,S),M=D0(M,b.unstable_observedBits),O=O(M),m.effectTag|=1,o0(v,m,O,S),m.child;case 14:return M=m.type,b=I0(M,m.pendingProps),b=I0(M.type,b),ff(v,m,M,b,O,S);case 15:return cf(v,m,m.type,m.pendingProps,O,S);case 17:return O=m.type,M=m.pendingProps,M=m.elementType===O?M:I0(O,M),v!==null&&(v.alternate=null,m.alternate=null,m.effectTag|=2),m.tag=1,c0(O)?(v=!0,wo(m)):v=!1,io(m,S),cu(m,O,M,S),Vu(m,O,M,S),Be(null,m,O,!0,v,S);case 19:return $t(v,m,S)}throw Error(t(156,m.tag))};var Kf=null,Tl=null;function xl(v){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__==\"undefined\")return!1;var m=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(m.isDisabled||!m.supportsFiber)return!0;try{var S=m.inject(v);Kf=function(O){try{m.onCommitFiberRoot(S,O,void 0,(O.current.effectTag&64)==64)}catch(M){}},Tl=function(O){try{m.onCommitFiberUnmount(S,O)}catch(M){}}}catch(O){}return!0}function hf(v,m,S,O){this.tag=v,this.key=S,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=m,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=O,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function xo(v,m,S,O){return new hf(v,m,S,O)}function mf(v){return v=v.prototype,!(!v||!v.isReactComponent)}function Wa(v){if(typeof v==\"function\")return mf(v)?1:0;if(v!=null){if(v=v.$$typeof,v===ce)return 11;if(v===Se)return 14}return 2}function ti(v,m){var S=v.alternate;return S===null?(S=xo(v.tag,m,v.key,v.mode),S.elementType=v.elementType,S.type=v.type,S.stateNode=v.stateNode,S.alternate=v,v.alternate=S):(S.pendingProps=m,S.effectTag=0,S.nextEffect=null,S.firstEffect=null,S.lastEffect=null),S.childExpirationTime=v.childExpirationTime,S.expirationTime=v.expirationTime,S.child=v.child,S.memoizedProps=v.memoizedProps,S.memoizedState=v.memoizedState,S.updateQueue=v.updateQueue,m=v.dependencies,S.dependencies=m===null?null:{expirationTime:m.expirationTime,firstContext:m.firstContext,responders:m.responders},S.sibling=v.sibling,S.index=v.index,S.ref=v.ref,S}function Hs(v,m,S,O,M,b){var ee=2;if(O=v,typeof v==\"function\")mf(v)&&(ee=1);else if(typeof v==\"string\")ee=5;else e:switch(v){case L:return mi(S.children,M,b,m);case re:ee=8,M|=7;break;case N:ee=8,M|=1;break;case j:return v=xo(12,S,m,M|8),v.elementType=j,v.type=j,v.expirationTime=b,v;case Q:return v=xo(13,S,m,M),v.type=Q,v.elementType=Q,v.expirationTime=b,v;case oe:return v=xo(19,S,m,M),v.elementType=oe,v.expirationTime=b,v;default:if(typeof v==\"object\"&&v!==null)switch(v.$$typeof){case $:ee=10;break e;case h:ee=9;break e;case ce:ee=11;break e;case Se:ee=14;break e;case me:ee=16,O=null;break e}throw Error(t(130,v==null?v:typeof v,\"\"))}return m=xo(ee,S,m,M),m.elementType=v,m.type=O,m.expirationTime=b,m}function mi(v,m,S,O){return v=xo(7,v,O,m),v.expirationTime=S,v}function vi(v,m,S){return v=xo(6,v,null,m),v.expirationTime=S,v}function Xf(v,m,S){return m=xo(4,v.children!==null?v.children:[],v.key,m),m.expirationTime=S,m.stateNode={containerInfo:v.containerInfo,pendingChildren:null,implementation:v.implementation},m}function Rc(v,m,S){this.tag=m,this.current=null,this.containerInfo=v,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=Un,this.pendingContext=this.context=null,this.hydrate=S,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function Jf(v,m){var S=v.firstSuspendedTime;return v=v.lastSuspendedTime,S!==0&&S>=m&&v<=m}function ao(v,m){var S=v.firstSuspendedTime,O=v.lastSuspendedTime;S<m&&(v.firstSuspendedTime=m),(O>m||S===0)&&(v.lastSuspendedTime=m),m<=v.lastPingedTime&&(v.lastPingedTime=0),m<=v.lastExpiredTime&&(v.lastExpiredTime=0)}function $o(v,m){m>v.firstPendingTime&&(v.firstPendingTime=m);var S=v.firstSuspendedTime;S!==0&&(m>=S?v.firstSuspendedTime=v.lastSuspendedTime=v.nextKnownPendingLevel=0:m>=v.lastSuspendedTime&&(v.lastSuspendedTime=m+1),m>v.nextKnownPendingLevel&&(v.nextKnownPendingLevel=m))}function kl(v,m){var S=v.lastExpiredTime;(S===0||S>m)&&(v.lastExpiredTime=m)}function Nc(v){var m=v._reactInternalFiber;if(m===void 0)throw typeof v.render==\"function\"?Error(t(188)):Error(t(268,Object.keys(v)));return v=Ue(m),v===null?null:v.stateNode}function Al(v,m){v=v.memoizedState,v!==null&&v.dehydrated!==null&&v.retryTime<m&&(v.retryTime=m)}function vf(v,m){Al(v,m),(v=v.alternate)&&Al(v,m)}var Qf={createContainer:function(v,m,S){return v=new Rc(v,m,S),m=xo(3,null,null,m===2?7:m===1?3:0),v.current=m,m.stateNode=v},updateContainer:function(v,m,S,O){var M=m.current,b=g0(),ee=nr.suspense;b=Kr(b,M,ee);e:if(S){S=S._reactInternalFiber;t:{if(Le(S)!==S||S.tag!==1)throw Error(t(170));var Ye=S;do{switch(Ye.tag){case 3:Ye=Ye.stateNode.context;break t;case 1:if(c0(Ye.type)){Ye=Ye.stateNode.__reactInternalMemoizedMergedChildContext;break t}}Ye=Ye.return}while(Ye!==null);throw Error(t(171))}if(S.tag===1){var Ze=S.type;if(c0(Ze)){S=uu(S,Ze,Ye);break e}}S=Ye}else S=si;return m.context===null?m.context=S:m.pendingContext=S,m=a0(b,ee),m.payload={element:v},O=O===void 0?null:O,O!==null&&(m.callback=O),V0(M,m),_0(M,b),b},batchedEventUpdates:function(v,m){var S=Kt;Kt|=2;try{return v(m)}finally{Kt=S,Kt===Fn&&O0()}},batchedUpdates:function(v,m){var S=Kt;Kt|=1;try{return v(m)}finally{Kt=S,Kt===Fn&&O0()}},unbatchedUpdates:function(v,m){var S=Kt;Kt&=-2,Kt|=pi;try{return v(m)}finally{Kt=S,Kt===Fn&&O0()}},deferredUpdates:function(v){return zi(97,v)},syncUpdates:function(v,m,S,O){return zi(99,v.bind(null,m,S,O))},discreteUpdates:function(v,m,S,O){var M=Kt;Kt|=4;try{return zi(98,v.bind(null,m,S,O))}finally{Kt=M,Kt===Fn&&O0()}},flushDiscreteUpdates:function(){(Kt&(1|Br|zr))===Fn&&(Ba(),Ws())},flushControlled:function(v){var m=Kt;Kt|=1;try{zi(99,v)}finally{Kt=m,Kt===Fn&&O0()}},flushSync:Oc,flushPassiveEffects:Ws,IsThisRendererActing:{current:!1},getPublicRootInstance:function(v){if(v=v.current,!v.child)return null;switch(v.child.tag){case 5:return At(v.child.stateNode);default:return v.child.stateNode}},attemptSynchronousHydration:function(v){switch(v.tag){case 3:var m=v.stateNode;m.hydrate&&df(m,m.firstPendingTime);break;case 13:Oc(function(){return _0(v,1073741823)}),m=fu(g0(),150,100),vf(v,m)}},attemptUserBlockingHydration:function(v){if(v.tag===13){var m=fu(g0(),150,100);_0(v,m),vf(v,m)}},attemptContinuousHydration:function(v){if(v.tag===13){g0();var m=gl++;_0(v,m),vf(v,m)}},attemptHydrationAtCurrentPriority:function(v){if(v.tag===13){var m=g0();m=Kr(m,v,null),_0(v,m),vf(v,m)}},findHostInstance:Nc,findHostInstanceWithWarning:function(v){return Nc(v)},findHostInstanceWithNoPortals:function(v){return v=be(v),v===null?null:v.tag===20?v.stateNode.instance:v.stateNode},shouldSuspend:function(){return!1},injectIntoDevTools:function(v){var m=v.findFiberByHostInstance;return xl(f({},v,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(S){return S=Ue(S),S===null?null:S.stateNode},findFiberByHostInstance:function(S){return m?m(S):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))}};c2.exports=Qf.default||Qf;var k0=c2.exports;return c2.exports=i,k0}});var lE=Me((ab,sE)=>{\"use strict\";sE.exports=uE()});var cE=Me((db,fE)=>{\"use strict\";var gN={ALIGN_COUNT:8,ALIGN_AUTO:0,ALIGN_FLEX_START:1,ALIGN_CENTER:2,ALIGN_FLEX_END:3,ALIGN_STRETCH:4,ALIGN_BASELINE:5,ALIGN_SPACE_BETWEEN:6,ALIGN_SPACE_AROUND:7,DIMENSION_COUNT:2,DIMENSION_WIDTH:0,DIMENSION_HEIGHT:1,DIRECTION_COUNT:3,DIRECTION_INHERIT:0,DIRECTION_LTR:1,DIRECTION_RTL:2,DISPLAY_COUNT:2,DISPLAY_FLEX:0,DISPLAY_NONE:1,EDGE_COUNT:9,EDGE_LEFT:0,EDGE_TOP:1,EDGE_RIGHT:2,EDGE_BOTTOM:3,EDGE_START:4,EDGE_END:5,EDGE_HORIZONTAL:6,EDGE_VERTICAL:7,EDGE_ALL:8,EXPERIMENTAL_FEATURE_COUNT:1,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:0,FLEX_DIRECTION_COUNT:4,FLEX_DIRECTION_COLUMN:0,FLEX_DIRECTION_COLUMN_REVERSE:1,FLEX_DIRECTION_ROW:2,FLEX_DIRECTION_ROW_REVERSE:3,JUSTIFY_COUNT:6,JUSTIFY_FLEX_START:0,JUSTIFY_CENTER:1,JUSTIFY_FLEX_END:2,JUSTIFY_SPACE_BETWEEN:3,JUSTIFY_SPACE_AROUND:4,JUSTIFY_SPACE_EVENLY:5,LOG_LEVEL_COUNT:6,LOG_LEVEL_ERROR:0,LOG_LEVEL_WARN:1,LOG_LEVEL_INFO:2,LOG_LEVEL_DEBUG:3,LOG_LEVEL_VERBOSE:4,LOG_LEVEL_FATAL:5,MEASURE_MODE_COUNT:3,MEASURE_MODE_UNDEFINED:0,MEASURE_MODE_EXACTLY:1,MEASURE_MODE_AT_MOST:2,NODE_TYPE_COUNT:2,NODE_TYPE_DEFAULT:0,NODE_TYPE_TEXT:1,OVERFLOW_COUNT:3,OVERFLOW_VISIBLE:0,OVERFLOW_HIDDEN:1,OVERFLOW_SCROLL:2,POSITION_TYPE_COUNT:2,POSITION_TYPE_RELATIVE:0,POSITION_TYPE_ABSOLUTE:1,PRINT_OPTIONS_COUNT:3,PRINT_OPTIONS_LAYOUT:1,PRINT_OPTIONS_STYLE:2,PRINT_OPTIONS_CHILDREN:4,UNIT_COUNT:4,UNIT_UNDEFINED:0,UNIT_POINT:1,UNIT_PERCENT:2,UNIT_AUTO:3,WRAP_COUNT:3,WRAP_NO_WRAP:0,WRAP_WRAP:1,WRAP_WRAP_REVERSE:2};fE.exports=gN});var hE=Me((pb,aE)=>{\"use strict\";var _N=Object.assign||function(i){for(var u=1;u<arguments.length;u++){var f=arguments[u];for(var c in f)Object.prototype.hasOwnProperty.call(f,c)&&(i[c]=f[c])}return i},Ph=function(){function i(u,f){for(var c=0;c<f.length;c++){var g=f[c];g.enumerable=g.enumerable||!1,g.configurable=!0,\"value\"in g&&(g.writable=!0),Object.defineProperty(u,g.key,g)}}return function(u,f,c){return f&&i(u.prototype,f),c&&i(u,c),u}}();function Oy(i,u,f){return u in i?Object.defineProperty(i,u,{value:f,enumerable:!0,configurable:!0,writable:!0}):i[u]=f,i}function Iy(i,u){if(!(i instanceof u))throw new TypeError(\"Cannot call a class as a function\")}var ps=cE(),yN=function(){function i(u,f,c,g,t,C){Iy(this,i),this.left=u,this.right=f,this.top=c,this.bottom=g,this.width=t,this.height=C}return Ph(i,[{key:\"fromJS\",value:function(f){f(this.left,this.right,this.top,this.bottom,this.width,this.height)}},{key:\"toString\",value:function(){return\"<Layout#\"+this.left+\":\"+this.right+\";\"+this.top+\":\"+this.bottom+\";\"+this.width+\":\"+this.height+\">\"}}]),i}(),dE=function(){Ph(i,null,[{key:\"fromJS\",value:function(f){var c=f.width,g=f.height;return new i(c,g)}}]);function i(u,f){Iy(this,i),this.width=u,this.height=f}return Ph(i,[{key:\"fromJS\",value:function(f){f(this.width,this.height)}},{key:\"toString\",value:function(){return\"<Size#\"+this.width+\"x\"+this.height+\">\"}}]),i}(),pE=function(){function i(u,f){Iy(this,i),this.unit=u,this.value=f}return Ph(i,[{key:\"fromJS\",value:function(f){f(this.unit,this.value)}},{key:\"toString\",value:function(){switch(this.unit){case ps.UNIT_POINT:return String(this.value);case ps.UNIT_PERCENT:return this.value+\"%\";case ps.UNIT_AUTO:return\"auto\";default:return this.value+\"?\"}}},{key:\"valueOf\",value:function(){return this.value}}]),i}();aE.exports=function(i,u){function f(C,A,x){var D=C[A];C[A]=function(){for(var L=arguments.length,N=Array(L),j=0;j<L;j++)N[j]=arguments[j];return x.call.apply(x,[this,D].concat(N))}}for(var c=[\"setPosition\",\"setMargin\",\"setFlexBasis\",\"setWidth\",\"setHeight\",\"setMinWidth\",\"setMinHeight\",\"setMaxWidth\",\"setMaxHeight\",\"setPadding\"],g=function(){var A,x=c[t],D=(A={},Oy(A,ps.UNIT_POINT,u.Node.prototype[x]),Oy(A,ps.UNIT_PERCENT,u.Node.prototype[x+\"Percent\"]),Oy(A,ps.UNIT_AUTO,u.Node.prototype[x+\"Auto\"]),A);f(u.Node.prototype,x,function(L){for(var N=arguments.length,j=Array(N>1?N-1:0),$=1;$<N;$++)j[$-1]=arguments[$];var h=j.pop(),re=void 0,ce=void 0;if(h===\"auto\")re=ps.UNIT_AUTO,ce=void 0;else if(h instanceof pE)re=h.unit,ce=h.valueOf();else if(re=typeof h==\"string\"&&h.endsWith(\"%\")?ps.UNIT_PERCENT:ps.UNIT_POINT,ce=parseFloat(h),!Number.isNaN(h)&&Number.isNaN(ce))throw new Error(\"Invalid value \"+h+\" for \"+x);if(!D[re])throw new Error('Failed to execute \"'+x+`\": Unsupported unit '`+h+\"'\");if(ce!==void 0){var Q;return(Q=D[re]).call.apply(Q,[this].concat(j,[ce]))}else{var oe;return(oe=D[re]).call.apply(oe,[this].concat(j))}})},t=0;t<c.length;t++)g();return f(u.Config.prototype,\"free\",function(){u.Config.destroy(this)}),f(u.Node,\"create\",function(C,A){return A?u.Node.createWithConfig(A):u.Node.createDefault()}),f(u.Node.prototype,\"free\",function(){u.Node.destroy(this)}),f(u.Node.prototype,\"freeRecursive\",function(){for(var C=0,A=this.getChildCount();C<A;++C)this.getChild(0).freeRecursive();this.free()}),f(u.Node.prototype,\"setMeasureFunc\",function(C,A){return A?C.call(this,function(){return dE.fromJS(A.apply(void 0,arguments))}):this.unsetMeasureFunc()}),f(u.Node.prototype,\"calculateLayout\",function(C){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NaN,x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,D=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ps.DIRECTION_LTR;return C.call(this,A,x,D)}),_N({Config:u.Config,Node:u.Node,Layout:i(\"Layout\",yN),Size:i(\"Size\",dE),Value:i(\"Value\",pE),getInstanceCount:function(){return u.getInstanceCount.apply(u,arguments)}},ps)}});var mE=Me((exports,module)=>{(function(i,u){typeof define==\"function\"&&define.amd?define([],function(){return u}):typeof module==\"object\"&&module.exports?module.exports=u:(i.nbind=i.nbind||{}).init=u})(exports,function(Module,cb){typeof Module==\"function\"&&(cb=Module,Module={}),Module.onRuntimeInitialized=function(i,u){return function(){i&&i.apply(this,arguments);try{Module.ccall(\"nbind_init\")}catch(f){u(f);return}u(null,{bind:Module._nbind_value,reflect:Module.NBind.reflect,queryType:Module.NBind.queryType,toggleLightGC:Module.toggleLightGC,lib:Module})}}(Module.onRuntimeInitialized,cb);var Module;Module||(Module=(typeof Module!=\"undefined\"?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1;if(Module.ENVIRONMENT)if(Module.ENVIRONMENT===\"WEB\")ENVIRONMENT_IS_WEB=!0;else if(Module.ENVIRONMENT===\"WORKER\")ENVIRONMENT_IS_WORKER=!0;else if(Module.ENVIRONMENT===\"NODE\")ENVIRONMENT_IS_NODE=!0;else if(Module.ENVIRONMENT===\"SHELL\")ENVIRONMENT_IS_SHELL=!0;else throw new Error(\"The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.\");else ENVIRONMENT_IS_WEB=typeof window==\"object\",ENVIRONMENT_IS_WORKER=typeof importScripts==\"function\",ENVIRONMENT_IS_NODE=typeof process==\"object\"&&typeof require==\"function\"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){Module.print||(Module.print=console.log),Module.printErr||(Module.printErr=console.warn);var nodeFS,nodePath;Module.read=function(u,f){nodeFS||(nodeFS={}(\"\")),nodePath||(nodePath={}(\"\")),u=nodePath.normalize(u);var c=nodeFS.readFileSync(u);return f?c:c.toString()},Module.readBinary=function(u){var f=Module.read(u,!0);return f.buffer||(f=new Uint8Array(f)),assert(f.buffer),f},Module.load=function(u){globalEval(read(u))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\\\/g,\"/\"):Module.thisProgram=\"unknown-program\"),Module.arguments=process.argv.slice(2),typeof module!=\"undefined\"&&(module.exports=Module),Module.inspect=function(){return\"[Emscripten Module object]\"}}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),typeof printErr!=\"undefined\"&&(Module.printErr=printErr),typeof read!=\"undefined\"?Module.read=read:Module.read=function(){throw\"no read() available\"},Module.readBinary=function(u){if(typeof readbuffer==\"function\")return new Uint8Array(readbuffer(u));var f=read(u,\"binary\");return assert(typeof f==\"object\"),f},typeof scriptArgs!=\"undefined\"?Module.arguments=scriptArgs:typeof arguments!=\"undefined\"&&(Module.arguments=arguments),typeof quit==\"function\"&&(Module.quit=function(i,u){quit(i)});else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(Module.read=function(u){var f=new XMLHttpRequest;return f.open(\"GET\",u,!1),f.send(null),f.responseText},ENVIRONMENT_IS_WORKER&&(Module.readBinary=function(u){var f=new XMLHttpRequest;return f.open(\"GET\",u,!1),f.responseType=\"arraybuffer\",f.send(null),new Uint8Array(f.response)}),Module.readAsync=function(u,f,c){var g=new XMLHttpRequest;g.open(\"GET\",u,!0),g.responseType=\"arraybuffer\",g.onload=function(){g.status==200||g.status==0&&g.response?f(g.response):c()},g.onerror=c,g.send(null)},typeof arguments!=\"undefined\"&&(Module.arguments=arguments),typeof console!=\"undefined\")Module.print||(Module.print=function(u){console.log(u)}),Module.printErr||(Module.printErr=function(u){console.warn(u)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&typeof dump!=\"undefined\"?function(i){dump(i)}:function(i){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),typeof Module.setWindowTitle==\"undefined\"&&(Module.setWindowTitle=function(i){document.title=i})}else throw\"Unknown runtime environment. Where are we?\";function globalEval(i){eval.call(null,i)}!Module.load&&Module.read&&(Module.load=function(u){globalEval(Module.read(u))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram=\"./this.program\"),Module.quit||(Module.quit=function(i,u){throw u}),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[];for(var key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);moduleOverrides=void 0;var Runtime={setTempRet0:function(i){return tempRet0=i,i},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(i){STACKTOP=i},getNativeTypeSize:function(i){switch(i){case\"i1\":case\"i8\":return 1;case\"i16\":return 2;case\"i32\":return 4;case\"i64\":return 8;case\"float\":return 4;case\"double\":return 8;default:{if(i[i.length-1]===\"*\")return Runtime.QUANTUM_SIZE;if(i[0]===\"i\"){var u=parseInt(i.substr(1));return assert(u%8==0),u/8}else return 0}}},getNativeFieldSize:function(i){return Math.max(Runtime.getNativeTypeSize(i),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(i,u){return u===\"double\"||u===\"i64\"?i&7&&(assert((i&7)==4),i+=4):assert((i&3)==0),i},getAlignSize:function(i,u,f){return!f&&(i==\"i64\"||i==\"double\")?8:i?Math.min(u||(i?Runtime.getNativeFieldSize(i):0),Runtime.QUANTUM_SIZE):Math.min(u,8)},dynCall:function(i,u,f){return f&&f.length?Module[\"dynCall_\"+i].apply(null,[u].concat(f)):Module[\"dynCall_\"+i].call(null,u)},functionPointers:[],addFunction:function(i){for(var u=0;u<Runtime.functionPointers.length;u++)if(!Runtime.functionPointers[u])return Runtime.functionPointers[u]=i,2*(1+u);throw\"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.\"},removeFunction:function(i){Runtime.functionPointers[(i-2)/2]=null},warnOnce:function(i){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[i]||(Runtime.warnOnce.shown[i]=1,Module.printErr(i))},funcWrappers:{},getFuncWrapper:function(i,u){if(!!i){assert(u),Runtime.funcWrappers[u]||(Runtime.funcWrappers[u]={});var f=Runtime.funcWrappers[u];return f[i]||(u.length===1?f[i]=function(){return Runtime.dynCall(u,i)}:u.length===2?f[i]=function(g){return Runtime.dynCall(u,i,[g])}:f[i]=function(){return Runtime.dynCall(u,i,Array.prototype.slice.call(arguments))}),f[i]}},getCompilerSetting:function(i){throw\"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work\"},stackAlloc:function(i){var u=STACKTOP;return STACKTOP=STACKTOP+i|0,STACKTOP=STACKTOP+15&-16,u},staticAlloc:function(i){var u=STATICTOP;return STATICTOP=STATICTOP+i|0,STATICTOP=STATICTOP+15&-16,u},dynamicAlloc:function(i){var u=HEAP32[DYNAMICTOP_PTR>>2],f=(u+i+15|0)&-16;if(HEAP32[DYNAMICTOP_PTR>>2]=f,f>=TOTAL_MEMORY){var c=enlargeMemory();if(!c)return HEAP32[DYNAMICTOP_PTR>>2]=u,0}return u},alignMemory:function(i,u){var f=i=Math.ceil(i/(u||16))*(u||16);return f},makeBigInt:function(i,u,f){var c=f?+(i>>>0)+ +(u>>>0)*4294967296:+(i>>>0)+ +(u|0)*4294967296;return c},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=0,EXITSTATUS=0;function assert(i,u){i||abort(\"Assertion failed: \"+u)}function getCFunc(ident){var func=Module[\"_\"+ident];if(!func)try{func=eval(\"_\"+ident)}catch(i){}return assert(func,\"Cannot call unknown function \"+ident+\" (perhaps LLVM optimizations or closure removed it?)\"),func}var cwrap,ccall;(function(){var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(i){var u=Runtime.stackAlloc(i.length);return writeArrayToMemory(i,u),u},stringToC:function(i){var u=0;if(i!=null&&i!==0){var f=(i.length<<2)+1;u=Runtime.stackAlloc(f),stringToUTF8(i,u,f)}return u}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(u,f,c,g,t){var C=getCFunc(u),A=[],x=0;if(g)for(var D=0;D<g.length;D++){var L=toC[c[D]];L?(x===0&&(x=Runtime.stackSave()),A[D]=L(g[D])):A[D]=g[D]}var N=C.apply(null,A);if(f===\"string\"&&(N=Pointer_stringify(N)),x!==0){if(t&&t.async){EmterpreterAsync.asyncFinalizers.push(function(){Runtime.stackRestore(x)});return}Runtime.stackRestore(x)}return N};var sourceRegex=/^function\\s*[a-zA-Z$_0-9]*\\s*\\(([^)]*)\\)\\s*{\\s*([^*]*?)[\\s;]*(?:return\\s*(.*?)[;\\s]*)?}$/;function parseJSFunc(i){var u=i.toString().match(sourceRegex).slice(1);return{arguments:u[0],body:u[1],returnValue:u[2]}}var JSsource=null;function ensureJSsource(){if(!JSsource){JSsource={};for(var i in JSfuncs)JSfuncs.hasOwnProperty(i)&&(JSsource[i]=parseJSFunc(JSfuncs[i]))}}cwrap=function(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every(function(i){return i===\"number\"}),numericRet=returnType!==\"string\";if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map(function(i,u){return\"$\"+u}),funcstr=\"(function(\"+argNames.join(\",\")+\") {\",nargs=argTypes.length;if(!numericArgs){ensureJSsource(),funcstr+=\"var stack = \"+JSsource.stackSave.body+\";\";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if(type!==\"number\"){var convertCode=JSsource[type+\"ToC\"];funcstr+=\"var \"+convertCode.arguments+\" = \"+arg+\";\",funcstr+=convertCode.body+\";\",funcstr+=arg+\"=(\"+convertCode.returnValue+\");\"}}}var cfuncname=parseJSFunc(function(){return cfunc}).returnValue;if(funcstr+=\"var ret = \"+cfuncname+\"(\"+argNames.join(\",\")+\");\",!numericRet){var strgfy=parseJSFunc(function(){return Pointer_stringify}).returnValue;funcstr+=\"ret = \"+strgfy+\"(ret);\"}return numericArgs||(ensureJSsource(),funcstr+=JSsource.stackRestore.body.replace(\"()\",\"(stack)\")+\";\"),funcstr+=\"return ret})\",eval(funcstr)}})(),Module.ccall=ccall,Module.cwrap=cwrap;function setValue(i,u,f,c){switch(f=f||\"i8\",f.charAt(f.length-1)===\"*\"&&(f=\"i32\"),f){case\"i1\":HEAP8[i>>0]=u;break;case\"i8\":HEAP8[i>>0]=u;break;case\"i16\":HEAP16[i>>1]=u;break;case\"i32\":HEAP32[i>>2]=u;break;case\"i64\":tempI64=[u>>>0,(tempDouble=u,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[i>>2]=tempI64[0],HEAP32[i+4>>2]=tempI64[1];break;case\"float\":HEAPF32[i>>2]=u;break;case\"double\":HEAPF64[i>>3]=u;break;default:abort(\"invalid type for setValue: \"+f)}}Module.setValue=setValue;function getValue(i,u,f){switch(u=u||\"i8\",u.charAt(u.length-1)===\"*\"&&(u=\"i32\"),u){case\"i1\":return HEAP8[i>>0];case\"i8\":return HEAP8[i>>0];case\"i16\":return HEAP16[i>>1];case\"i32\":return HEAP32[i>>2];case\"i64\":return HEAP32[i>>2];case\"float\":return HEAPF32[i>>2];case\"double\":return HEAPF64[i>>3];default:abort(\"invalid type for setValue: \"+u)}return null}Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE;function allocate(i,u,f,c){var g,t;typeof i==\"number\"?(g=!0,t=i):(g=!1,t=i.length);var C=typeof u==\"string\"?u:null,A;if(f==ALLOC_NONE?A=c:A=[typeof _malloc==\"function\"?_malloc:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][f===void 0?ALLOC_STATIC:f](Math.max(t,C?1:u.length)),g){var c=A,x;for(assert((A&3)==0),x=A+(t&~3);c<x;c+=4)HEAP32[c>>2]=0;for(x=A+t;c<x;)HEAP8[c++>>0]=0;return A}if(C===\"i8\")return i.subarray||i.slice?HEAPU8.set(i,A):HEAPU8.set(new Uint8Array(i),A),A;for(var D=0,L,N,j;D<t;){var $=i[D];if(typeof $==\"function\"&&($=Runtime.getFunctionIndex($)),L=C||u[D],L===0){D++;continue}L==\"i64\"&&(L=\"i32\"),setValue(A+D,$,L),j!==L&&(N=Runtime.getNativeTypeSize(L),j=L),D+=N}return A}Module.allocate=allocate;function getMemory(i){return staticSealed?runtimeInitialized?_malloc(i):Runtime.dynamicAlloc(i):Runtime.staticAlloc(i)}Module.getMemory=getMemory;function Pointer_stringify(i,u){if(u===0||!i)return\"\";for(var f=0,c,g=0;c=HEAPU8[i+g>>0],f|=c,!(c==0&&!u||(g++,u&&g==u)););u||(u=g);var t=\"\";if(f<128){for(var C=1024,A;u>0;)A=String.fromCharCode.apply(String,HEAPU8.subarray(i,i+Math.min(u,C))),t=t?t+A:A,i+=C,u-=C;return t}return Module.UTF8ToString(i)}Module.Pointer_stringify=Pointer_stringify;function AsciiToString(i){for(var u=\"\";;){var f=HEAP8[i++>>0];if(!f)return u;u+=String.fromCharCode(f)}}Module.AsciiToString=AsciiToString;function stringToAscii(i,u){return writeAsciiToMemory(i,u,!1)}Module.stringToAscii=stringToAscii;var UTF8Decoder=typeof TextDecoder!=\"undefined\"?new TextDecoder(\"utf8\"):void 0;function UTF8ArrayToString(i,u){for(var f=u;i[f];)++f;if(f-u>16&&i.subarray&&UTF8Decoder)return UTF8Decoder.decode(i.subarray(u,f));for(var c,g,t,C,A,x,D=\"\";;){if(c=i[u++],!c)return D;if(!(c&128)){D+=String.fromCharCode(c);continue}if(g=i[u++]&63,(c&224)==192){D+=String.fromCharCode((c&31)<<6|g);continue}if(t=i[u++]&63,(c&240)==224?c=(c&15)<<12|g<<6|t:(C=i[u++]&63,(c&248)==240?c=(c&7)<<18|g<<12|t<<6|C:(A=i[u++]&63,(c&252)==248?c=(c&3)<<24|g<<18|t<<12|C<<6|A:(x=i[u++]&63,c=(c&1)<<30|g<<24|t<<18|C<<12|A<<6|x))),c<65536)D+=String.fromCharCode(c);else{var L=c-65536;D+=String.fromCharCode(55296|L>>10,56320|L&1023)}}}Module.UTF8ArrayToString=UTF8ArrayToString;function UTF8ToString(i){return UTF8ArrayToString(HEAPU8,i)}Module.UTF8ToString=UTF8ToString;function stringToUTF8Array(i,u,f,c){if(!(c>0))return 0;for(var g=f,t=f+c-1,C=0;C<i.length;++C){var A=i.charCodeAt(C);if(A>=55296&&A<=57343&&(A=65536+((A&1023)<<10)|i.charCodeAt(++C)&1023),A<=127){if(f>=t)break;u[f++]=A}else if(A<=2047){if(f+1>=t)break;u[f++]=192|A>>6,u[f++]=128|A&63}else if(A<=65535){if(f+2>=t)break;u[f++]=224|A>>12,u[f++]=128|A>>6&63,u[f++]=128|A&63}else if(A<=2097151){if(f+3>=t)break;u[f++]=240|A>>18,u[f++]=128|A>>12&63,u[f++]=128|A>>6&63,u[f++]=128|A&63}else if(A<=67108863){if(f+4>=t)break;u[f++]=248|A>>24,u[f++]=128|A>>18&63,u[f++]=128|A>>12&63,u[f++]=128|A>>6&63,u[f++]=128|A&63}else{if(f+5>=t)break;u[f++]=252|A>>30,u[f++]=128|A>>24&63,u[f++]=128|A>>18&63,u[f++]=128|A>>12&63,u[f++]=128|A>>6&63,u[f++]=128|A&63}}return u[f]=0,f-g}Module.stringToUTF8Array=stringToUTF8Array;function stringToUTF8(i,u,f){return stringToUTF8Array(i,HEAPU8,u,f)}Module.stringToUTF8=stringToUTF8;function lengthBytesUTF8(i){for(var u=0,f=0;f<i.length;++f){var c=i.charCodeAt(f);c>=55296&&c<=57343&&(c=65536+((c&1023)<<10)|i.charCodeAt(++f)&1023),c<=127?++u:c<=2047?u+=2:c<=65535?u+=3:c<=2097151?u+=4:c<=67108863?u+=5:u+=6}return u}Module.lengthBytesUTF8=lengthBytesUTF8;var UTF16Decoder=typeof TextDecoder!=\"undefined\"?new TextDecoder(\"utf-16le\"):void 0;function demangle(i){var u=Module.___cxa_demangle||Module.__cxa_demangle;if(u){try{var f=i.substr(1),c=lengthBytesUTF8(f)+1,g=_malloc(c);stringToUTF8(f,g,c);var t=_malloc(4),C=u(g,0,0,t);if(getValue(t,\"i32\")===0&&C)return Pointer_stringify(C)}catch(A){}finally{g&&_free(g),t&&_free(t),C&&_free(C)}return i}return Runtime.warnOnce(\"warning: build with  -s DEMANGLE_SUPPORT=1  to link in libcxxabi demangling\"),i}function demangleAll(i){var u=/__Z[\\w\\d_]+/g;return i.replace(u,function(f){var c=demangle(f);return f===c?f:f+\" [\"+c+\"]\"})}function jsStackTrace(){var i=new Error;if(!i.stack){try{throw new Error(0)}catch(u){i=u}if(!i.stack)return\"(no stack trace available)\"}return i.stack.toString()}function stackTrace(){var i=jsStackTrace();return Module.extraStackTrace&&(i+=`\n`+Module.extraStackTrace()),demangleAll(i)}Module.stackTrace=stackTrace;var HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1;function abortOnCannotGrowMemory(){abort(\"Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value \"+TOTAL_MEMORY+\", (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 \")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||134217728;TOTAL_MEMORY<TOTAL_STACK&&Module.printErr(\"TOTAL_MEMORY should be larger than TOTAL_STACK, was \"+TOTAL_MEMORY+\"! (TOTAL_STACK=\"+TOTAL_STACK+\")\"),Module.buffer?buffer=Module.buffer:buffer=new ArrayBuffer(TOTAL_MEMORY),updateGlobalBufferViews();function getTotalMemory(){return TOTAL_MEMORY}if(HEAP32[0]=1668509029,HEAP16[1]=25459,HEAPU8[2]!==115||HEAPU8[3]!==99)throw\"Runtime error: expected the system to be little-endian!\";Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;function callRuntimeCallbacks(i){for(;i.length>0;){var u=i.shift();if(typeof u==\"function\"){u();continue}var f=u.func;typeof f==\"number\"?u.arg===void 0?Module.dynCall_v(f):Module.dynCall_vi(f,u.arg):f(u.arg===void 0?null:u.arg)}}var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun==\"function\"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for(typeof Module.postRun==\"function\"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(i){__ATPRERUN__.unshift(i)}Module.addOnPreRun=addOnPreRun;function addOnInit(i){__ATINIT__.unshift(i)}Module.addOnInit=addOnInit;function addOnPreMain(i){__ATMAIN__.unshift(i)}Module.addOnPreMain=addOnPreMain;function addOnExit(i){__ATEXIT__.unshift(i)}Module.addOnExit=addOnExit;function addOnPostRun(i){__ATPOSTRUN__.unshift(i)}Module.addOnPostRun=addOnPostRun;function intArrayFromString(i,u,f){var c=f>0?f:lengthBytesUTF8(i)+1,g=new Array(c),t=stringToUTF8Array(i,g,0,g.length);return u&&(g.length=t),g}Module.intArrayFromString=intArrayFromString;function intArrayToString(i){for(var u=[],f=0;f<i.length;f++){var c=i[f];c>255&&(c&=255),u.push(String.fromCharCode(c))}return u.join(\"\")}Module.intArrayToString=intArrayToString;function writeStringToMemory(i,u,f){Runtime.warnOnce(\"writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!\");var c,g;f&&(g=u+lengthBytesUTF8(i),c=HEAP8[g]),stringToUTF8(i,u,Infinity),f&&(HEAP8[g]=c)}Module.writeStringToMemory=writeStringToMemory;function writeArrayToMemory(i,u){HEAP8.set(i,u)}Module.writeArrayToMemory=writeArrayToMemory;function writeAsciiToMemory(i,u,f){for(var c=0;c<i.length;++c)HEAP8[u++>>0]=i.charCodeAt(c);f||(HEAP8[u>>0]=0)}if(Module.writeAsciiToMemory=writeAsciiToMemory,(!Math.imul||Math.imul(4294967295,5)!==-5)&&(Math.imul=function(u,f){var c=u>>>16,g=u&65535,t=f>>>16,C=f&65535;return g*C+(c*C+g*t<<16)|0}),Math.imul=Math.imul,!Math.fround){var froundBuffer=new Float32Array(1);Math.fround=function(i){return froundBuffer[0]=i,froundBuffer[0]}}Math.fround=Math.fround,Math.clz32||(Math.clz32=function(i){i=i>>>0;for(var u=0;u<32;u++)if(i&1<<31-u)return u;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(i){return i<0?Math.ceil(i):Math.floor(i)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_round=Math.round,Math_min=Math.min,Math_clz32=Math.clz32,Math_trunc=Math.trunc,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(i){return i}function addRunDependency(i){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}Module.addRunDependency=addRunDependency;function removeRunDependency(i){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var u=dependenciesFulfilled;dependenciesFulfilled=null,u()}}Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var ASM_CONSTS=[function(i,u,f,c,g,t,C,A){return _nbind.callbackSignatureList[i].apply(this,arguments)}];function _emscripten_asm_const_iiiiiiii(i,u,f,c,g,t,C,A){return ASM_CONSTS[i](u,f,c,g,t,C,A)}function _emscripten_asm_const_iiiii(i,u,f,c,g){return ASM_CONSTS[i](u,f,c,g)}function _emscripten_asm_const_iiidddddd(i,u,f,c,g,t,C,A,x){return ASM_CONSTS[i](u,f,c,g,t,C,A,x)}function _emscripten_asm_const_iiididi(i,u,f,c,g,t,C){return ASM_CONSTS[i](u,f,c,g,t,C)}function _emscripten_asm_const_iiii(i,u,f,c){return ASM_CONSTS[i](u,f,c)}function _emscripten_asm_const_iiiid(i,u,f,c,g){return ASM_CONSTS[i](u,f,c,g)}function _emscripten_asm_const_iiiiii(i,u,f,c,g,t){return ASM_CONSTS[i](u,f,c,g,t)}STATIC_BASE=Runtime.GLOBAL_BASE,STATICTOP=STATIC_BASE+12800,__ATINIT__.push({func:function(){__GLOBAL__sub_I_Yoga_cpp()}},{func:function(){__GLOBAL__sub_I_nbind_cc()}},{func:function(){__GLOBAL__sub_I_common_cc()}},{func:function(){__GLOBAL__sub_I_Binding_cc()}}),allocate([0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,192,127,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,128,191,0,0,128,191,0,0,192,127,0,0,0,0,0,0,0,0,0,0,128,63,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,190,12,0,0,200,12,0,0,208,12,0,0,216,12,0,0,230,12,0,0,242,12,0,0,1,0,0,0,3,0,0,0,0,0,0,0,2,0,0,0,0,0,192,127,3,0,0,0,180,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,182,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,1,0,0,0,4,0,0,0,183,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,184,45,0,0,185,45,0,0,181,45,0,0,181,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,148,4,0,0,3,0,0,0,187,45,0,0,164,4,0,0,188,45,0,0,2,0,0,0,189,45,0,0,164,4,0,0,188,45,0,0,185,45,0,0,164,4,0,0,185,45,0,0,164,4,0,0,188,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,5,0,0,0,6,0,0,0,1,0,0,0,7,0,0,0,183,45,0,0,182,45,0,0,181,45,0,0,190,45,0,0,190,45,0,0,182,45,0,0,182,45,0,0,185,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,185,45,0,0,48,5,0,0,3,0,0,0,56,5,0,0,1,0,0,0,189,45,0,0,185,45,0,0,164,4,0,0,76,5,0,0,2,0,0,0,191,45,0,0,186,45,0,0,182,45,0,0,185,45,0,0,192,45,0,0,185,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,76,5,0,0,76,5,0,0,136,5,0,0,182,45,0,0,181,45,0,0,2,0,0,0,190,45,0,0,136,5,0,0,56,19,0,0,156,5,0,0,2,0,0,0,184,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,8,0,0,0,9,0,0,0,1,0,0,0,10,0,0,0,204,5,0,0,181,45,0,0,181,45,0,0,2,0,0,0,180,45,0,0,204,5,0,0,2,0,0,0,195,45,0,0,236,5,0,0,97,19,0,0,198,45,0,0,211,45,0,0,212,45,0,0,213,45,0,0,214,45,0,0,215,45,0,0,188,45,0,0,182,45,0,0,216,45,0,0,217,45,0,0,218,45,0,0,219,45,0,0,192,45,0,0,181,45,0,0,0,0,0,0,185,45,0,0,110,19,0,0,186,45,0,0,115,19,0,0,221,45,0,0,120,19,0,0,148,4,0,0,132,19,0,0,96,6,0,0,145,19,0,0,222,45,0,0,164,19,0,0,223,45,0,0,173,19,0,0,0,0,0,0,3,0,0,0,104,6,0,0,1,0,0,0,187,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,11,0,0,0,12,0,0,0,1,0,0,0,13,0,0,0,185,45,0,0,224,45,0,0,164,6,0,0,188,45,0,0,172,6,0,0,180,6,0,0,2,0,0,0,188,6,0,0,7,0,0,0,224,45,0,0,7,0,0,0,164,6,0,0,1,0,0,0,213,45,0,0,185,45,0,0,224,45,0,0,172,6,0,0,185,45,0,0,224,45,0,0,164,6,0,0,185,45,0,0,224,45,0,0,211,45,0,0,211,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,172,6,0,0,222,45,0,0,211,45,0,0,224,45,0,0,188,45,0,0,222,45,0,0,211,45,0,0,40,7,0,0,188,45,0,0,2,0,0,0,224,45,0,0,185,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,222,45,0,0,224,45,0,0,148,4,0,0,185,45,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,185,45,0,0,164,6,0,0,148,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,14,0,0,0,15,0,0,0,1,0,0,0,16,0,0,0,148,7,0,0,2,0,0,0,225,45,0,0,183,45,0,0,188,45,0,0,168,7,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,234,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,148,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,9,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,242,45,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,110,111,100,101,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,119,104,105,99,104,32,115,116,105,108,108,32,104,97,115,32,99,104,105,108,100,114,101,110,32,97,116,116,97,99,104,101,100,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,115,116,105,108,108,32,97,116,116,97,99,104,101,100,32,116,111,32,97,32,112,97,114,101,110,116,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,99,111,110,102,105,103,0,67,97,110,110,111,116,32,115,101,116,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,67,104,105,108,100,32,97,108,114,101,97,100,121,32,104,97,115,32,97,32,112,97,114,101,110,116,44,32,105,116,32,109,117,115,116,32,98,101,32,114,101,109,111,118,101,100,32,102,105,114,115,116,46,0,67,97,110,110,111,116,32,97,100,100,32,99,104,105,108,100,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,79,110,108,121,32,108,101,97,102,32,110,111,100,101,115,32,119,105,116,104,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,115,104,111,117,108,100,32,109,97,110,117,97,108,108,121,32,109,97,114,107,32,116,104,101,109,115,101,108,118,101,115,32,97,115,32,100,105,114,116,121,0,67,97,110,110,111,116,32,103,101,116,32,108,97,121,111,117,116,32,112,114,111,112,101,114,116,105,101,115,32,111,102,32,109,117,108,116,105,45,101,100,103,101,32,115,104,111,114,116,104,97,110,100,115,0,37,115,37,100,46,123,91,115,107,105,112,112,101,100,93,32,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,61,62,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,37,115,37,100,46,123,37,115,0,42,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,37,115,10,0,37,115,37,100,46,125,37,115,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,79,117,116,32,111,102,32,99,97,99,104,101,32,101,110,116,114,105,101,115,33,10,0,83,99,97,108,101,32,102,97,99,116,111,114,32,115,104,111,117,108,100,32,110,111,116,32,98,101,32,108,101,115,115,32,116,104,97,110,32,122,101,114,111,0,105,110,105,116,105,97,108,0,37,115,10,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,85,78,68,69,70,73,78,69,68,0,69,88,65,67,84,76,89,0,65,84,95,77,79,83,84,0,76,65,89,95,85,78,68,69,70,73,78,69,68,0,76,65,89,95,69,88,65,67,84,76,89,0,76,65,89,95,65,84,95,77,79,83,84,0,97,118,97,105,108,97,98,108,101,87,105,100,116,104,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,119,105,100,116,104,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,97,118,97,105,108,97,98,108,101,72,101,105,103,104,116,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,104,101,105,103,104,116,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,102,108,101,120,0,115,116,114,101,116,99,104,0,109,117,108,116,105,108,105,110,101,45,115,116,114,101,116,99,104,0,69,120,112,101,99,116,101,100,32,110,111,100,101,32,116,111,32,104,97,118,101,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,0,109,101,97,115,117,114,101,0,69,120,112,101,99,116,32,99,117,115,116,111,109,32,98,97,115,101,108,105,110,101,32,102,117,110,99,116,105,111,110,32,116,111,32,110,111,116,32,114,101,116,117,114,110,32,78,97,78,0,97,98,115,45,109,101,97,115,117,114,101,0,97,98,115,45,108,97,121,111,117,116,0,78,111,100,101,0,99,114,101,97,116,101,68,101,102,97,117,108,116,0,99,114,101,97,116,101,87,105,116,104,67,111,110,102,105,103,0,100,101,115,116,114,111,121,0,114,101,115,101,116,0,99,111,112,121,83,116,121,108,101,0,115,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,115,101,116,80,111,115,105,116,105,111,110,0,115,101,116,80,111,115,105,116,105,111,110,80,101,114,99,101,110,116,0,115,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,115,101,116,65,108,105,103,110,73,116,101,109,115,0,115,101,116,65,108,105,103,110,83,101,108,102,0,115,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,115,101,116,70,108,101,120,87,114,97,112,0,115,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,115,101,116,77,97,114,103,105,110,0,115,101,116,77,97,114,103,105,110,80,101,114,99,101,110,116,0,115,101,116,77,97,114,103,105,110,65,117,116,111,0,115,101,116,79,118,101,114,102,108,111,119,0,115,101,116,68,105,115,112,108,97,121,0,115,101,116,70,108,101,120,0,115,101,116,70,108,101,120,66,97,115,105,115,0,115,101,116,70,108,101,120,66,97,115,105,115,80,101,114,99,101,110,116,0,115,101,116,70,108,101,120,71,114,111,119,0,115,101,116,70,108,101,120,83,104,114,105,110,107,0,115,101,116,87,105,100,116,104,0,115,101,116,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,87,105,100,116,104,65,117,116,111,0,115,101,116,72,101,105,103,104,116,0,115,101,116,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,72,101,105,103,104,116,65,117,116,111,0,115,101,116,77,105,110,87,105,100,116,104,0,115,101,116,77,105,110,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,105,110,72,101,105,103,104,116,0,115,101,116,77,105,110,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,77,97,120,87,105,100,116,104,0,115,101,116,77,97,120,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,97,120,72,101,105,103,104,116,0,115,101,116,77,97,120,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,65,115,112,101,99,116,82,97,116,105,111,0,115,101,116,66,111,114,100,101,114,0,115,101,116,80,97,100,100,105,110,103,0,115,101,116,80,97,100,100,105,110,103,80,101,114,99,101,110,116,0,103,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,103,101,116,80,111,115,105,116,105,111,110,0,103,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,103,101,116,65,108,105,103,110,73,116,101,109,115,0,103,101,116,65,108,105,103,110,83,101,108,102,0,103,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,103,101,116,70,108,101,120,87,114,97,112,0,103,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,103,101,116,77,97,114,103,105,110,0,103,101,116,70,108,101,120,66,97,115,105,115,0,103,101,116,70,108,101,120,71,114,111,119,0,103,101,116,70,108,101,120,83,104,114,105,110,107,0,103,101,116,87,105,100,116,104,0,103,101,116,72,101,105,103,104,116,0,103,101,116,77,105,110,87,105,100,116,104,0,103,101,116,77,105,110,72,101,105,103,104,116,0,103,101,116,77,97,120,87,105,100,116,104,0,103,101,116,77,97,120,72,101,105,103,104,116,0,103,101,116,65,115,112,101,99,116,82,97,116,105,111,0,103,101,116,66,111,114,100,101,114,0,103,101,116,79,118,101,114,102,108,111,119,0,103,101,116,68,105,115,112,108,97,121,0,103,101,116,80,97,100,100,105,110,103,0,105,110,115,101,114,116,67,104,105,108,100,0,114,101,109,111,118,101,67,104,105,108,100,0,103,101,116,67,104,105,108,100,67,111,117,110,116,0,103,101,116,80,97,114,101,110,116,0,103,101,116,67,104,105,108,100,0,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,117,110,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,109,97,114,107,68,105,114,116,121,0,105,115,68,105,114,116,121,0,99,97,108,99,117,108,97,116,101,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,76,101,102,116,0,103,101,116,67,111,109,112,117,116,101,100,82,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,84,111,112,0,103,101,116,67,111,109,112,117,116,101,100,66,111,116,116,111,109,0,103,101,116,67,111,109,112,117,116,101,100,87,105,100,116,104,0,103,101,116,67,111,109,112,117,116,101,100,72,101,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,77,97,114,103,105,110,0,103,101,116,67,111,109,112,117,116,101,100,66,111,114,100,101,114,0,103,101,116,67,111,109,112,117,116,101,100,80,97,100,100,105,110,103,0,67,111,110,102,105,103,0,99,114,101,97,116,101,0,115,101,116,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,115,101,116,80,111,105,110,116,83,99,97,108,101,70,97,99,116,111,114,0,105,115,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,86,97,108,117,101,0,76,97,121,111,117,116,0,83,105,122,101,0,103,101,116,73,110,115,116,97,110,99,101,67,111,117,110,116,0,73,110,116,54,52,0,1,1,1,2,2,4,4,4,4,8,8,4,8,118,111,105,100,0,98,111,111,108,0,115,116,100,58,58,115,116,114,105,110,103,0,99,98,70,117,110,99,116,105,111,110,32,38,0,99,111,110,115,116,32,99,98,70,117,110,99,116,105,111,110,32,38,0,69,120,116,101,114,110,97,108,0,66,117,102,102,101,114,0,78,66,105,110,100,73,68,0,78,66,105,110,100,0,98,105,110,100,95,118,97,108,117,101,0,114,101,102,108,101,99,116,0,113,117,101,114,121,84,121,112,101,0,108,97,108,108,111,99,0,108,114,101,115,101,116,0,123,114,101,116,117,114,110,40,95,110,98,105,110,100,46,99,97,108,108,98,97,99,107,83,105,103,110,97,116,117,114,101,76,105,115,116,91,36,48,93,46,97,112,112,108,121,40,116,104,105,115,44,97,114,103,117,109,101,110,116,115,41,41,59,125,0,95,110,98,105,110,100,95,110,101,119,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,46,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0],\"i8\",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=STATICTOP;STATICTOP+=16;function _atexit(i,u){__ATEXIT__.unshift({func:i,arg:u})}function ___cxa_atexit(){return _atexit.apply(null,arguments)}function _abort(){Module.abort()}function __ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj(){Module.printErr(\"missing function: _ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj\"),abort(-1)}function __decorate(i,u,f,c){var g=arguments.length,t=g<3?u:c===null?c=Object.getOwnPropertyDescriptor(u,f):c,C;if(typeof Reflect==\"object\"&&typeof Reflect.decorate==\"function\")t=Reflect.decorate(i,u,f,c);else for(var A=i.length-1;A>=0;A--)(C=i[A])&&(t=(g<3?C(t):g>3?C(u,f,t):C(u,f))||t);return g>3&&t&&Object.defineProperty(u,f,t),t}function _defineHidden(i){return function(u,f){Object.defineProperty(u,f,{configurable:!1,enumerable:!1,value:i,writable:!0})}}var _nbind={};function __nbind_free_external(i){_nbind.externalList[i].dereference(i)}function __nbind_reference_external(i){_nbind.externalList[i].reference()}function _llvm_stackrestore(i){var u=_llvm_stacksave,f=u.LLVM_SAVEDSTACKS[i];u.LLVM_SAVEDSTACKS.splice(i,1),Runtime.stackRestore(f)}function __nbind_register_pool(i,u,f,c){_nbind.Pool.pageSize=i,_nbind.Pool.usedPtr=u/4,_nbind.Pool.rootPtr=f,_nbind.Pool.pagePtr=c/4,HEAP32[u/4]=16909060,HEAP8[u]==1&&(_nbind.bigEndian=!0),HEAP32[u/4]=0,_nbind.makeTypeKindTbl=(t={},t[1024]=_nbind.PrimitiveType,t[64]=_nbind.Int64Type,t[2048]=_nbind.BindClass,t[3072]=_nbind.BindClassPtr,t[4096]=_nbind.SharedClassPtr,t[5120]=_nbind.ArrayType,t[6144]=_nbind.ArrayType,t[7168]=_nbind.CStringType,t[9216]=_nbind.CallbackType,t[10240]=_nbind.BindType,t),_nbind.makeTypeNameTbl={Buffer:_nbind.BufferType,External:_nbind.ExternalType,Int64:_nbind.Int64Type,_nbind_new:_nbind.CreateValueType,bool:_nbind.BooleanType,\"cbFunction &\":_nbind.CallbackType,\"const cbFunction &\":_nbind.CallbackType,\"const std::string &\":_nbind.StringType,\"std::string\":_nbind.StringType},Module.toggleLightGC=_nbind.toggleLightGC,_nbind.callUpcast=Module.dynCall_ii;var g=_nbind.makeType(_nbind.constructType,{flags:2048,id:0,name:\"\"});g.proto=Module,_nbind.BindClass.list.push(g);var t}function _emscripten_set_main_loop_timing(i,u){if(Browser.mainLoop.timingMode=i,Browser.mainLoop.timingValue=u,!Browser.mainLoop.func)return 1;if(i==0)Browser.mainLoop.scheduler=function(){var C=Math.max(0,Browser.mainLoop.tickStartTime+u-_emscripten_get_now())|0;setTimeout(Browser.mainLoop.runner,C)},Browser.mainLoop.method=\"timeout\";else if(i==1)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method=\"rAF\";else if(i==2){if(!window.setImmediate){let t=function(C){C.source===window&&C.data===c&&(C.stopPropagation(),f.shift()())};var g=t,f=[],c=\"setimmediate\";window.addEventListener(\"message\",t,!0),window.setImmediate=function(A){f.push(A),ENVIRONMENT_IS_WORKER?(Module.setImmediates===void 0&&(Module.setImmediates=[]),Module.setImmediates.push(A),window.postMessage({target:c})):window.postMessage(c,\"*\")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method=\"immediate\"}return 0}function _emscripten_get_now(){abort()}function _emscripten_set_main_loop(i,u,f,c,g){Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,\"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.\"),Browser.mainLoop.func=i,Browser.mainLoop.arg=c;var t;typeof c!=\"undefined\"?t=function(){Module.dynCall_vi(i,c)}:t=function(){Module.dynCall_v(i)};var C=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT){if(Browser.mainLoop.queue.length>0){var x=Date.now(),D=Browser.mainLoop.queue.shift();if(D.func(D.arg),Browser.mainLoop.remainingBlockers){var L=Browser.mainLoop.remainingBlockers,N=L%1==0?L-1:Math.floor(L);D.counted?Browser.mainLoop.remainingBlockers=N:(N=N+.5,Browser.mainLoop.remainingBlockers=(8*L+N)/9)}if(console.log('main loop blocker \"'+D.name+'\" took '+(Date.now()-x)+\" ms\"),Browser.mainLoop.updateStatus(),C<Browser.mainLoop.currentlyRunningMainloop)return;setTimeout(Browser.mainLoop.runner,0);return}if(!(C<Browser.mainLoop.currentlyRunningMainloop)){if(Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0,Browser.mainLoop.timingMode==1&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}else Browser.mainLoop.timingMode==0&&(Browser.mainLoop.tickStartTime=_emscripten_get_now());Browser.mainLoop.method===\"timeout\"&&Module.ctx&&(Module.printErr(\"Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!\"),Browser.mainLoop.method=\"\"),Browser.mainLoop.runIter(t),!(C<Browser.mainLoop.currentlyRunningMainloop)&&(typeof SDL==\"object\"&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Browser.mainLoop.scheduler())}}},g||(u&&u>0?_emscripten_set_main_loop_timing(0,1e3/u):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),f)throw\"SimulateInfiniteLoop\"}var Browser={mainLoop:{scheduler:null,method:\"\",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var i=Browser.mainLoop.timingMode,u=Browser.mainLoop.timingValue,f=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(f,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(i,u),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var i=Module.statusMessage||\"Please wait...\",u=Browser.mainLoop.remainingBlockers,f=Browser.mainLoop.expectedBlockers;u?u<f?Module.setStatus(i+\" (\"+(f-u)+\"/\"+f+\")\"):Module.setStatus(i):Module.setStatus(\"\")}},runIter:function(i){if(!ABORT){if(Module.preMainLoop){var u=Module.preMainLoop();if(u===!1)return}try{i()}catch(f){if(f instanceof ExitStatus)return;throw f&&typeof f==\"object\"&&f.stack&&Module.printErr(\"exception thrown: \"+[f,f.stack]),f}Module.postMainLoop&&Module.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(Module.preloadPlugins||(Module.preloadPlugins=[]),Browser.initted)return;Browser.initted=!0;try{new Blob,Browser.hasBlobConstructor=!0}catch(g){Browser.hasBlobConstructor=!1,console.log(\"warning: no blob constructor, cannot create blobs with mimetypes\")}Browser.BlobBuilder=typeof MozBlobBuilder!=\"undefined\"?MozBlobBuilder:typeof WebKitBlobBuilder!=\"undefined\"?WebKitBlobBuilder:Browser.hasBlobConstructor?null:console.log(\"warning: no BlobBuilder\"),Browser.URLObject=typeof window!=\"undefined\"?window.URL?window.URL:window.webkitURL:void 0,!Module.noImageDecoding&&typeof Browser.URLObject==\"undefined\"&&(console.log(\"warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.\"),Module.noImageDecoding=!0);var i={};i.canHandle=function(t){return!Module.noImageDecoding&&/\\.(jpg|jpeg|png|bmp)$/i.test(t)},i.handle=function(t,C,A,x){var D=null;if(Browser.hasBlobConstructor)try{D=new Blob([t],{type:Browser.getMimetype(C)}),D.size!==t.length&&(D=new Blob([new Uint8Array(t).buffer],{type:Browser.getMimetype(C)}))}catch($){Runtime.warnOnce(\"Blob constructor present but fails: \"+$+\"; falling back to blob builder\")}if(!D){var L=new Browser.BlobBuilder;L.append(new Uint8Array(t).buffer),D=L.getBlob()}var N=Browser.URLObject.createObjectURL(D),j=new Image;j.onload=function(){assert(j.complete,\"Image \"+C+\" could not be decoded\");var h=document.createElement(\"canvas\");h.width=j.width,h.height=j.height;var re=h.getContext(\"2d\");re.drawImage(j,0,0),Module.preloadedImages[C]=h,Browser.URLObject.revokeObjectURL(N),A&&A(t)},j.onerror=function(h){console.log(\"Image \"+N+\" could not be decoded\"),x&&x()},j.src=N},Module.preloadPlugins.push(i);var u={};u.canHandle=function(t){return!Module.noAudioDecoding&&t.substr(-4)in{\".ogg\":1,\".wav\":1,\".mp3\":1}},u.handle=function(t,C,A,x){var D=!1;function L(re){D||(D=!0,Module.preloadedAudios[C]=re,A&&A(t))}function N(){D||(D=!0,Module.preloadedAudios[C]=new Audio,x&&x())}if(Browser.hasBlobConstructor){try{var j=new Blob([t],{type:Browser.getMimetype(C)})}catch(re){return N()}var $=Browser.URLObject.createObjectURL(j),h=new Audio;h.addEventListener(\"canplaythrough\",function(){L(h)},!1),h.onerror=function(ce){if(D)return;console.log(\"warning: browser could not fully decode audio \"+C+\", trying slower base64 approach\");function Q(oe){for(var Se=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",me=\"=\",De=\"\",J=0,Te=0,Oe=0;Oe<oe.length;Oe++)for(J=J<<8|oe[Oe],Te+=8;Te>=6;){var Le=J>>Te-6&63;Te-=6,De+=Se[Le]}return Te==2?(De+=Se[(J&3)<<4],De+=me+me):Te==4&&(De+=Se[(J&15)<<2],De+=me),De}h.src=\"data:audio/x-\"+C.substr(-3)+\";base64,\"+Q(t),L(h)},h.src=$,Browser.safeSetTimeout(function(){L(h)},1e4)}else return N()},Module.preloadPlugins.push(u);function f(){Browser.pointerLock=document.pointerLockElement===Module.canvas||document.mozPointerLockElement===Module.canvas||document.webkitPointerLockElement===Module.canvas||document.msPointerLockElement===Module.canvas}var c=Module.canvas;c&&(c.requestPointerLock=c.requestPointerLock||c.mozRequestPointerLock||c.webkitRequestPointerLock||c.msRequestPointerLock||function(){},c.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},c.exitPointerLock=c.exitPointerLock.bind(document),document.addEventListener(\"pointerlockchange\",f,!1),document.addEventListener(\"mozpointerlockchange\",f,!1),document.addEventListener(\"webkitpointerlockchange\",f,!1),document.addEventListener(\"mspointerlockchange\",f,!1),Module.elementPointerLock&&c.addEventListener(\"click\",function(g){!Browser.pointerLock&&Module.canvas.requestPointerLock&&(Module.canvas.requestPointerLock(),g.preventDefault())},!1))},createContext:function(i,u,f,c){if(u&&Module.ctx&&i==Module.canvas)return Module.ctx;var g,t;if(u){var C={antialias:!1,alpha:!1};if(c)for(var A in c)C[A]=c[A];t=GL.createContext(i,C),t&&(g=GL.getContext(t).GLctx)}else g=i.getContext(\"2d\");return g?(f&&(u||assert(typeof GLctx==\"undefined\",\"cannot set in module if GLctx is used, but we are a non-GL context that would replace it\"),Module.ctx=g,u&&GL.makeContextCurrent(t),Module.useWebGL=u,Browser.moduleContextCreatedCallbacks.forEach(function(x){x()}),Browser.init()),g):null},destroyContext:function(i,u,f){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(i,u,f){Browser.lockPointer=i,Browser.resizeCanvas=u,Browser.vrDevice=f,typeof Browser.lockPointer==\"undefined\"&&(Browser.lockPointer=!0),typeof Browser.resizeCanvas==\"undefined\"&&(Browser.resizeCanvas=!1),typeof Browser.vrDevice==\"undefined\"&&(Browser.vrDevice=null);var c=Module.canvas;function g(){Browser.isFullscreen=!1;var C=c.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===C?(c.exitFullscreen=document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){},c.exitFullscreen=c.exitFullscreen.bind(document),Browser.lockPointer&&c.requestPointerLock(),Browser.isFullscreen=!0,Browser.resizeCanvas&&Browser.setFullscreenCanvasSize()):(C.parentNode.insertBefore(c,C),C.parentNode.removeChild(C),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullscreen),Module.onFullscreen&&Module.onFullscreen(Browser.isFullscreen),Browser.updateCanvasDimensions(c)}Browser.fullscreenHandlersInstalled||(Browser.fullscreenHandlersInstalled=!0,document.addEventListener(\"fullscreenchange\",g,!1),document.addEventListener(\"mozfullscreenchange\",g,!1),document.addEventListener(\"webkitfullscreenchange\",g,!1),document.addEventListener(\"MSFullscreenChange\",g,!1));var t=document.createElement(\"div\");c.parentNode.insertBefore(t,c),t.appendChild(c),t.requestFullscreen=t.requestFullscreen||t.mozRequestFullScreen||t.msRequestFullscreen||(t.webkitRequestFullscreen?function(){t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(t.webkitRequestFullScreen?function(){t.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),f?t.requestFullscreen({vrDisplay:f}):t.requestFullscreen()},requestFullScreen:function(i,u,f){return Module.printErr(\"Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead.\"),Browser.requestFullScreen=function(c,g,t){return Browser.requestFullscreen(c,g,t)},Browser.requestFullscreen(i,u,f)},nextRAF:0,fakeRequestAnimationFrame:function(i){var u=Date.now();if(Browser.nextRAF===0)Browser.nextRAF=u+1e3/60;else for(;u+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var f=Math.max(Browser.nextRAF-u,0);setTimeout(i,f)},requestAnimationFrame:function(u){typeof window==\"undefined\"?Browser.fakeRequestAnimationFrame(u):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(u))},safeCallback:function(i){return function(){if(!ABORT)return i.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var i=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],i.forEach(function(u){u()})}},safeRequestAnimationFrame:function(i){return Browser.requestAnimationFrame(function(){ABORT||(Browser.allowAsyncCallbacks?i():Browser.queuedAsyncCallbacks.push(i))})},safeSetTimeout:function(i,u){return Module.noExitRuntime=!0,setTimeout(function(){ABORT||(Browser.allowAsyncCallbacks?i():Browser.queuedAsyncCallbacks.push(i))},u)},safeSetInterval:function(i,u){return Module.noExitRuntime=!0,setInterval(function(){ABORT||Browser.allowAsyncCallbacks&&i()},u)},getMimetype:function(i){return{jpg:\"image/jpeg\",jpeg:\"image/jpeg\",png:\"image/png\",bmp:\"image/bmp\",ogg:\"audio/ogg\",wav:\"audio/wav\",mp3:\"audio/mpeg\"}[i.substr(i.lastIndexOf(\".\")+1)]},getUserMedia:function(i){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(i)},getMovementX:function(i){return i.movementX||i.mozMovementX||i.webkitMovementX||0},getMovementY:function(i){return i.movementY||i.mozMovementY||i.webkitMovementY||0},getMouseWheelDelta:function(i){var u=0;switch(i.type){case\"DOMMouseScroll\":u=i.detail;break;case\"mousewheel\":u=i.wheelDelta;break;case\"wheel\":u=i.deltaY;break;default:throw\"unrecognized mouse wheel event: \"+i.type}return u},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(i){if(Browser.pointerLock)i.type!=\"mousemove\"&&\"mozMovementX\"in i?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(i),Browser.mouseMovementY=Browser.getMovementY(i)),typeof SDL!=\"undefined\"?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var u=Module.canvas.getBoundingClientRect(),f=Module.canvas.width,c=Module.canvas.height,g=typeof window.scrollX!=\"undefined\"?window.scrollX:window.pageXOffset,t=typeof window.scrollY!=\"undefined\"?window.scrollY:window.pageYOffset;if(i.type===\"touchstart\"||i.type===\"touchend\"||i.type===\"touchmove\"){var C=i.touch;if(C===void 0)return;var A=C.pageX-(g+u.left),x=C.pageY-(t+u.top);A=A*(f/u.width),x=x*(c/u.height);var D={x:A,y:x};if(i.type===\"touchstart\")Browser.lastTouches[C.identifier]=D,Browser.touches[C.identifier]=D;else if(i.type===\"touchend\"||i.type===\"touchmove\"){var L=Browser.touches[C.identifier];L||(L=D),Browser.lastTouches[C.identifier]=L,Browser.touches[C.identifier]=D}return}var N=i.pageX-(g+u.left),j=i.pageY-(t+u.top);N=N*(f/u.width),j=j*(c/u.height),Browser.mouseMovementX=N-Browser.mouseX,Browser.mouseMovementY=j-Browser.mouseY,Browser.mouseX=N,Browser.mouseY=j}},asyncLoad:function(i,u,f,c){var g=c?\"\":getUniqueRunDependency(\"al \"+i);Module.readAsync(i,function(t){assert(t,'Loading data file \"'+i+'\" failed (no arrayBuffer).'),u(new Uint8Array(t)),g&&removeRunDependency(g)},function(t){if(f)f();else throw'Loading data file \"'+i+'\" failed.'}),g&&addRunDependency(g)},resizeListeners:[],updateResizeListeners:function(){var i=Module.canvas;Browser.resizeListeners.forEach(function(u){u(i.width,i.height)})},setCanvasSize:function(i,u,f){var c=Module.canvas;Browser.updateCanvasDimensions(c,i,u),f||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if(typeof SDL!=\"undefined\"){var i=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];i=i|8388608,HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=i}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if(typeof SDL!=\"undefined\"){var i=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];i=i&~8388608,HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=i}Browser.updateResizeListeners()},updateCanvasDimensions:function(i,u,f){u&&f?(i.widthNative=u,i.heightNative=f):(u=i.widthNative,f=i.heightNative);var c=u,g=f;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(c/g<Module.forcedAspectRatio?c=Math.round(g*Module.forcedAspectRatio):g=Math.round(c/Module.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===i.parentNode&&typeof screen!=\"undefined\"){var t=Math.min(screen.width/c,screen.height/g);c=Math.round(c*t),g=Math.round(g*t)}Browser.resizeCanvas?(i.width!=c&&(i.width=c),i.height!=g&&(i.height=g),typeof i.style!=\"undefined\"&&(i.style.removeProperty(\"width\"),i.style.removeProperty(\"height\"))):(i.width!=u&&(i.width=u),i.height!=f&&(i.height=f),typeof i.style!=\"undefined\"&&(c!=u||g!=f?(i.style.setProperty(\"width\",c+\"px\",\"important\"),i.style.setProperty(\"height\",g+\"px\",\"important\")):(i.style.removeProperty(\"width\"),i.style.removeProperty(\"height\"))))},wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function(){var i=Browser.nextWgetRequestHandle;return Browser.nextWgetRequestHandle++,i}},SYSCALLS={varargs:0,get:function(i){SYSCALLS.varargs+=4;var u=HEAP32[SYSCALLS.varargs-4>>2];return u},getStr:function(){var i=Pointer_stringify(SYSCALLS.get());return i},get64:function(){var i=SYSCALLS.get(),u=SYSCALLS.get();return i>=0?assert(u===0):assert(u===-1),i},getZero:function(){assert(SYSCALLS.get()===0)}};function ___syscall6(i,u){SYSCALLS.varargs=u;try{var f=SYSCALLS.getStreamFromFD();return FS.close(f),0}catch(c){return(typeof FS==\"undefined\"||!(c instanceof FS.ErrnoError))&&abort(c),-c.errno}}function ___syscall54(i,u){SYSCALLS.varargs=u;try{return 0}catch(f){return(typeof FS==\"undefined\"||!(f instanceof FS.ErrnoError))&&abort(f),-f.errno}}function _typeModule(i){var u=[[0,1,\"X\"],[1,1,\"const X\"],[128,1,\"X *\"],[256,1,\"X &\"],[384,1,\"X &&\"],[512,1,\"std::shared_ptr<X>\"],[640,1,\"std::unique_ptr<X>\"],[5120,1,\"std::vector<X>\"],[6144,2,\"std::array<X, Y>\"],[9216,-1,\"std::function<X (Y)>\"]];function f(x,D,L,N,j,$){if(D==1){var h=N&896;(h==128||h==256||h==384)&&(x=\"X const\")}var re;return $?re=L.replace(\"X\",x).replace(\"Y\",j):re=x.replace(\"X\",L).replace(\"Y\",j),re.replace(/([*&]) (?=[*&])/g,\"$1\")}function c(x,D,L,N,j){throw new Error(x+\" type \"+L.replace(\"X\",D+\"?\")+(N?\" with flag \"+N:\"\")+\" in \"+j)}function g(x,D,L,N,j,$,h,re){$===void 0&&($=\"X\"),re===void 0&&(re=1);var ce=L(x);if(ce)return ce;var Q=N(x),oe=Q.placeholderFlag,Se=u[oe];h&&Se&&($=f(h[2],h[0],$,Se[0],\"?\",!0));var me;oe==0&&(me=\"Unbound\"),oe>=10&&(me=\"Corrupt\"),re>20&&(me=\"Deeply nested\"),me&&c(me,x,$,oe,j||\"?\");var De=Q.paramList[0],J=g(De,D,L,N,j,$,Se,re+1),Te,Oe={flags:Se[0],id:x,name:\"\",paramList:[J]},Le=[],ot=\"?\";switch(Q.placeholderFlag){case 1:Te=J.spec;break;case 2:if((J.flags&15360)==1024&&J.spec.ptrSize==1){Oe.flags=7168;break}case 3:case 6:case 5:Te=J.spec,(J.flags&15360)!=2048;break;case 8:ot=\"\"+Q.paramList[1],Oe.paramList.push(Q.paramList[1]);break;case 9:for(var ct=0,Ue=Q.paramList[1];ct<Ue.length;ct++){var be=Ue[ct],At=g(be,D,L,N,j,$,Se,re+1);Le.push(At.name),Oe.paramList.push(At)}ot=Le.join(\", \");break;default:break}if(Oe.name=f(Se[2],Se[0],J.name,J.flags,ot),Te){for(var Ot=0,Nt=Object.keys(Te);Ot<Nt.length;Ot++){var Je=Nt[Ot];Oe[Je]=Oe[Je]||Te[Je]}Oe.flags|=Te.flags}return t(D,Oe)}function t(x,D){var L=D.flags,N=L&896,j=L&15360;return!D.name&&j==1024&&(D.ptrSize==1?D.name=(L&16?\"\":(L&8?\"un\":\"\")+\"signed \")+\"char\":D.name=(L&8?\"u\":\"\")+(L&32?\"float\":\"int\")+(D.ptrSize*8+\"_t\")),D.ptrSize==8&&!(L&32)&&(j=64),j==2048&&(N==512||N==640?j=4096:N&&(j=3072)),x(j,D)}var C=function(){function x(D){this.id=D.id,this.name=D.name,this.flags=D.flags,this.spec=D}return x.prototype.toString=function(){return this.name},x}(),A={Type:C,getComplexType:g,makeType:t,structureList:u};return i.output=A,i.output||A}function __nbind_register_type(i,u){var f=_nbind.readAsciiString(u),c={flags:10240,id:i,name:f};_nbind.makeType(_nbind.constructType,c)}function __nbind_register_callback_signature(i,u){var f=_nbind.readTypeIdList(i,u),c=_nbind.callbackSignatureList.length;return _nbind.callbackSignatureList[c]=_nbind.makeJSCaller(f),c}function __extends(i,u){for(var f in u)u.hasOwnProperty(f)&&(i[f]=u[f]);function c(){this.constructor=i}c.prototype=u.prototype,i.prototype=new c}function __nbind_register_class(i,u,f,c,g,t,C){var A=_nbind.readAsciiString(C),x=_nbind.readPolicyList(u),D=HEAPU32.subarray(i/4,i/4+2),L={flags:2048|(x.Value?2:0),id:D[0],name:A},N=_nbind.makeType(_nbind.constructType,L);N.ptrType=_nbind.getComplexType(D[1],_nbind.constructType,_nbind.getType,_nbind.queryType),N.destroy=_nbind.makeMethodCaller(N.ptrType,{boundID:L.id,flags:0,name:\"destroy\",num:0,ptr:t,title:N.name+\".free\",typeList:[\"void\",\"uint32_t\",\"uint32_t\"]}),g&&(N.superIdList=Array.prototype.slice.call(HEAPU32.subarray(f/4,f/4+g)),N.upcastList=Array.prototype.slice.call(HEAPU32.subarray(c/4,c/4+g))),Module[N.name]=N.makeBound(x),_nbind.BindClass.list.push(N)}function _removeAccessorPrefix(i){var u=/^[Gg]et_?([A-Z]?([A-Z]?))/;return i.replace(u,function(f,c,g){return g?c:c.toLowerCase()})}function __nbind_register_function(i,u,f,c,g,t,C,A,x,D){var L=_nbind.getType(i),N=_nbind.readPolicyList(u),j=_nbind.readTypeIdList(f,c),$;if(C==5)$=[{direct:g,name:\"__nbindConstructor\",ptr:0,title:L.name+\" constructor\",typeList:[\"uint32_t\"].concat(j.slice(1))},{direct:t,name:\"__nbindValueConstructor\",ptr:0,title:L.name+\" value constructor\",typeList:[\"void\",\"uint32_t\"].concat(j.slice(1))}];else{var h=_nbind.readAsciiString(A),re=(L.name&&L.name+\".\")+h;(C==3||C==4)&&(h=_removeAccessorPrefix(h)),$=[{boundID:i,direct:t,name:h,ptr:g,title:re,typeList:j}]}for(var ce=0,Q=$;ce<Q.length;ce++){var oe=Q[ce];oe.signatureType=C,oe.policyTbl=N,oe.num=x,oe.flags=D,L.addMethod(oe)}}function _nbind_value(i,u){_nbind.typeNameTbl[i]||_nbind.throwError(\"Unknown value type \"+i),Module.NBind.bind_value(i,u),_defineHidden(_nbind.typeNameTbl[i].proto.prototype.__nbindValueConstructor)(u.prototype,\"__nbindValueConstructor\")}Module._nbind_value=_nbind_value;function __nbind_get_value_object(i,u){var f=_nbind.popValue(i);if(!f.fromJS)throw new Error(\"Object \"+f+\" has no fromJS function\");f.fromJS(function(){f.__nbindValueConstructor.apply(this,Array.prototype.concat.apply([u],arguments))})}function _emscripten_memcpy_big(i,u,f){return HEAPU8.set(HEAPU8.subarray(u,u+f),i),i}function __nbind_register_primitive(i,u,f){var c={flags:1024|f,id:i,ptrSize:u};_nbind.makeType(_nbind.constructType,c)}var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],\"i8\",ALLOC_STATIC);function ___setErrNo(i){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=i),i}function _llvm_stacksave(){var i=_llvm_stacksave;return i.LLVM_SAVEDSTACKS||(i.LLVM_SAVEDSTACKS=[]),i.LLVM_SAVEDSTACKS.push(Runtime.stackSave()),i.LLVM_SAVEDSTACKS.length-1}function ___syscall140(i,u){SYSCALLS.varargs=u;try{var f=SYSCALLS.getStreamFromFD(),c=SYSCALLS.get(),g=SYSCALLS.get(),t=SYSCALLS.get(),C=SYSCALLS.get(),A=g;return FS.llseek(f,A,C),HEAP32[t>>2]=f.position,f.getdents&&A===0&&C===0&&(f.getdents=null),0}catch(x){return(typeof FS==\"undefined\"||!(x instanceof FS.ErrnoError))&&abort(x),-x.errno}}function ___syscall146(i,u){SYSCALLS.varargs=u;try{var f=SYSCALLS.get(),c=SYSCALLS.get(),g=SYSCALLS.get(),t=0;___syscall146.buffer||(___syscall146.buffers=[null,[],[]],___syscall146.printChar=function(L,N){var j=___syscall146.buffers[L];assert(j),N===0||N===10?((L===1?Module.print:Module.printErr)(UTF8ArrayToString(j,0)),j.length=0):j.push(N)});for(var C=0;C<g;C++){for(var A=HEAP32[c+C*8>>2],x=HEAP32[c+(C*8+4)>>2],D=0;D<x;D++)___syscall146.printChar(f,HEAPU8[A+D]);t+=x}return t}catch(L){return(typeof FS==\"undefined\"||!(L instanceof FS.ErrnoError))&&abort(L),-L.errno}}function __nbind_finish(){for(var i=0,u=_nbind.BindClass.list;i<u.length;i++){var f=u[i];f.finish()}}var ___dso_handle=STATICTOP;STATICTOP+=16,function(_nbind){var typeIdTbl={};_nbind.typeNameTbl={};var Pool=function(){function i(){}return i.lalloc=function(u){u=u+7&~7;var f=HEAPU32[i.usedPtr];if(u>i.pageSize/2||u>i.pageSize-f){var c=_nbind.typeNameTbl.NBind.proto;return c.lalloc(u)}else return HEAPU32[i.usedPtr]=f+u,i.rootPtr+f},i.lreset=function(u,f){var c=HEAPU32[i.pagePtr];if(c){var g=_nbind.typeNameTbl.NBind.proto;g.lreset(u,f)}else HEAPU32[i.usedPtr]=u},i}();_nbind.Pool=Pool;function constructType(i,u){var f=i==10240?_nbind.makeTypeNameTbl[u.name]||_nbind.BindType:_nbind.makeTypeKindTbl[i],c=new f(u);return typeIdTbl[u.id]=c,_nbind.typeNameTbl[u.name]=c,c}_nbind.constructType=constructType;function getType(i){return typeIdTbl[i]}_nbind.getType=getType;function queryType(i){var u=HEAPU8[i],f=_nbind.structureList[u][1];i/=4,f<0&&(++i,f=HEAPU32[i]+1);var c=Array.prototype.slice.call(HEAPU32.subarray(i+1,i+1+f));return u==9&&(c=[c[0],c.slice(1)]),{paramList:c,placeholderFlag:u}}_nbind.queryType=queryType;function getTypes(i,u){return i.map(function(f){return typeof f==\"number\"?_nbind.getComplexType(f,constructType,getType,queryType,u):_nbind.typeNameTbl[f]})}_nbind.getTypes=getTypes;function readTypeIdList(i,u){return Array.prototype.slice.call(HEAPU32,i/4,i/4+u)}_nbind.readTypeIdList=readTypeIdList;function readAsciiString(i){for(var u=i;HEAPU8[u++];);return String.fromCharCode.apply(\"\",HEAPU8.subarray(i,u-1))}_nbind.readAsciiString=readAsciiString;function readPolicyList(i){var u={};if(i)for(;;){var f=HEAPU32[i/4];if(!f)break;u[readAsciiString(f)]=!0,i+=4}return u}_nbind.readPolicyList=readPolicyList;function getDynCall(i,u){var f={float32_t:\"d\",float64_t:\"d\",int64_t:\"d\",uint64_t:\"d\",void:\"v\"},c=i.map(function(t){return f[t.name]||\"i\"}).join(\"\"),g=Module[\"dynCall_\"+c];if(!g)throw new Error(\"dynCall_\"+c+\" not found for \"+u+\"(\"+i.map(function(t){return t.name}).join(\", \")+\")\");return g}_nbind.getDynCall=getDynCall;function addMethod(i,u,f,c){var g=i[u];i.hasOwnProperty(u)&&g?((g.arity||g.arity===0)&&(g=_nbind.makeOverloader(g,g.arity),i[u]=g),g.addMethod(f,c)):(f.arity=c,i[u]=f)}_nbind.addMethod=addMethod;function throwError(i){throw new Error(i)}_nbind.throwError=throwError,_nbind.bigEndian=!1,_a=_typeModule(_typeModule),_nbind.Type=_a.Type,_nbind.makeType=_a.makeType,_nbind.getComplexType=_a.getComplexType,_nbind.structureList=_a.structureList;var BindType=function(i){__extends(u,i);function u(){var f=i!==null&&i.apply(this,arguments)||this;return f.heap=HEAPU32,f.ptrSize=4,f}return u.prototype.needsWireRead=function(f){return!!this.wireRead||!!this.makeWireRead},u.prototype.needsWireWrite=function(f){return!!this.wireWrite||!!this.makeWireWrite},u}(_nbind.Type);_nbind.BindType=BindType;var PrimitiveType=function(i){__extends(u,i);function u(f){var c=i.call(this,f)||this,g=f.flags&32?{32:HEAPF32,64:HEAPF64}:f.flags&8?{8:HEAPU8,16:HEAPU16,32:HEAPU32}:{8:HEAP8,16:HEAP16,32:HEAP32};return c.heap=g[f.ptrSize*8],c.ptrSize=f.ptrSize,c}return u.prototype.needsWireWrite=function(f){return!!f&&!!f.Strict},u.prototype.makeWireWrite=function(f,c){return c&&c.Strict&&function(g){if(typeof g==\"number\")return g;throw new Error(\"Type mismatch\")}},u}(BindType);_nbind.PrimitiveType=PrimitiveType;function pushCString(i,u){if(i==null){if(u&&u.Nullable)return 0;throw new Error(\"Type mismatch\")}if(u&&u.Strict){if(typeof i!=\"string\")throw new Error(\"Type mismatch\")}else i=i.toString();var f=Module.lengthBytesUTF8(i)+1,c=_nbind.Pool.lalloc(f);return Module.stringToUTF8Array(i,HEAPU8,c,f),c}_nbind.pushCString=pushCString;function popCString(i){return i===0?null:Module.Pointer_stringify(i)}_nbind.popCString=popCString;var CStringType=function(i){__extends(u,i);function u(){var f=i!==null&&i.apply(this,arguments)||this;return f.wireRead=popCString,f.wireWrite=pushCString,f.readResources=[_nbind.resources.pool],f.writeResources=[_nbind.resources.pool],f}return u.prototype.makeWireWrite=function(f,c){return function(g){return pushCString(g,c)}},u}(BindType);_nbind.CStringType=CStringType;var BooleanType=function(i){__extends(u,i);function u(){var f=i!==null&&i.apply(this,arguments)||this;return f.wireRead=function(c){return!!c},f}return u.prototype.needsWireWrite=function(f){return!!f&&!!f.Strict},u.prototype.makeWireRead=function(f){return\"!!(\"+f+\")\"},u.prototype.makeWireWrite=function(f,c){return c&&c.Strict&&function(g){if(typeof g==\"boolean\")return g;throw new Error(\"Type mismatch\")}||f},u}(BindType);_nbind.BooleanType=BooleanType;var Wrapper=function(){function i(){}return i.prototype.persist=function(){this.__nbindState|=1},i}();_nbind.Wrapper=Wrapper;function makeBound(i,u){var f=function(c){__extends(g,c);function g(t,C,A,x){var D=c.call(this)||this;if(!(D instanceof g))return new(Function.prototype.bind.apply(g,Array.prototype.concat.apply([null],arguments)));var L=C,N=A,j=x;if(t!==_nbind.ptrMarker){var $=D.__nbindConstructor.apply(D,arguments);L=4096|512,j=HEAPU32[$/4],N=HEAPU32[$/4+1]}var h={configurable:!0,enumerable:!1,value:null,writable:!1},re={__nbindFlags:L,__nbindPtr:N};j&&(re.__nbindShared=j,_nbind.mark(D));for(var ce=0,Q=Object.keys(re);ce<Q.length;ce++){var oe=Q[ce];h.value=re[oe],Object.defineProperty(D,oe,h)}return _defineHidden(0)(D,\"__nbindState\"),D}return g.prototype.free=function(){u.destroy.call(this,this.__nbindShared,this.__nbindFlags),this.__nbindState|=2,disableMember(this,\"__nbindShared\"),disableMember(this,\"__nbindPtr\")},g}(Wrapper);return __decorate([_defineHidden()],f.prototype,\"__nbindConstructor\",void 0),__decorate([_defineHidden()],f.prototype,\"__nbindValueConstructor\",void 0),__decorate([_defineHidden(i)],f.prototype,\"__nbindPolicies\",void 0),f}_nbind.makeBound=makeBound;function disableMember(i,u){function f(){throw new Error(\"Accessing deleted object\")}Object.defineProperty(i,u,{configurable:!1,enumerable:!1,get:f,set:f})}_nbind.ptrMarker={};var BindClass=function(i){__extends(u,i);function u(f){var c=i.call(this,f)||this;return c.wireRead=function(g){return _nbind.popValue(g,c.ptrType)},c.wireWrite=function(g){return pushPointer(g,c.ptrType,!0)},c.pendingSuperCount=0,c.ready=!1,c.methodTbl={},f.paramList?(c.classType=f.paramList[0].classType,c.proto=c.classType.proto):c.classType=c,c}return u.prototype.makeBound=function(f){var c=_nbind.makeBound(f,this);return this.proto=c,this.ptrType.proto=c,c},u.prototype.addMethod=function(f){var c=this.methodTbl[f.name]||[];c.push(f),this.methodTbl[f.name]=c},u.prototype.registerMethods=function(f,c){for(var g,t=0,C=Object.keys(f.methodTbl);t<C.length;t++)for(var A=C[t],x=f.methodTbl[A],D=0,L=x;D<L.length;D++){var N=L[D],j=void 0,$=void 0;if(j=this.proto.prototype,!(c&&N.signatureType!=1))switch(N.signatureType){case 1:j=this.proto;case 5:$=_nbind.makeCaller(N),_nbind.addMethod(j,N.name,$,N.typeList.length-1);break;case 4:g=_nbind.makeMethodCaller(f.ptrType,N);break;case 3:Object.defineProperty(j,N.name,{configurable:!0,enumerable:!1,get:_nbind.makeMethodCaller(f.ptrType,N),set:g});break;case 2:$=_nbind.makeMethodCaller(f.ptrType,N),_nbind.addMethod(j,N.name,$,N.typeList.length-1);break;default:break}}},u.prototype.registerSuperMethods=function(f,c,g){if(!g[f.name]){g[f.name]=!0;for(var t=0,C,A=0,x=f.superIdList||[];A<x.length;A++){var D=x[A],L=_nbind.getType(D);t++<c||c<0?C=-1:C=0,this.registerSuperMethods(L,C,g)}this.registerMethods(f,c<0)}},u.prototype.finish=function(){if(this.ready)return this;this.ready=!0,this.superList=(this.superIdList||[]).map(function(g){return _nbind.getType(g).finish()});var f=this.proto;if(this.superList.length){var c=function(){this.constructor=f};c.prototype=this.superList[0].proto.prototype,f.prototype=new c}return f!=Module&&(f.prototype.__nbindType=this),this.registerSuperMethods(this,1,{}),this},u.prototype.upcastStep=function(f,c){if(f==this)return c;for(var g=0;g<this.superList.length;++g){var t=this.superList[g].upcastStep(f,_nbind.callUpcast(this.upcastList[g],c));if(t)return t}return 0},u}(_nbind.BindType);BindClass.list=[],_nbind.BindClass=BindClass;function popPointer(i,u){return i?new u.proto(_nbind.ptrMarker,u.flags,i):null}_nbind.popPointer=popPointer;function pushPointer(i,u,f){if(!(i instanceof _nbind.Wrapper)){if(f)return _nbind.pushValue(i);throw new Error(\"Type mismatch\")}var c=i.__nbindPtr,g=i.__nbindType.classType,t=u.classType;if(i instanceof u.proto)for(;g!=t;)c=_nbind.callUpcast(g.upcastList[0],c),g=g.superList[0];else if(c=g.upcastStep(t,c),!c)throw new Error(\"Type mismatch\");return c}_nbind.pushPointer=pushPointer;function pushMutablePointer(i,u){var f=pushPointer(i,u);if(i.__nbindFlags&1)throw new Error(\"Passing a const value as a non-const argument\");return f}var BindClassPtr=function(i){__extends(u,i);function u(f){var c=i.call(this,f)||this;c.classType=f.paramList[0].classType,c.proto=c.classType.proto;var g=f.flags&1,t=(c.flags&896)==256&&f.flags&2,C=g?pushPointer:pushMutablePointer,A=t?_nbind.popValue:popPointer;return c.makeWireWrite=function(x,D){return D.Nullable?function(L){return L?C(L,c):0}:function(L){return C(L,c)}},c.wireRead=function(x){return A(x,c)},c.wireWrite=function(x){return C(x,c)},c}return u}(_nbind.BindType);_nbind.BindClassPtr=BindClassPtr;function popShared(i,u){var f=HEAPU32[i/4],c=HEAPU32[i/4+1];return c?new u.proto(_nbind.ptrMarker,u.flags,c,f):null}_nbind.popShared=popShared;function pushShared(i,u){if(!(i instanceof u.proto))throw new Error(\"Type mismatch\");return i.__nbindShared}function pushMutableShared(i,u){if(!(i instanceof u.proto))throw new Error(\"Type mismatch\");if(i.__nbindFlags&1)throw new Error(\"Passing a const value as a non-const argument\");return i.__nbindShared}var SharedClassPtr=function(i){__extends(u,i);function u(f){var c=i.call(this,f)||this;c.readResources=[_nbind.resources.pool],c.classType=f.paramList[0].classType,c.proto=c.classType.proto;var g=f.flags&1,t=g?pushShared:pushMutableShared;return c.wireRead=function(C){return popShared(C,c)},c.wireWrite=function(C){return t(C,c)},c}return u}(_nbind.BindType);_nbind.SharedClassPtr=SharedClassPtr,_nbind.externalList=[0];var firstFreeExternal=0,External=function(){function i(u){this.refCount=1,this.data=u}return i.prototype.register=function(){var u=firstFreeExternal;return u?firstFreeExternal=_nbind.externalList[u]:u=_nbind.externalList.length,_nbind.externalList[u]=this,u},i.prototype.reference=function(){++this.refCount},i.prototype.dereference=function(u){--this.refCount==0&&(this.free&&this.free(),_nbind.externalList[u]=firstFreeExternal,firstFreeExternal=u)},i}();_nbind.External=External;function popExternal(i){var u=_nbind.externalList[i];return u.dereference(i),u.data}function pushExternal(i){var u=new External(i);return u.reference(),u.register()}var ExternalType=function(i){__extends(u,i);function u(){var f=i!==null&&i.apply(this,arguments)||this;return f.wireRead=popExternal,f.wireWrite=pushExternal,f}return u}(_nbind.BindType);_nbind.ExternalType=ExternalType,_nbind.callbackSignatureList=[];var CallbackType=function(i){__extends(u,i);function u(){var f=i!==null&&i.apply(this,arguments)||this;return f.wireWrite=function(c){return typeof c!=\"function\"&&_nbind.throwError(\"Type mismatch\"),new _nbind.External(c).register()},f}return u}(_nbind.BindType);_nbind.CallbackType=CallbackType,_nbind.valueList=[0];var firstFreeValue=0;function pushValue(i){var u=firstFreeValue;return u?firstFreeValue=_nbind.valueList[u]:u=_nbind.valueList.length,_nbind.valueList[u]=i,u*2+1}_nbind.pushValue=pushValue;function popValue(i,u){if(i||_nbind.throwError(\"Value type JavaScript class is missing or not registered\"),i&1){i>>=1;var f=_nbind.valueList[i];return _nbind.valueList[i]=firstFreeValue,firstFreeValue=i,f}else{if(u)return _nbind.popShared(i,u);throw new Error(\"Invalid value slot \"+i)}}_nbind.popValue=popValue;var valueBase=18446744073709552e3;function push64(i){return typeof i==\"number\"?i:pushValue(i)*4096+valueBase}function pop64(i){return i<valueBase?i:popValue((i-valueBase)/4096)}var CreateValueType=function(i){__extends(u,i);function u(){return i!==null&&i.apply(this,arguments)||this}return u.prototype.makeWireWrite=function(f){return\"(_nbind.pushValue(new \"+f+\"))\"},u}(_nbind.BindType);_nbind.CreateValueType=CreateValueType;var Int64Type=function(i){__extends(u,i);function u(){var f=i!==null&&i.apply(this,arguments)||this;return f.wireWrite=push64,f.wireRead=pop64,f}return u}(_nbind.BindType);_nbind.Int64Type=Int64Type;function pushArray(i,u){if(!i)return 0;var f=i.length;if((u.size||u.size===0)&&f<u.size)throw new Error(\"Type mismatch\");var c=u.memberType.ptrSize,g=_nbind.Pool.lalloc(4+f*c);HEAPU32[g/4]=f;var t=u.memberType.heap,C=(g+4)/c,A=u.memberType.wireWrite,x=0;if(A)for(;x<f;)t[C++]=A(i[x++]);else for(;x<f;)t[C++]=i[x++];return g}_nbind.pushArray=pushArray;function popArray(i,u){if(i===0)return null;var f=HEAPU32[i/4],c=new Array(f),g=u.memberType.heap;i=(i+4)/u.memberType.ptrSize;var t=u.memberType.wireRead,C=0;if(t)for(;C<f;)c[C++]=t(g[i++]);else for(;C<f;)c[C++]=g[i++];return c}_nbind.popArray=popArray;var ArrayType=function(i){__extends(u,i);function u(f){var c=i.call(this,f)||this;return c.wireRead=function(g){return popArray(g,c)},c.wireWrite=function(g){return pushArray(g,c)},c.readResources=[_nbind.resources.pool],c.writeResources=[_nbind.resources.pool],c.memberType=f.paramList[0],f.paramList[1]&&(c.size=f.paramList[1]),c}return u}(_nbind.BindType);_nbind.ArrayType=ArrayType;function pushString(i,u){if(i==null)if(u&&u.Nullable)i=\"\";else throw new Error(\"Type mismatch\");if(u&&u.Strict){if(typeof i!=\"string\")throw new Error(\"Type mismatch\")}else i=i.toString();var f=Module.lengthBytesUTF8(i),c=_nbind.Pool.lalloc(4+f+1);return HEAPU32[c/4]=f,Module.stringToUTF8Array(i,HEAPU8,c+4,f+1),c}_nbind.pushString=pushString;function popString(i){if(i===0)return null;var u=HEAPU32[i/4];return Module.Pointer_stringify(i+4,u)}_nbind.popString=popString;var StringType=function(i){__extends(u,i);function u(){var f=i!==null&&i.apply(this,arguments)||this;return f.wireRead=popString,f.wireWrite=pushString,f.readResources=[_nbind.resources.pool],f.writeResources=[_nbind.resources.pool],f}return u.prototype.makeWireWrite=function(f,c){return function(g){return pushString(g,c)}},u}(_nbind.BindType);_nbind.StringType=StringType;function makeArgList(i){return Array.apply(null,Array(i)).map(function(u,f){return\"a\"+(f+1)})}function anyNeedsWireWrite(i,u){return i.reduce(function(f,c){return f||c.needsWireWrite(u)},!1)}function anyNeedsWireRead(i,u){return i.reduce(function(f,c){return f||!!c.needsWireRead(u)},!1)}function makeWireRead(i,u,f,c){var g=i.length;return f.makeWireRead?f.makeWireRead(c,i,g):f.wireRead?(i[g]=f.wireRead,\"(convertParamList[\"+g+\"](\"+c+\"))\"):c}function makeWireWrite(i,u,f,c){var g,t=i.length;return f.makeWireWrite?g=f.makeWireWrite(c,u,i,t):g=f.wireWrite,g?typeof g==\"string\"?g:(i[t]=g,\"(convertParamList[\"+t+\"](\"+c+\"))\"):c}function buildCallerFunction(dynCall,ptrType,ptr,num,policyTbl,needsWireWrite,prefix,returnType,argTypeList,mask,err){var argList=makeArgList(argTypeList.length),convertParamList=[],callExpression=makeWireRead(convertParamList,policyTbl,returnType,\"dynCall(\"+[prefix].concat(argList.map(function(i,u){return makeWireWrite(convertParamList,policyTbl,argTypeList[u],i)})).join(\",\")+\")\"),resourceSet=_nbind.listResources([returnType],argTypeList),sourceCode=\"function(\"+argList.join(\",\")+\"){\"+(mask?\"this.__nbindFlags&mask&&err();\":\"\")+resourceSet.makeOpen()+\"var r=\"+callExpression+\";\"+resourceSet.makeClose()+\"return r;}\";return eval(\"(\"+sourceCode+\")\")}function buildJSCallerFunction(returnType,argTypeList){var argList=makeArgList(argTypeList.length),convertParamList=[],callExpression=makeWireWrite(convertParamList,null,returnType,\"_nbind.externalList[num].data(\"+argList.map(function(i,u){return makeWireRead(convertParamList,null,argTypeList[u],i)}).join(\",\")+\")\"),resourceSet=_nbind.listResources(argTypeList,[returnType]);resourceSet.remove(_nbind.resources.pool);var sourceCode=\"function(\"+[\"dummy\",\"num\"].concat(argList).join(\",\")+\"){\"+resourceSet.makeOpen()+\"var r=\"+callExpression+\";\"+resourceSet.makeClose()+\"return r;}\";return eval(\"(\"+sourceCode+\")\")}_nbind.buildJSCallerFunction=buildJSCallerFunction;function makeJSCaller(i){var u=i.length-1,f=_nbind.getTypes(i,\"callback\"),c=f[0],g=f.slice(1),t=anyNeedsWireRead(g,null),C=c.needsWireWrite(null);if(!C&&!t)switch(u){case 0:return function(A,x){return _nbind.externalList[x].data()};case 1:return function(A,x,D){return _nbind.externalList[x].data(D)};case 2:return function(A,x,D,L){return _nbind.externalList[x].data(D,L)};case 3:return function(A,x,D,L,N){return _nbind.externalList[x].data(D,L,N)};default:break}return buildJSCallerFunction(c,g)}_nbind.makeJSCaller=makeJSCaller;function makeMethodCaller(i,u){var f=u.typeList.length-1,c=u.typeList.slice(0);c.splice(1,0,\"uint32_t\",u.boundID);var g=_nbind.getTypes(c,u.title),t=g[0],C=g.slice(3),A=t.needsWireRead(u.policyTbl),x=anyNeedsWireWrite(C,u.policyTbl),D=u.ptr,L=u.num,N=_nbind.getDynCall(g,u.title),j=~u.flags&1;function $(){throw new Error(\"Calling a non-const method on a const object\")}if(!A&&!x)switch(f){case 0:return function(){return this.__nbindFlags&j?$():N(D,L,_nbind.pushPointer(this,i))};case 1:return function(h){return this.__nbindFlags&j?$():N(D,L,_nbind.pushPointer(this,i),h)};case 2:return function(h,re){return this.__nbindFlags&j?$():N(D,L,_nbind.pushPointer(this,i),h,re)};case 3:return function(h,re,ce){return this.__nbindFlags&j?$():N(D,L,_nbind.pushPointer(this,i),h,re,ce)};default:break}return buildCallerFunction(N,i,D,L,u.policyTbl,x,\"ptr,num,pushPointer(this,ptrType)\",t,C,j,$)}_nbind.makeMethodCaller=makeMethodCaller;function makeCaller(i){var u=i.typeList.length-1,f=_nbind.getTypes(i.typeList,i.title),c=f[0],g=f.slice(1),t=c.needsWireRead(i.policyTbl),C=anyNeedsWireWrite(g,i.policyTbl),A=i.direct,x=i.ptr;if(i.direct&&!t&&!C){var D=_nbind.getDynCall(f,i.title);switch(u){case 0:return function(){return D(A)};case 1:return function($){return D(A,$)};case 2:return function($,h){return D(A,$,h)};case 3:return function($,h,re){return D(A,$,h,re)};default:break}x=0}var L;if(x){var N=i.typeList.slice(0);N.splice(1,0,\"uint32_t\"),f=_nbind.getTypes(N,i.title),L=\"ptr,num\"}else x=A,L=\"ptr\";var j=_nbind.getDynCall(f,i.title);return buildCallerFunction(j,null,x,i.num,i.policyTbl,C,L,c,g)}_nbind.makeCaller=makeCaller;function makeOverloader(i,u){var f=[];function c(){return f[arguments.length].apply(this,arguments)}return c.addMethod=function(g,t){f[t]=g},c.addMethod(i,u),c}_nbind.makeOverloader=makeOverloader;var Resource=function(){function i(u,f){var c=this;this.makeOpen=function(){return Object.keys(c.openTbl).join(\"\")},this.makeClose=function(){return Object.keys(c.closeTbl).join(\"\")},this.openTbl={},this.closeTbl={},u&&(this.openTbl[u]=!0),f&&(this.closeTbl[f]=!0)}return i.prototype.add=function(u){for(var f=0,c=Object.keys(u.openTbl);f<c.length;f++){var g=c[f];this.openTbl[g]=!0}for(var t=0,C=Object.keys(u.closeTbl);t<C.length;t++){var g=C[t];this.closeTbl[g]=!0}},i.prototype.remove=function(u){for(var f=0,c=Object.keys(u.openTbl);f<c.length;f++){var g=c[f];delete this.openTbl[g]}for(var t=0,C=Object.keys(u.closeTbl);t<C.length;t++){var g=C[t];delete this.closeTbl[g]}},i}();_nbind.Resource=Resource;function listResources(i,u){for(var f=new Resource,c=0,g=i;c<g.length;c++)for(var t=g[c],C=0,A=t.readResources||[];C<A.length;C++){var x=A[C];f.add(x)}for(var D=0,L=u;D<L.length;D++)for(var t=L[D],N=0,j=t.writeResources||[];N<j.length;N++){var x=j[N];f.add(x)}return f}_nbind.listResources=listResources,_nbind.resources={pool:new Resource(\"var used=HEAPU32[_nbind.Pool.usedPtr],page=HEAPU32[_nbind.Pool.pagePtr];\",\"_nbind.Pool.lreset(used,page);\")};var ExternalBuffer=function(i){__extends(u,i);function u(f,c){var g=i.call(this,f)||this;return g.ptr=c,g}return u.prototype.free=function(){_free(this.ptr)},u}(_nbind.External);function getBuffer(i){return i instanceof ArrayBuffer?new Uint8Array(i):i instanceof DataView?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):i}function pushBuffer(i,u){if(i==null&&u&&u.Nullable&&(i=[]),typeof i!=\"object\")throw new Error(\"Type mismatch\");var f=i,c=f.byteLength||f.length;if(!c&&c!==0&&f.byteLength!==0)throw new Error(\"Type mismatch\");var g=_nbind.Pool.lalloc(8),t=_malloc(c),C=g/4;return HEAPU32[C++]=c,HEAPU32[C++]=t,HEAPU32[C++]=new ExternalBuffer(i,t).register(),HEAPU8.set(getBuffer(i),t),g}var BufferType=function(i){__extends(u,i);function u(){var f=i!==null&&i.apply(this,arguments)||this;return f.wireWrite=pushBuffer,f.readResources=[_nbind.resources.pool],f.writeResources=[_nbind.resources.pool],f}return u.prototype.makeWireWrite=function(f,c){return function(g){return pushBuffer(g,c)}},u}(_nbind.BindType);_nbind.BufferType=BufferType;function commitBuffer(i,u,f){var c=_nbind.externalList[i].data,g=Buffer;if(typeof Buffer!=\"function\"&&(g=function(){}),!(c instanceof Array)){var t=HEAPU8.subarray(u,u+f);if(c instanceof g){var C=void 0;typeof Buffer.from==\"function\"&&Buffer.from.length>=3?C=Buffer.from(t):C=new Buffer(t),C.copy(c)}else getBuffer(c).set(t)}}_nbind.commitBuffer=commitBuffer;var dirtyList=[],gcTimer=0;function sweep(){for(var i=0,u=dirtyList;i<u.length;i++){var f=u[i];f.__nbindState&(1|2)||f.free()}dirtyList=[],gcTimer=0}_nbind.mark=function(i){};function toggleLightGC(i){i?_nbind.mark=function(u){dirtyList.push(u),gcTimer||(gcTimer=setTimeout(sweep,0))}:_nbind.mark=function(u){}}_nbind.toggleLightGC=toggleLightGC}(_nbind),Module.requestFullScreen=function(u,f,c){Module.printErr(\"Module.requestFullScreen is deprecated. Please call Module.requestFullscreen instead.\"),Module.requestFullScreen=Module.requestFullscreen,Browser.requestFullScreen(u,f,c)},Module.requestFullscreen=function(u,f,c){Browser.requestFullscreen(u,f,c)},Module.requestAnimationFrame=function(u){Browser.requestAnimationFrame(u)},Module.setCanvasSize=function(u,f,c){Browser.setCanvasSize(u,f,c)},Module.pauseMainLoop=function(){Browser.mainLoop.pause()},Module.resumeMainLoop=function(){Browser.mainLoop.resume()},Module.getUserMedia=function(){Browser.getUserMedia()},Module.createContext=function(u,f,c,g){return Browser.createContext(u,f,c,g)},ENVIRONMENT_IS_NODE?_emscripten_get_now=function(){var u=process.hrtime();return u[0]*1e3+u[1]/1e6}:typeof dateNow!=\"undefined\"?_emscripten_get_now=dateNow:typeof self==\"object\"&&self.performance&&typeof self.performance.now==\"function\"?_emscripten_get_now=function(){return self.performance.now()}:typeof performance==\"object\"&&typeof performance.now==\"function\"?_emscripten_get_now=function(){return performance.now()}:_emscripten_get_now=Date.now,__ATEXIT__.push(function(){var i=Module._fflush;i&&i(0);var u=___syscall146.printChar;if(!!u){var f=___syscall146.buffers;f[1].length&&u(1,10),f[2].length&&u(2,10)}}),DYNAMICTOP_PTR=allocate(1,\"i32\",ALLOC_STATIC),STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=Runtime.alignMemory(STACK_MAX),HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE,staticSealed=!0;function invoke_viiiii(i,u,f,c,g,t){try{Module.dynCall_viiiii(i,u,f,c,g,t)}catch(C){if(typeof C!=\"number\"&&C!==\"longjmp\")throw C;Module.setThrew(1,0)}}function invoke_vif(i,u,f){try{Module.dynCall_vif(i,u,f)}catch(c){if(typeof c!=\"number\"&&c!==\"longjmp\")throw c;Module.setThrew(1,0)}}function invoke_vid(i,u,f){try{Module.dynCall_vid(i,u,f)}catch(c){if(typeof c!=\"number\"&&c!==\"longjmp\")throw c;Module.setThrew(1,0)}}function invoke_fiff(i,u,f,c){try{return Module.dynCall_fiff(i,u,f,c)}catch(g){if(typeof g!=\"number\"&&g!==\"longjmp\")throw g;Module.setThrew(1,0)}}function invoke_vi(i,u){try{Module.dynCall_vi(i,u)}catch(f){if(typeof f!=\"number\"&&f!==\"longjmp\")throw f;Module.setThrew(1,0)}}function invoke_vii(i,u,f){try{Module.dynCall_vii(i,u,f)}catch(c){if(typeof c!=\"number\"&&c!==\"longjmp\")throw c;Module.setThrew(1,0)}}function invoke_ii(i,u){try{return Module.dynCall_ii(i,u)}catch(f){if(typeof f!=\"number\"&&f!==\"longjmp\")throw f;Module.setThrew(1,0)}}function invoke_viddi(i,u,f,c,g){try{Module.dynCall_viddi(i,u,f,c,g)}catch(t){if(typeof t!=\"number\"&&t!==\"longjmp\")throw t;Module.setThrew(1,0)}}function invoke_vidd(i,u,f,c){try{Module.dynCall_vidd(i,u,f,c)}catch(g){if(typeof g!=\"number\"&&g!==\"longjmp\")throw g;Module.setThrew(1,0)}}function invoke_iiii(i,u,f,c){try{return Module.dynCall_iiii(i,u,f,c)}catch(g){if(typeof g!=\"number\"&&g!==\"longjmp\")throw g;Module.setThrew(1,0)}}function invoke_diii(i,u,f,c){try{return Module.dynCall_diii(i,u,f,c)}catch(g){if(typeof g!=\"number\"&&g!==\"longjmp\")throw g;Module.setThrew(1,0)}}function invoke_di(i,u){try{return Module.dynCall_di(i,u)}catch(f){if(typeof f!=\"number\"&&f!==\"longjmp\")throw f;Module.setThrew(1,0)}}function invoke_iid(i,u,f){try{return Module.dynCall_iid(i,u,f)}catch(c){if(typeof c!=\"number\"&&c!==\"longjmp\")throw c;Module.setThrew(1,0)}}function invoke_iii(i,u,f){try{return Module.dynCall_iii(i,u,f)}catch(c){if(typeof c!=\"number\"&&c!==\"longjmp\")throw c;Module.setThrew(1,0)}}function invoke_viiddi(i,u,f,c,g,t){try{Module.dynCall_viiddi(i,u,f,c,g,t)}catch(C){if(typeof C!=\"number\"&&C!==\"longjmp\")throw C;Module.setThrew(1,0)}}function invoke_viiiiii(i,u,f,c,g,t,C){try{Module.dynCall_viiiiii(i,u,f,c,g,t,C)}catch(A){if(typeof A!=\"number\"&&A!==\"longjmp\")throw A;Module.setThrew(1,0)}}function invoke_dii(i,u,f){try{return Module.dynCall_dii(i,u,f)}catch(c){if(typeof c!=\"number\"&&c!==\"longjmp\")throw c;Module.setThrew(1,0)}}function invoke_i(i){try{return Module.dynCall_i(i)}catch(u){if(typeof u!=\"number\"&&u!==\"longjmp\")throw u;Module.setThrew(1,0)}}function invoke_iiiiii(i,u,f,c,g,t){try{return Module.dynCall_iiiiii(i,u,f,c,g,t)}catch(C){if(typeof C!=\"number\"&&C!==\"longjmp\")throw C;Module.setThrew(1,0)}}function invoke_viiid(i,u,f,c,g){try{Module.dynCall_viiid(i,u,f,c,g)}catch(t){if(typeof t!=\"number\"&&t!==\"longjmp\")throw t;Module.setThrew(1,0)}}function invoke_viififi(i,u,f,c,g,t,C){try{Module.dynCall_viififi(i,u,f,c,g,t,C)}catch(A){if(typeof A!=\"number\"&&A!==\"longjmp\")throw A;Module.setThrew(1,0)}}function invoke_viii(i,u,f,c){try{Module.dynCall_viii(i,u,f,c)}catch(g){if(typeof g!=\"number\"&&g!==\"longjmp\")throw g;Module.setThrew(1,0)}}function invoke_v(i){try{Module.dynCall_v(i)}catch(u){if(typeof u!=\"number\"&&u!==\"longjmp\")throw u;Module.setThrew(1,0)}}function invoke_viid(i,u,f,c){try{Module.dynCall_viid(i,u,f,c)}catch(g){if(typeof g!=\"number\"&&g!==\"longjmp\")throw g;Module.setThrew(1,0)}}function invoke_idd(i,u,f){try{return Module.dynCall_idd(i,u,f)}catch(c){if(typeof c!=\"number\"&&c!==\"longjmp\")throw c;Module.setThrew(1,0)}}function invoke_viiii(i,u,f,c,g){try{Module.dynCall_viiii(i,u,f,c,g)}catch(t){if(typeof t!=\"number\"&&t!==\"longjmp\")throw t;Module.setThrew(1,0)}}Module.asmGlobalArg={Math,Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Float32Array,Float64Array,NaN:NaN,Infinity:Infinity},Module.asmLibraryArg={abort,assert,enlargeMemory,getTotalMemory,abortOnCannotGrowMemory,invoke_viiiii,invoke_vif,invoke_vid,invoke_fiff,invoke_vi,invoke_vii,invoke_ii,invoke_viddi,invoke_vidd,invoke_iiii,invoke_diii,invoke_di,invoke_iid,invoke_iii,invoke_viiddi,invoke_viiiiii,invoke_dii,invoke_i,invoke_iiiiii,invoke_viiid,invoke_viififi,invoke_viii,invoke_v,invoke_viid,invoke_idd,invoke_viiii,_emscripten_asm_const_iiiii,_emscripten_asm_const_iiidddddd,_emscripten_asm_const_iiiid,__nbind_reference_external,_emscripten_asm_const_iiiiiiii,_removeAccessorPrefix,_typeModule,__nbind_register_pool,__decorate,_llvm_stackrestore,___cxa_atexit,__extends,__nbind_get_value_object,__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj,_emscripten_set_main_loop_timing,__nbind_register_primitive,__nbind_register_type,_emscripten_memcpy_big,__nbind_register_function,___setErrNo,__nbind_register_class,__nbind_finish,_abort,_nbind_value,_llvm_stacksave,___syscall54,_defineHidden,_emscripten_set_main_loop,_emscripten_get_now,__nbind_register_callback_signature,_emscripten_asm_const_iiiiii,__nbind_free_external,_emscripten_asm_const_iiii,_emscripten_asm_const_iiididi,___syscall6,_atexit,___syscall140,___syscall146,DYNAMICTOP_PTR,tempDoublePtr,ABORT,STACKTOP,STACK_MAX,cttz_i8,___dso_handle};var asm=function(i,u,f){var c=new i.Int8Array(f),g=new i.Int16Array(f),t=new i.Int32Array(f),C=new i.Uint8Array(f),A=new i.Uint16Array(f),x=new i.Uint32Array(f),D=new i.Float32Array(f),L=new i.Float64Array(f),N=u.DYNAMICTOP_PTR|0,j=u.tempDoublePtr|0,$=u.ABORT|0,h=u.STACKTOP|0,re=u.STACK_MAX|0,ce=u.cttz_i8|0,Q=u.___dso_handle|0,oe=0,Se=0,me=0,De=0,J=i.NaN,Te=i.Infinity,Oe=0,Le=0,ot=0,ct=0,Ue=0,be=0,At=i.Math.floor,Ot=i.Math.abs,Nt=i.Math.sqrt,Je=i.Math.pow,V=i.Math.cos,ne=i.Math.sin,ge=i.Math.tan,Z=i.Math.acos,Ae=i.Math.asin,at=i.Math.atan,it=i.Math.atan2,Ft=i.Math.exp,jt=i.Math.log,hn=i.Math.ceil,Un=i.Math.imul,Jt=i.Math.min,Yt=i.Math.max,cr=i.Math.clz32,w=i.Math.fround,pt=u.abort,Mn=u.assert,Bn=u.enlargeMemory,Xn=u.getTotalMemory,vr=u.abortOnCannotGrowMemory,gr=u.invoke_viiiii,r0=u.invoke_vif,Ci=u.invoke_vid,yo=u.invoke_fiff,Ds=u.invoke_vi,Mu=u.invoke_vii,Gf=u.invoke_ii,iu=u.invoke_viddi,ou=u.invoke_vidd,ol=u.invoke_iiii,ul=u.invoke_diii,Es=u.invoke_di,Uo=u.invoke_iid,sl=u.invoke_iii,Ss=u.invoke_viiddi,Cs=u.invoke_viiiiii,Ti=u.invoke_dii,Fu=u.invoke_i,ll=u.invoke_iiiiii,fl=u.invoke_viiid,cl=u.invoke_viififi,al=u.invoke_viii,Ui=u.invoke_v,Mr=u.invoke_viid,Ac=u.invoke_idd,of=u.invoke_viiii,Ts=u._emscripten_asm_const_iiiii,xs=u._emscripten_asm_const_iiidddddd,dl=u._emscripten_asm_const_iiiid,qi=u.__nbind_reference_external,qo=u._emscripten_asm_const_iiiiiiii,kr=u._removeAccessorPrefix,Fr=u._typeModule,si=u.__nbind_register_pool,H0=u.__decorate,b0=u._llvm_stackrestore,Bt=u.___cxa_atexit,Lu=u.__extends,c0=u.__nbind_get_value_object,Ru=u.__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj,ks=u._emscripten_set_main_loop_timing,As=u.__nbind_register_primitive,uu=u.__nbind_register_type,wo=u._emscripten_memcpy_big,zo=u.__nbind_register_function,Os=u.___setErrNo,Is=u.__nbind_register_class,uf=u.__nbind_finish,_n=u._abort,Nu=u._nbind_value,Wo=u._llvm_stacksave,su=u.___syscall54,Ps=u._defineHidden,pl=u._emscripten_set_main_loop,Vf=u._emscripten_get_now,hl=u.__nbind_register_callback_signature,Bu=u._emscripten_asm_const_iiiiii,ju=u.__nbind_free_external,sf=u._emscripten_asm_const_iiii,ro=u._emscripten_asm_const_iiididi,Ms=u.___syscall6,ml=u._atexit,Uu=u.___syscall140,G0=u.___syscall146,Fs=w(0);let tt=w(0);function zi(e){e=e|0;var n=0;return n=h,h=h+e|0,h=h+15&-16,n|0}function lu(){return h|0}function Ho(e){e=e|0,h=e}function O0(e,n){e=e|0,n=n|0,h=e,re=n}function vl(e,n){e=e|0,n=n|0,oe||(oe=e,Se=n)}function gl(e){e=e|0,be=e}function fu(){return be|0}function _l(){var e=0,n=0;vn(8104,8,400)|0,vn(8504,408,540)|0,e=9044,n=e+44|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));c[9088]=0,c[9089]=1,t[2273]=0,t[2274]=948,t[2275]=948,Bt(17,8104,Q|0)|0}function Sn(e){e=e|0,lf(e+948|0)}function gt(e){return e=w(e),((Ar(e)|0)&2147483647)>>>0>2139095040|0}function en(e,n,r){e=e|0,n=n|0,r=r|0;e:do if(t[e+(n<<3)+4>>2]|0)e=e+(n<<3)|0;else{if((n|2|0)==3?t[e+60>>2]|0:0){e=e+56|0;break}switch(n|0){case 0:case 2:case 4:case 5:{if(t[e+52>>2]|0){e=e+48|0;break e}break}default:}if(t[e+68>>2]|0){e=e+64|0;break}else{e=(n|1|0)==5?948:r;break}}while(0);return e|0}function I0(e){e=e|0;var n=0;return n=uh(1e3)|0,li(e,(n|0)!=0,2456),t[2276]=(t[2276]|0)+1,vn(n|0,8104,1e3)|0,c[e+2>>0]|0&&(t[n+4>>2]=2,t[n+12>>2]=4),t[n+976>>2]=e,n|0}function li(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0;s=h,h=h+16|0,o=s,n||(t[o>>2]=r,zs(e,5,3197,o)),h=s}function qu(){return I0(956)|0}function Wi(e){e=e|0;var n=0;return n=Tt(1e3)|0,zu(n,e),li(t[e+976>>2]|0,1,2456),t[2276]=(t[2276]|0)+1,t[n+944>>2]=0,n|0}function zu(e,n){e=e|0,n=n|0;var r=0;vn(e|0,n|0,948)|0,af(e+948|0,n+948|0),r=e+960|0,e=n+960|0,n=r+40|0;do t[r>>2]=t[e>>2],r=r+4|0,e=e+4|0;while((r|0)<(n|0))}function Wu(e){e=e|0;var n=0,r=0,o=0,s=0;if(n=e+944|0,r=t[n>>2]|0,r|0&&(Ls(r+948|0,e)|0,t[n>>2]=0),r=fi(e)|0,r|0){n=0;do t[(e0(e,n)|0)+944>>2]=0,n=n+1|0;while((n|0)!=(r|0))}r=e+948|0,o=t[r>>2]|0,s=e+952|0,n=t[s>>2]|0,(n|0)!=(o|0)&&(t[s>>2]=n+(~((n+-4-o|0)>>>2)<<2)),io(r),sh(e),t[2276]=(t[2276]|0)+-1}function Ls(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0;o=t[e>>2]|0,_=e+4|0,r=t[_>>2]|0,l=r;e:do if((o|0)==(r|0))s=o,d=4;else for(e=o;;){if((t[e>>2]|0)==(n|0)){s=e,d=4;break e}if(e=e+4|0,(e|0)==(r|0)){e=0;break}}while(0);return(d|0)==4&&((s|0)!=(r|0)?(o=s+4|0,e=l-o|0,n=e>>2,n&&(Y1(s|0,o|0,e|0)|0,r=t[_>>2]|0),e=s+(n<<2)|0,(r|0)==(e|0)||(t[_>>2]=r+(~((r+-4-e|0)>>>2)<<2)),e=1):e=0),e|0}function fi(e){return e=e|0,(t[e+952>>2]|0)-(t[e+948>>2]|0)>>2|0}function e0(e,n){e=e|0,n=n|0;var r=0;return r=t[e+948>>2]|0,(t[e+952>>2]|0)-r>>2>>>0>n>>>0?e=t[r+(n<<2)>>2]|0:e=0,e|0}function io(e){e=e|0;var n=0,r=0,o=0,s=0;o=h,h=h+32|0,n=o,s=t[e>>2]|0,r=(t[e+4>>2]|0)-s|0,((t[e+8>>2]|0)-s|0)>>>0>r>>>0&&(s=r>>2,z(n,s,s,e+8|0),dr(e,n),Or(n)),h=o}function D0(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0;k=fi(e)|0;do if(k|0){if((t[(e0(e,0)|0)+944>>2]|0)==(e|0)){if(!(Ls(e+948|0,n)|0))break;vn(n+400|0,8504,540)|0,t[n+944>>2]=0,ln(e);break}d=t[(t[e+976>>2]|0)+12>>2]|0,_=e+948|0,y=(d|0)==0,r=0,l=0;do o=t[(t[_>>2]|0)+(l<<2)>>2]|0,(o|0)==(n|0)?ln(e):(s=Wi(o)|0,t[(t[_>>2]|0)+(r<<2)>>2]=s,t[s+944>>2]=e,y||Q4[d&15](o,s,e,r),r=r+1|0),l=l+1|0;while((l|0)!=(k|0));if(r>>>0<k>>>0){y=e+948|0,_=e+952|0,d=r,r=t[_>>2]|0;do l=(t[y>>2]|0)+(d<<2)|0,o=l+4|0,s=r-o|0,n=s>>2,n&&(Y1(l|0,o|0,s|0)|0,r=t[_>>2]|0),s=r,o=l+(n<<2)|0,(s|0)!=(o|0)&&(r=s+(~((s+-4-o|0)>>>2)<<2)|0,t[_>>2]=r),d=d+1|0;while((d|0)!=(k|0))}}while(0)}function Do(e){e=e|0;var n=0,r=0,o=0,s=0;i0(e,(fi(e)|0)==0,2491),i0(e,(t[e+944>>2]|0)==0,2545),n=e+948|0,r=t[n>>2]|0,o=e+952|0,s=t[o>>2]|0,(s|0)!=(r|0)&&(t[o>>2]=s+(~((s+-4-r|0)>>>2)<<2)),io(n),n=e+976|0,r=t[n>>2]|0,vn(e|0,8104,1e3)|0,c[r+2>>0]|0&&(t[e+4>>2]=2,t[e+12>>2]=4),t[n>>2]=r}function i0(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0;s=h,h=h+16|0,o=s,n||(t[o>>2]=r,wn(e,5,3197,o)),h=s}function Rs(){return t[2276]|0}function a0(){var e=0;return e=uh(20)|0,Hu((e|0)!=0,2592),t[2277]=(t[2277]|0)+1,t[e>>2]=t[239],t[e+4>>2]=t[240],t[e+8>>2]=t[241],t[e+12>>2]=t[242],t[e+16>>2]=t[243],e|0}function Hu(e,n){e=e|0,n=n|0;var r=0,o=0;o=h,h=h+16|0,r=o,e||(t[r>>2]=n,wn(0,5,3197,r)),h=o}function V0(e){e=e|0,sh(e),t[2277]=(t[2277]|0)+-1}function bu(e,n){e=e|0,n=n|0;var r=0;n?(i0(e,(fi(e)|0)==0,2629),r=1):(r=0,n=0),t[e+964>>2]=n,t[e+988>>2]=r}function Ns(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;o=h,h=h+16|0,l=o+8|0,s=o+4|0,d=o,t[s>>2]=n,i0(e,(t[n+944>>2]|0)==0,2709),i0(e,(t[e+964>>2]|0)==0,2763),bo(e),n=e+948|0,t[d>>2]=(t[n>>2]|0)+(r<<2),t[l>>2]=t[d>>2],P0(n,l,s)|0,t[(t[s>>2]|0)+944>>2]=e,ln(e),h=o}function bo(e){e=e|0;var n=0,r=0,o=0,s=0,l=0,d=0,_=0;if(r=fi(e)|0,r|0?(t[(e0(e,0)|0)+944>>2]|0)!=(e|0):0){o=t[(t[e+976>>2]|0)+12>>2]|0,s=e+948|0,l=(o|0)==0,n=0;do d=t[(t[s>>2]|0)+(n<<2)>>2]|0,_=Wi(d)|0,t[(t[s>>2]|0)+(n<<2)>>2]=_,t[_+944>>2]=e,l||Q4[o&15](d,_,e,n),n=n+1|0;while((n|0)!=(r|0))}}function P0(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0,we=0,le=0,ie=0,Pe=0,ke=0;Pe=h,h=h+64|0,P=Pe+52|0,_=Pe+48|0,q=Pe+28|0,we=Pe+24|0,le=Pe+20|0,ie=Pe,o=t[e>>2]|0,l=o,n=o+((t[n>>2]|0)-l>>2<<2)|0,o=e+4|0,s=t[o>>2]|0,d=e+8|0;do if(s>>>0<(t[d>>2]|0)>>>0){if((n|0)==(s|0)){t[n>>2]=t[r>>2],t[o>>2]=(t[o>>2]|0)+4;break}Qn(e,n,s,n+4|0),n>>>0<=r>>>0&&(r=(t[o>>2]|0)>>>0>r>>>0?r+4|0:r),t[n>>2]=t[r>>2]}else{o=(s-l>>2)+1|0,s=Q0(e)|0,s>>>0<o>>>0&&$n(e),T=t[e>>2]|0,k=(t[d>>2]|0)-T|0,l=k>>1,z(ie,k>>2>>>0<s>>>1>>>0?l>>>0<o>>>0?o:l:s,n-T>>2,e+8|0),T=ie+8|0,o=t[T>>2]|0,l=ie+12|0,k=t[l>>2]|0,d=k,y=o;do if((o|0)==(k|0)){if(k=ie+4|0,o=t[k>>2]|0,ke=t[ie>>2]|0,s=ke,o>>>0<=ke>>>0){o=d-s>>1,o=(o|0)==0?1:o,z(q,o,o>>>2,t[ie+16>>2]|0),t[we>>2]=t[k>>2],t[le>>2]=t[T>>2],t[_>>2]=t[we>>2],t[P>>2]=t[le>>2],s0(q,_,P),o=t[ie>>2]|0,t[ie>>2]=t[q>>2],t[q>>2]=o,o=q+4|0,ke=t[k>>2]|0,t[k>>2]=t[o>>2],t[o>>2]=ke,o=q+8|0,ke=t[T>>2]|0,t[T>>2]=t[o>>2],t[o>>2]=ke,o=q+12|0,ke=t[l>>2]|0,t[l>>2]=t[o>>2],t[o>>2]=ke,Or(q),o=t[T>>2]|0;break}l=o,d=((l-s>>2)+1|0)/-2|0,_=o+(d<<2)|0,s=y-l|0,l=s>>2,l&&(Y1(_|0,o|0,s|0)|0,o=t[k>>2]|0),ke=_+(l<<2)|0,t[T>>2]=ke,t[k>>2]=o+(d<<2),o=ke}while(0);t[o>>2]=t[r>>2],t[T>>2]=(t[T>>2]|0)+4,n=nn(e,ie,n)|0,Or(ie)}while(0);return h=Pe,n|0}function ln(e){e=e|0;var n=0;do{if(n=e+984|0,c[n>>0]|0)break;c[n>>0]=1,D[e+504>>2]=w(J),e=t[e+944>>2]|0}while((e|0)!=0)}function lf(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-4-o|0)>>>2)<<2)),Ve(r))}function nr(e){return e=e|0,t[e+944>>2]|0}function rr(e){e=e|0,i0(e,(t[e+964>>2]|0)!=0,2832),ln(e)}function Go(e){return e=e|0,(c[e+984>>0]|0)!=0|0}function Gu(e,n){e=e|0,n=n|0,fL(e,n,400)|0&&(vn(e|0,n|0,400)|0,ln(e))}function yl(e){e=e|0;var n=tt;return n=w(D[e+44>>2]),e=gt(n)|0,w(e?w(0):n)}function cu(e){e=e|0;var n=tt;return n=w(D[e+48>>2]),gt(n)|0&&(n=c[(t[e+976>>2]|0)+2>>0]|0?w(1):w(0)),w(n)}function Bs(e,n){e=e|0,n=n|0,t[e+980>>2]=n}function Vu(e){return e=e|0,t[e+980>>2]|0}function M0(e,n){e=e|0,n=n|0;var r=0;r=e+4|0,(t[r>>2]|0)!=(n|0)&&(t[r>>2]=n,ln(e))}function au(e){return e=e|0,t[e+4>>2]|0}function Lr(e,n){e=e|0,n=n|0;var r=0;r=e+8|0,(t[r>>2]|0)!=(n|0)&&(t[r>>2]=n,ln(e))}function F(e){return e=e|0,t[e+8>>2]|0}function R(e,n){e=e|0,n=n|0;var r=0;r=e+12|0,(t[r>>2]|0)!=(n|0)&&(t[r>>2]=n,ln(e))}function U(e){return e=e|0,t[e+12>>2]|0}function H(e,n){e=e|0,n=n|0;var r=0;r=e+16|0,(t[r>>2]|0)!=(n|0)&&(t[r>>2]=n,ln(e))}function fe(e){return e=e|0,t[e+16>>2]|0}function ue(e,n){e=e|0,n=n|0;var r=0;r=e+20|0,(t[r>>2]|0)!=(n|0)&&(t[r>>2]=n,ln(e))}function de(e){return e=e|0,t[e+20>>2]|0}function W(e,n){e=e|0,n=n|0;var r=0;r=e+24|0,(t[r>>2]|0)!=(n|0)&&(t[r>>2]=n,ln(e))}function ve(e){return e=e|0,t[e+24>>2]|0}function Fe(e,n){e=e|0,n=n|0;var r=0;r=e+28|0,(t[r>>2]|0)!=(n|0)&&(t[r>>2]=n,ln(e))}function Ge(e){return e=e|0,t[e+28>>2]|0}function K(e,n){e=e|0,n=n|0;var r=0;r=e+32|0,(t[r>>2]|0)!=(n|0)&&(t[r>>2]=n,ln(e))}function xe(e){return e=e|0,t[e+32>>2]|0}function je(e,n){e=e|0,n=n|0;var r=0;r=e+36|0,(t[r>>2]|0)!=(n|0)&&(t[r>>2]=n,ln(e))}function Xe(e){return e=e|0,t[e+36>>2]|0}function rt(e,n){e=e|0,n=w(n);var r=0;r=e+40|0,w(D[r>>2])!=n&&(D[r>>2]=n,ln(e))}function st(e,n){e=e|0,n=w(n);var r=0;r=e+44|0,w(D[r>>2])!=n&&(D[r>>2]=n,ln(e))}function xt(e,n){e=e|0,n=w(n);var r=0;r=e+48|0,w(D[r>>2])!=n&&(D[r>>2]=n,ln(e))}function wt(e,n){e=e|0,n=w(n);var r=0,o=0,s=0,l=0;l=gt(n)|0,r=(l^1)&1,o=e+52|0,s=e+56|0,(l|w(D[o>>2])==n?(t[s>>2]|0)==(r|0):0)||(D[o>>2]=n,t[s>>2]=r,ln(e))}function lt(e,n){e=e|0,n=w(n);var r=0,o=0;o=e+52|0,r=e+56|0,(w(D[o>>2])==n?(t[r>>2]|0)==2:0)||(D[o>>2]=n,o=gt(n)|0,t[r>>2]=o?3:2,ln(e))}function Rt(e,n){e=e|0,n=n|0;var r=0,o=0;o=n+52|0,r=t[o+4>>2]|0,n=e,t[n>>2]=t[o>>2],t[n+4>>2]=r}function yn(e,n,r){e=e|0,n=n|0,r=w(r);var o=0,s=0,l=0;l=gt(r)|0,o=(l^1)&1,s=e+132+(n<<3)|0,n=e+132+(n<<3)+4|0,(l|w(D[s>>2])==r?(t[n>>2]|0)==(o|0):0)||(D[s>>2]=r,t[n>>2]=o,ln(e))}function sn(e,n,r){e=e|0,n=n|0,r=w(r);var o=0,s=0,l=0;l=gt(r)|0,o=l?0:2,s=e+132+(n<<3)|0,n=e+132+(n<<3)+4|0,(l|w(D[s>>2])==r?(t[n>>2]|0)==(o|0):0)||(D[s>>2]=r,t[n>>2]=o,ln(e))}function ar(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=n+132+(r<<3)|0,n=t[o+4>>2]|0,r=e,t[r>>2]=t[o>>2],t[r+4>>2]=n}function rn(e,n,r){e=e|0,n=n|0,r=w(r);var o=0,s=0,l=0;l=gt(r)|0,o=(l^1)&1,s=e+60+(n<<3)|0,n=e+60+(n<<3)+4|0,(l|w(D[s>>2])==r?(t[n>>2]|0)==(o|0):0)||(D[s>>2]=r,t[n>>2]=o,ln(e))}function Hn(e,n,r){e=e|0,n=n|0,r=w(r);var o=0,s=0,l=0;l=gt(r)|0,o=l?0:2,s=e+60+(n<<3)|0,n=e+60+(n<<3)+4|0,(l|w(D[s>>2])==r?(t[n>>2]|0)==(o|0):0)||(D[s>>2]=r,t[n>>2]=o,ln(e))}function d0(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=n+60+(r<<3)|0,n=t[o+4>>2]|0,r=e,t[r>>2]=t[o>>2],t[r+4>>2]=n}function Cr(e,n){e=e|0,n=n|0;var r=0;r=e+60+(n<<3)+4|0,(t[r>>2]|0)!=3&&(D[e+60+(n<<3)>>2]=w(J),t[r>>2]=3,ln(e))}function He(e,n,r){e=e|0,n=n|0,r=w(r);var o=0,s=0,l=0;l=gt(r)|0,o=(l^1)&1,s=e+204+(n<<3)|0,n=e+204+(n<<3)+4|0,(l|w(D[s>>2])==r?(t[n>>2]|0)==(o|0):0)||(D[s>>2]=r,t[n>>2]=o,ln(e))}function Qe(e,n,r){e=e|0,n=n|0,r=w(r);var o=0,s=0,l=0;l=gt(r)|0,o=l?0:2,s=e+204+(n<<3)|0,n=e+204+(n<<3)+4|0,(l|w(D[s>>2])==r?(t[n>>2]|0)==(o|0):0)||(D[s>>2]=r,t[n>>2]=o,ln(e))}function Ne(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=n+204+(r<<3)|0,n=t[o+4>>2]|0,r=e,t[r>>2]=t[o>>2],t[r+4>>2]=n}function ft(e,n,r){e=e|0,n=n|0,r=w(r);var o=0,s=0,l=0;l=gt(r)|0,o=(l^1)&1,s=e+276+(n<<3)|0,n=e+276+(n<<3)+4|0,(l|w(D[s>>2])==r?(t[n>>2]|0)==(o|0):0)||(D[s>>2]=r,t[n>>2]=o,ln(e))}function St(e,n){return e=e|0,n=n|0,w(D[e+276+(n<<3)>>2])}function Qt(e,n){e=e|0,n=w(n);var r=0,o=0,s=0,l=0;l=gt(n)|0,r=(l^1)&1,o=e+348|0,s=e+352|0,(l|w(D[o>>2])==n?(t[s>>2]|0)==(r|0):0)||(D[o>>2]=n,t[s>>2]=r,ln(e))}function Cn(e,n){e=e|0,n=w(n);var r=0,o=0;o=e+348|0,r=e+352|0,(w(D[o>>2])==n?(t[r>>2]|0)==2:0)||(D[o>>2]=n,o=gt(n)|0,t[r>>2]=o?3:2,ln(e))}function bn(e){e=e|0;var n=0;n=e+352|0,(t[n>>2]|0)!=3&&(D[e+348>>2]=w(J),t[n>>2]=3,ln(e))}function p0(e,n){e=e|0,n=n|0;var r=0,o=0;o=n+348|0,r=t[o+4>>2]|0,n=e,t[n>>2]=t[o>>2],t[n+4>>2]=r}function h0(e,n){e=e|0,n=w(n);var r=0,o=0,s=0,l=0;l=gt(n)|0,r=(l^1)&1,o=e+356|0,s=e+360|0,(l|w(D[o>>2])==n?(t[s>>2]|0)==(r|0):0)||(D[o>>2]=n,t[s>>2]=r,ln(e))}function ci(e,n){e=e|0,n=w(n);var r=0,o=0;o=e+356|0,r=e+360|0,(w(D[o>>2])==n?(t[r>>2]|0)==2:0)||(D[o>>2]=n,o=gt(n)|0,t[r>>2]=o?3:2,ln(e))}function xi(e){e=e|0;var n=0;n=e+360|0,(t[n>>2]|0)!=3&&(D[e+356>>2]=w(J),t[n>>2]=3,ln(e))}function E0(e,n){e=e|0,n=n|0;var r=0,o=0;o=n+356|0,r=t[o+4>>2]|0,n=e,t[n>>2]=t[o>>2],t[n+4>>2]=r}function qr(e,n){e=e|0,n=w(n);var r=0,o=0,s=0,l=0;l=gt(n)|0,r=(l^1)&1,o=e+364|0,s=e+368|0,(l|w(D[o>>2])==n?(t[s>>2]|0)==(r|0):0)||(D[o>>2]=n,t[s>>2]=r,ln(e))}function Eo(e,n){e=e|0,n=w(n);var r=0,o=0,s=0,l=0;l=gt(n)|0,r=l?0:2,o=e+364|0,s=e+368|0,(l|w(D[o>>2])==n?(t[s>>2]|0)==(r|0):0)||(D[o>>2]=n,t[s>>2]=r,ln(e))}function So(e,n){e=e|0,n=n|0;var r=0,o=0;o=n+364|0,r=t[o+4>>2]|0,n=e,t[n>>2]=t[o>>2],t[n+4>>2]=r}function wl(e,n){e=e|0,n=w(n);var r=0,o=0,s=0,l=0;l=gt(n)|0,r=(l^1)&1,o=e+372|0,s=e+376|0,(l|w(D[o>>2])==n?(t[s>>2]|0)==(r|0):0)||(D[o>>2]=n,t[s>>2]=r,ln(e))}function js(e,n){e=e|0,n=w(n);var r=0,o=0,s=0,l=0;l=gt(n)|0,r=l?0:2,o=e+372|0,s=e+376|0,(l|w(D[o>>2])==n?(t[s>>2]|0)==(r|0):0)||(D[o>>2]=n,t[s>>2]=r,ln(e))}function Dl(e,n){e=e|0,n=n|0;var r=0,o=0;o=n+372|0,r=t[o+4>>2]|0,n=e,t[n>>2]=t[o>>2],t[n+4>>2]=r}function du(e,n){e=e|0,n=w(n);var r=0,o=0,s=0,l=0;l=gt(n)|0,r=(l^1)&1,o=e+380|0,s=e+384|0,(l|w(D[o>>2])==n?(t[s>>2]|0)==(r|0):0)||(D[o>>2]=n,t[s>>2]=r,ln(e))}function Yu(e,n){e=e|0,n=w(n);var r=0,o=0,s=0,l=0;l=gt(n)|0,r=l?0:2,o=e+380|0,s=e+384|0,(l|w(D[o>>2])==n?(t[s>>2]|0)==(r|0):0)||(D[o>>2]=n,t[s>>2]=r,ln(e))}function Us(e,n){e=e|0,n=n|0;var r=0,o=0;o=n+380|0,r=t[o+4>>2]|0,n=e,t[n>>2]=t[o>>2],t[n+4>>2]=r}function oo(e,n){e=e|0,n=w(n);var r=0,o=0,s=0,l=0;l=gt(n)|0,r=(l^1)&1,o=e+388|0,s=e+392|0,(l|w(D[o>>2])==n?(t[s>>2]|0)==(r|0):0)||(D[o>>2]=n,t[s>>2]=r,ln(e))}function Hi(e,n){e=e|0,n=w(n);var r=0,o=0,s=0,l=0;l=gt(n)|0,r=l?0:2,o=e+388|0,s=e+392|0,(l|w(D[o>>2])==n?(t[s>>2]|0)==(r|0):0)||(D[o>>2]=n,t[s>>2]=r,ln(e))}function qs(e,n){e=e|0,n=n|0;var r=0,o=0;o=n+388|0,r=t[o+4>>2]|0,n=e,t[n>>2]=t[o>>2],t[n+4>>2]=r}function F0(e,n){e=e|0,n=w(n);var r=0;r=e+396|0,w(D[r>>2])!=n&&(D[r>>2]=n,ln(e))}function Gr(e){return e=e|0,w(D[e+396>>2])}function ir(e){return e=e|0,w(D[e+400>>2])}function L0(e){return e=e|0,w(D[e+404>>2])}function Y0(e){return e=e|0,w(D[e+408>>2])}function Co(e){return e=e|0,w(D[e+412>>2])}function $u(e){return e=e|0,w(D[e+416>>2])}function Vo(e){return e=e|0,w(D[e+420>>2])}function Rr(e,n){switch(e=e|0,n=n|0,i0(e,(n|0)<6,2918),n|0){case 0:{n=(t[e+496>>2]|0)==2?5:4;break}case 2:{n=(t[e+496>>2]|0)==2?4:5;break}default:}return w(D[e+424+(n<<2)>>2])}function Jn(e,n){switch(e=e|0,n=n|0,i0(e,(n|0)<6,2918),n|0){case 0:{n=(t[e+496>>2]|0)==2?5:4;break}case 2:{n=(t[e+496>>2]|0)==2?4:5;break}default:}return w(D[e+448+(n<<2)>>2])}function ai(e,n){switch(e=e|0,n=n|0,i0(e,(n|0)<6,2918),n|0){case 0:{n=(t[e+496>>2]|0)==2?5:4;break}case 2:{n=(t[e+496>>2]|0)==2?4:5;break}default:}return w(D[e+472+(n<<2)>>2])}function o0(e,n){e=e|0,n=n|0;var r=0,o=tt;return r=t[e+4>>2]|0,(r|0)==(t[n+4>>2]|0)?r?(o=w(D[e>>2]),e=w(Ot(w(o-w(D[n>>2]))))<w(999999974e-13)):e=1:e=0,e|0}function Vr(e,n){e=w(e),n=w(n);var r=0;return gt(e)|0?r=gt(n)|0:r=w(Ot(w(e-n)))<w(999999974e-13),r|0}function ff(e,n){e=e|0,n=n|0,cf(e,n)}function cf(e,n){e=e|0,n=n|0;var r=0,o=0;r=h,h=h+16|0,o=r+4|0,t[o>>2]=0,t[o+4>>2]=0,t[o+8>>2]=0,Ru(o|0,e|0,n|0,0),wn(e,3,(c[o+11>>0]|0)<0?t[o>>2]|0:o,r),ML(o),h=r}function $0(e,n,r,o){e=w(e),n=w(n),r=r|0,o=o|0;var s=tt;e=w(e*n),s=w(V4(e,w(1)));do if(Vr(s,w(0))|0)e=w(e-s);else{if(e=w(e-s),Vr(s,w(1))|0){e=w(e+w(1));break}if(r){e=w(e+w(1));break}o||(s>w(.5)?s=w(1):(o=Vr(s,w(.5))|0,s=w(o?1:0)),e=w(e+s))}while(0);return w(e/n)}function K0(e,n,r,o,s,l,d,_,y,k,T,P,q){e=e|0,n=w(n),r=r|0,o=w(o),s=s|0,l=w(l),d=d|0,_=w(_),y=w(y),k=w(k),T=w(T),P=w(P),q=q|0;var we=0,le=tt,ie=tt,Pe=tt,ke=tt,qe=tt,pe=tt;return y<w(0)|k<w(0)?q=0:(((q|0)!=0?(le=w(D[q+4>>2]),le!=w(0)):0)?(Pe=w($0(n,le,0,0)),ke=w($0(o,le,0,0)),ie=w($0(l,le,0,0)),le=w($0(_,le,0,0))):(ie=l,Pe=n,le=_,ke=o),(s|0)==(e|0)?we=Vr(ie,Pe)|0:we=0,(d|0)==(r|0)?q=Vr(le,ke)|0:q=0,((we?0:(qe=w(n-T),!(ae(e,qe,y)|0)))?!(Be(e,qe,s,y)|0):0)?we=Ie(e,qe,s,l,y)|0:we=1,((q?0:(pe=w(o-P),!(ae(r,pe,k)|0)))?!(Be(r,pe,d,k)|0):0)?q=Ie(r,pe,d,_,k)|0:q=1,q=we&q),q|0}function ae(e,n,r){return e=e|0,n=w(n),r=w(r),(e|0)==1?e=Vr(n,r)|0:e=0,e|0}function Be(e,n,r,o){return e=e|0,n=w(n),r=r|0,o=w(o),(e|0)==2&(r|0)==0?n>=o?e=1:e=Vr(n,o)|0:e=0,e|0}function Ie(e,n,r,o,s){return e=e|0,n=w(n),r=r|0,o=w(o),s=w(s),(e|0)==2&(r|0)==2&o>n?s<=n?e=1:e=Vr(n,s)|0:e=0,e|0}function ht(e,n,r,o,s,l,d,_,y,k,T){e=e|0,n=w(n),r=w(r),o=o|0,s=s|0,l=l|0,d=w(d),_=w(_),y=y|0,k=k|0,T=T|0;var P=0,q=0,we=0,le=0,ie=tt,Pe=tt,ke=0,qe=0,pe=0,_e=0,vt=0,Ln=0,Ht=0,It=0,gn=0,Pn=0,zt=0,Dr=tt,Ki=tt,Xi=tt,Ji=0,Ro=0;zt=h,h=h+160|0,It=zt+152|0,Ht=zt+120|0,Ln=zt+104|0,pe=zt+72|0,le=zt+56|0,vt=zt+8|0,qe=zt,_e=(t[2279]|0)+1|0,t[2279]=_e,gn=e+984|0,((c[gn>>0]|0)!=0?(t[e+512>>2]|0)!=(t[2278]|0):0)?ke=4:(t[e+516>>2]|0)==(o|0)?Pn=0:ke=4,(ke|0)==4&&(t[e+520>>2]=0,t[e+924>>2]=-1,t[e+928>>2]=-1,D[e+932>>2]=w(-1),D[e+936>>2]=w(-1),Pn=1);e:do if(t[e+964>>2]|0)if(ie=w(mt(e,2,d)),Pe=w(mt(e,0,d)),P=e+916|0,Xi=w(D[P>>2]),Ki=w(D[e+920>>2]),Dr=w(D[e+932>>2]),K0(s,n,l,r,t[e+924>>2]|0,Xi,t[e+928>>2]|0,Ki,Dr,w(D[e+936>>2]),ie,Pe,T)|0)ke=22;else if(we=t[e+520>>2]|0,!we)ke=21;else for(q=0;;){if(P=e+524+(q*24|0)|0,Dr=w(D[P>>2]),Ki=w(D[e+524+(q*24|0)+4>>2]),Xi=w(D[e+524+(q*24|0)+16>>2]),K0(s,n,l,r,t[e+524+(q*24|0)+8>>2]|0,Dr,t[e+524+(q*24|0)+12>>2]|0,Ki,Xi,w(D[e+524+(q*24|0)+20>>2]),ie,Pe,T)|0){ke=22;break e}if(q=q+1|0,q>>>0>=we>>>0){ke=21;break}}else{if(y){if(P=e+916|0,!(Vr(w(D[P>>2]),n)|0)){ke=21;break}if(!(Vr(w(D[e+920>>2]),r)|0)){ke=21;break}if((t[e+924>>2]|0)!=(s|0)){ke=21;break}P=(t[e+928>>2]|0)==(l|0)?P:0,ke=22;break}if(we=t[e+520>>2]|0,!we)ke=21;else for(q=0;;){if(P=e+524+(q*24|0)|0,((Vr(w(D[P>>2]),n)|0?Vr(w(D[e+524+(q*24|0)+4>>2]),r)|0:0)?(t[e+524+(q*24|0)+8>>2]|0)==(s|0):0)?(t[e+524+(q*24|0)+12>>2]|0)==(l|0):0){ke=22;break e}if(q=q+1|0,q>>>0>=we>>>0){ke=21;break}}}while(0);do if((ke|0)==21)c[11697]|0?(P=0,ke=28):(P=0,ke=31);else if((ke|0)==22){if(q=(c[11697]|0)!=0,!((P|0)!=0&(Pn^1)))if(q){ke=28;break}else{ke=31;break}le=P+16|0,t[e+908>>2]=t[le>>2],we=P+20|0,t[e+912>>2]=t[we>>2],(c[11698]|0)==0|q^1||(t[qe>>2]=Gn(_e)|0,t[qe+4>>2]=_e,wn(e,4,2972,qe),q=t[e+972>>2]|0,q|0&&Nl[q&127](e),s=$t(s,y)|0,l=$t(l,y)|0,Ro=+w(D[le>>2]),Ji=+w(D[we>>2]),t[vt>>2]=s,t[vt+4>>2]=l,L[vt+8>>3]=+n,L[vt+16>>3]=+r,L[vt+24>>3]=Ro,L[vt+32>>3]=Ji,t[vt+40>>2]=k,wn(e,4,2989,vt))}while(0);return(ke|0)==28&&(q=Gn(_e)|0,t[le>>2]=q,t[le+4>>2]=_e,t[le+8>>2]=Pn?3047:11699,wn(e,4,3038,le),q=t[e+972>>2]|0,q|0&&Nl[q&127](e),vt=$t(s,y)|0,ke=$t(l,y)|0,t[pe>>2]=vt,t[pe+4>>2]=ke,L[pe+8>>3]=+n,L[pe+16>>3]=+r,t[pe+24>>2]=k,wn(e,4,3049,pe),ke=31),(ke|0)==31&&(X0(e,n,r,o,s,l,d,_,y,T),c[11697]|0&&(q=t[2279]|0,vt=Gn(q)|0,t[Ln>>2]=vt,t[Ln+4>>2]=q,t[Ln+8>>2]=Pn?3047:11699,wn(e,4,3083,Ln),q=t[e+972>>2]|0,q|0&&Nl[q&127](e),vt=$t(s,y)|0,Ln=$t(l,y)|0,Ji=+w(D[e+908>>2]),Ro=+w(D[e+912>>2]),t[Ht>>2]=vt,t[Ht+4>>2]=Ln,L[Ht+8>>3]=Ji,L[Ht+16>>3]=Ro,t[Ht+24>>2]=k,wn(e,4,3092,Ht)),t[e+516>>2]=o,P||(q=e+520|0,P=t[q>>2]|0,(P|0)==16&&(c[11697]|0&&wn(e,4,3124,It),t[q>>2]=0,P=0),y?P=e+916|0:(t[q>>2]=P+1,P=e+524+(P*24|0)|0),D[P>>2]=n,D[P+4>>2]=r,t[P+8>>2]=s,t[P+12>>2]=l,t[P+16>>2]=t[e+908>>2],t[P+20>>2]=t[e+912>>2],P=0)),y&&(t[e+416>>2]=t[e+908>>2],t[e+420>>2]=t[e+912>>2],c[e+985>>0]=1,c[gn>>0]=0),t[2279]=(t[2279]|0)+-1,t[e+512>>2]=t[2278],h=zt,Pn|(P|0)==0|0}function mt(e,n,r){e=e|0,n=n|0,r=w(r);var o=tt;return o=w(Tr(e,n,r)),w(o+w(R0(e,n,r)))}function wn(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0;l=h,h=h+16|0,s=l,t[s>>2]=o,e?o=t[e+976>>2]|0:o=0,Ku(o,e,n,r,s),h=l}function Gn(e){return e=e|0,(e>>>0>60?3201:3201+(60-e)|0)|0}function $t(e,n){e=e|0,n=n|0;var r=0,o=0,s=0;return s=h,h=h+32|0,r=s+12|0,o=s,t[r>>2]=t[254],t[r+4>>2]=t[255],t[r+8>>2]=t[256],t[o>>2]=t[257],t[o+4>>2]=t[258],t[o+8>>2]=t[259],(e|0)>2?e=11699:e=t[(n?o:r)+(e<<2)>>2]|0,h=s,e|0}function X0(e,n,r,o,s,l,d,_,y,k){e=e|0,n=w(n),r=w(r),o=o|0,s=s|0,l=l|0,d=w(d),_=w(_),y=y|0,k=k|0;var T=0,P=0,q=0,we=0,le=tt,ie=tt,Pe=tt,ke=tt,qe=tt,pe=tt,_e=tt,vt=0,Ln=0,Ht=0,It=tt,gn=tt,Pn=0,zt=tt,Dr=0,Ki=0,Xi=0,Ji=0,Ro=0,kf=0,Af=0,Cu=0,Of=0,Js=0,Qs=0,If=0,Pf=0,Mf=0,Kn=0,Tu=0,Ff=0,us=0,Lf=tt,Rf=tt,Zs=tt,el=tt,ss=tt,Fi=0,nu=0,go=0,xu=0,jl=0,Ul=tt,tl=tt,ql=tt,zl=tt,Li=tt,Di=tt,ku=0,xr=tt,Wl=tt,Qi=tt,ls=tt,Zi=tt,fs=tt,Hl=0,bl=0,cs=tt,Ri=tt,Au=0,Gl=0,Vl=0,Yl=0,En=tt,br=0,Ei=0,eo=0,Ni=0,xn=0,Vt=0,Ou=0,kt=tt,$l=0,Qr=0;Ou=h,h=h+16|0,Fi=Ou+12|0,nu=Ou+8|0,go=Ou+4|0,xu=Ou,i0(e,(s|0)==0|(gt(n)|0)^1,3326),i0(e,(l|0)==0|(gt(r)|0)^1,3406),Ei=so(e,o)|0,t[e+496>>2]=Ei,xn=N0(2,Ei)|0,Vt=N0(0,Ei)|0,D[e+440>>2]=w(Tr(e,xn,d)),D[e+444>>2]=w(R0(e,xn,d)),D[e+428>>2]=w(Tr(e,Vt,d)),D[e+436>>2]=w(R0(e,Vt,d)),D[e+464>>2]=w(C0(e,xn)),D[e+468>>2]=w(di(e,xn)),D[e+452>>2]=w(C0(e,Vt)),D[e+460>>2]=w(di(e,Vt)),D[e+488>>2]=w(u0(e,xn,d)),D[e+492>>2]=w(v0(e,xn,d)),D[e+476>>2]=w(u0(e,Vt,d)),D[e+484>>2]=w(v0(e,Vt,d));do if(t[e+964>>2]|0)To(e,n,r,s,l,d,_);else{if(eo=e+948|0,Ni=(t[e+952>>2]|0)-(t[eo>>2]|0)>>2,!Ni){pu(e,n,r,s,l,d,_);break}if(y?0:Sl(e,n,r,s,l,d,_)|0)break;bo(e),Tu=e+508|0,c[Tu>>0]=0,xn=N0(t[e+4>>2]|0,Ei)|0,Vt=Cl(xn,Ei)|0,br=Nr(xn)|0,Ff=t[e+8>>2]|0,Gl=e+28|0,us=(t[Gl>>2]|0)!=0,Zi=br?d:_,cs=br?_:d,Lf=w(B0(e,xn,d)),Rf=w(hu(e,xn,d)),le=w(B0(e,Vt,d)),fs=w(Fn(e,xn,d)),Ri=w(Fn(e,Vt,d)),Ht=br?s:l,Au=br?l:s,En=br?fs:Ri,qe=br?Ri:fs,ls=w(mt(e,2,d)),ke=w(mt(e,0,d)),ie=w(w(Tn(e+364|0,d))-En),Pe=w(w(Tn(e+380|0,d))-En),pe=w(w(Tn(e+372|0,_))-qe),_e=w(w(Tn(e+388|0,_))-qe),Zs=br?ie:pe,el=br?Pe:_e,ls=w(n-ls),n=w(ls-En),gt(n)|0?En=n:En=w(Ur(w(cc(n,Pe)),ie)),Wl=w(r-ke),n=w(Wl-qe),gt(n)|0?Qi=n:Qi=w(Ur(w(cc(n,_e)),pe)),ie=br?En:Qi,xr=br?Qi:En;e:do if((Ht|0)==1)for(o=0,P=0;;){if(T=e0(e,P)|0,!o)(w(Br(T))>w(0)?w(zr(T))>w(0):0)?o=T:o=0;else if(pi(T)|0){we=0;break e}if(P=P+1|0,P>>>0>=Ni>>>0){we=o;break}}else we=0;while(0);vt=we+500|0,Ln=we+504|0,o=0,T=0,n=w(0),q=0;do{if(P=t[(t[eo>>2]|0)+(q<<2)>>2]|0,(t[P+36>>2]|0)==1)lo(P),c[P+985>>0]=1,c[P+984>>0]=0;else{$r(P),y&&Yo(P,so(P,Ei)|0,ie,xr,En);do if((t[P+24>>2]|0)!=1)if((P|0)==(we|0)){t[vt>>2]=t[2278],D[Ln>>2]=w(0);break}else{wr(e,P,En,s,Qi,En,Qi,l,Ei,k);break}else T|0&&(t[T+960>>2]=P),t[P+960>>2]=0,T=P,o=(o|0)==0?P:o;while(0);Di=w(D[P+504>>2]),n=w(n+w(Di+w(mt(P,xn,En))))}q=q+1|0}while((q|0)!=(Ni|0));for(Xi=n>ie,ku=us&((Ht|0)==2&Xi)?1:Ht,Dr=(Au|0)==1,Ro=Dr&(y^1),kf=(ku|0)==1,Af=(ku|0)==2,Cu=976+(xn<<2)|0,Of=(Au|2|0)==2,Mf=Dr&(us^1),Js=1040+(Vt<<2)|0,Qs=1040+(xn<<2)|0,If=976+(Vt<<2)|0,Pf=(Au|0)!=1,Xi=us&((Ht|0)!=0&Xi),Ki=e+976|0,Dr=Dr^1,n=ie,Pn=0,Ji=0,Di=w(0),ss=w(0);;){e:do if(Pn>>>0<Ni>>>0)for(Ln=t[eo>>2]|0,q=0,_e=w(0),pe=w(0),Pe=w(0),ie=w(0),P=0,T=0,we=Pn;;){if(vt=t[Ln+(we<<2)>>2]|0,(t[vt+36>>2]|0)!=1?(t[vt+940>>2]=Ji,(t[vt+24>>2]|0)!=1):0){if(ke=w(mt(vt,xn,En)),Kn=t[Cu>>2]|0,r=w(Tn(vt+380+(Kn<<3)|0,Zi)),qe=w(D[vt+504>>2]),r=w(cc(r,qe)),r=w(Ur(w(Tn(vt+364+(Kn<<3)|0,Zi)),r)),us&(q|0)!=0&w(ke+w(pe+r))>n){l=q,ke=_e,Ht=we;break e}ke=w(ke+r),r=w(pe+ke),ke=w(_e+ke),pi(vt)|0&&(Pe=w(Pe+w(Br(vt))),ie=w(ie-w(qe*w(zr(vt))))),T|0&&(t[T+960>>2]=vt),t[vt+960>>2]=0,q=q+1|0,T=vt,P=(P|0)==0?vt:P}else ke=_e,r=pe;if(we=we+1|0,we>>>0<Ni>>>0)_e=ke,pe=r;else{l=q,Ht=we;break}}else l=0,ke=w(0),Pe=w(0),ie=w(0),P=0,Ht=Pn;while(0);Kn=Pe>w(0)&Pe<w(1),It=Kn?w(1):Pe,Kn=ie>w(0)&ie<w(1),_e=Kn?w(1):ie;do if(kf)Kn=51;else if(ke<Zs&((gt(Zs)|0)^1))n=Zs,Kn=51;else if(ke>el&((gt(el)|0)^1))n=el,Kn=51;else if(c[(t[Ki>>2]|0)+3>>0]|0)Kn=51;else{if(It!=w(0)?w(Br(e))!=w(0):0){Kn=53;break}n=ke,Kn=53}while(0);if((Kn|0)==51&&(Kn=0,gt(n)|0?Kn=53:(gn=w(n-ke),zt=n)),(Kn|0)==53&&(Kn=0,ke<w(0)?(gn=w(-ke),zt=n):(gn=w(0),zt=n)),Ro?0:(jl=(P|0)==0,!jl)){q=t[Cu>>2]|0,we=gn<w(0),qe=w(gn/_e),vt=gn>w(0),pe=w(gn/It),Pe=w(0),ke=w(0),n=w(0),T=P;do r=w(Tn(T+380+(q<<3)|0,Zi)),ie=w(Tn(T+364+(q<<3)|0,Zi)),ie=w(cc(r,w(Ur(ie,w(D[T+504>>2]))))),we?(r=w(ie*w(zr(T))),(r!=w(-0)?(kt=w(ie-w(qe*r)),Ul=w(kn(T,xn,kt,zt,En)),kt!=Ul):0)&&(Pe=w(Pe-w(Ul-ie)),n=w(n+r))):((vt?(tl=w(Br(T)),tl!=w(0)):0)?(kt=w(ie+w(pe*tl)),ql=w(kn(T,xn,kt,zt,En)),kt!=ql):0)&&(Pe=w(Pe-w(ql-ie)),ke=w(ke-tl)),T=t[T+960>>2]|0;while((T|0)!=0);if(n=w(_e+n),ie=w(gn+Pe),jl)n=w(0);else{qe=w(It+ke),we=t[Cu>>2]|0,vt=ie<w(0),Ln=n==w(0),pe=w(ie/n),q=ie>w(0),qe=w(ie/qe),n=w(0);do{kt=w(Tn(P+380+(we<<3)|0,Zi)),Pe=w(Tn(P+364+(we<<3)|0,Zi)),Pe=w(cc(kt,w(Ur(Pe,w(D[P+504>>2]))))),vt?(kt=w(Pe*w(zr(P))),ie=w(-kt),kt!=w(-0)?(kt=w(pe*ie),ie=w(kn(P,xn,w(Pe+(Ln?ie:kt)),zt,En))):ie=Pe):(q?(zl=w(Br(P)),zl!=w(0)):0)?ie=w(kn(P,xn,w(Pe+w(qe*zl)),zt,En)):ie=Pe,n=w(n-w(ie-Pe)),ke=w(mt(P,xn,En)),r=w(mt(P,Vt,En)),ie=w(ie+ke),D[nu>>2]=ie,t[xu>>2]=1,Pe=w(D[P+396>>2]);e:do if(gt(Pe)|0){T=gt(xr)|0;do if(!T){if(Xi|(m0(P,Vt,xr)|0|Dr)||(T0(e,P)|0)!=4||(t[(hi(P,Vt)|0)+4>>2]|0)==3||(t[(Ai(P,Vt)|0)+4>>2]|0)==3)break;D[Fi>>2]=xr,t[go>>2]=1;break e}while(0);if(m0(P,Vt,xr)|0){T=t[P+992+(t[If>>2]<<2)>>2]|0,kt=w(r+w(Tn(T,xr))),D[Fi>>2]=kt,T=Pf&(t[T+4>>2]|0)==2,t[go>>2]=((gt(kt)|0|T)^1)&1;break}else{D[Fi>>2]=xr,t[go>>2]=T?0:2;break}}else kt=w(ie-ke),It=w(kt/Pe),kt=w(Pe*kt),t[go>>2]=1,D[Fi>>2]=w(r+(br?It:kt));while(0);Kt(P,xn,zt,En,xu,nu),Kt(P,Vt,xr,En,go,Fi);do if(m0(P,Vt,xr)|0?0:(T0(e,P)|0)==4){if((t[(hi(P,Vt)|0)+4>>2]|0)==3){T=0;break}T=(t[(Ai(P,Vt)|0)+4>>2]|0)!=3}else T=0;while(0);kt=w(D[nu>>2]),It=w(D[Fi>>2]),$l=t[xu>>2]|0,Qr=t[go>>2]|0,ht(P,br?kt:It,br?It:kt,Ei,br?$l:Qr,br?Qr:$l,En,Qi,y&(T^1),3488,k)|0,c[Tu>>0]=c[Tu>>0]|c[P+508>>0],P=t[P+960>>2]|0}while((P|0)!=0)}}else n=w(0);if(n=w(gn+n),Qr=n<w(0)&1,c[Tu>>0]=Qr|C[Tu>>0],Af&n>w(0)?(T=t[Cu>>2]|0,((t[e+364+(T<<3)+4>>2]|0)!=0?(Li=w(Tn(e+364+(T<<3)|0,Zi)),Li>=w(0)):0)?ie=w(Ur(w(0),w(Li-w(zt-n)))):ie=w(0)):ie=n,vt=Pn>>>0<Ht>>>0,vt){we=t[eo>>2]|0,q=Pn,T=0;do P=t[we+(q<<2)>>2]|0,t[P+24>>2]|0||(T=((t[(hi(P,xn)|0)+4>>2]|0)==3&1)+T|0,T=T+((t[(Ai(P,xn)|0)+4>>2]|0)==3&1)|0),q=q+1|0;while((q|0)!=(Ht|0));T?(ke=w(0),r=w(0)):Kn=101}else Kn=101;e:do if((Kn|0)==101)switch(Kn=0,Ff|0){case 1:{T=0,ke=w(ie*w(.5)),r=w(0);break e}case 2:{T=0,ke=ie,r=w(0);break e}case 3:{if(l>>>0<=1){T=0,ke=w(0),r=w(0);break e}r=w((l+-1|0)>>>0),T=0,ke=w(0),r=w(w(Ur(ie,w(0)))/r);break e}case 5:{r=w(ie/w((l+1|0)>>>0)),T=0,ke=r;break e}case 4:{r=w(ie/w(l>>>0)),T=0,ke=w(r*w(.5));break e}default:{T=0,ke=w(0),r=w(0);break e}}while(0);if(n=w(Lf+ke),vt){Pe=w(ie/w(T|0)),q=t[eo>>2]|0,P=Pn,ie=w(0);do{T=t[q+(P<<2)>>2]|0;e:do if((t[T+36>>2]|0)!=1){switch(t[T+24>>2]|0){case 1:{if(X(T,xn)|0){if(!y)break e;kt=w(Y(T,xn,zt)),kt=w(kt+w(C0(e,xn))),kt=w(kt+w(Tr(T,xn,En))),D[T+400+(t[Qs>>2]<<2)>>2]=kt;break e}break}case 0:if(Qr=(t[(hi(T,xn)|0)+4>>2]|0)==3,kt=w(Pe+n),n=Qr?kt:n,y&&(Qr=T+400+(t[Qs>>2]<<2)|0,D[Qr>>2]=w(n+w(D[Qr>>2]))),Qr=(t[(Ai(T,xn)|0)+4>>2]|0)==3,kt=w(Pe+n),n=Qr?kt:n,Ro){kt=w(r+w(mt(T,xn,En))),ie=xr,n=w(n+w(kt+w(D[T+504>>2])));break e}else{n=w(n+w(r+w(ye(T,xn,En)))),ie=w(Ur(ie,w(ye(T,Vt,En))));break e}default:}y&&(kt=w(ke+w(C0(e,xn))),Qr=T+400+(t[Qs>>2]<<2)|0,D[Qr>>2]=w(kt+w(D[Qr>>2])))}while(0);P=P+1|0}while((P|0)!=(Ht|0))}else ie=w(0);if(r=w(Rf+n),Of?ke=w(w(kn(e,Vt,w(Ri+ie),cs,d))-Ri):ke=xr,Pe=w(w(kn(e,Vt,w(Ri+(Mf?xr:ie)),cs,d))-Ri),vt&y){P=Pn;do{q=t[(t[eo>>2]|0)+(P<<2)>>2]|0;do if((t[q+36>>2]|0)!=1){if((t[q+24>>2]|0)==1){if(X(q,Vt)|0){if(kt=w(Y(q,Vt,xr)),kt=w(kt+w(C0(e,Vt))),kt=w(kt+w(Tr(q,Vt,En))),T=t[Js>>2]|0,D[q+400+(T<<2)>>2]=kt,!(gt(kt)|0))break}else T=t[Js>>2]|0;kt=w(C0(e,Vt)),D[q+400+(T<<2)>>2]=w(kt+w(Tr(q,Vt,En)));break}T=T0(e,q)|0;do if((T|0)==4){if((t[(hi(q,Vt)|0)+4>>2]|0)==3){Kn=139;break}if((t[(Ai(q,Vt)|0)+4>>2]|0)==3){Kn=139;break}if(m0(q,Vt,xr)|0){n=le;break}$l=t[q+908+(t[Cu>>2]<<2)>>2]|0,t[Fi>>2]=$l,n=w(D[q+396>>2]),Qr=gt(n)|0,ie=(t[j>>2]=$l,w(D[j>>2])),Qr?n=Pe:(gn=w(mt(q,Vt,En)),kt=w(ie/n),n=w(n*ie),n=w(gn+(br?kt:n))),D[nu>>2]=n,D[Fi>>2]=w(w(mt(q,xn,En))+ie),t[go>>2]=1,t[xu>>2]=1,Kt(q,xn,zt,En,go,Fi),Kt(q,Vt,xr,En,xu,nu),n=w(D[Fi>>2]),gn=w(D[nu>>2]),kt=br?n:gn,n=br?gn:n,Qr=((gt(kt)|0)^1)&1,ht(q,kt,n,Ei,Qr,((gt(n)|0)^1)&1,En,Qi,1,3493,k)|0,n=le}else Kn=139;while(0);e:do if((Kn|0)==139){Kn=0,n=w(ke-w(ye(q,Vt,En)));do if((t[(hi(q,Vt)|0)+4>>2]|0)==3){if((t[(Ai(q,Vt)|0)+4>>2]|0)!=3)break;n=w(le+w(Ur(w(0),w(n*w(.5)))));break e}while(0);if((t[(Ai(q,Vt)|0)+4>>2]|0)==3){n=le;break}if((t[(hi(q,Vt)|0)+4>>2]|0)==3){n=w(le+w(Ur(w(0),n)));break}switch(T|0){case 1:{n=le;break e}case 2:{n=w(le+w(n*w(.5)));break e}default:{n=w(le+n);break e}}}while(0);kt=w(Di+n),Qr=q+400+(t[Js>>2]<<2)|0,D[Qr>>2]=w(kt+w(D[Qr>>2]))}while(0);P=P+1|0}while((P|0)!=(Ht|0))}if(Di=w(Di+Pe),ss=w(Ur(ss,r)),l=Ji+1|0,Ht>>>0>=Ni>>>0)break;n=zt,Pn=Ht,Ji=l}do if(y){if(T=l>>>0>1,T?0:!(he(e)|0))break;if(!(gt(xr)|0)){n=w(xr-Di);e:do switch(t[e+12>>2]|0){case 3:{le=w(le+n),pe=w(0);break}case 2:{le=w(le+w(n*w(.5))),pe=w(0);break}case 4:{xr>Di?pe=w(n/w(l>>>0)):pe=w(0);break}case 7:if(xr>Di){le=w(le+w(n/w(l<<1>>>0))),pe=w(n/w(l>>>0)),pe=T?pe:w(0);break e}else{le=w(le+w(n*w(.5))),pe=w(0);break e}case 6:{pe=w(n/w(Ji>>>0)),pe=xr>Di&T?pe:w(0);break}default:pe=w(0)}while(0);if(l|0)for(vt=1040+(Vt<<2)|0,Ln=976+(Vt<<2)|0,we=0,P=0;;){e:do if(P>>>0<Ni>>>0)for(ie=w(0),Pe=w(0),n=w(0),q=P;;){T=t[(t[eo>>2]|0)+(q<<2)>>2]|0;do if((t[T+36>>2]|0)!=1?(t[T+24>>2]|0)==0:0){if((t[T+940>>2]|0)!=(we|0))break e;if(We(T,Vt)|0&&(kt=w(D[T+908+(t[Ln>>2]<<2)>>2]),n=w(Ur(n,w(kt+w(mt(T,Vt,En)))))),(T0(e,T)|0)!=5)break;Li=w(et(T)),Li=w(Li+w(Tr(T,0,En))),kt=w(D[T+912>>2]),kt=w(w(kt+w(mt(T,0,En)))-Li),Li=w(Ur(Pe,Li)),kt=w(Ur(ie,kt)),ie=kt,Pe=Li,n=w(Ur(n,w(Li+kt)))}while(0);if(T=q+1|0,T>>>0<Ni>>>0)q=T;else{q=T;break}}else Pe=w(0),n=w(0),q=P;while(0);if(qe=w(pe+n),r=le,le=w(le+qe),P>>>0<q>>>0){ke=w(r+Pe),T=P;do{P=t[(t[eo>>2]|0)+(T<<2)>>2]|0;e:do if((t[P+36>>2]|0)!=1?(t[P+24>>2]|0)==0:0)switch(T0(e,P)|0){case 1:{kt=w(r+w(Tr(P,Vt,En))),D[P+400+(t[vt>>2]<<2)>>2]=kt;break e}case 3:{kt=w(w(le-w(R0(P,Vt,En)))-w(D[P+908+(t[Ln>>2]<<2)>>2])),D[P+400+(t[vt>>2]<<2)>>2]=kt;break e}case 2:{kt=w(r+w(w(qe-w(D[P+908+(t[Ln>>2]<<2)>>2]))*w(.5))),D[P+400+(t[vt>>2]<<2)>>2]=kt;break e}case 4:{if(kt=w(r+w(Tr(P,Vt,En))),D[P+400+(t[vt>>2]<<2)>>2]=kt,m0(P,Vt,xr)|0||(br?(ie=w(D[P+908>>2]),n=w(ie+w(mt(P,xn,En))),Pe=qe):(Pe=w(D[P+912>>2]),Pe=w(Pe+w(mt(P,Vt,En))),n=qe,ie=w(D[P+908>>2])),Vr(n,ie)|0?Vr(Pe,w(D[P+912>>2]))|0:0))break e;ht(P,n,Pe,Ei,1,1,En,Qi,1,3501,k)|0;break e}case 5:{D[P+404>>2]=w(w(ke-w(et(P)))+w(Y(P,0,xr)));break e}default:break e}while(0);T=T+1|0}while((T|0)!=(q|0))}if(we=we+1|0,(we|0)==(l|0))break;P=q}}}while(0);if(D[e+908>>2]=w(kn(e,2,ls,d,d)),D[e+912>>2]=w(kn(e,0,Wl,_,d)),((ku|0)!=0?(Hl=t[e+32>>2]|0,bl=(ku|0)==2,!(bl&(Hl|0)!=2)):0)?bl&(Hl|0)==2&&(n=w(fs+zt),n=w(Ur(w(cc(n,w(Dt(e,xn,ss,Zi)))),fs)),Kn=198):(n=w(kn(e,xn,ss,Zi,d)),Kn=198),(Kn|0)==198&&(D[e+908+(t[976+(xn<<2)>>2]<<2)>>2]=n),((Au|0)!=0?(Vl=t[e+32>>2]|0,Yl=(Au|0)==2,!(Yl&(Vl|0)!=2)):0)?Yl&(Vl|0)==2&&(n=w(Ri+xr),n=w(Ur(w(cc(n,w(Dt(e,Vt,w(Ri+Di),cs)))),Ri)),Kn=204):(n=w(kn(e,Vt,w(Ri+Di),cs,d)),Kn=204),(Kn|0)==204&&(D[e+908+(t[976+(Vt<<2)>>2]<<2)>>2]=n),y){if((t[Gl>>2]|0)==2){P=976+(Vt<<2)|0,q=1040+(Vt<<2)|0,T=0;do we=e0(e,T)|0,t[we+24>>2]|0||($l=t[P>>2]|0,kt=w(D[e+908+($l<<2)>>2]),Qr=we+400+(t[q>>2]<<2)|0,kt=w(kt-w(D[Qr>>2])),D[Qr>>2]=w(kt-w(D[we+908+($l<<2)>>2]))),T=T+1|0;while((T|0)!=(Ni|0))}if(o|0){T=br?ku:s;do bt(e,o,En,T,Qi,Ei,k),o=t[o+960>>2]|0;while((o|0)!=0)}if(T=(xn|2|0)==3,P=(Vt|2|0)==3,T|P){o=0;do q=t[(t[eo>>2]|0)+(o<<2)>>2]|0,(t[q+36>>2]|0)!=1&&(T&&Zt(e,q,xn),P&&Zt(e,q,Vt)),o=o+1|0;while((o|0)!=(Ni|0))}}}while(0);h=Ou}function ki(e,n){e=e|0,n=w(n);var r=0;li(e,n>=w(0),3147),r=n==w(0),D[e+4>>2]=r?w(0):n}function Yr(e,n,r,o){e=e|0,n=w(n),r=w(r),o=o|0;var s=tt,l=tt,d=0,_=0,y=0;t[2278]=(t[2278]|0)+1,$r(e),m0(e,2,n)|0?(s=w(Tn(t[e+992>>2]|0,n)),y=1,s=w(s+w(mt(e,2,n)))):(s=w(Tn(e+380|0,n)),s>=w(0)?y=2:(y=((gt(n)|0)^1)&1,s=n)),m0(e,0,r)|0?(l=w(Tn(t[e+996>>2]|0,r)),_=1,l=w(l+w(mt(e,0,n)))):(l=w(Tn(e+388|0,r)),l>=w(0)?_=2:(_=((gt(r)|0)^1)&1,l=r)),d=e+976|0,(ht(e,s,l,o,y,_,n,r,1,3189,t[d>>2]|0)|0?(Yo(e,t[e+496>>2]|0,n,r,n),bi(e,w(D[(t[d>>2]|0)+4>>2]),w(0),w(0)),c[11696]|0):0)&&ff(e,7)}function $r(e){e=e|0;var n=0,r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0;_=h,h=h+32|0,d=_+24|0,l=_+16|0,o=_+8|0,s=_,r=0;do n=e+380+(r<<3)|0,((t[e+380+(r<<3)+4>>2]|0)!=0?(y=n,k=t[y+4>>2]|0,T=o,t[T>>2]=t[y>>2],t[T+4>>2]=k,T=e+364+(r<<3)|0,k=t[T+4>>2]|0,y=s,t[y>>2]=t[T>>2],t[y+4>>2]=k,t[l>>2]=t[o>>2],t[l+4>>2]=t[o+4>>2],t[d>>2]=t[s>>2],t[d+4>>2]=t[s+4>>2],o0(l,d)|0):0)||(n=e+348+(r<<3)|0),t[e+992+(r<<2)>>2]=n,r=r+1|0;while((r|0)!=2);h=_}function m0(e,n,r){e=e|0,n=n|0,r=w(r);var o=0;switch(e=t[e+992+(t[976+(n<<2)>>2]<<2)>>2]|0,t[e+4>>2]|0){case 0:case 3:{e=0;break}case 1:{w(D[e>>2])<w(0)?e=0:o=5;break}case 2:{w(D[e>>2])<w(0)?e=0:e=(gt(r)|0)^1;break}default:o=5}return(o|0)==5&&(e=1),e|0}function Tn(e,n){switch(e=e|0,n=w(n),t[e+4>>2]|0){case 2:{n=w(w(w(D[e>>2])*n)/w(100));break}case 1:{n=w(D[e>>2]);break}default:n=w(J)}return w(n)}function Yo(e,n,r,o,s){e=e|0,n=n|0,r=w(r),o=w(o),s=w(s);var l=0,d=tt;n=t[e+944>>2]|0?n:1,l=N0(t[e+4>>2]|0,n)|0,n=Cl(l,n)|0,r=w(Wr(e,l,r)),o=w(Wr(e,n,o)),d=w(r+w(Tr(e,l,s))),D[e+400+(t[1040+(l<<2)>>2]<<2)>>2]=d,r=w(r+w(R0(e,l,s))),D[e+400+(t[1e3+(l<<2)>>2]<<2)>>2]=r,r=w(o+w(Tr(e,n,s))),D[e+400+(t[1040+(n<<2)>>2]<<2)>>2]=r,s=w(o+w(R0(e,n,s))),D[e+400+(t[1e3+(n<<2)>>2]<<2)>>2]=s}function bi(e,n,r,o){e=e|0,n=w(n),r=w(r),o=w(o);var s=0,l=0,d=tt,_=tt,y=0,k=0,T=tt,P=0,q=tt,we=tt,le=tt,ie=tt;if(n!=w(0)&&(s=e+400|0,ie=w(D[s>>2]),l=e+404|0,le=w(D[l>>2]),P=e+416|0,we=w(D[P>>2]),k=e+420|0,d=w(D[k>>2]),q=w(ie+r),T=w(le+o),o=w(q+we),_=w(T+d),y=(t[e+988>>2]|0)==1,D[s>>2]=w($0(ie,n,0,y)),D[l>>2]=w($0(le,n,0,y)),r=w(V4(w(we*n),w(1))),Vr(r,w(0))|0?l=0:l=(Vr(r,w(1))|0)^1,r=w(V4(w(d*n),w(1))),Vr(r,w(0))|0?s=0:s=(Vr(r,w(1))|0)^1,ie=w($0(o,n,y&l,y&(l^1))),D[P>>2]=w(ie-w($0(q,n,0,y))),ie=w($0(_,n,y&s,y&(s^1))),D[k>>2]=w(ie-w($0(T,n,0,y))),l=(t[e+952>>2]|0)-(t[e+948>>2]|0)>>2,l|0)){s=0;do bi(e0(e,s)|0,n,q,T),s=s+1|0;while((s|0)!=(l|0))}}function or(e,n,r,o,s){switch(e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,r|0){case 5:case 0:{e=q8(t[489]|0,o,s)|0;break}default:e=AL(o,s)|0}return e|0}function zs(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0;s=h,h=h+16|0,l=s,t[l>>2]=o,Ku(e,0,n,r,l),h=s}function Ku(e,n,r,o,s){if(e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,e=e|0?e:956,sD[t[e+8>>2]&1](e,n,r,o,s)|0,(r|0)==5)_n();else return}function J0(e,n,r){e=e|0,n=n|0,r=r|0,c[e+n>>0]=r&1}function af(e,n){e=e|0,n=n|0;var r=0,o=0;t[e>>2]=0,t[e+4>>2]=0,t[e+8>>2]=0,r=n+4|0,o=(t[r>>2]|0)-(t[n>>2]|0)>>2,o|0&&(S0(e,o),El(e,t[n>>2]|0,t[r>>2]|0,o))}function S0(e,n){e=e|0,n=n|0;var r=0;if((Q0(e)|0)>>>0<n>>>0&&$n(e),n>>>0>1073741823)_n();else{r=Tt(n<<2)|0,t[e+4>>2]=r,t[e>>2]=r,t[e+8>>2]=r+(n<<2);return}}function El(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0,o=e+4|0,e=r-n|0,(e|0)>0&&(vn(t[o>>2]|0,n|0,e|0)|0,t[o>>2]=(t[o>>2]|0)+(e>>>2<<2))}function Q0(e){return e=e|0,1073741823}function Tr(e,n,r){return e=e|0,n=n|0,r=w(r),(Nr(n)|0?(t[e+96>>2]|0)!=0:0)?e=e+92|0:e=en(e+60|0,t[1040+(n<<2)>>2]|0,992)|0,w(uo(e,r))}function R0(e,n,r){return e=e|0,n=n|0,r=w(r),(Nr(n)|0?(t[e+104>>2]|0)!=0:0)?e=e+100|0:e=en(e+60|0,t[1e3+(n<<2)>>2]|0,992)|0,w(uo(e,r))}function Nr(e){return e=e|0,(e|1|0)==3|0}function uo(e,n){return e=e|0,n=w(n),(t[e+4>>2]|0)==3?n=w(0):n=w(Tn(e,n)),w(n)}function so(e,n){return e=e|0,n=n|0,e=t[e>>2]|0,((e|0)==0?(n|0)>1?n:1:e)|0}function N0(e,n){e=e|0,n=n|0;var r=0;e:do if((n|0)==2){switch(e|0){case 2:{e=3;break e}case 3:break;default:{r=4;break e}}e=2}else r=4;while(0);return e|0}function C0(e,n){e=e|0,n=n|0;var r=tt;return((Nr(n)|0?(t[e+312>>2]|0)!=0:0)?(r=w(D[e+308>>2]),r>=w(0)):0)||(r=w(Ur(w(D[(en(e+276|0,t[1040+(n<<2)>>2]|0,992)|0)>>2]),w(0)))),w(r)}function di(e,n){e=e|0,n=n|0;var r=tt;return((Nr(n)|0?(t[e+320>>2]|0)!=0:0)?(r=w(D[e+316>>2]),r>=w(0)):0)||(r=w(Ur(w(D[(en(e+276|0,t[1e3+(n<<2)>>2]|0,992)|0)>>2]),w(0)))),w(r)}function u0(e,n,r){e=e|0,n=n|0,r=w(r);var o=tt;return((Nr(n)|0?(t[e+240>>2]|0)!=0:0)?(o=w(Tn(e+236|0,r)),o>=w(0)):0)||(o=w(Ur(w(Tn(en(e+204|0,t[1040+(n<<2)>>2]|0,992)|0,r)),w(0)))),w(o)}function v0(e,n,r){e=e|0,n=n|0,r=w(r);var o=tt;return((Nr(n)|0?(t[e+248>>2]|0)!=0:0)?(o=w(Tn(e+244|0,r)),o>=w(0)):0)||(o=w(Ur(w(Tn(en(e+204|0,t[1e3+(n<<2)>>2]|0,992)|0,r)),w(0)))),w(o)}function To(e,n,r,o,s,l,d){e=e|0,n=w(n),r=w(r),o=o|0,s=s|0,l=w(l),d=w(d);var _=tt,y=tt,k=tt,T=tt,P=tt,q=tt,we=0,le=0,ie=0;ie=h,h=h+16|0,we=ie,le=e+964|0,i0(e,(t[le>>2]|0)!=0,3519),_=w(Fn(e,2,n)),y=w(Fn(e,0,n)),k=w(mt(e,2,n)),T=w(mt(e,0,n)),gt(n)|0?P=n:P=w(Ur(w(0),w(w(n-k)-_))),gt(r)|0?q=r:q=w(Ur(w(0),w(w(r-T)-y))),(o|0)==1&(s|0)==1?(D[e+908>>2]=w(kn(e,2,w(n-k),l,l)),n=w(kn(e,0,w(r-T),d,l))):(lD[t[le>>2]&1](we,e,P,o,q,s),P=w(_+w(D[we>>2])),q=w(n-k),D[e+908>>2]=w(kn(e,2,(o|2|0)==2?P:q,l,l)),q=w(y+w(D[we+4>>2])),n=w(r-T),n=w(kn(e,0,(s|2|0)==2?q:n,d,l))),D[e+912>>2]=n,h=ie}function pu(e,n,r,o,s,l,d){e=e|0,n=w(n),r=w(r),o=o|0,s=s|0,l=w(l),d=w(d);var _=tt,y=tt,k=tt,T=tt;k=w(Fn(e,2,l)),_=w(Fn(e,0,l)),T=w(mt(e,2,l)),y=w(mt(e,0,l)),n=w(n-T),D[e+908>>2]=w(kn(e,2,(o|2|0)==2?k:n,l,l)),r=w(r-y),D[e+912>>2]=w(kn(e,0,(s|2|0)==2?_:r,d,l))}function Sl(e,n,r,o,s,l,d){e=e|0,n=w(n),r=w(r),o=o|0,s=s|0,l=w(l),d=w(d);var _=0,y=tt,k=tt;return _=(o|0)==2,((n<=w(0)&_?0:!(r<=w(0)&(s|0)==2))?!((o|0)==1&(s|0)==1):0)?e=0:(y=w(mt(e,0,l)),k=w(mt(e,2,l)),_=n<w(0)&_|(gt(n)|0),n=w(n-k),D[e+908>>2]=w(kn(e,2,_?w(0):n,l,l)),n=w(r-y),_=r<w(0)&(s|0)==2|(gt(r)|0),D[e+912>>2]=w(kn(e,0,_?w(0):n,d,l)),e=1),e|0}function Cl(e,n){return e=e|0,n=n|0,qt(e)|0?e=N0(2,n)|0:e=0,e|0}function B0(e,n,r){return e=e|0,n=n|0,r=w(r),r=w(u0(e,n,r)),w(r+w(C0(e,n)))}function hu(e,n,r){return e=e|0,n=n|0,r=w(r),r=w(v0(e,n,r)),w(r+w(di(e,n)))}function Fn(e,n,r){e=e|0,n=n|0,r=w(r);var o=tt;return o=w(B0(e,n,r)),w(o+w(hu(e,n,r)))}function pi(e){return e=e|0,t[e+24>>2]|0?e=0:w(Br(e))!=w(0)?e=1:e=w(zr(e))!=w(0),e|0}function Br(e){e=e|0;var n=tt;if(t[e+944>>2]|0){if(n=w(D[e+44>>2]),gt(n)|0)return n=w(D[e+40>>2]),e=n>w(0)&((gt(n)|0)^1),w(e?n:w(0))}else n=w(0);return w(n)}function zr(e){e=e|0;var n=tt,r=0,o=tt;do if(t[e+944>>2]|0){if(n=w(D[e+48>>2]),gt(n)|0){if(r=c[(t[e+976>>2]|0)+2>>0]|0,r<<24>>24==0?(o=w(D[e+40>>2]),o<w(0)&((gt(o)|0)^1)):0){n=w(-o);break}n=r<<24>>24?w(1):w(0)}}else n=w(0);while(0);return w(n)}function lo(e){e=e|0;var n=0,r=0;if(pa(e+400|0,0,540)|0,c[e+985>>0]=1,bo(e),r=fi(e)|0,r|0){n=e+948|0,e=0;do lo(t[(t[n>>2]|0)+(e<<2)>>2]|0),e=e+1|0;while((e|0)!=(r|0))}}function wr(e,n,r,o,s,l,d,_,y,k){e=e|0,n=n|0,r=w(r),o=o|0,s=w(s),l=w(l),d=w(d),_=_|0,y=y|0,k=k|0;var T=0,P=tt,q=0,we=0,le=tt,ie=tt,Pe=0,ke=tt,qe=0,pe=tt,_e=0,vt=0,Ln=0,Ht=0,It=0,gn=0,Pn=0,zt=0,Dr=0,Ki=0;Dr=h,h=h+16|0,Ln=Dr+12|0,Ht=Dr+8|0,It=Dr+4|0,gn=Dr,zt=N0(t[e+4>>2]|0,y)|0,_e=Nr(zt)|0,P=w(Tn(Ut(n)|0,_e?l:d)),vt=m0(n,2,l)|0,Pn=m0(n,0,d)|0;do if(gt(P)|0?0:!(gt(_e?r:s)|0)){if(T=n+504|0,!(gt(w(D[T>>2]))|0)&&(!(fn(t[n+976>>2]|0,0)|0)||(t[n+500>>2]|0)==(t[2278]|0)))break;D[T>>2]=w(Ur(P,w(Fn(n,zt,l))))}else q=7;while(0);do if((q|0)==7){if(qe=_e^1,!(qe|vt^1)){d=w(Tn(t[n+992>>2]|0,l)),D[n+504>>2]=w(Ur(d,w(Fn(n,2,l))));break}if(!(_e|Pn^1)){d=w(Tn(t[n+996>>2]|0,d)),D[n+504>>2]=w(Ur(d,w(Fn(n,0,l))));break}D[Ln>>2]=w(J),D[Ht>>2]=w(J),t[It>>2]=0,t[gn>>2]=0,ke=w(mt(n,2,l)),pe=w(mt(n,0,l)),vt?(le=w(ke+w(Tn(t[n+992>>2]|0,l))),D[Ln>>2]=le,t[It>>2]=1,we=1):(we=0,le=w(J)),Pn?(P=w(pe+w(Tn(t[n+996>>2]|0,d))),D[Ht>>2]=P,t[gn>>2]=1,T=1):(T=0,P=w(J)),q=t[e+32>>2]|0,_e&(q|0)==2?q=2:(gt(le)|0?!(gt(r)|0):0)&&(D[Ln>>2]=r,t[It>>2]=2,we=2,le=r),(((q|0)==2&qe?0:gt(P)|0)?!(gt(s)|0):0)&&(D[Ht>>2]=s,t[gn>>2]=2,T=2,P=s),ie=w(D[n+396>>2]),Pe=gt(ie)|0;do if(Pe)q=we;else{if((we|0)==1&qe){D[Ht>>2]=w(w(le-ke)/ie),t[gn>>2]=1,T=1,q=1;break}_e&(T|0)==1?(D[Ln>>2]=w(ie*w(P-pe)),t[It>>2]=1,T=1,q=1):q=we}while(0);Ki=gt(r)|0,we=(T0(e,n)|0)!=4,(_e|vt|((o|0)!=1|Ki)|(we|(q|0)==1)?0:(D[Ln>>2]=r,t[It>>2]=1,!Pe))&&(D[Ht>>2]=w(w(r-ke)/ie),t[gn>>2]=1,T=1),(Pn|qe|((_|0)!=1|(gt(s)|0))|(we|(T|0)==1)?0:(D[Ht>>2]=s,t[gn>>2]=1,!Pe))&&(D[Ln>>2]=w(ie*w(s-pe)),t[It>>2]=1),Kt(n,2,l,l,It,Ln),Kt(n,0,d,l,gn,Ht),r=w(D[Ln>>2]),s=w(D[Ht>>2]),ht(n,r,s,y,t[It>>2]|0,t[gn>>2]|0,l,d,0,3565,k)|0,d=w(D[n+908+(t[976+(zt<<2)>>2]<<2)>>2]),D[n+504>>2]=w(Ur(d,w(Fn(n,zt,l))))}while(0);t[n+500>>2]=t[2278],h=Dr}function kn(e,n,r,o,s){return e=e|0,n=n|0,r=w(r),o=w(o),s=w(s),o=w(Dt(e,n,r,o)),w(Ur(o,w(Fn(e,n,s))))}function T0(e,n){return e=e|0,n=n|0,n=n+20|0,n=t[((t[n>>2]|0)==0?e+16|0:n)>>2]|0,((n|0)==5?qt(t[e+4>>2]|0)|0:0)&&(n=1),n|0}function hi(e,n){return e=e|0,n=n|0,(Nr(n)|0?(t[e+96>>2]|0)!=0:0)?n=4:n=t[1040+(n<<2)>>2]|0,e+60+(n<<3)|0}function Ai(e,n){return e=e|0,n=n|0,(Nr(n)|0?(t[e+104>>2]|0)!=0:0)?n=5:n=t[1e3+(n<<2)>>2]|0,e+60+(n<<3)|0}function Kt(e,n,r,o,s,l){switch(e=e|0,n=n|0,r=w(r),o=w(o),s=s|0,l=l|0,r=w(Tn(e+380+(t[976+(n<<2)>>2]<<3)|0,r)),r=w(r+w(mt(e,n,o))),t[s>>2]|0){case 2:case 1:{s=gt(r)|0,o=w(D[l>>2]),D[l>>2]=s|o<r?o:r;break}case 0:{gt(r)|0||(t[s>>2]=2,D[l>>2]=r);break}default:}}function X(e,n){return e=e|0,n=n|0,e=e+132|0,(Nr(n)|0?(t[(en(e,4,948)|0)+4>>2]|0)!=0:0)?e=1:e=(t[(en(e,t[1040+(n<<2)>>2]|0,948)|0)+4>>2]|0)!=0,e|0}function Y(e,n,r){e=e|0,n=n|0,r=w(r);var o=0,s=0;return e=e+132|0,(Nr(n)|0?(o=en(e,4,948)|0,(t[o+4>>2]|0)!=0):0)?s=4:(o=en(e,t[1040+(n<<2)>>2]|0,948)|0,t[o+4>>2]|0?s=4:r=w(0)),(s|0)==4&&(r=w(Tn(o,r))),w(r)}function ye(e,n,r){e=e|0,n=n|0,r=w(r);var o=tt;return o=w(D[e+908+(t[976+(n<<2)>>2]<<2)>>2]),o=w(o+w(Tr(e,n,r))),w(o+w(R0(e,n,r)))}function he(e){e=e|0;var n=0,r=0,o=0;e:do if(qt(t[e+4>>2]|0)|0)n=0;else if((t[e+16>>2]|0)!=5)if(r=fi(e)|0,!r)n=0;else for(n=0;;){if(o=e0(e,n)|0,(t[o+24>>2]|0)==0?(t[o+20>>2]|0)==5:0){n=1;break e}if(n=n+1|0,n>>>0>=r>>>0){n=0;break}}else n=1;while(0);return n|0}function We(e,n){e=e|0,n=n|0;var r=tt;return r=w(D[e+908+(t[976+(n<<2)>>2]<<2)>>2]),r>=w(0)&((gt(r)|0)^1)|0}function et(e){e=e|0;var n=tt,r=0,o=0,s=0,l=0,d=0,_=0,y=tt;if(r=t[e+968>>2]|0,r)y=w(D[e+908>>2]),n=w(D[e+912>>2]),n=w(rD[r&0](e,y,n)),i0(e,(gt(n)|0)^1,3573);else{l=fi(e)|0;do if(l|0){for(r=0,s=0;;){if(o=e0(e,s)|0,t[o+940>>2]|0){d=8;break}if((t[o+24>>2]|0)!=1)if(_=(T0(e,o)|0)==5,_){r=o;break}else r=(r|0)==0?o:r;if(s=s+1|0,s>>>0>=l>>>0){d=8;break}}if((d|0)==8&&!r)break;return n=w(et(r)),w(n+w(D[r+404>>2]))}while(0);n=w(D[e+912>>2])}return w(n)}function Dt(e,n,r,o){e=e|0,n=n|0,r=w(r),o=w(o);var s=tt,l=0;return qt(n)|0?(n=1,l=3):Nr(n)|0?(n=0,l=3):(o=w(J),s=w(J)),(l|0)==3&&(s=w(Tn(e+364+(n<<3)|0,o)),o=w(Tn(e+380+(n<<3)|0,o))),l=o<r&(o>=w(0)&((gt(o)|0)^1)),r=l?o:r,l=s>=w(0)&((gt(s)|0)^1)&r<s,w(l?s:r)}function bt(e,n,r,o,s,l,d){e=e|0,n=n|0,r=w(r),o=o|0,s=w(s),l=l|0,d=d|0;var _=tt,y=tt,k=0,T=0,P=tt,q=tt,we=tt,le=0,ie=0,Pe=0,ke=0,qe=tt,pe=0;Pe=N0(t[e+4>>2]|0,l)|0,le=Cl(Pe,l)|0,ie=Nr(Pe)|0,P=w(mt(n,2,r)),q=w(mt(n,0,r)),m0(n,2,r)|0?_=w(P+w(Tn(t[n+992>>2]|0,r))):(X(n,2)|0?_t(n,2)|0:0)?(_=w(D[e+908>>2]),y=w(C0(e,2)),y=w(_-w(y+w(di(e,2)))),_=w(Y(n,2,r)),_=w(kn(n,2,w(y-w(_+w(_r(n,2,r)))),r,r))):_=w(J),m0(n,0,s)|0?y=w(q+w(Tn(t[n+996>>2]|0,s))):(X(n,0)|0?_t(n,0)|0:0)?(y=w(D[e+912>>2]),qe=w(C0(e,0)),qe=w(y-w(qe+w(di(e,0)))),y=w(Y(n,0,s)),y=w(kn(n,0,w(qe-w(y+w(_r(n,0,s)))),s,r))):y=w(J),k=gt(_)|0,T=gt(y)|0;do if(k^T?(we=w(D[n+396>>2]),!(gt(we)|0)):0)if(k){_=w(P+w(w(y-q)*we));break}else{qe=w(q+w(w(_-P)/we)),y=T?qe:y;break}while(0);T=gt(_)|0,k=gt(y)|0,T|k&&(pe=(T^1)&1,o=r>w(0)&((o|0)!=0&T),_=ie?_:o?r:_,ht(n,_,y,l,ie?pe:o?2:pe,T&(k^1)&1,_,y,0,3623,d)|0,_=w(D[n+908>>2]),_=w(_+w(mt(n,2,r))),y=w(D[n+912>>2]),y=w(y+w(mt(n,0,r)))),ht(n,_,y,l,1,1,_,y,1,3635,d)|0,(_t(n,Pe)|0?!(X(n,Pe)|0):0)?(pe=t[976+(Pe<<2)>>2]|0,qe=w(D[e+908+(pe<<2)>>2]),qe=w(qe-w(D[n+908+(pe<<2)>>2])),qe=w(qe-w(di(e,Pe))),qe=w(qe-w(R0(n,Pe,r))),qe=w(qe-w(_r(n,Pe,ie?r:s))),D[n+400+(t[1040+(Pe<<2)>>2]<<2)>>2]=qe):ke=21;do if((ke|0)==21){if(X(n,Pe)|0?0:(t[e+8>>2]|0)==1){pe=t[976+(Pe<<2)>>2]|0,qe=w(D[e+908+(pe<<2)>>2]),qe=w(w(qe-w(D[n+908+(pe<<2)>>2]))*w(.5)),D[n+400+(t[1040+(Pe<<2)>>2]<<2)>>2]=qe;break}(X(n,Pe)|0?0:(t[e+8>>2]|0)==2)&&(pe=t[976+(Pe<<2)>>2]|0,qe=w(D[e+908+(pe<<2)>>2]),qe=w(qe-w(D[n+908+(pe<<2)>>2])),D[n+400+(t[1040+(Pe<<2)>>2]<<2)>>2]=qe)}while(0);(_t(n,le)|0?!(X(n,le)|0):0)?(pe=t[976+(le<<2)>>2]|0,qe=w(D[e+908+(pe<<2)>>2]),qe=w(qe-w(D[n+908+(pe<<2)>>2])),qe=w(qe-w(di(e,le))),qe=w(qe-w(R0(n,le,r))),qe=w(qe-w(_r(n,le,ie?s:r))),D[n+400+(t[1040+(le<<2)>>2]<<2)>>2]=qe):ke=30;do if((ke|0)==30?!(X(n,le)|0):0){if((T0(e,n)|0)==2){pe=t[976+(le<<2)>>2]|0,qe=w(D[e+908+(pe<<2)>>2]),qe=w(w(qe-w(D[n+908+(pe<<2)>>2]))*w(.5)),D[n+400+(t[1040+(le<<2)>>2]<<2)>>2]=qe;break}pe=(T0(e,n)|0)==3,pe^(t[e+28>>2]|0)==2&&(pe=t[976+(le<<2)>>2]|0,qe=w(D[e+908+(pe<<2)>>2]),qe=w(qe-w(D[n+908+(pe<<2)>>2])),D[n+400+(t[1040+(le<<2)>>2]<<2)>>2]=qe)}while(0)}function Zt(e,n,r){e=e|0,n=n|0,r=r|0;var o=tt,s=0;s=t[976+(r<<2)>>2]|0,o=w(D[n+908+(s<<2)>>2]),o=w(w(D[e+908+(s<<2)>>2])-o),o=w(o-w(D[n+400+(t[1040+(r<<2)>>2]<<2)>>2])),D[n+400+(t[1e3+(r<<2)>>2]<<2)>>2]=o}function qt(e){return e=e|0,(e|1|0)==1|0}function Ut(e){e=e|0;var n=tt;switch(t[e+56>>2]|0){case 0:case 3:{n=w(D[e+40>>2]),n>w(0)&((gt(n)|0)^1)?e=c[(t[e+976>>2]|0)+2>>0]|0?1056:992:e=1056;break}default:e=e+52|0}return e|0}function fn(e,n){return e=e|0,n=n|0,(c[e+n>>0]|0)!=0|0}function _t(e,n){return e=e|0,n=n|0,e=e+132|0,(Nr(n)|0?(t[(en(e,5,948)|0)+4>>2]|0)!=0:0)?e=1:e=(t[(en(e,t[1e3+(n<<2)>>2]|0,948)|0)+4>>2]|0)!=0,e|0}function _r(e,n,r){e=e|0,n=n|0,r=w(r);var o=0,s=0;return e=e+132|0,(Nr(n)|0?(o=en(e,5,948)|0,(t[o+4>>2]|0)!=0):0)?s=4:(o=en(e,t[1e3+(n<<2)>>2]|0,948)|0,t[o+4>>2]|0?s=4:r=w(0)),(s|0)==4&&(r=w(Tn(o,r))),w(r)}function Wr(e,n,r){return e=e|0,n=n|0,r=w(r),X(e,n)|0?r=w(Y(e,n,r)):r=w(-w(_r(e,n,r))),w(r)}function Ar(e){return e=w(e),D[j>>2]=e,t[j>>2]|0|0}function z(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>1073741823)_n();else{s=Tt(n<<2)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r<<2)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n<<2)}function dr(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(0-(s>>2)<<2)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function Or(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~((o+-4-n|0)>>>2)<<2)),e=t[e>>2]|0,e|0&&Ve(e)}function Qn(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0;if(d=e+4|0,_=t[d>>2]|0,s=_-o|0,l=s>>2,e=n+(l<<2)|0,e>>>0<r>>>0){o=_;do t[o>>2]=t[e>>2],e=e+4|0,o=(t[d>>2]|0)+4|0,t[d>>2]=o;while(e>>>0<r>>>0)}l|0&&Y1(_+(0-l<<2)|0,n|0,s|0)|0}function nn(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0;return _=n+4|0,y=t[_>>2]|0,s=t[e>>2]|0,d=r,l=d-s|0,o=y+(0-(l>>2)<<2)|0,t[_>>2]=o,(l|0)>0&&vn(o|0,s|0,l|0)|0,s=e+4|0,l=n+8|0,o=(t[s>>2]|0)-d|0,(o|0)>0&&(vn(t[l>>2]|0,r|0,o|0)|0,t[l>>2]=(t[l>>2]|0)+(o>>>2<<2)),d=t[e>>2]|0,t[e>>2]=t[_>>2],t[_>>2]=d,d=t[s>>2]|0,t[s>>2]=t[l>>2],t[l>>2]=d,d=e+8|0,r=n+12|0,e=t[d>>2]|0,t[d>>2]=t[r>>2],t[r>>2]=e,t[n>>2]=t[_>>2],y|0}function s0(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;if(d=t[n>>2]|0,l=t[r>>2]|0,(d|0)!=(l|0)){s=e+8|0,r=((l+-4-d|0)>>>2)+1|0,e=d,o=t[s>>2]|0;do t[o>>2]=t[e>>2],o=(t[s>>2]|0)+4|0,t[s>>2]=o,e=e+4|0;while((e|0)!=(l|0));t[n>>2]=d+(r<<2)}}function t0(){_l()}function g0(){var e=0;return e=Tt(4)|0,Kr(e),e|0}function Kr(e){e=e|0,t[e>>2]=a0()|0}function _0(e){e=e|0,e|0&&(Gi(e),Ve(e))}function Gi(e){e=e|0,V0(t[e>>2]|0)}function fo(e,n,r){e=e|0,n=n|0,r=r|0,J0(t[e>>2]|0,n,r)}function x0(e,n){e=e|0,n=w(n),ki(t[e>>2]|0,n)}function Xu(e,n){return e=e|0,n=n|0,fn(t[e>>2]|0,n)|0}function Z0(){var e=0;return e=Tt(8)|0,df(e,0),e|0}function df(e,n){e=e|0,n=n|0,n?n=I0(t[n>>2]|0)|0:n=qu()|0,t[e>>2]=n,t[e+4>>2]=0,Bs(n,e)}function Ba(e){e=e|0;var n=0;return n=Tt(8)|0,df(n,e),n|0}function Oc(e){e=e|0,e|0&&(mu(e),Ve(e))}function mu(e){e=e|0;var n=0;Wu(t[e>>2]|0),n=e+4|0,e=t[n>>2]|0,t[n>>2]=0,e|0&&(Ju(e),Ve(e))}function Ju(e){e=e|0,ei(e)}function ei(e){e=e|0,e=t[e>>2]|0,e|0&&ju(e|0)}function Yf(e){return e=e|0,Vu(e)|0}function pf(e){e=e|0;var n=0,r=0;r=e+4|0,n=t[r>>2]|0,t[r>>2]=0,n|0&&(Ju(n),Ve(n)),Do(t[e>>2]|0)}function ja(e,n){e=e|0,n=n|0,Gu(t[e>>2]|0,t[n>>2]|0)}function Ua(e,n){e=e|0,n=n|0,W(t[e>>2]|0,n)}function Ic(e,n,r){e=e|0,n=n|0,r=+r,yn(t[e>>2]|0,n,w(r))}function vu(e,n,r){e=e|0,n=n|0,r=+r,sn(t[e>>2]|0,n,w(r))}function $f(e,n){e=e|0,n=n|0,R(t[e>>2]|0,n)}function gu(e,n){e=e|0,n=n|0,H(t[e>>2]|0,n)}function co(e,n){e=e|0,n=n|0,ue(t[e>>2]|0,n)}function qa(e,n){e=e|0,n=n|0,M0(t[e>>2]|0,n)}function Ws(e,n){e=e|0,n=n|0,Fe(t[e>>2]|0,n)}function za(e,n){e=e|0,n=n|0,Lr(t[e>>2]|0,n)}function Pc(e,n,r){e=e|0,n=n|0,r=+r,rn(t[e>>2]|0,n,w(r))}function Qu(e,n,r){e=e|0,n=n|0,r=+r,Hn(t[e>>2]|0,n,w(r))}function Mc(e,n){e=e|0,n=n|0,Cr(t[e>>2]|0,n)}function Fc(e,n){e=e|0,n=n|0,K(t[e>>2]|0,n)}function Lc(e,n){e=e|0,n=n|0,je(t[e>>2]|0,n)}function Kf(e,n){e=e|0,n=+n,rt(t[e>>2]|0,w(n))}function Tl(e,n){e=e|0,n=+n,wt(t[e>>2]|0,w(n))}function xl(e,n){e=e|0,n=+n,lt(t[e>>2]|0,w(n))}function hf(e,n){e=e|0,n=+n,st(t[e>>2]|0,w(n))}function xo(e,n){e=e|0,n=+n,xt(t[e>>2]|0,w(n))}function mf(e,n){e=e|0,n=+n,Qt(t[e>>2]|0,w(n))}function Wa(e,n){e=e|0,n=+n,Cn(t[e>>2]|0,w(n))}function ti(e){e=e|0,bn(t[e>>2]|0)}function Hs(e,n){e=e|0,n=+n,h0(t[e>>2]|0,w(n))}function mi(e,n){e=e|0,n=+n,ci(t[e>>2]|0,w(n))}function vi(e){e=e|0,xi(t[e>>2]|0)}function Xf(e,n){e=e|0,n=+n,qr(t[e>>2]|0,w(n))}function Rc(e,n){e=e|0,n=+n,Eo(t[e>>2]|0,w(n))}function Jf(e,n){e=e|0,n=+n,wl(t[e>>2]|0,w(n))}function ao(e,n){e=e|0,n=+n,js(t[e>>2]|0,w(n))}function $o(e,n){e=e|0,n=+n,du(t[e>>2]|0,w(n))}function kl(e,n){e=e|0,n=+n,Yu(t[e>>2]|0,w(n))}function Nc(e,n){e=e|0,n=+n,oo(t[e>>2]|0,w(n))}function Al(e,n){e=e|0,n=+n,Hi(t[e>>2]|0,w(n))}function vf(e,n){e=e|0,n=+n,F0(t[e>>2]|0,w(n))}function Qf(e,n,r){e=e|0,n=n|0,r=+r,ft(t[e>>2]|0,n,w(r))}function k0(e,n,r){e=e|0,n=n|0,r=+r,He(t[e>>2]|0,n,w(r))}function v(e,n,r){e=e|0,n=n|0,r=+r,Qe(t[e>>2]|0,n,w(r))}function m(e){return e=e|0,ve(t[e>>2]|0)|0}function S(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0;o=h,h=h+16|0,s=o,ar(s,t[n>>2]|0,r),O(e,s),h=o}function O(e,n){e=e|0,n=n|0,M(e,t[n+4>>2]|0,+w(D[n>>2]))}function M(e,n,r){e=e|0,n=n|0,r=+r,t[e>>2]=n,L[e+8>>3]=r}function b(e){return e=e|0,U(t[e>>2]|0)|0}function ee(e){return e=e|0,fe(t[e>>2]|0)|0}function Ye(e){return e=e|0,de(t[e>>2]|0)|0}function Ze(e){return e=e|0,au(t[e>>2]|0)|0}function ut(e){return e=e|0,Ge(t[e>>2]|0)|0}function In(e){return e=e|0,F(t[e>>2]|0)|0}function A0(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0;o=h,h=h+16|0,s=o,d0(s,t[n>>2]|0,r),O(e,s),h=o}function jr(e){return e=e|0,xe(t[e>>2]|0)|0}function gi(e){return e=e|0,Xe(t[e>>2]|0)|0}function po(e,n){e=e|0,n=n|0;var r=0,o=0;r=h,h=h+16|0,o=r,Rt(o,t[n>>2]|0),O(e,o),h=r}function _i(e){return e=e|0,+ +w(yl(t[e>>2]|0))}function Re(e){return e=e|0,+ +w(cu(t[e>>2]|0))}function Ce(e,n){e=e|0,n=n|0;var r=0,o=0;r=h,h=h+16|0,o=r,p0(o,t[n>>2]|0),O(e,o),h=r}function ze(e,n){e=e|0,n=n|0;var r=0,o=0;r=h,h=h+16|0,o=r,E0(o,t[n>>2]|0),O(e,o),h=r}function Et(e,n){e=e|0,n=n|0;var r=0,o=0;r=h,h=h+16|0,o=r,So(o,t[n>>2]|0),O(e,o),h=r}function on(e,n){e=e|0,n=n|0;var r=0,o=0;r=h,h=h+16|0,o=r,Dl(o,t[n>>2]|0),O(e,o),h=r}function sr(e,n){e=e|0,n=n|0;var r=0,o=0;r=h,h=h+16|0,o=r,Us(o,t[n>>2]|0),O(e,o),h=r}function mn(e,n){e=e|0,n=n|0;var r=0,o=0;r=h,h=h+16|0,o=r,qs(o,t[n>>2]|0),O(e,o),h=r}function pr(e){return e=e|0,+ +w(Gr(t[e>>2]|0))}function Hr(e,n){return e=e|0,n=n|0,+ +w(St(t[e>>2]|0,n))}function Vn(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0;o=h,h=h+16|0,s=o,Ne(s,t[n>>2]|0,r),O(e,s),h=o}function ni(e,n,r){e=e|0,n=n|0,r=r|0,Ns(t[e>>2]|0,t[n>>2]|0,r)}function Zf(e,n){e=e|0,n=n|0,D0(t[e>>2]|0,t[n>>2]|0)}function Pm(e){return e=e|0,fi(t[e>>2]|0)|0}function Ha(e){return e=e|0,e=nr(t[e>>2]|0)|0,e?e=Yf(e)|0:e=0,e|0}function vd(e,n){return e=e|0,n=n|0,e=e0(t[e>>2]|0,n)|0,e?e=Yf(e)|0:e=0,e|0}function gd(e,n){e=e|0,n=n|0;var r=0,o=0;o=Tt(4)|0,ba(o,n),r=e+4|0,n=t[r>>2]|0,t[r>>2]=o,n|0&&(Ju(n),Ve(n)),bu(t[e>>2]|0,1)}function ba(e,n){e=e|0,n=n|0,Oo(e,n)}function Bc(e,n,r,o,s,l){e=e|0,n=n|0,r=w(r),o=o|0,s=w(s),l=l|0;var d=0,_=0;d=h,h=h+16|0,_=d,Mm(_,Vu(n)|0,+r,o,+s,l),D[e>>2]=w(+L[_>>3]),D[e+4>>2]=w(+L[_+8>>3]),h=d}function Mm(e,n,r,o,s,l){e=e|0,n=n|0,r=+r,o=o|0,s=+s,l=l|0;var d=0,_=0,y=0,k=0,T=0;d=h,h=h+32|0,T=d+8|0,k=d+20|0,y=d,_=d+16|0,L[T>>3]=r,t[k>>2]=o,L[y>>3]=s,t[_>>2]=l,_d(e,t[n+4>>2]|0,T,k,y,_),h=d}function _d(e,n,r,o,s,l){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0;var d=0,_=0;d=h,h=h+16|0,_=d,Zo(_),n=Oi(n)|0,Fm(e,n,+L[r>>3],t[o>>2]|0,+L[s>>3],t[l>>2]|0),eu(_),h=d}function Oi(e){return e=e|0,t[e>>2]|0}function Fm(e,n,r,o,s,l){e=e|0,n=n|0,r=+r,o=o|0,s=+s,l=l|0;var d=0;d=ko(yd()|0)|0,r=+Ko(r),o=jc(o)|0,s=+Ko(s),Ga(e,ro(0,d|0,n|0,+r,o|0,+s,jc(l)|0)|0)}function yd(){var e=0;return c[7608]|0||(Ed(9120),e=7608,t[e>>2]=1,t[e+4>>2]=0),9120}function ko(e){return e=e|0,t[e+8>>2]|0}function Ko(e){return e=+e,+ +Ol(e)}function jc(e){return e=e|0,Dd(e)|0}function Ga(e,n){e=e|0,n=n|0;var r=0,o=0,s=0;s=h,h=h+32|0,r=s,o=n,o&1?(Lm(r,0),c0(o|0,r|0)|0,Va(e,r),Wn(r)):(t[e>>2]=t[n>>2],t[e+4>>2]=t[n+4>>2],t[e+8>>2]=t[n+8>>2],t[e+12>>2]=t[n+12>>2]),h=s}function Lm(e,n){e=e|0,n=n|0,wd(e,n),t[e+8>>2]=0,c[e+24>>0]=0}function Va(e,n){e=e|0,n=n|0,n=n+8|0,t[e>>2]=t[n>>2],t[e+4>>2]=t[n+4>>2],t[e+8>>2]=t[n+8>>2],t[e+12>>2]=t[n+12>>2]}function Wn(e){e=e|0,c[e+24>>0]=0}function wd(e,n){e=e|0,n=n|0,t[e>>2]=n}function Dd(e){return e=e|0,e|0}function Ol(e){return e=+e,+e}function Ed(e){e=e|0,Ao(e,Rm()|0,4)}function Rm(){return 1064}function Ao(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,t[e+4>>2]=r,t[e+8>>2]=hl(n|0,r+1|0)|0}function Oo(e,n){e=e|0,n=n|0,n=t[n>>2]|0,t[e>>2]=n,qi(n|0)}function Nm(e){e=e|0;var n=0,r=0;r=e+4|0,n=t[r>>2]|0,t[r>>2]=0,n|0&&(Ju(n),Ve(n)),bu(t[e>>2]|0,0)}function Uc(e){e=e|0,rr(t[e>>2]|0)}function Ya(e){return e=e|0,Go(t[e>>2]|0)|0}function Sd(e,n,r,o){e=e|0,n=+n,r=+r,o=o|0,Yr(t[e>>2]|0,w(n),w(r),o)}function Cd(e){return e=e|0,+ +w(ir(t[e>>2]|0))}function ho(e){return e=e|0,+ +w(Y0(t[e>>2]|0))}function bs(e){return e=e|0,+ +w(L0(t[e>>2]|0))}function $a(e){return e=e|0,+ +w(Co(t[e>>2]|0))}function Td(e){return e=e|0,+ +w($u(t[e>>2]|0))}function qc(e){return e=e|0,+ +w(Vo(t[e>>2]|0))}function xd(e,n){e=e|0,n=n|0,L[e>>3]=+w(ir(t[n>>2]|0)),L[e+8>>3]=+w(Y0(t[n>>2]|0)),L[e+16>>3]=+w(L0(t[n>>2]|0)),L[e+24>>3]=+w(Co(t[n>>2]|0)),L[e+32>>3]=+w($u(t[n>>2]|0)),L[e+40>>3]=+w(Vo(t[n>>2]|0))}function Ka(e,n){return e=e|0,n=n|0,+ +w(Rr(t[e>>2]|0,n))}function kd(e,n){return e=e|0,n=n|0,+ +w(Jn(t[e>>2]|0,n))}function Xa(e,n){return e=e|0,n=n|0,+ +w(ai(t[e>>2]|0,n))}function Ja(){return Rs()|0}function Gs(){Bm(),Vs(),Ad(),Od(),Qa(),jm()}function Bm(){hO(11713,4938,1)}function Vs(){FA(10448)}function Ad(){hA(10408)}function Od(){Bk(10324)}function Qa(){Gx(10096)}function jm(){Um(9132)}function Um(e){e=e|0;var n=0,r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0,we=0,le=0,ie=0,Pe=0,ke=0,qe=0,pe=0,_e=0,vt=0,Ln=0,Ht=0,It=0,gn=0,Pn=0,zt=0,Dr=0,Ki=0,Xi=0,Ji=0,Ro=0,kf=0,Af=0,Cu=0,Of=0,Js=0,Qs=0,If=0,Pf=0,Mf=0,Kn=0,Tu=0,Ff=0,us=0,Lf=0,Rf=0,Zs=0,el=0,ss=0,Fi=0,nu=0,go=0,xu=0,jl=0,Ul=0,tl=0,ql=0,zl=0,Li=0,Di=0,ku=0,xr=0,Wl=0,Qi=0,ls=0,Zi=0,fs=0,Hl=0,bl=0,cs=0,Ri=0,Au=0,Gl=0,Vl=0,Yl=0,En=0,br=0,Ei=0,eo=0,Ni=0,xn=0,Vt=0,Ou=0;n=h,h=h+672|0,r=n+656|0,Ou=n+648|0,Vt=n+640|0,xn=n+632|0,Ni=n+624|0,eo=n+616|0,Ei=n+608|0,br=n+600|0,En=n+592|0,Yl=n+584|0,Vl=n+576|0,Gl=n+568|0,Au=n+560|0,Ri=n+552|0,cs=n+544|0,bl=n+536|0,Hl=n+528|0,fs=n+520|0,Zi=n+512|0,ls=n+504|0,Qi=n+496|0,Wl=n+488|0,xr=n+480|0,ku=n+472|0,Di=n+464|0,Li=n+456|0,zl=n+448|0,ql=n+440|0,tl=n+432|0,Ul=n+424|0,jl=n+416|0,xu=n+408|0,go=n+400|0,nu=n+392|0,Fi=n+384|0,ss=n+376|0,el=n+368|0,Zs=n+360|0,Rf=n+352|0,Lf=n+344|0,us=n+336|0,Ff=n+328|0,Tu=n+320|0,Kn=n+312|0,Mf=n+304|0,Pf=n+296|0,If=n+288|0,Qs=n+280|0,Js=n+272|0,Of=n+264|0,Cu=n+256|0,Af=n+248|0,kf=n+240|0,Ro=n+232|0,Ji=n+224|0,Xi=n+216|0,Ki=n+208|0,Dr=n+200|0,zt=n+192|0,Pn=n+184|0,gn=n+176|0,It=n+168|0,Ht=n+160|0,Ln=n+152|0,vt=n+144|0,_e=n+136|0,pe=n+128|0,qe=n+120|0,ke=n+112|0,Pe=n+104|0,ie=n+96|0,le=n+88|0,we=n+80|0,q=n+72|0,P=n+64|0,T=n+56|0,k=n+48|0,y=n+40|0,_=n+32|0,d=n+24|0,l=n+16|0,s=n+8|0,o=n,qm(e,3646),Id(e,3651,2)|0,Pd(e,3665,2)|0,zm(e,3682,18)|0,t[Ou>>2]=19,t[Ou+4>>2]=0,t[r>>2]=t[Ou>>2],t[r+4>>2]=t[Ou+4>>2],gf(e,3690,r)|0,t[Vt>>2]=1,t[Vt+4>>2]=0,t[r>>2]=t[Vt>>2],t[r+4>>2]=t[Vt+4>>2],Md(e,3696,r)|0,t[xn>>2]=2,t[xn+4>>2]=0,t[r>>2]=t[xn>>2],t[r+4>>2]=t[xn+4>>2],Xr(e,3706,r)|0,t[Ni>>2]=1,t[Ni+4>>2]=0,t[r>>2]=t[Ni>>2],t[r+4>>2]=t[Ni+4>>2],yi(e,3722,r)|0,t[eo>>2]=2,t[eo+4>>2]=0,t[r>>2]=t[eo>>2],t[r+4>>2]=t[eo+4>>2],yi(e,3734,r)|0,t[Ei>>2]=3,t[Ei+4>>2]=0,t[r>>2]=t[Ei>>2],t[r+4>>2]=t[Ei+4>>2],Xr(e,3753,r)|0,t[br>>2]=4,t[br+4>>2]=0,t[r>>2]=t[br>>2],t[r+4>>2]=t[br+4>>2],Xr(e,3769,r)|0,t[En>>2]=5,t[En+4>>2]=0,t[r>>2]=t[En>>2],t[r+4>>2]=t[En+4>>2],Xr(e,3783,r)|0,t[Yl>>2]=6,t[Yl+4>>2]=0,t[r>>2]=t[Yl>>2],t[r+4>>2]=t[Yl+4>>2],Xr(e,3796,r)|0,t[Vl>>2]=7,t[Vl+4>>2]=0,t[r>>2]=t[Vl>>2],t[r+4>>2]=t[Vl+4>>2],Xr(e,3813,r)|0,t[Gl>>2]=8,t[Gl+4>>2]=0,t[r>>2]=t[Gl>>2],t[r+4>>2]=t[Gl+4>>2],Xr(e,3825,r)|0,t[Au>>2]=3,t[Au+4>>2]=0,t[r>>2]=t[Au>>2],t[r+4>>2]=t[Au+4>>2],yi(e,3843,r)|0,t[Ri>>2]=4,t[Ri+4>>2]=0,t[r>>2]=t[Ri>>2],t[r+4>>2]=t[Ri+4>>2],yi(e,3853,r)|0,t[cs>>2]=9,t[cs+4>>2]=0,t[r>>2]=t[cs>>2],t[r+4>>2]=t[cs+4>>2],Xr(e,3870,r)|0,t[bl>>2]=10,t[bl+4>>2]=0,t[r>>2]=t[bl>>2],t[r+4>>2]=t[bl+4>>2],Xr(e,3884,r)|0,t[Hl>>2]=11,t[Hl+4>>2]=0,t[r>>2]=t[Hl>>2],t[r+4>>2]=t[Hl+4>>2],Xr(e,3896,r)|0,t[fs>>2]=1,t[fs+4>>2]=0,t[r>>2]=t[fs>>2],t[r+4>>2]=t[fs+4>>2],j0(e,3907,r)|0,t[Zi>>2]=2,t[Zi+4>>2]=0,t[r>>2]=t[Zi>>2],t[r+4>>2]=t[Zi+4>>2],j0(e,3915,r)|0,t[ls>>2]=3,t[ls+4>>2]=0,t[r>>2]=t[ls>>2],t[r+4>>2]=t[ls+4>>2],j0(e,3928,r)|0,t[Qi>>2]=4,t[Qi+4>>2]=0,t[r>>2]=t[Qi>>2],t[r+4>>2]=t[Qi+4>>2],j0(e,3948,r)|0,t[Wl>>2]=5,t[Wl+4>>2]=0,t[r>>2]=t[Wl>>2],t[r+4>>2]=t[Wl+4>>2],j0(e,3960,r)|0,t[xr>>2]=6,t[xr+4>>2]=0,t[r>>2]=t[xr>>2],t[r+4>>2]=t[xr+4>>2],j0(e,3974,r)|0,t[ku>>2]=7,t[ku+4>>2]=0,t[r>>2]=t[ku>>2],t[r+4>>2]=t[ku+4>>2],j0(e,3983,r)|0,t[Di>>2]=20,t[Di+4>>2]=0,t[r>>2]=t[Di>>2],t[r+4>>2]=t[Di+4>>2],gf(e,3999,r)|0,t[Li>>2]=8,t[Li+4>>2]=0,t[r>>2]=t[Li>>2],t[r+4>>2]=t[Li+4>>2],j0(e,4012,r)|0,t[zl>>2]=9,t[zl+4>>2]=0,t[r>>2]=t[zl>>2],t[r+4>>2]=t[zl+4>>2],j0(e,4022,r)|0,t[ql>>2]=21,t[ql+4>>2]=0,t[r>>2]=t[ql>>2],t[r+4>>2]=t[ql+4>>2],gf(e,4039,r)|0,t[tl>>2]=10,t[tl+4>>2]=0,t[r>>2]=t[tl>>2],t[r+4>>2]=t[tl+4>>2],j0(e,4053,r)|0,t[Ul>>2]=11,t[Ul+4>>2]=0,t[r>>2]=t[Ul>>2],t[r+4>>2]=t[Ul+4>>2],j0(e,4065,r)|0,t[jl>>2]=12,t[jl+4>>2]=0,t[r>>2]=t[jl>>2],t[r+4>>2]=t[jl+4>>2],j0(e,4084,r)|0,t[xu>>2]=13,t[xu+4>>2]=0,t[r>>2]=t[xu>>2],t[r+4>>2]=t[xu+4>>2],j0(e,4097,r)|0,t[go>>2]=14,t[go+4>>2]=0,t[r>>2]=t[go>>2],t[r+4>>2]=t[go+4>>2],j0(e,4117,r)|0,t[nu>>2]=15,t[nu+4>>2]=0,t[r>>2]=t[nu>>2],t[r+4>>2]=t[nu+4>>2],j0(e,4129,r)|0,t[Fi>>2]=16,t[Fi+4>>2]=0,t[r>>2]=t[Fi>>2],t[r+4>>2]=t[Fi+4>>2],j0(e,4148,r)|0,t[ss>>2]=17,t[ss+4>>2]=0,t[r>>2]=t[ss>>2],t[r+4>>2]=t[ss+4>>2],j0(e,4161,r)|0,t[el>>2]=18,t[el+4>>2]=0,t[r>>2]=t[el>>2],t[r+4>>2]=t[el+4>>2],j0(e,4181,r)|0,t[Zs>>2]=5,t[Zs+4>>2]=0,t[r>>2]=t[Zs>>2],t[r+4>>2]=t[Zs+4>>2],yi(e,4196,r)|0,t[Rf>>2]=6,t[Rf+4>>2]=0,t[r>>2]=t[Rf>>2],t[r+4>>2]=t[Rf+4>>2],yi(e,4206,r)|0,t[Lf>>2]=7,t[Lf+4>>2]=0,t[r>>2]=t[Lf>>2],t[r+4>>2]=t[Lf+4>>2],yi(e,4217,r)|0,t[us>>2]=3,t[us+4>>2]=0,t[r>>2]=t[us>>2],t[r+4>>2]=t[us+4>>2],Zu(e,4235,r)|0,t[Ff>>2]=1,t[Ff+4>>2]=0,t[r>>2]=t[Ff>>2],t[r+4>>2]=t[Ff+4>>2],_f(e,4251,r)|0,t[Tu>>2]=4,t[Tu+4>>2]=0,t[r>>2]=t[Tu>>2],t[r+4>>2]=t[Tu+4>>2],Zu(e,4263,r)|0,t[Kn>>2]=5,t[Kn+4>>2]=0,t[r>>2]=t[Kn>>2],t[r+4>>2]=t[Kn+4>>2],Zu(e,4279,r)|0,t[Mf>>2]=6,t[Mf+4>>2]=0,t[r>>2]=t[Mf>>2],t[r+4>>2]=t[Mf+4>>2],Zu(e,4293,r)|0,t[Pf>>2]=7,t[Pf+4>>2]=0,t[r>>2]=t[Pf>>2],t[r+4>>2]=t[Pf+4>>2],Zu(e,4306,r)|0,t[If>>2]=8,t[If+4>>2]=0,t[r>>2]=t[If>>2],t[r+4>>2]=t[If+4>>2],Zu(e,4323,r)|0,t[Qs>>2]=9,t[Qs+4>>2]=0,t[r>>2]=t[Qs>>2],t[r+4>>2]=t[Qs+4>>2],Zu(e,4335,r)|0,t[Js>>2]=2,t[Js+4>>2]=0,t[r>>2]=t[Js>>2],t[r+4>>2]=t[Js+4>>2],_f(e,4353,r)|0,t[Of>>2]=12,t[Of+4>>2]=0,t[r>>2]=t[Of>>2],t[r+4>>2]=t[Of+4>>2],Io(e,4363,r)|0,t[Cu>>2]=1,t[Cu+4>>2]=0,t[r>>2]=t[Cu>>2],t[r+4>>2]=t[Cu+4>>2],_u(e,4376,r)|0,t[Af>>2]=2,t[Af+4>>2]=0,t[r>>2]=t[Af>>2],t[r+4>>2]=t[Af+4>>2],_u(e,4388,r)|0,t[kf>>2]=13,t[kf+4>>2]=0,t[r>>2]=t[kf>>2],t[r+4>>2]=t[kf+4>>2],Io(e,4402,r)|0,t[Ro>>2]=14,t[Ro+4>>2]=0,t[r>>2]=t[Ro>>2],t[r+4>>2]=t[Ro+4>>2],Io(e,4411,r)|0,t[Ji>>2]=15,t[Ji+4>>2]=0,t[r>>2]=t[Ji>>2],t[r+4>>2]=t[Ji+4>>2],Io(e,4421,r)|0,t[Xi>>2]=16,t[Xi+4>>2]=0,t[r>>2]=t[Xi>>2],t[r+4>>2]=t[Xi+4>>2],Io(e,4433,r)|0,t[Ki>>2]=17,t[Ki+4>>2]=0,t[r>>2]=t[Ki>>2],t[r+4>>2]=t[Ki+4>>2],Io(e,4446,r)|0,t[Dr>>2]=18,t[Dr+4>>2]=0,t[r>>2]=t[Dr>>2],t[r+4>>2]=t[Dr+4>>2],Io(e,4458,r)|0,t[zt>>2]=3,t[zt+4>>2]=0,t[r>>2]=t[zt>>2],t[r+4>>2]=t[zt+4>>2],_u(e,4471,r)|0,t[Pn>>2]=1,t[Pn+4>>2]=0,t[r>>2]=t[Pn>>2],t[r+4>>2]=t[Pn+4>>2],ec(e,4486,r)|0,t[gn>>2]=10,t[gn+4>>2]=0,t[r>>2]=t[gn>>2],t[r+4>>2]=t[gn+4>>2],Zu(e,4496,r)|0,t[It>>2]=11,t[It+4>>2]=0,t[r>>2]=t[It>>2],t[r+4>>2]=t[It+4>>2],Zu(e,4508,r)|0,t[Ht>>2]=3,t[Ht+4>>2]=0,t[r>>2]=t[Ht>>2],t[r+4>>2]=t[Ht+4>>2],_f(e,4519,r)|0,t[Ln>>2]=4,t[Ln+4>>2]=0,t[r>>2]=t[Ln>>2],t[r+4>>2]=t[Ln+4>>2],Wm(e,4530,r)|0,t[vt>>2]=19,t[vt+4>>2]=0,t[r>>2]=t[vt>>2],t[r+4>>2]=t[vt+4>>2],Fd(e,4542,r)|0,t[_e>>2]=12,t[_e+4>>2]=0,t[r>>2]=t[_e>>2],t[r+4>>2]=t[_e+4>>2],yf(e,4554,r)|0,t[pe>>2]=13,t[pe+4>>2]=0,t[r>>2]=t[pe>>2],t[r+4>>2]=t[pe+4>>2],tc(e,4568,r)|0,t[qe>>2]=2,t[qe+4>>2]=0,t[r>>2]=t[qe>>2],t[r+4>>2]=t[qe+4>>2],Hm(e,4578,r)|0,t[ke>>2]=20,t[ke+4>>2]=0,t[r>>2]=t[ke>>2],t[r+4>>2]=t[ke+4>>2],Ld(e,4587,r)|0,t[Pe>>2]=22,t[Pe+4>>2]=0,t[r>>2]=t[Pe>>2],t[r+4>>2]=t[Pe+4>>2],gf(e,4602,r)|0,t[ie>>2]=23,t[ie+4>>2]=0,t[r>>2]=t[ie>>2],t[r+4>>2]=t[ie+4>>2],gf(e,4619,r)|0,t[le>>2]=14,t[le+4>>2]=0,t[r>>2]=t[le>>2],t[r+4>>2]=t[le+4>>2],Rd(e,4629,r)|0,t[we>>2]=1,t[we+4>>2]=0,t[r>>2]=t[we>>2],t[r+4>>2]=t[we+4>>2],zc(e,4637,r)|0,t[q>>2]=4,t[q+4>>2]=0,t[r>>2]=t[q>>2],t[r+4>>2]=t[q+4>>2],_u(e,4653,r)|0,t[P>>2]=5,t[P+4>>2]=0,t[r>>2]=t[P>>2],t[r+4>>2]=t[P+4>>2],_u(e,4669,r)|0,t[T>>2]=6,t[T+4>>2]=0,t[r>>2]=t[T>>2],t[r+4>>2]=t[T+4>>2],_u(e,4686,r)|0,t[k>>2]=7,t[k+4>>2]=0,t[r>>2]=t[k>>2],t[r+4>>2]=t[k+4>>2],_u(e,4701,r)|0,t[y>>2]=8,t[y+4>>2]=0,t[r>>2]=t[y>>2],t[r+4>>2]=t[y+4>>2],_u(e,4719,r)|0,t[_>>2]=9,t[_+4>>2]=0,t[r>>2]=t[_>>2],t[r+4>>2]=t[_+4>>2],_u(e,4736,r)|0,t[d>>2]=21,t[d+4>>2]=0,t[r>>2]=t[d>>2],t[r+4>>2]=t[d+4>>2],Nd(e,4754,r)|0,t[l>>2]=2,t[l+4>>2]=0,t[r>>2]=t[l>>2],t[r+4>>2]=t[l+4>>2],ec(e,4772,r)|0,t[s>>2]=3,t[s+4>>2]=0,t[r>>2]=t[s>>2],t[r+4>>2]=t[s+4>>2],ec(e,4790,r)|0,t[o>>2]=4,t[o+4>>2]=0,t[r>>2]=t[o>>2],t[r+4>>2]=t[o+4>>2],ec(e,4808,r)|0,h=n}function qm(e,n){e=e|0,n=n|0;var r=0;r=Nx()|0,t[e>>2]=r,Bx(r,n),Cf(t[e>>2]|0)}function Id(e,n,r){return e=e|0,n=n|0,r=r|0,Ex(e,Zn(n)|0,r,0),e|0}function Pd(e,n,r){return e=e|0,n=n|0,r=r|0,ux(e,Zn(n)|0,r,0),e|0}function zm(e,n,r){return e=e|0,n=n|0,r=r|0,V9(e,Zn(n)|0,r,0),e|0}function gf(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],I9(e,n,s),h=o,e|0}function Md(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],vo(e,n,s),h=o,e|0}function Xr(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],a(e,n,s),h=o,e|0}function yi(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],n4(e,n,s),h=o,e|0}function j0(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],b_(e,n,s),h=o,e|0}function Zu(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],L_(e,n,s),h=o,e|0}function _f(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Hp(e,n,s),h=o,e|0}function Io(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],e_(e,n,s),h=o,e|0}function _u(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Ip(e,n,s),h=o,e|0}function ec(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Ng(e,n,s),h=o,e|0}function Wm(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],l0(e,n,s),h=o,e|0}function Fd(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],hg(e,n,s),h=o,e|0}function yf(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],sg(e,n,s),h=o,e|0}function tc(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Kv(e,n,s),h=o,e|0}function Hm(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],y1(e,n,s),h=o,e|0}function Ld(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],wv(e,n,s),h=o,e|0}function Rd(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],fv(e,n,s),h=o,e|0}function zc(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Gd(e,n,s),h=o,e|0}function Nd(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Wc(e,n,s),h=o,e|0}function Wc(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Hc(e,r,s,1),h=o}function Zn(e){return e=e|0,e|0}function Hc(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=Za()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=Bd(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,bc(l,o)|0,o),h=s}function Za(){var e=0,n=0;if(c[7616]|0||(yu(9136),Bt(24,9136,Q|0)|0,n=7616,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9136)|0)){e=9136,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));yu(9136)}return 9136}function Bd(e){return e=e|0,0}function bc(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=Za()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],n1(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(jd(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function ur(e,n,r,o,s,l){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0;var d=0,_=0,y=0,k=0,T=0,P=0,q=0,we=0;d=h,h=h+32|0,q=d+24|0,P=d+20|0,y=d+16|0,T=d+12|0,k=d+8|0,_=d+4|0,we=d,t[P>>2]=n,t[y>>2]=r,t[T>>2]=o,t[k>>2]=s,t[_>>2]=l,l=e+28|0,t[we>>2]=t[l>>2],t[q>>2]=t[we>>2],e1(e+24|0,q,P,T,k,y,_)|0,t[l>>2]=t[t[l>>2]>>2],h=d}function e1(e,n,r,o,s,l,d){return e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0,d=d|0,e=bm(n)|0,n=Tt(24)|0,t1(n+4|0,t[r>>2]|0,t[o>>2]|0,t[s>>2]|0,t[l>>2]|0,t[d>>2]|0),t[n>>2]=t[e>>2],t[e>>2]=n,n|0}function bm(e){return e=e|0,t[e>>2]|0}function t1(e,n,r,o,s,l){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0,t[e>>2]=n,t[e+4>>2]=r,t[e+8>>2]=o,t[e+12>>2]=s,t[e+16>>2]=l}function Lt(e,n){return e=e|0,n=n|0,n|e|0}function n1(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function jd(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=Gm(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,Ud(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],n1(l,o,r),t[y>>2]=(t[y>>2]|0)+12,Vm(e,_),Ym(_),h=k;return}}function Gm(e){return e=e|0,357913941}function Ud(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function Vm(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function Ym(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function yu(e){e=e|0,Gc(e)}function r1(e){e=e|0,i1(e+24|0)}function Dn(e){return e=e|0,t[e>>2]|0}function i1(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function Gc(e){e=e|0;var n=0;n=An()|0,Nn(e,2,3,n,cn()|0,0),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function An(){return 9228}function cn(){return 1140}function Vc(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0;return r=h,h=h+16|0,o=r+8|0,s=r,l=Il(e)|0,e=t[l+4>>2]|0,t[s>>2]=t[l>>2],t[s+4>>2]=e,t[o>>2]=t[s>>2],t[o+4>>2]=t[s+4>>2],n=$m(n,o)|0,h=r,n|0}function Nn(e,n,r,o,s,l){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0,t[e>>2]=n,t[e+4>>2]=r,t[e+8>>2]=o,t[e+12>>2]=s,t[e+16>>2]=l}function Il(e){return e=e|0,(t[(Za()|0)+24>>2]|0)+(e*12|0)|0}function $m(e,n){e=e|0,n=n|0;var r=0,o=0,s=0;return s=h,h=h+48|0,o=s,r=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(r=t[(t[e>>2]|0)+r>>2]|0),Bl[r&31](o,e),o=o1(o)|0,h=s,o|0}function o1(e){e=e|0;var n=0,r=0,o=0,s=0;return s=h,h=h+32|0,n=s+12|0,r=s,o=U0(u1()|0)|0,o?(s1(n,o),l1(r,n),qd(e,r),e=f1(n)|0):e=zd(e)|0,h=s,e|0}function u1(){var e=0;return c[7632]|0||(nc(9184),Bt(25,9184,Q|0)|0,e=7632,t[e>>2]=1,t[e+4>>2]=0),9184}function U0(e){return e=e|0,t[e+36>>2]|0}function s1(e,n){e=e|0,n=n|0,t[e>>2]=n,t[e+4>>2]=e,t[e+8>>2]=0}function l1(e,n){e=e|0,n=n|0,t[e>>2]=t[n>>2],t[e+4>>2]=t[n+4>>2],t[e+8>>2]=0}function qd(e,n){e=e|0,n=n|0,Ii(n,e,e+8|0,e+16|0,e+24|0,e+32|0,e+40|0)|0}function f1(e){return e=e|0,t[(t[e+4>>2]|0)+8>>2]|0}function zd(e){e=e|0;var n=0,r=0,o=0,s=0,l=0,d=0,_=0,y=0;y=h,h=h+16|0,r=y+4|0,o=y,s=Qo(8)|0,l=s,d=Tt(48)|0,_=d,n=_+48|0;do t[_>>2]=t[e>>2],_=_+4|0,e=e+4|0;while((_|0)<(n|0));return n=l+4|0,t[n>>2]=d,_=Tt(8)|0,d=t[n>>2]|0,t[o>>2]=0,t[r>>2]=t[o>>2],Wd(_,d,r),t[s>>2]=_,h=y,l|0}function Wd(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,r=Tt(16)|0,t[r+4>>2]=0,t[r+8>>2]=0,t[r>>2]=1092,t[r+12>>2]=n,t[e+4>>2]=r}function Km(e){e=e|0,da(e),Ve(e)}function Xm(e){e=e|0,e=t[e+12>>2]|0,e|0&&Ve(e)}function es(e){e=e|0,Ve(e)}function Ii(e,n,r,o,s,l,d){return e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0,d=d|0,l=c1(t[e>>2]|0,n,r,o,s,l,d)|0,d=e+4|0,t[(t[d>>2]|0)+8>>2]=l,t[(t[d>>2]|0)+8>>2]|0}function c1(e,n,r,o,s,l,d){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0,d=d|0;var _=0,y=0;return _=h,h=h+16|0,y=_,Zo(y),e=Oi(e)|0,d=Jm(e,+L[n>>3],+L[r>>3],+L[o>>3],+L[s>>3],+L[l>>3],+L[d>>3])|0,eu(y),h=_,d|0}function Jm(e,n,r,o,s,l,d){e=e|0,n=+n,r=+r,o=+o,s=+s,l=+l,d=+d;var _=0;return _=ko(a1()|0)|0,n=+Ko(n),r=+Ko(r),o=+Ko(o),s=+Ko(s),l=+Ko(l),xs(0,_|0,e|0,+n,+r,+o,+s,+l,+ +Ko(d))|0}function a1(){var e=0;return c[7624]|0||(Qm(9172),e=7624,t[e>>2]=1,t[e+4>>2]=0),9172}function Qm(e){e=e|0,Ao(e,Zm()|0,6)}function Zm(){return 1112}function nc(e){e=e|0,Ys(e)}function Hd(e){e=e|0,d1(e+24|0),bd(e+16|0)}function d1(e){e=e|0,tv(e)}function bd(e){e=e|0,ev(e)}function ev(e){e=e|0;var n=0,r=0;if(n=t[e>>2]|0,n|0)do r=n,n=t[n>>2]|0,Ve(r);while((n|0)!=0);t[e>>2]=0}function tv(e){e=e|0;var n=0,r=0;if(n=t[e>>2]|0,n|0)do r=n,n=t[n>>2]|0,Ve(r);while((n|0)!=0);t[e>>2]=0}function Ys(e){e=e|0;var n=0;t[e+16>>2]=0,t[e+20>>2]=0,n=e+24|0,t[n>>2]=0,t[e+28>>2]=n,t[e+36>>2]=0,c[e+40>>0]=0,c[e+41>>0]=0}function Gd(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Vd(e,r,s,0),h=o}function Vd(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=p1()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=h1(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,Yd(l,o)|0,o),h=s}function p1(){var e=0,n=0;if(c[7640]|0||(Xo(9232),Bt(26,9232,Q|0)|0,n=7640,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9232)|0)){e=9232,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));Xo(9232)}return 9232}function h1(e){return e=e|0,0}function Yd(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=p1()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],wf(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(m1(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function wf(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function m1(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=$d(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,Kd(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],wf(l,o,r),t[y>>2]=(t[y>>2]|0)+12,Yc(e,_),Xd(_),h=k;return}}function $d(e){return e=e|0,357913941}function Kd(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function Yc(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function Xd(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function Xo(e){e=e|0,Jd(e)}function Pl(e){e=e|0,nv(e+24|0)}function nv(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function Jd(e){e=e|0;var n=0;n=An()|0,Nn(e,2,1,n,rv()|0,3),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function rv(){return 1144}function iv(e,n,r,o,s){e=e|0,n=n|0,r=+r,o=+o,s=s|0;var l=0,d=0,_=0,y=0;l=h,h=h+16|0,d=l+8|0,_=l,y=ov(e)|0,e=t[y+4>>2]|0,t[_>>2]=t[y>>2],t[_+4>>2]=e,t[d>>2]=t[_>>2],t[d+4>>2]=t[_+4>>2],uv(n,d,r,o,s),h=l}function ov(e){return e=e|0,(t[(p1()|0)+24>>2]|0)+(e*12|0)|0}function uv(e,n,r,o,s){e=e|0,n=n|0,r=+r,o=+o,s=s|0;var l=0,d=0,_=0,y=0,k=0;k=h,h=h+16|0,d=k+2|0,_=k+1|0,y=k,l=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(l=t[(t[e>>2]|0)+l>>2]|0),wu(d,r),r=+Du(d,r),wu(_,o),o=+Du(_,o),ts(y,s),y=ns(y,s)|0,iD[l&1](e,r,o,y),h=k}function wu(e,n){e=e|0,n=+n}function Du(e,n){return e=e|0,n=+n,+ +lv(n)}function ts(e,n){e=e|0,n=n|0}function ns(e,n){return e=e|0,n=n|0,sv(n)|0}function sv(e){return e=e|0,e|0}function lv(e){return e=+e,+e}function fv(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Qd(e,r,s,1),h=o}function Qd(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=$c()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=Zd(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,cv(l,o)|0,o),h=s}function $c(){var e=0,n=0;if(c[7648]|0||(np(9268),Bt(27,9268,Q|0)|0,n=7648,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9268)|0)){e=9268,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));np(9268)}return 9268}function Zd(e){return e=e|0,0}function cv(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=$c()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],ep(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(av(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function ep(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function av(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=tp(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,dv(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],ep(l,o,r),t[y>>2]=(t[y>>2]|0)+12,pv(e,_),hv(_),h=k;return}}function tp(e){return e=e|0,357913941}function dv(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function pv(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function hv(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function np(e){e=e|0,Po(e)}function mv(e){e=e|0,vv(e+24|0)}function vv(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function Po(e){e=e|0;var n=0;n=An()|0,Nn(e,2,4,n,gv()|0,0),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function gv(){return 1160}function _v(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0;return r=h,h=h+16|0,o=r+8|0,s=r,l=yv(e)|0,e=t[l+4>>2]|0,t[s>>2]=t[l>>2],t[s+4>>2]=e,t[o>>2]=t[s>>2],t[o+4>>2]=t[s+4>>2],n=rp(n,o)|0,h=r,n|0}function yv(e){return e=e|0,(t[($c()|0)+24>>2]|0)+(e*12|0)|0}function rp(e,n){e=e|0,n=n|0;var r=0;return r=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(r=t[(t[e>>2]|0)+r>>2]|0),ip(dc[r&31](e)|0)|0}function ip(e){return e=e|0,e&1|0}function wv(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Dv(e,r,s,0),h=o}function Dv(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=v1()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=g1(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,Ev(l,o)|0,o),h=s}function v1(){var e=0,n=0;if(c[7656]|0||(up(9304),Bt(28,9304,Q|0)|0,n=7656,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9304)|0)){e=9304,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));up(9304)}return 9304}function g1(e){return e=e|0,0}function Ev(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=v1()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],op(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(Sv(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function op(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function Sv(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=Cv(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,Tv(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],op(l,o,r),t[y>>2]=(t[y>>2]|0)+12,xv(e,_),kv(_),h=k;return}}function Cv(e){return e=e|0,357913941}function Tv(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function xv(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function kv(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function up(e){e=e|0,Iv(e)}function Av(e){e=e|0,Ov(e+24|0)}function Ov(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function Iv(e){e=e|0;var n=0;n=An()|0,Nn(e,2,5,n,Pv()|0,1),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function Pv(){return 1164}function Mv(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;o=h,h=h+16|0,s=o+8|0,l=o,d=Fv(e)|0,e=t[d+4>>2]|0,t[l>>2]=t[d>>2],t[l+4>>2]=e,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Lv(n,s,r),h=o}function Fv(e){return e=e|0,(t[(v1()|0)+24>>2]|0)+(e*12|0)|0}function Lv(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0;l=h,h=h+16|0,s=l,o=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(o=t[(t[e>>2]|0)+o>>2]|0),$s(s,r),r=Ks(s,r)|0,Bl[o&31](e,r),Xs(s),h=l}function $s(e,n){e=e|0,n=n|0,Rv(e,n)}function Ks(e,n){return e=e|0,n=n|0,e|0}function Xs(e){e=e|0,Ju(e)}function Rv(e,n){e=e|0,n=n|0,_1(e,n)}function _1(e,n){e=e|0,n=n|0,t[e>>2]=n}function y1(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],sp(e,r,s,0),h=o}function sp(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=w1()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=Nv(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,Bv(l,o)|0,o),h=s}function w1(){var e=0,n=0;if(c[7664]|0||(cp(9340),Bt(29,9340,Q|0)|0,n=7664,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9340)|0)){e=9340,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));cp(9340)}return 9340}function Nv(e){return e=e|0,0}function Bv(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=w1()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],lp(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(jv(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function lp(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function jv(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=Uv(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,qv(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],lp(l,o,r),t[y>>2]=(t[y>>2]|0)+12,zv(e,_),fp(_),h=k;return}}function Uv(e){return e=e|0,357913941}function qv(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function zv(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function fp(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function cp(e){e=e|0,Hv(e)}function Kc(e){e=e|0,Wv(e+24|0)}function Wv(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function Hv(e){e=e|0;var n=0;n=An()|0,Nn(e,2,4,n,bv()|0,1),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function bv(){return 1180}function Gv(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=Vv(e)|0,e=t[d+4>>2]|0,t[l>>2]=t[d>>2],t[l+4>>2]=e,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],r=Yv(n,s,r)|0,h=o,r|0}function Vv(e){return e=e|0,(t[(w1()|0)+24>>2]|0)+(e*12|0)|0}function Yv(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0;return l=h,h=h+16|0,s=l,o=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(o=t[(t[e>>2]|0)+o>>2]|0),Ml(s,r),s=Fl(s,r)|0,s=Xc(J4[o&15](e,s)|0)|0,h=l,s|0}function Ml(e,n){e=e|0,n=n|0}function Fl(e,n){return e=e|0,n=n|0,$v(n)|0}function Xc(e){return e=e|0,e|0}function $v(e){return e=e|0,e|0}function Kv(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Xv(e,r,s,0),h=o}function Xv(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=D1()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=Jv(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,Qv(l,o)|0,o),h=s}function D1(){var e=0,n=0;if(c[7672]|0||(hp(9376),Bt(30,9376,Q|0)|0,n=7672,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9376)|0)){e=9376,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));hp(9376)}return 9376}function Jv(e){return e=e|0,0}function Qv(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=D1()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],ap(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(dp(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function ap(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function dp(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=pp(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,Zv(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],ap(l,o,r),t[y>>2]=(t[y>>2]|0)+12,eg(e,_),tg(_),h=k;return}}function pp(e){return e=e|0,357913941}function Zv(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function eg(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function tg(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function hp(e){e=e|0,rg(e)}function Jc(e){e=e|0,ng(e+24|0)}function ng(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function rg(e){e=e|0;var n=0;n=An()|0,Nn(e,2,5,n,mp()|0,0),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function mp(){return 1196}function ig(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0;return r=h,h=h+16|0,o=r+8|0,s=r,l=og(e)|0,e=t[l+4>>2]|0,t[s>>2]=t[l>>2],t[s+4>>2]=e,t[o>>2]=t[s>>2],t[o+4>>2]=t[s+4>>2],n=ug(n,o)|0,h=r,n|0}function og(e){return e=e|0,(t[(D1()|0)+24>>2]|0)+(e*12|0)|0}function ug(e,n){e=e|0,n=n|0;var r=0;return r=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(r=t[(t[e>>2]|0)+r>>2]|0),Xc(dc[r&31](e)|0)|0}function sg(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],lg(e,r,s,1),h=o}function lg(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=E1()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=fg(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,cg(l,o)|0,o),h=s}function E1(){var e=0,n=0;if(c[7680]|0||(C1(9412),Bt(31,9412,Q|0)|0,n=7680,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9412)|0)){e=9412,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));C1(9412)}return 9412}function fg(e){return e=e|0,0}function cg(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=E1()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],rc(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(ag(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function rc(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function ag(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=vp(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,gp(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],rc(l,o,r),t[y>>2]=(t[y>>2]|0)+12,S1(e,_),_p(_),h=k;return}}function vp(e){return e=e|0,357913941}function gp(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function S1(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function _p(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function C1(e){e=e|0,dg(e)}function yp(e){e=e|0,wp(e+24|0)}function wp(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function dg(e){e=e|0;var n=0;n=An()|0,Nn(e,2,6,n,Dp()|0,0),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function Dp(){return 1200}function pg(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0;return r=h,h=h+16|0,o=r+8|0,s=r,l=Qc(e)|0,e=t[l+4>>2]|0,t[s>>2]=t[l>>2],t[s+4>>2]=e,t[o>>2]=t[s>>2],t[o+4>>2]=t[s+4>>2],n=Zc(n,o)|0,h=r,n|0}function Qc(e){return e=e|0,(t[(E1()|0)+24>>2]|0)+(e*12|0)|0}function Zc(e,n){e=e|0,n=n|0;var r=0;return r=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(r=t[(t[e>>2]|0)+r>>2]|0),ea(dc[r&31](e)|0)|0}function ea(e){return e=e|0,e|0}function hg(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],T1(e,r,s,0),h=o}function T1(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=ta()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=mg(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,vg(l,o)|0,o),h=s}function ta(){var e=0,n=0;if(c[7688]|0||(Sp(9448),Bt(32,9448,Q|0)|0,n=7688,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9448)|0)){e=9448,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));Sp(9448)}return 9448}function mg(e){return e=e|0,0}function vg(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=ta()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],Ep(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(gg(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function Ep(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function gg(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=_g(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,yg(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],Ep(l,o,r),t[y>>2]=(t[y>>2]|0)+12,wg(e,_),Dg(_),h=k;return}}function _g(e){return e=e|0,357913941}function yg(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function wg(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function Dg(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function Sp(e){e=e|0,Cg(e)}function Eg(e){e=e|0,Sg(e+24|0)}function Sg(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function Cg(e){e=e|0;var n=0;n=An()|0,Nn(e,2,6,n,Mo()|0,1),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function Mo(){return 1204}function Tg(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;o=h,h=h+16|0,s=o+8|0,l=o,d=xg(e)|0,e=t[d+4>>2]|0,t[l>>2]=t[d>>2],t[l+4>>2]=e,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Ll(n,s,r),h=o}function xg(e){return e=e|0,(t[(ta()|0)+24>>2]|0)+(e*12|0)|0}function Ll(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0;l=h,h=h+16|0,s=l,o=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(o=t[(t[e>>2]|0)+o>>2]|0),On(s,r),s=x1(s,r)|0,Bl[o&31](e,s),h=l}function On(e,n){e=e|0,n=n|0}function x1(e,n){return e=e|0,n=n|0,Vi(n)|0}function Vi(e){return e=e|0,e|0}function l0(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],kg(e,r,s,0),h=o}function kg(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=Eu()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=Ag(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,Og(l,o)|0,o),h=s}function Eu(){var e=0,n=0;if(c[7696]|0||(A1(9484),Bt(33,9484,Q|0)|0,n=7696,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9484)|0)){e=9484,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));A1(9484)}return 9484}function Ag(e){return e=e|0,0}function Og(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=Eu()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],Cp(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(Ig(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function Cp(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function Ig(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=Pg(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,k1(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],Cp(l,o,r),t[y>>2]=(t[y>>2]|0)+12,Mg(e,_),rs(_),h=k;return}}function Pg(e){return e=e|0,357913941}function k1(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function Mg(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function rs(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function A1(e){e=e|0,n0(e)}function na(e){e=e|0,Jr(e+24|0)}function Jr(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function n0(e){e=e|0;var n=0;n=An()|0,Nn(e,2,1,n,Tp()|0,2),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function Tp(){return 1212}function Fg(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0;s=h,h=h+16|0,l=s+8|0,d=s,_=Lg(e)|0,e=t[_+4>>2]|0,t[d>>2]=t[_>>2],t[d+4>>2]=e,t[l>>2]=t[d>>2],t[l+4>>2]=t[d+4>>2],Rg(n,l,r,o),h=s}function Lg(e){return e=e|0,(t[(Eu()|0)+24>>2]|0)+(e*12|0)|0}function Rg(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0;_=h,h=h+16|0,l=_+1|0,d=_,s=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(s=t[(t[e>>2]|0)+s>>2]|0),On(l,r),l=x1(l,r)|0,Ml(d,o),d=Fl(d,o)|0,X1[s&15](e,l,d),h=_}function Ng(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Bg(e,r,s,1),h=o}function Bg(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=O1()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=xp(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,ic(l,o)|0,o),h=s}function O1(){var e=0,n=0;if(c[7704]|0||(Ap(9520),Bt(34,9520,Q|0)|0,n=7704,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9520)|0)){e=9520,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));Ap(9520)}return 9520}function xp(e){return e=e|0,0}function ic(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=O1()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],ra(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(jg(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function ra(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function jg(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=kp(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,ia(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],ra(l,o,r),t[y>>2]=(t[y>>2]|0)+12,mo(e,_),Df(_),h=k;return}}function kp(e){return e=e|0,357913941}function ia(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function mo(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function Df(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function Ap(e){e=e|0,zg(e)}function Ug(e){e=e|0,qg(e+24|0)}function qg(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function zg(e){e=e|0;var n=0;n=An()|0,Nn(e,2,1,n,Wg()|0,1),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function Wg(){return 1224}function Op(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;return s=h,h=h+16|0,l=s+8|0,d=s,_=is(e)|0,e=t[_+4>>2]|0,t[d>>2]=t[_>>2],t[d+4>>2]=e,t[l>>2]=t[d>>2],t[l+4>>2]=t[d+4>>2],o=+jn(n,l,r),h=s,+o}function is(e){return e=e|0,(t[(O1()|0)+24>>2]|0)+(e*12|0)|0}function jn(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return l=h,h=h+16|0,s=l,o=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(o=t[(t[e>>2]|0)+o>>2]|0),ts(s,r),s=ns(s,r)|0,d=+Ol(+uD[o&7](e,s)),h=l,+d}function Ip(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Fo(e,r,s,1),h=o}function Fo(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=oa()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=Hg(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,yr(l,o)|0,o),h=s}function oa(){var e=0,n=0;if(c[7712]|0||(Fp(9556),Bt(35,9556,Q|0)|0,n=7712,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9556)|0)){e=9556,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));Fp(9556)}return 9556}function Hg(e){return e=e|0,0}function yr(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=oa()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],Pp(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(Mp(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function Pp(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function Mp(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=ua(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,bg(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],Pp(l,o,r),t[y>>2]=(t[y>>2]|0)+12,Gg(e,_),Vg(_),h=k;return}}function ua(e){return e=e|0,357913941}function bg(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function Gg(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function Vg(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function Fp(e){e=e|0,Kg(e)}function Yg(e){e=e|0,$g(e+24|0)}function $g(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function Kg(e){e=e|0;var n=0;n=An()|0,Nn(e,2,5,n,Xg()|0,0),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function Xg(){return 1232}function Jg(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=Qg(e)|0,e=t[d+4>>2]|0,t[l>>2]=t[d>>2],t[l+4>>2]=e,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],r=+Zg(n,s),h=o,+r}function Qg(e){return e=e|0,(t[(oa()|0)+24>>2]|0)+(e*12|0)|0}function Zg(e,n){e=e|0,n=n|0;var r=0;return r=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(r=t[(t[e>>2]|0)+r>>2]|0),+ +Ol(+oD[r&15](e))}function e_(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],t_(e,r,s,1),h=o}function t_(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=oc()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=n_(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,I1(l,o)|0,o),h=s}function oc(){var e=0,n=0;if(c[7720]|0||(Rp(9592),Bt(36,9592,Q|0)|0,n=7720,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9592)|0)){e=9592,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));Rp(9592)}return 9592}function n_(e){return e=e|0,0}function I1(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=oc()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],Lp(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(r_(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function Lp(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function r_(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=i_(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,q0(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],Lp(l,o,r),t[y>>2]=(t[y>>2]|0)+12,Yi(e,_),o_(_),h=k;return}}function i_(e){return e=e|0,357913941}function q0(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function Yi(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function o_(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function Rp(e){e=e|0,s_(e)}function u_(e){e=e|0,Np(e+24|0)}function Np(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function s_(e){e=e|0;var n=0;n=An()|0,Nn(e,2,7,n,l_()|0,0),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function l_(){return 1276}function f_(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0;return r=h,h=h+16|0,o=r+8|0,s=r,l=Bp(e)|0,e=t[l+4>>2]|0,t[s>>2]=t[l>>2],t[s+4>>2]=e,t[o>>2]=t[s>>2],t[o+4>>2]=t[s+4>>2],n=c_(n,o)|0,h=r,n|0}function Bp(e){return e=e|0,(t[(oc()|0)+24>>2]|0)+(e*12|0)|0}function c_(e,n){e=e|0,n=n|0;var r=0,o=0,s=0;return s=h,h=h+16|0,o=s,r=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(r=t[(t[e>>2]|0)+r>>2]|0),Bl[r&31](o,e),o=jp(o)|0,h=s,o|0}function jp(e){e=e|0;var n=0,r=0,o=0,s=0;return s=h,h=h+32|0,n=s+12|0,r=s,o=U0(Up()|0)|0,o?(s1(n,o),l1(r,n),qp(e,r),e=f1(n)|0):e=zp(e)|0,h=s,e|0}function Up(){var e=0;return c[7736]|0||(Wp(9640),Bt(25,9640,Q|0)|0,e=7736,t[e>>2]=1,t[e+4>>2]=0),9640}function qp(e,n){e=e|0,n=n|0,Ef(n,e,e+8|0)|0}function zp(e){e=e|0;var n=0,r=0,o=0,s=0,l=0,d=0,_=0;return r=h,h=h+16|0,s=r+4|0,d=r,o=Qo(8)|0,n=o,_=Tt(16)|0,t[_>>2]=t[e>>2],t[_+4>>2]=t[e+4>>2],t[_+8>>2]=t[e+8>>2],t[_+12>>2]=t[e+12>>2],l=n+4|0,t[l>>2]=_,e=Tt(8)|0,l=t[l>>2]|0,t[d>>2]=0,t[s>>2]=t[d>>2],P1(e,l,s),t[o>>2]=e,h=r,n|0}function P1(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,r=Tt(16)|0,t[r+4>>2]=0,t[r+8>>2]=0,t[r>>2]=1244,t[r+12>>2]=n,t[e+4>>2]=r}function a_(e){e=e|0,da(e),Ve(e)}function d_(e){e=e|0,e=t[e+12>>2]|0,e|0&&Ve(e)}function p_(e){e=e|0,Ve(e)}function Ef(e,n,r){return e=e|0,n=n|0,r=r|0,n=h_(t[e>>2]|0,n,r)|0,r=e+4|0,t[(t[r>>2]|0)+8>>2]=n,t[(t[r>>2]|0)+8>>2]|0}function h_(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0;return o=h,h=h+16|0,s=o,Zo(s),e=Oi(e)|0,r=m_(e,t[n>>2]|0,+L[r>>3])|0,eu(s),h=o,r|0}function m_(e,n,r){e=e|0,n=n|0,r=+r;var o=0;return o=ko(v_()|0)|0,n=jc(n)|0,dl(0,o|0,e|0,n|0,+ +Ko(r))|0}function v_(){var e=0;return c[7728]|0||(g_(9628),e=7728,t[e>>2]=1,t[e+4>>2]=0),9628}function g_(e){e=e|0,Ao(e,__()|0,2)}function __(){return 1264}function Wp(e){e=e|0,Ys(e)}function Hp(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],y_(e,r,s,1),h=o}function y_(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=M1()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=w_(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,D_(l,o)|0,o),h=s}function M1(){var e=0,n=0;if(c[7744]|0||(Gp(9684),Bt(37,9684,Q|0)|0,n=7744,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9684)|0)){e=9684,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));Gp(9684)}return 9684}function w_(e){return e=e|0,0}function D_(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=M1()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],bp(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(E_(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function bp(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function E_(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=S_(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,C_(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],bp(l,o,r),t[y>>2]=(t[y>>2]|0)+12,T_(e,_),x_(_),h=k;return}}function S_(e){return e=e|0,357913941}function C_(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function T_(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function x_(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function Gp(e){e=e|0,O_(e)}function k_(e){e=e|0,A_(e+24|0)}function A_(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function O_(e){e=e|0;var n=0;n=An()|0,Nn(e,2,5,n,I_()|0,1),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function I_(){return 1280}function P_(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=M_(e)|0,e=t[d+4>>2]|0,t[l>>2]=t[d>>2],t[l+4>>2]=e,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],r=F_(n,s,r)|0,h=o,r|0}function M_(e){return e=e|0,(t[(M1()|0)+24>>2]|0)+(e*12|0)|0}function F_(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return d=h,h=h+32|0,s=d,l=d+16|0,o=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(o=t[(t[e>>2]|0)+o>>2]|0),ts(l,r),l=ns(l,r)|0,X1[o&15](s,e,l),l=jp(s)|0,h=d,l|0}function L_(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],R_(e,r,s,1),h=o}function R_(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=F1()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=N_(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,B_(l,o)|0,o),h=s}function F1(){var e=0,n=0;if(c[7752]|0||(Kp(9720),Bt(38,9720,Q|0)|0,n=7752,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9720)|0)){e=9720,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));Kp(9720)}return 9720}function N_(e){return e=e|0,0}function B_(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=F1()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],Vp(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(j_(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function Vp(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function j_(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=L1(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,Yp(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],Vp(l,o,r),t[y>>2]=(t[y>>2]|0)+12,$p(e,_),U_(_),h=k;return}}function L1(e){return e=e|0,357913941}function Yp(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function $p(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function U_(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function Kp(e){e=e|0,z_(e)}function q_(e){e=e|0,R1(e+24|0)}function R1(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function z_(e){e=e|0;var n=0;n=An()|0,Nn(e,2,8,n,W_()|0,0),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function W_(){return 1288}function H_(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0;return r=h,h=h+16|0,o=r+8|0,s=r,l=$i(e)|0,e=t[l+4>>2]|0,t[s>>2]=t[l>>2],t[s+4>>2]=e,t[o>>2]=t[s>>2],t[o+4>>2]=t[s+4>>2],n=N1(n,o)|0,h=r,n|0}function $i(e){return e=e|0,(t[(F1()|0)+24>>2]|0)+(e*12|0)|0}function N1(e,n){e=e|0,n=n|0;var r=0;return r=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(r=t[(t[e>>2]|0)+r>>2]|0),Dd(dc[r&31](e)|0)|0}function b_(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],G_(e,r,s,0),h=o}function G_(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=B1()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=V_(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,j1(l,o)|0,o),h=s}function B1(){var e=0,n=0;if(c[7760]|0||(q1(9756),Bt(39,9756,Q|0)|0,n=7760,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9756)|0)){e=9756,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));q1(9756)}return 9756}function V_(e){return e=e|0,0}function j1(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=B1()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],Xp(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(U1(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function Xp(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function U1(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=Y_(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,$_(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],Xp(l,o,r),t[y>>2]=(t[y>>2]|0)+12,K_(e,_),X_(_),h=k;return}}function Y_(e){return e=e|0,357913941}function $_(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function K_(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function X_(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function q1(e){e=e|0,Z_(e)}function J_(e){e=e|0,Q_(e+24|0)}function Q_(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function Z_(e){e=e|0;var n=0;n=An()|0,Nn(e,2,8,n,z1()|0,1),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function z1(){return 1292}function W1(e,n,r){e=e|0,n=n|0,r=+r;var o=0,s=0,l=0,d=0;o=h,h=h+16|0,s=o+8|0,l=o,d=e4(e)|0,e=t[d+4>>2]|0,t[l>>2]=t[d>>2],t[l+4>>2]=e,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],t4(n,s,r),h=o}function e4(e){return e=e|0,(t[(B1()|0)+24>>2]|0)+(e*12|0)|0}function t4(e,n,r){e=e|0,n=n|0,r=+r;var o=0,s=0,l=0;l=h,h=h+16|0,s=l,o=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(o=t[(t[e>>2]|0)+o>>2]|0),wu(s,r),r=+Du(s,r),nD[o&31](e,r),h=l}function n4(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],r4(e,r,s,0),h=o}function r4(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=H1()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=i4(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,o4(l,o)|0,o),h=s}function H1(){var e=0,n=0;if(c[7768]|0||(Qp(9792),Bt(40,9792,Q|0)|0,n=7768,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9792)|0)){e=9792,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));Qp(9792)}return 9792}function i4(e){return e=e|0,0}function o4(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=H1()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],Jp(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(u4(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function Jp(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function u4(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=s4(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,l4(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],Jp(l,o,r),t[y>>2]=(t[y>>2]|0)+12,f4(e,_),c4(_),h=k;return}}function s4(e){return e=e|0,357913941}function l4(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function f4(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function c4(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function Qp(e){e=e|0,p4(e)}function a4(e){e=e|0,d4(e+24|0)}function d4(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function p4(e){e=e|0;var n=0;n=An()|0,Nn(e,2,1,n,h4()|0,2),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function h4(){return 1300}function m4(e,n,r,o){e=e|0,n=n|0,r=r|0,o=+o;var s=0,l=0,d=0,_=0;s=h,h=h+16|0,l=s+8|0,d=s,_=v4(e)|0,e=t[_+4>>2]|0,t[d>>2]=t[_>>2],t[d+4>>2]=e,t[l>>2]=t[d>>2],t[l+4>>2]=t[d+4>>2],g4(n,l,r,o),h=s}function v4(e){return e=e|0,(t[(H1()|0)+24>>2]|0)+(e*12|0)|0}function g4(e,n,r,o){e=e|0,n=n|0,r=r|0,o=+o;var s=0,l=0,d=0,_=0;_=h,h=h+16|0,l=_+1|0,d=_,s=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(s=t[(t[e>>2]|0)+s>>2]|0),ts(l,r),l=ns(l,r)|0,wu(d,o),o=+Du(d,o),cD[s&15](e,l,o),h=_}function a(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],p(e,r,s,0),h=o}function p(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=E()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=I(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,B(l,o)|0,o),h=s}function E(){var e=0,n=0;if(c[7776]|0||(nt(9828),Bt(41,9828,Q|0)|0,n=7776,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9828)|0)){e=9828,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));nt(9828)}return 9828}function I(e){return e=e|0,0}function B(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=E()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],G(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(te(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function G(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function te(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=se(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,Ee(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],G(l,o,r),t[y>>2]=(t[y>>2]|0)+12,$e(e,_),Ke(_),h=k;return}}function se(e){return e=e|0,357913941}function Ee(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function $e(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function Ke(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function nt(e){e=e|0,an(e)}function Ct(e){e=e|0,Gt(e+24|0)}function Gt(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function an(e){e=e|0;var n=0;n=An()|0,Nn(e,2,7,n,qn()|0,1),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function qn(){return 1312}function dn(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;o=h,h=h+16|0,s=o+8|0,l=o,d=Yn(e)|0,e=t[d+4>>2]|0,t[l>>2]=t[d>>2],t[l+4>>2]=e,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],er(n,s,r),h=o}function Yn(e){return e=e|0,(t[(E()|0)+24>>2]|0)+(e*12|0)|0}function er(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0;l=h,h=h+16|0,s=l,o=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(o=t[(t[e>>2]|0)+o>>2]|0),ts(s,r),s=ns(s,r)|0,Bl[o&31](e,s),h=l}function vo(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Pi(e,r,s,0),h=o}function Pi(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=Mi()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=f0(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,Jo(l,o)|0,o),h=s}function Mi(){var e=0,n=0;if(c[7784]|0||(kw(9864),Bt(42,9864,Q|0)|0,n=7784,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9864)|0)){e=9864,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));kw(9864)}return 9864}function f0(e){return e=e|0,0}function Jo(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=Mi()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],Su(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(Zp(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function Su(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function Zp(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=v9(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,g9(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],Su(l,o,r),t[y>>2]=(t[y>>2]|0)+12,_9(e,_),y9(_),h=k;return}}function v9(e){return e=e|0,357913941}function g9(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function _9(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function y9(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function kw(e){e=e|0,E9(e)}function w9(e){e=e|0,D9(e+24|0)}function D9(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function E9(e){e=e|0;var n=0;n=An()|0,Nn(e,2,8,n,S9()|0,1),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function S9(){return 1320}function C9(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;o=h,h=h+16|0,s=o+8|0,l=o,d=T9(e)|0,e=t[d+4>>2]|0,t[l>>2]=t[d>>2],t[l+4>>2]=e,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],x9(n,s,r),h=o}function T9(e){return e=e|0,(t[(Mi()|0)+24>>2]|0)+(e*12|0)|0}function x9(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0;l=h,h=h+16|0,s=l,o=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(o=t[(t[e>>2]|0)+o>>2]|0),k9(s,r),s=A9(s,r)|0,Bl[o&31](e,s),h=l}function k9(e,n){e=e|0,n=n|0}function A9(e,n){return e=e|0,n=n|0,O9(n)|0}function O9(e){return e=e|0,e|0}function I9(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],P9(e,r,s,0),h=o}function P9(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=_4()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=M9(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,F9(l,o)|0,o),h=s}function _4(){var e=0,n=0;if(c[7792]|0||(Ow(9900),Bt(43,9900,Q|0)|0,n=7792,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9900)|0)){e=9900,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));Ow(9900)}return 9900}function M9(e){return e=e|0,0}function F9(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=_4()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],Aw(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(L9(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function Aw(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function L9(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=R9(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,N9(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],Aw(l,o,r),t[y>>2]=(t[y>>2]|0)+12,B9(e,_),j9(_),h=k;return}}function R9(e){return e=e|0,357913941}function N9(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function B9(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function j9(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function Ow(e){e=e|0,z9(e)}function U9(e){e=e|0,q9(e+24|0)}function q9(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function z9(e){e=e|0;var n=0;n=An()|0,Nn(e,2,22,n,W9()|0,0),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function W9(){return 1344}function H9(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0;r=h,h=h+16|0,o=r+8|0,s=r,l=b9(e)|0,e=t[l+4>>2]|0,t[s>>2]=t[l>>2],t[s+4>>2]=e,t[o>>2]=t[s>>2],t[o+4>>2]=t[s+4>>2],G9(n,o),h=r}function b9(e){return e=e|0,(t[(_4()|0)+24>>2]|0)+(e*12|0)|0}function G9(e,n){e=e|0,n=n|0;var r=0;r=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(r=t[(t[e>>2]|0)+r>>2]|0),Nl[r&127](e)}function V9(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0;l=t[e>>2]|0,s=y4()|0,e=Y9(r)|0,ur(l,n,s,e,$9(r,o)|0,o)}function y4(){var e=0,n=0;if(c[7800]|0||(Pw(9936),Bt(44,9936,Q|0)|0,n=7800,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9936)|0)){e=9936,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));Pw(9936)}return 9936}function Y9(e){return e=e|0,e|0}function $9(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0;return _=h,h=h+16|0,s=_,l=_+4|0,t[s>>2]=e,y=y4()|0,d=y+24|0,n=Lt(n,4)|0,t[l>>2]=n,r=y+28|0,o=t[r>>2]|0,o>>>0<(t[y+32>>2]|0)>>>0?(Iw(o,e,n),n=(t[r>>2]|0)+8|0,t[r>>2]=n):(K9(d,s,l),n=t[r>>2]|0),h=_,(n-(t[d>>2]|0)>>3)+-1|0}function Iw(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,t[e+4>>2]=r}function K9(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0;if(_=h,h=h+32|0,s=_,l=e+4|0,d=((t[l>>2]|0)-(t[e>>2]|0)>>3)+1|0,o=X9(e)|0,o>>>0<d>>>0)$n(e);else{y=t[e>>2]|0,T=(t[e+8>>2]|0)-y|0,k=T>>2,J9(s,T>>3>>>0<o>>>1>>>0?k>>>0<d>>>0?d:k:o,(t[l>>2]|0)-y>>3,e+8|0),d=s+8|0,Iw(t[d>>2]|0,t[n>>2]|0,t[r>>2]|0),t[d>>2]=(t[d>>2]|0)+8,Q9(e,s),Z9(s),h=_;return}}function X9(e){return e=e|0,536870911}function J9(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>536870911)_n();else{s=Tt(n<<3)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r<<3)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n<<3)}function Q9(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(0-(s>>3)<<3)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function Z9(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~((o+-8-n|0)>>>3)<<3)),e=t[e>>2]|0,e|0&&Ve(e)}function Pw(e){e=e|0,nx(e)}function ex(e){e=e|0,tx(e+24|0)}function tx(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function nx(e){e=e|0;var n=0;n=An()|0,Nn(e,1,23,n,Mo()|0,1),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function rx(e,n){e=e|0,n=n|0,ox(t[(ix(e)|0)>>2]|0,n)}function ix(e){return e=e|0,(t[(y4()|0)+24>>2]|0)+(e<<3)|0}function ox(e,n){e=e|0,n=n|0;var r=0,o=0;r=h,h=h+16|0,o=r,On(o,n),n=x1(o,n)|0,Nl[e&127](n),h=r}function ux(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0;l=t[e>>2]|0,s=w4()|0,e=sx(r)|0,ur(l,n,s,e,lx(r,o)|0,o)}function w4(){var e=0,n=0;if(c[7808]|0||(Fw(9972),Bt(45,9972,Q|0)|0,n=7808,t[n>>2]=1,t[n+4>>2]=0),!(Dn(9972)|0)){e=9972,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));Fw(9972)}return 9972}function sx(e){return e=e|0,e|0}function lx(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0;return _=h,h=h+16|0,s=_,l=_+4|0,t[s>>2]=e,y=w4()|0,d=y+24|0,n=Lt(n,4)|0,t[l>>2]=n,r=y+28|0,o=t[r>>2]|0,o>>>0<(t[y+32>>2]|0)>>>0?(Mw(o,e,n),n=(t[r>>2]|0)+8|0,t[r>>2]=n):(fx(d,s,l),n=t[r>>2]|0),h=_,(n-(t[d>>2]|0)>>3)+-1|0}function Mw(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,t[e+4>>2]=r}function fx(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0;if(_=h,h=h+32|0,s=_,l=e+4|0,d=((t[l>>2]|0)-(t[e>>2]|0)>>3)+1|0,o=cx(e)|0,o>>>0<d>>>0)$n(e);else{y=t[e>>2]|0,T=(t[e+8>>2]|0)-y|0,k=T>>2,ax(s,T>>3>>>0<o>>>1>>>0?k>>>0<d>>>0?d:k:o,(t[l>>2]|0)-y>>3,e+8|0),d=s+8|0,Mw(t[d>>2]|0,t[n>>2]|0,t[r>>2]|0),t[d>>2]=(t[d>>2]|0)+8,dx(e,s),px(s),h=_;return}}function cx(e){return e=e|0,536870911}function ax(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>536870911)_n();else{s=Tt(n<<3)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r<<3)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n<<3)}function dx(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(0-(s>>3)<<3)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function px(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~((o+-8-n|0)>>>3)<<3)),e=t[e>>2]|0,e|0&&Ve(e)}function Fw(e){e=e|0,vx(e)}function hx(e){e=e|0,mx(e+24|0)}function mx(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function vx(e){e=e|0;var n=0;n=An()|0,Nn(e,1,9,n,gx()|0,1),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function gx(){return 1348}function _x(e,n){return e=e|0,n=n|0,wx(t[(yx(e)|0)>>2]|0,n)|0}function yx(e){return e=e|0,(t[(w4()|0)+24>>2]|0)+(e<<3)|0}function wx(e,n){e=e|0,n=n|0;var r=0,o=0;return r=h,h=h+16|0,o=r,Lw(o,n),n=Rw(o,n)|0,n=Xc(dc[e&31](n)|0)|0,h=r,n|0}function Lw(e,n){e=e|0,n=n|0}function Rw(e,n){return e=e|0,n=n|0,Dx(n)|0}function Dx(e){return e=e|0,e|0}function Ex(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0;l=t[e>>2]|0,s=D4()|0,e=Sx(r)|0,ur(l,n,s,e,Cx(r,o)|0,o)}function D4(){var e=0,n=0;if(c[7816]|0||(Bw(10008),Bt(46,10008,Q|0)|0,n=7816,t[n>>2]=1,t[n+4>>2]=0),!(Dn(10008)|0)){e=10008,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));Bw(10008)}return 10008}function Sx(e){return e=e|0,e|0}function Cx(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0;return _=h,h=h+16|0,s=_,l=_+4|0,t[s>>2]=e,y=D4()|0,d=y+24|0,n=Lt(n,4)|0,t[l>>2]=n,r=y+28|0,o=t[r>>2]|0,o>>>0<(t[y+32>>2]|0)>>>0?(Nw(o,e,n),n=(t[r>>2]|0)+8|0,t[r>>2]=n):(Tx(d,s,l),n=t[r>>2]|0),h=_,(n-(t[d>>2]|0)>>3)+-1|0}function Nw(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,t[e+4>>2]=r}function Tx(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0;if(_=h,h=h+32|0,s=_,l=e+4|0,d=((t[l>>2]|0)-(t[e>>2]|0)>>3)+1|0,o=xx(e)|0,o>>>0<d>>>0)$n(e);else{y=t[e>>2]|0,T=(t[e+8>>2]|0)-y|0,k=T>>2,kx(s,T>>3>>>0<o>>>1>>>0?k>>>0<d>>>0?d:k:o,(t[l>>2]|0)-y>>3,e+8|0),d=s+8|0,Nw(t[d>>2]|0,t[n>>2]|0,t[r>>2]|0),t[d>>2]=(t[d>>2]|0)+8,Ax(e,s),Ox(s),h=_;return}}function xx(e){return e=e|0,536870911}function kx(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>536870911)_n();else{s=Tt(n<<3)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r<<3)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n<<3)}function Ax(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(0-(s>>3)<<3)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function Ox(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~((o+-8-n|0)>>>3)<<3)),e=t[e>>2]|0,e|0&&Ve(e)}function Bw(e){e=e|0,Mx(e)}function Ix(e){e=e|0,Px(e+24|0)}function Px(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function Mx(e){e=e|0;var n=0;n=An()|0,Nn(e,1,15,n,mp()|0,0),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function Fx(e){return e=e|0,Rx(t[(Lx(e)|0)>>2]|0)|0}function Lx(e){return e=e|0,(t[(D4()|0)+24>>2]|0)+(e<<3)|0}function Rx(e){return e=e|0,Xc(ph[e&7]()|0)|0}function Nx(){var e=0;return c[7832]|0||(bx(10052),Bt(25,10052,Q|0)|0,e=7832,t[e>>2]=1,t[e+4>>2]=0),10052}function Bx(e,n){e=e|0,n=n|0,t[e>>2]=jx()|0,t[e+4>>2]=Ux()|0,t[e+12>>2]=n,t[e+8>>2]=qx()|0,t[e+32>>2]=2}function jx(){return 11709}function Ux(){return 1188}function qx(){return eh()|0}function zx(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0,(Sf(o,896)|0)==512?r|0&&(Wx(r),Ve(r)):n|0&&(mu(n),Ve(n))}function Sf(e,n){return e=e|0,n=n|0,n&e|0}function Wx(e){e=e|0,e=t[e+4>>2]|0,e|0&&Tf(e)}function eh(){var e=0;return c[7824]|0||(t[2511]=Hx()|0,t[2512]=0,e=7824,t[e>>2]=1,t[e+4>>2]=0),10044}function Hx(){return 0}function bx(e){e=e|0,Ys(e)}function Gx(e){e=e|0;var n=0,r=0,o=0,s=0,l=0;n=h,h=h+32|0,r=n+24|0,l=n+16|0,s=n+8|0,o=n,Vx(e,4827),Yx(e,4834,3)|0,$x(e,3682,47)|0,t[l>>2]=9,t[l+4>>2]=0,t[r>>2]=t[l>>2],t[r+4>>2]=t[l+4>>2],Kx(e,4841,r)|0,t[s>>2]=1,t[s+4>>2]=0,t[r>>2]=t[s>>2],t[r+4>>2]=t[s+4>>2],Xx(e,4871,r)|0,t[o>>2]=10,t[o+4>>2]=0,t[r>>2]=t[o>>2],t[r+4>>2]=t[o+4>>2],Jx(e,4891,r)|0,h=n}function Vx(e,n){e=e|0,n=n|0;var r=0;r=Ok()|0,t[e>>2]=r,Ik(r,n),Cf(t[e>>2]|0)}function Yx(e,n,r){return e=e|0,n=n|0,r=r|0,pk(e,Zn(n)|0,r,0),e|0}function $x(e,n,r){return e=e|0,n=n|0,r=r|0,Q7(e,Zn(n)|0,r,0),e|0}function Kx(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],F7(e,n,s),h=o,e|0}function Xx(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],h7(e,n,s),h=o,e|0}function Jx(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=t[r+4>>2]|0,t[l>>2]=t[r>>2],t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Qx(e,n,s),h=o,e|0}function Qx(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],Zx(e,r,s,1),h=o}function Zx(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=E4()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=e7(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,t7(l,o)|0,o),h=s}function E4(){var e=0,n=0;if(c[7840]|0||(Uw(10100),Bt(48,10100,Q|0)|0,n=7840,t[n>>2]=1,t[n+4>>2]=0),!(Dn(10100)|0)){e=10100,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));Uw(10100)}return 10100}function e7(e){return e=e|0,0}function t7(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=E4()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],jw(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(n7(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function jw(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function n7(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=r7(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,i7(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],jw(l,o,r),t[y>>2]=(t[y>>2]|0)+12,o7(e,_),u7(_),h=k;return}}function r7(e){return e=e|0,357913941}function i7(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function o7(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function u7(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function Uw(e){e=e|0,f7(e)}function s7(e){e=e|0,l7(e+24|0)}function l7(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function f7(e){e=e|0;var n=0;n=An()|0,Nn(e,2,6,n,c7()|0,1),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function c7(){return 1364}function a7(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;return o=h,h=h+16|0,s=o+8|0,l=o,d=d7(e)|0,e=t[d+4>>2]|0,t[l>>2]=t[d>>2],t[l+4>>2]=e,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],r=p7(n,s,r)|0,h=o,r|0}function d7(e){return e=e|0,(t[(E4()|0)+24>>2]|0)+(e*12|0)|0}function p7(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0;return l=h,h=h+16|0,s=l,o=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(o=t[(t[e>>2]|0)+o>>2]|0),ts(s,r),s=ns(s,r)|0,s=ip(J4[o&15](e,s)|0)|0,h=l,s|0}function h7(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],m7(e,r,s,0),h=o}function m7(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=S4()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=v7(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,g7(l,o)|0,o),h=s}function S4(){var e=0,n=0;if(c[7848]|0||(zw(10136),Bt(49,10136,Q|0)|0,n=7848,t[n>>2]=1,t[n+4>>2]=0),!(Dn(10136)|0)){e=10136,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));zw(10136)}return 10136}function v7(e){return e=e|0,0}function g7(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=S4()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],qw(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(_7(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function qw(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function _7(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=y7(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,w7(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],qw(l,o,r),t[y>>2]=(t[y>>2]|0)+12,D7(e,_),E7(_),h=k;return}}function y7(e){return e=e|0,357913941}function w7(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function D7(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function E7(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function zw(e){e=e|0,T7(e)}function S7(e){e=e|0,C7(e+24|0)}function C7(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function T7(e){e=e|0;var n=0;n=An()|0,Nn(e,2,9,n,x7()|0,1),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function x7(){return 1372}function k7(e,n,r){e=e|0,n=n|0,r=+r;var o=0,s=0,l=0,d=0;o=h,h=h+16|0,s=o+8|0,l=o,d=A7(e)|0,e=t[d+4>>2]|0,t[l>>2]=t[d>>2],t[l+4>>2]=e,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],O7(n,s,r),h=o}function A7(e){return e=e|0,(t[(S4()|0)+24>>2]|0)+(e*12|0)|0}function O7(e,n,r){e=e|0,n=n|0,r=+r;var o=0,s=0,l=0,d=tt;l=h,h=h+16|0,s=l,o=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(o=t[(t[e>>2]|0)+o>>2]|0),I7(s,r),d=w(P7(s,r)),tD[o&1](e,d),h=l}function I7(e,n){e=e|0,n=+n}function P7(e,n){return e=e|0,n=+n,w(M7(n))}function M7(e){return e=+e,w(e)}function F7(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,s=o+8|0,l=o,_=t[r>>2]|0,d=t[r+4>>2]|0,r=Zn(n)|0,t[l>>2]=_,t[l+4>>2]=d,t[s>>2]=t[l>>2],t[s+4>>2]=t[l+4>>2],L7(e,r,s,0),h=o}function L7(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0,y=0,k=0,T=0;s=h,h=h+32|0,l=s+16|0,T=s+8|0,_=s,k=t[r>>2]|0,y=t[r+4>>2]|0,d=t[e>>2]|0,e=C4()|0,t[T>>2]=k,t[T+4>>2]=y,t[l>>2]=t[T>>2],t[l+4>>2]=t[T+4>>2],r=R7(l)|0,t[_>>2]=k,t[_+4>>2]=y,t[l>>2]=t[_>>2],t[l+4>>2]=t[_+4>>2],ur(d,n,e,r,N7(l,o)|0,o),h=s}function C4(){var e=0,n=0;if(c[7856]|0||(Hw(10172),Bt(50,10172,Q|0)|0,n=7856,t[n>>2]=1,t[n+4>>2]=0),!(Dn(10172)|0)){e=10172,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));Hw(10172)}return 10172}function R7(e){return e=e|0,0}function N7(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0;return T=h,h=h+32|0,s=T+24|0,d=T+16|0,_=T,y=T+8|0,l=t[e>>2]|0,o=t[e+4>>2]|0,t[_>>2]=l,t[_+4>>2]=o,P=C4()|0,k=P+24|0,e=Lt(n,4)|0,t[y>>2]=e,n=P+28|0,r=t[n>>2]|0,r>>>0<(t[P+32>>2]|0)>>>0?(t[d>>2]=l,t[d+4>>2]=o,t[s>>2]=t[d>>2],t[s+4>>2]=t[d+4>>2],Ww(r,s,e),e=(t[n>>2]|0)+12|0,t[n>>2]=e):(B7(k,_,y),e=t[n>>2]|0),h=T,((e-(t[k>>2]|0)|0)/12|0)+-1|0}function Ww(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=t[n+4>>2]|0,t[e>>2]=t[n>>2],t[e+4>>2]=o,t[e+8>>2]=r}function B7(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;if(k=h,h=h+48|0,o=k+32|0,d=k+24|0,_=k,y=e+4|0,s=(((t[y>>2]|0)-(t[e>>2]|0)|0)/12|0)+1|0,l=j7(e)|0,l>>>0<s>>>0)$n(e);else{T=t[e>>2]|0,q=((t[e+8>>2]|0)-T|0)/12|0,P=q<<1,U7(_,q>>>0<l>>>1>>>0?P>>>0<s>>>0?s:P:l,((t[y>>2]|0)-T|0)/12|0,e+8|0),y=_+8|0,l=t[y>>2]|0,s=t[n+4>>2]|0,r=t[r>>2]|0,t[d>>2]=t[n>>2],t[d+4>>2]=s,t[o>>2]=t[d>>2],t[o+4>>2]=t[d+4>>2],Ww(l,o,r),t[y>>2]=(t[y>>2]|0)+12,q7(e,_),z7(_),h=k;return}}function j7(e){return e=e|0,357913941}function U7(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>357913941)_n();else{s=Tt(n*12|0)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r*12|0)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n*12|0)}function q7(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(((s|0)/-12|0)*12|0)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function z7(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~(((o+-12-n|0)>>>0)/12|0)*12|0)),e=t[e>>2]|0,e|0&&Ve(e)}function Hw(e){e=e|0,b7(e)}function W7(e){e=e|0,H7(e+24|0)}function H7(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~(((n+-12-o|0)>>>0)/12|0)*12|0)),Ve(r))}function b7(e){e=e|0;var n=0;n=An()|0,Nn(e,2,3,n,G7()|0,2),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function G7(){return 1380}function V7(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0;s=h,h=h+16|0,l=s+8|0,d=s,_=Y7(e)|0,e=t[_+4>>2]|0,t[d>>2]=t[_>>2],t[d+4>>2]=e,t[l>>2]=t[d>>2],t[l+4>>2]=t[d+4>>2],$7(n,l,r,o),h=s}function Y7(e){return e=e|0,(t[(C4()|0)+24>>2]|0)+(e*12|0)|0}function $7(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0;_=h,h=h+16|0,l=_+1|0,d=_,s=t[n>>2]|0,n=t[n+4>>2]|0,e=e+(n>>1)|0,n&1&&(s=t[(t[e>>2]|0)+s>>2]|0),ts(l,r),l=ns(l,r)|0,K7(d,o),d=X7(d,o)|0,X1[s&15](e,l,d),h=_}function K7(e,n){e=e|0,n=n|0}function X7(e,n){return e=e|0,n=n|0,J7(n)|0}function J7(e){return e=e|0,(e|0)!=0|0}function Q7(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0;l=t[e>>2]|0,s=T4()|0,e=Z7(r)|0,ur(l,n,s,e,ek(r,o)|0,o)}function T4(){var e=0,n=0;if(c[7864]|0||(Gw(10208),Bt(51,10208,Q|0)|0,n=7864,t[n>>2]=1,t[n+4>>2]=0),!(Dn(10208)|0)){e=10208,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));Gw(10208)}return 10208}function Z7(e){return e=e|0,e|0}function ek(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0;return _=h,h=h+16|0,s=_,l=_+4|0,t[s>>2]=e,y=T4()|0,d=y+24|0,n=Lt(n,4)|0,t[l>>2]=n,r=y+28|0,o=t[r>>2]|0,o>>>0<(t[y+32>>2]|0)>>>0?(bw(o,e,n),n=(t[r>>2]|0)+8|0,t[r>>2]=n):(tk(d,s,l),n=t[r>>2]|0),h=_,(n-(t[d>>2]|0)>>3)+-1|0}function bw(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,t[e+4>>2]=r}function tk(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0;if(_=h,h=h+32|0,s=_,l=e+4|0,d=((t[l>>2]|0)-(t[e>>2]|0)>>3)+1|0,o=nk(e)|0,o>>>0<d>>>0)$n(e);else{y=t[e>>2]|0,T=(t[e+8>>2]|0)-y|0,k=T>>2,rk(s,T>>3>>>0<o>>>1>>>0?k>>>0<d>>>0?d:k:o,(t[l>>2]|0)-y>>3,e+8|0),d=s+8|0,bw(t[d>>2]|0,t[n>>2]|0,t[r>>2]|0),t[d>>2]=(t[d>>2]|0)+8,ik(e,s),ok(s),h=_;return}}function nk(e){return e=e|0,536870911}function rk(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>536870911)_n();else{s=Tt(n<<3)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r<<3)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n<<3)}function ik(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(0-(s>>3)<<3)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function ok(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~((o+-8-n|0)>>>3)<<3)),e=t[e>>2]|0,e|0&&Ve(e)}function Gw(e){e=e|0,lk(e)}function uk(e){e=e|0,sk(e+24|0)}function sk(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function lk(e){e=e|0;var n=0;n=An()|0,Nn(e,1,24,n,fk()|0,1),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function fk(){return 1392}function ck(e,n){e=e|0,n=n|0,dk(t[(ak(e)|0)>>2]|0,n)}function ak(e){return e=e|0,(t[(T4()|0)+24>>2]|0)+(e<<3)|0}function dk(e,n){e=e|0,n=n|0;var r=0,o=0;r=h,h=h+16|0,o=r,Lw(o,n),n=Rw(o,n)|0,Nl[e&127](n),h=r}function pk(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0;l=t[e>>2]|0,s=x4()|0,e=hk(r)|0,ur(l,n,s,e,mk(r,o)|0,o)}function x4(){var e=0,n=0;if(c[7872]|0||(Yw(10244),Bt(52,10244,Q|0)|0,n=7872,t[n>>2]=1,t[n+4>>2]=0),!(Dn(10244)|0)){e=10244,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));Yw(10244)}return 10244}function hk(e){return e=e|0,e|0}function mk(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0;return _=h,h=h+16|0,s=_,l=_+4|0,t[s>>2]=e,y=x4()|0,d=y+24|0,n=Lt(n,4)|0,t[l>>2]=n,r=y+28|0,o=t[r>>2]|0,o>>>0<(t[y+32>>2]|0)>>>0?(Vw(o,e,n),n=(t[r>>2]|0)+8|0,t[r>>2]=n):(vk(d,s,l),n=t[r>>2]|0),h=_,(n-(t[d>>2]|0)>>3)+-1|0}function Vw(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,t[e+4>>2]=r}function vk(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0;if(_=h,h=h+32|0,s=_,l=e+4|0,d=((t[l>>2]|0)-(t[e>>2]|0)>>3)+1|0,o=gk(e)|0,o>>>0<d>>>0)$n(e);else{y=t[e>>2]|0,T=(t[e+8>>2]|0)-y|0,k=T>>2,_k(s,T>>3>>>0<o>>>1>>>0?k>>>0<d>>>0?d:k:o,(t[l>>2]|0)-y>>3,e+8|0),d=s+8|0,Vw(t[d>>2]|0,t[n>>2]|0,t[r>>2]|0),t[d>>2]=(t[d>>2]|0)+8,yk(e,s),wk(s),h=_;return}}function gk(e){return e=e|0,536870911}function _k(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>536870911)_n();else{s=Tt(n<<3)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r<<3)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n<<3)}function yk(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(0-(s>>3)<<3)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function wk(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~((o+-8-n|0)>>>3)<<3)),e=t[e>>2]|0,e|0&&Ve(e)}function Yw(e){e=e|0,Sk(e)}function Dk(e){e=e|0,Ek(e+24|0)}function Ek(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function Sk(e){e=e|0;var n=0;n=An()|0,Nn(e,1,16,n,Ck()|0,0),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function Ck(){return 1400}function Tk(e){return e=e|0,kk(t[(xk(e)|0)>>2]|0)|0}function xk(e){return e=e|0,(t[(x4()|0)+24>>2]|0)+(e<<3)|0}function kk(e){return e=e|0,Ak(ph[e&7]()|0)|0}function Ak(e){return e=e|0,e|0}function Ok(){var e=0;return c[7880]|0||(Nk(10280),Bt(25,10280,Q|0)|0,e=7880,t[e>>2]=1,t[e+4>>2]=0),10280}function Ik(e,n){e=e|0,n=n|0,t[e>>2]=Pk()|0,t[e+4>>2]=Mk()|0,t[e+12>>2]=n,t[e+8>>2]=Fk()|0,t[e+32>>2]=4}function Pk(){return 11711}function Mk(){return 1356}function Fk(){return eh()|0}function Lk(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0,(Sf(o,896)|0)==512?r|0&&(Rk(r),Ve(r)):n|0&&(Gi(n),Ve(n))}function Rk(e){e=e|0,e=t[e+4>>2]|0,e|0&&Tf(e)}function Nk(e){e=e|0,Ys(e)}function Bk(e){e=e|0,jk(e,4920),Uk(e)|0,qk(e)|0}function jk(e,n){e=e|0,n=n|0;var r=0;r=Up()|0,t[e>>2]=r,sA(r,n),Cf(t[e>>2]|0)}function Uk(e){e=e|0;var n=0;return n=t[e>>2]|0,uc(n,Jk()|0),e|0}function qk(e){e=e|0;var n=0;return n=t[e>>2]|0,uc(n,zk()|0),e|0}function zk(){var e=0;return c[7888]|0||($w(10328),Bt(53,10328,Q|0)|0,e=7888,t[e>>2]=1,t[e+4>>2]=0),Dn(10328)|0||$w(10328),10328}function uc(e,n){e=e|0,n=n|0,ur(e,0,n,0,0,0)}function $w(e){e=e|0,bk(e),sc(e,10)}function Wk(e){e=e|0,Hk(e+24|0)}function Hk(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function bk(e){e=e|0;var n=0;n=An()|0,Nn(e,5,1,n,$k()|0,2),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function Gk(e,n,r){e=e|0,n=n|0,r=+r,Vk(e,n,r)}function sc(e,n){e=e|0,n=n|0,t[e+20>>2]=n}function Vk(e,n,r){e=e|0,n=n|0,r=+r;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+16|0,l=o+8|0,_=o+13|0,s=o,d=o+12|0,ts(_,n),t[l>>2]=ns(_,n)|0,wu(d,r),L[s>>3]=+Du(d,r),Yk(e,l,s),h=o}function Yk(e,n,r){e=e|0,n=n|0,r=r|0,M(e+8|0,t[n>>2]|0,+L[r>>3]),c[e+24>>0]=1}function $k(){return 1404}function Kk(e,n){return e=e|0,n=+n,Xk(e,n)|0}function Xk(e,n){e=e|0,n=+n;var r=0,o=0,s=0,l=0,d=0,_=0,y=0;return o=h,h=h+16|0,l=o+4|0,d=o+8|0,_=o,s=Qo(8)|0,r=s,y=Tt(16)|0,ts(l,e),e=ns(l,e)|0,wu(d,n),M(y,e,+Du(d,n)),d=r+4|0,t[d>>2]=y,e=Tt(8)|0,d=t[d>>2]|0,t[_>>2]=0,t[l>>2]=t[_>>2],P1(e,d,l),t[s>>2]=e,h=o,r|0}function Jk(){var e=0;return c[7896]|0||(Kw(10364),Bt(54,10364,Q|0)|0,e=7896,t[e>>2]=1,t[e+4>>2]=0),Dn(10364)|0||Kw(10364),10364}function Kw(e){e=e|0,eA(e),sc(e,55)}function Qk(e){e=e|0,Zk(e+24|0)}function Zk(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function eA(e){e=e|0;var n=0;n=An()|0,Nn(e,5,4,n,iA()|0,0),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function tA(e){e=e|0,nA(e)}function nA(e){e=e|0,rA(e)}function rA(e){e=e|0,Xw(e+8|0),c[e+24>>0]=1}function Xw(e){e=e|0,t[e>>2]=0,L[e+8>>3]=0}function iA(){return 1424}function oA(){return uA()|0}function uA(){var e=0,n=0,r=0,o=0,s=0,l=0,d=0;return n=h,h=h+16|0,s=n+4|0,d=n,r=Qo(8)|0,e=r,o=Tt(16)|0,Xw(o),l=e+4|0,t[l>>2]=o,o=Tt(8)|0,l=t[l>>2]|0,t[d>>2]=0,t[s>>2]=t[d>>2],P1(o,l,s),t[r>>2]=o,h=n,e|0}function sA(e,n){e=e|0,n=n|0,t[e>>2]=lA()|0,t[e+4>>2]=fA()|0,t[e+12>>2]=n,t[e+8>>2]=cA()|0,t[e+32>>2]=5}function lA(){return 11710}function fA(){return 1416}function cA(){return th()|0}function aA(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0,(Sf(o,896)|0)==512?r|0&&(dA(r),Ve(r)):n|0&&Ve(n)}function dA(e){e=e|0,e=t[e+4>>2]|0,e|0&&Tf(e)}function th(){var e=0;return c[7904]|0||(t[2600]=pA()|0,t[2601]=0,e=7904,t[e>>2]=1,t[e+4>>2]=0),10400}function pA(){return t[357]|0}function hA(e){e=e|0,mA(e,4926),vA(e)|0}function mA(e,n){e=e|0,n=n|0;var r=0;r=u1()|0,t[e>>2]=r,kA(r,n),Cf(t[e>>2]|0)}function vA(e){e=e|0;var n=0;return n=t[e>>2]|0,uc(n,gA()|0),e|0}function gA(){var e=0;return c[7912]|0||(Jw(10412),Bt(56,10412,Q|0)|0,e=7912,t[e>>2]=1,t[e+4>>2]=0),Dn(10412)|0||Jw(10412),10412}function Jw(e){e=e|0,wA(e),sc(e,57)}function _A(e){e=e|0,yA(e+24|0)}function yA(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function wA(e){e=e|0;var n=0;n=An()|0,Nn(e,5,5,n,CA()|0,0),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function DA(e){e=e|0,EA(e)}function EA(e){e=e|0,SA(e)}function SA(e){e=e|0;var n=0,r=0;n=e+8|0,r=n+48|0;do t[n>>2]=0,n=n+4|0;while((n|0)<(r|0));c[e+56>>0]=1}function CA(){return 1432}function TA(){return xA()|0}function xA(){var e=0,n=0,r=0,o=0,s=0,l=0,d=0,_=0;d=h,h=h+16|0,e=d+4|0,n=d,r=Qo(8)|0,o=r,s=Tt(48)|0,l=s,_=l+48|0;do t[l>>2]=0,l=l+4|0;while((l|0)<(_|0));return l=o+4|0,t[l>>2]=s,_=Tt(8)|0,l=t[l>>2]|0,t[n>>2]=0,t[e>>2]=t[n>>2],Wd(_,l,e),t[r>>2]=_,h=d,o|0}function kA(e,n){e=e|0,n=n|0,t[e>>2]=AA()|0,t[e+4>>2]=OA()|0,t[e+12>>2]=n,t[e+8>>2]=IA()|0,t[e+32>>2]=6}function AA(){return 11704}function OA(){return 1436}function IA(){return th()|0}function PA(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0,(Sf(o,896)|0)==512?r|0&&(MA(r),Ve(r)):n|0&&Ve(n)}function MA(e){e=e|0,e=t[e+4>>2]|0,e|0&&Tf(e)}function FA(e){e=e|0,LA(e,4933),RA(e)|0,NA(e)|0}function LA(e,n){e=e|0,n=n|0;var r=0;r=uO()|0,t[e>>2]=r,sO(r,n),Cf(t[e>>2]|0)}function RA(e){e=e|0;var n=0;return n=t[e>>2]|0,uc(n,XA()|0),e|0}function NA(e){e=e|0;var n=0;return n=t[e>>2]|0,uc(n,BA()|0),e|0}function BA(){var e=0;return c[7920]|0||(Qw(10452),Bt(58,10452,Q|0)|0,e=7920,t[e>>2]=1,t[e+4>>2]=0),Dn(10452)|0||Qw(10452),10452}function Qw(e){e=e|0,qA(e),sc(e,1)}function jA(e){e=e|0,UA(e+24|0)}function UA(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function qA(e){e=e|0;var n=0;n=An()|0,Nn(e,5,1,n,bA()|0,2),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function zA(e,n,r){e=e|0,n=+n,r=+r,WA(e,n,r)}function WA(e,n,r){e=e|0,n=+n,r=+r;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+32|0,l=o+8|0,_=o+17|0,s=o,d=o+16|0,wu(_,n),L[l>>3]=+Du(_,n),wu(d,r),L[s>>3]=+Du(d,r),HA(e,l,s),h=o}function HA(e,n,r){e=e|0,n=n|0,r=r|0,Zw(e+8|0,+L[n>>3],+L[r>>3]),c[e+24>>0]=1}function Zw(e,n,r){e=e|0,n=+n,r=+r,L[e>>3]=n,L[e+8>>3]=r}function bA(){return 1472}function GA(e,n){return e=+e,n=+n,VA(e,n)|0}function VA(e,n){e=+e,n=+n;var r=0,o=0,s=0,l=0,d=0,_=0,y=0;return o=h,h=h+16|0,d=o+4|0,_=o+8|0,y=o,s=Qo(8)|0,r=s,l=Tt(16)|0,wu(d,e),e=+Du(d,e),wu(_,n),Zw(l,e,+Du(_,n)),_=r+4|0,t[_>>2]=l,l=Tt(8)|0,_=t[_>>2]|0,t[y>>2]=0,t[d>>2]=t[y>>2],e8(l,_,d),t[s>>2]=l,h=o,r|0}function e8(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,r=Tt(16)|0,t[r+4>>2]=0,t[r+8>>2]=0,t[r>>2]=1452,t[r+12>>2]=n,t[e+4>>2]=r}function YA(e){e=e|0,da(e),Ve(e)}function $A(e){e=e|0,e=t[e+12>>2]|0,e|0&&Ve(e)}function KA(e){e=e|0,Ve(e)}function XA(){var e=0;return c[7928]|0||(t8(10488),Bt(59,10488,Q|0)|0,e=7928,t[e>>2]=1,t[e+4>>2]=0),Dn(10488)|0||t8(10488),10488}function t8(e){e=e|0,ZA(e),sc(e,60)}function JA(e){e=e|0,QA(e+24|0)}function QA(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function ZA(e){e=e|0;var n=0;n=An()|0,Nn(e,5,6,n,rO()|0,0),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function eO(e){e=e|0,tO(e)}function tO(e){e=e|0,nO(e)}function nO(e){e=e|0,n8(e+8|0),c[e+24>>0]=1}function n8(e){e=e|0,t[e>>2]=0,t[e+4>>2]=0,t[e+8>>2]=0,t[e+12>>2]=0}function rO(){return 1492}function iO(){return oO()|0}function oO(){var e=0,n=0,r=0,o=0,s=0,l=0,d=0;return n=h,h=h+16|0,s=n+4|0,d=n,r=Qo(8)|0,e=r,o=Tt(16)|0,n8(o),l=e+4|0,t[l>>2]=o,o=Tt(8)|0,l=t[l>>2]|0,t[d>>2]=0,t[s>>2]=t[d>>2],e8(o,l,s),t[r>>2]=o,h=n,e|0}function uO(){var e=0;return c[7936]|0||(pO(10524),Bt(25,10524,Q|0)|0,e=7936,t[e>>2]=1,t[e+4>>2]=0),10524}function sO(e,n){e=e|0,n=n|0,t[e>>2]=lO()|0,t[e+4>>2]=fO()|0,t[e+12>>2]=n,t[e+8>>2]=cO()|0,t[e+32>>2]=7}function lO(){return 11700}function fO(){return 1484}function cO(){return th()|0}function aO(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0,(Sf(o,896)|0)==512?r|0&&(dO(r),Ve(r)):n|0&&Ve(n)}function dO(e){e=e|0,e=t[e+4>>2]|0,e|0&&Tf(e)}function pO(e){e=e|0,Ys(e)}function hO(e,n,r){e=e|0,n=n|0,r=r|0,e=Zn(n)|0,n=mO(r)|0,r=vO(r,0)|0,VO(e,n,r,k4()|0,0)}function mO(e){return e=e|0,e|0}function vO(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0;return _=h,h=h+16|0,s=_,l=_+4|0,t[s>>2]=e,y=k4()|0,d=y+24|0,n=Lt(n,4)|0,t[l>>2]=n,r=y+28|0,o=t[r>>2]|0,o>>>0<(t[y+32>>2]|0)>>>0?(i8(o,e,n),n=(t[r>>2]|0)+8|0,t[r>>2]=n):(SO(d,s,l),n=t[r>>2]|0),h=_,(n-(t[d>>2]|0)>>3)+-1|0}function k4(){var e=0,n=0;if(c[7944]|0||(r8(10568),Bt(61,10568,Q|0)|0,n=7944,t[n>>2]=1,t[n+4>>2]=0),!(Dn(10568)|0)){e=10568,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));r8(10568)}return 10568}function r8(e){e=e|0,yO(e)}function gO(e){e=e|0,_O(e+24|0)}function _O(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function yO(e){e=e|0;var n=0;n=An()|0,Nn(e,1,17,n,Dp()|0,0),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function wO(e){return e=e|0,EO(t[(DO(e)|0)>>2]|0)|0}function DO(e){return e=e|0,(t[(k4()|0)+24>>2]|0)+(e<<3)|0}function EO(e){return e=e|0,ea(ph[e&7]()|0)|0}function i8(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,t[e+4>>2]=r}function SO(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0;if(_=h,h=h+32|0,s=_,l=e+4|0,d=((t[l>>2]|0)-(t[e>>2]|0)>>3)+1|0,o=CO(e)|0,o>>>0<d>>>0)$n(e);else{y=t[e>>2]|0,T=(t[e+8>>2]|0)-y|0,k=T>>2,TO(s,T>>3>>>0<o>>>1>>>0?k>>>0<d>>>0?d:k:o,(t[l>>2]|0)-y>>3,e+8|0),d=s+8|0,i8(t[d>>2]|0,t[n>>2]|0,t[r>>2]|0),t[d>>2]=(t[d>>2]|0)+8,xO(e,s),kO(s),h=_;return}}function CO(e){return e=e|0,536870911}function TO(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>536870911)_n();else{s=Tt(n<<3)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r<<3)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n<<3)}function xO(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(0-(s>>3)<<3)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function kO(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~((o+-8-n|0)>>>3)<<3)),e=t[e>>2]|0,e|0&&Ve(e)}function AO(){OO()}function OO(){IO(10604)}function IO(e){e=e|0,PO(e,4955)}function PO(e,n){e=e|0,n=n|0;var r=0;r=MO()|0,t[e>>2]=r,FO(r,n),Cf(t[e>>2]|0)}function MO(){var e=0;return c[7952]|0||(WO(10612),Bt(25,10612,Q|0)|0,e=7952,t[e>>2]=1,t[e+4>>2]=0),10612}function FO(e,n){e=e|0,n=n|0,t[e>>2]=BO()|0,t[e+4>>2]=jO()|0,t[e+12>>2]=n,t[e+8>>2]=UO()|0,t[e+32>>2]=8}function Cf(e){e=e|0;var n=0,r=0;n=h,h=h+16|0,r=n,sa()|0,t[r>>2]=e,LO(10608,r),h=n}function sa(){return c[11714]|0||(t[2652]=0,Bt(62,10608,Q|0)|0,c[11714]=1),10608}function LO(e,n){e=e|0,n=n|0;var r=0;r=Tt(8)|0,t[r+4>>2]=t[n>>2],t[r>>2]=t[e>>2],t[e>>2]=r}function RO(e){e=e|0,NO(e)}function NO(e){e=e|0;var n=0,r=0;if(n=t[e>>2]|0,n|0)do r=n,n=t[n>>2]|0,Ve(r);while((n|0)!=0);t[e>>2]=0}function BO(){return 11715}function jO(){return 1496}function UO(){return eh()|0}function qO(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0,(Sf(o,896)|0)==512?r|0&&(zO(r),Ve(r)):n|0&&Ve(n)}function zO(e){e=e|0,e=t[e+4>>2]|0,e|0&&Tf(e)}function WO(e){e=e|0,Ys(e)}function HO(e,n){e=e|0,n=n|0;var r=0,o=0;sa()|0,r=t[2652]|0;e:do if(r|0){for(;o=t[r+4>>2]|0,!(o|0?(U8(A4(o)|0,e)|0)==0:0);)if(r=t[r>>2]|0,!r)break e;bO(o,n)}while(0)}function A4(e){return e=e|0,t[e+12>>2]|0}function bO(e,n){e=e|0,n=n|0;var r=0;e=e+36|0,r=t[e>>2]|0,r|0&&(Ju(r),Ve(r)),r=Tt(4)|0,ba(r,n),t[e>>2]=r}function O4(){return c[11716]|0||(t[2664]=0,Bt(63,10656,Q|0)|0,c[11716]=1),10656}function o8(){var e=0;return c[11717]|0?e=t[2665]|0:(GO(),t[2665]=1504,c[11717]=1,e=1504),e|0}function GO(){c[11740]|0||(c[11718]=Lt(Lt(8,0)|0,0)|0,c[11719]=Lt(Lt(0,0)|0,0)|0,c[11720]=Lt(Lt(0,16)|0,0)|0,c[11721]=Lt(Lt(8,0)|0,0)|0,c[11722]=Lt(Lt(0,0)|0,0)|0,c[11723]=Lt(Lt(8,0)|0,0)|0,c[11724]=Lt(Lt(0,0)|0,0)|0,c[11725]=Lt(Lt(8,0)|0,0)|0,c[11726]=Lt(Lt(0,0)|0,0)|0,c[11727]=Lt(Lt(8,0)|0,0)|0,c[11728]=Lt(Lt(0,0)|0,0)|0,c[11729]=Lt(Lt(0,0)|0,32)|0,c[11730]=Lt(Lt(0,0)|0,32)|0,c[11740]=1)}function u8(){return 1572}function VO(e,n,r,o,s){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0;var l=0,d=0,_=0,y=0,k=0,T=0;l=h,h=h+32|0,T=l+16|0,k=l+12|0,y=l+8|0,_=l+4|0,d=l,t[T>>2]=e,t[k>>2]=n,t[y>>2]=r,t[_>>2]=o,t[d>>2]=s,O4()|0,YO(10656,T,k,y,_,d),h=l}function YO(e,n,r,o,s,l){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0;var d=0;d=Tt(24)|0,t1(d+4|0,t[n>>2]|0,t[r>>2]|0,t[o>>2]|0,t[s>>2]|0,t[l>>2]|0),t[d>>2]=t[e>>2],t[e>>2]=d}function s8(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0,we=0,le=0,ie=0,Pe=0,ke=0,qe=0;if(qe=h,h=h+32|0,le=qe+20|0,ie=qe+8|0,Pe=qe+4|0,ke=qe,n=t[n>>2]|0,n|0){we=le+4|0,y=le+8|0,k=ie+4|0,T=ie+8|0,P=ie+8|0,q=le+8|0;do{if(d=n+4|0,_=I4(d)|0,_|0){if(s=b1(_)|0,t[le>>2]=0,t[we>>2]=0,t[y>>2]=0,o=(G1(_)|0)+1|0,$O(le,o),o|0)for(;o=o+-1|0,os(ie,t[s>>2]|0),l=t[we>>2]|0,l>>>0<(t[q>>2]|0)>>>0?(t[l>>2]=t[ie>>2],t[we>>2]=(t[we>>2]|0)+4):P4(le,ie),o;)s=s+4|0;o=V1(_)|0,t[ie>>2]=0,t[k>>2]=0,t[T>>2]=0;e:do if(t[o>>2]|0)for(s=0,l=0;;){if((s|0)==(l|0)?KO(ie,o):(t[s>>2]=t[o>>2],t[k>>2]=(t[k>>2]|0)+4),o=o+4|0,!(t[o>>2]|0))break e;s=t[k>>2]|0,l=t[P>>2]|0}while(0);t[Pe>>2]=nh(d)|0,t[ke>>2]=Dn(_)|0,XO(r,e,Pe,ke,le,ie),M4(ie),Rl(le)}n=t[n>>2]|0}while((n|0)!=0)}h=qe}function I4(e){return e=e|0,t[e+12>>2]|0}function b1(e){return e=e|0,t[e+12>>2]|0}function G1(e){return e=e|0,t[e+16>>2]|0}function $O(e,n){e=e|0,n=n|0;var r=0,o=0,s=0;s=h,h=h+32|0,r=s,o=t[e>>2]|0,(t[e+8>>2]|0)-o>>2>>>0<n>>>0&&(m8(r,n,(t[e+4>>2]|0)-o>>2,e+8|0),v8(e,r),g8(r)),h=s}function P4(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0;if(d=h,h=h+32|0,r=d,o=e+4|0,s=((t[o>>2]|0)-(t[e>>2]|0)>>2)+1|0,l=h8(e)|0,l>>>0<s>>>0)$n(e);else{_=t[e>>2]|0,k=(t[e+8>>2]|0)-_|0,y=k>>1,m8(r,k>>2>>>0<l>>>1>>>0?y>>>0<s>>>0?s:y:l,(t[o>>2]|0)-_>>2,e+8|0),l=r+8|0,t[t[l>>2]>>2]=t[n>>2],t[l>>2]=(t[l>>2]|0)+4,v8(e,r),g8(r),h=d;return}}function V1(e){return e=e|0,t[e+8>>2]|0}function KO(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0;if(d=h,h=h+32|0,r=d,o=e+4|0,s=((t[o>>2]|0)-(t[e>>2]|0)>>2)+1|0,l=p8(e)|0,l>>>0<s>>>0)$n(e);else{_=t[e>>2]|0,k=(t[e+8>>2]|0)-_|0,y=k>>1,mI(r,k>>2>>>0<l>>>1>>>0?y>>>0<s>>>0?s:y:l,(t[o>>2]|0)-_>>2,e+8|0),l=r+8|0,t[t[l>>2]>>2]=t[n>>2],t[l>>2]=(t[l>>2]|0)+4,vI(e,r),gI(r),h=d;return}}function nh(e){return e=e|0,t[e>>2]|0}function XO(e,n,r,o,s,l){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0,JO(e,n,r,o,s,l)}function M4(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-4-o|0)>>>2)<<2)),Ve(r))}function Rl(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-4-o|0)>>>2)<<2)),Ve(r))}function JO(e,n,r,o,s,l){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0;var d=0,_=0,y=0,k=0,T=0,P=0;d=h,h=h+48|0,T=d+40|0,_=d+32|0,P=d+24|0,y=d+12|0,k=d,Zo(_),e=Oi(e)|0,t[P>>2]=t[n>>2],r=t[r>>2]|0,o=t[o>>2]|0,F4(y,s),QO(k,l),t[T>>2]=t[P>>2],ZO(e,T,r,o,y,k),M4(k),Rl(y),eu(_),h=d}function F4(e,n){e=e|0,n=n|0;var r=0,o=0;t[e>>2]=0,t[e+4>>2]=0,t[e+8>>2]=0,r=n+4|0,o=(t[r>>2]|0)-(t[n>>2]|0)>>2,o|0&&(pI(e,o),hI(e,t[n>>2]|0,t[r>>2]|0,o))}function QO(e,n){e=e|0,n=n|0;var r=0,o=0;t[e>>2]=0,t[e+4>>2]=0,t[e+8>>2]=0,r=n+4|0,o=(t[r>>2]|0)-(t[n>>2]|0)>>2,o|0&&(aI(e,o),dI(e,t[n>>2]|0,t[r>>2]|0,o))}function ZO(e,n,r,o,s,l){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0;var d=0,_=0,y=0,k=0,T=0,P=0;d=h,h=h+32|0,T=d+28|0,P=d+24|0,_=d+12|0,y=d,k=ko(eI()|0)|0,t[P>>2]=t[n>>2],t[T>>2]=t[P>>2],n=lc(T)|0,r=l8(r)|0,o=L4(o)|0,t[_>>2]=t[s>>2],T=s+4|0,t[_+4>>2]=t[T>>2],P=s+8|0,t[_+8>>2]=t[P>>2],t[P>>2]=0,t[T>>2]=0,t[s>>2]=0,s=R4(_)|0,t[y>>2]=t[l>>2],T=l+4|0,t[y+4>>2]=t[T>>2],P=l+8|0,t[y+8>>2]=t[P>>2],t[P>>2]=0,t[T>>2]=0,t[l>>2]=0,qo(0,k|0,e|0,n|0,r|0,o|0,s|0,tI(y)|0)|0,M4(y),Rl(_),h=d}function eI(){var e=0;return c[7968]|0||(fI(10708),e=7968,t[e>>2]=1,t[e+4>>2]=0),10708}function lc(e){return e=e|0,c8(e)|0}function l8(e){return e=e|0,f8(e)|0}function L4(e){return e=e|0,ea(e)|0}function R4(e){return e=e|0,rI(e)|0}function tI(e){return e=e|0,nI(e)|0}function nI(e){e=e|0;var n=0,r=0,o=0;if(o=(t[e+4>>2]|0)-(t[e>>2]|0)|0,r=o>>2,o=Qo(o+4|0)|0,t[o>>2]=r,r|0){n=0;do t[o+4+(n<<2)>>2]=f8(t[(t[e>>2]|0)+(n<<2)>>2]|0)|0,n=n+1|0;while((n|0)!=(r|0))}return o|0}function f8(e){return e=e|0,e|0}function rI(e){e=e|0;var n=0,r=0,o=0;if(o=(t[e+4>>2]|0)-(t[e>>2]|0)|0,r=o>>2,o=Qo(o+4|0)|0,t[o>>2]=r,r|0){n=0;do t[o+4+(n<<2)>>2]=c8((t[e>>2]|0)+(n<<2)|0)|0,n=n+1|0;while((n|0)!=(r|0))}return o|0}function c8(e){e=e|0;var n=0,r=0,o=0,s=0;return s=h,h=h+32|0,n=s+12|0,r=s,o=U0(a8()|0)|0,o?(s1(n,o),l1(r,n),UF(e,r),e=f1(n)|0):e=iI(e)|0,h=s,e|0}function a8(){var e=0;return c[7960]|0||(lI(10664),Bt(25,10664,Q|0)|0,e=7960,t[e>>2]=1,t[e+4>>2]=0),10664}function iI(e){e=e|0;var n=0,r=0,o=0,s=0,l=0,d=0,_=0;return r=h,h=h+16|0,s=r+4|0,d=r,o=Qo(8)|0,n=o,_=Tt(4)|0,t[_>>2]=t[e>>2],l=n+4|0,t[l>>2]=_,e=Tt(8)|0,l=t[l>>2]|0,t[d>>2]=0,t[s>>2]=t[d>>2],d8(e,l,s),t[o>>2]=e,h=r,n|0}function d8(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,r=Tt(16)|0,t[r+4>>2]=0,t[r+8>>2]=0,t[r>>2]=1656,t[r+12>>2]=n,t[e+4>>2]=r}function oI(e){e=e|0,da(e),Ve(e)}function uI(e){e=e|0,e=t[e+12>>2]|0,e|0&&Ve(e)}function sI(e){e=e|0,Ve(e)}function lI(e){e=e|0,Ys(e)}function fI(e){e=e|0,Ao(e,cI()|0,5)}function cI(){return 1676}function aI(e,n){e=e|0,n=n|0;var r=0;if((p8(e)|0)>>>0<n>>>0&&$n(e),n>>>0>1073741823)_n();else{r=Tt(n<<2)|0,t[e+4>>2]=r,t[e>>2]=r,t[e+8>>2]=r+(n<<2);return}}function dI(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0,o=e+4|0,e=r-n|0,(e|0)>0&&(vn(t[o>>2]|0,n|0,e|0)|0,t[o>>2]=(t[o>>2]|0)+(e>>>2<<2))}function p8(e){return e=e|0,1073741823}function pI(e,n){e=e|0,n=n|0;var r=0;if((h8(e)|0)>>>0<n>>>0&&$n(e),n>>>0>1073741823)_n();else{r=Tt(n<<2)|0,t[e+4>>2]=r,t[e>>2]=r,t[e+8>>2]=r+(n<<2);return}}function hI(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0,o=e+4|0,e=r-n|0,(e|0)>0&&(vn(t[o>>2]|0,n|0,e|0)|0,t[o>>2]=(t[o>>2]|0)+(e>>>2<<2))}function h8(e){return e=e|0,1073741823}function mI(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>1073741823)_n();else{s=Tt(n<<2)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r<<2)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n<<2)}function vI(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(0-(s>>2)<<2)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function gI(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~((o+-4-n|0)>>>2)<<2)),e=t[e>>2]|0,e|0&&Ve(e)}function m8(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>1073741823)_n();else{s=Tt(n<<2)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r<<2)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n<<2)}function v8(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(0-(s>>2)<<2)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function g8(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~((o+-4-n|0)>>>2)<<2)),e=t[e>>2]|0,e|0&&Ve(e)}function _I(e,n,r,o,s){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0;var l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0,we=0,le=0,ie=0;if(ie=h,h=h+32|0,T=ie+20|0,P=ie+12|0,k=ie+16|0,q=ie+4|0,we=ie,le=ie+8|0,_=o8()|0,l=t[_>>2]|0,d=t[l>>2]|0,d|0)for(y=t[_+8>>2]|0,_=t[_+4>>2]|0;os(T,d),yI(e,T,_,y),l=l+4|0,d=t[l>>2]|0,d;)y=y+1|0,_=_+1|0;if(l=u8()|0,d=t[l>>2]|0,d|0)do os(T,d),t[P>>2]=t[l+4>>2],wI(n,T,P),l=l+8|0,d=t[l>>2]|0;while((d|0)!=0);if(l=t[(sa()|0)>>2]|0,l|0)do n=t[l+4>>2]|0,os(T,t[(la(n)|0)>>2]|0),t[P>>2]=A4(n)|0,DI(r,T,P),l=t[l>>2]|0;while((l|0)!=0);if(os(k,0),l=O4()|0,t[T>>2]=t[k>>2],s8(T,l,s),l=t[(sa()|0)>>2]|0,l|0){e=T+4|0,n=T+8|0,r=T+8|0;do{if(y=t[l+4>>2]|0,os(P,t[(la(y)|0)>>2]|0),EI(q,_8(y)|0),d=t[q>>2]|0,d|0){t[T>>2]=0,t[e>>2]=0,t[n>>2]=0;do os(we,t[(la(t[d+4>>2]|0)|0)>>2]|0),_=t[e>>2]|0,_>>>0<(t[r>>2]|0)>>>0?(t[_>>2]=t[we>>2],t[e>>2]=(t[e>>2]|0)+4):P4(T,we),d=t[d>>2]|0;while((d|0)!=0);SI(o,P,T),Rl(T)}t[le>>2]=t[P>>2],k=y8(y)|0,t[T>>2]=t[le>>2],s8(T,k,s),bd(q),l=t[l>>2]|0}while((l|0)!=0)}h=ie}function yI(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0,RI(e,n,r,o)}function wI(e,n,r){e=e|0,n=n|0,r=r|0,LI(e,n,r)}function la(e){return e=e|0,e|0}function DI(e,n,r){e=e|0,n=n|0,r=r|0,II(e,n,r)}function _8(e){return e=e|0,e+16|0}function EI(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0;if(l=h,h=h+16|0,s=l+8|0,r=l,t[e>>2]=0,o=t[n>>2]|0,t[s>>2]=o,t[r>>2]=e,r=OI(r)|0,o|0){if(o=Tt(12)|0,d=(w8(s)|0)+4|0,e=t[d+4>>2]|0,n=o+4|0,t[n>>2]=t[d>>2],t[n+4>>2]=e,n=t[t[s>>2]>>2]|0,t[s>>2]=n,!n)e=o;else for(n=o;e=Tt(12)|0,y=(w8(s)|0)+4|0,_=t[y+4>>2]|0,d=e+4|0,t[d>>2]=t[y>>2],t[d+4>>2]=_,t[n>>2]=e,d=t[t[s>>2]>>2]|0,t[s>>2]=d,d;)n=e;t[e>>2]=t[r>>2],t[r>>2]=o}h=l}function SI(e,n,r){e=e|0,n=n|0,r=r|0,CI(e,n,r)}function y8(e){return e=e|0,e+24|0}function CI(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+32|0,d=o+24|0,s=o+16|0,_=o+12|0,l=o,Zo(s),e=Oi(e)|0,t[_>>2]=t[n>>2],F4(l,r),t[d>>2]=t[_>>2],TI(e,d,l),Rl(l),eu(s),h=o}function TI(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=h,h=h+32|0,d=o+16|0,_=o+12|0,s=o,l=ko(xI()|0)|0,t[_>>2]=t[n>>2],t[d>>2]=t[_>>2],n=lc(d)|0,t[s>>2]=t[r>>2],d=r+4|0,t[s+4>>2]=t[d>>2],_=r+8|0,t[s+8>>2]=t[_>>2],t[_>>2]=0,t[d>>2]=0,t[r>>2]=0,Ts(0,l|0,e|0,n|0,R4(s)|0)|0,Rl(s),h=o}function xI(){var e=0;return c[7976]|0||(kI(10720),e=7976,t[e>>2]=1,t[e+4>>2]=0),10720}function kI(e){e=e|0,Ao(e,AI()|0,2)}function AI(){return 1732}function OI(e){return e=e|0,t[e>>2]|0}function w8(e){return e=e|0,t[e>>2]|0}function II(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;o=h,h=h+32|0,l=o+16|0,s=o+8|0,d=o,Zo(s),e=Oi(e)|0,t[d>>2]=t[n>>2],r=t[r>>2]|0,t[l>>2]=t[d>>2],D8(e,l,r),eu(s),h=o}function D8(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;o=h,h=h+16|0,l=o+4|0,d=o,s=ko(PI()|0)|0,t[d>>2]=t[n>>2],t[l>>2]=t[d>>2],n=lc(l)|0,Ts(0,s|0,e|0,n|0,l8(r)|0)|0,h=o}function PI(){var e=0;return c[7984]|0||(MI(10732),e=7984,t[e>>2]=1,t[e+4>>2]=0),10732}function MI(e){e=e|0,Ao(e,FI()|0,2)}function FI(){return 1744}function LI(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;o=h,h=h+32|0,l=o+16|0,s=o+8|0,d=o,Zo(s),e=Oi(e)|0,t[d>>2]=t[n>>2],r=t[r>>2]|0,t[l>>2]=t[d>>2],D8(e,l,r),eu(s),h=o}function RI(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0;s=h,h=h+32|0,d=s+16|0,l=s+8|0,_=s,Zo(l),e=Oi(e)|0,t[_>>2]=t[n>>2],r=c[r>>0]|0,o=c[o>>0]|0,t[d>>2]=t[_>>2],NI(e,d,r,o),eu(l),h=s}function NI(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0;s=h,h=h+16|0,d=s+4|0,_=s,l=ko(BI()|0)|0,t[_>>2]=t[n>>2],t[d>>2]=t[_>>2],n=lc(d)|0,r=fa(r)|0,Bu(0,l|0,e|0,n|0,r|0,fa(o)|0)|0,h=s}function BI(){var e=0;return c[7992]|0||(UI(10744),e=7992,t[e>>2]=1,t[e+4>>2]=0),10744}function fa(e){return e=e|0,jI(e)|0}function jI(e){return e=e|0,e&255|0}function UI(e){e=e|0,Ao(e,qI()|0,3)}function qI(){return 1756}function zI(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;switch(q=h,h=h+32|0,_=q+8|0,y=q+4|0,k=q+20|0,T=q,_1(e,0),o=jF(n)|0,t[_>>2]=0,P=_+4|0,t[P>>2]=0,t[_+8>>2]=0,o<<24>>24){case 0:{c[k>>0]=0,WI(y,r,k),rh(e,y)|0,ei(y);break}case 8:{P=z4(n)|0,c[k>>0]=8,os(T,t[P+4>>2]|0),HI(y,r,k,T,P+8|0),rh(e,y)|0,ei(y);break}case 9:{if(l=z4(n)|0,n=t[l+4>>2]|0,n|0)for(d=_+8|0,s=l+12|0;n=n+-1|0,os(y,t[s>>2]|0),o=t[P>>2]|0,o>>>0<(t[d>>2]|0)>>>0?(t[o>>2]=t[y>>2],t[P>>2]=(t[P>>2]|0)+4):P4(_,y),n;)s=s+4|0;c[k>>0]=9,os(T,t[l+8>>2]|0),bI(y,r,k,T,_),rh(e,y)|0,ei(y);break}default:P=z4(n)|0,c[k>>0]=o,os(T,t[P+4>>2]|0),GI(y,r,k,T),rh(e,y)|0,ei(y)}Rl(_),h=q}function WI(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0;o=h,h=h+16|0,s=o,Zo(s),n=Oi(n)|0,iP(e,n,c[r>>0]|0),eu(s),h=o}function rh(e,n){e=e|0,n=n|0;var r=0;return r=t[e>>2]|0,r|0&&ju(r|0),t[e>>2]=t[n>>2],t[n>>2]=0,e|0}function HI(e,n,r,o,s){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0;var l=0,d=0,_=0,y=0;l=h,h=h+32|0,_=l+16|0,d=l+8|0,y=l,Zo(d),n=Oi(n)|0,r=c[r>>0]|0,t[y>>2]=t[o>>2],s=t[s>>2]|0,t[_>>2]=t[y>>2],eP(e,n,r,_,s),eu(d),h=l}function bI(e,n,r,o,s){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0;var l=0,d=0,_=0,y=0,k=0;l=h,h=h+32|0,y=l+24|0,d=l+16|0,k=l+12|0,_=l,Zo(d),n=Oi(n)|0,r=c[r>>0]|0,t[k>>2]=t[o>>2],F4(_,s),t[y>>2]=t[k>>2],XI(e,n,r,y,_),Rl(_),eu(d),h=l}function GI(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0;s=h,h=h+32|0,d=s+16|0,l=s+8|0,_=s,Zo(l),n=Oi(n)|0,r=c[r>>0]|0,t[_>>2]=t[o>>2],t[d>>2]=t[_>>2],VI(e,n,r,d),eu(l),h=s}function VI(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0,d=0,_=0;s=h,h=h+16|0,l=s+4|0,_=s,d=ko(YI()|0)|0,r=fa(r)|0,t[_>>2]=t[o>>2],t[l>>2]=t[_>>2],ih(e,Ts(0,d|0,n|0,r|0,lc(l)|0)|0),h=s}function YI(){var e=0;return c[8e3]|0||($I(10756),e=8e3,t[e>>2]=1,t[e+4>>2]=0),10756}function ih(e,n){e=e|0,n=n|0,_1(e,n)}function $I(e){e=e|0,Ao(e,KI()|0,2)}function KI(){return 1772}function XI(e,n,r,o,s){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0;var l=0,d=0,_=0,y=0,k=0;l=h,h=h+32|0,y=l+16|0,k=l+12|0,d=l,_=ko(JI()|0)|0,r=fa(r)|0,t[k>>2]=t[o>>2],t[y>>2]=t[k>>2],o=lc(y)|0,t[d>>2]=t[s>>2],y=s+4|0,t[d+4>>2]=t[y>>2],k=s+8|0,t[d+8>>2]=t[k>>2],t[k>>2]=0,t[y>>2]=0,t[s>>2]=0,ih(e,Bu(0,_|0,n|0,r|0,o|0,R4(d)|0)|0),Rl(d),h=l}function JI(){var e=0;return c[8008]|0||(QI(10768),e=8008,t[e>>2]=1,t[e+4>>2]=0),10768}function QI(e){e=e|0,Ao(e,ZI()|0,3)}function ZI(){return 1784}function eP(e,n,r,o,s){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0;var l=0,d=0,_=0,y=0;l=h,h=h+16|0,_=l+4|0,y=l,d=ko(tP()|0)|0,r=fa(r)|0,t[y>>2]=t[o>>2],t[_>>2]=t[y>>2],o=lc(_)|0,ih(e,Bu(0,d|0,n|0,r|0,o|0,L4(s)|0)|0),h=l}function tP(){var e=0;return c[8016]|0||(nP(10780),e=8016,t[e>>2]=1,t[e+4>>2]=0),10780}function nP(e){e=e|0,Ao(e,rP()|0,3)}function rP(){return 1800}function iP(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;o=ko(oP()|0)|0,ih(e,sf(0,o|0,n|0,fa(r)|0)|0)}function oP(){var e=0;return c[8024]|0||(uP(10792),e=8024,t[e>>2]=1,t[e+4>>2]=0),10792}function uP(e){e=e|0,Ao(e,sP()|0,1)}function sP(){return 1816}function lP(){fP(),cP(),aP()}function fP(){t[2702]=K8(65536)|0}function cP(){PP(10856)}function aP(){dP(10816)}function dP(e){e=e|0,pP(e,5044),hP(e)|0}function pP(e,n){e=e|0,n=n|0;var r=0;r=a8()|0,t[e>>2]=r,TP(r,n),Cf(t[e>>2]|0)}function hP(e){e=e|0;var n=0;return n=t[e>>2]|0,uc(n,mP()|0),e|0}function mP(){var e=0;return c[8032]|0||(E8(10820),Bt(64,10820,Q|0)|0,e=8032,t[e>>2]=1,t[e+4>>2]=0),Dn(10820)|0||E8(10820),10820}function E8(e){e=e|0,_P(e),sc(e,25)}function vP(e){e=e|0,gP(e+24|0)}function gP(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function _P(e){e=e|0;var n=0;n=An()|0,Nn(e,5,18,n,EP()|0,1),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function yP(e,n){e=e|0,n=n|0,wP(e,n)}function wP(e,n){e=e|0,n=n|0;var r=0,o=0,s=0;r=h,h=h+16|0,o=r,s=r+4|0,Ml(s,n),t[o>>2]=Fl(s,n)|0,DP(e,o),h=r}function DP(e,n){e=e|0,n=n|0,S8(e+4|0,t[n>>2]|0),c[e+8>>0]=1}function S8(e,n){e=e|0,n=n|0,t[e>>2]=n}function EP(){return 1824}function SP(e){return e=e|0,CP(e)|0}function CP(e){e=e|0;var n=0,r=0,o=0,s=0,l=0,d=0,_=0;return r=h,h=h+16|0,s=r+4|0,d=r,o=Qo(8)|0,n=o,_=Tt(4)|0,Ml(s,e),S8(_,Fl(s,e)|0),l=n+4|0,t[l>>2]=_,e=Tt(8)|0,l=t[l>>2]|0,t[d>>2]=0,t[s>>2]=t[d>>2],d8(e,l,s),t[o>>2]=e,h=r,n|0}function Qo(e){e=e|0;var n=0,r=0;return e=e+7&-8,(e>>>0<=32768?(n=t[2701]|0,e>>>0<=(65536-n|0)>>>0):0)?(r=(t[2702]|0)+n|0,t[2701]=n+e,e=r):(e=K8(e+8|0)|0,t[e>>2]=t[2703],t[2703]=e,e=e+8|0),e|0}function TP(e,n){e=e|0,n=n|0,t[e>>2]=xP()|0,t[e+4>>2]=kP()|0,t[e+12>>2]=n,t[e+8>>2]=AP()|0,t[e+32>>2]=9}function xP(){return 11744}function kP(){return 1832}function AP(){return th()|0}function OP(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0,(Sf(o,896)|0)==512?r|0&&(IP(r),Ve(r)):n|0&&Ve(n)}function IP(e){e=e|0,e=t[e+4>>2]|0,e|0&&Tf(e)}function PP(e){e=e|0,MP(e,5052),FP(e)|0,LP(e,5058,26)|0,RP(e,5069,1)|0,NP(e,5077,10)|0,BP(e,5087,19)|0,jP(e,5094,27)|0}function MP(e,n){e=e|0,n=n|0;var r=0;r=IF()|0,t[e>>2]=r,PF(r,n),Cf(t[e>>2]|0)}function FP(e){e=e|0;var n=0;return n=t[e>>2]|0,uc(n,vF()|0),e|0}function LP(e,n,r){return e=e|0,n=n|0,r=r|0,QM(e,Zn(n)|0,r,0),e|0}function RP(e,n,r){return e=e|0,n=n|0,r=r|0,BM(e,Zn(n)|0,r,0),e|0}function NP(e,n,r){return e=e|0,n=n|0,r=r|0,mM(e,Zn(n)|0,r,0),e|0}function BP(e,n,r){return e=e|0,n=n|0,r=r|0,eM(e,Zn(n)|0,r,0),e|0}function C8(e,n){e=e|0,n=n|0;var r=0,o=0;e:for(;;){for(r=t[2703]|0;;){if((r|0)==(n|0))break e;if(o=t[r>>2]|0,t[2703]=o,!r)r=o;else break}Ve(r)}t[2701]=e}function jP(e,n,r){return e=e|0,n=n|0,r=r|0,UP(e,Zn(n)|0,r,0),e|0}function UP(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0;l=t[e>>2]|0,s=N4()|0,e=qP(r)|0,ur(l,n,s,e,zP(r,o)|0,o)}function N4(){var e=0,n=0;if(c[8040]|0||(x8(10860),Bt(65,10860,Q|0)|0,n=8040,t[n>>2]=1,t[n+4>>2]=0),!(Dn(10860)|0)){e=10860,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));x8(10860)}return 10860}function qP(e){return e=e|0,e|0}function zP(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0;return _=h,h=h+16|0,s=_,l=_+4|0,t[s>>2]=e,y=N4()|0,d=y+24|0,n=Lt(n,4)|0,t[l>>2]=n,r=y+28|0,o=t[r>>2]|0,o>>>0<(t[y+32>>2]|0)>>>0?(T8(o,e,n),n=(t[r>>2]|0)+8|0,t[r>>2]=n):(WP(d,s,l),n=t[r>>2]|0),h=_,(n-(t[d>>2]|0)>>3)+-1|0}function T8(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,t[e+4>>2]=r}function WP(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0;if(_=h,h=h+32|0,s=_,l=e+4|0,d=((t[l>>2]|0)-(t[e>>2]|0)>>3)+1|0,o=HP(e)|0,o>>>0<d>>>0)$n(e);else{y=t[e>>2]|0,T=(t[e+8>>2]|0)-y|0,k=T>>2,bP(s,T>>3>>>0<o>>>1>>>0?k>>>0<d>>>0?d:k:o,(t[l>>2]|0)-y>>3,e+8|0),d=s+8|0,T8(t[d>>2]|0,t[n>>2]|0,t[r>>2]|0),t[d>>2]=(t[d>>2]|0)+8,GP(e,s),VP(s),h=_;return}}function HP(e){return e=e|0,536870911}function bP(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>536870911)_n();else{s=Tt(n<<3)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r<<3)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n<<3)}function GP(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(0-(s>>3)<<3)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function VP(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~((o+-8-n|0)>>>3)<<3)),e=t[e>>2]|0,e|0&&Ve(e)}function x8(e){e=e|0,KP(e)}function YP(e){e=e|0,$P(e+24|0)}function $P(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function KP(e){e=e|0;var n=0;n=An()|0,Nn(e,1,11,n,XP()|0,2),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function XP(){return 1840}function JP(e,n,r){e=e|0,n=n|0,r=r|0,ZP(t[(QP(e)|0)>>2]|0,n,r)}function QP(e){return e=e|0,(t[(N4()|0)+24>>2]|0)+(e<<3)|0}function ZP(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0;o=h,h=h+16|0,l=o+1|0,s=o,Ml(l,n),n=Fl(l,n)|0,Ml(s,r),r=Fl(s,r)|0,Bl[e&31](n,r),h=o}function eM(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0;l=t[e>>2]|0,s=B4()|0,e=tM(r)|0,ur(l,n,s,e,nM(r,o)|0,o)}function B4(){var e=0,n=0;if(c[8048]|0||(A8(10896),Bt(66,10896,Q|0)|0,n=8048,t[n>>2]=1,t[n+4>>2]=0),!(Dn(10896)|0)){e=10896,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));A8(10896)}return 10896}function tM(e){return e=e|0,e|0}function nM(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0;return _=h,h=h+16|0,s=_,l=_+4|0,t[s>>2]=e,y=B4()|0,d=y+24|0,n=Lt(n,4)|0,t[l>>2]=n,r=y+28|0,o=t[r>>2]|0,o>>>0<(t[y+32>>2]|0)>>>0?(k8(o,e,n),n=(t[r>>2]|0)+8|0,t[r>>2]=n):(rM(d,s,l),n=t[r>>2]|0),h=_,(n-(t[d>>2]|0)>>3)+-1|0}function k8(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,t[e+4>>2]=r}function rM(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0;if(_=h,h=h+32|0,s=_,l=e+4|0,d=((t[l>>2]|0)-(t[e>>2]|0)>>3)+1|0,o=iM(e)|0,o>>>0<d>>>0)$n(e);else{y=t[e>>2]|0,T=(t[e+8>>2]|0)-y|0,k=T>>2,oM(s,T>>3>>>0<o>>>1>>>0?k>>>0<d>>>0?d:k:o,(t[l>>2]|0)-y>>3,e+8|0),d=s+8|0,k8(t[d>>2]|0,t[n>>2]|0,t[r>>2]|0),t[d>>2]=(t[d>>2]|0)+8,uM(e,s),sM(s),h=_;return}}function iM(e){return e=e|0,536870911}function oM(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>536870911)_n();else{s=Tt(n<<3)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r<<3)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n<<3)}function uM(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(0-(s>>3)<<3)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function sM(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~((o+-8-n|0)>>>3)<<3)),e=t[e>>2]|0,e|0&&Ve(e)}function A8(e){e=e|0,cM(e)}function lM(e){e=e|0,fM(e+24|0)}function fM(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function cM(e){e=e|0;var n=0;n=An()|0,Nn(e,1,11,n,aM()|0,1),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function aM(){return 1852}function dM(e,n){return e=e|0,n=n|0,hM(t[(pM(e)|0)>>2]|0,n)|0}function pM(e){return e=e|0,(t[(B4()|0)+24>>2]|0)+(e<<3)|0}function hM(e,n){e=e|0,n=n|0;var r=0,o=0;return r=h,h=h+16|0,o=r,Ml(o,n),n=Fl(o,n)|0,n=ea(dc[e&31](n)|0)|0,h=r,n|0}function mM(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0;l=t[e>>2]|0,s=j4()|0,e=vM(r)|0,ur(l,n,s,e,gM(r,o)|0,o)}function j4(){var e=0,n=0;if(c[8056]|0||(I8(10932),Bt(67,10932,Q|0)|0,n=8056,t[n>>2]=1,t[n+4>>2]=0),!(Dn(10932)|0)){e=10932,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));I8(10932)}return 10932}function vM(e){return e=e|0,e|0}function gM(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0;return _=h,h=h+16|0,s=_,l=_+4|0,t[s>>2]=e,y=j4()|0,d=y+24|0,n=Lt(n,4)|0,t[l>>2]=n,r=y+28|0,o=t[r>>2]|0,o>>>0<(t[y+32>>2]|0)>>>0?(O8(o,e,n),n=(t[r>>2]|0)+8|0,t[r>>2]=n):(_M(d,s,l),n=t[r>>2]|0),h=_,(n-(t[d>>2]|0)>>3)+-1|0}function O8(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,t[e+4>>2]=r}function _M(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0;if(_=h,h=h+32|0,s=_,l=e+4|0,d=((t[l>>2]|0)-(t[e>>2]|0)>>3)+1|0,o=yM(e)|0,o>>>0<d>>>0)$n(e);else{y=t[e>>2]|0,T=(t[e+8>>2]|0)-y|0,k=T>>2,wM(s,T>>3>>>0<o>>>1>>>0?k>>>0<d>>>0?d:k:o,(t[l>>2]|0)-y>>3,e+8|0),d=s+8|0,O8(t[d>>2]|0,t[n>>2]|0,t[r>>2]|0),t[d>>2]=(t[d>>2]|0)+8,DM(e,s),EM(s),h=_;return}}function yM(e){return e=e|0,536870911}function wM(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>536870911)_n();else{s=Tt(n<<3)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r<<3)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n<<3)}function DM(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(0-(s>>3)<<3)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function EM(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~((o+-8-n|0)>>>3)<<3)),e=t[e>>2]|0,e|0&&Ve(e)}function I8(e){e=e|0,TM(e)}function SM(e){e=e|0,CM(e+24|0)}function CM(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function TM(e){e=e|0;var n=0;n=An()|0,Nn(e,1,7,n,xM()|0,2),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function xM(){return 1860}function kM(e,n,r){return e=e|0,n=n|0,r=r|0,OM(t[(AM(e)|0)>>2]|0,n,r)|0}function AM(e){return e=e|0,(t[(j4()|0)+24>>2]|0)+(e<<3)|0}function OM(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0;return o=h,h=h+32|0,d=o+12|0,l=o+8|0,_=o,y=o+16|0,s=o+4|0,IM(y,n),PM(_,y,n),$s(s,r),r=Ks(s,r)|0,t[d>>2]=t[_>>2],X1[e&15](l,d,r),r=MM(l)|0,ei(l),Xs(s),h=o,r|0}function IM(e,n){e=e|0,n=n|0}function PM(e,n,r){e=e|0,n=n|0,r=r|0,FM(e,r)}function MM(e){return e=e|0,Oi(e)|0}function FM(e,n){e=e|0,n=n|0;var r=0,o=0,s=0;s=h,h=h+16|0,r=s,o=n,o&1?(LM(r,0),c0(o|0,r|0)|0,RM(e,r),NM(r)):t[e>>2]=t[n>>2],h=s}function LM(e,n){e=e|0,n=n|0,wd(e,n),t[e+4>>2]=0,c[e+8>>0]=0}function RM(e,n){e=e|0,n=n|0,t[e>>2]=t[n+4>>2]}function NM(e){e=e|0,c[e+8>>0]=0}function BM(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0;l=t[e>>2]|0,s=U4()|0,e=jM(r)|0,ur(l,n,s,e,UM(r,o)|0,o)}function U4(){var e=0,n=0;if(c[8064]|0||(M8(10968),Bt(68,10968,Q|0)|0,n=8064,t[n>>2]=1,t[n+4>>2]=0),!(Dn(10968)|0)){e=10968,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));M8(10968)}return 10968}function jM(e){return e=e|0,e|0}function UM(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0;return _=h,h=h+16|0,s=_,l=_+4|0,t[s>>2]=e,y=U4()|0,d=y+24|0,n=Lt(n,4)|0,t[l>>2]=n,r=y+28|0,o=t[r>>2]|0,o>>>0<(t[y+32>>2]|0)>>>0?(P8(o,e,n),n=(t[r>>2]|0)+8|0,t[r>>2]=n):(qM(d,s,l),n=t[r>>2]|0),h=_,(n-(t[d>>2]|0)>>3)+-1|0}function P8(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,t[e+4>>2]=r}function qM(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0;if(_=h,h=h+32|0,s=_,l=e+4|0,d=((t[l>>2]|0)-(t[e>>2]|0)>>3)+1|0,o=zM(e)|0,o>>>0<d>>>0)$n(e);else{y=t[e>>2]|0,T=(t[e+8>>2]|0)-y|0,k=T>>2,WM(s,T>>3>>>0<o>>>1>>>0?k>>>0<d>>>0?d:k:o,(t[l>>2]|0)-y>>3,e+8|0),d=s+8|0,P8(t[d>>2]|0,t[n>>2]|0,t[r>>2]|0),t[d>>2]=(t[d>>2]|0)+8,HM(e,s),bM(s),h=_;return}}function zM(e){return e=e|0,536870911}function WM(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>536870911)_n();else{s=Tt(n<<3)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r<<3)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n<<3)}function HM(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(0-(s>>3)<<3)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function bM(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~((o+-8-n|0)>>>3)<<3)),e=t[e>>2]|0,e|0&&Ve(e)}function M8(e){e=e|0,YM(e)}function GM(e){e=e|0,VM(e+24|0)}function VM(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function YM(e){e=e|0;var n=0;n=An()|0,Nn(e,1,1,n,$M()|0,5),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function $M(){return 1872}function KM(e,n,r,o,s,l){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0,JM(t[(XM(e)|0)>>2]|0,n,r,o,s,l)}function XM(e){return e=e|0,(t[(U4()|0)+24>>2]|0)+(e<<3)|0}function JM(e,n,r,o,s,l){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0;var d=0,_=0,y=0,k=0,T=0,P=0;d=h,h=h+32|0,_=d+16|0,y=d+12|0,k=d+8|0,T=d+4|0,P=d,$s(_,n),n=Ks(_,n)|0,$s(y,r),r=Ks(y,r)|0,$s(k,o),o=Ks(k,o)|0,$s(T,s),s=Ks(T,s)|0,$s(P,l),l=Ks(P,l)|0,eD[e&1](n,r,o,s,l),Xs(P),Xs(T),Xs(k),Xs(y),Xs(_),h=d}function QM(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0;l=t[e>>2]|0,s=q4()|0,e=ZM(r)|0,ur(l,n,s,e,eF(r,o)|0,o)}function q4(){var e=0,n=0;if(c[8072]|0||(L8(11004),Bt(69,11004,Q|0)|0,n=8072,t[n>>2]=1,t[n+4>>2]=0),!(Dn(11004)|0)){e=11004,n=e+36|0;do t[e>>2]=0,e=e+4|0;while((e|0)<(n|0));L8(11004)}return 11004}function ZM(e){return e=e|0,e|0}function eF(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0,_=0,y=0;return _=h,h=h+16|0,s=_,l=_+4|0,t[s>>2]=e,y=q4()|0,d=y+24|0,n=Lt(n,4)|0,t[l>>2]=n,r=y+28|0,o=t[r>>2]|0,o>>>0<(t[y+32>>2]|0)>>>0?(F8(o,e,n),n=(t[r>>2]|0)+8|0,t[r>>2]=n):(tF(d,s,l),n=t[r>>2]|0),h=_,(n-(t[d>>2]|0)>>3)+-1|0}function F8(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,t[e+4>>2]=r}function tF(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0;if(_=h,h=h+32|0,s=_,l=e+4|0,d=((t[l>>2]|0)-(t[e>>2]|0)>>3)+1|0,o=nF(e)|0,o>>>0<d>>>0)$n(e);else{y=t[e>>2]|0,T=(t[e+8>>2]|0)-y|0,k=T>>2,rF(s,T>>3>>>0<o>>>1>>>0?k>>>0<d>>>0?d:k:o,(t[l>>2]|0)-y>>3,e+8|0),d=s+8|0,F8(t[d>>2]|0,t[n>>2]|0,t[r>>2]|0),t[d>>2]=(t[d>>2]|0)+8,iF(e,s),oF(s),h=_;return}}function nF(e){return e=e|0,536870911}function rF(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0;t[e+12>>2]=0,t[e+16>>2]=o;do if(n)if(n>>>0>536870911)_n();else{s=Tt(n<<3)|0;break}else s=0;while(0);t[e>>2]=s,o=s+(r<<3)|0,t[e+8>>2]=o,t[e+4>>2]=o,t[e+12>>2]=s+(n<<3)}function iF(e,n){e=e|0,n=n|0;var r=0,o=0,s=0,l=0,d=0;o=t[e>>2]|0,d=e+4|0,l=n+4|0,s=(t[d>>2]|0)-o|0,r=(t[l>>2]|0)+(0-(s>>3)<<3)|0,t[l>>2]=r,(s|0)>0?(vn(r|0,o|0,s|0)|0,o=l,r=t[l>>2]|0):o=l,l=t[e>>2]|0,t[e>>2]=r,t[o>>2]=l,l=n+8|0,s=t[d>>2]|0,t[d>>2]=t[l>>2],t[l>>2]=s,l=e+8|0,d=n+12|0,e=t[l>>2]|0,t[l>>2]=t[d>>2],t[d>>2]=e,t[n>>2]=t[o>>2]}function oF(e){e=e|0;var n=0,r=0,o=0;n=t[e+4>>2]|0,r=e+8|0,o=t[r>>2]|0,(o|0)!=(n|0)&&(t[r>>2]=o+(~((o+-8-n|0)>>>3)<<3)),e=t[e>>2]|0,e|0&&Ve(e)}function L8(e){e=e|0,lF(e)}function uF(e){e=e|0,sF(e+24|0)}function sF(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function lF(e){e=e|0;var n=0;n=An()|0,Nn(e,1,12,n,fF()|0,2),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function fF(){return 1896}function cF(e,n,r){e=e|0,n=n|0,r=r|0,dF(t[(aF(e)|0)>>2]|0,n,r)}function aF(e){return e=e|0,(t[(q4()|0)+24>>2]|0)+(e<<3)|0}function dF(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0;o=h,h=h+16|0,l=o+4|0,s=o,pF(l,n),n=hF(l,n)|0,$s(s,r),r=Ks(s,r)|0,Bl[e&31](n,r),Xs(s),h=o}function pF(e,n){e=e|0,n=n|0}function hF(e,n){return e=e|0,n=n|0,mF(n)|0}function mF(e){return e=e|0,e|0}function vF(){var e=0;return c[8080]|0||(R8(11040),Bt(70,11040,Q|0)|0,e=8080,t[e>>2]=1,t[e+4>>2]=0),Dn(11040)|0||R8(11040),11040}function R8(e){e=e|0,yF(e),sc(e,71)}function gF(e){e=e|0,_F(e+24|0)}function _F(e){e=e|0;var n=0,r=0,o=0;r=t[e>>2]|0,o=r,r|0&&(e=e+4|0,n=t[e>>2]|0,(n|0)!=(r|0)&&(t[e>>2]=n+(~((n+-8-o|0)>>>3)<<3)),Ve(r))}function yF(e){e=e|0;var n=0;n=An()|0,Nn(e,5,7,n,SF()|0,0),t[e+24>>2]=0,t[e+28>>2]=0,t[e+32>>2]=0}function wF(e){e=e|0,DF(e)}function DF(e){e=e|0,EF(e)}function EF(e){e=e|0,c[e+8>>0]=1}function SF(){return 1936}function CF(){return TF()|0}function TF(){var e=0,n=0,r=0,o=0,s=0,l=0,d=0;return n=h,h=h+16|0,s=n+4|0,d=n,r=Qo(8)|0,e=r,l=e+4|0,t[l>>2]=Tt(1)|0,o=Tt(8)|0,l=t[l>>2]|0,t[d>>2]=0,t[s>>2]=t[d>>2],xF(o,l,s),t[r>>2]=o,h=n,e|0}function xF(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]=n,r=Tt(16)|0,t[r+4>>2]=0,t[r+8>>2]=0,t[r>>2]=1916,t[r+12>>2]=n,t[e+4>>2]=r}function kF(e){e=e|0,da(e),Ve(e)}function AF(e){e=e|0,e=t[e+12>>2]|0,e|0&&Ve(e)}function OF(e){e=e|0,Ve(e)}function IF(){var e=0;return c[8088]|0||(BF(11076),Bt(25,11076,Q|0)|0,e=8088,t[e>>2]=1,t[e+4>>2]=0),11076}function PF(e,n){e=e|0,n=n|0,t[e>>2]=MF()|0,t[e+4>>2]=FF()|0,t[e+12>>2]=n,t[e+8>>2]=LF()|0,t[e+32>>2]=10}function MF(){return 11745}function FF(){return 1940}function LF(){return eh()|0}function RF(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0,(Sf(o,896)|0)==512?r|0&&(NF(r),Ve(r)):n|0&&Ve(n)}function NF(e){e=e|0,e=t[e+4>>2]|0,e|0&&Tf(e)}function BF(e){e=e|0,Ys(e)}function os(e,n){e=e|0,n=n|0,t[e>>2]=n}function z4(e){return e=e|0,t[e>>2]|0}function jF(e){return e=e|0,c[t[e>>2]>>0]|0}function UF(e,n){e=e|0,n=n|0;var r=0,o=0;r=h,h=h+16|0,o=r,t[o>>2]=t[e>>2],qF(n,o)|0,h=r}function qF(e,n){e=e|0,n=n|0;var r=0;return r=zF(t[e>>2]|0,n)|0,n=e+4|0,t[(t[n>>2]|0)+8>>2]=r,t[(t[n>>2]|0)+8>>2]|0}function zF(e,n){e=e|0,n=n|0;var r=0,o=0;return r=h,h=h+16|0,o=r,Zo(o),e=Oi(e)|0,n=WF(e,t[n>>2]|0)|0,eu(o),h=r,n|0}function Zo(e){e=e|0,t[e>>2]=t[2701],t[e+4>>2]=t[2703]}function WF(e,n){e=e|0,n=n|0;var r=0;return r=ko(HF()|0)|0,sf(0,r|0,e|0,L4(n)|0)|0}function eu(e){e=e|0,C8(t[e>>2]|0,t[e+4>>2]|0)}function HF(){var e=0;return c[8096]|0||(bF(11120),e=8096,t[e>>2]=1,t[e+4>>2]=0),11120}function bF(e){e=e|0,Ao(e,GF()|0,1)}function GF(){return 1948}function VF(){YF()}function YF(){var e=0,n=0,r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0,we=0,le=0,ie=0;if(le=h,h=h+16|0,T=le+4|0,P=le,si(65536,10804,t[2702]|0,10812),r=o8()|0,n=t[r>>2]|0,e=t[n>>2]|0,e|0)for(o=t[r+8>>2]|0,r=t[r+4>>2]|0;As(e|0,C[r>>0]|0|0,c[o>>0]|0),n=n+4|0,e=t[n>>2]|0,e;)o=o+1|0,r=r+1|0;if(e=u8()|0,n=t[e>>2]|0,n|0)do uu(n|0,t[e+4>>2]|0),e=e+8|0,n=t[e>>2]|0;while((n|0)!=0);uu($F()|0,5167),k=sa()|0,e=t[k>>2]|0;e:do if(e|0){do KF(t[e+4>>2]|0),e=t[e>>2]|0;while((e|0)!=0);if(e=t[k>>2]|0,e|0){y=k;do{for(;s=e,e=t[e>>2]|0,s=t[s+4>>2]|0,!!(XF(s)|0);)if(t[P>>2]=y,t[T>>2]=t[P>>2],JF(k,T)|0,!e)break e;if(QF(s),y=t[y>>2]|0,n=N8(s)|0,l=Wo()|0,d=h,h=h+((1*(n<<2)|0)+15&-16)|0,_=h,h=h+((1*(n<<2)|0)+15&-16)|0,n=t[(_8(s)|0)>>2]|0,n|0)for(r=d,o=_;t[r>>2]=t[(la(t[n+4>>2]|0)|0)>>2],t[o>>2]=t[n+8>>2],n=t[n>>2]|0,n;)r=r+4|0,o=o+4|0;ie=la(s)|0,n=ZF(s)|0,r=N8(s)|0,o=eL(s)|0,Is(ie|0,n|0,d|0,_|0,r|0,o|0,A4(s)|0),b0(l|0)}while((e|0)!=0)}}while(0);if(e=t[(O4()|0)>>2]|0,e|0)do ie=e+4|0,k=I4(ie)|0,s=V1(k)|0,l=b1(k)|0,d=(G1(k)|0)+1|0,_=oh(k)|0,y=B8(ie)|0,k=Dn(k)|0,T=nh(ie)|0,P=W4(ie)|0,zo(0,s|0,l|0,d|0,_|0,y|0,k|0,T|0,P|0,H4(ie)|0),e=t[e>>2]|0;while((e|0)!=0);e=t[(sa()|0)>>2]|0;e:do if(e|0){t:for(;;){if(n=t[e+4>>2]|0,n|0?(q=t[(la(n)|0)>>2]|0,we=t[(y8(n)|0)>>2]|0,we|0):0){r=we;do{n=r+4|0,o=I4(n)|0;n:do if(o|0)switch(Dn(o)|0){case 0:break t;case 4:case 3:case 2:{_=V1(o)|0,y=b1(o)|0,k=(G1(o)|0)+1|0,T=oh(o)|0,P=Dn(o)|0,ie=nh(n)|0,zo(q|0,_|0,y|0,k|0,T|0,0,P|0,ie|0,W4(n)|0,H4(n)|0);break n}case 1:{d=V1(o)|0,_=b1(o)|0,y=(G1(o)|0)+1|0,k=oh(o)|0,T=B8(n)|0,P=Dn(o)|0,ie=nh(n)|0,zo(q|0,d|0,_|0,y|0,k|0,T|0,P|0,ie|0,W4(n)|0,H4(n)|0);break n}case 5:{k=V1(o)|0,T=b1(o)|0,P=(G1(o)|0)+1|0,ie=oh(o)|0,zo(q|0,k|0,T|0,P|0,ie|0,tL(o)|0,Dn(o)|0,0,0,0);break n}default:break n}while(0);r=t[r>>2]|0}while((r|0)!=0)}if(e=t[e>>2]|0,!e)break e}_n()}while(0);uf(),h=le}function $F(){return 11703}function KF(e){e=e|0,c[e+40>>0]=0}function XF(e){return e=e|0,(c[e+40>>0]|0)!=0|0}function JF(e,n){return e=e|0,n=n|0,n=nL(n)|0,e=t[n>>2]|0,t[n>>2]=t[e>>2],Ve(e),t[n>>2]|0}function QF(e){e=e|0,c[e+40>>0]=1}function N8(e){return e=e|0,t[e+20>>2]|0}function ZF(e){return e=e|0,t[e+8>>2]|0}function eL(e){return e=e|0,t[e+32>>2]|0}function oh(e){return e=e|0,t[e+4>>2]|0}function B8(e){return e=e|0,t[e+4>>2]|0}function W4(e){return e=e|0,t[e+8>>2]|0}function H4(e){return e=e|0,t[e+16>>2]|0}function tL(e){return e=e|0,t[e+20>>2]|0}function nL(e){return e=e|0,t[e>>2]|0}function uh(e){e=e|0;var n=0,r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0,we=0,le=0,ie=0,Pe=0,ke=0,qe=0,pe=0,_e=0,vt=0;vt=h,h=h+16|0,q=vt;do if(e>>>0<245){if(k=e>>>0<11?16:e+11&-8,e=k>>>3,P=t[2783]|0,r=P>>>e,r&3|0)return n=(r&1^1)+e|0,e=11172+(n<<1<<2)|0,r=e+8|0,o=t[r>>2]|0,s=o+8|0,l=t[s>>2]|0,(e|0)==(l|0)?t[2783]=P&~(1<<n):(t[l+12>>2]=e,t[r>>2]=l),_e=n<<3,t[o+4>>2]=_e|3,_e=o+_e+4|0,t[_e>>2]=t[_e>>2]|1,_e=s,h=vt,_e|0;if(T=t[2785]|0,k>>>0>T>>>0){if(r|0)return n=2<<e,n=r<<e&(n|0-n),n=(n&0-n)+-1|0,d=n>>>12&16,n=n>>>d,r=n>>>5&8,n=n>>>r,s=n>>>2&4,n=n>>>s,e=n>>>1&2,n=n>>>e,o=n>>>1&1,o=(r|d|s|e|o)+(n>>>o)|0,n=11172+(o<<1<<2)|0,e=n+8|0,s=t[e>>2]|0,d=s+8|0,r=t[d>>2]|0,(n|0)==(r|0)?(e=P&~(1<<o),t[2783]=e):(t[r+12>>2]=n,t[e>>2]=r,e=P),l=(o<<3)-k|0,t[s+4>>2]=k|3,o=s+k|0,t[o+4>>2]=l|1,t[o+l>>2]=l,T|0&&(s=t[2788]|0,n=T>>>3,r=11172+(n<<1<<2)|0,n=1<<n,e&n?(e=r+8|0,n=t[e>>2]|0):(t[2783]=e|n,n=r,e=r+8|0),t[e>>2]=s,t[n+12>>2]=s,t[s+8>>2]=n,t[s+12>>2]=r),t[2785]=l,t[2788]=o,_e=d,h=vt,_e|0;if(_=t[2784]|0,_){if(r=(_&0-_)+-1|0,d=r>>>12&16,r=r>>>d,l=r>>>5&8,r=r>>>l,y=r>>>2&4,r=r>>>y,o=r>>>1&2,r=r>>>o,e=r>>>1&1,e=t[11436+((l|d|y|o|e)+(r>>>e)<<2)>>2]|0,r=(t[e+4>>2]&-8)-k|0,o=t[e+16+(((t[e+16>>2]|0)==0&1)<<2)>>2]|0,!o)y=e,l=r;else{do d=(t[o+4>>2]&-8)-k|0,y=d>>>0<r>>>0,r=y?d:r,e=y?o:e,o=t[o+16+(((t[o+16>>2]|0)==0&1)<<2)>>2]|0;while((o|0)!=0);y=e,l=r}if(d=y+k|0,y>>>0<d>>>0){s=t[y+24>>2]|0,n=t[y+12>>2]|0;do if((n|0)==(y|0)){if(e=y+20|0,n=t[e>>2]|0,!n&&(e=y+16|0,n=t[e>>2]|0,!n)){r=0;break}for(;;){if(r=n+20|0,o=t[r>>2]|0,o|0){n=o,e=r;continue}if(r=n+16|0,o=t[r>>2]|0,o)n=o,e=r;else break}t[e>>2]=0,r=n}else r=t[y+8>>2]|0,t[r+12>>2]=n,t[n+8>>2]=r,r=n;while(0);do if(s|0){if(n=t[y+28>>2]|0,e=11436+(n<<2)|0,(y|0)==(t[e>>2]|0)){if(t[e>>2]=r,!r){t[2784]=_&~(1<<n);break}}else if(t[s+16+(((t[s+16>>2]|0)!=(y|0)&1)<<2)>>2]=r,!r)break;t[r+24>>2]=s,n=t[y+16>>2]|0,n|0&&(t[r+16>>2]=n,t[n+24>>2]=r),n=t[y+20>>2]|0,n|0&&(t[r+20>>2]=n,t[n+24>>2]=r)}while(0);return l>>>0<16?(_e=l+k|0,t[y+4>>2]=_e|3,_e=y+_e+4|0,t[_e>>2]=t[_e>>2]|1):(t[y+4>>2]=k|3,t[d+4>>2]=l|1,t[d+l>>2]=l,T|0&&(o=t[2788]|0,n=T>>>3,r=11172+(n<<1<<2)|0,n=1<<n,P&n?(e=r+8|0,n=t[e>>2]|0):(t[2783]=P|n,n=r,e=r+8|0),t[e>>2]=o,t[n+12>>2]=o,t[o+8>>2]=n,t[o+12>>2]=r),t[2785]=l,t[2788]=d),_e=y+8|0,h=vt,_e|0}else P=k}else P=k}else P=k}else if(e>>>0<=4294967231)if(e=e+11|0,k=e&-8,y=t[2784]|0,y){o=0-k|0,e=e>>>8,e?k>>>0>16777215?_=31:(P=(e+1048320|0)>>>16&8,pe=e<<P,T=(pe+520192|0)>>>16&4,pe=pe<<T,_=(pe+245760|0)>>>16&2,_=14-(T|P|_)+(pe<<_>>>15)|0,_=k>>>(_+7|0)&1|_<<1):_=0,r=t[11436+(_<<2)>>2]|0;e:do if(!r)r=0,e=0,pe=57;else for(e=0,d=k<<((_|0)==31?0:25-(_>>>1)|0),l=0;;){if(s=(t[r+4>>2]&-8)-k|0,s>>>0<o>>>0)if(s)e=r,o=s;else{e=r,o=0,s=r,pe=61;break e}if(s=t[r+20>>2]|0,r=t[r+16+(d>>>31<<2)>>2]|0,l=(s|0)==0|(s|0)==(r|0)?l:s,s=(r|0)==0,s){r=l,pe=57;break}else d=d<<((s^1)&1)}while(0);if((pe|0)==57){if((r|0)==0&(e|0)==0){if(e=2<<_,e=y&(e|0-e),!e){P=k;break}P=(e&0-e)+-1|0,d=P>>>12&16,P=P>>>d,l=P>>>5&8,P=P>>>l,_=P>>>2&4,P=P>>>_,T=P>>>1&2,P=P>>>T,r=P>>>1&1,e=0,r=t[11436+((l|d|_|T|r)+(P>>>r)<<2)>>2]|0}r?(s=r,pe=61):(_=e,d=o)}if((pe|0)==61)for(;;)if(pe=0,r=(t[s+4>>2]&-8)-k|0,P=r>>>0<o>>>0,r=P?r:o,e=P?s:e,s=t[s+16+(((t[s+16>>2]|0)==0&1)<<2)>>2]|0,s)o=r,pe=61;else{_=e,d=r;break}if((_|0)!=0?d>>>0<((t[2785]|0)-k|0)>>>0:0){if(l=_+k|0,_>>>0>=l>>>0)return _e=0,h=vt,_e|0;s=t[_+24>>2]|0,n=t[_+12>>2]|0;do if((n|0)==(_|0)){if(e=_+20|0,n=t[e>>2]|0,!n&&(e=_+16|0,n=t[e>>2]|0,!n)){n=0;break}for(;;){if(r=n+20|0,o=t[r>>2]|0,o|0){n=o,e=r;continue}if(r=n+16|0,o=t[r>>2]|0,o)n=o,e=r;else break}t[e>>2]=0}else _e=t[_+8>>2]|0,t[_e+12>>2]=n,t[n+8>>2]=_e;while(0);do if(s){if(e=t[_+28>>2]|0,r=11436+(e<<2)|0,(_|0)==(t[r>>2]|0)){if(t[r>>2]=n,!n){o=y&~(1<<e),t[2784]=o;break}}else if(t[s+16+(((t[s+16>>2]|0)!=(_|0)&1)<<2)>>2]=n,!n){o=y;break}t[n+24>>2]=s,e=t[_+16>>2]|0,e|0&&(t[n+16>>2]=e,t[e+24>>2]=n),e=t[_+20>>2]|0,e&&(t[n+20>>2]=e,t[e+24>>2]=n),o=y}else o=y;while(0);do if(d>>>0>=16){if(t[_+4>>2]=k|3,t[l+4>>2]=d|1,t[l+d>>2]=d,n=d>>>3,d>>>0<256){r=11172+(n<<1<<2)|0,e=t[2783]|0,n=1<<n,e&n?(e=r+8|0,n=t[e>>2]|0):(t[2783]=e|n,n=r,e=r+8|0),t[e>>2]=l,t[n+12>>2]=l,t[l+8>>2]=n,t[l+12>>2]=r;break}if(n=d>>>8,n?d>>>0>16777215?n=31:(pe=(n+1048320|0)>>>16&8,_e=n<<pe,qe=(_e+520192|0)>>>16&4,_e=_e<<qe,n=(_e+245760|0)>>>16&2,n=14-(qe|pe|n)+(_e<<n>>>15)|0,n=d>>>(n+7|0)&1|n<<1):n=0,r=11436+(n<<2)|0,t[l+28>>2]=n,e=l+16|0,t[e+4>>2]=0,t[e>>2]=0,e=1<<n,!(o&e)){t[2784]=o|e,t[r>>2]=l,t[l+24>>2]=r,t[l+12>>2]=l,t[l+8>>2]=l;break}for(e=d<<((n|0)==31?0:25-(n>>>1)|0),r=t[r>>2]|0;;){if((t[r+4>>2]&-8|0)==(d|0)){pe=97;break}if(o=r+16+(e>>>31<<2)|0,n=t[o>>2]|0,n)e=e<<1,r=n;else{pe=96;break}}if((pe|0)==96){t[o>>2]=l,t[l+24>>2]=r,t[l+12>>2]=l,t[l+8>>2]=l;break}else if((pe|0)==97){pe=r+8|0,_e=t[pe>>2]|0,t[_e+12>>2]=l,t[pe>>2]=l,t[l+8>>2]=_e,t[l+12>>2]=r,t[l+24>>2]=0;break}}else _e=d+k|0,t[_+4>>2]=_e|3,_e=_+_e+4|0,t[_e>>2]=t[_e>>2]|1;while(0);return _e=_+8|0,h=vt,_e|0}else P=k}else P=k;else P=-1;while(0);if(r=t[2785]|0,r>>>0>=P>>>0)return n=r-P|0,e=t[2788]|0,n>>>0>15?(_e=e+P|0,t[2788]=_e,t[2785]=n,t[_e+4>>2]=n|1,t[_e+n>>2]=n,t[e+4>>2]=P|3):(t[2785]=0,t[2788]=0,t[e+4>>2]=r|3,_e=e+r+4|0,t[_e>>2]=t[_e>>2]|1),_e=e+8|0,h=vt,_e|0;if(d=t[2786]|0,d>>>0>P>>>0)return qe=d-P|0,t[2786]=qe,_e=t[2789]|0,pe=_e+P|0,t[2789]=pe,t[pe+4>>2]=qe|1,t[_e+4>>2]=P|3,_e=_e+8|0,h=vt,_e|0;if(t[2901]|0?e=t[2903]|0:(t[2903]=4096,t[2902]=4096,t[2904]=-1,t[2905]=-1,t[2906]=0,t[2894]=0,e=q&-16^1431655768,t[q>>2]=e,t[2901]=e,e=4096),_=P+48|0,y=P+47|0,l=e+y|0,s=0-e|0,k=l&s,k>>>0<=P>>>0||(e=t[2893]|0,e|0?(T=t[2891]|0,q=T+k|0,q>>>0<=T>>>0|q>>>0>e>>>0):0))return _e=0,h=vt,_e|0;e:do if(t[2894]&4)n=0,pe=133;else{r=t[2789]|0;t:do if(r){for(o=11580;e=t[o>>2]|0,!(e>>>0<=r>>>0?(ie=o+4|0,(e+(t[ie>>2]|0)|0)>>>0>r>>>0):0);)if(e=t[o+8>>2]|0,e)o=e;else{pe=118;break t}if(n=l-d&s,n>>>0<2147483647)if(e=xf(n|0)|0,(e|0)==((t[o>>2]|0)+(t[ie>>2]|0)|0)){if((e|0)!=(-1|0)){d=n,l=e,pe=135;break e}}else o=e,pe=126;else n=0}else pe=118;while(0);do if((pe|0)==118)if(r=xf(0)|0,(r|0)!=(-1|0)?(n=r,we=t[2902]|0,le=we+-1|0,n=((le&n|0)==0?0:(le+n&0-we)-n|0)+k|0,we=t[2891]|0,le=n+we|0,n>>>0>P>>>0&n>>>0<2147483647):0){if(ie=t[2893]|0,ie|0?le>>>0<=we>>>0|le>>>0>ie>>>0:0){n=0;break}if(e=xf(n|0)|0,(e|0)==(r|0)){d=n,l=r,pe=135;break e}else o=e,pe=126}else n=0;while(0);do if((pe|0)==126){if(r=0-n|0,!(_>>>0>n>>>0&(n>>>0<2147483647&(o|0)!=(-1|0))))if((o|0)==(-1|0)){n=0;break}else{d=n,l=o,pe=135;break e}if(e=t[2903]|0,e=y-n+e&0-e,e>>>0>=2147483647){d=n,l=o,pe=135;break e}if((xf(e|0)|0)==(-1|0)){xf(r|0)|0,n=0;break}else{d=e+n|0,l=o,pe=135;break e}}while(0);t[2894]=t[2894]|4,pe=133}while(0);if((((pe|0)==133?k>>>0<2147483647:0)?(qe=xf(k|0)|0,ie=xf(0)|0,Pe=ie-qe|0,ke=Pe>>>0>(P+40|0)>>>0,!((qe|0)==(-1|0)|ke^1|qe>>>0<ie>>>0&((qe|0)!=(-1|0)&(ie|0)!=(-1|0))^1)):0)&&(d=ke?Pe:n,l=qe,pe=135),(pe|0)==135){n=(t[2891]|0)+d|0,t[2891]=n,n>>>0>(t[2892]|0)>>>0&&(t[2892]=n),y=t[2789]|0;do if(y){for(n=11580;;){if(e=t[n>>2]|0,r=n+4|0,o=t[r>>2]|0,(l|0)==(e+o|0)){pe=145;break}if(s=t[n+8>>2]|0,s)n=s;else break}if(((pe|0)==145?(t[n+12>>2]&8|0)==0:0)?y>>>0<l>>>0&y>>>0>=e>>>0:0){t[r>>2]=o+d,_e=y+8|0,_e=(_e&7|0)==0?0:0-_e&7,pe=y+_e|0,_e=(t[2786]|0)+(d-_e)|0,t[2789]=pe,t[2786]=_e,t[pe+4>>2]=_e|1,t[pe+_e+4>>2]=40,t[2790]=t[2905];break}for(l>>>0<(t[2787]|0)>>>0&&(t[2787]=l),r=l+d|0,n=11580;;){if((t[n>>2]|0)==(r|0)){pe=153;break}if(e=t[n+8>>2]|0,e)n=e;else break}if((pe|0)==153?(t[n+12>>2]&8|0)==0:0){t[n>>2]=l,T=n+4|0,t[T>>2]=(t[T>>2]|0)+d,T=l+8|0,T=l+((T&7|0)==0?0:0-T&7)|0,n=r+8|0,n=r+((n&7|0)==0?0:0-n&7)|0,k=T+P|0,_=n-T-P|0,t[T+4>>2]=P|3;do if((n|0)!=(y|0)){if((n|0)==(t[2788]|0)){_e=(t[2785]|0)+_|0,t[2785]=_e,t[2788]=k,t[k+4>>2]=_e|1,t[k+_e>>2]=_e;break}if(e=t[n+4>>2]|0,(e&3|0)==1){d=e&-8,o=e>>>3;e:do if(e>>>0<256)if(e=t[n+8>>2]|0,r=t[n+12>>2]|0,(r|0)==(e|0)){t[2783]=t[2783]&~(1<<o);break}else{t[e+12>>2]=r,t[r+8>>2]=e;break}else{l=t[n+24>>2]|0,e=t[n+12>>2]|0;do if((e|0)==(n|0)){if(o=n+16|0,r=o+4|0,e=t[r>>2]|0,!e)if(e=t[o>>2]|0,e)r=o;else{e=0;break}for(;;){if(o=e+20|0,s=t[o>>2]|0,s|0){e=s,r=o;continue}if(o=e+16|0,s=t[o>>2]|0,s)e=s,r=o;else break}t[r>>2]=0}else _e=t[n+8>>2]|0,t[_e+12>>2]=e,t[e+8>>2]=_e;while(0);if(!l)break;r=t[n+28>>2]|0,o=11436+(r<<2)|0;do if((n|0)!=(t[o>>2]|0)){if(t[l+16+(((t[l+16>>2]|0)!=(n|0)&1)<<2)>>2]=e,!e)break e}else{if(t[o>>2]=e,e|0)break;t[2784]=t[2784]&~(1<<r);break e}while(0);if(t[e+24>>2]=l,r=n+16|0,o=t[r>>2]|0,o|0&&(t[e+16>>2]=o,t[o+24>>2]=e),r=t[r+4>>2]|0,!r)break;t[e+20>>2]=r,t[r+24>>2]=e}while(0);n=n+d|0,s=d+_|0}else s=_;if(n=n+4|0,t[n>>2]=t[n>>2]&-2,t[k+4>>2]=s|1,t[k+s>>2]=s,n=s>>>3,s>>>0<256){r=11172+(n<<1<<2)|0,e=t[2783]|0,n=1<<n,e&n?(e=r+8|0,n=t[e>>2]|0):(t[2783]=e|n,n=r,e=r+8|0),t[e>>2]=k,t[n+12>>2]=k,t[k+8>>2]=n,t[k+12>>2]=r;break}n=s>>>8;do if(!n)n=0;else{if(s>>>0>16777215){n=31;break}pe=(n+1048320|0)>>>16&8,_e=n<<pe,qe=(_e+520192|0)>>>16&4,_e=_e<<qe,n=(_e+245760|0)>>>16&2,n=14-(qe|pe|n)+(_e<<n>>>15)|0,n=s>>>(n+7|0)&1|n<<1}while(0);if(o=11436+(n<<2)|0,t[k+28>>2]=n,e=k+16|0,t[e+4>>2]=0,t[e>>2]=0,e=t[2784]|0,r=1<<n,!(e&r)){t[2784]=e|r,t[o>>2]=k,t[k+24>>2]=o,t[k+12>>2]=k,t[k+8>>2]=k;break}for(e=s<<((n|0)==31?0:25-(n>>>1)|0),r=t[o>>2]|0;;){if((t[r+4>>2]&-8|0)==(s|0)){pe=194;break}if(o=r+16+(e>>>31<<2)|0,n=t[o>>2]|0,n)e=e<<1,r=n;else{pe=193;break}}if((pe|0)==193){t[o>>2]=k,t[k+24>>2]=r,t[k+12>>2]=k,t[k+8>>2]=k;break}else if((pe|0)==194){pe=r+8|0,_e=t[pe>>2]|0,t[_e+12>>2]=k,t[pe>>2]=k,t[k+8>>2]=_e,t[k+12>>2]=r,t[k+24>>2]=0;break}}else _e=(t[2786]|0)+_|0,t[2786]=_e,t[2789]=k,t[k+4>>2]=_e|1;while(0);return _e=T+8|0,h=vt,_e|0}for(n=11580;e=t[n>>2]|0,!(e>>>0<=y>>>0?(_e=e+(t[n+4>>2]|0)|0,_e>>>0>y>>>0):0);)n=t[n+8>>2]|0;s=_e+-47|0,e=s+8|0,e=s+((e&7|0)==0?0:0-e&7)|0,s=y+16|0,e=e>>>0<s>>>0?y:e,n=e+8|0,r=l+8|0,r=(r&7|0)==0?0:0-r&7,pe=l+r|0,r=d+-40-r|0,t[2789]=pe,t[2786]=r,t[pe+4>>2]=r|1,t[pe+r+4>>2]=40,t[2790]=t[2905],r=e+4|0,t[r>>2]=27,t[n>>2]=t[2895],t[n+4>>2]=t[2896],t[n+8>>2]=t[2897],t[n+12>>2]=t[2898],t[2895]=l,t[2896]=d,t[2898]=0,t[2897]=n,n=e+24|0;do pe=n,n=n+4|0,t[n>>2]=7;while((pe+8|0)>>>0<_e>>>0);if((e|0)!=(y|0)){if(l=e-y|0,t[r>>2]=t[r>>2]&-2,t[y+4>>2]=l|1,t[e>>2]=l,n=l>>>3,l>>>0<256){r=11172+(n<<1<<2)|0,e=t[2783]|0,n=1<<n,e&n?(e=r+8|0,n=t[e>>2]|0):(t[2783]=e|n,n=r,e=r+8|0),t[e>>2]=y,t[n+12>>2]=y,t[y+8>>2]=n,t[y+12>>2]=r;break}if(n=l>>>8,n?l>>>0>16777215?r=31:(pe=(n+1048320|0)>>>16&8,_e=n<<pe,qe=(_e+520192|0)>>>16&4,_e=_e<<qe,r=(_e+245760|0)>>>16&2,r=14-(qe|pe|r)+(_e<<r>>>15)|0,r=l>>>(r+7|0)&1|r<<1):r=0,o=11436+(r<<2)|0,t[y+28>>2]=r,t[y+20>>2]=0,t[s>>2]=0,n=t[2784]|0,e=1<<r,!(n&e)){t[2784]=n|e,t[o>>2]=y,t[y+24>>2]=o,t[y+12>>2]=y,t[y+8>>2]=y;break}for(e=l<<((r|0)==31?0:25-(r>>>1)|0),r=t[o>>2]|0;;){if((t[r+4>>2]&-8|0)==(l|0)){pe=216;break}if(o=r+16+(e>>>31<<2)|0,n=t[o>>2]|0,n)e=e<<1,r=n;else{pe=215;break}}if((pe|0)==215){t[o>>2]=y,t[y+24>>2]=r,t[y+12>>2]=y,t[y+8>>2]=y;break}else if((pe|0)==216){pe=r+8|0,_e=t[pe>>2]|0,t[_e+12>>2]=y,t[pe>>2]=y,t[y+8>>2]=_e,t[y+12>>2]=r,t[y+24>>2]=0;break}}}else{_e=t[2787]|0,(_e|0)==0|l>>>0<_e>>>0&&(t[2787]=l),t[2895]=l,t[2896]=d,t[2898]=0,t[2792]=t[2901],t[2791]=-1,n=0;do _e=11172+(n<<1<<2)|0,t[_e+12>>2]=_e,t[_e+8>>2]=_e,n=n+1|0;while((n|0)!=32);_e=l+8|0,_e=(_e&7|0)==0?0:0-_e&7,pe=l+_e|0,_e=d+-40-_e|0,t[2789]=pe,t[2786]=_e,t[pe+4>>2]=_e|1,t[pe+_e+4>>2]=40,t[2790]=t[2905]}while(0);if(n=t[2786]|0,n>>>0>P>>>0)return qe=n-P|0,t[2786]=qe,_e=t[2789]|0,pe=_e+P|0,t[2789]=pe,t[pe+4>>2]=qe|1,t[_e+4>>2]=P|3,_e=_e+8|0,h=vt,_e|0}return t[(ca()|0)>>2]=12,_e=0,h=vt,_e|0}function sh(e){e=e|0;var n=0,r=0,o=0,s=0,l=0,d=0,_=0,y=0;if(!!e){r=e+-8|0,s=t[2787]|0,e=t[e+-4>>2]|0,n=e&-8,y=r+n|0;do if(e&1)_=r,d=r;else{if(o=t[r>>2]|0,!(e&3)||(d=r+(0-o)|0,l=o+n|0,d>>>0<s>>>0))return;if((d|0)==(t[2788]|0)){if(e=y+4|0,n=t[e>>2]|0,(n&3|0)!=3){_=d,n=l;break}t[2785]=l,t[e>>2]=n&-2,t[d+4>>2]=l|1,t[d+l>>2]=l;return}if(r=o>>>3,o>>>0<256)if(e=t[d+8>>2]|0,n=t[d+12>>2]|0,(n|0)==(e|0)){t[2783]=t[2783]&~(1<<r),_=d,n=l;break}else{t[e+12>>2]=n,t[n+8>>2]=e,_=d,n=l;break}s=t[d+24>>2]|0,e=t[d+12>>2]|0;do if((e|0)==(d|0)){if(r=d+16|0,n=r+4|0,e=t[n>>2]|0,!e)if(e=t[r>>2]|0,e)n=r;else{e=0;break}for(;;){if(r=e+20|0,o=t[r>>2]|0,o|0){e=o,n=r;continue}if(r=e+16|0,o=t[r>>2]|0,o)e=o,n=r;else break}t[n>>2]=0}else _=t[d+8>>2]|0,t[_+12>>2]=e,t[e+8>>2]=_;while(0);if(s){if(n=t[d+28>>2]|0,r=11436+(n<<2)|0,(d|0)==(t[r>>2]|0)){if(t[r>>2]=e,!e){t[2784]=t[2784]&~(1<<n),_=d,n=l;break}}else if(t[s+16+(((t[s+16>>2]|0)!=(d|0)&1)<<2)>>2]=e,!e){_=d,n=l;break}t[e+24>>2]=s,n=d+16|0,r=t[n>>2]|0,r|0&&(t[e+16>>2]=r,t[r+24>>2]=e),n=t[n+4>>2]|0,n?(t[e+20>>2]=n,t[n+24>>2]=e,_=d,n=l):(_=d,n=l)}else _=d,n=l}while(0);if(!(d>>>0>=y>>>0)&&(e=y+4|0,o=t[e>>2]|0,!!(o&1))){if(o&2)t[e>>2]=o&-2,t[_+4>>2]=n|1,t[d+n>>2]=n,s=n;else{if(e=t[2788]|0,(y|0)==(t[2789]|0)){if(y=(t[2786]|0)+n|0,t[2786]=y,t[2789]=_,t[_+4>>2]=y|1,(_|0)!=(e|0))return;t[2788]=0,t[2785]=0;return}if((y|0)==(e|0)){y=(t[2785]|0)+n|0,t[2785]=y,t[2788]=d,t[_+4>>2]=y|1,t[d+y>>2]=y;return}s=(o&-8)+n|0,r=o>>>3;do if(o>>>0<256)if(n=t[y+8>>2]|0,e=t[y+12>>2]|0,(e|0)==(n|0)){t[2783]=t[2783]&~(1<<r);break}else{t[n+12>>2]=e,t[e+8>>2]=n;break}else{l=t[y+24>>2]|0,e=t[y+12>>2]|0;do if((e|0)==(y|0)){if(r=y+16|0,n=r+4|0,e=t[n>>2]|0,!e)if(e=t[r>>2]|0,e)n=r;else{r=0;break}for(;;){if(r=e+20|0,o=t[r>>2]|0,o|0){e=o,n=r;continue}if(r=e+16|0,o=t[r>>2]|0,o)e=o,n=r;else break}t[n>>2]=0,r=e}else r=t[y+8>>2]|0,t[r+12>>2]=e,t[e+8>>2]=r,r=e;while(0);if(l|0){if(e=t[y+28>>2]|0,n=11436+(e<<2)|0,(y|0)==(t[n>>2]|0)){if(t[n>>2]=r,!r){t[2784]=t[2784]&~(1<<e);break}}else if(t[l+16+(((t[l+16>>2]|0)!=(y|0)&1)<<2)>>2]=r,!r)break;t[r+24>>2]=l,e=y+16|0,n=t[e>>2]|0,n|0&&(t[r+16>>2]=n,t[n+24>>2]=r),e=t[e+4>>2]|0,e|0&&(t[r+20>>2]=e,t[e+24>>2]=r)}}while(0);if(t[_+4>>2]=s|1,t[d+s>>2]=s,(_|0)==(t[2788]|0)){t[2785]=s;return}}if(e=s>>>3,s>>>0<256){r=11172+(e<<1<<2)|0,n=t[2783]|0,e=1<<e,n&e?(n=r+8|0,e=t[n>>2]|0):(t[2783]=n|e,e=r,n=r+8|0),t[n>>2]=_,t[e+12>>2]=_,t[_+8>>2]=e,t[_+12>>2]=r;return}e=s>>>8,e?s>>>0>16777215?e=31:(d=(e+1048320|0)>>>16&8,y=e<<d,l=(y+520192|0)>>>16&4,y=y<<l,e=(y+245760|0)>>>16&2,e=14-(l|d|e)+(y<<e>>>15)|0,e=s>>>(e+7|0)&1|e<<1):e=0,o=11436+(e<<2)|0,t[_+28>>2]=e,t[_+20>>2]=0,t[_+16>>2]=0,n=t[2784]|0,r=1<<e;do if(n&r){for(n=s<<((e|0)==31?0:25-(e>>>1)|0),r=t[o>>2]|0;;){if((t[r+4>>2]&-8|0)==(s|0)){e=73;break}if(o=r+16+(n>>>31<<2)|0,e=t[o>>2]|0,e)n=n<<1,r=e;else{e=72;break}}if((e|0)==72){t[o>>2]=_,t[_+24>>2]=r,t[_+12>>2]=_,t[_+8>>2]=_;break}else if((e|0)==73){d=r+8|0,y=t[d>>2]|0,t[y+12>>2]=_,t[d>>2]=_,t[_+8>>2]=y,t[_+12>>2]=r,t[_+24>>2]=0;break}}else t[2784]=n|r,t[o>>2]=_,t[_+24>>2]=o,t[_+12>>2]=_,t[_+8>>2]=_;while(0);if(y=(t[2791]|0)+-1|0,t[2791]=y,!y)e=11588;else return;for(;e=t[e>>2]|0,e;)e=e+8|0;t[2791]=-1}}}function rL(){return 11628}function iL(e){e=e|0;var n=0,r=0;return n=h,h=h+16|0,r=n,t[r>>2]=sL(t[e+60>>2]|0)|0,e=lh(Ms(6,r|0)|0)|0,h=n,e|0}function j8(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0,we=0;P=h,h=h+48|0,k=P+16|0,l=P,s=P+32|0,_=e+28|0,o=t[_>>2]|0,t[s>>2]=o,y=e+20|0,o=(t[y>>2]|0)-o|0,t[s+4>>2]=o,t[s+8>>2]=n,t[s+12>>2]=r,o=o+r|0,d=e+60|0,t[l>>2]=t[d>>2],t[l+4>>2]=s,t[l+8>>2]=2,l=lh(G0(146,l|0)|0)|0;e:do if((o|0)!=(l|0)){for(n=2;!((l|0)<0);)if(o=o-l|0,we=t[s+4>>2]|0,q=l>>>0>we>>>0,s=q?s+8|0:s,n=(q<<31>>31)+n|0,we=l-(q?we:0)|0,t[s>>2]=(t[s>>2]|0)+we,q=s+4|0,t[q>>2]=(t[q>>2]|0)-we,t[k>>2]=t[d>>2],t[k+4>>2]=s,t[k+8>>2]=n,l=lh(G0(146,k|0)|0)|0,(o|0)==(l|0)){T=3;break e}t[e+16>>2]=0,t[_>>2]=0,t[y>>2]=0,t[e>>2]=t[e>>2]|32,(n|0)==2?r=0:r=r-(t[s+4>>2]|0)|0}else T=3;while(0);return(T|0)==3&&(we=t[e+44>>2]|0,t[e+16>>2]=we+(t[e+48>>2]|0),t[_>>2]=we,t[y>>2]=we),h=P,r|0}function oL(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0;return s=h,h=h+32|0,l=s,o=s+20|0,t[l>>2]=t[e+60>>2],t[l+4>>2]=0,t[l+8>>2]=n,t[l+12>>2]=o,t[l+16>>2]=r,(lh(Uu(140,l|0)|0)|0)<0?(t[o>>2]=-1,e=-1):e=t[o>>2]|0,h=s,e|0}function lh(e){return e=e|0,e>>>0>4294963200&&(t[(ca()|0)>>2]=0-e,e=-1),e|0}function ca(){return(uL()|0)+64|0}function uL(){return b4()|0}function b4(){return 2084}function sL(e){return e=e|0,e|0}function lL(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0;return s=h,h=h+32|0,o=s,t[e+36>>2]=1,((t[e>>2]&64|0)==0?(t[o>>2]=t[e+60>>2],t[o+4>>2]=21523,t[o+8>>2]=s+16,su(54,o|0)|0):0)&&(c[e+75>>0]=-1),o=j8(e,n,r)|0,h=s,o|0}function U8(e,n){e=e|0,n=n|0;var r=0,o=0;if(r=c[e>>0]|0,o=c[n>>0]|0,r<<24>>24==0?1:r<<24>>24!=o<<24>>24)e=o;else{do e=e+1|0,n=n+1|0,r=c[e>>0]|0,o=c[n>>0]|0;while(!(r<<24>>24==0?1:r<<24>>24!=o<<24>>24));e=o}return(r&255)-(e&255)|0}function fL(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0;e:do if(!r)e=0;else{for(;o=c[e>>0]|0,s=c[n>>0]|0,o<<24>>24==s<<24>>24;)if(r=r+-1|0,r)e=e+1|0,n=n+1|0;else{e=0;break e}e=(o&255)-(s&255)|0}while(0);return e|0}function q8(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0,we=0,le=0,ie=0;ie=h,h=h+224|0,T=ie+120|0,P=ie+80|0,we=ie,le=ie+136|0,o=P,s=o+40|0;do t[o>>2]=0,o=o+4|0;while((o|0)<(s|0));return t[T>>2]=t[r>>2],(G4(0,n,T,we,P)|0)<0?r=-1:((t[e+76>>2]|0)>-1?q=cL(e)|0:q=0,r=t[e>>2]|0,k=r&32,(c[e+74>>0]|0)<1&&(t[e>>2]=r&-33),o=e+48|0,t[o>>2]|0?r=G4(e,n,T,we,P)|0:(s=e+44|0,l=t[s>>2]|0,t[s>>2]=le,d=e+28|0,t[d>>2]=le,_=e+20|0,t[_>>2]=le,t[o>>2]=80,y=e+16|0,t[y>>2]=le+80,r=G4(e,n,T,we,P)|0,l&&(dh[t[e+36>>2]&7](e,0,0)|0,r=(t[_>>2]|0)==0?-1:r,t[s>>2]=l,t[o>>2]=0,t[y>>2]=0,t[d>>2]=0,t[_>>2]=0)),o=t[e>>2]|0,t[e>>2]=o|k,q|0&&aL(e),r=(o&32|0)==0?r:-1),h=ie,r|0}function G4(e,n,r,o,s){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0;var l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0,we=0,le=0,ie=0,Pe=0,ke=0,qe=0,pe=0,_e=0,vt=0,Ln=0,Ht=0,It=0,gn=0,Pn=0,zt=0;zt=h,h=h+64|0,Ht=zt+16|0,It=zt,vt=zt+24|0,gn=zt+8|0,Pn=zt+20|0,t[Ht>>2]=n,qe=(e|0)!=0,pe=vt+40|0,_e=pe,vt=vt+39|0,Ln=gn+4|0,d=0,l=0,T=0;e:for(;;){do if((l|0)>-1)if((d|0)>(2147483647-l|0)){t[(ca()|0)>>2]=75,l=-1;break}else{l=d+l|0;break}while(0);if(d=c[n>>0]|0,d<<24>>24)_=n;else{ke=87;break}t:for(;;){switch(d<<24>>24){case 37:{d=_,ke=9;break t}case 0:{d=_;break t}default:}Pe=_+1|0,t[Ht>>2]=Pe,d=c[Pe>>0]|0,_=Pe}t:do if((ke|0)==9)for(;;){if(ke=0,(c[_+1>>0]|0)!=37)break t;if(d=d+1|0,_=_+2|0,t[Ht>>2]=_,(c[_>>0]|0)==37)ke=9;else break}while(0);if(d=d-n|0,qe&&ri(e,n,d),d|0){n=_;continue}y=_+1|0,d=(c[y>>0]|0)+-48|0,d>>>0<10?(Pe=(c[_+2>>0]|0)==36,ie=Pe?d:-1,T=Pe?1:T,y=Pe?_+3|0:y):ie=-1,t[Ht>>2]=y,d=c[y>>0]|0,_=(d<<24>>24)+-32|0;t:do if(_>>>0<32)for(k=0,P=d;;){if(d=1<<_,!(d&75913)){d=P;break t}if(k=d|k,y=y+1|0,t[Ht>>2]=y,d=c[y>>0]|0,_=(d<<24>>24)+-32|0,_>>>0>=32)break;P=d}else k=0;while(0);if(d<<24>>24==42){if(_=y+1|0,d=(c[_>>0]|0)+-48|0,d>>>0<10?(c[y+2>>0]|0)==36:0)t[s+(d<<2)>>2]=10,d=t[o+((c[_>>0]|0)+-48<<3)>>2]|0,T=1,y=y+3|0;else{if(T|0){l=-1;break}qe?(T=(t[r>>2]|0)+(4-1)&~(4-1),d=t[T>>2]|0,t[r>>2]=T+4,T=0,y=_):(d=0,T=0,y=_)}t[Ht>>2]=y,Pe=(d|0)<0,d=Pe?0-d|0:d,k=Pe?k|8192:k}else{if(d=z8(Ht)|0,(d|0)<0){l=-1;break}y=t[Ht>>2]|0}do if((c[y>>0]|0)==46){if((c[y+1>>0]|0)!=42){t[Ht>>2]=y+1,_=z8(Ht)|0,y=t[Ht>>2]|0;break}if(P=y+2|0,_=(c[P>>0]|0)+-48|0,_>>>0<10?(c[y+3>>0]|0)==36:0){t[s+(_<<2)>>2]=10,_=t[o+((c[P>>0]|0)+-48<<3)>>2]|0,y=y+4|0,t[Ht>>2]=y;break}if(T|0){l=-1;break e}qe?(Pe=(t[r>>2]|0)+(4-1)&~(4-1),_=t[Pe>>2]|0,t[r>>2]=Pe+4):_=0,t[Ht>>2]=P,y=P}else _=-1;while(0);for(le=0;;){if(((c[y>>0]|0)+-65|0)>>>0>57){l=-1;break e}if(Pe=y+1|0,t[Ht>>2]=Pe,P=c[(c[y>>0]|0)+-65+(5178+(le*58|0))>>0]|0,q=P&255,(q+-1|0)>>>0<8)le=q,y=Pe;else break}if(!(P<<24>>24)){l=-1;break}we=(ie|0)>-1;do if(P<<24>>24==19)if(we){l=-1;break e}else ke=49;else{if(we){t[s+(ie<<2)>>2]=q,we=o+(ie<<3)|0,ie=t[we+4>>2]|0,ke=It,t[ke>>2]=t[we>>2],t[ke+4>>2]=ie,ke=49;break}if(!qe){l=0;break e}W8(It,q,r)}while(0);if((ke|0)==49?(ke=0,!qe):0){d=0,n=Pe;continue}y=c[y>>0]|0,y=(le|0)!=0&(y&15|0)==3?y&-33:y,we=k&-65537,ie=(k&8192|0)==0?k:we;t:do switch(y|0){case 110:switch((le&255)<<24>>24){case 0:{t[t[It>>2]>>2]=l,d=0,n=Pe;continue e}case 1:{t[t[It>>2]>>2]=l,d=0,n=Pe;continue e}case 2:{d=t[It>>2]|0,t[d>>2]=l,t[d+4>>2]=((l|0)<0)<<31>>31,d=0,n=Pe;continue e}case 3:{g[t[It>>2]>>1]=l,d=0,n=Pe;continue e}case 4:{c[t[It>>2]>>0]=l,d=0,n=Pe;continue e}case 6:{t[t[It>>2]>>2]=l,d=0,n=Pe;continue e}case 7:{d=t[It>>2]|0,t[d>>2]=l,t[d+4>>2]=((l|0)<0)<<31>>31,d=0,n=Pe;continue e}default:{d=0,n=Pe;continue e}}case 112:{y=120,_=_>>>0>8?_:8,n=ie|8,ke=61;break}case 88:case 120:{n=ie,ke=61;break}case 111:{y=It,n=t[y>>2]|0,y=t[y+4>>2]|0,q=pL(n,y,pe)|0,we=_e-q|0,k=0,P=5642,_=(ie&8|0)==0|(_|0)>(we|0)?_:we+1|0,we=ie,ke=67;break}case 105:case 100:if(y=It,n=t[y>>2]|0,y=t[y+4>>2]|0,(y|0)<0){n=fh(0,0,n|0,y|0)|0,y=be,k=It,t[k>>2]=n,t[k+4>>2]=y,k=1,P=5642,ke=66;break t}else{k=(ie&2049|0)!=0&1,P=(ie&2048|0)==0?(ie&1|0)==0?5642:5644:5643,ke=66;break t}case 117:{y=It,k=0,P=5642,n=t[y>>2]|0,y=t[y+4>>2]|0,ke=66;break}case 99:{c[vt>>0]=t[It>>2],n=vt,k=0,P=5642,q=pe,y=1,_=we;break}case 109:{y=hL(t[(ca()|0)>>2]|0)|0,ke=71;break}case 115:{y=t[It>>2]|0,y=y|0?y:5652,ke=71;break}case 67:{t[gn>>2]=t[It>>2],t[Ln>>2]=0,t[It>>2]=gn,q=-1,y=gn,ke=75;break}case 83:{n=t[It>>2]|0,_?(q=_,y=n,ke=75):(wi(e,32,d,0,ie),n=0,ke=84);break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{d=vL(e,+L[It>>3],d,_,ie,y)|0,n=Pe;continue e}default:k=0,P=5642,q=pe,y=_,_=ie}while(0);t:do if((ke|0)==61)ie=It,le=t[ie>>2]|0,ie=t[ie+4>>2]|0,q=dL(le,ie,pe,y&32)|0,P=(n&8|0)==0|(le|0)==0&(ie|0)==0,k=P?0:2,P=P?5642:5642+(y>>4)|0,we=n,n=le,y=ie,ke=67;else if((ke|0)==66)q=aa(n,y,pe)|0,we=ie,ke=67;else if((ke|0)==71)ke=0,ie=mL(y,0,_)|0,le=(ie|0)==0,n=y,k=0,P=5642,q=le?y+_|0:ie,y=le?_:ie-y|0,_=we;else if((ke|0)==75){for(ke=0,P=y,n=0,_=0;k=t[P>>2]|0,!(!k||(_=H8(Pn,k)|0,(_|0)<0|_>>>0>(q-n|0)>>>0));)if(n=_+n|0,q>>>0>n>>>0)P=P+4|0;else break;if((_|0)<0){l=-1;break e}if(wi(e,32,d,n,ie),!n)n=0,ke=84;else for(k=0;;){if(_=t[y>>2]|0,!_){ke=84;break t}if(_=H8(Pn,_)|0,k=_+k|0,(k|0)>(n|0)){ke=84;break t}if(ri(e,Pn,_),k>>>0>=n>>>0){ke=84;break}else y=y+4|0}}while(0);if((ke|0)==67)ke=0,y=(n|0)!=0|(y|0)!=0,ie=(_|0)!=0|y,y=((y^1)&1)+(_e-q)|0,n=ie?q:pe,q=pe,y=ie?(_|0)>(y|0)?_:y:_,_=(_|0)>-1?we&-65537:we;else if((ke|0)==84){ke=0,wi(e,32,d,n,ie^8192),d=(d|0)>(n|0)?d:n,n=Pe;continue}le=q-n|0,we=(y|0)<(le|0)?le:y,ie=we+k|0,d=(d|0)<(ie|0)?ie:d,wi(e,32,d,ie,_),ri(e,P,k),wi(e,48,d,ie,_^65536),wi(e,48,we,le,0),ri(e,n,le),wi(e,32,d,ie,_^8192),n=Pe}e:do if((ke|0)==87&&!e)if(!T)l=0;else{for(l=1;n=t[s+(l<<2)>>2]|0,!!n;)if(W8(o+(l<<3)|0,n,r),l=l+1|0,(l|0)>=10){l=1;break e}for(;;){if(t[s+(l<<2)>>2]|0){l=-1;break e}if(l=l+1|0,(l|0)>=10){l=1;break}}}while(0);return h=zt,l|0}function cL(e){return e=e|0,0}function aL(e){e=e|0}function ri(e,n,r){e=e|0,n=n|0,r=r|0,t[e>>2]&32||TL(n,r,e)|0}function z8(e){e=e|0;var n=0,r=0,o=0;if(r=t[e>>2]|0,o=(c[r>>0]|0)+-48|0,o>>>0<10){n=0;do n=o+(n*10|0)|0,r=r+1|0,t[e>>2]=r,o=(c[r>>0]|0)+-48|0;while(o>>>0<10)}else n=0;return n|0}function W8(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0;e:do if(n>>>0<=20)do switch(n|0){case 9:{o=(t[r>>2]|0)+(4-1)&~(4-1),n=t[o>>2]|0,t[r>>2]=o+4,t[e>>2]=n;break e}case 10:{o=(t[r>>2]|0)+(4-1)&~(4-1),n=t[o>>2]|0,t[r>>2]=o+4,o=e,t[o>>2]=n,t[o+4>>2]=((n|0)<0)<<31>>31;break e}case 11:{o=(t[r>>2]|0)+(4-1)&~(4-1),n=t[o>>2]|0,t[r>>2]=o+4,o=e,t[o>>2]=n,t[o+4>>2]=0;break e}case 12:{o=(t[r>>2]|0)+(8-1)&~(8-1),n=o,s=t[n>>2]|0,n=t[n+4>>2]|0,t[r>>2]=o+8,o=e,t[o>>2]=s,t[o+4>>2]=n;break e}case 13:{s=(t[r>>2]|0)+(4-1)&~(4-1),o=t[s>>2]|0,t[r>>2]=s+4,o=(o&65535)<<16>>16,s=e,t[s>>2]=o,t[s+4>>2]=((o|0)<0)<<31>>31;break e}case 14:{s=(t[r>>2]|0)+(4-1)&~(4-1),o=t[s>>2]|0,t[r>>2]=s+4,s=e,t[s>>2]=o&65535,t[s+4>>2]=0;break e}case 15:{s=(t[r>>2]|0)+(4-1)&~(4-1),o=t[s>>2]|0,t[r>>2]=s+4,o=(o&255)<<24>>24,s=e,t[s>>2]=o,t[s+4>>2]=((o|0)<0)<<31>>31;break e}case 16:{s=(t[r>>2]|0)+(4-1)&~(4-1),o=t[s>>2]|0,t[r>>2]=s+4,s=e,t[s>>2]=o&255,t[s+4>>2]=0;break e}case 17:{s=(t[r>>2]|0)+(8-1)&~(8-1),l=+L[s>>3],t[r>>2]=s+8,L[e>>3]=l;break e}case 18:{s=(t[r>>2]|0)+(8-1)&~(8-1),l=+L[s>>3],t[r>>2]=s+8,L[e>>3]=l;break e}default:break e}while(0);while(0)}function dL(e,n,r,o){if(e=e|0,n=n|0,r=r|0,o=o|0,!((e|0)==0&(n|0)==0))do r=r+-1|0,c[r>>0]=C[5694+(e&15)>>0]|0|o,e=ch(e|0,n|0,4)|0,n=be;while(!((e|0)==0&(n|0)==0));return r|0}function pL(e,n,r){if(e=e|0,n=n|0,r=r|0,!((e|0)==0&(n|0)==0))do r=r+-1|0,c[r>>0]=e&7|48,e=ch(e|0,n|0,3)|0,n=be;while(!((e|0)==0&(n|0)==0));return r|0}function aa(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;if(n>>>0>0|(n|0)==0&e>>>0>4294967295){for(;o=K4(e|0,n|0,10,0)|0,r=r+-1|0,c[r>>0]=o&255|48,o=e,e=$4(e|0,n|0,10,0)|0,n>>>0>9|(n|0)==9&o>>>0>4294967295;)n=be;n=e}else n=e;if(n)for(;r=r+-1|0,c[r>>0]=(n>>>0)%10|0|48,!(n>>>0<10);)n=(n>>>0)/10|0;return r|0}function hL(e){return e=e|0,DL(e,t[(wL()|0)+188>>2]|0)|0}function mL(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;l=n&255,o=(r|0)!=0;e:do if(o&(e&3|0)!=0)for(s=n&255;;){if((c[e>>0]|0)==s<<24>>24){d=6;break e}if(e=e+1|0,r=r+-1|0,o=(r|0)!=0,!(o&(e&3|0)!=0)){d=5;break}}else d=5;while(0);(d|0)==5&&(o?d=6:r=0);e:do if((d|0)==6&&(s=n&255,(c[e>>0]|0)!=s<<24>>24)){o=Un(l,16843009)|0;t:do if(r>>>0>3){for(;l=t[e>>2]^o,!((l&-2139062144^-2139062144)&l+-16843009|0);)if(e=e+4|0,r=r+-4|0,r>>>0<=3){d=11;break t}}else d=11;while(0);if((d|0)==11&&!r){r=0;break}for(;;){if((c[e>>0]|0)==s<<24>>24)break e;if(e=e+1|0,r=r+-1|0,!r){r=0;break}}}while(0);return(r|0?e:0)|0}function wi(e,n,r,o,s){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0;var l=0,d=0;if(d=h,h=h+256|0,l=d,(r|0)>(o|0)&(s&73728|0)==0){if(s=r-o|0,pa(l|0,n|0,(s>>>0<256?s:256)|0)|0,s>>>0>255){n=r-o|0;do ri(e,l,256),s=s+-256|0;while(s>>>0>255);s=n&255}ri(e,l,s)}h=d}function H8(e,n){return e=e|0,n=n|0,e?e=_L(e,n,0)|0:e=0,e|0}function vL(e,n,r,o,s,l){e=e|0,n=+n,r=r|0,o=o|0,s=s|0,l=l|0;var d=0,_=0,y=0,k=0,T=0,P=0,q=0,we=0,le=0,ie=0,Pe=0,ke=0,qe=0,pe=0,_e=0,vt=0,Ln=0,Ht=0,It=0,gn=0,Pn=0,zt=0,Dr=0;Dr=h,h=h+560|0,y=Dr+8|0,Pe=Dr,zt=Dr+524|0,Pn=zt,k=Dr+512|0,t[Pe>>2]=0,gn=k+12|0,b8(n)|0,(be|0)<0?(n=-n,Ht=1,Ln=5659):(Ht=(s&2049|0)!=0&1,Ln=(s&2048|0)==0?(s&1|0)==0?5660:5665:5662),b8(n)|0,It=be&2146435072;do if(It>>>0<2146435072|(It|0)==2146435072&0<0){if(we=+gL(n,Pe)*2,d=we!=0,d&&(t[Pe>>2]=(t[Pe>>2]|0)+-1),qe=l|32,(qe|0)==97){le=l&32,q=(le|0)==0?Ln:Ln+9|0,P=Ht|2,d=12-o|0;do if(o>>>0>11|(d|0)==0)n=we;else{n=8;do d=d+-1|0,n=n*16;while((d|0)!=0);if((c[q>>0]|0)==45){n=-(n+(-we-n));break}else{n=we+n-n;break}}while(0);_=t[Pe>>2]|0,d=(_|0)<0?0-_|0:_,d=aa(d,((d|0)<0)<<31>>31,gn)|0,(d|0)==(gn|0)&&(d=k+11|0,c[d>>0]=48),c[d+-1>>0]=(_>>31&2)+43,T=d+-2|0,c[T>>0]=l+15,k=(o|0)<1,y=(s&8|0)==0,d=zt;do It=~~n,_=d+1|0,c[d>>0]=C[5694+It>>0]|le,n=(n-+(It|0))*16,((_-Pn|0)==1?!(y&(k&n==0)):0)?(c[_>>0]=46,d=d+2|0):d=_;while(n!=0);It=d-Pn|0,Pn=gn-T|0,gn=(o|0)!=0&(It+-2|0)<(o|0)?o+2|0:It,d=Pn+P+gn|0,wi(e,32,r,d,s),ri(e,q,P),wi(e,48,r,d,s^65536),ri(e,zt,It),wi(e,48,gn-It|0,0,0),ri(e,T,Pn),wi(e,32,r,d,s^8192);break}_=(o|0)<0?6:o,d?(d=(t[Pe>>2]|0)+-28|0,t[Pe>>2]=d,n=we*268435456):(n=we,d=t[Pe>>2]|0),It=(d|0)<0?y:y+288|0,y=It;do _e=~~n>>>0,t[y>>2]=_e,y=y+4|0,n=(n-+(_e>>>0))*1e9;while(n!=0);if((d|0)>0)for(k=It,P=y;;){if(T=(d|0)<29?d:29,d=P+-4|0,d>>>0>=k>>>0){y=0;do pe=X8(t[d>>2]|0,0,T|0)|0,pe=Y4(pe|0,be|0,y|0,0)|0,_e=be,ke=K4(pe|0,_e|0,1e9,0)|0,t[d>>2]=ke,y=$4(pe|0,_e|0,1e9,0)|0,d=d+-4|0;while(d>>>0>=k>>>0);y&&(k=k+-4|0,t[k>>2]=y)}for(y=P;!(y>>>0<=k>>>0);)if(d=y+-4|0,!(t[d>>2]|0))y=d;else break;if(d=(t[Pe>>2]|0)-T|0,t[Pe>>2]=d,(d|0)>0)P=y;else break}else k=It;if((d|0)<0){o=((_+25|0)/9|0)+1|0,ie=(qe|0)==102;do{if(le=0-d|0,le=(le|0)<9?le:9,k>>>0<y>>>0){T=(1<<le)+-1|0,P=1e9>>>le,q=0,d=k;do _e=t[d>>2]|0,t[d>>2]=(_e>>>le)+q,q=Un(_e&T,P)|0,d=d+4|0;while(d>>>0<y>>>0);d=(t[k>>2]|0)==0?k+4|0:k,q?(t[y>>2]=q,k=d,d=y+4|0):(k=d,d=y)}else k=(t[k>>2]|0)==0?k+4|0:k,d=y;y=ie?It:k,y=(d-y>>2|0)>(o|0)?y+(o<<2)|0:d,d=(t[Pe>>2]|0)+le|0,t[Pe>>2]=d}while((d|0)<0);d=k,o=y}else d=k,o=y;if(_e=It,d>>>0<o>>>0){if(y=(_e-d>>2)*9|0,T=t[d>>2]|0,T>>>0>=10){k=10;do k=k*10|0,y=y+1|0;while(T>>>0>=k>>>0)}}else y=0;if(ie=(qe|0)==103,ke=(_|0)!=0,k=_-((qe|0)!=102?y:0)+((ke&ie)<<31>>31)|0,(k|0)<(((o-_e>>2)*9|0)+-9|0)){if(k=k+9216|0,le=It+4+(((k|0)/9|0)+-1024<<2)|0,k=((k|0)%9|0)+1|0,(k|0)<9){T=10;do T=T*10|0,k=k+1|0;while((k|0)!=9)}else T=10;if(P=t[le>>2]|0,q=(P>>>0)%(T>>>0)|0,k=(le+4|0)==(o|0),k&(q|0)==0)k=le;else if(we=(((P>>>0)/(T>>>0)|0)&1|0)==0?9007199254740992:9007199254740994,pe=(T|0)/2|0,n=q>>>0<pe>>>0?.5:k&(q|0)==(pe|0)?1:1.5,Ht&&(pe=(c[Ln>>0]|0)==45,n=pe?-n:n,we=pe?-we:we),k=P-q|0,t[le>>2]=k,we+n!=we){if(pe=k+T|0,t[le>>2]=pe,pe>>>0>999999999)for(y=le;k=y+-4|0,t[y>>2]=0,k>>>0<d>>>0&&(d=d+-4|0,t[d>>2]=0),pe=(t[k>>2]|0)+1|0,t[k>>2]=pe,pe>>>0>999999999;)y=k;else k=le;if(y=(_e-d>>2)*9|0,P=t[d>>2]|0,P>>>0>=10){T=10;do T=T*10|0,y=y+1|0;while(P>>>0>=T>>>0)}}else k=le;k=k+4|0,k=o>>>0>k>>>0?k:o,pe=d}else k=o,pe=d;for(qe=k;;){if(qe>>>0<=pe>>>0){Pe=0;break}if(d=qe+-4|0,!(t[d>>2]|0))qe=d;else{Pe=1;break}}o=0-y|0;do if(ie)if(d=((ke^1)&1)+_|0,(d|0)>(y|0)&(y|0)>-5?(T=l+-1|0,_=d+-1-y|0):(T=l+-2|0,_=d+-1|0),d=s&8,d)le=d;else{if(Pe?(vt=t[qe+-4>>2]|0,(vt|0)!=0):0)if((vt>>>0)%10|0)k=0;else{k=0,d=10;do d=d*10|0,k=k+1|0;while(!((vt>>>0)%(d>>>0)|0|0))}else k=9;if(d=((qe-_e>>2)*9|0)+-9|0,(T|32|0)==102){le=d-k|0,le=(le|0)>0?le:0,_=(_|0)<(le|0)?_:le,le=0;break}else{le=d+y-k|0,le=(le|0)>0?le:0,_=(_|0)<(le|0)?_:le,le=0;break}}else T=l,le=s&8;while(0);if(ie=_|le,P=(ie|0)!=0&1,q=(T|32|0)==102,q)ke=0,d=(y|0)>0?y:0;else{if(d=(y|0)<0?o:y,d=aa(d,((d|0)<0)<<31>>31,gn)|0,k=gn,(k-d|0)<2)do d=d+-1|0,c[d>>0]=48;while((k-d|0)<2);c[d+-1>>0]=(y>>31&2)+43,d=d+-2|0,c[d>>0]=T,ke=d,d=k-d|0}if(d=Ht+1+_+P+d|0,wi(e,32,r,d,s),ri(e,Ln,Ht),wi(e,48,r,d,s^65536),q){T=pe>>>0>It>>>0?It:pe,le=zt+9|0,P=le,q=zt+8|0,k=T;do{if(y=aa(t[k>>2]|0,0,le)|0,(k|0)==(T|0))(y|0)==(le|0)&&(c[q>>0]=48,y=q);else if(y>>>0>zt>>>0){pa(zt|0,48,y-Pn|0)|0;do y=y+-1|0;while(y>>>0>zt>>>0)}ri(e,y,P-y|0),k=k+4|0}while(k>>>0<=It>>>0);if(ie|0&&ri(e,5710,1),k>>>0<qe>>>0&(_|0)>0)for(;;){if(y=aa(t[k>>2]|0,0,le)|0,y>>>0>zt>>>0){pa(zt|0,48,y-Pn|0)|0;do y=y+-1|0;while(y>>>0>zt>>>0)}if(ri(e,y,(_|0)<9?_:9),k=k+4|0,y=_+-9|0,k>>>0<qe>>>0&(_|0)>9)_=y;else{_=y;break}}wi(e,48,_+9|0,9,0)}else{if(ie=Pe?qe:pe+4|0,(_|0)>-1){Pe=zt+9|0,le=(le|0)==0,o=Pe,P=0-Pn|0,q=zt+8|0,T=pe;do{y=aa(t[T>>2]|0,0,Pe)|0,(y|0)==(Pe|0)&&(c[q>>0]=48,y=q);do if((T|0)==(pe|0)){if(k=y+1|0,ri(e,y,1),le&(_|0)<1){y=k;break}ri(e,5710,1),y=k}else{if(y>>>0<=zt>>>0)break;pa(zt|0,48,y+P|0)|0;do y=y+-1|0;while(y>>>0>zt>>>0)}while(0);Pn=o-y|0,ri(e,y,(_|0)>(Pn|0)?Pn:_),_=_-Pn|0,T=T+4|0}while(T>>>0<ie>>>0&(_|0)>-1)}wi(e,48,_+18|0,18,0),ri(e,ke,gn-ke|0)}wi(e,32,r,d,s^8192)}else zt=(l&32|0)!=0,d=Ht+3|0,wi(e,32,r,d,s&-65537),ri(e,Ln,Ht),ri(e,n!=n|!1?zt?5686:5690:zt?5678:5682,3),wi(e,32,r,d,s^8192);while(0);return h=Dr,((d|0)<(r|0)?r:d)|0}function b8(e){e=+e;var n=0;return L[j>>3]=e,n=t[j>>2]|0,be=t[j+4>>2]|0,n|0}function gL(e,n){return e=+e,n=n|0,+ +G8(e,n)}function G8(e,n){e=+e,n=n|0;var r=0,o=0,s=0;switch(L[j>>3]=e,r=t[j>>2]|0,o=t[j+4>>2]|0,s=ch(r|0,o|0,52)|0,s&2047){case 0:{e!=0?(e=+G8(e*18446744073709552e3,n),r=(t[n>>2]|0)+-64|0):r=0,t[n>>2]=r;break}case 2047:break;default:t[n>>2]=(s&2047)+-1022,t[j>>2]=r,t[j+4>>2]=o&-2146435073|1071644672,e=+L[j>>3]}return+e}function _L(e,n,r){e=e|0,n=n|0,r=r|0;do if(e){if(n>>>0<128){c[e>>0]=n,e=1;break}if(!(t[t[(yL()|0)+188>>2]>>2]|0))if((n&-128|0)==57216){c[e>>0]=n,e=1;break}else{t[(ca()|0)>>2]=84,e=-1;break}if(n>>>0<2048){c[e>>0]=n>>>6|192,c[e+1>>0]=n&63|128,e=2;break}if(n>>>0<55296|(n&-8192|0)==57344){c[e>>0]=n>>>12|224,c[e+1>>0]=n>>>6&63|128,c[e+2>>0]=n&63|128,e=3;break}if((n+-65536|0)>>>0<1048576){c[e>>0]=n>>>18|240,c[e+1>>0]=n>>>12&63|128,c[e+2>>0]=n>>>6&63|128,c[e+3>>0]=n&63|128,e=4;break}else{t[(ca()|0)>>2]=84,e=-1;break}}else e=1;while(0);return e|0}function yL(){return b4()|0}function wL(){return b4()|0}function DL(e,n){e=e|0,n=n|0;var r=0,o=0;for(o=0;;){if((C[5712+o>>0]|0)==(e|0)){e=2;break}if(r=o+1|0,(r|0)==87){r=5800,o=87,e=5;break}else o=r}if((e|0)==2&&(o?(r=5800,e=5):r=5800),(e|0)==5)for(;;){do e=r,r=r+1|0;while((c[e>>0]|0)!=0);if(o=o+-1|0,o)e=5;else break}return EL(r,t[n+20>>2]|0)|0}function EL(e,n){return e=e|0,n=n|0,SL(e,n)|0}function SL(e,n){return e=e|0,n=n|0,n?n=CL(t[n>>2]|0,t[n+4>>2]|0,e)|0:n=0,(n|0?n:e)|0}function CL(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0;q=(t[e>>2]|0)+1794895138|0,l=fc(t[e+8>>2]|0,q)|0,o=fc(t[e+12>>2]|0,q)|0,s=fc(t[e+16>>2]|0,q)|0;e:do if((l>>>0<n>>>2>>>0?(P=n-(l<<2)|0,o>>>0<P>>>0&s>>>0<P>>>0):0)?((s|o)&3|0)==0:0){for(P=o>>>2,T=s>>>2,k=0;;){if(_=l>>>1,y=k+_|0,d=y<<1,s=d+P|0,o=fc(t[e+(s<<2)>>2]|0,q)|0,s=fc(t[e+(s+1<<2)>>2]|0,q)|0,!(s>>>0<n>>>0&o>>>0<(n-s|0)>>>0)){o=0;break e}if(c[e+(s+o)>>0]|0){o=0;break e}if(o=U8(r,e+s|0)|0,!o)break;if(o=(o|0)<0,(l|0)==1){o=0;break e}else k=o?k:y,l=o?_:l-_|0}o=d+T|0,s=fc(t[e+(o<<2)>>2]|0,q)|0,o=fc(t[e+(o+1<<2)>>2]|0,q)|0,o>>>0<n>>>0&s>>>0<(n-o|0)>>>0?o=(c[e+(o+s)>>0]|0)==0?e+o|0:0:o=0}else o=0;while(0);return o|0}function fc(e,n){e=e|0,n=n|0;var r=0;return r=Z8(e|0)|0,((n|0)==0?e:r)|0}function TL(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0,_=0;o=r+16|0,s=t[o>>2]|0,s?l=5:xL(r)|0?o=0:(s=t[o>>2]|0,l=5);e:do if((l|0)==5){if(_=r+20|0,d=t[_>>2]|0,o=d,(s-d|0)>>>0<n>>>0){o=dh[t[r+36>>2]&7](r,e,n)|0;break}t:do if((c[r+75>>0]|0)>-1){for(d=n;;){if(!d){l=0,s=e;break t}if(s=d+-1|0,(c[e+s>>0]|0)==10)break;d=s}if(o=dh[t[r+36>>2]&7](r,e,d)|0,o>>>0<d>>>0)break e;l=d,s=e+d|0,n=n-d|0,o=t[_>>2]|0}else l=0,s=e;while(0);vn(o|0,s|0,n|0)|0,t[_>>2]=(t[_>>2]|0)+n,o=l+n|0}while(0);return o|0}function xL(e){e=e|0;var n=0,r=0;return n=e+74|0,r=c[n>>0]|0,c[n>>0]=r+255|r,n=t[e>>2]|0,n&8?(t[e>>2]=n|32,e=-1):(t[e+8>>2]=0,t[e+4>>2]=0,r=t[e+44>>2]|0,t[e+28>>2]=r,t[e+20>>2]=r,t[e+16>>2]=r+(t[e+48>>2]|0),e=0),e|0}function Ur(e,n){e=w(e),n=w(n);var r=0,o=0;r=V8(e)|0;do if((r&2147483647)>>>0<=2139095040){if(o=V8(n)|0,(o&2147483647)>>>0<=2139095040)if((o^r|0)<0){e=(r|0)<0?n:e;break}else{e=e<n?n:e;break}}else e=n;while(0);return w(e)}function V8(e){return e=w(e),D[j>>2]=e,t[j>>2]|0|0}function cc(e,n){e=w(e),n=w(n);var r=0,o=0;r=Y8(e)|0;do if((r&2147483647)>>>0<=2139095040){if(o=Y8(n)|0,(o&2147483647)>>>0<=2139095040)if((o^r|0)<0){e=(r|0)<0?e:n;break}else{e=e<n?e:n;break}}else e=n;while(0);return w(e)}function Y8(e){return e=w(e),D[j>>2]=e,t[j>>2]|0|0}function V4(e,n){e=w(e),n=w(n);var r=0,o=0,s=0,l=0,d=0,_=0,y=0,k=0;l=(D[j>>2]=e,t[j>>2]|0),_=(D[j>>2]=n,t[j>>2]|0),r=l>>>23&255,d=_>>>23&255,y=l&-2147483648,s=_<<1;e:do if((s|0)!=0?!((r|0)==255|((kL(n)|0)&2147483647)>>>0>2139095040):0){if(o=l<<1,o>>>0<=s>>>0)return n=w(e*w(0)),w((o|0)==(s|0)?n:e);if(r)o=l&8388607|8388608;else{if(r=l<<9,(r|0)>-1){o=r,r=0;do r=r+-1|0,o=o<<1;while((o|0)>-1)}else r=0;o=l<<1-r}if(d)_=_&8388607|8388608;else{if(l=_<<9,(l|0)>-1){s=0;do s=s+-1|0,l=l<<1;while((l|0)>-1)}else s=0;d=s,_=_<<1-s}s=o-_|0,l=(s|0)>-1;t:do if((r|0)>(d|0)){for(;;){if(l)if(s)o=s;else break;if(o=o<<1,r=r+-1|0,s=o-_|0,l=(s|0)>-1,(r|0)<=(d|0))break t}n=w(e*w(0));break e}while(0);if(l)if(s)o=s;else{n=w(e*w(0));break}if(o>>>0<8388608)do o=o<<1,r=r+-1|0;while(o>>>0<8388608);(r|0)>0?r=o+-8388608|r<<23:r=o>>>(1-r|0),n=(t[j>>2]=r|y,w(D[j>>2]))}else k=3;while(0);return(k|0)==3&&(n=w(e*n),n=w(n/n)),w(n)}function kL(e){return e=w(e),D[j>>2]=e,t[j>>2]|0|0}function AL(e,n){return e=e|0,n=n|0,q8(t[582]|0,e,n)|0}function $n(e){e=e|0,_n()}function da(e){e=e|0}function OL(e,n){return e=e|0,n=n|0,0}function IL(e){return e=e|0,($8(e+4|0)|0)==-1?(Nl[t[(t[e>>2]|0)+8>>2]&127](e),e=1):e=0,e|0}function $8(e){e=e|0;var n=0;return n=t[e>>2]|0,t[e>>2]=n+-1,n+-1|0}function Tf(e){e=e|0,IL(e)|0&&PL(e)}function PL(e){e=e|0;var n=0;n=e+8|0,((t[n>>2]|0)!=0?($8(n)|0)!=-1:0)||Nl[t[(t[e>>2]|0)+16>>2]&127](e)}function Tt(e){e=e|0;var n=0;for(n=(e|0)==0?1:e;e=uh(n)|0,!(e|0);){if(e=FL()|0,!e){e=0;break}fD[e&0]()}return e|0}function K8(e){return e=e|0,Tt(e)|0}function Ve(e){e=e|0,sh(e)}function ML(e){e=e|0,(c[e+11>>0]|0)<0&&Ve(t[e>>2]|0)}function FL(){var e=0;return e=t[2923]|0,t[2923]=e+0,e|0}function LL(){}function fh(e,n,r,o){return e=e|0,n=n|0,r=r|0,o=o|0,o=n-o-(r>>>0>e>>>0|0)>>>0,be=o,e-r>>>0|0|0}function Y4(e,n,r,o){return e=e|0,n=n|0,r=r|0,o=o|0,r=e+r>>>0,be=n+o+(r>>>0<e>>>0|0)>>>0,r|0|0}function pa(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0,d=0;if(l=e+r|0,n=n&255,(r|0)>=67){for(;e&3;)c[e>>0]=n,e=e+1|0;for(o=l&-4|0,s=o-64|0,d=n|n<<8|n<<16|n<<24;(e|0)<=(s|0);)t[e>>2]=d,t[e+4>>2]=d,t[e+8>>2]=d,t[e+12>>2]=d,t[e+16>>2]=d,t[e+20>>2]=d,t[e+24>>2]=d,t[e+28>>2]=d,t[e+32>>2]=d,t[e+36>>2]=d,t[e+40>>2]=d,t[e+44>>2]=d,t[e+48>>2]=d,t[e+52>>2]=d,t[e+56>>2]=d,t[e+60>>2]=d,e=e+64|0;for(;(e|0)<(o|0);)t[e>>2]=d,e=e+4|0}for(;(e|0)<(l|0);)c[e>>0]=n,e=e+1|0;return l-r|0}function X8(e,n,r){return e=e|0,n=n|0,r=r|0,(r|0)<32?(be=n<<r|(e&(1<<r)-1<<32-r)>>>32-r,e<<r):(be=e<<r-32,0)}function ch(e,n,r){return e=e|0,n=n|0,r=r|0,(r|0)<32?(be=n>>>r,e>>>r|(n&(1<<r)-1)<<32-r):(be=0,n>>>r-32|0)}function vn(e,n,r){e=e|0,n=n|0,r=r|0;var o=0,s=0,l=0;if((r|0)>=8192)return wo(e|0,n|0,r|0)|0;if(l=e|0,s=e+r|0,(e&3)==(n&3)){for(;e&3;){if(!r)return l|0;c[e>>0]=c[n>>0]|0,e=e+1|0,n=n+1|0,r=r-1|0}for(r=s&-4|0,o=r-64|0;(e|0)<=(o|0);)t[e>>2]=t[n>>2],t[e+4>>2]=t[n+4>>2],t[e+8>>2]=t[n+8>>2],t[e+12>>2]=t[n+12>>2],t[e+16>>2]=t[n+16>>2],t[e+20>>2]=t[n+20>>2],t[e+24>>2]=t[n+24>>2],t[e+28>>2]=t[n+28>>2],t[e+32>>2]=t[n+32>>2],t[e+36>>2]=t[n+36>>2],t[e+40>>2]=t[n+40>>2],t[e+44>>2]=t[n+44>>2],t[e+48>>2]=t[n+48>>2],t[e+52>>2]=t[n+52>>2],t[e+56>>2]=t[n+56>>2],t[e+60>>2]=t[n+60>>2],e=e+64|0,n=n+64|0;for(;(e|0)<(r|0);)t[e>>2]=t[n>>2],e=e+4|0,n=n+4|0}else for(r=s-4|0;(e|0)<(r|0);)c[e>>0]=c[n>>0]|0,c[e+1>>0]=c[n+1>>0]|0,c[e+2>>0]=c[n+2>>0]|0,c[e+3>>0]=c[n+3>>0]|0,e=e+4|0,n=n+4|0;for(;(e|0)<(s|0);)c[e>>0]=c[n>>0]|0,e=e+1|0,n=n+1|0;return l|0}function J8(e){e=e|0;var n=0;return n=c[ce+(e&255)>>0]|0,(n|0)<8?n|0:(n=c[ce+(e>>8&255)>>0]|0,(n|0)<8?n+8|0:(n=c[ce+(e>>16&255)>>0]|0,(n|0)<8?n+16|0:(c[ce+(e>>>24)>>0]|0)+24|0))}function Q8(e,n,r,o,s){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0;var l=0,d=0,_=0,y=0,k=0,T=0,P=0,q=0,we=0,le=0;if(T=e,y=n,k=y,d=r,q=o,_=q,!k)return l=(s|0)!=0,_?l?(t[s>>2]=e|0,t[s+4>>2]=n&0,q=0,s=0,be=q,s|0):(q=0,s=0,be=q,s|0):(l&&(t[s>>2]=(T>>>0)%(d>>>0),t[s+4>>2]=0),q=0,s=(T>>>0)/(d>>>0)>>>0,be=q,s|0);l=(_|0)==0;do if(d){if(!l){if(l=(cr(_|0)|0)-(cr(k|0)|0)|0,l>>>0<=31){P=l+1|0,_=31-l|0,n=l-31>>31,d=P,e=T>>>(P>>>0)&n|k<<_,n=k>>>(P>>>0)&n,l=0,_=T<<_;break}return s?(t[s>>2]=e|0,t[s+4>>2]=y|n&0,q=0,s=0,be=q,s|0):(q=0,s=0,be=q,s|0)}if(l=d-1|0,l&d|0){_=(cr(d|0)|0)+33-(cr(k|0)|0)|0,le=64-_|0,P=32-_|0,y=P>>31,we=_-32|0,n=we>>31,d=_,e=P-1>>31&k>>>(we>>>0)|(k<<P|T>>>(_>>>0))&n,n=n&k>>>(_>>>0),l=T<<le&y,_=(k<<le|T>>>(we>>>0))&y|T<<P&_-33>>31;break}return s|0&&(t[s>>2]=l&T,t[s+4>>2]=0),(d|0)==1?(we=y|n&0,le=e|0|0,be=we,le|0):(le=J8(d|0)|0,we=k>>>(le>>>0)|0,le=k<<32-le|T>>>(le>>>0)|0,be=we,le|0)}else{if(l)return s|0&&(t[s>>2]=(k>>>0)%(d>>>0),t[s+4>>2]=0),we=0,le=(k>>>0)/(d>>>0)>>>0,be=we,le|0;if(!T)return s|0&&(t[s>>2]=0,t[s+4>>2]=(k>>>0)%(_>>>0)),we=0,le=(k>>>0)/(_>>>0)>>>0,be=we,le|0;if(l=_-1|0,!(l&_))return s|0&&(t[s>>2]=e|0,t[s+4>>2]=l&k|n&0),we=0,le=k>>>((J8(_|0)|0)>>>0),be=we,le|0;if(l=(cr(_|0)|0)-(cr(k|0)|0)|0,l>>>0<=30){n=l+1|0,_=31-l|0,d=n,e=k<<_|T>>>(n>>>0),n=k>>>(n>>>0),l=0,_=T<<_;break}return s?(t[s>>2]=e|0,t[s+4>>2]=y|n&0,we=0,le=0,be=we,le|0):(we=0,le=0,be=we,le|0)}while(0);if(!d)k=_,y=0,_=0;else{P=r|0|0,T=q|o&0,k=Y4(P|0,T|0,-1,-1)|0,r=be,y=_,_=0;do o=y,y=l>>>31|y<<1,l=_|l<<1,o=e<<1|o>>>31|0,q=e>>>31|n<<1|0,fh(k|0,r|0,o|0,q|0)|0,le=be,we=le>>31|((le|0)<0?-1:0)<<1,_=we&1,e=fh(o|0,q|0,we&P|0,(((le|0)<0?-1:0)>>31|((le|0)<0?-1:0)<<1)&T|0)|0,n=be,d=d-1|0;while((d|0)!=0);k=y,y=0}return d=0,s|0&&(t[s>>2]=e,t[s+4>>2]=n),we=(l|0)>>>31|(k|d)<<1|(d<<1|l>>>31)&0|y,le=(l<<1|0>>>31)&-2|_,be=we,le|0}function $4(e,n,r,o){return e=e|0,n=n|0,r=r|0,o=o|0,Q8(e,n,r,o,0)|0}function xf(e){e=e|0;var n=0,r=0;return r=e+15&-16|0,n=t[N>>2]|0,e=n+r|0,(r|0)>0&(e|0)<(n|0)|(e|0)<0?(vr()|0,Os(12),-1):(t[N>>2]=e,((e|0)>(Xn()|0)?(Bn()|0)==0:0)?(t[N>>2]=n,Os(12),-1):n|0)}function Y1(e,n,r){e=e|0,n=n|0,r=r|0;var o=0;if((n|0)<(e|0)&(e|0)<(n+r|0)){for(o=e,n=n+r|0,e=e+r|0;(r|0)>0;)e=e-1|0,n=n-1|0,r=r-1|0,c[e>>0]=c[n>>0]|0;e=o}else vn(e,n,r)|0;return e|0}function K4(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0;var s=0,l=0;return l=h,h=h+16|0,s=l|0,Q8(e,n,r,o,s)|0,h=l,be=t[s+4>>2]|0,t[s>>2]|0|0}function Z8(e){return e=e|0,(e&255)<<24|(e>>8&255)<<16|(e>>16&255)<<8|e>>>24|0}function RL(e,n,r,o,s,l){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0,eD[e&1](n|0,r|0,o|0,s|0,l|0)}function NL(e,n,r){e=e|0,n=n|0,r=w(r),tD[e&1](n|0,w(r))}function BL(e,n,r){e=e|0,n=n|0,r=+r,nD[e&31](n|0,+r)}function jL(e,n,r,o){return e=e|0,n=n|0,r=w(r),o=w(o),w(rD[e&0](n|0,w(r),w(o)))}function UL(e,n){e=e|0,n=n|0,Nl[e&127](n|0)}function qL(e,n,r){e=e|0,n=n|0,r=r|0,Bl[e&31](n|0,r|0)}function zL(e,n){return e=e|0,n=n|0,dc[e&31](n|0)|0}function WL(e,n,r,o,s){e=e|0,n=n|0,r=+r,o=+o,s=s|0,iD[e&1](n|0,+r,+o,s|0)}function HL(e,n,r,o){e=e|0,n=n|0,r=+r,o=+o,CR[e&1](n|0,+r,+o)}function bL(e,n,r,o){return e=e|0,n=n|0,r=r|0,o=o|0,dh[e&7](n|0,r|0,o|0)|0}function VL(e,n,r,o){return e=e|0,n=n|0,r=r|0,o=o|0,+TR[e&1](n|0,r|0,o|0)}function YL(e,n){return e=e|0,n=n|0,+oD[e&15](n|0)}function $L(e,n,r){return e=e|0,n=n|0,r=+r,xR[e&1](n|0,+r)|0}function KL(e,n,r){return e=e|0,n=n|0,r=r|0,J4[e&15](n|0,r|0)|0}function XL(e,n,r,o,s,l){e=e|0,n=n|0,r=r|0,o=+o,s=+s,l=l|0,kR[e&1](n|0,r|0,+o,+s,l|0)}function JL(e,n,r,o,s,l,d){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0,d=d|0,AR[e&1](n|0,r|0,o|0,s|0,l|0,d|0)}function QL(e,n,r){return e=e|0,n=n|0,r=r|0,+uD[e&7](n|0,r|0)}function ZL(e){return e=e|0,ph[e&7]()|0}function eR(e,n,r,o,s,l){return e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0,sD[e&1](n|0,r|0,o|0,s|0,l|0)|0}function tR(e,n,r,o,s){e=e|0,n=n|0,r=r|0,o=o|0,s=+s,OR[e&1](n|0,r|0,o|0,+s)}function nR(e,n,r,o,s,l,d){e=e|0,n=n|0,r=r|0,o=w(o),s=s|0,l=w(l),d=d|0,lD[e&1](n|0,r|0,w(o),s|0,w(l),d|0)}function rR(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0,X1[e&15](n|0,r|0,o|0)}function iR(e){e=e|0,fD[e&0]()}function oR(e,n,r,o){e=e|0,n=n|0,r=r|0,o=+o,cD[e&15](n|0,r|0,+o)}function uR(e,n,r){return e=e|0,n=+n,r=+r,IR[e&1](+n,+r)|0}function sR(e,n,r,o,s){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,Q4[e&15](n|0,r|0,o|0,s|0)}function lR(e,n,r,o,s){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,pt(0)}function fR(e,n){e=e|0,n=w(n),pt(1)}function Lo(e,n){e=e|0,n=+n,pt(2)}function cR(e,n,r){return e=e|0,n=w(n),r=w(r),pt(3),tt}function tn(e){e=e|0,pt(4)}function $1(e,n){e=e|0,n=n|0,pt(5)}function tu(e){return e=e|0,pt(6),0}function aR(e,n,r,o){e=e|0,n=+n,r=+r,o=o|0,pt(7)}function dR(e,n,r){e=e|0,n=+n,r=+r,pt(8)}function pR(e,n,r){return e=e|0,n=n|0,r=r|0,pt(9),0}function hR(e,n,r){return e=e|0,n=n|0,r=r|0,pt(10),0}function ac(e){return e=e|0,pt(11),0}function mR(e,n){return e=e|0,n=+n,pt(12),0}function K1(e,n){return e=e|0,n=n|0,pt(13),0}function vR(e,n,r,o,s){e=e|0,n=n|0,r=+r,o=+o,s=s|0,pt(14)}function gR(e,n,r,o,s,l){e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,l=l|0,pt(15)}function X4(e,n){return e=e|0,n=n|0,pt(16),0}function _R(){return pt(17),0}function yR(e,n,r,o,s){return e=e|0,n=n|0,r=r|0,o=o|0,s=s|0,pt(18),0}function wR(e,n,r,o){e=e|0,n=n|0,r=r|0,o=+o,pt(19)}function DR(e,n,r,o,s,l){e=e|0,n=n|0,r=w(r),o=o|0,s=w(s),l=l|0,pt(20)}function ah(e,n,r){e=e|0,n=n|0,r=r|0,pt(21)}function ER(){pt(22)}function ha(e,n,r){e=e|0,n=n|0,r=+r,pt(23)}function SR(e,n){return e=+e,n=+n,pt(24),0}function ma(e,n,r,o){e=e|0,n=n|0,r=r|0,o=o|0,pt(25)}var eD=[lR,_I],tD=[fR,x0],nD=[Lo,Kf,Tl,xl,hf,xo,mf,Wa,Hs,mi,Xf,Rc,Jf,ao,$o,kl,Nc,Al,vf,Lo,Lo,Lo,Lo,Lo,Lo,Lo,Lo,Lo,Lo,Lo,Lo,Lo],rD=[cR],Nl=[tn,da,Km,Xm,es,a_,d_,p_,YA,$A,KA,oI,uI,sI,kF,AF,OF,Sn,Oc,pf,ti,vi,Nm,Uc,r1,Hd,Pl,mv,Av,Kc,Jc,yp,Eg,na,Ug,Yg,u_,k_,q_,J_,a4,Ct,w9,U9,ex,hx,Ix,_0,s7,S7,W7,uk,Dk,Wk,Qk,tA,_A,DA,jA,JA,eO,gO,RO,d1,vP,YP,lM,SM,GM,uF,gF,wF,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn,tn],Bl=[$1,ja,Ua,$f,gu,co,qa,Ws,za,Mc,Fc,Lc,po,Ce,ze,Et,on,sr,mn,Zf,gd,xd,H9,rx,ck,yP,HO,C8,$1,$1,$1,$1],dc=[tu,iL,Ba,m,b,ee,Ye,Ze,ut,In,jr,gi,Pm,Ha,Ya,Fx,Tk,wO,SP,Qo,tu,tu,tu,tu,tu,tu,tu,tu,tu,tu,tu,tu],iD=[aR,Sd],CR=[dR,zA],dh=[pR,j8,oL,lL,Gv,P_,a7,kM],TR=[hR,Op],oD=[ac,_i,Re,pr,Cd,ho,bs,$a,Td,qc,ac,ac,ac,ac,ac,ac],xR=[mR,Kk],J4=[K1,OL,vd,Vc,_v,ig,pg,f_,H_,_x,Xu,dM,K1,K1,K1,K1],kR=[vR,iv],AR=[gR,KM],uD=[X4,Hr,Ka,kd,Xa,Jg,X4,X4],ph=[_R,Ja,Z0,g0,oA,TA,iO,CF],sD=[yR,or],OR=[wR,m4],lD=[DR,Bc],X1=[ah,S,A0,Vn,ni,Mv,Tg,dn,C9,fo,zI,JP,cF,ah,ah,ah],fD=[ER],cD=[ha,Ic,vu,Pc,Qu,Qf,k0,v,W1,k7,Gk,ha,ha,ha,ha,ha],IR=[SR,GA],Q4=[ma,Fg,zx,V7,Lk,aA,PA,aO,qO,OP,RF,ma,ma,ma,ma,ma];return{_llvm_bswap_i32:Z8,dynCall_idd:uR,dynCall_i:ZL,_i64Subtract:fh,___udivdi3:$4,dynCall_vif:NL,setThrew:vl,dynCall_viii:rR,_bitshift64Lshr:ch,_bitshift64Shl:X8,dynCall_vi:UL,dynCall_viiddi:XL,dynCall_diii:VL,dynCall_iii:KL,_memset:pa,_sbrk:xf,_memcpy:vn,__GLOBAL__sub_I_Yoga_cpp:t0,dynCall_vii:qL,___uremdi3:K4,dynCall_vid:BL,stackAlloc:zi,_nbind_init:VF,getTempRet0:fu,dynCall_di:YL,dynCall_iid:$L,setTempRet0:gl,_i64Add:Y4,dynCall_fiff:jL,dynCall_iiii:bL,_emscripten_get_global_libc:rL,dynCall_viid:oR,dynCall_viiid:tR,dynCall_viififi:nR,dynCall_ii:zL,__GLOBAL__sub_I_Binding_cc:lP,dynCall_viiii:sR,dynCall_iiiiii:eR,stackSave:lu,dynCall_viiiii:RL,__GLOBAL__sub_I_nbind_cc:Gs,dynCall_vidd:HL,_free:sh,runPostSets:LL,dynCall_viiiiii:JL,establishStackSpace:O0,_memmove:Y1,stackRestore:Ho,_malloc:uh,__GLOBAL__sub_I_common_cc:AO,dynCall_viddi:WL,dynCall_dii:QL,dynCall_v:iR}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),_llvm_bswap_i32=Module._llvm_bswap_i32=asm._llvm_bswap_i32,getTempRet0=Module.getTempRet0=asm.getTempRet0,___udivdi3=Module.___udivdi3=asm.___udivdi3,setThrew=Module.setThrew=asm.setThrew,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,_memset=Module._memset=asm._memset,_sbrk=Module._sbrk=asm._sbrk,_memcpy=Module._memcpy=asm._memcpy,stackAlloc=Module.stackAlloc=asm.stackAlloc,___uremdi3=Module.___uremdi3=asm.___uremdi3,_nbind_init=Module._nbind_init=asm._nbind_init,_i64Subtract=Module._i64Subtract=asm._i64Subtract,setTempRet0=Module.setTempRet0=asm.setTempRet0,_i64Add=Module._i64Add=asm._i64Add,_emscripten_get_global_libc=Module._emscripten_get_global_libc=asm._emscripten_get_global_libc,__GLOBAL__sub_I_Yoga_cpp=Module.__GLOBAL__sub_I_Yoga_cpp=asm.__GLOBAL__sub_I_Yoga_cpp,__GLOBAL__sub_I_Binding_cc=Module.__GLOBAL__sub_I_Binding_cc=asm.__GLOBAL__sub_I_Binding_cc,stackSave=Module.stackSave=asm.stackSave,__GLOBAL__sub_I_nbind_cc=Module.__GLOBAL__sub_I_nbind_cc=asm.__GLOBAL__sub_I_nbind_cc,_free=Module._free=asm._free,runPostSets=Module.runPostSets=asm.runPostSets,establishStackSpace=Module.establishStackSpace=asm.establishStackSpace,_memmove=Module._memmove=asm._memmove,stackRestore=Module.stackRestore=asm.stackRestore,_malloc=Module._malloc=asm._malloc,__GLOBAL__sub_I_common_cc=Module.__GLOBAL__sub_I_common_cc=asm.__GLOBAL__sub_I_common_cc,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vif=Module.dynCall_vif=asm.dynCall_vif,dynCall_vid=Module.dynCall_vid=asm.dynCall_vid,dynCall_fiff=Module.dynCall_fiff=asm.dynCall_fiff,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_vii=Module.dynCall_vii=asm.dynCall_vii,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viddi=Module.dynCall_viddi=asm.dynCall_viddi,dynCall_vidd=Module.dynCall_vidd=asm.dynCall_vidd,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_diii=Module.dynCall_diii=asm.dynCall_diii,dynCall_di=Module.dynCall_di=asm.dynCall_di,dynCall_iid=Module.dynCall_iid=asm.dynCall_iid,dynCall_iii=Module.dynCall_iii=asm.dynCall_iii,dynCall_viiddi=Module.dynCall_viiddi=asm.dynCall_viiddi,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_dii=Module.dynCall_dii=asm.dynCall_dii,dynCall_i=Module.dynCall_i=asm.dynCall_i,dynCall_iiiiii=Module.dynCall_iiiiii=asm.dynCall_iiiiii,dynCall_viiid=Module.dynCall_viiid=asm.dynCall_viiid,dynCall_viififi=Module.dynCall_viififi=asm.dynCall_viififi,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viid=Module.dynCall_viid=asm.dynCall_viid,dynCall_idd=Module.dynCall_idd=asm.dynCall_idd,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii;Runtime.stackAlloc=Module.stackAlloc,Runtime.stackSave=Module.stackSave,Runtime.stackRestore=Module.stackRestore,Runtime.establishStackSpace=Module.establishStackSpace,Runtime.setTempRet0=Module.setTempRet0,Runtime.getTempRet0=Module.getTempRet0,Module.asm=asm;function ExitStatus(i){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+i+\")\",this.status=i}ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var initialStackTop,preloadStartTime=null,calledMain=!1;dependenciesFulfilled=function i(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=i)},Module.callMain=Module.callMain=function(u){u=u||[],ensureInitRuntime();var f=u.length+1;function c(){for(var x=0;x<4-1;x++)g.push(0)}var g=[allocate(intArrayFromString(Module.thisProgram),\"i8\",ALLOC_NORMAL)];c();for(var t=0;t<f-1;t=t+1)g.push(allocate(intArrayFromString(u[t]),\"i8\",ALLOC_NORMAL)),c();g.push(0),g=allocate(g,\"i32\",ALLOC_NORMAL);try{var C=Module._main(f,g,0);exit(C,!0)}catch(x){if(x instanceof ExitStatus)return;if(x==\"SimulateInfiniteLoop\"){Module.noExitRuntime=!0;return}else{var A=x;x&&typeof x==\"object\"&&x.stack&&(A=[x,x.stack]),Module.printErr(\"exception thrown: \"+A),Module.quit(1,x)}}finally{calledMain=!0}};function run(i){if(i=i||Module.arguments,preloadStartTime===null&&(preloadStartTime=Date.now()),runDependencies>0||(preRun(),runDependencies>0)||Module.calledRun)return;function u(){Module.calledRun||(Module.calledRun=!0,!ABORT&&(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(i),postRun()))}Module.setStatus?(Module.setStatus(\"Running...\"),setTimeout(function(){setTimeout(function(){Module.setStatus(\"\")},1),u()},1)):u()}Module.run=Module.run=run;function exit(i,u){u&&Module.noExitRuntime||(Module.noExitRuntime||(ABORT=!0,EXITSTATUS=i,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(i)),ENVIRONMENT_IS_NODE&&process.exit(i),Module.quit(i,new ExitStatus(i)))}Module.exit=Module.exit=exit;var abortDecorators=[];function abort(i){Module.onAbort&&Module.onAbort(i),i!==void 0?(Module.print(i),Module.printErr(i),i=JSON.stringify(i)):i=\"\",ABORT=!0,EXITSTATUS=1;var u=`\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.`,f=\"abort(\"+i+\") at \"+stackTrace()+u;throw abortDecorators&&abortDecorators.forEach(function(c){f=c(f,i)}),f}if(Module.abort=Module.abort=abort,Module.preInit)for(typeof Module.preInit==\"function\"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()})});var hc=Me((hb,vE)=>{\"use strict\";var wN=hE(),DN=mE(),Py=!1,My=null;DN({},function(i,u){if(!Py){if(Py=!0,i)throw i;My=u}});if(!Py)throw new Error(\"Failed to load the yoga module - it needed to be loaded synchronously, but didn't\");vE.exports=wN(My.bind,My.lib)});var _E=Me((mb,gE)=>{\"use strict\";gE.exports=({onlyFirst:i=!1}={})=>{let u=[\"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:[a-zA-Z\\\\d]*(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)\",\"(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-ntqry=><~]))\"].join(\"|\");return new RegExp(u,i?void 0:\"g\")}});var Fy=Me((vb,yE)=>{\"use strict\";var EN=_E();yE.exports=i=>typeof i==\"string\"?i.replace(EN(),\"\"):i});var Ry=Me((gb,Ly)=>{\"use strict\";var wE=i=>Number.isNaN(i)?!1:i>=4352&&(i<=4447||i===9001||i===9002||11904<=i&&i<=12871&&i!==12351||12880<=i&&i<=19903||19968<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65131||65281<=i&&i<=65376||65504<=i&&i<=65510||110592<=i&&i<=110593||127488<=i&&i<=127569||131072<=i&&i<=262141);Ly.exports=wE;Ly.exports.default=wE});var EE=Me((_b,DE)=>{\"use strict\";DE.exports=function(){return/\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62(?:\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67|\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74|\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73)\\uDB40\\uDC7F|\\uD83D\\uDC68(?:\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C\\uDFFB|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFE])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83D\\uDC68|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D[\\uDC66\\uDC67])|[\\u2695\\u2696\\u2708]\\uFE0F|\\uD83D[\\uDC66\\uDC67]|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|(?:\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708])\\uFE0F|\\uD83C\\uDFFB\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C[\\uDFFB-\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFB\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D\\uD83D\\uDC69)\\uD83C\\uDFFB|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])|\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1)|(?:\\uD83E\\uDDD1\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFE])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D\\uD83D\\uDC69)(?:\\uD83C[\\uDFFB\\uDFFC])|\\uD83D\\uDC69(?:\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFB\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFC-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|(?:\\uD83E\\uDDD1\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D\\uD83D\\uDC69)(?:\\uD83C[\\uDFFB-\\uDFFD])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D\\uDC41\\uFE0F\\u200D\\uD83D\\uDDE8|\\uD83D\\uDC69(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|(?:(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)\\uFE0F|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF])\\u200D[\\u2640\\u2642]|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD6-\\uDDDD])(?:(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|\\u200D[\\u2640\\u2642])|\\uD83C\\uDFF4\\u200D\\u2620)\\uFE0F|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83C\\uDFF3\\uFE0F\\u200D\\uD83C\\uDF08|\\uD83D\\uDC15\\u200D\\uD83E\\uDDBA|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67|\\uD83C\\uDDFD\\uD83C\\uDDF0|\\uD83C\\uDDF4\\uD83C\\uDDF2|\\uD83C\\uDDF6\\uD83C\\uDDE6|[#\\*0-9]\\uFE0F\\u20E3|\\uD83C\\uDDE7(?:\\uD83C[\\uDDE6\\uDDE7\\uDDE9-\\uDDEF\\uDDF1-\\uDDF4\\uDDF6-\\uDDF9\\uDDFB\\uDDFC\\uDDFE\\uDDFF])|\\uD83C\\uDDF9(?:\\uD83C[\\uDDE6\\uDDE8\\uDDE9\\uDDEB-\\uDDED\\uDDEF-\\uDDF4\\uDDF7\\uDDF9\\uDDFB\\uDDFC\\uDDFF])|\\uD83C\\uDDEA(?:\\uD83C[\\uDDE6\\uDDE8\\uDDEA\\uDDEC\\uDDED\\uDDF7-\\uDDFA])|\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83C\\uDDF7(?:\\uD83C[\\uDDEA\\uDDF4\\uDDF8\\uDDFA\\uDDFC])|\\uD83D\\uDC69(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83C\\uDDF2(?:\\uD83C[\\uDDE6\\uDDE8-\\uDDED\\uDDF0-\\uDDFF])|\\uD83C\\uDDE6(?:\\uD83C[\\uDDE8-\\uDDEC\\uDDEE\\uDDF1\\uDDF2\\uDDF4\\uDDF6-\\uDDFA\\uDDFC\\uDDFD\\uDDFF])|\\uD83C\\uDDF0(?:\\uD83C[\\uDDEA\\uDDEC-\\uDDEE\\uDDF2\\uDDF3\\uDDF5\\uDDF7\\uDDFC\\uDDFE\\uDDFF])|\\uD83C\\uDDED(?:\\uD83C[\\uDDF0\\uDDF2\\uDDF3\\uDDF7\\uDDF9\\uDDFA])|\\uD83C\\uDDE9(?:\\uD83C[\\uDDEA\\uDDEC\\uDDEF\\uDDF0\\uDDF2\\uDDF4\\uDDFF])|\\uD83C\\uDDFE(?:\\uD83C[\\uDDEA\\uDDF9])|\\uD83C\\uDDEC(?:\\uD83C[\\uDDE6\\uDDE7\\uDDE9-\\uDDEE\\uDDF1-\\uDDF3\\uDDF5-\\uDDFA\\uDDFC\\uDDFE])|\\uD83C\\uDDF8(?:\\uD83C[\\uDDE6-\\uDDEA\\uDDEC-\\uDDF4\\uDDF7-\\uDDF9\\uDDFB\\uDDFD-\\uDDFF])|\\uD83C\\uDDEB(?:\\uD83C[\\uDDEE-\\uDDF0\\uDDF2\\uDDF4\\uDDF7])|\\uD83C\\uDDF5(?:\\uD83C[\\uDDE6\\uDDEA-\\uDDED\\uDDF0-\\uDDF3\\uDDF7-\\uDDF9\\uDDFC\\uDDFE])|\\uD83C\\uDDFB(?:\\uD83C[\\uDDE6\\uDDE8\\uDDEA\\uDDEC\\uDDEE\\uDDF3\\uDDFA])|\\uD83C\\uDDF3(?:\\uD83C[\\uDDE6\\uDDE8\\uDDEA-\\uDDEC\\uDDEE\\uDDF1\\uDDF4\\uDDF5\\uDDF7\\uDDFA\\uDDFF])|\\uD83C\\uDDE8(?:\\uD83C[\\uDDE6\\uDDE8\\uDDE9\\uDDEB-\\uDDEE\\uDDF0-\\uDDF5\\uDDF7\\uDDFA-\\uDDFF])|\\uD83C\\uDDF1(?:\\uD83C[\\uDDE6-\\uDDE8\\uDDEE\\uDDF0\\uDDF7-\\uDDFB\\uDDFE])|\\uD83C\\uDDFF(?:\\uD83C[\\uDDE6\\uDDF2\\uDDFC])|\\uD83C\\uDDFC(?:\\uD83C[\\uDDEB\\uDDF8])|\\uD83C\\uDDFA(?:\\uD83C[\\uDDE6\\uDDEC\\uDDF2\\uDDF3\\uDDF8\\uDDFE\\uDDFF])|\\uD83C\\uDDEE(?:\\uD83C[\\uDDE8-\\uDDEA\\uDDF1-\\uDDF4\\uDDF6-\\uDDF9])|\\uD83C\\uDDEF(?:\\uD83C[\\uDDEA\\uDDF2\\uDDF4\\uDDF5])|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD6-\\uDDDD])(?:\\uD83C[\\uDFFB-\\uDFFF])|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uD83C[\\uDFFB-\\uDFFF])|(?:[\\u261D\\u270A-\\u270D]|\\uD83C[\\uDF85\\uDFC2\\uDFC7]|\\uD83D[\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66\\uDC67\\uDC6B-\\uDC6D\\uDC70\\uDC72\\uDC74-\\uDC76\\uDC78\\uDC7C\\uDC83\\uDC85\\uDCAA\\uDD74\\uDD7A\\uDD90\\uDD95\\uDD96\\uDE4C\\uDE4F\\uDEC0\\uDECC]|\\uD83E[\\uDD0F\\uDD18-\\uDD1C\\uDD1E\\uDD1F\\uDD30-\\uDD36\\uDDB5\\uDDB6\\uDDBB\\uDDD2-\\uDDD5])(?:\\uD83C[\\uDFFB-\\uDFFF])|(?:[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u270A\\u270B\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF93\\uDFA0-\\uDFCA\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF4\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC3E\\uDC40\\uDC42-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDD7A\\uDD95\\uDD96\\uDDA4\\uDDFB-\\uDE4F\\uDE80-\\uDEC5\\uDECC\\uDED0-\\uDED2\\uDED5\\uDEEB\\uDEEC\\uDEF4-\\uDEFA\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0D-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD71\\uDD73-\\uDD76\\uDD7A-\\uDDA2\\uDDA5-\\uDDAA\\uDDAE-\\uDDCA\\uDDCD-\\uDDFF\\uDE70-\\uDE73\\uDE78-\\uDE7A\\uDE80-\\uDE82\\uDE90-\\uDE95])|(?:[#\\*0-9\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23E9-\\u23F3\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB-\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u261D\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A1\\u26AA\\u26AB\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C5\\u26C8\\u26CE\\u26CF\\u26D1\\u26D3\\u26D4\\u26E9\\u26EA\\u26F0-\\u26F5\\u26F7-\\u26FA\\u26FD\\u2702\\u2705\\u2708-\\u270D\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2728\\u2733\\u2734\\u2744\\u2747\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2763\\u2764\\u2795-\\u2797\\u27A1\\u27B0\\u27BF\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B50\\u2B55\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDC04\\uDCCF\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE02\\uDE1A\\uDE2F\\uDE32-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF21\\uDF24-\\uDF93\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E-\\uDFF0\\uDFF3-\\uDFF5\\uDFF7-\\uDFFF]|\\uD83D[\\uDC00-\\uDCFD\\uDCFF-\\uDD3D\\uDD49-\\uDD4E\\uDD50-\\uDD67\\uDD6F\\uDD70\\uDD73-\\uDD7A\\uDD87\\uDD8A-\\uDD8D\\uDD90\\uDD95\\uDD96\\uDDA4\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-\\uDDD3\\uDDDC-\\uDDDE\\uDDE1\\uDDE3\\uDDE8\\uDDEF\\uDDF3\\uDDFA-\\uDE4F\\uDE80-\\uDEC5\\uDECB-\\uDED2\\uDED5\\uDEE0-\\uDEE5\\uDEE9\\uDEEB\\uDEEC\\uDEF0\\uDEF3-\\uDEFA\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0D-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD71\\uDD73-\\uDD76\\uDD7A-\\uDDA2\\uDDA5-\\uDDAA\\uDDAE-\\uDDCA\\uDDCD-\\uDDFF\\uDE70-\\uDE73\\uDE78-\\uDE7A\\uDE80-\\uDE82\\uDE90-\\uDE95])\\uFE0F|(?:[\\u261D\\u26F9\\u270A-\\u270D]|\\uD83C[\\uDF85\\uDFC2-\\uDFC4\\uDFC7\\uDFCA-\\uDFCC]|\\uD83D[\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66-\\uDC78\\uDC7C\\uDC81-\\uDC83\\uDC85-\\uDC87\\uDC8F\\uDC91\\uDCAA\\uDD74\\uDD75\\uDD7A\\uDD90\\uDD95\\uDD96\\uDE45-\\uDE47\\uDE4B-\\uDE4F\\uDEA3\\uDEB4-\\uDEB6\\uDEC0\\uDECC]|\\uD83E[\\uDD0F\\uDD18-\\uDD1F\\uDD26\\uDD30-\\uDD39\\uDD3C-\\uDD3E\\uDDB5\\uDDB6\\uDDB8\\uDDB9\\uDDBB\\uDDCD-\\uDDCF\\uDDD1-\\uDDDD])/g}});var Mh=Me((yb,Ny)=>{\"use strict\";var SN=Fy(),CN=Ry(),TN=EE(),SE=i=>{if(i=i.replace(TN(),\"  \"),typeof i!=\"string\"||i.length===0)return 0;i=SN(i);let u=0;for(let f=0;f<i.length;f++){let c=i.codePointAt(f);c<=31||c>=127&&c<=159||c>=768&&c<=879||(c>65535&&f++,u+=CN(c)?2:1)}return u};Ny.exports=SE;Ny.exports.default=SE});var jy=Me((wb,By)=>{\"use strict\";var xN=Mh(),CE=i=>{let u=0;for(let f of i.split(`\n`))u=Math.max(u,xN(f));return u};By.exports=CE;By.exports.default=CE});var TE=Me(a2=>{\"use strict\";var kN=a2&&a2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(a2,\"__esModule\",{value:!0});var AN=kN(jy()),Uy={};a2.default=i=>{if(i.length===0)return{width:0,height:0};if(Uy[i])return Uy[i];let u=AN.default(i),f=i.split(`\n`).length;return Uy[i]={width:u,height:f},{width:u,height:f}}});var xE=Me(d2=>{\"use strict\";var ON=d2&&d2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(d2,\"__esModule\",{value:!0});var hr=ON(hc()),IN=(i,u)=>{\"position\"in u&&i.setPositionType(u.position===\"absolute\"?hr.default.POSITION_TYPE_ABSOLUTE:hr.default.POSITION_TYPE_RELATIVE)},PN=(i,u)=>{\"marginLeft\"in u&&i.setMargin(hr.default.EDGE_START,u.marginLeft||0),\"marginRight\"in u&&i.setMargin(hr.default.EDGE_END,u.marginRight||0),\"marginTop\"in u&&i.setMargin(hr.default.EDGE_TOP,u.marginTop||0),\"marginBottom\"in u&&i.setMargin(hr.default.EDGE_BOTTOM,u.marginBottom||0)},MN=(i,u)=>{\"paddingLeft\"in u&&i.setPadding(hr.default.EDGE_LEFT,u.paddingLeft||0),\"paddingRight\"in u&&i.setPadding(hr.default.EDGE_RIGHT,u.paddingRight||0),\"paddingTop\"in u&&i.setPadding(hr.default.EDGE_TOP,u.paddingTop||0),\"paddingBottom\"in u&&i.setPadding(hr.default.EDGE_BOTTOM,u.paddingBottom||0)},FN=(i,u)=>{var f;\"flexGrow\"in u&&i.setFlexGrow((f=u.flexGrow)!==null&&f!==void 0?f:0),\"flexShrink\"in u&&i.setFlexShrink(typeof u.flexShrink==\"number\"?u.flexShrink:1),\"flexDirection\"in u&&(u.flexDirection===\"row\"&&i.setFlexDirection(hr.default.FLEX_DIRECTION_ROW),u.flexDirection===\"row-reverse\"&&i.setFlexDirection(hr.default.FLEX_DIRECTION_ROW_REVERSE),u.flexDirection===\"column\"&&i.setFlexDirection(hr.default.FLEX_DIRECTION_COLUMN),u.flexDirection===\"column-reverse\"&&i.setFlexDirection(hr.default.FLEX_DIRECTION_COLUMN_REVERSE)),\"flexBasis\"in u&&(typeof u.flexBasis==\"number\"?i.setFlexBasis(u.flexBasis):typeof u.flexBasis==\"string\"?i.setFlexBasisPercent(Number.parseInt(u.flexBasis,10)):i.setFlexBasis(NaN)),\"alignItems\"in u&&((u.alignItems===\"stretch\"||!u.alignItems)&&i.setAlignItems(hr.default.ALIGN_STRETCH),u.alignItems===\"flex-start\"&&i.setAlignItems(hr.default.ALIGN_FLEX_START),u.alignItems===\"center\"&&i.setAlignItems(hr.default.ALIGN_CENTER),u.alignItems===\"flex-end\"&&i.setAlignItems(hr.default.ALIGN_FLEX_END)),\"alignSelf\"in u&&((u.alignSelf===\"auto\"||!u.alignSelf)&&i.setAlignSelf(hr.default.ALIGN_AUTO),u.alignSelf===\"flex-start\"&&i.setAlignSelf(hr.default.ALIGN_FLEX_START),u.alignSelf===\"center\"&&i.setAlignSelf(hr.default.ALIGN_CENTER),u.alignSelf===\"flex-end\"&&i.setAlignSelf(hr.default.ALIGN_FLEX_END)),\"justifyContent\"in u&&((u.justifyContent===\"flex-start\"||!u.justifyContent)&&i.setJustifyContent(hr.default.JUSTIFY_FLEX_START),u.justifyContent===\"center\"&&i.setJustifyContent(hr.default.JUSTIFY_CENTER),u.justifyContent===\"flex-end\"&&i.setJustifyContent(hr.default.JUSTIFY_FLEX_END),u.justifyContent===\"space-between\"&&i.setJustifyContent(hr.default.JUSTIFY_SPACE_BETWEEN),u.justifyContent===\"space-around\"&&i.setJustifyContent(hr.default.JUSTIFY_SPACE_AROUND))},LN=(i,u)=>{var f,c;\"width\"in u&&(typeof u.width==\"number\"?i.setWidth(u.width):typeof u.width==\"string\"?i.setWidthPercent(Number.parseInt(u.width,10)):i.setWidthAuto()),\"height\"in u&&(typeof u.height==\"number\"?i.setHeight(u.height):typeof u.height==\"string\"?i.setHeightPercent(Number.parseInt(u.height,10)):i.setHeightAuto()),\"minWidth\"in u&&(typeof u.minWidth==\"string\"?i.setMinWidthPercent(Number.parseInt(u.minWidth,10)):i.setMinWidth((f=u.minWidth)!==null&&f!==void 0?f:0)),\"minHeight\"in u&&(typeof u.minHeight==\"string\"?i.setMinHeightPercent(Number.parseInt(u.minHeight,10)):i.setMinHeight((c=u.minHeight)!==null&&c!==void 0?c:0))},RN=(i,u)=>{\"display\"in u&&i.setDisplay(u.display===\"flex\"?hr.default.DISPLAY_FLEX:hr.default.DISPLAY_NONE)},NN=(i,u)=>{if(\"borderStyle\"in u){let f=typeof u.borderStyle==\"string\"?1:0;i.setBorder(hr.default.EDGE_TOP,f),i.setBorder(hr.default.EDGE_BOTTOM,f),i.setBorder(hr.default.EDGE_LEFT,f),i.setBorder(hr.default.EDGE_RIGHT,f)}};d2.default=(i,u={})=>{IN(i,u),PN(i,u),MN(i,u),FN(i,u),LN(i,u),RN(i,u),NN(i,u)}});var AE=Me((Sb,kE)=>{\"use strict\";kE.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var qy=Me((Cb,OE)=>{var p2=AE(),IE={};for(let i of Object.keys(p2))IE[p2[i]]=i;var Xt={rgb:{channels:3,labels:\"rgb\"},hsl:{channels:3,labels:\"hsl\"},hsv:{channels:3,labels:\"hsv\"},hwb:{channels:3,labels:\"hwb\"},cmyk:{channels:4,labels:\"cmyk\"},xyz:{channels:3,labels:\"xyz\"},lab:{channels:3,labels:\"lab\"},lch:{channels:3,labels:\"lch\"},hex:{channels:1,labels:[\"hex\"]},keyword:{channels:1,labels:[\"keyword\"]},ansi16:{channels:1,labels:[\"ansi16\"]},ansi256:{channels:1,labels:[\"ansi256\"]},hcg:{channels:3,labels:[\"h\",\"c\",\"g\"]},apple:{channels:3,labels:[\"r16\",\"g16\",\"b16\"]},gray:{channels:1,labels:[\"gray\"]}};OE.exports=Xt;for(let i of Object.keys(Xt)){if(!(\"channels\"in Xt[i]))throw new Error(\"missing channels property: \"+i);if(!(\"labels\"in Xt[i]))throw new Error(\"missing channel labels property: \"+i);if(Xt[i].labels.length!==Xt[i].channels)throw new Error(\"channel and label counts mismatch: \"+i);let{channels:u,labels:f}=Xt[i];delete Xt[i].channels,delete Xt[i].labels,Object.defineProperty(Xt[i],\"channels\",{value:u}),Object.defineProperty(Xt[i],\"labels\",{value:f})}Xt.rgb.hsl=function(i){let u=i[0]/255,f=i[1]/255,c=i[2]/255,g=Math.min(u,f,c),t=Math.max(u,f,c),C=t-g,A,x;t===g?A=0:u===t?A=(f-c)/C:f===t?A=2+(c-u)/C:c===t&&(A=4+(u-f)/C),A=Math.min(A*60,360),A<0&&(A+=360);let D=(g+t)/2;return t===g?x=0:D<=.5?x=C/(t+g):x=C/(2-t-g),[A,x*100,D*100]};Xt.rgb.hsv=function(i){let u,f,c,g,t,C=i[0]/255,A=i[1]/255,x=i[2]/255,D=Math.max(C,A,x),L=D-Math.min(C,A,x),N=function(j){return(D-j)/6/L+1/2};return L===0?(g=0,t=0):(t=L/D,u=N(C),f=N(A),c=N(x),C===D?g=c-f:A===D?g=1/3+u-c:x===D&&(g=2/3+f-u),g<0?g+=1:g>1&&(g-=1)),[g*360,t*100,D*100]};Xt.rgb.hwb=function(i){let u=i[0],f=i[1],c=i[2],g=Xt.rgb.hsl(i)[0],t=1/255*Math.min(u,Math.min(f,c));return c=1-1/255*Math.max(u,Math.max(f,c)),[g,t*100,c*100]};Xt.rgb.cmyk=function(i){let u=i[0]/255,f=i[1]/255,c=i[2]/255,g=Math.min(1-u,1-f,1-c),t=(1-u-g)/(1-g)||0,C=(1-f-g)/(1-g)||0,A=(1-c-g)/(1-g)||0;return[t*100,C*100,A*100,g*100]};function BN(i,u){return(i[0]-u[0])**2+(i[1]-u[1])**2+(i[2]-u[2])**2}Xt.rgb.keyword=function(i){let u=IE[i];if(u)return u;let f=Infinity,c;for(let g of Object.keys(p2)){let t=p2[g],C=BN(i,t);C<f&&(f=C,c=g)}return c};Xt.keyword.rgb=function(i){return p2[i]};Xt.rgb.xyz=function(i){let u=i[0]/255,f=i[1]/255,c=i[2]/255;u=u>.04045?((u+.055)/1.055)**2.4:u/12.92,f=f>.04045?((f+.055)/1.055)**2.4:f/12.92,c=c>.04045?((c+.055)/1.055)**2.4:c/12.92;let g=u*.4124+f*.3576+c*.1805,t=u*.2126+f*.7152+c*.0722,C=u*.0193+f*.1192+c*.9505;return[g*100,t*100,C*100]};Xt.rgb.lab=function(i){let u=Xt.rgb.xyz(i),f=u[0],c=u[1],g=u[2];f/=95.047,c/=100,g/=108.883,f=f>.008856?f**(1/3):7.787*f+16/116,c=c>.008856?c**(1/3):7.787*c+16/116,g=g>.008856?g**(1/3):7.787*g+16/116;let t=116*c-16,C=500*(f-c),A=200*(c-g);return[t,C,A]};Xt.hsl.rgb=function(i){let u=i[0]/360,f=i[1]/100,c=i[2]/100,g,t,C;if(f===0)return C=c*255,[C,C,C];c<.5?g=c*(1+f):g=c+f-c*f;let A=2*c-g,x=[0,0,0];for(let D=0;D<3;D++)t=u+1/3*-(D-1),t<0&&t++,t>1&&t--,6*t<1?C=A+(g-A)*6*t:2*t<1?C=g:3*t<2?C=A+(g-A)*(2/3-t)*6:C=A,x[D]=C*255;return x};Xt.hsl.hsv=function(i){let u=i[0],f=i[1]/100,c=i[2]/100,g=f,t=Math.max(c,.01);c*=2,f*=c<=1?c:2-c,g*=t<=1?t:2-t;let C=(c+f)/2,A=c===0?2*g/(t+g):2*f/(c+f);return[u,A*100,C*100]};Xt.hsv.rgb=function(i){let u=i[0]/60,f=i[1]/100,c=i[2]/100,g=Math.floor(u)%6,t=u-Math.floor(u),C=255*c*(1-f),A=255*c*(1-f*t),x=255*c*(1-f*(1-t));switch(c*=255,g){case 0:return[c,x,C];case 1:return[A,c,C];case 2:return[C,c,x];case 3:return[C,A,c];case 4:return[x,C,c];case 5:return[c,C,A]}};Xt.hsv.hsl=function(i){let u=i[0],f=i[1]/100,c=i[2]/100,g=Math.max(c,.01),t,C;C=(2-f)*c;let A=(2-f)*g;return t=f*g,t/=A<=1?A:2-A,t=t||0,C/=2,[u,t*100,C*100]};Xt.hwb.rgb=function(i){let u=i[0]/360,f=i[1]/100,c=i[2]/100,g=f+c,t;g>1&&(f/=g,c/=g);let C=Math.floor(6*u),A=1-c;t=6*u-C,(C&1)!=0&&(t=1-t);let x=f+t*(A-f),D,L,N;switch(C){default:case 6:case 0:D=A,L=x,N=f;break;case 1:D=x,L=A,N=f;break;case 2:D=f,L=A,N=x;break;case 3:D=f,L=x,N=A;break;case 4:D=x,L=f,N=A;break;case 5:D=A,L=f,N=x;break}return[D*255,L*255,N*255]};Xt.cmyk.rgb=function(i){let u=i[0]/100,f=i[1]/100,c=i[2]/100,g=i[3]/100,t=1-Math.min(1,u*(1-g)+g),C=1-Math.min(1,f*(1-g)+g),A=1-Math.min(1,c*(1-g)+g);return[t*255,C*255,A*255]};Xt.xyz.rgb=function(i){let u=i[0]/100,f=i[1]/100,c=i[2]/100,g,t,C;return g=u*3.2406+f*-1.5372+c*-.4986,t=u*-.9689+f*1.8758+c*.0415,C=u*.0557+f*-.204+c*1.057,g=g>.0031308?1.055*g**(1/2.4)-.055:g*12.92,t=t>.0031308?1.055*t**(1/2.4)-.055:t*12.92,C=C>.0031308?1.055*C**(1/2.4)-.055:C*12.92,g=Math.min(Math.max(0,g),1),t=Math.min(Math.max(0,t),1),C=Math.min(Math.max(0,C),1),[g*255,t*255,C*255]};Xt.xyz.lab=function(i){let u=i[0],f=i[1],c=i[2];u/=95.047,f/=100,c/=108.883,u=u>.008856?u**(1/3):7.787*u+16/116,f=f>.008856?f**(1/3):7.787*f+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;let g=116*f-16,t=500*(u-f),C=200*(f-c);return[g,t,C]};Xt.lab.xyz=function(i){let u=i[0],f=i[1],c=i[2],g,t,C;t=(u+16)/116,g=f/500+t,C=t-c/200;let A=t**3,x=g**3,D=C**3;return t=A>.008856?A:(t-16/116)/7.787,g=x>.008856?x:(g-16/116)/7.787,C=D>.008856?D:(C-16/116)/7.787,g*=95.047,t*=100,C*=108.883,[g,t,C]};Xt.lab.lch=function(i){let u=i[0],f=i[1],c=i[2],g;g=Math.atan2(c,f)*360/2/Math.PI,g<0&&(g+=360);let C=Math.sqrt(f*f+c*c);return[u,C,g]};Xt.lch.lab=function(i){let u=i[0],f=i[1],g=i[2]/360*2*Math.PI,t=f*Math.cos(g),C=f*Math.sin(g);return[u,t,C]};Xt.rgb.ansi16=function(i,u=null){let[f,c,g]=i,t=u===null?Xt.rgb.hsv(i)[2]:u;if(t=Math.round(t/50),t===0)return 30;let C=30+(Math.round(g/255)<<2|Math.round(c/255)<<1|Math.round(f/255));return t===2&&(C+=60),C};Xt.hsv.ansi16=function(i){return Xt.rgb.ansi16(Xt.hsv.rgb(i),i[2])};Xt.rgb.ansi256=function(i){let u=i[0],f=i[1],c=i[2];return u===f&&f===c?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(f/255*5)+Math.round(c/255*5)};Xt.ansi16.rgb=function(i){let u=i%10;if(u===0||u===7)return i>50&&(u+=3.5),u=u/10.5*255,[u,u,u];let f=(~~(i>50)+1)*.5,c=(u&1)*f*255,g=(u>>1&1)*f*255,t=(u>>2&1)*f*255;return[c,g,t]};Xt.ansi256.rgb=function(i){if(i>=232){let t=(i-232)*10+8;return[t,t,t]}i-=16;let u,f=Math.floor(i/36)/5*255,c=Math.floor((u=i%36)/6)/5*255,g=u%6/5*255;return[f,c,g]};Xt.rgb.hex=function(i){let f=(((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255)).toString(16).toUpperCase();return\"000000\".substring(f.length)+f};Xt.hex.rgb=function(i){let u=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!u)return[0,0,0];let f=u[0];u[0].length===3&&(f=f.split(\"\").map(A=>A+A).join(\"\"));let c=parseInt(f,16),g=c>>16&255,t=c>>8&255,C=c&255;return[g,t,C]};Xt.rgb.hcg=function(i){let u=i[0]/255,f=i[1]/255,c=i[2]/255,g=Math.max(Math.max(u,f),c),t=Math.min(Math.min(u,f),c),C=g-t,A,x;return C<1?A=t/(1-C):A=0,C<=0?x=0:g===u?x=(f-c)/C%6:g===f?x=2+(c-u)/C:x=4+(u-f)/C,x/=6,x%=1,[x*360,C*100,A*100]};Xt.hsl.hcg=function(i){let u=i[1]/100,f=i[2]/100,c=f<.5?2*u*f:2*u*(1-f),g=0;return c<1&&(g=(f-.5*c)/(1-c)),[i[0],c*100,g*100]};Xt.hsv.hcg=function(i){let u=i[1]/100,f=i[2]/100,c=u*f,g=0;return c<1&&(g=(f-c)/(1-c)),[i[0],c*100,g*100]};Xt.hcg.rgb=function(i){let u=i[0]/360,f=i[1]/100,c=i[2]/100;if(f===0)return[c*255,c*255,c*255];let g=[0,0,0],t=u%1*6,C=t%1,A=1-C,x=0;switch(Math.floor(t)){case 0:g[0]=1,g[1]=C,g[2]=0;break;case 1:g[0]=A,g[1]=1,g[2]=0;break;case 2:g[0]=0,g[1]=1,g[2]=C;break;case 3:g[0]=0,g[1]=A,g[2]=1;break;case 4:g[0]=C,g[1]=0,g[2]=1;break;default:g[0]=1,g[1]=0,g[2]=A}return x=(1-f)*c,[(f*g[0]+x)*255,(f*g[1]+x)*255,(f*g[2]+x)*255]};Xt.hcg.hsv=function(i){let u=i[1]/100,f=i[2]/100,c=u+f*(1-u),g=0;return c>0&&(g=u/c),[i[0],g*100,c*100]};Xt.hcg.hsl=function(i){let u=i[1]/100,c=i[2]/100*(1-u)+.5*u,g=0;return c>0&&c<.5?g=u/(2*c):c>=.5&&c<1&&(g=u/(2*(1-c))),[i[0],g*100,c*100]};Xt.hcg.hwb=function(i){let u=i[1]/100,f=i[2]/100,c=u+f*(1-u);return[i[0],(c-u)*100,(1-c)*100]};Xt.hwb.hcg=function(i){let u=i[1]/100,f=i[2]/100,c=1-f,g=c-u,t=0;return g<1&&(t=(c-g)/(1-g)),[i[0],g*100,t*100]};Xt.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]};Xt.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]};Xt.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]};Xt.gray.hsl=function(i){return[0,0,i[0]]};Xt.gray.hsv=Xt.gray.hsl;Xt.gray.hwb=function(i){return[0,100,i[0]]};Xt.gray.cmyk=function(i){return[0,0,0,i[0]]};Xt.gray.lab=function(i){return[i[0],0,0]};Xt.gray.hex=function(i){let u=Math.round(i[0]/100*255)&255,c=((u<<16)+(u<<8)+u).toString(16).toUpperCase();return\"000000\".substring(c.length)+c};Xt.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]}});var ME=Me((Tb,PE)=>{var Fh=qy();function jN(){let i={},u=Object.keys(Fh);for(let f=u.length,c=0;c<f;c++)i[u[c]]={distance:-1,parent:null};return i}function UN(i){let u=jN(),f=[i];for(u[i].distance=0;f.length;){let c=f.pop(),g=Object.keys(Fh[c]);for(let t=g.length,C=0;C<t;C++){let A=g[C],x=u[A];x.distance===-1&&(x.distance=u[c].distance+1,x.parent=c,f.unshift(A))}}return u}function qN(i,u){return function(f){return u(i(f))}}function zN(i,u){let f=[u[i].parent,i],c=Fh[u[i].parent][i],g=u[i].parent;for(;u[g].parent;)f.unshift(u[g].parent),c=qN(Fh[u[g].parent][g],c),g=u[g].parent;return c.conversion=f,c}PE.exports=function(i){let u=UN(i),f={},c=Object.keys(u);for(let g=c.length,t=0;t<g;t++){let C=c[t];u[C].parent!==null&&(f[C]=zN(C,u))}return f}});var LE=Me((xb,FE)=>{var zy=qy(),WN=ME(),Ca={},HN=Object.keys(zy);function bN(i){let u=function(...f){let c=f[0];return c==null?c:(c.length>1&&(f=c),i(f))};return\"conversion\"in i&&(u.conversion=i.conversion),u}function GN(i){let u=function(...f){let c=f[0];if(c==null)return c;c.length>1&&(f=c);let g=i(f);if(typeof g==\"object\")for(let t=g.length,C=0;C<t;C++)g[C]=Math.round(g[C]);return g};return\"conversion\"in i&&(u.conversion=i.conversion),u}HN.forEach(i=>{Ca[i]={},Object.defineProperty(Ca[i],\"channels\",{value:zy[i].channels}),Object.defineProperty(Ca[i],\"labels\",{value:zy[i].labels});let u=WN(i);Object.keys(u).forEach(c=>{let g=u[c];Ca[i][c]=GN(g),Ca[i][c].raw=bN(g)})});FE.exports=Ca});var Rh=Me((kb,RE)=>{\"use strict\";var NE=(i,u)=>(...f)=>`\u001b[${i(...f)+u}m`,BE=(i,u)=>(...f)=>{let c=i(...f);return`\u001b[${38+u};5;${c}m`},jE=(i,u)=>(...f)=>{let c=i(...f);return`\u001b[${38+u};2;${c[0]};${c[1]};${c[2]}m`},Lh=i=>i,UE=(i,u,f)=>[i,u,f],Ta=(i,u,f)=>{Object.defineProperty(i,u,{get:()=>{let c=f();return Object.defineProperty(i,u,{value:c,enumerable:!0,configurable:!0}),c},enumerable:!0,configurable:!0})},Wy,xa=(i,u,f,c)=>{Wy===void 0&&(Wy=LE());let g=c?10:0,t={};for(let[C,A]of Object.entries(Wy)){let x=C===\"ansi16\"?\"ansi\":C;C===u?t[x]=i(f,g):typeof A==\"object\"&&(t[x]=i(A[u],g))}return t};function VN(){let i=new Map,u={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};u.color.gray=u.color.blackBright,u.bgColor.bgGray=u.bgColor.bgBlackBright,u.color.grey=u.color.blackBright,u.bgColor.bgGrey=u.bgColor.bgBlackBright;for(let[f,c]of Object.entries(u)){for(let[g,t]of Object.entries(c))u[g]={open:`\u001b[${t[0]}m`,close:`\u001b[${t[1]}m`},c[g]=u[g],i.set(t[0],t[1]);Object.defineProperty(u,f,{value:c,enumerable:!1})}return Object.defineProperty(u,\"codes\",{value:i,enumerable:!1}),u.color.close=\"\u001b[39m\",u.bgColor.close=\"\u001b[49m\",Ta(u.color,\"ansi\",()=>xa(NE,\"ansi16\",Lh,!1)),Ta(u.color,\"ansi256\",()=>xa(BE,\"ansi256\",Lh,!1)),Ta(u.color,\"ansi16m\",()=>xa(jE,\"rgb\",UE,!1)),Ta(u.bgColor,\"ansi\",()=>xa(NE,\"ansi16\",Lh,!0)),Ta(u.bgColor,\"ansi256\",()=>xa(BE,\"ansi256\",Lh,!0)),Ta(u.bgColor,\"ansi16m\",()=>xa(jE,\"rgb\",UE,!0)),u}Object.defineProperty(RE,\"exports\",{enumerable:!0,get:VN})});var WE=Me((Ab,qE)=>{\"use strict\";var h2=Mh(),YN=Fy(),$N=Rh(),Hy=new Set([\"\u001b\",\"\\x9B\"]),KN=39,zE=i=>`${Hy.values().next().value}[${i}m`,XN=i=>i.split(\" \").map(u=>h2(u)),by=(i,u,f)=>{let c=[...u],g=!1,t=h2(YN(i[i.length-1]));for(let[C,A]of c.entries()){let x=h2(A);if(t+x<=f?i[i.length-1]+=A:(i.push(A),t=0),Hy.has(A))g=!0;else if(g&&A===\"m\"){g=!1;continue}g||(t+=x,t===f&&C<c.length-1&&(i.push(\"\"),t=0))}!t&&i[i.length-1].length>0&&i.length>1&&(i[i.length-2]+=i.pop())},JN=i=>{let u=i.split(\" \"),f=u.length;for(;f>0&&!(h2(u[f-1])>0);)f--;return f===u.length?i:u.slice(0,f).join(\" \")+u.slice(f).join(\"\")},QN=(i,u,f={})=>{if(f.trim!==!1&&i.trim()===\"\")return\"\";let c=\"\",g=\"\",t,C=XN(i),A=[\"\"];for(let[x,D]of i.split(\" \").entries()){f.trim!==!1&&(A[A.length-1]=A[A.length-1].trimLeft());let L=h2(A[A.length-1]);if(x!==0&&(L>=u&&(f.wordWrap===!1||f.trim===!1)&&(A.push(\"\"),L=0),(L>0||f.trim===!1)&&(A[A.length-1]+=\" \",L++)),f.hard&&C[x]>u){let N=u-L,j=1+Math.floor((C[x]-N-1)/u);Math.floor((C[x]-1)/u)<j&&A.push(\"\"),by(A,D,u);continue}if(L+C[x]>u&&L>0&&C[x]>0){if(f.wordWrap===!1&&L<u){by(A,D,u);continue}A.push(\"\")}if(L+C[x]>u&&f.wordWrap===!1){by(A,D,u);continue}A[A.length-1]+=D}f.trim!==!1&&(A=A.map(JN)),c=A.join(`\n`);for(let[x,D]of[...c].entries()){if(g+=D,Hy.has(D)){let N=parseFloat(/\\d[^m]*/.exec(c.slice(x,x+4)));t=N===KN?null:N}let L=$N.codes.get(Number(t));t&&L&&(c[x+1]===`\n`?g+=zE(L):D===`\n`&&(g+=zE(t)))}return g};qE.exports=(i,u,f)=>String(i).normalize().replace(/\\r\\n/g,`\n`).split(`\n`).map(c=>QN(c,u,f)).join(`\n`)});var GE=Me((Ob,HE)=>{\"use strict\";var bE=\"[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]\",ZN=i=>i&&i.exact?new RegExp(`^${bE}$`):new RegExp(bE,\"g\");HE.exports=ZN});var Gy=Me((Ib,VE)=>{\"use strict\";var eB=Ry(),tB=GE(),YE=Rh(),$E=[\"\u001b\",\"\\x9B\"],Nh=i=>`${$E[0]}[${i}m`,KE=(i,u,f)=>{let c=[];i=[...i];for(let g of i){let t=g;g.match(\";\")&&(g=g.split(\";\")[0][0]+\"0\");let C=YE.codes.get(parseInt(g,10));if(C){let A=i.indexOf(C.toString());A>=0?i.splice(A,1):c.push(Nh(u?C:t))}else if(u){c.push(Nh(0));break}else c.push(Nh(t))}if(u&&(c=c.filter((g,t)=>c.indexOf(g)===t),f!==void 0)){let g=Nh(YE.codes.get(parseInt(f,10)));c=c.reduce((t,C)=>C===g?[C,...t]:[...t,C],[])}return c.join(\"\")};VE.exports=(i,u,f)=>{let c=[...i.normalize()],g=[];f=typeof f==\"number\"?f:c.length;let t=!1,C,A=0,x=\"\";for(let[D,L]of c.entries()){let N=!1;if($E.includes(L)){let j=/\\d[^m]*/.exec(i.slice(D,D+18));C=j&&j.length>0?j[0]:void 0,A<f&&(t=!0,C!==void 0&&g.push(C))}else t&&L===\"m\"&&(t=!1,N=!0);if(!t&&!N&&++A,!tB({exact:!0}).test(L)&&eB(L.codePointAt())&&++A,A>u&&A<=f)x+=L;else if(A===u&&!t&&C!==void 0)x=KE(g);else if(A>=f){x+=KE(g,!0,C);break}}return x}});var JE=Me((Pb,XE)=>{\"use strict\";var Bf=Gy(),nB=Mh();function Bh(i,u,f){if(i.charAt(u)===\" \")return u;for(let c=1;c<=3;c++)if(f){if(i.charAt(u+c)===\" \")return u+c}else if(i.charAt(u-c)===\" \")return u-c;return u}XE.exports=(i,u,f)=>{f=dt({position:\"end\",preferTruncationOnSpace:!1},f);let{position:c,space:g,preferTruncationOnSpace:t}=f,C=\"\\u2026\",A=1;if(typeof i!=\"string\")throw new TypeError(`Expected \\`input\\` to be a string, got ${typeof i}`);if(typeof u!=\"number\")throw new TypeError(`Expected \\`columns\\` to be a number, got ${typeof u}`);if(u<1)return\"\";if(u===1)return C;let x=nB(i);if(x<=u)return i;if(c===\"start\"){if(t){let D=Bh(i,x-u+1,!0);return C+Bf(i,D,x).trim()}return g===!0&&(C+=\" \",A=2),C+Bf(i,x-u+A,x)}if(c===\"middle\"){g===!0&&(C=\" \"+C+\" \",A=3);let D=Math.floor(u/2);if(t){let L=Bh(i,D),N=Bh(i,x-(u-D)+1,!0);return Bf(i,0,L)+C+Bf(i,N,x).trim()}return Bf(i,0,D)+C+Bf(i,x-(u-D)+A,x)}if(c===\"end\"){if(t){let D=Bh(i,u-1);return Bf(i,0,D)+C}return g===!0&&(C=\" \"+C,A=2),Bf(i,0,u-A)+C}throw new Error(`Expected \\`options.position\\` to be either \\`start\\`, \\`middle\\` or \\`end\\`, got ${c}`)}});var Yy=Me(m2=>{\"use strict\";var QE=m2&&m2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(m2,\"__esModule\",{value:!0});var rB=QE(WE()),iB=QE(JE()),Vy={};m2.default=(i,u,f)=>{let c=i+String(u)+String(f);if(Vy[c])return Vy[c];let g=i;if(f===\"wrap\"&&(g=rB.default(i,u,{trim:!1,hard:!0})),f.startsWith(\"truncate\")){let t=\"end\";f===\"truncate-middle\"&&(t=\"middle\"),f===\"truncate-start\"&&(t=\"start\"),g=iB.default(i,u,{position:t})}return Vy[c]=g,g}});var Ky=Me($y=>{\"use strict\";Object.defineProperty($y,\"__esModule\",{value:!0});var ZE=i=>{let u=\"\";if(i.childNodes.length>0)for(let f of i.childNodes){let c=\"\";f.nodeName===\"#text\"?c=f.nodeValue:((f.nodeName===\"ink-text\"||f.nodeName===\"ink-virtual-text\")&&(c=ZE(f)),c.length>0&&typeof f.internal_transform==\"function\"&&(c=f.internal_transform(c))),u+=c}return u};$y.default=ZE});var Xy=Me(Zr=>{\"use strict\";var v2=Zr&&Zr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Zr,\"__esModule\",{value:!0});Zr.setTextNodeValue=Zr.createTextNode=Zr.setStyle=Zr.setAttribute=Zr.removeChildNode=Zr.insertBeforeNode=Zr.appendChildNode=Zr.createNode=Zr.TEXT_NAME=void 0;var oB=v2(hc()),e6=v2(TE()),uB=v2(xE()),sB=v2(Yy()),lB=v2(Ky());Zr.TEXT_NAME=\"#text\";Zr.createNode=i=>{var u;let f={nodeName:i,style:{},attributes:{},childNodes:[],parentNode:null,yogaNode:i===\"ink-virtual-text\"?void 0:oB.default.Node.create()};return i===\"ink-text\"&&((u=f.yogaNode)===null||u===void 0||u.setMeasureFunc(fB.bind(null,f))),f};Zr.appendChildNode=(i,u)=>{var f;u.parentNode&&Zr.removeChildNode(u.parentNode,u),u.parentNode=i,i.childNodes.push(u),u.yogaNode&&((f=i.yogaNode)===null||f===void 0||f.insertChild(u.yogaNode,i.yogaNode.getChildCount())),(i.nodeName===\"ink-text\"||i.nodeName===\"ink-virtual-text\")&&jh(i)};Zr.insertBeforeNode=(i,u,f)=>{var c,g;u.parentNode&&Zr.removeChildNode(u.parentNode,u),u.parentNode=i;let t=i.childNodes.indexOf(f);if(t>=0){i.childNodes.splice(t,0,u),u.yogaNode&&((c=i.yogaNode)===null||c===void 0||c.insertChild(u.yogaNode,t));return}i.childNodes.push(u),u.yogaNode&&((g=i.yogaNode)===null||g===void 0||g.insertChild(u.yogaNode,i.yogaNode.getChildCount())),(i.nodeName===\"ink-text\"||i.nodeName===\"ink-virtual-text\")&&jh(i)};Zr.removeChildNode=(i,u)=>{var f,c;u.yogaNode&&((c=(f=u.parentNode)===null||f===void 0?void 0:f.yogaNode)===null||c===void 0||c.removeChild(u.yogaNode)),u.parentNode=null;let g=i.childNodes.indexOf(u);g>=0&&i.childNodes.splice(g,1),(i.nodeName===\"ink-text\"||i.nodeName===\"ink-virtual-text\")&&jh(i)};Zr.setAttribute=(i,u,f)=>{i.attributes[u]=f};Zr.setStyle=(i,u)=>{i.style=u,i.yogaNode&&uB.default(i.yogaNode,u)};Zr.createTextNode=i=>{let u={nodeName:\"#text\",nodeValue:i,yogaNode:void 0,parentNode:null,style:{}};return Zr.setTextNodeValue(u,i),u};var fB=function(i,u){var f,c;let g=i.nodeName===\"#text\"?i.nodeValue:lB.default(i),t=e6.default(g);if(t.width<=u||t.width>=1&&u>0&&u<1)return t;let C=(c=(f=i.style)===null||f===void 0?void 0:f.textWrap)!==null&&c!==void 0?c:\"wrap\",A=sB.default(g,u,C);return e6.default(A)},t6=i=>{var u;if(!(!i||!i.parentNode))return(u=i.yogaNode)!==null&&u!==void 0?u:t6(i.parentNode)},jh=i=>{let u=t6(i);u==null||u.markDirty()};Zr.setTextNodeValue=(i,u)=>{typeof u!=\"string\"&&(u=String(u)),i.nodeValue=u,jh(i)}});var mc=Me((Rb,n6)=>{\"use strict\";n6.exports={BINARY_TYPES:[\"nodebuffer\",\"arraybuffer\",\"fragments\"],GUID:\"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\",kStatusCode:Symbol(\"status-code\"),kWebSocket:Symbol(\"websocket\"),EMPTY_BUFFER:Buffer.alloc(0),NOOP:()=>{}}});var g2=Me((Nb,Jy)=>{\"use strict\";var{EMPTY_BUFFER:cB}=mc();function r6(i,u){if(i.length===0)return cB;if(i.length===1)return i[0];let f=Buffer.allocUnsafe(u),c=0;for(let g=0;g<i.length;g++){let t=i[g];f.set(t,c),c+=t.length}return c<u?f.slice(0,c):f}function i6(i,u,f,c,g){for(let t=0;t<g;t++)f[c+t]=i[t]^u[t&3]}function o6(i,u){let f=i.length;for(let c=0;c<f;c++)i[c]^=u[c&3]}function u6(i){return i.byteLength===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)}function Uh(i){if(Uh.readOnly=!0,Buffer.isBuffer(i))return i;let u;return i instanceof ArrayBuffer?u=Buffer.from(i):ArrayBuffer.isView(i)?u=Buffer.from(i.buffer,i.byteOffset,i.byteLength):(u=Buffer.from(i),Uh.readOnly=!1),u}try{let i=require(\"bufferutil\"),u=i.BufferUtil||i;Jy.exports={concat:r6,mask(f,c,g,t,C){C<48?i6(f,c,g,t,C):u.mask(f,c,g,t,C)},toArrayBuffer:u6,toBuffer:Uh,unmask(f,c){f.length<32?o6(f,c):u.unmask(f,c)}}}catch(i){Jy.exports={concat:r6,mask:i6,toArrayBuffer:u6,toBuffer:Uh,unmask:o6}}});var c6=Me((Bb,s6)=>{\"use strict\";var l6=Symbol(\"kDone\"),Qy=Symbol(\"kRun\"),f6=class{constructor(u){this[l6]=()=>{this.pending--,this[Qy]()},this.concurrency=u||Infinity,this.jobs=[],this.pending=0}add(u){this.jobs.push(u),this[Qy]()}[Qy](){if(this.pending!==this.concurrency&&this.jobs.length){let u=this.jobs.shift();this.pending++,u(this[l6])}}};s6.exports=f6});var w2=Me((jb,a6)=>{\"use strict\";var _2=require(\"zlib\"),d6=g2(),aB=c6(),{kStatusCode:p6,NOOP:dB}=mc(),pB=Buffer.from([0,0,255,255]),qh=Symbol(\"permessage-deflate\"),Xl=Symbol(\"total-length\"),y2=Symbol(\"callback\"),jf=Symbol(\"buffers\"),Zy=Symbol(\"error\"),zh,h6=class{constructor(u,f,c){if(this._maxPayload=c|0,this._options=u||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!f,this._deflate=null,this._inflate=null,this.params=null,!zh){let g=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;zh=new aB(g)}}static get extensionName(){return\"permessage-deflate\"}offer(){let u={};return this._options.serverNoContextTakeover&&(u.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(u.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(u.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?u.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(u.client_max_window_bits=!0),u}accept(u){return u=this.normalizeParams(u),this.params=this._isServer?this.acceptAsServer(u):this.acceptAsClient(u),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let u=this._deflate[y2];this._deflate.close(),this._deflate=null,u&&u(new Error(\"The deflate stream was closed while data was being processed\"))}}acceptAsServer(u){let f=this._options,c=u.find(g=>!(f.serverNoContextTakeover===!1&&g.server_no_context_takeover||g.server_max_window_bits&&(f.serverMaxWindowBits===!1||typeof f.serverMaxWindowBits==\"number\"&&f.serverMaxWindowBits>g.server_max_window_bits)||typeof f.clientMaxWindowBits==\"number\"&&!g.client_max_window_bits));if(!c)throw new Error(\"None of the extension offers can be accepted\");return f.serverNoContextTakeover&&(c.server_no_context_takeover=!0),f.clientNoContextTakeover&&(c.client_no_context_takeover=!0),typeof f.serverMaxWindowBits==\"number\"&&(c.server_max_window_bits=f.serverMaxWindowBits),typeof f.clientMaxWindowBits==\"number\"?c.client_max_window_bits=f.clientMaxWindowBits:(c.client_max_window_bits===!0||f.clientMaxWindowBits===!1)&&delete c.client_max_window_bits,c}acceptAsClient(u){let f=u[0];if(this._options.clientNoContextTakeover===!1&&f.client_no_context_takeover)throw new Error('Unexpected parameter \"client_no_context_takeover\"');if(!f.client_max_window_bits)typeof this._options.clientMaxWindowBits==\"number\"&&(f.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==\"number\"&&f.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter \"client_max_window_bits\"');return f}normalizeParams(u){return u.forEach(f=>{Object.keys(f).forEach(c=>{let g=f[c];if(g.length>1)throw new Error(`Parameter \"${c}\" must have only a single value`);if(g=g[0],c===\"client_max_window_bits\"){if(g!==!0){let t=+g;if(!Number.isInteger(t)||t<8||t>15)throw new TypeError(`Invalid value for parameter \"${c}\": ${g}`);g=t}else if(!this._isServer)throw new TypeError(`Invalid value for parameter \"${c}\": ${g}`)}else if(c===\"server_max_window_bits\"){let t=+g;if(!Number.isInteger(t)||t<8||t>15)throw new TypeError(`Invalid value for parameter \"${c}\": ${g}`);g=t}else if(c===\"client_no_context_takeover\"||c===\"server_no_context_takeover\"){if(g!==!0)throw new TypeError(`Invalid value for parameter \"${c}\": ${g}`)}else throw new Error(`Unknown parameter \"${c}\"`);f[c]=g})}),u}decompress(u,f,c){zh.add(g=>{this._decompress(u,f,(t,C)=>{g(),c(t,C)})})}compress(u,f,c){zh.add(g=>{this._compress(u,f,(t,C)=>{g(),c(t,C)})})}_decompress(u,f,c){let g=this._isServer?\"client\":\"server\";if(!this._inflate){let t=`${g}_max_window_bits`,C=typeof this.params[t]!=\"number\"?_2.Z_DEFAULT_WINDOWBITS:this.params[t];this._inflate=_2.createInflateRaw(zn(dt({},this._options.zlibInflateOptions),{windowBits:C})),this._inflate[qh]=this,this._inflate[Xl]=0,this._inflate[jf]=[],this._inflate.on(\"error\",mB),this._inflate.on(\"data\",m6)}this._inflate[y2]=c,this._inflate.write(u),f&&this._inflate.write(pB),this._inflate.flush(()=>{let t=this._inflate[Zy];if(t){this._inflate.close(),this._inflate=null,c(t);return}let C=d6.concat(this._inflate[jf],this._inflate[Xl]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Xl]=0,this._inflate[jf]=[],f&&this.params[`${g}_no_context_takeover`]&&this._inflate.reset()),c(null,C)})}_compress(u,f,c){let g=this._isServer?\"server\":\"client\";if(!this._deflate){let t=`${g}_max_window_bits`,C=typeof this.params[t]!=\"number\"?_2.Z_DEFAULT_WINDOWBITS:this.params[t];this._deflate=_2.createDeflateRaw(zn(dt({},this._options.zlibDeflateOptions),{windowBits:C})),this._deflate[Xl]=0,this._deflate[jf]=[],this._deflate.on(\"error\",dB),this._deflate.on(\"data\",hB)}this._deflate[y2]=c,this._deflate.write(u),this._deflate.flush(_2.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let t=d6.concat(this._deflate[jf],this._deflate[Xl]);f&&(t=t.slice(0,t.length-4)),this._deflate[y2]=null,this._deflate[Xl]=0,this._deflate[jf]=[],f&&this.params[`${g}_no_context_takeover`]&&this._deflate.reset(),c(null,t)})}};a6.exports=h6;function hB(i){this[jf].push(i),this[Xl]+=i.length}function m6(i){if(this[Xl]+=i.length,this[qh]._maxPayload<1||this[Xl]<=this[qh]._maxPayload){this[jf].push(i);return}this[Zy]=new RangeError(\"Max payload size exceeded\"),this[Zy][p6]=1009,this.removeListener(\"data\",m6),this.reset()}function mB(i){this[qh]._inflate=null,i[p6]=1007,this[y2](i)}});var t3=Me((Ub,e3)=>{\"use strict\";function v6(i){return i>=1e3&&i<=1014&&i!==1004&&i!==1005&&i!==1006||i>=3e3&&i<=4999}function g6(i){let u=i.length,f=0;for(;f<u;)if((i[f]&128)==0)f++;else if((i[f]&224)==192){if(f+1===u||(i[f+1]&192)!=128||(i[f]&254)==192)return!1;f+=2}else if((i[f]&240)==224){if(f+2>=u||(i[f+1]&192)!=128||(i[f+2]&192)!=128||i[f]===224&&(i[f+1]&224)==128||i[f]===237&&(i[f+1]&224)==160)return!1;f+=3}else if((i[f]&248)==240){if(f+3>=u||(i[f+1]&192)!=128||(i[f+2]&192)!=128||(i[f+3]&192)!=128||i[f]===240&&(i[f+1]&240)==128||i[f]===244&&i[f+1]>143||i[f]>244)return!1;f+=4}else return!1;return!0}try{let i=require(\"utf-8-validate\");typeof i==\"object\"&&(i=i.Validation.isValidUTF8),e3.exports={isValidStatusCode:v6,isValidUTF8(u){return u.length<150?g6(u):i(u)}}}catch(i){e3.exports={isValidStatusCode:v6,isValidUTF8:g6}}});var i3=Me((qb,_6)=>{\"use strict\";var{Writable:vB}=require(\"stream\"),y6=w2(),{BINARY_TYPES:gB,EMPTY_BUFFER:_B,kStatusCode:yB,kWebSocket:wB}=mc(),{concat:n3,toArrayBuffer:DB,unmask:EB}=g2(),{isValidStatusCode:SB,isValidUTF8:w6}=t3(),D2=0,D6=1,E6=2,S6=3,r3=4,CB=5,C6=class extends vB{constructor(u,f,c,g){super();this._binaryType=u||gB[0],this[wB]=void 0,this._extensions=f||{},this._isServer=!!c,this._maxPayload=g|0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=D2,this._loop=!1}_write(u,f,c){if(this._opcode===8&&this._state==D2)return c();this._bufferedBytes+=u.length,this._buffers.push(u),this.startLoop(c)}consume(u){if(this._bufferedBytes-=u,u===this._buffers[0].length)return this._buffers.shift();if(u<this._buffers[0].length){let c=this._buffers[0];return this._buffers[0]=c.slice(u),c.slice(0,u)}let f=Buffer.allocUnsafe(u);do{let c=this._buffers[0],g=f.length-u;u>=c.length?f.set(this._buffers.shift(),g):(f.set(new Uint8Array(c.buffer,c.byteOffset,u),g),this._buffers[0]=c.slice(u)),u-=c.length}while(u>0);return f}startLoop(u){let f;this._loop=!0;do switch(this._state){case D2:f=this.getInfo();break;case D6:f=this.getPayloadLength16();break;case E6:f=this.getPayloadLength64();break;case S6:this.getMask();break;case r3:f=this.getData(u);break;default:this._loop=!1;return}while(this._loop);u(f)}getInfo(){if(this._bufferedBytes<2){this._loop=!1;return}let u=this.consume(2);if((u[0]&48)!=0)return this._loop=!1,ii(RangeError,\"RSV2 and RSV3 must be clear\",!0,1002);let f=(u[0]&64)==64;if(f&&!this._extensions[y6.extensionName])return this._loop=!1,ii(RangeError,\"RSV1 must be clear\",!0,1002);if(this._fin=(u[0]&128)==128,this._opcode=u[0]&15,this._payloadLength=u[1]&127,this._opcode===0){if(f)return this._loop=!1,ii(RangeError,\"RSV1 must be clear\",!0,1002);if(!this._fragmented)return this._loop=!1,ii(RangeError,\"invalid opcode 0\",!0,1002);this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented)return this._loop=!1,ii(RangeError,`invalid opcode ${this._opcode}`,!0,1002);this._compressed=f}else if(this._opcode>7&&this._opcode<11){if(!this._fin)return this._loop=!1,ii(RangeError,\"FIN must be set\",!0,1002);if(f)return this._loop=!1,ii(RangeError,\"RSV1 must be clear\",!0,1002);if(this._payloadLength>125)return this._loop=!1,ii(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002)}else return this._loop=!1,ii(RangeError,`invalid opcode ${this._opcode}`,!0,1002);if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(u[1]&128)==128,this._isServer){if(!this._masked)return this._loop=!1,ii(RangeError,\"MASK must be set\",!0,1002)}else if(this._masked)return this._loop=!1,ii(RangeError,\"MASK must be clear\",!0,1002);if(this._payloadLength===126)this._state=D6;else if(this._payloadLength===127)this._state=E6;else return this.haveLength()}getPayloadLength16(){if(this._bufferedBytes<2){this._loop=!1;return}return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength()}getPayloadLength64(){if(this._bufferedBytes<8){this._loop=!1;return}let u=this.consume(8),f=u.readUInt32BE(0);return f>Math.pow(2,53-32)-1?(this._loop=!1,ii(RangeError,\"Unsupported WebSocket frame: payload length > 2^53 - 1\",!1,1009)):(this._payloadLength=f*Math.pow(2,32)+u.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,ii(RangeError,\"Max payload size exceeded\",!1,1009);this._masked?this._state=S6:this._state=r3}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=r3}getData(u){let f=_B;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}f=this.consume(this._payloadLength),this._masked&&EB(f,this._mask)}if(this._opcode>7)return this.controlMessage(f);if(this._compressed){this._state=CB,this.decompress(f,u);return}return f.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(f)),this.dataMessage()}decompress(u,f){this._extensions[y6.extensionName].decompress(u,this._fin,(g,t)=>{if(g)return f(g);if(t.length){if(this._messageLength+=t.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return f(ii(RangeError,\"Max payload size exceeded\",!1,1009));this._fragments.push(t)}let C=this.dataMessage();if(C)return f(C);this.startLoop(f)})}dataMessage(){if(this._fin){let u=this._messageLength,f=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let c;this._binaryType===\"nodebuffer\"?c=n3(f,u):this._binaryType===\"arraybuffer\"?c=DB(n3(f,u)):c=f,this.emit(\"message\",c)}else{let c=n3(f,u);if(!w6(c))return this._loop=!1,ii(Error,\"invalid UTF-8 sequence\",!0,1007);this.emit(\"message\",c.toString())}}this._state=D2}controlMessage(u){if(this._opcode===8)if(this._loop=!1,u.length===0)this.emit(\"conclude\",1005,\"\"),this.end();else{if(u.length===1)return ii(RangeError,\"invalid payload length 1\",!0,1002);{let f=u.readUInt16BE(0);if(!SB(f))return ii(RangeError,`invalid status code ${f}`,!0,1002);let c=u.slice(2);if(!w6(c))return ii(Error,\"invalid UTF-8 sequence\",!0,1007);this.emit(\"conclude\",f,c.toString()),this.end()}}else this._opcode===9?this.emit(\"ping\",u):this.emit(\"pong\",u);this._state=D2}};_6.exports=C6;function ii(i,u,f,c){let g=new i(f?`Invalid WebSocket frame: ${u}`:u);return Error.captureStackTrace(g,ii),g[yB]=c,g}});var o3=Me((zb,T6)=>{\"use strict\";var{randomFillSync:TB}=require(\"crypto\"),x6=w2(),{EMPTY_BUFFER:xB}=mc(),{isValidStatusCode:kB}=t3(),{mask:k6,toBuffer:Jl}=g2(),vc=Buffer.alloc(4),Ql=class{constructor(u,f){this._extensions=f||{},this._socket=u,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(u,f){let c=f.mask&&f.readOnly,g=f.mask?6:2,t=u.length;u.length>=65536?(g+=8,t=127):u.length>125&&(g+=2,t=126);let C=Buffer.allocUnsafe(c?u.length+g:g);return C[0]=f.fin?f.opcode|128:f.opcode,f.rsv1&&(C[0]|=64),C[1]=t,t===126?C.writeUInt16BE(u.length,2):t===127&&(C.writeUInt32BE(0,2),C.writeUInt32BE(u.length,6)),f.mask?(TB(vc,0,4),C[1]|=128,C[g-4]=vc[0],C[g-3]=vc[1],C[g-2]=vc[2],C[g-1]=vc[3],c?(k6(u,vc,C,g,u.length),[C]):(k6(u,vc,u,0,u.length),[C,u])):[C,u]}close(u,f,c,g){let t;if(u===void 0)t=xB;else{if(typeof u!=\"number\"||!kB(u))throw new TypeError(\"First argument must be a valid error code number\");if(f===void 0||f===\"\")t=Buffer.allocUnsafe(2),t.writeUInt16BE(u,0);else{let C=Buffer.byteLength(f);if(C>123)throw new RangeError(\"The message must not be greater than 123 bytes\");t=Buffer.allocUnsafe(2+C),t.writeUInt16BE(u,0),t.write(f,2)}}this._deflating?this.enqueue([this.doClose,t,c,g]):this.doClose(t,c,g)}doClose(u,f,c){this.sendFrame(Ql.frame(u,{fin:!0,rsv1:!1,opcode:8,mask:f,readOnly:!1}),c)}ping(u,f,c){let g=Jl(u);if(g.length>125)throw new RangeError(\"The data size must not be greater than 125 bytes\");this._deflating?this.enqueue([this.doPing,g,f,Jl.readOnly,c]):this.doPing(g,f,Jl.readOnly,c)}doPing(u,f,c,g){this.sendFrame(Ql.frame(u,{fin:!0,rsv1:!1,opcode:9,mask:f,readOnly:c}),g)}pong(u,f,c){let g=Jl(u);if(g.length>125)throw new RangeError(\"The data size must not be greater than 125 bytes\");this._deflating?this.enqueue([this.doPong,g,f,Jl.readOnly,c]):this.doPong(g,f,Jl.readOnly,c)}doPong(u,f,c,g){this.sendFrame(Ql.frame(u,{fin:!0,rsv1:!1,opcode:10,mask:f,readOnly:c}),g)}send(u,f,c){let g=Jl(u),t=this._extensions[x6.extensionName],C=f.binary?2:1,A=f.compress;if(this._firstFragment?(this._firstFragment=!1,A&&t&&(A=g.length>=t._threshold),this._compress=A):(A=!1,C=0),f.fin&&(this._firstFragment=!0),t){let x={fin:f.fin,rsv1:A,opcode:C,mask:f.mask,readOnly:Jl.readOnly};this._deflating?this.enqueue([this.dispatch,g,this._compress,x,c]):this.dispatch(g,this._compress,x,c)}else this.sendFrame(Ql.frame(g,{fin:f.fin,rsv1:!1,opcode:C,mask:f.mask,readOnly:Jl.readOnly}),c)}dispatch(u,f,c,g){if(!f){this.sendFrame(Ql.frame(u,c),g);return}let t=this._extensions[x6.extensionName];this._bufferedBytes+=u.length,this._deflating=!0,t.compress(u,c.fin,(C,A)=>{if(this._socket.destroyed){let x=new Error(\"The socket was closed while data was being compressed\");typeof g==\"function\"&&g(x);for(let D=0;D<this._queue.length;D++){let L=this._queue[D][4];typeof L==\"function\"&&L(x)}return}this._bufferedBytes-=u.length,this._deflating=!1,c.readOnly=!1,this.sendFrame(Ql.frame(A,c),g),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let u=this._queue.shift();this._bufferedBytes-=u[1].length,Reflect.apply(u[0],this,u.slice(1))}}enqueue(u){this._bufferedBytes+=u[1].length,this._queue.push(u)}sendFrame(u,f){u.length===2?(this._socket.cork(),this._socket.write(u[0]),this._socket.write(u[1],f),this._socket.uncork()):this._socket.write(u[0],f)}};T6.exports=Ql});var F6=Me((Wb,A6)=>{\"use strict\";var E2=class{constructor(u,f){this.target=f,this.type=u}},O6=class extends E2{constructor(u,f){super(\"message\",f);this.data=u}},I6=class extends E2{constructor(u,f,c){super(\"close\",c);this.wasClean=c._closeFrameReceived&&c._closeFrameSent,this.reason=f,this.code=u}},P6=class extends E2{constructor(u){super(\"open\",u)}},M6=class extends E2{constructor(u,f){super(\"error\",f);this.message=u.message,this.error=u}},AB={addEventListener(i,u,f){if(typeof u!=\"function\")return;function c(x){u.call(this,new O6(x,this))}function g(x,D){u.call(this,new I6(x,D,this))}function t(x){u.call(this,new M6(x,this))}function C(){u.call(this,new P6(this))}let A=f&&f.once?\"once\":\"on\";i===\"message\"?(c._listener=u,this[A](i,c)):i===\"close\"?(g._listener=u,this[A](i,g)):i===\"error\"?(t._listener=u,this[A](i,t)):i===\"open\"?(C._listener=u,this[A](i,C)):this[A](i,u)},removeEventListener(i,u){let f=this.listeners(i);for(let c=0;c<f.length;c++)(f[c]===u||f[c]._listener===u)&&this.removeListener(i,f[c])}};A6.exports=AB});var u3=Me((Hb,L6)=>{\"use strict\";var S2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function rl(i,u,f){i[u]===void 0?i[u]=[f]:i[u].push(f)}function OB(i){let u=Object.create(null);if(i===void 0||i===\"\")return u;let f=Object.create(null),c=!1,g=!1,t=!1,C,A,x=-1,D=-1,L=0;for(;L<i.length;L++){let j=i.charCodeAt(L);if(C===void 0)if(D===-1&&S2[j]===1)x===-1&&(x=L);else if(j===32||j===9)D===-1&&x!==-1&&(D=L);else if(j===59||j===44){if(x===-1)throw new SyntaxError(`Unexpected character at index ${L}`);D===-1&&(D=L);let $=i.slice(x,D);j===44?(rl(u,$,f),f=Object.create(null)):C=$,x=D=-1}else throw new SyntaxError(`Unexpected character at index ${L}`);else if(A===void 0)if(D===-1&&S2[j]===1)x===-1&&(x=L);else if(j===32||j===9)D===-1&&x!==-1&&(D=L);else if(j===59||j===44){if(x===-1)throw new SyntaxError(`Unexpected character at index ${L}`);D===-1&&(D=L),rl(f,i.slice(x,D),!0),j===44&&(rl(u,C,f),f=Object.create(null),C=void 0),x=D=-1}else if(j===61&&x!==-1&&D===-1)A=i.slice(x,L),x=D=-1;else throw new SyntaxError(`Unexpected character at index ${L}`);else if(g){if(S2[j]!==1)throw new SyntaxError(`Unexpected character at index ${L}`);x===-1?x=L:c||(c=!0),g=!1}else if(t)if(S2[j]===1)x===-1&&(x=L);else if(j===34&&x!==-1)t=!1,D=L;else if(j===92)g=!0;else throw new SyntaxError(`Unexpected character at index ${L}`);else if(j===34&&i.charCodeAt(L-1)===61)t=!0;else if(D===-1&&S2[j]===1)x===-1&&(x=L);else if(x!==-1&&(j===32||j===9))D===-1&&(D=L);else if(j===59||j===44){if(x===-1)throw new SyntaxError(`Unexpected character at index ${L}`);D===-1&&(D=L);let $=i.slice(x,D);c&&($=$.replace(/\\\\/g,\"\"),c=!1),rl(f,A,$),j===44&&(rl(u,C,f),f=Object.create(null),C=void 0),A=void 0,x=D=-1}else throw new SyntaxError(`Unexpected character at index ${L}`)}if(x===-1||t)throw new SyntaxError(\"Unexpected end of input\");D===-1&&(D=L);let N=i.slice(x,D);return C===void 0?rl(u,N,f):(A===void 0?rl(f,N,!0):c?rl(f,A,N.replace(/\\\\/g,\"\")):rl(f,A,N),rl(u,C,f)),u}function IB(i){return Object.keys(i).map(u=>{let f=i[u];return Array.isArray(f)||(f=[f]),f.map(c=>[u].concat(Object.keys(c).map(g=>{let t=c[g];return Array.isArray(t)||(t=[t]),t.map(C=>C===!0?g:`${g}=${C}`).join(\"; \")})).join(\"; \")).join(\", \")}).join(\", \")}L6.exports={format:IB,parse:OB}});var a3=Me((bb,R6)=>{\"use strict\";var PB=require(\"events\"),MB=require(\"https\"),FB=require(\"http\"),N6=require(\"net\"),LB=require(\"tls\"),{randomBytes:RB,createHash:NB}=require(\"crypto\"),{URL:s3}=require(\"url\"),Uf=w2(),BB=i3(),jB=o3(),{BINARY_TYPES:B6,EMPTY_BUFFER:l3,GUID:UB,kStatusCode:qB,kWebSocket:No,NOOP:j6}=mc(),{addEventListener:zB,removeEventListener:WB}=F6(),{format:HB,parse:bB}=u3(),{toBuffer:GB}=g2(),U6=[\"CONNECTING\",\"OPEN\",\"CLOSING\",\"CLOSED\"],f3=[8,13],VB=30*1e3,mr=class extends PB{constructor(u,f,c){super();this._binaryType=B6[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=\"\",this._closeTimer=null,this._extensions={},this._protocol=\"\",this._readyState=mr.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,u!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,Array.isArray(f)?f=f.join(\", \"):typeof f==\"object\"&&f!==null&&(c=f,f=void 0),q6(this,u,f,c)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(u){!B6.includes(u)||(this._binaryType=u,this._receiver&&(this._receiver._binaryType=u))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(u,f,c){let g=new BB(this.binaryType,this._extensions,this._isServer,c);this._sender=new jB(u,this._extensions),this._receiver=g,this._socket=u,g[No]=this,u[No]=this,g.on(\"conclude\",YB),g.on(\"drain\",$B),g.on(\"error\",KB),g.on(\"message\",XB),g.on(\"ping\",JB),g.on(\"pong\",QB),u.setTimeout(0),u.setNoDelay(),f.length>0&&u.unshift(f),u.on(\"close\",z6),u.on(\"data\",Wh),u.on(\"end\",W6),u.on(\"error\",H6),this._readyState=mr.OPEN,this.emit(\"open\")}emitClose(){if(!this._socket){this._readyState=mr.CLOSED,this.emit(\"close\",this._closeCode,this._closeMessage);return}this._extensions[Uf.extensionName]&&this._extensions[Uf.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=mr.CLOSED,this.emit(\"close\",this._closeCode,this._closeMessage)}close(u,f){if(this.readyState!==mr.CLOSED){if(this.readyState===mr.CONNECTING){let c=\"WebSocket was closed before the connection was established\";return Zl(this,this._req,c)}if(this.readyState===mr.CLOSING){this._closeFrameSent&&this._closeFrameReceived&&this._socket.end();return}this._readyState=mr.CLOSING,this._sender.close(u,f,!this._isServer,c=>{c||(this._closeFrameSent=!0,this._closeFrameReceived&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),VB)}}ping(u,f,c){if(this.readyState===mr.CONNECTING)throw new Error(\"WebSocket is not open: readyState 0 (CONNECTING)\");if(typeof u==\"function\"?(c=u,u=f=void 0):typeof f==\"function\"&&(c=f,f=void 0),typeof u==\"number\"&&(u=u.toString()),this.readyState!==mr.OPEN){c3(this,u,c);return}f===void 0&&(f=!this._isServer),this._sender.ping(u||l3,f,c)}pong(u,f,c){if(this.readyState===mr.CONNECTING)throw new Error(\"WebSocket is not open: readyState 0 (CONNECTING)\");if(typeof u==\"function\"?(c=u,u=f=void 0):typeof f==\"function\"&&(c=f,f=void 0),typeof u==\"number\"&&(u=u.toString()),this.readyState!==mr.OPEN){c3(this,u,c);return}f===void 0&&(f=!this._isServer),this._sender.pong(u||l3,f,c)}send(u,f,c){if(this.readyState===mr.CONNECTING)throw new Error(\"WebSocket is not open: readyState 0 (CONNECTING)\");if(typeof f==\"function\"&&(c=f,f={}),typeof u==\"number\"&&(u=u.toString()),this.readyState!==mr.OPEN){c3(this,u,c);return}let g=dt({binary:typeof u!=\"string\",mask:!this._isServer,compress:!0,fin:!0},f);this._extensions[Uf.extensionName]||(g.compress=!1),this._sender.send(u||l3,g,c)}terminate(){if(this.readyState!==mr.CLOSED){if(this.readyState===mr.CONNECTING){let u=\"WebSocket was closed before the connection was established\";return Zl(this,this._req,u)}this._socket&&(this._readyState=mr.CLOSING,this._socket.destroy())}}};U6.forEach((i,u)=>{let f={enumerable:!0,value:u};Object.defineProperty(mr.prototype,i,f),Object.defineProperty(mr,i,f)});[\"binaryType\",\"bufferedAmount\",\"extensions\",\"protocol\",\"readyState\",\"url\"].forEach(i=>{Object.defineProperty(mr.prototype,i,{enumerable:!0})});[\"open\",\"error\",\"close\",\"message\"].forEach(i=>{Object.defineProperty(mr.prototype,`on${i}`,{configurable:!0,enumerable:!0,get(){let u=this.listeners(i);for(let f=0;f<u.length;f++)if(u[f]._listener)return u[f]._listener},set(u){let f=this.listeners(i);for(let c=0;c<f.length;c++)f[c]._listener&&this.removeListener(i,f[c]);this.addEventListener(i,u)}})});mr.prototype.addEventListener=zB;mr.prototype.removeEventListener=WB;R6.exports=mr;function q6(i,u,f,c){let g=zn(dt({protocolVersion:f3[1],maxPayload:100*1024*1024,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10},c),{createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0});if(!f3.includes(g.protocolVersion))throw new RangeError(`Unsupported protocol version: ${g.protocolVersion} (supported versions: ${f3.join(\", \")})`);let t;u instanceof s3?(t=u,i._url=u.href):(t=new s3(u),i._url=u);let C=t.protocol===\"ws+unix:\";if(!t.host&&(!C||!t.pathname))throw new Error(`Invalid URL: ${i.url}`);let A=t.protocol===\"wss:\"||t.protocol===\"https:\",x=A?443:80,D=RB(16).toString(\"base64\"),L=A?MB.get:FB.get,N;if(g.createConnection=A?ej:ZB,g.defaultPort=g.defaultPort||x,g.port=t.port||x,g.host=t.hostname.startsWith(\"[\")?t.hostname.slice(1,-1):t.hostname,g.headers=dt({\"Sec-WebSocket-Version\":g.protocolVersion,\"Sec-WebSocket-Key\":D,Connection:\"Upgrade\",Upgrade:\"websocket\"},g.headers),g.path=t.pathname+t.search,g.timeout=g.handshakeTimeout,g.perMessageDeflate&&(N=new Uf(g.perMessageDeflate!==!0?g.perMessageDeflate:{},!1,g.maxPayload),g.headers[\"Sec-WebSocket-Extensions\"]=HB({[Uf.extensionName]:N.offer()})),f&&(g.headers[\"Sec-WebSocket-Protocol\"]=f),g.origin&&(g.protocolVersion<13?g.headers[\"Sec-WebSocket-Origin\"]=g.origin:g.headers.Origin=g.origin),(t.username||t.password)&&(g.auth=`${t.username}:${t.password}`),C){let $=g.path.split(\":\");g.socketPath=$[0],g.path=$[1]}let j=i._req=L(g);g.timeout&&j.on(\"timeout\",()=>{Zl(i,j,\"Opening handshake has timed out\")}),j.on(\"error\",$=>{j===null||j.aborted||(j=i._req=null,i._readyState=mr.CLOSING,i.emit(\"error\",$),i.emitClose())}),j.on(\"response\",$=>{let h=$.headers.location,re=$.statusCode;if(h&&g.followRedirects&&re>=300&&re<400){if(++i._redirects>g.maxRedirects){Zl(i,j,\"Maximum redirects exceeded\");return}j.abort();let ce=new s3(h,u);q6(i,ce,f,c)}else i.emit(\"unexpected-response\",j,$)||Zl(i,j,`Unexpected server response: ${$.statusCode}`)}),j.on(\"upgrade\",($,h,re)=>{if(i.emit(\"upgrade\",$),i.readyState!==mr.CONNECTING)return;j=i._req=null;let ce=NB(\"sha1\").update(D+UB).digest(\"base64\");if($.headers[\"sec-websocket-accept\"]!==ce){Zl(i,h,\"Invalid Sec-WebSocket-Accept header\");return}let Q=$.headers[\"sec-websocket-protocol\"],oe=(f||\"\").split(/, */),Se;if(!f&&Q?Se=\"Server sent a subprotocol but none was requested\":f&&!Q?Se=\"Server sent no subprotocol\":Q&&!oe.includes(Q)&&(Se=\"Server sent an invalid subprotocol\"),Se){Zl(i,h,Se);return}if(Q&&(i._protocol=Q),N)try{let me=bB($.headers[\"sec-websocket-extensions\"]);me[Uf.extensionName]&&(N.accept(me[Uf.extensionName]),i._extensions[Uf.extensionName]=N)}catch(me){Zl(i,h,\"Invalid Sec-WebSocket-Extensions header\");return}i.setSocket(h,re,g.maxPayload)})}function ZB(i){return i.path=i.socketPath,N6.connect(i)}function ej(i){return i.path=void 0,!i.servername&&i.servername!==\"\"&&(i.servername=N6.isIP(i.host)?\"\":i.host),LB.connect(i)}function Zl(i,u,f){i._readyState=mr.CLOSING;let c=new Error(f);Error.captureStackTrace(c,Zl),u.setHeader?(u.abort(),u.socket&&!u.socket.destroyed&&u.socket.destroy(),u.once(\"abort\",i.emitClose.bind(i)),i.emit(\"error\",c)):(u.destroy(c),u.once(\"error\",i.emit.bind(i,\"error\")),u.once(\"close\",i.emitClose.bind(i)))}function c3(i,u,f){if(u){let c=GB(u).length;i._socket?i._sender._bufferedBytes+=c:i._bufferedAmount+=c}if(f){let c=new Error(`WebSocket is not open: readyState ${i.readyState} (${U6[i.readyState]})`);f(c)}}function YB(i,u){let f=this[No];f._socket.removeListener(\"data\",Wh),f._socket.resume(),f._closeFrameReceived=!0,f._closeMessage=u,f._closeCode=i,i===1005?f.close():f.close(i,u)}function $B(){this[No]._socket.resume()}function KB(i){let u=this[No];u._socket.removeListener(\"data\",Wh),u._readyState=mr.CLOSING,u._closeCode=i[qB],u.emit(\"error\",i),u._socket.destroy()}function b6(){this[No].emitClose()}function XB(i){this[No].emit(\"message\",i)}function JB(i){let u=this[No];u.pong(i,!u._isServer,j6),u.emit(\"ping\",i)}function QB(i){this[No].emit(\"pong\",i)}function z6(){let i=this[No];this.removeListener(\"close\",z6),this.removeListener(\"end\",W6),i._readyState=mr.CLOSING,i._socket.read(),i._receiver.end(),this.removeListener(\"data\",Wh),this[No]=void 0,clearTimeout(i._closeTimer),i._receiver._writableState.finished||i._receiver._writableState.errorEmitted?i.emitClose():(i._receiver.on(\"error\",b6),i._receiver.on(\"finish\",b6))}function Wh(i){this[No]._receiver.write(i)||this.pause()}function W6(){let i=this[No];i._readyState=mr.CLOSING,i._receiver.end(),this.end()}function H6(){let i=this[No];this.removeListener(\"error\",H6),this.on(\"error\",j6),i&&(i._readyState=mr.CLOSING,this.destroy())}});var $6=Me((Gb,G6)=>{\"use strict\";var{Duplex:tj}=require(\"stream\");function V6(i){i.emit(\"close\")}function nj(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Y6(i){this.removeListener(\"error\",Y6),this.destroy(),this.listenerCount(\"error\")===0&&this.emit(\"error\",i)}function rj(i,u){let f=!0;function c(){f&&i._socket.resume()}i.readyState===i.CONNECTING?i.once(\"open\",function(){i._receiver.removeAllListeners(\"drain\"),i._receiver.on(\"drain\",c)}):(i._receiver.removeAllListeners(\"drain\"),i._receiver.on(\"drain\",c));let g=new tj(zn(dt({},u),{autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1}));return i.on(\"message\",function(C){g.push(C)||(f=!1,i._socket.pause())}),i.once(\"error\",function(C){g.destroyed||g.destroy(C)}),i.once(\"close\",function(){g.destroyed||g.push(null)}),g._destroy=function(t,C){if(i.readyState===i.CLOSED){C(t),process.nextTick(V6,g);return}let A=!1;i.once(\"error\",function(D){A=!0,C(D)}),i.once(\"close\",function(){A||C(t),process.nextTick(V6,g)}),i.terminate()},g._final=function(t){if(i.readyState===i.CONNECTING){i.once(\"open\",function(){g._final(t)});return}i._socket!==null&&(i._socket._writableState.finished?(t(),g._readableState.endEmitted&&g.destroy()):(i._socket.once(\"finish\",function(){t()}),i.close()))},g._read=function(){i.readyState===i.OPEN&&!f&&(f=!0,i._receiver._writableState.needDrain||i._socket.resume())},g._write=function(t,C,A){if(i.readyState===i.CONNECTING){i.once(\"open\",function(){g._write(t,C,A)});return}i.send(t,A)},g.on(\"end\",nj),g.on(\"error\",Y6),g}G6.exports=rj});var J6=Me((Vb,K6)=>{\"use strict\";var ij=require(\"events\"),{createHash:oj}=require(\"crypto\"),{createServer:uj,STATUS_CODES:d3}=require(\"http\"),gc=w2(),sj=a3(),{format:lj,parse:fj}=u3(),{GUID:cj,kWebSocket:aj}=mc(),dj=/^[+/0-9A-Za-z]{22}==$/,X6=class extends ij{constructor(u,f){super();if(u=dt({maxPayload:100*1024*1024,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null},u),u.port==null&&!u.server&&!u.noServer)throw new TypeError('One of the \"port\", \"server\", or \"noServer\" options must be specified');if(u.port!=null?(this._server=uj((c,g)=>{let t=d3[426];g.writeHead(426,{\"Content-Length\":t.length,\"Content-Type\":\"text/plain\"}),g.end(t)}),this._server.listen(u.port,u.host,u.backlog,f)):u.server&&(this._server=u.server),this._server){let c=this.emit.bind(this,\"connection\");this._removeListeners=pj(this._server,{listening:this.emit.bind(this,\"listening\"),error:this.emit.bind(this,\"error\"),upgrade:(g,t,C)=>{this.handleUpgrade(g,t,C,c)}})}u.perMessageDeflate===!0&&(u.perMessageDeflate={}),u.clientTracking&&(this.clients=new Set),this.options=u}address(){if(this.options.noServer)throw new Error('The server is operating in \"noServer\" mode');return this._server?this._server.address():null}close(u){if(u&&this.once(\"close\",u),this.clients)for(let c of this.clients)c.terminate();let f=this._server;if(f&&(this._removeListeners(),this._removeListeners=this._server=null,this.options.port!=null)){f.close(()=>this.emit(\"close\"));return}process.nextTick(hj,this)}shouldHandle(u){if(this.options.path){let f=u.url.indexOf(\"?\");if((f!==-1?u.url.slice(0,f):u.url)!==this.options.path)return!1}return!0}handleUpgrade(u,f,c,g){f.on(\"error\",p3);let t=u.headers[\"sec-websocket-key\"]!==void 0?u.headers[\"sec-websocket-key\"].trim():!1,C=+u.headers[\"sec-websocket-version\"],A={};if(u.method!==\"GET\"||u.headers.upgrade.toLowerCase()!==\"websocket\"||!t||!dj.test(t)||C!==8&&C!==13||!this.shouldHandle(u))return Hh(f,400);if(this.options.perMessageDeflate){let x=new gc(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let D=fj(u.headers[\"sec-websocket-extensions\"]);D[gc.extensionName]&&(x.accept(D[gc.extensionName]),A[gc.extensionName]=x)}catch(D){return Hh(f,400)}}if(this.options.verifyClient){let x={origin:u.headers[`${C===8?\"sec-websocket-origin\":\"origin\"}`],secure:!!(u.socket.authorized||u.socket.encrypted),req:u};if(this.options.verifyClient.length===2){this.options.verifyClient(x,(D,L,N,j)=>{if(!D)return Hh(f,L||401,N,j);this.completeUpgrade(t,A,u,f,c,g)});return}if(!this.options.verifyClient(x))return Hh(f,401)}this.completeUpgrade(t,A,u,f,c,g)}completeUpgrade(u,f,c,g,t,C){if(!g.readable||!g.writable)return g.destroy();if(g[aj])throw new Error(\"server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration\");let A=oj(\"sha1\").update(u+cj).digest(\"base64\"),x=[\"HTTP/1.1 101 Switching Protocols\",\"Upgrade: websocket\",\"Connection: Upgrade\",`Sec-WebSocket-Accept: ${A}`],D=new sj(null),L=c.headers[\"sec-websocket-protocol\"];if(L&&(L=L.split(\",\").map(mj),this.options.handleProtocols?L=this.options.handleProtocols(L,c):L=L[0],L&&(x.push(`Sec-WebSocket-Protocol: ${L}`),D._protocol=L)),f[gc.extensionName]){let N=f[gc.extensionName].params,j=lj({[gc.extensionName]:[N]});x.push(`Sec-WebSocket-Extensions: ${j}`),D._extensions=f}this.emit(\"headers\",x,c),g.write(x.concat(`\\r\n`).join(`\\r\n`)),g.removeListener(\"error\",p3),D.setSocket(g,t,this.options.maxPayload),this.clients&&(this.clients.add(D),D.on(\"close\",()=>this.clients.delete(D))),C(D,c)}};K6.exports=X6;function pj(i,u){for(let f of Object.keys(u))i.on(f,u[f]);return function(){for(let c of Object.keys(u))i.removeListener(c,u[c])}}function hj(i){i.emit(\"close\")}function p3(){this.destroy()}function Hh(i,u,f,c){i.writable&&(f=f||d3[u],c=dt({Connection:\"close\",\"Content-Type\":\"text/html\",\"Content-Length\":Buffer.byteLength(f)},c),i.write(`HTTP/1.1 ${u} ${d3[u]}\\r\n`+Object.keys(c).map(g=>`${g}: ${c[g]}`).join(`\\r\n`)+`\\r\n\\r\n`+f)),i.removeListener(\"error\",p3),i.destroy()}function mj(i){return i.trim()}});var Z6=Me((Yb,Q6)=>{\"use strict\";var C2=a3();C2.createWebSocketStream=$6();C2.Server=J6();C2.Receiver=i3();C2.Sender=o3();Q6.exports=C2});var eS=Me(bh=>{\"use strict\";var vj=bh&&bh.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(bh,\"__esModule\",{value:!0});var gj=vj(Z6()),T2=global;T2.WebSocket||(T2.WebSocket=gj.default);T2.window||(T2.window=global);T2.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__=[{type:1,value:7,isEnabled:!0},{type:2,value:\"InternalApp\",isEnabled:!0,isValid:!0},{type:2,value:\"InternalAppContext\",isEnabled:!0,isValid:!0},{type:2,value:\"InternalStdoutContext\",isEnabled:!0,isValid:!0},{type:2,value:\"InternalStderrContext\",isEnabled:!0,isValid:!0},{type:2,value:\"InternalStdinContext\",isEnabled:!0,isValid:!0},{type:2,value:\"InternalFocusContext\",isEnabled:!0,isValid:!0}]});var tS=Me((Gh,h3)=>{(function(i,u){typeof Gh==\"object\"&&typeof h3==\"object\"?h3.exports=u():typeof define==\"function\"&&define.amd?define([],u):typeof Gh==\"object\"?Gh.ReactDevToolsBackend=u():i.ReactDevToolsBackend=u()})(window,function(){return function(i){var u={};function f(c){if(u[c])return u[c].exports;var g=u[c]={i:c,l:!1,exports:{}};return i[c].call(g.exports,g,g.exports,f),g.l=!0,g.exports}return f.m=i,f.c=u,f.d=function(c,g,t){f.o(c,g)||Object.defineProperty(c,g,{enumerable:!0,get:t})},f.r=function(c){typeof Symbol!=\"undefined\"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(c,\"__esModule\",{value:!0})},f.t=function(c,g){if(1&g&&(c=f(c)),8&g||4&g&&typeof c==\"object\"&&c&&c.__esModule)return c;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,\"default\",{enumerable:!0,value:c}),2&g&&typeof c!=\"string\")for(var C in c)f.d(t,C,function(A){return c[A]}.bind(null,C));return t},f.n=function(c){var g=c&&c.__esModule?function(){return c.default}:function(){return c};return f.d(g,\"a\",g),g},f.o=function(c,g){return Object.prototype.hasOwnProperty.call(c,g)},f.p=\"\",f(f.s=20)}([function(i,u,f){\"use strict\";i.exports=f(12)},function(i,u,f){\"use strict\";var c=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function C(A){if(A==null)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(A)}i.exports=function(){try{if(!Object.assign)return!1;var A=new String(\"abc\");if(A[5]=\"de\",Object.getOwnPropertyNames(A)[0]===\"5\")return!1;for(var x={},D=0;D<10;D++)x[\"_\"+String.fromCharCode(D)]=D;if(Object.getOwnPropertyNames(x).map(function(N){return x[N]}).join(\"\")!==\"0123456789\")return!1;var L={};return\"abcdefghijklmnopqrst\".split(\"\").forEach(function(N){L[N]=N}),Object.keys(Object.assign({},L)).join(\"\")===\"abcdefghijklmnopqrst\"}catch(N){return!1}}()?Object.assign:function(A,x){for(var D,L,N=C(A),j=1;j<arguments.length;j++){for(var $ in D=Object(arguments[j]))g.call(D,$)&&(N[$]=D[$]);if(c){L=c(D);for(var h=0;h<L.length;h++)t.call(D,L[h])&&(N[L[h]]=D[L[h]])}}return N}},function(i,u,f){(function(c){function g(De){return(g=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(J){return typeof J}:function(J){return J&&typeof Symbol==\"function\"&&J.constructor===Symbol&&J!==Symbol.prototype?\"symbol\":typeof J})(De)}var t=/^\\s+|\\s+$/g,C=/^[-+]0x[0-9a-f]+$/i,A=/^0b[01]+$/i,x=/^0o[0-7]+$/i,D=parseInt,L=(c===void 0?\"undefined\":g(c))==\"object\"&&c&&c.Object===Object&&c,N=(typeof self==\"undefined\"?\"undefined\":g(self))==\"object\"&&self&&self.Object===Object&&self,j=L||N||Function(\"return this\")(),$=Object.prototype.toString,h=Math.max,re=Math.min,ce=function(){return j.Date.now()};function Q(De,J,Te){var Oe,Le,ot,ct,Ue,be,At=0,Ot=!1,Nt=!1,Je=!0;if(typeof De!=\"function\")throw new TypeError(\"Expected a function\");function V(it){var Ft=Oe,jt=Le;return Oe=Le=void 0,At=it,ct=De.apply(jt,Ft)}function ne(it){return At=it,Ue=setTimeout(Z,J),Ot?V(it):ct}function ge(it){var Ft=it-be;return be===void 0||Ft>=J||Ft<0||Nt&&it-At>=ot}function Z(){var it=ce();if(ge(it))return Ae(it);Ue=setTimeout(Z,function(Ft){var jt=J-(Ft-be);return Nt?re(jt,ot-(Ft-At)):jt}(it))}function Ae(it){return Ue=void 0,Je&&Oe?V(it):(Oe=Le=void 0,ct)}function at(){var it=ce(),Ft=ge(it);if(Oe=arguments,Le=this,be=it,Ft){if(Ue===void 0)return ne(be);if(Nt)return Ue=setTimeout(Z,J),V(be)}return Ue===void 0&&(Ue=setTimeout(Z,J)),ct}return J=me(J)||0,oe(Te)&&(Ot=!!Te.leading,ot=(Nt=\"maxWait\"in Te)?h(me(Te.maxWait)||0,J):ot,Je=\"trailing\"in Te?!!Te.trailing:Je),at.cancel=function(){Ue!==void 0&&clearTimeout(Ue),At=0,Oe=be=Le=Ue=void 0},at.flush=function(){return Ue===void 0?ct:Ae(ce())},at}function oe(De){var J=g(De);return!!De&&(J==\"object\"||J==\"function\")}function Se(De){return g(De)==\"symbol\"||function(J){return!!J&&g(J)==\"object\"}(De)&&$.call(De)==\"[object Symbol]\"}function me(De){if(typeof De==\"number\")return De;if(Se(De))return NaN;if(oe(De)){var J=typeof De.valueOf==\"function\"?De.valueOf():De;De=oe(J)?J+\"\":J}if(typeof De!=\"string\")return De===0?De:+De;De=De.replace(t,\"\");var Te=A.test(De);return Te||x.test(De)?D(De.slice(2),Te?2:8):C.test(De)?NaN:+De}i.exports=function(De,J,Te){var Oe=!0,Le=!0;if(typeof De!=\"function\")throw new TypeError(\"Expected a function\");return oe(Te)&&(Oe=\"leading\"in Te?!!Te.leading:Oe,Le=\"trailing\"in Te?!!Te.trailing:Le),Q(De,J,{leading:Oe,maxWait:J,trailing:Le})}}).call(this,f(4))},function(i,u,f){(function(c){function g(V){return(g=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(ne){return typeof ne}:function(ne){return ne&&typeof Symbol==\"function\"&&ne.constructor===Symbol&&ne!==Symbol.prototype?\"symbol\":typeof ne})(V)}var t;u=i.exports=h,t=(c===void 0?\"undefined\":g(c))===\"object\"&&c.env&&c.env.NODE_DEBUG&&/\\bsemver\\b/i.test(c.env.NODE_DEBUG)?function(){var V=Array.prototype.slice.call(arguments,0);V.unshift(\"SEMVER\"),console.log.apply(console,V)}:function(){},u.SEMVER_SPEC_VERSION=\"2.0.0\";var C=Number.MAX_SAFE_INTEGER||9007199254740991,A=u.re=[],x=u.src=[],D=u.tokens={},L=0;function N(V){D[V]=L++}N(\"NUMERICIDENTIFIER\"),x[D.NUMERICIDENTIFIER]=\"0|[1-9]\\\\d*\",N(\"NUMERICIDENTIFIERLOOSE\"),x[D.NUMERICIDENTIFIERLOOSE]=\"[0-9]+\",N(\"NONNUMERICIDENTIFIER\"),x[D.NONNUMERICIDENTIFIER]=\"\\\\d*[a-zA-Z-][a-zA-Z0-9-]*\",N(\"MAINVERSION\"),x[D.MAINVERSION]=\"(\"+x[D.NUMERICIDENTIFIER]+\")\\\\.(\"+x[D.NUMERICIDENTIFIER]+\")\\\\.(\"+x[D.NUMERICIDENTIFIER]+\")\",N(\"MAINVERSIONLOOSE\"),x[D.MAINVERSIONLOOSE]=\"(\"+x[D.NUMERICIDENTIFIERLOOSE]+\")\\\\.(\"+x[D.NUMERICIDENTIFIERLOOSE]+\")\\\\.(\"+x[D.NUMERICIDENTIFIERLOOSE]+\")\",N(\"PRERELEASEIDENTIFIER\"),x[D.PRERELEASEIDENTIFIER]=\"(?:\"+x[D.NUMERICIDENTIFIER]+\"|\"+x[D.NONNUMERICIDENTIFIER]+\")\",N(\"PRERELEASEIDENTIFIERLOOSE\"),x[D.PRERELEASEIDENTIFIERLOOSE]=\"(?:\"+x[D.NUMERICIDENTIFIERLOOSE]+\"|\"+x[D.NONNUMERICIDENTIFIER]+\")\",N(\"PRERELEASE\"),x[D.PRERELEASE]=\"(?:-(\"+x[D.PRERELEASEIDENTIFIER]+\"(?:\\\\.\"+x[D.PRERELEASEIDENTIFIER]+\")*))\",N(\"PRERELEASELOOSE\"),x[D.PRERELEASELOOSE]=\"(?:-?(\"+x[D.PRERELEASEIDENTIFIERLOOSE]+\"(?:\\\\.\"+x[D.PRERELEASEIDENTIFIERLOOSE]+\")*))\",N(\"BUILDIDENTIFIER\"),x[D.BUILDIDENTIFIER]=\"[0-9A-Za-z-]+\",N(\"BUILD\"),x[D.BUILD]=\"(?:\\\\+(\"+x[D.BUILDIDENTIFIER]+\"(?:\\\\.\"+x[D.BUILDIDENTIFIER]+\")*))\",N(\"FULL\"),N(\"FULLPLAIN\"),x[D.FULLPLAIN]=\"v?\"+x[D.MAINVERSION]+x[D.PRERELEASE]+\"?\"+x[D.BUILD]+\"?\",x[D.FULL]=\"^\"+x[D.FULLPLAIN]+\"$\",N(\"LOOSEPLAIN\"),x[D.LOOSEPLAIN]=\"[v=\\\\s]*\"+x[D.MAINVERSIONLOOSE]+x[D.PRERELEASELOOSE]+\"?\"+x[D.BUILD]+\"?\",N(\"LOOSE\"),x[D.LOOSE]=\"^\"+x[D.LOOSEPLAIN]+\"$\",N(\"GTLT\"),x[D.GTLT]=\"((?:<|>)?=?)\",N(\"XRANGEIDENTIFIERLOOSE\"),x[D.XRANGEIDENTIFIERLOOSE]=x[D.NUMERICIDENTIFIERLOOSE]+\"|x|X|\\\\*\",N(\"XRANGEIDENTIFIER\"),x[D.XRANGEIDENTIFIER]=x[D.NUMERICIDENTIFIER]+\"|x|X|\\\\*\",N(\"XRANGEPLAIN\"),x[D.XRANGEPLAIN]=\"[v=\\\\s]*(\"+x[D.XRANGEIDENTIFIER]+\")(?:\\\\.(\"+x[D.XRANGEIDENTIFIER]+\")(?:\\\\.(\"+x[D.XRANGEIDENTIFIER]+\")(?:\"+x[D.PRERELEASE]+\")?\"+x[D.BUILD]+\"?)?)?\",N(\"XRANGEPLAINLOOSE\"),x[D.XRANGEPLAINLOOSE]=\"[v=\\\\s]*(\"+x[D.XRANGEIDENTIFIERLOOSE]+\")(?:\\\\.(\"+x[D.XRANGEIDENTIFIERLOOSE]+\")(?:\\\\.(\"+x[D.XRANGEIDENTIFIERLOOSE]+\")(?:\"+x[D.PRERELEASELOOSE]+\")?\"+x[D.BUILD]+\"?)?)?\",N(\"XRANGE\"),x[D.XRANGE]=\"^\"+x[D.GTLT]+\"\\\\s*\"+x[D.XRANGEPLAIN]+\"$\",N(\"XRANGELOOSE\"),x[D.XRANGELOOSE]=\"^\"+x[D.GTLT]+\"\\\\s*\"+x[D.XRANGEPLAINLOOSE]+\"$\",N(\"COERCE\"),x[D.COERCE]=\"(^|[^\\\\d])(\\\\d{1,16})(?:\\\\.(\\\\d{1,16}))?(?:\\\\.(\\\\d{1,16}))?(?:$|[^\\\\d])\",N(\"COERCERTL\"),A[D.COERCERTL]=new RegExp(x[D.COERCE],\"g\"),N(\"LONETILDE\"),x[D.LONETILDE]=\"(?:~>?)\",N(\"TILDETRIM\"),x[D.TILDETRIM]=\"(\\\\s*)\"+x[D.LONETILDE]+\"\\\\s+\",A[D.TILDETRIM]=new RegExp(x[D.TILDETRIM],\"g\"),N(\"TILDE\"),x[D.TILDE]=\"^\"+x[D.LONETILDE]+x[D.XRANGEPLAIN]+\"$\",N(\"TILDELOOSE\"),x[D.TILDELOOSE]=\"^\"+x[D.LONETILDE]+x[D.XRANGEPLAINLOOSE]+\"$\",N(\"LONECARET\"),x[D.LONECARET]=\"(?:\\\\^)\",N(\"CARETTRIM\"),x[D.CARETTRIM]=\"(\\\\s*)\"+x[D.LONECARET]+\"\\\\s+\",A[D.CARETTRIM]=new RegExp(x[D.CARETTRIM],\"g\"),N(\"CARET\"),x[D.CARET]=\"^\"+x[D.LONECARET]+x[D.XRANGEPLAIN]+\"$\",N(\"CARETLOOSE\"),x[D.CARETLOOSE]=\"^\"+x[D.LONECARET]+x[D.XRANGEPLAINLOOSE]+\"$\",N(\"COMPARATORLOOSE\"),x[D.COMPARATORLOOSE]=\"^\"+x[D.GTLT]+\"\\\\s*(\"+x[D.LOOSEPLAIN]+\")$|^$\",N(\"COMPARATOR\"),x[D.COMPARATOR]=\"^\"+x[D.GTLT]+\"\\\\s*(\"+x[D.FULLPLAIN]+\")$|^$\",N(\"COMPARATORTRIM\"),x[D.COMPARATORTRIM]=\"(\\\\s*)\"+x[D.GTLT]+\"\\\\s*(\"+x[D.LOOSEPLAIN]+\"|\"+x[D.XRANGEPLAIN]+\")\",A[D.COMPARATORTRIM]=new RegExp(x[D.COMPARATORTRIM],\"g\"),N(\"HYPHENRANGE\"),x[D.HYPHENRANGE]=\"^\\\\s*(\"+x[D.XRANGEPLAIN]+\")\\\\s+-\\\\s+(\"+x[D.XRANGEPLAIN]+\")\\\\s*$\",N(\"HYPHENRANGELOOSE\"),x[D.HYPHENRANGELOOSE]=\"^\\\\s*(\"+x[D.XRANGEPLAINLOOSE]+\")\\\\s+-\\\\s+(\"+x[D.XRANGEPLAINLOOSE]+\")\\\\s*$\",N(\"STAR\"),x[D.STAR]=\"(<|>)?=?\\\\s*\\\\*\";for(var j=0;j<L;j++)t(j,x[j]),A[j]||(A[j]=new RegExp(x[j]));function $(V,ne){if(ne&&g(ne)===\"object\"||(ne={loose:!!ne,includePrerelease:!1}),V instanceof h)return V;if(typeof V!=\"string\"||V.length>256||!(ne.loose?A[D.LOOSE]:A[D.FULL]).test(V))return null;try{return new h(V,ne)}catch(ge){return null}}function h(V,ne){if(ne&&g(ne)===\"object\"||(ne={loose:!!ne,includePrerelease:!1}),V instanceof h){if(V.loose===ne.loose)return V;V=V.version}else if(typeof V!=\"string\")throw new TypeError(\"Invalid Version: \"+V);if(V.length>256)throw new TypeError(\"version is longer than 256 characters\");if(!(this instanceof h))return new h(V,ne);t(\"SemVer\",V,ne),this.options=ne,this.loose=!!ne.loose;var ge=V.trim().match(ne.loose?A[D.LOOSE]:A[D.FULL]);if(!ge)throw new TypeError(\"Invalid Version: \"+V);if(this.raw=V,this.major=+ge[1],this.minor=+ge[2],this.patch=+ge[3],this.major>C||this.major<0)throw new TypeError(\"Invalid major version\");if(this.minor>C||this.minor<0)throw new TypeError(\"Invalid minor version\");if(this.patch>C||this.patch<0)throw new TypeError(\"Invalid patch version\");ge[4]?this.prerelease=ge[4].split(\".\").map(function(Z){if(/^[0-9]+$/.test(Z)){var Ae=+Z;if(Ae>=0&&Ae<C)return Ae}return Z}):this.prerelease=[],this.build=ge[5]?ge[5].split(\".\"):[],this.format()}u.parse=$,u.valid=function(V,ne){var ge=$(V,ne);return ge?ge.version:null},u.clean=function(V,ne){var ge=$(V.trim().replace(/^[=v]+/,\"\"),ne);return ge?ge.version:null},u.SemVer=h,h.prototype.format=function(){return this.version=this.major+\".\"+this.minor+\".\"+this.patch,this.prerelease.length&&(this.version+=\"-\"+this.prerelease.join(\".\")),this.version},h.prototype.toString=function(){return this.version},h.prototype.compare=function(V){return t(\"SemVer.compare\",this.version,this.options,V),V instanceof h||(V=new h(V,this.options)),this.compareMain(V)||this.comparePre(V)},h.prototype.compareMain=function(V){return V instanceof h||(V=new h(V,this.options)),ce(this.major,V.major)||ce(this.minor,V.minor)||ce(this.patch,V.patch)},h.prototype.comparePre=function(V){if(V instanceof h||(V=new h(V,this.options)),this.prerelease.length&&!V.prerelease.length)return-1;if(!this.prerelease.length&&V.prerelease.length)return 1;if(!this.prerelease.length&&!V.prerelease.length)return 0;var ne=0;do{var ge=this.prerelease[ne],Z=V.prerelease[ne];if(t(\"prerelease compare\",ne,ge,Z),ge===void 0&&Z===void 0)return 0;if(Z===void 0)return 1;if(ge===void 0)return-1;if(ge!==Z)return ce(ge,Z)}while(++ne)},h.prototype.compareBuild=function(V){V instanceof h||(V=new h(V,this.options));var ne=0;do{var ge=this.build[ne],Z=V.build[ne];if(t(\"prerelease compare\",ne,ge,Z),ge===void 0&&Z===void 0)return 0;if(Z===void 0)return 1;if(ge===void 0)return-1;if(ge!==Z)return ce(ge,Z)}while(++ne)},h.prototype.inc=function(V,ne){switch(V){case\"premajor\":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(\"pre\",ne);break;case\"preminor\":this.prerelease.length=0,this.patch=0,this.minor++,this.inc(\"pre\",ne);break;case\"prepatch\":this.prerelease.length=0,this.inc(\"patch\",ne),this.inc(\"pre\",ne);break;case\"prerelease\":this.prerelease.length===0&&this.inc(\"patch\",ne),this.inc(\"pre\",ne);break;case\"major\":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case\"minor\":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case\"patch\":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case\"pre\":if(this.prerelease.length===0)this.prerelease=[0];else{for(var ge=this.prerelease.length;--ge>=0;)typeof this.prerelease[ge]==\"number\"&&(this.prerelease[ge]++,ge=-2);ge===-1&&this.prerelease.push(0)}ne&&(this.prerelease[0]===ne?isNaN(this.prerelease[1])&&(this.prerelease=[ne,0]):this.prerelease=[ne,0]);break;default:throw new Error(\"invalid increment argument: \"+V)}return this.format(),this.raw=this.version,this},u.inc=function(V,ne,ge,Z){typeof ge==\"string\"&&(Z=ge,ge=void 0);try{return new h(V,ge).inc(ne,Z).version}catch(Ae){return null}},u.diff=function(V,ne){if(me(V,ne))return null;var ge=$(V),Z=$(ne),Ae=\"\";if(ge.prerelease.length||Z.prerelease.length){Ae=\"pre\";var at=\"prerelease\"}for(var it in ge)if((it===\"major\"||it===\"minor\"||it===\"patch\")&&ge[it]!==Z[it])return Ae+it;return at},u.compareIdentifiers=ce;var re=/^[0-9]+$/;function ce(V,ne){var ge=re.test(V),Z=re.test(ne);return ge&&Z&&(V=+V,ne=+ne),V===ne?0:ge&&!Z?-1:Z&&!ge?1:V<ne?-1:1}function Q(V,ne,ge){return new h(V,ge).compare(new h(ne,ge))}function oe(V,ne,ge){return Q(V,ne,ge)>0}function Se(V,ne,ge){return Q(V,ne,ge)<0}function me(V,ne,ge){return Q(V,ne,ge)===0}function De(V,ne,ge){return Q(V,ne,ge)!==0}function J(V,ne,ge){return Q(V,ne,ge)>=0}function Te(V,ne,ge){return Q(V,ne,ge)<=0}function Oe(V,ne,ge,Z){switch(ne){case\"===\":return g(V)===\"object\"&&(V=V.version),g(ge)===\"object\"&&(ge=ge.version),V===ge;case\"!==\":return g(V)===\"object\"&&(V=V.version),g(ge)===\"object\"&&(ge=ge.version),V!==ge;case\"\":case\"=\":case\"==\":return me(V,ge,Z);case\"!=\":return De(V,ge,Z);case\">\":return oe(V,ge,Z);case\">=\":return J(V,ge,Z);case\"<\":return Se(V,ge,Z);case\"<=\":return Te(V,ge,Z);default:throw new TypeError(\"Invalid operator: \"+ne)}}function Le(V,ne){if(ne&&g(ne)===\"object\"||(ne={loose:!!ne,includePrerelease:!1}),V instanceof Le){if(V.loose===!!ne.loose)return V;V=V.value}if(!(this instanceof Le))return new Le(V,ne);t(\"comparator\",V,ne),this.options=ne,this.loose=!!ne.loose,this.parse(V),this.semver===ot?this.value=\"\":this.value=this.operator+this.semver.version,t(\"comp\",this)}u.rcompareIdentifiers=function(V,ne){return ce(ne,V)},u.major=function(V,ne){return new h(V,ne).major},u.minor=function(V,ne){return new h(V,ne).minor},u.patch=function(V,ne){return new h(V,ne).patch},u.compare=Q,u.compareLoose=function(V,ne){return Q(V,ne,!0)},u.compareBuild=function(V,ne,ge){var Z=new h(V,ge),Ae=new h(ne,ge);return Z.compare(Ae)||Z.compareBuild(Ae)},u.rcompare=function(V,ne,ge){return Q(ne,V,ge)},u.sort=function(V,ne){return V.sort(function(ge,Z){return u.compareBuild(ge,Z,ne)})},u.rsort=function(V,ne){return V.sort(function(ge,Z){return u.compareBuild(Z,ge,ne)})},u.gt=oe,u.lt=Se,u.eq=me,u.neq=De,u.gte=J,u.lte=Te,u.cmp=Oe,u.Comparator=Le;var ot={};function ct(V,ne){if(ne&&g(ne)===\"object\"||(ne={loose:!!ne,includePrerelease:!1}),V instanceof ct)return V.loose===!!ne.loose&&V.includePrerelease===!!ne.includePrerelease?V:new ct(V.raw,ne);if(V instanceof Le)return new ct(V.value,ne);if(!(this instanceof ct))return new ct(V,ne);if(this.options=ne,this.loose=!!ne.loose,this.includePrerelease=!!ne.includePrerelease,this.raw=V,this.set=V.split(/\\s*\\|\\|\\s*/).map(function(ge){return this.parseRange(ge.trim())},this).filter(function(ge){return ge.length}),!this.set.length)throw new TypeError(\"Invalid SemVer Range: \"+V);this.format()}function Ue(V,ne){for(var ge=!0,Z=V.slice(),Ae=Z.pop();ge&&Z.length;)ge=Z.every(function(at){return Ae.intersects(at,ne)}),Ae=Z.pop();return ge}function be(V){return!V||V.toLowerCase()===\"x\"||V===\"*\"}function At(V,ne,ge,Z,Ae,at,it,Ft,jt,hn,Un,Jt,Yt){return((ne=be(ge)?\"\":be(Z)?\">=\"+ge+\".0.0\":be(Ae)?\">=\"+ge+\".\"+Z+\".0\":\">=\"+ne)+\" \"+(Ft=be(jt)?\"\":be(hn)?\"<\"+(+jt+1)+\".0.0\":be(Un)?\"<\"+jt+\".\"+(+hn+1)+\".0\":Jt?\"<=\"+jt+\".\"+hn+\".\"+Un+\"-\"+Jt:\"<=\"+Ft)).trim()}function Ot(V,ne,ge){for(var Z=0;Z<V.length;Z++)if(!V[Z].test(ne))return!1;if(ne.prerelease.length&&!ge.includePrerelease){for(Z=0;Z<V.length;Z++)if(t(V[Z].semver),V[Z].semver!==ot&&V[Z].semver.prerelease.length>0){var Ae=V[Z].semver;if(Ae.major===ne.major&&Ae.minor===ne.minor&&Ae.patch===ne.patch)return!0}return!1}return!0}function Nt(V,ne,ge){try{ne=new ct(ne,ge)}catch(Z){return!1}return ne.test(V)}function Je(V,ne,ge,Z){var Ae,at,it,Ft,jt;switch(V=new h(V,Z),ne=new ct(ne,Z),ge){case\">\":Ae=oe,at=Te,it=Se,Ft=\">\",jt=\">=\";break;case\"<\":Ae=Se,at=J,it=oe,Ft=\"<\",jt=\"<=\";break;default:throw new TypeError('Must provide a hilo val of \"<\" or \">\"')}if(Nt(V,ne,Z))return!1;for(var hn=0;hn<ne.set.length;++hn){var Un=ne.set[hn],Jt=null,Yt=null;if(Un.forEach(function(cr){cr.semver===ot&&(cr=new Le(\">=0.0.0\")),Jt=Jt||cr,Yt=Yt||cr,Ae(cr.semver,Jt.semver,Z)?Jt=cr:it(cr.semver,Yt.semver,Z)&&(Yt=cr)}),Jt.operator===Ft||Jt.operator===jt||(!Yt.operator||Yt.operator===Ft)&&at(V,Yt.semver)||Yt.operator===jt&&it(V,Yt.semver))return!1}return!0}Le.prototype.parse=function(V){var ne=this.options.loose?A[D.COMPARATORLOOSE]:A[D.COMPARATOR],ge=V.match(ne);if(!ge)throw new TypeError(\"Invalid comparator: \"+V);this.operator=ge[1]!==void 0?ge[1]:\"\",this.operator===\"=\"&&(this.operator=\"\"),ge[2]?this.semver=new h(ge[2],this.options.loose):this.semver=ot},Le.prototype.toString=function(){return this.value},Le.prototype.test=function(V){if(t(\"Comparator.test\",V,this.options.loose),this.semver===ot||V===ot)return!0;if(typeof V==\"string\")try{V=new h(V,this.options)}catch(ne){return!1}return Oe(V,this.operator,this.semver,this.options)},Le.prototype.intersects=function(V,ne){if(!(V instanceof Le))throw new TypeError(\"a Comparator is required\");var ge;if(ne&&g(ne)===\"object\"||(ne={loose:!!ne,includePrerelease:!1}),this.operator===\"\")return this.value===\"\"||(ge=new ct(V.value,ne),Nt(this.value,ge,ne));if(V.operator===\"\")return V.value===\"\"||(ge=new ct(this.value,ne),Nt(V.semver,ge,ne));var Z=!(this.operator!==\">=\"&&this.operator!==\">\"||V.operator!==\">=\"&&V.operator!==\">\"),Ae=!(this.operator!==\"<=\"&&this.operator!==\"<\"||V.operator!==\"<=\"&&V.operator!==\"<\"),at=this.semver.version===V.semver.version,it=!(this.operator!==\">=\"&&this.operator!==\"<=\"||V.operator!==\">=\"&&V.operator!==\"<=\"),Ft=Oe(this.semver,\"<\",V.semver,ne)&&(this.operator===\">=\"||this.operator===\">\")&&(V.operator===\"<=\"||V.operator===\"<\"),jt=Oe(this.semver,\">\",V.semver,ne)&&(this.operator===\"<=\"||this.operator===\"<\")&&(V.operator===\">=\"||V.operator===\">\");return Z||Ae||at&&it||Ft||jt},u.Range=ct,ct.prototype.format=function(){return this.range=this.set.map(function(V){return V.join(\" \").trim()}).join(\"||\").trim(),this.range},ct.prototype.toString=function(){return this.range},ct.prototype.parseRange=function(V){var ne=this.options.loose;V=V.trim();var ge=ne?A[D.HYPHENRANGELOOSE]:A[D.HYPHENRANGE];V=V.replace(ge,At),t(\"hyphen replace\",V),V=V.replace(A[D.COMPARATORTRIM],\"$1$2$3\"),t(\"comparator trim\",V,A[D.COMPARATORTRIM]),V=(V=(V=V.replace(A[D.TILDETRIM],\"$1~\")).replace(A[D.CARETTRIM],\"$1^\")).split(/\\s+/).join(\" \");var Z=ne?A[D.COMPARATORLOOSE]:A[D.COMPARATOR],Ae=V.split(\" \").map(function(at){return function(it,Ft){return t(\"comp\",it,Ft),it=function(jt,hn){return jt.trim().split(/\\s+/).map(function(Un){return function(Jt,Yt){t(\"caret\",Jt,Yt);var cr=Yt.loose?A[D.CARETLOOSE]:A[D.CARET];return Jt.replace(cr,function(w,pt,Mn,Bn,Xn){var vr;return t(\"caret\",Jt,w,pt,Mn,Bn,Xn),be(pt)?vr=\"\":be(Mn)?vr=\">=\"+pt+\".0.0 <\"+(+pt+1)+\".0.0\":be(Bn)?vr=pt===\"0\"?\">=\"+pt+\".\"+Mn+\".0 <\"+pt+\".\"+(+Mn+1)+\".0\":\">=\"+pt+\".\"+Mn+\".0 <\"+(+pt+1)+\".0.0\":Xn?(t(\"replaceCaret pr\",Xn),vr=pt===\"0\"?Mn===\"0\"?\">=\"+pt+\".\"+Mn+\".\"+Bn+\"-\"+Xn+\" <\"+pt+\".\"+Mn+\".\"+(+Bn+1):\">=\"+pt+\".\"+Mn+\".\"+Bn+\"-\"+Xn+\" <\"+pt+\".\"+(+Mn+1)+\".0\":\">=\"+pt+\".\"+Mn+\".\"+Bn+\"-\"+Xn+\" <\"+(+pt+1)+\".0.0\"):(t(\"no pr\"),vr=pt===\"0\"?Mn===\"0\"?\">=\"+pt+\".\"+Mn+\".\"+Bn+\" <\"+pt+\".\"+Mn+\".\"+(+Bn+1):\">=\"+pt+\".\"+Mn+\".\"+Bn+\" <\"+pt+\".\"+(+Mn+1)+\".0\":\">=\"+pt+\".\"+Mn+\".\"+Bn+\" <\"+(+pt+1)+\".0.0\"),t(\"caret return\",vr),vr})}(Un,hn)}).join(\" \")}(it,Ft),t(\"caret\",it),it=function(jt,hn){return jt.trim().split(/\\s+/).map(function(Un){return function(Jt,Yt){var cr=Yt.loose?A[D.TILDELOOSE]:A[D.TILDE];return Jt.replace(cr,function(w,pt,Mn,Bn,Xn){var vr;return t(\"tilde\",Jt,w,pt,Mn,Bn,Xn),be(pt)?vr=\"\":be(Mn)?vr=\">=\"+pt+\".0.0 <\"+(+pt+1)+\".0.0\":be(Bn)?vr=\">=\"+pt+\".\"+Mn+\".0 <\"+pt+\".\"+(+Mn+1)+\".0\":Xn?(t(\"replaceTilde pr\",Xn),vr=\">=\"+pt+\".\"+Mn+\".\"+Bn+\"-\"+Xn+\" <\"+pt+\".\"+(+Mn+1)+\".0\"):vr=\">=\"+pt+\".\"+Mn+\".\"+Bn+\" <\"+pt+\".\"+(+Mn+1)+\".0\",t(\"tilde return\",vr),vr})}(Un,hn)}).join(\" \")}(it,Ft),t(\"tildes\",it),it=function(jt,hn){return t(\"replaceXRanges\",jt,hn),jt.split(/\\s+/).map(function(Un){return function(Jt,Yt){Jt=Jt.trim();var cr=Yt.loose?A[D.XRANGELOOSE]:A[D.XRANGE];return Jt.replace(cr,function(w,pt,Mn,Bn,Xn,vr){t(\"xRange\",Jt,w,pt,Mn,Bn,Xn,vr);var gr=be(Mn),r0=gr||be(Bn),Ci=r0||be(Xn),yo=Ci;return pt===\"=\"&&yo&&(pt=\"\"),vr=Yt.includePrerelease?\"-0\":\"\",gr?w=pt===\">\"||pt===\"<\"?\"<0.0.0-0\":\"*\":pt&&yo?(r0&&(Bn=0),Xn=0,pt===\">\"?(pt=\">=\",r0?(Mn=+Mn+1,Bn=0,Xn=0):(Bn=+Bn+1,Xn=0)):pt===\"<=\"&&(pt=\"<\",r0?Mn=+Mn+1:Bn=+Bn+1),w=pt+Mn+\".\"+Bn+\".\"+Xn+vr):r0?w=\">=\"+Mn+\".0.0\"+vr+\" <\"+(+Mn+1)+\".0.0\"+vr:Ci&&(w=\">=\"+Mn+\".\"+Bn+\".0\"+vr+\" <\"+Mn+\".\"+(+Bn+1)+\".0\"+vr),t(\"xRange return\",w),w})}(Un,hn)}).join(\" \")}(it,Ft),t(\"xrange\",it),it=function(jt,hn){return t(\"replaceStars\",jt,hn),jt.trim().replace(A[D.STAR],\"\")}(it,Ft),t(\"stars\",it),it}(at,this.options)},this).join(\" \").split(/\\s+/);return this.options.loose&&(Ae=Ae.filter(function(at){return!!at.match(Z)})),Ae=Ae.map(function(at){return new Le(at,this.options)},this)},ct.prototype.intersects=function(V,ne){if(!(V instanceof ct))throw new TypeError(\"a Range is required\");return this.set.some(function(ge){return Ue(ge,ne)&&V.set.some(function(Z){return Ue(Z,ne)&&ge.every(function(Ae){return Z.every(function(at){return Ae.intersects(at,ne)})})})})},u.toComparators=function(V,ne){return new ct(V,ne).set.map(function(ge){return ge.map(function(Z){return Z.value}).join(\" \").trim().split(\" \")})},ct.prototype.test=function(V){if(!V)return!1;if(typeof V==\"string\")try{V=new h(V,this.options)}catch(ge){return!1}for(var ne=0;ne<this.set.length;ne++)if(Ot(this.set[ne],V,this.options))return!0;return!1},u.satisfies=Nt,u.maxSatisfying=function(V,ne,ge){var Z=null,Ae=null;try{var at=new ct(ne,ge)}catch(it){return null}return V.forEach(function(it){at.test(it)&&(Z&&Ae.compare(it)!==-1||(Ae=new h(Z=it,ge)))}),Z},u.minSatisfying=function(V,ne,ge){var Z=null,Ae=null;try{var at=new ct(ne,ge)}catch(it){return null}return V.forEach(function(it){at.test(it)&&(Z&&Ae.compare(it)!==1||(Ae=new h(Z=it,ge)))}),Z},u.minVersion=function(V,ne){V=new ct(V,ne);var ge=new h(\"0.0.0\");if(V.test(ge)||(ge=new h(\"0.0.0-0\"),V.test(ge)))return ge;ge=null;for(var Z=0;Z<V.set.length;++Z)V.set[Z].forEach(function(Ae){var at=new h(Ae.semver.version);switch(Ae.operator){case\">\":at.prerelease.length===0?at.patch++:at.prerelease.push(0),at.raw=at.format();case\"\":case\">=\":ge&&!oe(ge,at)||(ge=at);break;case\"<\":case\"<=\":break;default:throw new Error(\"Unexpected operation: \"+Ae.operator)}});return ge&&V.test(ge)?ge:null},u.validRange=function(V,ne){try{return new ct(V,ne).range||\"*\"}catch(ge){return null}},u.ltr=function(V,ne,ge){return Je(V,ne,\"<\",ge)},u.gtr=function(V,ne,ge){return Je(V,ne,\">\",ge)},u.outside=Je,u.prerelease=function(V,ne){var ge=$(V,ne);return ge&&ge.prerelease.length?ge.prerelease:null},u.intersects=function(V,ne,ge){return V=new ct(V,ge),ne=new ct(ne,ge),V.intersects(ne)},u.coerce=function(V,ne){if(V instanceof h)return V;if(typeof V==\"number\"&&(V=String(V)),typeof V!=\"string\")return null;var ge=null;if((ne=ne||{}).rtl){for(var Z;(Z=A[D.COERCERTL].exec(V))&&(!ge||ge.index+ge[0].length!==V.length);)ge&&Z.index+Z[0].length===ge.index+ge[0].length||(ge=Z),A[D.COERCERTL].lastIndex=Z.index+Z[1].length+Z[2].length;A[D.COERCERTL].lastIndex=-1}else ge=V.match(A[D.COERCE]);return ge===null?null:$(ge[2]+\".\"+(ge[3]||\"0\")+\".\"+(ge[4]||\"0\"),ne)}}).call(this,f(5))},function(i,u){function f(g){return(f=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(t){return typeof t}:function(t){return t&&typeof Symbol==\"function\"&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(g)}var c;c=function(){return this}();try{c=c||new Function(\"return this\")()}catch(g){(typeof window==\"undefined\"?\"undefined\":f(window))===\"object\"&&(c=window)}i.exports=c},function(i,u){var f,c,g=i.exports={};function t(){throw new Error(\"setTimeout has not been defined\")}function C(){throw new Error(\"clearTimeout has not been defined\")}function A(ce){if(f===setTimeout)return setTimeout(ce,0);if((f===t||!f)&&setTimeout)return f=setTimeout,setTimeout(ce,0);try{return f(ce,0)}catch(Q){try{return f.call(null,ce,0)}catch(oe){return f.call(this,ce,0)}}}(function(){try{f=typeof setTimeout==\"function\"?setTimeout:t}catch(ce){f=t}try{c=typeof clearTimeout==\"function\"?clearTimeout:C}catch(ce){c=C}})();var x,D=[],L=!1,N=-1;function j(){L&&x&&(L=!1,x.length?D=x.concat(D):N=-1,D.length&&$())}function $(){if(!L){var ce=A(j);L=!0;for(var Q=D.length;Q;){for(x=D,D=[];++N<Q;)x&&x[N].run();N=-1,Q=D.length}x=null,L=!1,function(oe){if(c===clearTimeout)return clearTimeout(oe);if((c===C||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(oe);try{c(oe)}catch(Se){try{return c.call(null,oe)}catch(me){return c.call(this,oe)}}}(ce)}}function h(ce,Q){this.fun=ce,this.array=Q}function re(){}g.nextTick=function(ce){var Q=new Array(arguments.length-1);if(arguments.length>1)for(var oe=1;oe<arguments.length;oe++)Q[oe-1]=arguments[oe];D.push(new h(ce,Q)),D.length!==1||L||A($)},h.prototype.run=function(){this.fun.apply(null,this.array)},g.title=\"browser\",g.browser=!0,g.env={},g.argv=[],g.version=\"\",g.versions={},g.on=re,g.addListener=re,g.once=re,g.off=re,g.removeListener=re,g.removeAllListeners=re,g.emit=re,g.prependListener=re,g.prependOnceListener=re,g.listeners=function(ce){return[]},g.binding=function(ce){throw new Error(\"process.binding is not supported\")},g.cwd=function(){return\"/\"},g.chdir=function(ce){throw new Error(\"process.chdir is not supported\")},g.umask=function(){return 0}},function(i,u,f){\"use strict\";function c(Oe,Le){if(!(Oe instanceof Le))throw new TypeError(\"Cannot call a class as a function\")}function g(Oe,Le){for(var ot=0;ot<Le.length;ot++){var ct=Le[ot];ct.enumerable=ct.enumerable||!1,ct.configurable=!0,\"value\"in ct&&(ct.writable=!0),Object.defineProperty(Oe,ct.key,ct)}}var t=f(10),C=Symbol(\"max\"),A=Symbol(\"length\"),x=Symbol(\"lengthCalculator\"),D=Symbol(\"allowStale\"),L=Symbol(\"maxAge\"),N=Symbol(\"dispose\"),j=Symbol(\"noDisposeOnSet\"),$=Symbol(\"lruList\"),h=Symbol(\"cache\"),re=Symbol(\"updateAgeOnGet\"),ce=function(){return 1},Q=function(){function Oe(Ue){if(c(this,Oe),typeof Ue==\"number\"&&(Ue={max:Ue}),Ue||(Ue={}),Ue.max&&(typeof Ue.max!=\"number\"||Ue.max<0))throw new TypeError(\"max must be a non-negative number\");this[C]=Ue.max||1/0;var be=Ue.length||ce;if(this[x]=typeof be!=\"function\"?ce:be,this[D]=Ue.stale||!1,Ue.maxAge&&typeof Ue.maxAge!=\"number\")throw new TypeError(\"maxAge must be a number\");this[L]=Ue.maxAge||0,this[N]=Ue.dispose,this[j]=Ue.noDisposeOnSet||!1,this[re]=Ue.updateAgeOnGet||!1,this.reset()}var Le,ot,ct;return Le=Oe,(ot=[{key:\"rforEach\",value:function(Ue,be){be=be||this;for(var At=this[$].tail;At!==null;){var Ot=At.prev;Te(this,Ue,At,be),At=Ot}}},{key:\"forEach\",value:function(Ue,be){be=be||this;for(var At=this[$].head;At!==null;){var Ot=At.next;Te(this,Ue,At,be),At=Ot}}},{key:\"keys\",value:function(){return this[$].toArray().map(function(Ue){return Ue.key})}},{key:\"values\",value:function(){return this[$].toArray().map(function(Ue){return Ue.value})}},{key:\"reset\",value:function(){var Ue=this;this[N]&&this[$]&&this[$].length&&this[$].forEach(function(be){return Ue[N](be.key,be.value)}),this[h]=new Map,this[$]=new t,this[A]=0}},{key:\"dump\",value:function(){var Ue=this;return this[$].map(function(be){return!Se(Ue,be)&&{k:be.key,v:be.value,e:be.now+(be.maxAge||0)}}).toArray().filter(function(be){return be})}},{key:\"dumpLru\",value:function(){return this[$]}},{key:\"set\",value:function(Ue,be,At){if((At=At||this[L])&&typeof At!=\"number\")throw new TypeError(\"maxAge must be a number\");var Ot=At?Date.now():0,Nt=this[x](be,Ue);if(this[h].has(Ue)){if(Nt>this[C])return De(this,this[h].get(Ue)),!1;var Je=this[h].get(Ue).value;return this[N]&&(this[j]||this[N](Ue,Je.value)),Je.now=Ot,Je.maxAge=At,Je.value=be,this[A]+=Nt-Je.length,Je.length=Nt,this.get(Ue),me(this),!0}var V=new J(Ue,be,Nt,Ot,At);return V.length>this[C]?(this[N]&&this[N](Ue,be),!1):(this[A]+=V.length,this[$].unshift(V),this[h].set(Ue,this[$].head),me(this),!0)}},{key:\"has\",value:function(Ue){if(!this[h].has(Ue))return!1;var be=this[h].get(Ue).value;return!Se(this,be)}},{key:\"get\",value:function(Ue){return oe(this,Ue,!0)}},{key:\"peek\",value:function(Ue){return oe(this,Ue,!1)}},{key:\"pop\",value:function(){var Ue=this[$].tail;return Ue?(De(this,Ue),Ue.value):null}},{key:\"del\",value:function(Ue){De(this,this[h].get(Ue))}},{key:\"load\",value:function(Ue){this.reset();for(var be=Date.now(),At=Ue.length-1;At>=0;At--){var Ot=Ue[At],Nt=Ot.e||0;if(Nt===0)this.set(Ot.k,Ot.v);else{var Je=Nt-be;Je>0&&this.set(Ot.k,Ot.v,Je)}}}},{key:\"prune\",value:function(){var Ue=this;this[h].forEach(function(be,At){return oe(Ue,At,!1)})}},{key:\"max\",set:function(Ue){if(typeof Ue!=\"number\"||Ue<0)throw new TypeError(\"max must be a non-negative number\");this[C]=Ue||1/0,me(this)},get:function(){return this[C]}},{key:\"allowStale\",set:function(Ue){this[D]=!!Ue},get:function(){return this[D]}},{key:\"maxAge\",set:function(Ue){if(typeof Ue!=\"number\")throw new TypeError(\"maxAge must be a non-negative number\");this[L]=Ue,me(this)},get:function(){return this[L]}},{key:\"lengthCalculator\",set:function(Ue){var be=this;typeof Ue!=\"function\"&&(Ue=ce),Ue!==this[x]&&(this[x]=Ue,this[A]=0,this[$].forEach(function(At){At.length=be[x](At.value,At.key),be[A]+=At.length})),me(this)},get:function(){return this[x]}},{key:\"length\",get:function(){return this[A]}},{key:\"itemCount\",get:function(){return this[$].length}}])&&g(Le.prototype,ot),ct&&g(Le,ct),Oe}(),oe=function(Oe,Le,ot){var ct=Oe[h].get(Le);if(ct){var Ue=ct.value;if(Se(Oe,Ue)){if(De(Oe,ct),!Oe[D])return}else ot&&(Oe[re]&&(ct.value.now=Date.now()),Oe[$].unshiftNode(ct));return Ue.value}},Se=function(Oe,Le){if(!Le||!Le.maxAge&&!Oe[L])return!1;var ot=Date.now()-Le.now;return Le.maxAge?ot>Le.maxAge:Oe[L]&&ot>Oe[L]},me=function(Oe){if(Oe[A]>Oe[C])for(var Le=Oe[$].tail;Oe[A]>Oe[C]&&Le!==null;){var ot=Le.prev;De(Oe,Le),Le=ot}},De=function(Oe,Le){if(Le){var ot=Le.value;Oe[N]&&Oe[N](ot.key,ot.value),Oe[A]-=ot.length,Oe[h].delete(ot.key),Oe[$].removeNode(Le)}},J=function Oe(Le,ot,ct,Ue,be){c(this,Oe),this.key=Le,this.value=ot,this.length=ct,this.now=Ue,this.maxAge=be||0},Te=function(Oe,Le,ot,ct){var Ue=ot.value;Se(Oe,Ue)&&(De(Oe,ot),Oe[D]||(Ue=void 0)),Ue&&Le.call(ct,Ue.value,Ue.key,Oe)};i.exports=Q},function(i,u,f){(function(c){function g(t){return(g=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(C){return typeof C}:function(C){return C&&typeof Symbol==\"function\"&&C.constructor===Symbol&&C!==Symbol.prototype?\"symbol\":typeof C})(t)}i.exports=function(){if(typeof document==\"undefined\"||!document.addEventListener)return null;var t,C,A,x={};return x.copy=function(){var D=!1,L=null,N=!1;function j(){D=!1,L=null,N&&window.getSelection().removeAllRanges(),N=!1}return document.addEventListener(\"copy\",function($){if(D){for(var h in L)$.clipboardData.setData(h,L[h]);$.preventDefault()}}),function($){return new Promise(function(h,re){D=!0,typeof $==\"string\"?L={\"text/plain\":$}:$ instanceof Node?L={\"text/html\":new XMLSerializer().serializeToString($)}:$ instanceof Object?L=$:re(\"Invalid data type. Must be string, DOM node, or an object mapping MIME types to strings.\"),function ce(Q){try{if(document.execCommand(\"copy\"))j(),h();else{if(Q)throw j(),new Error(\"Unable to copy. Perhaps it's not available in your browser?\");(function(){var oe=document.getSelection();if(!document.queryCommandEnabled(\"copy\")&&oe.isCollapsed){var Se=document.createRange();Se.selectNodeContents(document.body),oe.removeAllRanges(),oe.addRange(Se),N=!0}})(),ce(!0)}}catch(oe){j(),re(oe)}}(!1)})}}(),x.paste=(A=!1,document.addEventListener(\"paste\",function(D){if(A){A=!1,D.preventDefault();var L=t;t=null,L(D.clipboardData.getData(C))}}),function(D){return new Promise(function(L,N){A=!0,t=L,C=D||\"text/plain\";try{document.execCommand(\"paste\")||(A=!1,N(new Error(\"Unable to paste. Pasting only works in Internet Explorer at the moment.\")))}catch(j){A=!1,N(new Error(j))}})}),typeof ClipboardEvent==\"undefined\"&&window.clipboardData!==void 0&&window.clipboardData.setData!==void 0&&(function(D){function L(me,De){return function(){me.apply(De,arguments)}}function N(me){if(g(this)!=\"object\")throw new TypeError(\"Promises must be constructed via new\");if(typeof me!=\"function\")throw new TypeError(\"not a function\");this._state=null,this._value=null,this._deferreds=[],Q(me,L($,this),L(h,this))}function j(me){var De=this;return this._state===null?void this._deferreds.push(me):void oe(function(){var J=De._state?me.onFulfilled:me.onRejected;if(J!==null){var Te;try{Te=J(De._value)}catch(Oe){return void me.reject(Oe)}me.resolve(Te)}else(De._state?me.resolve:me.reject)(De._value)})}function $(me){try{if(me===this)throw new TypeError(\"A promise cannot be resolved with itself.\");if(me&&(g(me)==\"object\"||typeof me==\"function\")){var De=me.then;if(typeof De==\"function\")return void Q(L(De,me),L($,this),L(h,this))}this._state=!0,this._value=me,re.call(this)}catch(J){h.call(this,J)}}function h(me){this._state=!1,this._value=me,re.call(this)}function re(){for(var me=0,De=this._deferreds.length;De>me;me++)j.call(this,this._deferreds[me]);this._deferreds=null}function ce(me,De,J,Te){this.onFulfilled=typeof me==\"function\"?me:null,this.onRejected=typeof De==\"function\"?De:null,this.resolve=J,this.reject=Te}function Q(me,De,J){var Te=!1;try{me(function(Oe){Te||(Te=!0,De(Oe))},function(Oe){Te||(Te=!0,J(Oe))})}catch(Oe){if(Te)return;Te=!0,J(Oe)}}var oe=N.immediateFn||typeof c==\"function\"&&c||function(me){setTimeout(me,1)},Se=Array.isArray||function(me){return Object.prototype.toString.call(me)===\"[object Array]\"};N.prototype.catch=function(me){return this.then(null,me)},N.prototype.then=function(me,De){var J=this;return new N(function(Te,Oe){j.call(J,new ce(me,De,Te,Oe))})},N.all=function(){var me=Array.prototype.slice.call(arguments.length===1&&Se(arguments[0])?arguments[0]:arguments);return new N(function(De,J){function Te(ot,ct){try{if(ct&&(g(ct)==\"object\"||typeof ct==\"function\")){var Ue=ct.then;if(typeof Ue==\"function\")return void Ue.call(ct,function(be){Te(ot,be)},J)}me[ot]=ct,--Oe==0&&De(me)}catch(be){J(be)}}if(me.length===0)return De([]);for(var Oe=me.length,Le=0;Le<me.length;Le++)Te(Le,me[Le])})},N.resolve=function(me){return me&&g(me)==\"object\"&&me.constructor===N?me:new N(function(De){De(me)})},N.reject=function(me){return new N(function(De,J){J(me)})},N.race=function(me){return new N(function(De,J){for(var Te=0,Oe=me.length;Oe>Te;Te++)me[Te].then(De,J)})},i.exports?i.exports=N:D.Promise||(D.Promise=N)}(this),x.copy=function(D){return new Promise(function(L,N){if(typeof D!=\"string\"&&!(\"text/plain\"in D))throw new Error(\"You must provide a text/plain type.\");var j=typeof D==\"string\"?D:D[\"text/plain\"];window.clipboardData.setData(\"Text\",j)?L():N(new Error(\"Copying was rejected.\"))})},x.paste=function(){return new Promise(function(D,L){var N=window.clipboardData.getData(\"Text\");N?D(N):L(new Error(\"Pasting was rejected.\"))})}),x}()}).call(this,f(13).setImmediate)},function(i,u,f){\"use strict\";i.exports=f(15)},function(i,u,f){\"use strict\";f.r(u),u.default=`:root {\n  /**\n   * IMPORTANT: When new theme variables are added below\\u2013 also add them to SettingsContext updateThemeVariables()\n   */\n\n  /* Light theme */\n  --light-color-attribute-name: #ef6632;\n  --light-color-attribute-name-not-editable: #23272f;\n  --light-color-attribute-name-inverted: rgba(255, 255, 255, 0.7);\n  --light-color-attribute-value: #1a1aa6;\n  --light-color-attribute-value-inverted: #ffffff;\n  --light-color-attribute-editable-value: #1a1aa6;\n  --light-color-background: #ffffff;\n  --light-color-background-hover: rgba(0, 136, 250, 0.1);\n  --light-color-background-inactive: #e5e5e5;\n  --light-color-background-invalid: #fff0f0;\n  --light-color-background-selected: #0088fa;\n  --light-color-button-background: #ffffff;\n  --light-color-button-background-focus: #ededed;\n  --light-color-button: #5f6673;\n  --light-color-button-disabled: #cfd1d5;\n  --light-color-button-active: #0088fa;\n  --light-color-button-focus: #23272f;\n  --light-color-button-hover: #23272f;\n  --light-color-border: #eeeeee;\n  --light-color-commit-did-not-render-fill: #cfd1d5;\n  --light-color-commit-did-not-render-fill-text: #000000;\n  --light-color-commit-did-not-render-pattern: #cfd1d5;\n  --light-color-commit-did-not-render-pattern-text: #333333;\n  --light-color-commit-gradient-0: #37afa9;\n  --light-color-commit-gradient-1: #63b19e;\n  --light-color-commit-gradient-2: #80b393;\n  --light-color-commit-gradient-3: #97b488;\n  --light-color-commit-gradient-4: #abb67d;\n  --light-color-commit-gradient-5: #beb771;\n  --light-color-commit-gradient-6: #cfb965;\n  --light-color-commit-gradient-7: #dfba57;\n  --light-color-commit-gradient-8: #efbb49;\n  --light-color-commit-gradient-9: #febc38;\n  --light-color-commit-gradient-text: #000000;\n  --light-color-component-name: #6a51b2;\n  --light-color-component-name-inverted: #ffffff;\n  --light-color-component-badge-background: rgba(0, 0, 0, 0.1);\n  --light-color-component-badge-background-inverted: rgba(255, 255, 255, 0.25);\n  --light-color-component-badge-count: #777d88;\n  --light-color-component-badge-count-inverted: rgba(255, 255, 255, 0.7);\n  --light-color-context-background: rgba(0,0,0,.9);\n  --light-color-context-background-hover: rgba(255, 255, 255, 0.1);\n  --light-color-context-background-selected: #178fb9;\n  --light-color-context-border: #3d424a;\n  --light-color-context-text: #ffffff;\n  --light-color-context-text-selected: #ffffff;\n  --light-color-dim: #777d88;\n  --light-color-dimmer: #cfd1d5;\n  --light-color-dimmest: #eff0f1;\n  --light-color-error-background: hsl(0, 100%, 97%);\n  --light-color-error-border: hsl(0, 100%, 92%);\n  --light-color-error-text: #ff0000;\n  --light-color-expand-collapse-toggle: #777d88;\n  --light-color-link: #0000ff;\n  --light-color-modal-background: rgba(255, 255, 255, 0.75);\n  --light-color-record-active: #fc3a4b;\n  --light-color-record-hover: #3578e5;\n  --light-color-record-inactive: #0088fa;\n  --light-color-scroll-thumb: #c2c2c2;\n  --light-color-scroll-track: #fafafa;\n  --light-color-search-match: yellow;\n  --light-color-search-match-current: #f7923b;\n  --light-color-selected-tree-highlight-active: rgba(0, 136, 250, 0.1);\n  --light-color-selected-tree-highlight-inactive: rgba(0, 0, 0, 0.05);\n  --light-color-shadow: rgba(0, 0, 0, 0.25);\n  --light-color-tab-selected-border: #0088fa;\n  --light-color-text: #000000;\n  --light-color-text-invalid: #ff0000;\n  --light-color-text-selected: #ffffff;\n  --light-color-toggle-background-invalid: #fc3a4b;\n  --light-color-toggle-background-on: #0088fa;\n  --light-color-toggle-background-off: #cfd1d5;\n  --light-color-toggle-text: #ffffff;\n  --light-color-tooltip-background: rgba(0, 0, 0, 0.9);\n  --light-color-tooltip-text: #ffffff;\n\n  /* Dark theme */\n  --dark-color-attribute-name: #9d87d2;\n  --dark-color-attribute-name-not-editable: #ededed;\n  --dark-color-attribute-name-inverted: #282828;\n  --dark-color-attribute-value: #cedae0;\n  --dark-color-attribute-value-inverted: #ffffff;\n  --dark-color-attribute-editable-value: yellow;\n  --dark-color-background: #282c34;\n  --dark-color-background-hover: rgba(255, 255, 255, 0.1);\n  --dark-color-background-inactive: #3d424a;\n  --dark-color-background-invalid: #5c0000;\n  --dark-color-background-selected: #178fb9;\n  --dark-color-button-background: #282c34;\n  --dark-color-button-background-focus: #3d424a;\n  --dark-color-button: #afb3b9;\n  --dark-color-button-active: #61dafb;\n  --dark-color-button-disabled: #4f5766;\n  --dark-color-button-focus: #a2e9fc;\n  --dark-color-button-hover: #ededed;\n  --dark-color-border: #3d424a;\n  --dark-color-commit-did-not-render-fill: #777d88;\n  --dark-color-commit-did-not-render-fill-text: #000000;\n  --dark-color-commit-did-not-render-pattern: #666c77;\n  --dark-color-commit-did-not-render-pattern-text: #ffffff;\n  --dark-color-commit-gradient-0: #37afa9;\n  --dark-color-commit-gradient-1: #63b19e;\n  --dark-color-commit-gradient-2: #80b393;\n  --dark-color-commit-gradient-3: #97b488;\n  --dark-color-commit-gradient-4: #abb67d;\n  --dark-color-commit-gradient-5: #beb771;\n  --dark-color-commit-gradient-6: #cfb965;\n  --dark-color-commit-gradient-7: #dfba57;\n  --dark-color-commit-gradient-8: #efbb49;\n  --dark-color-commit-gradient-9: #febc38;\n  --dark-color-commit-gradient-text: #000000;\n  --dark-color-component-name: #61dafb;\n  --dark-color-component-name-inverted: #282828;\n  --dark-color-component-badge-background: rgba(255, 255, 255, 0.25);\n  --dark-color-component-badge-background-inverted: rgba(0, 0, 0, 0.25);\n  --dark-color-component-badge-count: #8f949d;\n  --dark-color-component-badge-count-inverted: rgba(255, 255, 255, 0.7);\n  --dark-color-context-background: rgba(255,255,255,.9);\n  --dark-color-context-background-hover: rgba(0, 136, 250, 0.1);\n  --dark-color-context-background-selected: #0088fa;\n  --dark-color-context-border: #eeeeee;\n  --dark-color-context-text: #000000;\n  --dark-color-context-text-selected: #ffffff;\n  --dark-color-dim: #8f949d;\n  --dark-color-dimmer: #777d88;\n  --dark-color-dimmest: #4f5766;\n  --dark-color-error-background: #200;\n  --dark-color-error-border: #900;\n  --dark-color-error-text: #f55;\n  --dark-color-expand-collapse-toggle: #8f949d;\n  --dark-color-link: #61dafb;\n  --dark-color-modal-background: rgba(0, 0, 0, 0.75);\n  --dark-color-record-active: #fc3a4b;\n  --dark-color-record-hover: #a2e9fc;\n  --dark-color-record-inactive: #61dafb;\n  --dark-color-scroll-thumb: #afb3b9;\n  --dark-color-scroll-track: #313640;\n  --dark-color-search-match: yellow;\n  --dark-color-search-match-current: #f7923b;\n  --dark-color-selected-tree-highlight-active: rgba(23, 143, 185, 0.15);\n  --dark-color-selected-tree-highlight-inactive: rgba(255, 255, 255, 0.05);\n  --dark-color-shadow: rgba(0, 0, 0, 0.5);\n  --dark-color-tab-selected-border: #178fb9;\n  --dark-color-text: #ffffff;\n  --dark-color-text-invalid: #ff8080;\n  --dark-color-text-selected: #ffffff;\n  --dark-color-toggle-background-invalid: #fc3a4b;\n  --dark-color-toggle-background-on: #178fb9;\n  --dark-color-toggle-background-off: #777d88;\n  --dark-color-toggle-text: #ffffff;\n  --dark-color-tooltip-background: rgba(255, 255, 255, 0.9);\n  --dark-color-tooltip-text: #000000;\n\n  /* Font smoothing */\n  --light-font-smoothing: auto;\n  --dark-font-smoothing: antialiased;\n  --font-smoothing: auto;\n\n  /* Compact density */\n  --compact-font-size-monospace-small: 9px;\n  --compact-font-size-monospace-normal: 11px;\n  --compact-font-size-monospace-large: 15px;\n  --compact-font-size-sans-small: 10px;\n  --compact-font-size-sans-normal: 12px;\n  --compact-font-size-sans-large: 14px;\n  --compact-line-height-data: 18px;\n  --compact-root-font-size: 16px;\n\n  /* Comfortable density */\n  --comfortable-font-size-monospace-small: 10px;\n  --comfortable-font-size-monospace-normal: 13px;\n  --comfortable-font-size-monospace-large: 17px;\n  --comfortable-font-size-sans-small: 12px;\n  --comfortable-font-size-sans-normal: 14px;\n  --comfortable-font-size-sans-large: 16px;\n  --comfortable-line-height-data: 22px;\n  --comfortable-root-font-size: 20px;\n\n  /* GitHub.com system fonts */\n  --font-family-monospace: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo,\n    Courier, monospace;\n  --font-family-sans: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica,\n    Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;\n\n  /* Constant values shared between JS and CSS */\n  --interaction-commit-size: 10px;\n  --interaction-label-width: 200px;\n}\n`},function(i,u,f){\"use strict\";function c(x){var D=this;if(D instanceof c||(D=new c),D.tail=null,D.head=null,D.length=0,x&&typeof x.forEach==\"function\")x.forEach(function(j){D.push(j)});else if(arguments.length>0)for(var L=0,N=arguments.length;L<N;L++)D.push(arguments[L]);return D}function g(x,D,L){var N=D===x.head?new A(L,null,D,x):new A(L,D,D.next,x);return N.next===null&&(x.tail=N),N.prev===null&&(x.head=N),x.length++,N}function t(x,D){x.tail=new A(D,x.tail,null,x),x.head||(x.head=x.tail),x.length++}function C(x,D){x.head=new A(D,null,x.head,x),x.tail||(x.tail=x.head),x.length++}function A(x,D,L,N){if(!(this instanceof A))return new A(x,D,L,N);this.list=N,this.value=x,D?(D.next=this,this.prev=D):this.prev=null,L?(L.prev=this,this.next=L):this.next=null}i.exports=c,c.Node=A,c.create=c,c.prototype.removeNode=function(x){if(x.list!==this)throw new Error(\"removing node which does not belong to this list\");var D=x.next,L=x.prev;return D&&(D.prev=L),L&&(L.next=D),x===this.head&&(this.head=D),x===this.tail&&(this.tail=L),x.list.length--,x.next=null,x.prev=null,x.list=null,D},c.prototype.unshiftNode=function(x){if(x!==this.head){x.list&&x.list.removeNode(x);var D=this.head;x.list=this,x.next=D,D&&(D.prev=x),this.head=x,this.tail||(this.tail=x),this.length++}},c.prototype.pushNode=function(x){if(x!==this.tail){x.list&&x.list.removeNode(x);var D=this.tail;x.list=this,x.prev=D,D&&(D.next=x),this.tail=x,this.head||(this.head=x),this.length++}},c.prototype.push=function(){for(var x=0,D=arguments.length;x<D;x++)t(this,arguments[x]);return this.length},c.prototype.unshift=function(){for(var x=0,D=arguments.length;x<D;x++)C(this,arguments[x]);return this.length},c.prototype.pop=function(){if(this.tail){var x=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,x}},c.prototype.shift=function(){if(this.head){var x=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,x}},c.prototype.forEach=function(x,D){D=D||this;for(var L=this.head,N=0;L!==null;N++)x.call(D,L.value,N,this),L=L.next},c.prototype.forEachReverse=function(x,D){D=D||this;for(var L=this.tail,N=this.length-1;L!==null;N--)x.call(D,L.value,N,this),L=L.prev},c.prototype.get=function(x){for(var D=0,L=this.head;L!==null&&D<x;D++)L=L.next;if(D===x&&L!==null)return L.value},c.prototype.getReverse=function(x){for(var D=0,L=this.tail;L!==null&&D<x;D++)L=L.prev;if(D===x&&L!==null)return L.value},c.prototype.map=function(x,D){D=D||this;for(var L=new c,N=this.head;N!==null;)L.push(x.call(D,N.value,this)),N=N.next;return L},c.prototype.mapReverse=function(x,D){D=D||this;for(var L=new c,N=this.tail;N!==null;)L.push(x.call(D,N.value,this)),N=N.prev;return L},c.prototype.reduce=function(x,D){var L,N=this.head;if(arguments.length>1)L=D;else{if(!this.head)throw new TypeError(\"Reduce of empty list with no initial value\");N=this.head.next,L=this.head.value}for(var j=0;N!==null;j++)L=x(L,N.value,j),N=N.next;return L},c.prototype.reduceReverse=function(x,D){var L,N=this.tail;if(arguments.length>1)L=D;else{if(!this.tail)throw new TypeError(\"Reduce of empty list with no initial value\");N=this.tail.prev,L=this.tail.value}for(var j=this.length-1;N!==null;j--)L=x(L,N.value,j),N=N.prev;return L},c.prototype.toArray=function(){for(var x=new Array(this.length),D=0,L=this.head;L!==null;D++)x[D]=L.value,L=L.next;return x},c.prototype.toArrayReverse=function(){for(var x=new Array(this.length),D=0,L=this.tail;L!==null;D++)x[D]=L.value,L=L.prev;return x},c.prototype.slice=function(x,D){(D=D||this.length)<0&&(D+=this.length),(x=x||0)<0&&(x+=this.length);var L=new c;if(D<x||D<0)return L;x<0&&(x=0),D>this.length&&(D=this.length);for(var N=0,j=this.head;j!==null&&N<x;N++)j=j.next;for(;j!==null&&N<D;N++,j=j.next)L.push(j.value);return L},c.prototype.sliceReverse=function(x,D){(D=D||this.length)<0&&(D+=this.length),(x=x||0)<0&&(x+=this.length);var L=new c;if(D<x||D<0)return L;x<0&&(x=0),D>this.length&&(D=this.length);for(var N=this.length,j=this.tail;j!==null&&N>D;N--)j=j.prev;for(;j!==null&&N>x;N--,j=j.prev)L.push(j.value);return L},c.prototype.splice=function(x,D){x>this.length&&(x=this.length-1),x<0&&(x=this.length+x);for(var L=0,N=this.head;N!==null&&L<x;L++)N=N.next;var j=[];for(L=0;N&&L<D;L++)j.push(N.value),N=this.removeNode(N);for(N===null&&(N=this.tail),N!==this.head&&N!==this.tail&&(N=N.prev),L=2;L<arguments.length;L++)N=g(this,N,arguments[L]);return j},c.prototype.reverse=function(){for(var x=this.head,D=this.tail,L=x;L!==null;L=L.prev){var N=L.prev;L.prev=L.next,L.next=N}return this.head=D,this.tail=x,this};try{f(11)(c)}catch(x){}},function(i,u,f){\"use strict\";i.exports=function(c){c.prototype[Symbol.iterator]=regeneratorRuntime.mark(function g(){var t;return regeneratorRuntime.wrap(function(C){for(;;)switch(C.prev=C.next){case 0:t=this.head;case 1:if(!t){C.next=7;break}return C.next=4,t.value;case 4:t=t.next,C.next=1;break;case 7:case\"end\":return C.stop()}},g,this)})}},function(i,u,f){\"use strict\";function c(Je){return(c=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(V){return typeof V}:function(V){return V&&typeof Symbol==\"function\"&&V.constructor===Symbol&&V!==Symbol.prototype?\"symbol\":typeof V})(Je)}var g=60103,t=60106,C=60107,A=60108,x=60114,D=60109,L=60110,N=60112,j=60113,$=60120,h=60115,re=60116,ce=60121,Q=60122,oe=60117,Se=60129,me=60131;if(typeof Symbol==\"function\"&&Symbol.for){var De=Symbol.for;g=De(\"react.element\"),t=De(\"react.portal\"),C=De(\"react.fragment\"),A=De(\"react.strict_mode\"),x=De(\"react.profiler\"),D=De(\"react.provider\"),L=De(\"react.context\"),N=De(\"react.forward_ref\"),j=De(\"react.suspense\"),$=De(\"react.suspense_list\"),h=De(\"react.memo\"),re=De(\"react.lazy\"),ce=De(\"react.block\"),Q=De(\"react.server.block\"),oe=De(\"react.fundamental\"),Se=De(\"react.debug_trace_mode\"),me=De(\"react.legacy_hidden\")}function J(Je){if(c(Je)===\"object\"&&Je!==null){var V=Je.$$typeof;switch(V){case g:switch(Je=Je.type){case C:case x:case A:case j:case $:return Je;default:switch(Je=Je&&Je.$$typeof){case L:case N:case re:case h:case D:return Je;default:return V}}case t:return V}}}var Te=D,Oe=g,Le=N,ot=C,ct=re,Ue=h,be=t,At=x,Ot=A,Nt=j;u.ContextConsumer=L,u.ContextProvider=Te,u.Element=Oe,u.ForwardRef=Le,u.Fragment=ot,u.Lazy=ct,u.Memo=Ue,u.Portal=be,u.Profiler=At,u.StrictMode=Ot,u.Suspense=Nt,u.isAsyncMode=function(){return!1},u.isConcurrentMode=function(){return!1},u.isContextConsumer=function(Je){return J(Je)===L},u.isContextProvider=function(Je){return J(Je)===D},u.isElement=function(Je){return c(Je)===\"object\"&&Je!==null&&Je.$$typeof===g},u.isForwardRef=function(Je){return J(Je)===N},u.isFragment=function(Je){return J(Je)===C},u.isLazy=function(Je){return J(Je)===re},u.isMemo=function(Je){return J(Je)===h},u.isPortal=function(Je){return J(Je)===t},u.isProfiler=function(Je){return J(Je)===x},u.isStrictMode=function(Je){return J(Je)===A},u.isSuspense=function(Je){return J(Je)===j},u.isValidElementType=function(Je){return typeof Je==\"string\"||typeof Je==\"function\"||Je===C||Je===x||Je===Se||Je===A||Je===j||Je===$||Je===me||c(Je)===\"object\"&&Je!==null&&(Je.$$typeof===re||Je.$$typeof===h||Je.$$typeof===D||Je.$$typeof===L||Je.$$typeof===N||Je.$$typeof===oe||Je.$$typeof===ce||Je[0]===Q)},u.typeOf=J},function(i,u,f){(function(c){var g=c!==void 0&&c||typeof self!=\"undefined\"&&self||window,t=Function.prototype.apply;function C(A,x){this._id=A,this._clearFn=x}u.setTimeout=function(){return new C(t.call(setTimeout,g,arguments),clearTimeout)},u.setInterval=function(){return new C(t.call(setInterval,g,arguments),clearInterval)},u.clearTimeout=u.clearInterval=function(A){A&&A.close()},C.prototype.unref=C.prototype.ref=function(){},C.prototype.close=function(){this._clearFn.call(g,this._id)},u.enroll=function(A,x){clearTimeout(A._idleTimeoutId),A._idleTimeout=x},u.unenroll=function(A){clearTimeout(A._idleTimeoutId),A._idleTimeout=-1},u._unrefActive=u.active=function(A){clearTimeout(A._idleTimeoutId);var x=A._idleTimeout;x>=0&&(A._idleTimeoutId=setTimeout(function(){A._onTimeout&&A._onTimeout()},x))},f(14),u.setImmediate=typeof self!=\"undefined\"&&self.setImmediate||c!==void 0&&c.setImmediate||this&&this.setImmediate,u.clearImmediate=typeof self!=\"undefined\"&&self.clearImmediate||c!==void 0&&c.clearImmediate||this&&this.clearImmediate}).call(this,f(4))},function(i,u,f){(function(c,g){(function(t,C){\"use strict\";if(!t.setImmediate){var A,x,D,L,N,j=1,$={},h=!1,re=t.document,ce=Object.getPrototypeOf&&Object.getPrototypeOf(t);ce=ce&&ce.setTimeout?ce:t,{}.toString.call(t.process)===\"[object process]\"?A=function(Se){g.nextTick(function(){oe(Se)})}:function(){if(t.postMessage&&!t.importScripts){var Se=!0,me=t.onmessage;return t.onmessage=function(){Se=!1},t.postMessage(\"\",\"*\"),t.onmessage=me,Se}}()?(L=\"setImmediate$\"+Math.random()+\"$\",N=function(Se){Se.source===t&&typeof Se.data==\"string\"&&Se.data.indexOf(L)===0&&oe(+Se.data.slice(L.length))},t.addEventListener?t.addEventListener(\"message\",N,!1):t.attachEvent(\"onmessage\",N),A=function(Se){t.postMessage(L+Se,\"*\")}):t.MessageChannel?((D=new MessageChannel).port1.onmessage=function(Se){oe(Se.data)},A=function(Se){D.port2.postMessage(Se)}):re&&\"onreadystatechange\"in re.createElement(\"script\")?(x=re.documentElement,A=function(Se){var me=re.createElement(\"script\");me.onreadystatechange=function(){oe(Se),me.onreadystatechange=null,x.removeChild(me),me=null},x.appendChild(me)}):A=function(Se){setTimeout(oe,0,Se)},ce.setImmediate=function(Se){typeof Se!=\"function\"&&(Se=new Function(\"\"+Se));for(var me=new Array(arguments.length-1),De=0;De<me.length;De++)me[De]=arguments[De+1];var J={callback:Se,args:me};return $[j]=J,A(j),j++},ce.clearImmediate=Q}function Q(Se){delete $[Se]}function oe(Se){if(h)setTimeout(oe,0,Se);else{var me=$[Se];if(me){h=!0;try{(function(De){var J=De.callback,Te=De.args;switch(Te.length){case 0:J();break;case 1:J(Te[0]);break;case 2:J(Te[0],Te[1]);break;case 3:J(Te[0],Te[1],Te[2]);break;default:J.apply(void 0,Te)}})(me)}finally{Q(Se),h=!1}}}}})(typeof self==\"undefined\"?c===void 0?this:c:self)}).call(this,f(4),f(5))},function(i,u,f){\"use strict\";function c(J){return(c=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(Te){return typeof Te}:function(Te){return Te&&typeof Symbol==\"function\"&&Te.constructor===Symbol&&Te!==Symbol.prototype?\"symbol\":typeof Te})(J)}var g=f(1),t=f(16),C=f(18).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=60128;if(typeof Symbol==\"function\"&&Symbol.for){var x=Symbol.for;A=x(\"react.opaque.id\")}var D=[],L=null,N=null;function j(){if(L===null){var J=new Map;try{re.useContext({_currentValue:null}),re.useState(null),re.useReducer(function(ot){return ot},null),re.useRef(null),re.useLayoutEffect(function(){}),re.useEffect(function(){}),re.useImperativeHandle(void 0,function(){return null}),re.useDebugValue(null),re.useCallback(function(){}),re.useMemo(function(){return null})}finally{var Te=D;D=[]}for(var Oe=0;Oe<Te.length;Oe++){var Le=Te[Oe];J.set(Le.primitive,t.parse(Le.stackError))}L=J}return L}var $=null;function h(){var J=$;return J!==null&&($=J.next),J}var re={readContext:function(J){return J._currentValue},useCallback:function(J){var Te=h();return D.push({primitive:\"Callback\",stackError:Error(),value:Te!==null?Te.memoizedState[0]:J}),J},useContext:function(J){return D.push({primitive:\"Context\",stackError:Error(),value:J._currentValue}),J._currentValue},useEffect:function(J){h(),D.push({primitive:\"Effect\",stackError:Error(),value:J})},useImperativeHandle:function(J){h();var Te=void 0;J!==null&&c(J)===\"object\"&&(Te=J.current),D.push({primitive:\"ImperativeHandle\",stackError:Error(),value:Te})},useDebugValue:function(J,Te){D.push({primitive:\"DebugValue\",stackError:Error(),value:typeof Te==\"function\"?Te(J):J})},useLayoutEffect:function(J){h(),D.push({primitive:\"LayoutEffect\",stackError:Error(),value:J})},useMemo:function(J){var Te=h();return J=Te!==null?Te.memoizedState[0]:J(),D.push({primitive:\"Memo\",stackError:Error(),value:J}),J},useReducer:function(J,Te,Oe){return Te=(J=h())!==null?J.memoizedState:Oe!==void 0?Oe(Te):Te,D.push({primitive:\"Reducer\",stackError:Error(),value:Te}),[Te,function(){}]},useRef:function(J){var Te=h();return J=Te!==null?Te.memoizedState:{current:J},D.push({primitive:\"Ref\",stackError:Error(),value:J.current}),J},useState:function(J){var Te=h();return J=Te!==null?Te.memoizedState:typeof J==\"function\"?J():J,D.push({primitive:\"State\",stackError:Error(),value:J}),[J,function(){}]},useTransition:function(){return h(),h(),D.push({primitive:\"Transition\",stackError:Error(),value:void 0}),[function(){},!1]},useMutableSource:function(J,Te){return h(),h(),h(),h(),J=Te(J._source),D.push({primitive:\"MutableSource\",stackError:Error(),value:J}),J},useDeferredValue:function(J){return h(),h(),D.push({primitive:\"DeferredValue\",stackError:Error(),value:J}),J},useOpaqueIdentifier:function(){var J=h();return N&&N.mode===0&&h(),(J=J===null?void 0:J.memoizedState)&&J.$$typeof===A&&(J=void 0),D.push({primitive:\"OpaqueIdentifier\",stackError:Error(),value:J}),J}},ce=0;function Q(J,Te,Oe){var Le=Te[Oe].source,ot=0;e:for(;ot<J.length;ot++)if(J[ot].source===Le){for(var ct=Oe+1,Ue=ot+1;ct<Te.length&&Ue<J.length;ct++,Ue++)if(J[Ue].source!==Te[ct].source)continue e;return ot}return-1}function oe(J,Te){return!!J&&(Te=\"use\"+Te,!(J.length<Te.length)&&J.lastIndexOf(Te)===J.length-Te.length)}function Se(J){if(!J)return\"\";var Te=J.lastIndexOf(\".\");return Te===-1&&(Te=0),J.substr(Te,3)===\"use\"&&(Te+=3),J.substr(Te)}function me(J,Te){for(var Oe=[],Le=null,ot=Oe,ct=0,Ue=[],be=0;be<Te.length;be++){var At=Te[be],Ot=J,Nt=t.parse(At.stackError);e:{var Je=Nt,V=Q(Je,Ot,ce);if(V!==-1)Ot=V;else{for(var ne=0;ne<Ot.length&&5>ne;ne++)if((V=Q(Je,Ot,ne))!==-1){ce=ne,Ot=V;break e}Ot=-1}}e:{if(Je=Nt,(V=j().get(At.primitive))!==void 0){for(ne=0;ne<V.length&&ne<Je.length;ne++)if(V[ne].source!==Je[ne].source){ne<Je.length-1&&oe(Je[ne].functionName,At.primitive)&&ne++,ne<Je.length-1&&oe(Je[ne].functionName,At.primitive)&&ne++,Je=ne;break e}}Je=-1}if((Nt=Ot===-1||Je===-1||2>Ot-Je?null:Nt.slice(Je,Ot-1))!==null){if(Ot=0,Le!==null){for(;Ot<Nt.length&&Ot<Le.length&&Nt[Nt.length-Ot-1].source===Le[Le.length-Ot-1].source;)Ot++;for(Le=Le.length-1;Le>Ot;Le--)ot=Ue.pop()}for(Le=Nt.length-Ot-1;1<=Le;Le--)Ot=[],ot.push({id:null,isStateEditable:!1,name:Se(Nt[Le-1].functionName),value:void 0,subHooks:Ot}),Ue.push(ot),ot=Ot;Le=Nt}Ot=(Nt=At.primitive)===\"Context\"||Nt===\"DebugValue\"?null:ct++,ot.push({id:Ot,isStateEditable:Nt===\"Reducer\"||Nt===\"State\",name:Nt,value:At.value,subHooks:[]})}return function ge(Z,Ae){for(var at=[],it=0;it<Z.length;it++){var Ft=Z[it];Ft.name===\"DebugValue\"&&Ft.subHooks.length===0?(Z.splice(it,1),it--,at.push(Ft)):ge(Ft.subHooks,Ft)}Ae!==null&&(at.length===1?Ae.value=at[0].value:1<at.length&&(Ae.value=at.map(function(jt){return jt.value})))}(Oe,null),Oe}function De(J,Te,Oe){Oe==null&&(Oe=C.ReactCurrentDispatcher);var Le=Oe.current;Oe.current=re;try{var ot=Error();J(Te)}finally{J=D,D=[],Oe.current=Le}return me(Oe=t.parse(ot),J)}u.inspectHooks=De,u.inspectHooksOfFiber=function(J,Te){if(Te==null&&(Te=C.ReactCurrentDispatcher),N=J,J.tag!==0&&J.tag!==15&&J.tag!==11&&J.tag!==22)throw Error(\"Unknown Fiber. Needs to be a function component to inspect hooks.\");j();var Oe=J.type,Le=J.memoizedProps;if(Oe!==J.elementType&&Oe&&Oe.defaultProps){Le=g({},Le);var ot=Oe.defaultProps;for(ct in ot)Le[ct]===void 0&&(Le[ct]=ot[ct])}$=J.memoizedState;var ct=new Map;try{for(ot=J;ot;){if(ot.tag===10){var Ue=ot.type._context;ct.has(Ue)||(ct.set(Ue,Ue._currentValue),Ue._currentValue=ot.memoizedProps.value)}ot=ot.return}if(J.tag===11){var be=Oe.render;Oe=Le;var At=J.ref,Ot=(J=Te).current;J.current=re;try{var Nt=Error();be(Oe,At)}finally{var Je=D;D=[],J.current=Ot}return me(t.parse(Nt),Je)}return De(Oe,Le,Te)}finally{$=null,function(V){V.forEach(function(ne,ge){return ge._currentValue=ne})}(ct)}}},function(i,u,f){var c,g,t;(function(C,A){\"use strict\";g=[f(17)],(t=typeof(c=function(x){var D=/(^|@)\\S+:\\d+/,L=/^\\s*at .*(\\S+:\\d+|\\(native\\))/m,N=/^(eval@)?(\\[native code])?$/;return{parse:function(j){if(j.stacktrace!==void 0||j[\"opera#sourceloc\"]!==void 0)return this.parseOpera(j);if(j.stack&&j.stack.match(L))return this.parseV8OrIE(j);if(j.stack)return this.parseFFOrSafari(j);throw new Error(\"Cannot parse given Error object\")},extractLocation:function(j){if(j.indexOf(\":\")===-1)return[j];var $=/(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(j.replace(/[()]/g,\"\"));return[$[1],$[2]||void 0,$[3]||void 0]},parseV8OrIE:function(j){return j.stack.split(`\n`).filter(function($){return!!$.match(L)},this).map(function($){$.indexOf(\"(eval \")>-1&&($=$.replace(/eval code/g,\"eval\").replace(/(\\(eval at [^()]*)|(\\),.*$)/g,\"\"));var h=$.replace(/^\\s+/,\"\").replace(/\\(eval code/g,\"(\"),re=h.match(/ (\\((.+):(\\d+):(\\d+)\\)$)/),ce=(h=re?h.replace(re[0],\"\"):h).split(/\\s+/).slice(1),Q=this.extractLocation(re?re[1]:ce.pop()),oe=ce.join(\" \")||void 0,Se=[\"eval\",\"<anonymous>\"].indexOf(Q[0])>-1?void 0:Q[0];return new x({functionName:oe,fileName:Se,lineNumber:Q[1],columnNumber:Q[2],source:$})},this)},parseFFOrSafari:function(j){return j.stack.split(`\n`).filter(function($){return!$.match(N)},this).map(function($){if($.indexOf(\" > eval\")>-1&&($=$.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g,\":$1\")),$.indexOf(\"@\")===-1&&$.indexOf(\":\")===-1)return new x({functionName:$});var h=/((.*\".+\"[^@]*)?[^@]*)(?:@)/,re=$.match(h),ce=re&&re[1]?re[1]:void 0,Q=this.extractLocation($.replace(h,\"\"));return new x({functionName:ce,fileName:Q[0],lineNumber:Q[1],columnNumber:Q[2],source:$})},this)},parseOpera:function(j){return!j.stacktrace||j.message.indexOf(`\n`)>-1&&j.message.split(`\n`).length>j.stacktrace.split(`\n`).length?this.parseOpera9(j):j.stack?this.parseOpera11(j):this.parseOpera10(j)},parseOpera9:function(j){for(var $=/Line (\\d+).*script (?:in )?(\\S+)/i,h=j.message.split(`\n`),re=[],ce=2,Q=h.length;ce<Q;ce+=2){var oe=$.exec(h[ce]);oe&&re.push(new x({fileName:oe[2],lineNumber:oe[1],source:h[ce]}))}return re},parseOpera10:function(j){for(var $=/Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i,h=j.stacktrace.split(`\n`),re=[],ce=0,Q=h.length;ce<Q;ce+=2){var oe=$.exec(h[ce]);oe&&re.push(new x({functionName:oe[3]||void 0,fileName:oe[2],lineNumber:oe[1],source:h[ce]}))}return re},parseOpera11:function(j){return j.stack.split(`\n`).filter(function($){return!!$.match(D)&&!$.match(/^Error created at/)},this).map(function($){var h,re=$.split(\"@\"),ce=this.extractLocation(re.pop()),Q=re.shift()||\"\",oe=Q.replace(/<anonymous function(: (\\w+))?>/,\"$2\").replace(/\\([^)]*\\)/g,\"\")||void 0;Q.match(/\\(([^)]*)\\)/)&&(h=Q.replace(/^[^(]+\\(([^)]*)\\)$/,\"$1\"));var Se=h===void 0||h===\"[arguments not available]\"?void 0:h.split(\",\");return new x({functionName:oe,args:Se,fileName:ce[0],lineNumber:ce[1],columnNumber:ce[2],source:$})},this)}}})==\"function\"?c.apply(u,g):c)===void 0||(i.exports=t)})()},function(i,u,f){var c,g,t;(function(C,A){\"use strict\";g=[],(t=typeof(c=function(){function x(oe){return oe.charAt(0).toUpperCase()+oe.substring(1)}function D(oe){return function(){return this[oe]}}var L=[\"isConstructor\",\"isEval\",\"isNative\",\"isToplevel\"],N=[\"columnNumber\",\"lineNumber\"],j=[\"fileName\",\"functionName\",\"source\"],$=L.concat(N,j,[\"args\"]);function h(oe){if(oe)for(var Se=0;Se<$.length;Se++)oe[$[Se]]!==void 0&&this[\"set\"+x($[Se])](oe[$[Se]])}h.prototype={getArgs:function(){return this.args},setArgs:function(oe){if(Object.prototype.toString.call(oe)!==\"[object Array]\")throw new TypeError(\"Args must be an Array\");this.args=oe},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(oe){if(oe instanceof h)this.evalOrigin=oe;else{if(!(oe instanceof Object))throw new TypeError(\"Eval Origin must be an Object or StackFrame\");this.evalOrigin=new h(oe)}},toString:function(){var oe=this.getFileName()||\"\",Se=this.getLineNumber()||\"\",me=this.getColumnNumber()||\"\",De=this.getFunctionName()||\"\";return this.getIsEval()?oe?\"[eval] (\"+oe+\":\"+Se+\":\"+me+\")\":\"[eval]:\"+Se+\":\"+me:De?De+\" (\"+oe+\":\"+Se+\":\"+me+\")\":oe+\":\"+Se+\":\"+me}},h.fromString=function(oe){var Se=oe.indexOf(\"(\"),me=oe.lastIndexOf(\")\"),De=oe.substring(0,Se),J=oe.substring(Se+1,me).split(\",\"),Te=oe.substring(me+1);if(Te.indexOf(\"@\")===0)var Oe=/@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(Te,\"\"),Le=Oe[1],ot=Oe[2],ct=Oe[3];return new h({functionName:De,args:J||void 0,fileName:Le,lineNumber:ot||void 0,columnNumber:ct||void 0})};for(var re=0;re<L.length;re++)h.prototype[\"get\"+x(L[re])]=D(L[re]),h.prototype[\"set\"+x(L[re])]=function(oe){return function(Se){this[oe]=Boolean(Se)}}(L[re]);for(var ce=0;ce<N.length;ce++)h.prototype[\"get\"+x(N[ce])]=D(N[ce]),h.prototype[\"set\"+x(N[ce])]=function(oe){return function(Se){if(me=Se,isNaN(parseFloat(me))||!isFinite(me))throw new TypeError(oe+\" must be a Number\");var me;this[oe]=Number(Se)}}(N[ce]);for(var Q=0;Q<j.length;Q++)h.prototype[\"get\"+x(j[Q])]=D(j[Q]),h.prototype[\"set\"+x(j[Q])]=function(oe){return function(Se){this[oe]=String(Se)}}(j[Q]);return h})==\"function\"?c.apply(u,g):c)===void 0||(i.exports=t)})()},function(i,u,f){\"use strict\";i.exports=f(19)},function(i,u,f){\"use strict\";function c(Z){return(c=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(Ae){return typeof Ae}:function(Ae){return Ae&&typeof Symbol==\"function\"&&Ae.constructor===Symbol&&Ae!==Symbol.prototype?\"symbol\":typeof Ae})(Z)}var g=f(1),t=60103,C=60106;u.Fragment=60107,u.StrictMode=60108,u.Profiler=60114;var A=60109,x=60110,D=60112;u.Suspense=60113,u.unstable_SuspenseList=60120;var L=60115,N=60116,j=60121;if(u.unstable_DebugTracingMode=60129,u.unstable_LegacyHidden=60131,typeof Symbol==\"function\"&&Symbol.for){var $=Symbol.for;t=$(\"react.element\"),C=$(\"react.portal\"),u.Fragment=$(\"react.fragment\"),u.StrictMode=$(\"react.strict_mode\"),u.Profiler=$(\"react.profiler\"),A=$(\"react.provider\"),x=$(\"react.context\"),D=$(\"react.forward_ref\"),u.Suspense=$(\"react.suspense\"),u.unstable_SuspenseList=$(\"react.suspense_list\"),L=$(\"react.memo\"),N=$(\"react.lazy\"),j=$(\"react.block\"),u.unstable_DebugTracingMode=$(\"react.debug_trace_mode\"),u.unstable_LegacyHidden=$(\"react.legacy_hidden\")}var h=typeof Symbol==\"function\"&&Symbol.iterator;function re(Z){for(var Ae=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+Z,at=1;at<arguments.length;at++)Ae+=\"&args[]=\"+encodeURIComponent(arguments[at]);return\"Minified React error #\"+Z+\"; visit \"+Ae+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}var ce={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Q={};function oe(Z,Ae,at){this.props=Z,this.context=Ae,this.refs=Q,this.updater=at||ce}function Se(){}function me(Z,Ae,at){this.props=Z,this.context=Ae,this.refs=Q,this.updater=at||ce}oe.prototype.isReactComponent={},oe.prototype.setState=function(Z,Ae){if(c(Z)!==\"object\"&&typeof Z!=\"function\"&&Z!=null)throw Error(re(85));this.updater.enqueueSetState(this,Z,Ae,\"setState\")},oe.prototype.forceUpdate=function(Z){this.updater.enqueueForceUpdate(this,Z,\"forceUpdate\")},Se.prototype=oe.prototype;var De=me.prototype=new Se;De.constructor=me,g(De,oe.prototype),De.isPureReactComponent=!0;var J={current:null},Te=Object.prototype.hasOwnProperty,Oe={key:!0,ref:!0,__self:!0,__source:!0};function Le(Z,Ae,at){var it,Ft={},jt=null,hn=null;if(Ae!=null)for(it in Ae.ref!==void 0&&(hn=Ae.ref),Ae.key!==void 0&&(jt=\"\"+Ae.key),Ae)Te.call(Ae,it)&&!Oe.hasOwnProperty(it)&&(Ft[it]=Ae[it]);var Un=arguments.length-2;if(Un===1)Ft.children=at;else if(1<Un){for(var Jt=Array(Un),Yt=0;Yt<Un;Yt++)Jt[Yt]=arguments[Yt+2];Ft.children=Jt}if(Z&&Z.defaultProps)for(it in Un=Z.defaultProps)Ft[it]===void 0&&(Ft[it]=Un[it]);return{$$typeof:t,type:Z,key:jt,ref:hn,props:Ft,_owner:J.current}}function ot(Z){return c(Z)===\"object\"&&Z!==null&&Z.$$typeof===t}var ct=/\\/+/g;function Ue(Z,Ae){return c(Z)===\"object\"&&Z!==null&&Z.key!=null?function(at){var it={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+at.replace(/[=:]/g,function(Ft){return it[Ft]})}(\"\"+Z.key):Ae.toString(36)}function be(Z,Ae,at,it,Ft){var jt=c(Z);jt!==\"undefined\"&&jt!==\"boolean\"||(Z=null);var hn=!1;if(Z===null)hn=!0;else switch(jt){case\"string\":case\"number\":hn=!0;break;case\"object\":switch(Z.$$typeof){case t:case C:hn=!0}}if(hn)return Ft=Ft(hn=Z),Z=it===\"\"?\".\"+Ue(hn,0):it,Array.isArray(Ft)?(at=\"\",Z!=null&&(at=Z.replace(ct,\"$&/\")+\"/\"),be(Ft,Ae,at,\"\",function(Yt){return Yt})):Ft!=null&&(ot(Ft)&&(Ft=function(Yt,cr){return{$$typeof:t,type:Yt.type,key:cr,ref:Yt.ref,props:Yt.props,_owner:Yt._owner}}(Ft,at+(!Ft.key||hn&&hn.key===Ft.key?\"\":(\"\"+Ft.key).replace(ct,\"$&/\")+\"/\")+Z)),Ae.push(Ft)),1;if(hn=0,it=it===\"\"?\".\":it+\":\",Array.isArray(Z))for(var Un=0;Un<Z.length;Un++){var Jt=it+Ue(jt=Z[Un],Un);hn+=be(jt,Ae,at,Jt,Ft)}else if(typeof(Jt=function(Yt){return Yt===null||c(Yt)!==\"object\"?null:typeof(Yt=h&&Yt[h]||Yt[\"@@iterator\"])==\"function\"?Yt:null}(Z))==\"function\")for(Z=Jt.call(Z),Un=0;!(jt=Z.next()).done;)hn+=be(jt=jt.value,Ae,at,Jt=it+Ue(jt,Un++),Ft);else if(jt===\"object\")throw Ae=\"\"+Z,Error(re(31,Ae===\"[object Object]\"?\"object with keys {\"+Object.keys(Z).join(\", \")+\"}\":Ae));return hn}function At(Z,Ae,at){if(Z==null)return Z;var it=[],Ft=0;return be(Z,it,\"\",\"\",function(jt){return Ae.call(at,jt,Ft++)}),it}function Ot(Z){if(Z._status===-1){var Ae=Z._result;Ae=Ae(),Z._status=0,Z._result=Ae,Ae.then(function(at){Z._status===0&&(at=at.default,Z._status=1,Z._result=at)},function(at){Z._status===0&&(Z._status=2,Z._result=at)})}if(Z._status===1)return Z._result;throw Z._result}function Nt(Z){return{$$typeof:j,_data:Z.load.apply(null,Z.args),_render:Z.render}}var Je={current:null};function V(){var Z=Je.current;if(Z===null)throw Error(re(321));return Z}var ne={transition:0},ge={ReactCurrentDispatcher:Je,ReactCurrentBatchConfig:ne,ReactCurrentOwner:J,IsSomeRendererActing:{current:!1},assign:g};u.Children={map:At,forEach:function(Z,Ae,at){At(Z,function(){Ae.apply(this,arguments)},at)},count:function(Z){var Ae=0;return At(Z,function(){Ae++}),Ae},toArray:function(Z){return At(Z,function(Ae){return Ae})||[]},only:function(Z){if(!ot(Z))throw Error(re(143));return Z}},u.Component=oe,u.PureComponent=me,u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ge,u.cloneElement=function(Z,Ae,at){if(Z==null)throw Error(re(267,Z));var it=g({},Z.props),Ft=Z.key,jt=Z.ref,hn=Z._owner;if(Ae!=null){if(Ae.ref!==void 0&&(jt=Ae.ref,hn=J.current),Ae.key!==void 0&&(Ft=\"\"+Ae.key),Z.type&&Z.type.defaultProps)var Un=Z.type.defaultProps;for(Jt in Ae)Te.call(Ae,Jt)&&!Oe.hasOwnProperty(Jt)&&(it[Jt]=Ae[Jt]===void 0&&Un!==void 0?Un[Jt]:Ae[Jt])}var Jt=arguments.length-2;if(Jt===1)it.children=at;else if(1<Jt){Un=Array(Jt);for(var Yt=0;Yt<Jt;Yt++)Un[Yt]=arguments[Yt+2];it.children=Un}return{$$typeof:t,type:Z.type,key:Ft,ref:jt,props:it,_owner:hn}},u.createContext=function(Z,Ae){return Ae===void 0&&(Ae=null),(Z={$$typeof:x,_calculateChangedBits:Ae,_currentValue:Z,_currentValue2:Z,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:A,_context:Z},Z.Consumer=Z},u.createElement=Le,u.createFactory=function(Z){var Ae=Le.bind(null,Z);return Ae.type=Z,Ae},u.createRef=function(){return{current:null}},u.forwardRef=function(Z){return{$$typeof:D,render:Z}},u.isValidElement=ot,u.lazy=function(Z){return{$$typeof:N,_payload:{_status:-1,_result:Z},_init:Ot}},u.memo=function(Z,Ae){return{$$typeof:L,type:Z,compare:Ae===void 0?null:Ae}},u.unstable_block=function(Z,Ae){return Ae===void 0?function(){return{$$typeof:j,_data:void 0,_render:Z}}:function(){return{$$typeof:N,_payload:{load:Ae,args:arguments,render:Z},_init:Nt}}},u.unstable_createMutableSource=function(Z,Ae){return{_getVersion:Ae,_source:Z,_workInProgressVersionPrimary:null,_workInProgressVersionSecondary:null}},u.unstable_startTransition=function(Z){var Ae=ne.transition;ne.transition=1;try{Z()}finally{ne.transition=Ae}},u.unstable_useDeferredValue=function(Z){return V().useDeferredValue(Z)},u.unstable_useMutableSource=function(Z,Ae,at){return V().useMutableSource(Z,Ae,at)},u.unstable_useOpaqueIdentifier=function(){return V().useOpaqueIdentifier()},u.unstable_useTransition=function(){return V().useTransition()},u.useCallback=function(Z,Ae){return V().useCallback(Z,Ae)},u.useContext=function(Z,Ae){return V().useContext(Z,Ae)},u.useDebugValue=function(){},u.useEffect=function(Z,Ae){return V().useEffect(Z,Ae)},u.useImperativeHandle=function(Z,Ae,at){return V().useImperativeHandle(Z,Ae,at)},u.useLayoutEffect=function(Z,Ae){return V().useLayoutEffect(Z,Ae)},u.useMemo=function(Z,Ae){return V().useMemo(Z,Ae)},u.useReducer=function(Z,Ae,at){return V().useReducer(Z,Ae,at)},u.useRef=function(Z){return V().useRef(Z)},u.useState=function(Z){return V().useState(Z)},u.version=\"17.0.0-alpha.0-experimental-51a3aa6af\"},function(i,u,f){\"use strict\";function c(F,R){for(var U=0;U<R.length;U++){var H=R[U];H.enumerable=H.enumerable||!1,H.configurable=!0,\"value\"in H&&(H.writable=!0),Object.defineProperty(F,H.key,H)}}f.r(u),f.d(u,\"connectToDevTools\",function(){return Lr});var g=function(){function F(){var fe,ue,de;(function(W,ve){if(!(W instanceof ve))throw new TypeError(\"Cannot call a class as a function\")})(this,F),fe=this,ue=\"listenersMap\",de=new Map,ue in fe?Object.defineProperty(fe,ue,{value:de,enumerable:!0,configurable:!0,writable:!0}):fe[ue]=de}var R,U,H;return R=F,(U=[{key:\"addListener\",value:function(fe,ue){var de=this.listenersMap.get(fe);de===void 0?this.listenersMap.set(fe,[ue]):de.indexOf(ue)<0&&de.push(ue)}},{key:\"emit\",value:function(fe){var ue=this.listenersMap.get(fe);if(ue!==void 0){for(var de=arguments.length,W=new Array(de>1?de-1:0),ve=1;ve<de;ve++)W[ve-1]=arguments[ve];if(ue.length===1){var Fe=ue[0];Fe.apply(null,W)}else{for(var Ge=!1,K=null,xe=Array.from(ue),je=0;je<xe.length;je++){var Xe=xe[je];try{Xe.apply(null,W)}catch(rt){K===null&&(Ge=!0,K=rt)}}if(Ge)throw K}}}},{key:\"removeAllListeners\",value:function(){this.listenersMap.clear()}},{key:\"removeListener\",value:function(fe,ue){var de=this.listenersMap.get(fe);if(de!==void 0){var W=de.indexOf(ue);W>=0&&de.splice(W,1)}}}])&&c(R.prototype,U),H&&c(R,H),F}(),t=f(2),C=f.n(t);try{var A=f(9).default,x=function(F){var R=new RegExp(\"\".concat(F,\": ([0-9]+)\")),U=A.match(R);return parseInt(U[1],10)};x(\"comfortable-line-height-data\"),x(\"compact-line-height-data\")}catch(F){}function D(F){try{return sessionStorage.getItem(F)}catch(R){return null}}function L(F){try{sessionStorage.removeItem(F)}catch(R){}}function N(F,R){try{return sessionStorage.setItem(F,R)}catch(U){}}var j=function(F,R){return F===R},$=f(1),h=f.n($);function re(F){return F.ownerDocument?F.ownerDocument.defaultView:null}function ce(F){var R=re(F);return R?R.frameElement:null}function Q(F){var R=me(F);return oe([F.getBoundingClientRect(),{top:R.borderTop,left:R.borderLeft,bottom:R.borderBottom,right:R.borderRight,width:0,height:0}])}function oe(F){return F.reduce(function(R,U){return R==null?U:{top:R.top+U.top,left:R.left+U.left,width:R.width,height:R.height,bottom:R.bottom+U.bottom,right:R.right+U.right}})}function Se(F,R){var U=ce(F);if(U&&U!==R){for(var H=[F.getBoundingClientRect()],fe=U,ue=!1;fe;){var de=Q(fe);if(H.push(de),fe=ce(fe),ue)break;fe&&re(fe)===R&&(ue=!0)}return oe(H)}return F.getBoundingClientRect()}function me(F){var R=window.getComputedStyle(F);return{borderLeft:parseInt(R.borderLeftWidth,10),borderRight:parseInt(R.borderRightWidth,10),borderTop:parseInt(R.borderTopWidth,10),borderBottom:parseInt(R.borderBottomWidth,10),marginLeft:parseInt(R.marginLeft,10),marginRight:parseInt(R.marginRight,10),marginTop:parseInt(R.marginTop,10),marginBottom:parseInt(R.marginBottom,10),paddingLeft:parseInt(R.paddingLeft,10),paddingRight:parseInt(R.paddingRight,10),paddingTop:parseInt(R.paddingTop,10),paddingBottom:parseInt(R.paddingBottom,10)}}function De(F,R){var U;if(typeof Symbol==\"undefined\"||F[Symbol.iterator]==null){if(Array.isArray(F)||(U=function(ve,Fe){if(!!ve){if(typeof ve==\"string\")return J(ve,Fe);var Ge=Object.prototype.toString.call(ve).slice(8,-1);if(Ge===\"Object\"&&ve.constructor&&(Ge=ve.constructor.name),Ge===\"Map\"||Ge===\"Set\")return Array.from(ve);if(Ge===\"Arguments\"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ge))return J(ve,Fe)}}(F))||R&&F&&typeof F.length==\"number\"){U&&(F=U);var H=0,fe=function(){};return{s:fe,n:function(){return H>=F.length?{done:!0}:{done:!1,value:F[H++]}},e:function(ve){throw ve},f:fe}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ue,de=!0,W=!1;return{s:function(){U=F[Symbol.iterator]()},n:function(){var ve=U.next();return de=ve.done,ve},e:function(ve){W=!0,ue=ve},f:function(){try{de||U.return==null||U.return()}finally{if(W)throw ue}}}}function J(F,R){(R==null||R>F.length)&&(R=F.length);for(var U=0,H=new Array(R);U<R;U++)H[U]=F[U];return H}function Te(F,R){if(!(F instanceof R))throw new TypeError(\"Cannot call a class as a function\")}function Oe(F,R){for(var U=0;U<R.length;U++){var H=R[U];H.enumerable=H.enumerable||!1,H.configurable=!0,\"value\"in H&&(H.writable=!0),Object.defineProperty(F,H.key,H)}}function Le(F,R,U){return R&&Oe(F.prototype,R),U&&Oe(F,U),F}var ot=function(){function F(R,U){Te(this,F),this.node=R.createElement(\"div\"),this.border=R.createElement(\"div\"),this.padding=R.createElement(\"div\"),this.content=R.createElement(\"div\"),this.border.style.borderColor=At.border,this.padding.style.borderColor=At.padding,this.content.style.backgroundColor=At.background,h()(this.node.style,{borderColor:At.margin,pointerEvents:\"none\",position:\"fixed\"}),this.node.style.zIndex=\"10000000\",this.node.appendChild(this.border),this.border.appendChild(this.padding),this.padding.appendChild(this.content),U.appendChild(this.node)}return Le(F,[{key:\"remove\",value:function(){this.node.parentNode&&this.node.parentNode.removeChild(this.node)}},{key:\"update\",value:function(R,U){be(U,\"margin\",this.node),be(U,\"border\",this.border),be(U,\"padding\",this.padding),h()(this.content.style,{height:R.height-U.borderTop-U.borderBottom-U.paddingTop-U.paddingBottom+\"px\",width:R.width-U.borderLeft-U.borderRight-U.paddingLeft-U.paddingRight+\"px\"}),h()(this.node.style,{top:R.top-U.marginTop+\"px\",left:R.left-U.marginLeft+\"px\"})}}]),F}(),ct=function(){function F(R,U){Te(this,F),this.tip=R.createElement(\"div\"),h()(this.tip.style,{display:\"flex\",flexFlow:\"row nowrap\",backgroundColor:\"#333740\",borderRadius:\"2px\",fontFamily:'\"SFMono-Regular\", Consolas, \"Liberation Mono\", Menlo, Courier, monospace',fontWeight:\"bold\",padding:\"3px 5px\",pointerEvents:\"none\",position:\"fixed\",fontSize:\"12px\",whiteSpace:\"nowrap\"}),this.nameSpan=R.createElement(\"span\"),this.tip.appendChild(this.nameSpan),h()(this.nameSpan.style,{color:\"#ee78e6\",borderRight:\"1px solid #aaaaaa\",paddingRight:\"0.5rem\",marginRight:\"0.5rem\"}),this.dimSpan=R.createElement(\"span\"),this.tip.appendChild(this.dimSpan),h()(this.dimSpan.style,{color:\"#d7d7d7\"}),this.tip.style.zIndex=\"10000000\",U.appendChild(this.tip)}return Le(F,[{key:\"remove\",value:function(){this.tip.parentNode&&this.tip.parentNode.removeChild(this.tip)}},{key:\"updateText\",value:function(R,U,H){this.nameSpan.textContent=R,this.dimSpan.textContent=Math.round(U)+\"px \\xD7 \"+Math.round(H)+\"px\"}},{key:\"updatePosition\",value:function(R,U){var H=this.tip.getBoundingClientRect(),fe=function(ue,de,W){var ve,Fe=Math.max(W.height,20),Ge=Math.max(W.width,60);ve=ue.top+ue.height+Fe<=de.top+de.height?ue.top+ue.height<de.top+0?de.top+5:ue.top+ue.height+5:ue.top-Fe<=de.top+de.height?ue.top-Fe-5<de.top+5?de.top+5:ue.top-Fe-5:de.top+de.height-Fe-5;var K=ue.left+5;return ue.left<de.left&&(K=de.left+5),ue.left+Ge>de.left+de.width&&(K=de.left+de.width-Ge-5),{style:{top:ve+=\"px\",left:K+=\"px\"}}}(R,U,{width:H.width,height:H.height});h()(this.tip.style,fe.style)}}]),F}(),Ue=function(){function F(){Te(this,F);var R=window.__REACT_DEVTOOLS_TARGET_WINDOW__||window;this.window=R;var U=window.__REACT_DEVTOOLS_TARGET_WINDOW__||window;this.tipBoundsWindow=U;var H=R.document;this.container=H.createElement(\"div\"),this.container.style.zIndex=\"10000000\",this.tip=new ct(H,this.container),this.rects=[],H.body.appendChild(this.container)}return Le(F,[{key:\"remove\",value:function(){this.tip.remove(),this.rects.forEach(function(R){R.remove()}),this.rects.length=0,this.container.parentNode&&this.container.parentNode.removeChild(this.container)}},{key:\"inspect\",value:function(R,U){for(var H=this,fe=R.filter(function(Xe){return Xe.nodeType===Node.ELEMENT_NODE});this.rects.length>fe.length;)this.rects.pop().remove();if(fe.length!==0){for(;this.rects.length<fe.length;)this.rects.push(new ot(this.window.document,this.container));var ue={top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,left:Number.POSITIVE_INFINITY};if(fe.forEach(function(Xe,rt){var st=Se(Xe,H.window),xt=me(Xe);ue.top=Math.min(ue.top,st.top-xt.marginTop),ue.right=Math.max(ue.right,st.left+st.width+xt.marginRight),ue.bottom=Math.max(ue.bottom,st.top+st.height+xt.marginBottom),ue.left=Math.min(ue.left,st.left-xt.marginLeft),H.rects[rt].update(st,xt)}),!U){U=fe[0].nodeName.toLowerCase();var de=fe[0],W=de.ownerDocument.defaultView.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(W!=null&&W.rendererInterfaces!=null){var ve,Fe=null,Ge=De(W.rendererInterfaces.values());try{for(Ge.s();!(ve=Ge.n()).done;){var K=ve.value,xe=K.getFiberIDForNative(de,!0);if(xe!==null){Fe=K.getDisplayNameForFiberID(xe,!0);break}}}catch(Xe){Ge.e(Xe)}finally{Ge.f()}Fe&&(U+=\" (in \"+Fe+\")\")}}this.tip.updateText(U,ue.right-ue.left,ue.bottom-ue.top);var je=Se(this.tipBoundsWindow.document.documentElement,this.window);this.tip.updatePosition({top:ue.top,left:ue.left,height:ue.bottom-ue.top,width:ue.right-ue.left},{top:je.top+this.tipBoundsWindow.scrollY,left:je.left+this.tipBoundsWindow.scrollX,height:this.tipBoundsWindow.innerHeight,width:this.tipBoundsWindow.innerWidth})}}}]),F}();function be(F,R,U){h()(U.style,{borderTopWidth:F[R+\"Top\"]+\"px\",borderLeftWidth:F[R+\"Left\"]+\"px\",borderRightWidth:F[R+\"Right\"]+\"px\",borderBottomWidth:F[R+\"Bottom\"]+\"px\",borderStyle:\"solid\"})}var At={background:\"rgba(120, 170, 210, 0.7)\",padding:\"rgba(77, 200, 0, 0.3)\",margin:\"rgba(255, 155, 0, 0.3)\",border:\"rgba(255, 200, 50, 0.3)\"},Ot=null,Nt=null;function Je(){Ot=null,Nt!==null&&(Nt.remove(),Nt=null)}function V(F,R,U){window.document!=null&&(Ot!==null&&clearTimeout(Ot),F!=null&&(Nt===null&&(Nt=new Ue),Nt.inspect(F,R),U&&(Ot=setTimeout(Je,2e3))))}var ne=new Set;function ge(F,R){function U(K){K&&typeof K.addEventListener==\"function\"&&(K.addEventListener(\"click\",ue,!0),K.addEventListener(\"mousedown\",de,!0),K.addEventListener(\"mouseover\",de,!0),K.addEventListener(\"mouseup\",de,!0),K.addEventListener(\"pointerdown\",W,!0),K.addEventListener(\"pointerover\",ve,!0),K.addEventListener(\"pointerup\",Fe,!0))}function H(){Je(),fe(window),ne.forEach(function(K){try{fe(K.contentWindow)}catch(xe){}}),ne=new Set}function fe(K){K&&typeof K.removeEventListener==\"function\"&&(K.removeEventListener(\"click\",ue,!0),K.removeEventListener(\"mousedown\",de,!0),K.removeEventListener(\"mouseover\",de,!0),K.removeEventListener(\"mouseup\",de,!0),K.removeEventListener(\"pointerdown\",W,!0),K.removeEventListener(\"pointerover\",ve,!0),K.removeEventListener(\"pointerup\",Fe,!0))}function ue(K){K.preventDefault(),K.stopPropagation(),H(),F.send(\"stopInspectingNative\",!0)}function de(K){K.preventDefault(),K.stopPropagation()}function W(K){K.preventDefault(),K.stopPropagation(),Ge(K.target)}function ve(K){K.preventDefault(),K.stopPropagation();var xe=K.target;if(xe.tagName===\"IFRAME\"){var je=xe;try{ne.has(je)||(U(je.contentWindow),ne.add(je))}catch(Xe){}}V([xe],null,!1),Ge(xe)}function Fe(K){K.preventDefault(),K.stopPropagation()}F.addListener(\"clearNativeElementHighlight\",function(){Je()}),F.addListener(\"highlightNativeElement\",function(K){var xe=K.displayName,je=K.hideAfterTimeout,Xe=K.id,rt=K.openNativeElementsPanel,st=K.rendererID,xt=K.scrollIntoView,wt=R.rendererInterfaces[st];wt==null&&console.warn('Invalid renderer id \"'.concat(st,'\" for element \"').concat(Xe,'\"'));var lt=null;if(wt!=null&&(lt=wt.findNativeNodesForFiberID(Xe)),lt!=null&&lt[0]!=null){var Rt=lt[0];xt&&typeof Rt.scrollIntoView==\"function\"&&Rt.scrollIntoView({block:\"nearest\",inline:\"nearest\"}),V(lt,xe,je),rt&&(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0=Rt,F.send(\"syncSelectionToNativeElementsPanel\"))}else Je()}),F.addListener(\"shutdown\",H),F.addListener(\"startInspectingNative\",function(){U(window)}),F.addListener(\"stopInspectingNative\",H);var Ge=C()(function(K){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:j,je=void 0,Xe=[],rt=void 0,st=!1,xt=function(lt,Rt){return xe(lt,Xe[Rt])},wt=function(){for(var lt=arguments.length,Rt=Array(lt),yn=0;yn<lt;yn++)Rt[yn]=arguments[yn];return st&&je===this&&Rt.length===Xe.length&&Rt.every(xt)?rt:(st=!0,je=this,Xe=Rt,rt=K.apply(this,Rt))};return wt}(function(K){var xe=R.getIDForNode(K);xe!==null&&F.send(\"selectFiber\",xe)}),200,{leading:!1})}var Z=[\"#37afa9\",\"#63b19e\",\"#80b393\",\"#97b488\",\"#abb67d\",\"#beb771\",\"#cfb965\",\"#dfba57\",\"#efbb49\",\"#febc38\"],Ae=null;function at(F){Ae===null&&function(){(Ae=window.document.createElement(\"canvas\")).style.cssText=`\n    xx-background-color: red;\n    xx-opacity: 0.5;\n    bottom: 0;\n    left: 0;\n    pointer-events: none;\n    position: fixed;\n    right: 0;\n    top: 0;\n    z-index: 1000000000;\n  `;var H=window.document.documentElement;H.insertBefore(Ae,H.firstChild)}();var R=Ae;R.width=window.innerWidth,R.height=window.innerHeight;var U=R.getContext(\"2d\");U.clearRect(0,0,R.width,R.height),F.forEach(function(H){var fe=H.count,ue=H.rect;if(ue!==null){var de=Math.min(Z.length-1,fe-1);(function(W,ve,Fe){var Ge=ve.height,K=ve.left,xe=ve.top,je=ve.width;W.lineWidth=1,W.strokeStyle=\"#f0f0f0\",W.strokeRect(K-1,xe-1,je+2,Ge+2),W.lineWidth=1,W.strokeStyle=\"#f0f0f0\",W.strokeRect(K+1,xe+1,je-1,Ge-1),W.strokeStyle=Fe,W.setLineDash([0]),W.lineWidth=1,W.strokeRect(K,xe,je-1,Ge-1),W.setLineDash([0])})(U,ue,Z[de])}})}function it(F){return(it=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(R){return typeof R}:function(R){return R&&typeof Symbol==\"function\"&&R.constructor===Symbol&&R!==Symbol.prototype?\"symbol\":typeof R})(F)}var Ft=(typeof performance==\"undefined\"?\"undefined\":it(performance))===\"object\"&&typeof performance.now==\"function\"?function(){return performance.now()}:function(){return Date.now()},jt=new Map,hn=null,Un=!1,Jt=null;function Yt(F){(Un=F)||(jt.clear(),hn!==null&&(cancelAnimationFrame(hn),hn=null),Jt!==null&&(clearTimeout(Jt),Jt=null),Ae!==null&&(Ae.parentNode!=null&&Ae.parentNode.removeChild(Ae),Ae=null))}function cr(F){Un&&(F.forEach(function(R){var U=jt.get(R),H=Ft(),fe=U!=null?U.lastMeasuredAt:0,ue=U!=null?U.rect:null;(ue===null||fe+250<H)&&(fe=H,ue=function(de){if(!de||typeof de.getBoundingClientRect!=\"function\")return null;var W=window.__REACT_DEVTOOLS_TARGET_WINDOW__||window;return Se(de,W)}(R)),jt.set(R,{count:U!=null?U.count+1:1,expirationTime:U!=null?Math.min(H+3e3,U.expirationTime+250):H+250,lastMeasuredAt:fe,rect:ue})}),Jt!==null&&(clearTimeout(Jt),Jt=null),hn===null&&(hn=requestAnimationFrame(w)))}function w(){hn=null,Jt=null;var F=Ft(),R=Number.MAX_VALUE;jt.forEach(function(U,H){U.expirationTime<F?jt.delete(H):R=Math.min(R,U.expirationTime)}),at(jt),R!==Number.MAX_VALUE&&(Jt=setTimeout(w,R-F))}var pt=f(3),Mn=f(6),Bn=f.n(Mn),Xn=f(0),vr=60120;if(typeof Symbol==\"function\"&&Symbol.for){var gr=Symbol.for;gr(\"react.element\"),gr(\"react.portal\"),gr(\"react.fragment\"),gr(\"react.strict_mode\"),gr(\"react.profiler\"),gr(\"react.provider\"),gr(\"react.context\"),gr(\"react.forward_ref\"),gr(\"react.suspense\"),vr=gr(\"react.suspense_list\"),gr(\"react.memo\"),gr(\"react.lazy\"),gr(\"react.block\"),gr(\"react.server.block\"),gr(\"react.fundamental\"),gr(\"react.scope\"),gr(\"react.opaque.id\"),gr(\"react.debug_trace_mode\"),gr(\"react.offscreen\"),gr(\"react.legacy_hidden\")}typeof Symbol==\"function\"&&Symbol.iterator;function r0(F){return(r0=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(R){return typeof R}:function(R){return R&&typeof Symbol==\"function\"&&R.constructor===Symbol&&R!==Symbol.prototype?\"symbol\":typeof R})(F)}var Ci={inspectable:Symbol(\"inspectable\"),inspected:Symbol(\"inspected\"),name:Symbol(\"name\"),preview_long:Symbol(\"preview_long\"),preview_short:Symbol(\"preview_short\"),readonly:Symbol(\"readonly\"),size:Symbol(\"size\"),type:Symbol(\"type\"),unserializable:Symbol(\"unserializable\")};function yo(F,R,U,H,fe){H.push(fe);var ue={inspectable:R,type:F,preview_long:Mr(U,!0),preview_short:Mr(U,!1),name:U.constructor&&U.constructor.name!==\"Object\"?U.constructor.name:\"\"};return F===\"array\"||F===\"typed_array\"?ue.size=U.length:F===\"object\"&&(ue.size=Object.keys(U).length),F!==\"iterator\"&&F!==\"typed_array\"||(ue.readonly=!0),ue}function Ds(F,R,U,H,fe){var ue,de=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,W=cl(F);switch(W){case\"html_element\":return R.push(H),{inspectable:!1,preview_short:Mr(F,!1),preview_long:Mr(F,!0),name:F.tagName,type:W};case\"function\":return R.push(H),{inspectable:!1,preview_short:Mr(F,!1),preview_long:Mr(F,!0),name:typeof F.name!=\"function\"&&F.name?F.name:\"function\",type:W};case\"string\":return F.length<=500?F:F.slice(0,500)+\"...\";case\"bigint\":case\"symbol\":return R.push(H),{inspectable:!1,preview_short:Mr(F,!1),preview_long:Mr(F,!0),name:F.toString(),type:W};case\"react_element\":return R.push(H),{inspectable:!1,preview_short:Mr(F,!1),preview_long:Mr(F,!0),name:al(F)||\"Unknown\",type:W};case\"array_buffer\":case\"data_view\":return R.push(H),{inspectable:!1,preview_short:Mr(F,!1),preview_long:Mr(F,!0),name:W===\"data_view\"?\"DataView\":\"ArrayBuffer\",size:F.byteLength,type:W};case\"array\":return ue=fe(H),de>=2&&!ue?yo(W,!0,F,R,H):F.map(function(Ge,K){return Ds(Ge,R,U,H.concat([K]),fe,ue?1:de+1)});case\"html_all_collection\":case\"typed_array\":case\"iterator\":if(ue=fe(H),de>=2&&!ue)return yo(W,!0,F,R,H);var ve={unserializable:!0,type:W,readonly:!0,size:W===\"typed_array\"?F.length:void 0,preview_short:Mr(F,!1),preview_long:Mr(F,!0),name:F.constructor&&F.constructor.name!==\"Object\"?F.constructor.name:\"\"};return r0(F[Symbol.iterator])&&Array.from(F).forEach(function(Ge,K){return ve[K]=Ds(Ge,R,U,H.concat([K]),fe,ue?1:de+1)}),U.push(H),ve;case\"opaque_iterator\":return R.push(H),{inspectable:!1,preview_short:Mr(F,!1),preview_long:Mr(F,!0),name:F[Symbol.toStringTag],type:W};case\"date\":case\"regexp\":return R.push(H),{inspectable:!1,preview_short:Mr(F,!1),preview_long:Mr(F,!0),name:F.toString(),type:W};case\"object\":if(ue=fe(H),de>=2&&!ue)return yo(W,!0,F,R,H);var Fe={};return Es(F).forEach(function(Ge){var K=Ge.toString();Fe[K]=Ds(F[Ge],R,U,H.concat([K]),fe,ue?1:de+1)}),Fe;case\"infinity\":case\"nan\":case\"undefined\":return R.push(H),{type:W};default:return F}}function Mu(F){return(Mu=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(R){return typeof R}:function(R){return R&&typeof Symbol==\"function\"&&R.constructor===Symbol&&R!==Symbol.prototype?\"symbol\":typeof R})(F)}function Gf(F){return function(R){if(Array.isArray(R))return iu(R)}(F)||function(R){if(typeof Symbol!=\"undefined\"&&Symbol.iterator in Object(R))return Array.from(R)}(F)||function(R,U){if(!!R){if(typeof R==\"string\")return iu(R,U);var H=Object.prototype.toString.call(R).slice(8,-1);if(H===\"Object\"&&R.constructor&&(H=R.constructor.name),H===\"Map\"||H===\"Set\")return Array.from(R);if(H===\"Arguments\"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(H))return iu(R,U)}}(F)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function iu(F,R){(R==null||R>F.length)&&(R=F.length);for(var U=0,H=new Array(R);U<R;U++)H[U]=F[U];return H}var ou=new WeakMap,ol=new Bn.a({max:1e3});function ul(F,R){return F.toString()>R.toString()?1:R.toString()>F.toString()?-1:0}function Es(F){for(var R=[],U=F,H=function(){var fe=[].concat(Gf(Object.keys(U)),Gf(Object.getOwnPropertySymbols(U))),ue=Object.getOwnPropertyDescriptors(U);fe.forEach(function(de){ue[de].enumerable&&R.push(de)}),U=Object.getPrototypeOf(U)};U!=null;)H();return R}function Uo(F){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:\"Anonymous\",U=ou.get(F);if(U!=null)return U;var H=R;return typeof F.displayName==\"string\"?H=F.displayName:typeof F.name==\"string\"&&F.name!==\"\"&&(H=F.name),ou.set(F,H),H}var sl=0;function Ss(){return++sl}function Cs(F){var R=ol.get(F);if(R!==void 0)return R;for(var U=new Array(F.length),H=0;H<F.length;H++)U[H]=F.codePointAt(H);return ol.set(F,U),U}function Ti(F,R){return R.reduce(function(U,H){if(U){if(hasOwnProperty.call(U,H))return U[H];if(typeof U[Symbol.iterator]==\"function\")return Array.from(U)[H]}return null},F)}function Fu(F,R){var U=R.length,H=R[U-1];if(F!=null){var fe=Ti(F,R.slice(0,U-1));fe&&(Array.isArray(fe)?fe.splice(H,1):delete fe[H])}}function ll(F,R,U){var H=R.length;if(F!=null){var fe=Ti(F,R.slice(0,H-1));if(fe){var ue=R[H-1];fe[U[H-1]]=fe[ue],Array.isArray(fe)?fe.splice(ue,1):delete fe[ue]}}}function fl(F,R,U){var H=R.length,fe=R[H-1];if(F!=null){var ue=Ti(F,R.slice(0,H-1));ue&&(ue[fe]=U)}}function cl(F){if(F===null)return\"null\";if(F===void 0)return\"undefined\";if(Object(Xn.isElement)(F))return\"react_element\";if(typeof HTMLElement!=\"undefined\"&&F instanceof HTMLElement)return\"html_element\";switch(Mu(F)){case\"bigint\":return\"bigint\";case\"boolean\":return\"boolean\";case\"function\":return\"function\";case\"number\":return Number.isNaN(F)?\"nan\":Number.isFinite(F)?\"number\":\"infinity\";case\"object\":if(Array.isArray(F))return\"array\";if(ArrayBuffer.isView(F))return hasOwnProperty.call(F.constructor,\"BYTES_PER_ELEMENT\")?\"typed_array\":\"data_view\";if(F.constructor&&F.constructor.name===\"ArrayBuffer\")return\"array_buffer\";if(typeof F[Symbol.iterator]==\"function\")return F[Symbol.iterator]()===F?\"opaque_iterator\":\"iterator\";if(F.constructor&&F.constructor.name===\"RegExp\")return\"regexp\";var R=Object.prototype.toString.call(F);return R===\"[object Date]\"?\"date\":R===\"[object HTMLAllCollection]\"?\"html_all_collection\":\"object\";case\"string\":return\"string\";case\"symbol\":return\"symbol\";case\"undefined\":return Object.prototype.toString.call(F)===\"[object HTMLAllCollection]\"?\"html_all_collection\":\"undefined\";default:return\"unknown\"}}function al(F){switch(Object(Xn.typeOf)(F)){case Xn.ContextConsumer:return\"ContextConsumer\";case Xn.ContextProvider:return\"ContextProvider\";case Xn.ForwardRef:return\"ForwardRef\";case Xn.Fragment:return\"Fragment\";case Xn.Lazy:return\"Lazy\";case Xn.Memo:return\"Memo\";case Xn.Portal:return\"Portal\";case Xn.Profiler:return\"Profiler\";case Xn.StrictMode:return\"StrictMode\";case Xn.Suspense:return\"Suspense\";case vr:return\"SuspenseList\";default:var R=F.type;return typeof R==\"string\"?R:typeof R==\"function\"?Uo(R,\"Anonymous\"):R!=null?\"NotImplementedInDevtools\":\"Element\"}}function Ui(F){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:50;return F.length>R?F.substr(0,R)+\"\\u2026\":F}function Mr(F,R){if(F!=null&&hasOwnProperty.call(F,Ci.type))return R?F[Ci.preview_long]:F[Ci.preview_short];switch(cl(F)){case\"html_element\":return\"<\".concat(Ui(F.tagName.toLowerCase()),\" />\");case\"function\":return Ui(\"\\u0192 \".concat(typeof F.name==\"function\"?\"\":F.name,\"() {}\"));case\"string\":return'\"'.concat(F,'\"');case\"bigint\":return Ui(F.toString()+\"n\");case\"regexp\":case\"symbol\":return Ui(F.toString());case\"react_element\":return\"<\".concat(Ui(al(F)||\"Unknown\"),\" />\");case\"array_buffer\":return\"ArrayBuffer(\".concat(F.byteLength,\")\");case\"data_view\":return\"DataView(\".concat(F.buffer.byteLength,\")\");case\"array\":if(R){for(var U=\"\",H=0;H<F.length&&(H>0&&(U+=\", \"),!((U+=Mr(F[H],!1)).length>50));H++);return\"[\".concat(Ui(U),\"]\")}var fe=hasOwnProperty.call(F,Ci.size)?F[Ci.size]:F.length;return\"Array(\".concat(fe,\")\");case\"typed_array\":var ue=\"\".concat(F.constructor.name,\"(\").concat(F.length,\")\");if(R){for(var de=\"\",W=0;W<F.length&&(W>0&&(de+=\", \"),!((de+=F[W]).length>50));W++);return\"\".concat(ue,\" [\").concat(Ui(de),\"]\")}return ue;case\"iterator\":var ve=F.constructor.name;if(R){for(var Fe=Array.from(F),Ge=\"\",K=0;K<Fe.length;K++){var xe=Fe[K];if(K>0&&(Ge+=\", \"),Array.isArray(xe)){var je=Mr(xe[0],!0),Xe=Mr(xe[1],!1);Ge+=\"\".concat(je,\" => \").concat(Xe)}else Ge+=Mr(xe,!1);if(Ge.length>50)break}return\"\".concat(ve,\"(\").concat(F.size,\") {\").concat(Ui(Ge),\"}\")}return\"\".concat(ve,\"(\").concat(F.size,\")\");case\"opaque_iterator\":return F[Symbol.toStringTag];case\"date\":return F.toString();case\"object\":if(R){for(var rt=Es(F).sort(ul),st=\"\",xt=0;xt<rt.length;xt++){var wt=rt[xt];if(xt>0&&(st+=\", \"),(st+=\"\".concat(wt.toString(),\": \").concat(Mr(F[wt],!1))).length>50)break}return\"{\".concat(Ui(st),\"}\")}return\"{\\u2026}\";case\"boolean\":case\"number\":case\"infinity\":case\"nan\":case\"null\":case\"undefined\":return F;default:try{return Ui(\"\"+F)}catch(lt){return\"unserializable\"}}}var Ac=f(7);function of(F){return(of=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(R){return typeof R}:function(R){return R&&typeof Symbol==\"function\"&&R.constructor===Symbol&&R!==Symbol.prototype?\"symbol\":typeof R})(F)}function Ts(F,R){var U=Object.keys(F);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(F);R&&(H=H.filter(function(fe){return Object.getOwnPropertyDescriptor(F,fe).enumerable})),U.push.apply(U,H)}return U}function xs(F){for(var R=1;R<arguments.length;R++){var U=arguments[R]!=null?arguments[R]:{};R%2?Ts(Object(U),!0).forEach(function(H){dl(F,H,U[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(F,Object.getOwnPropertyDescriptors(U)):Ts(Object(U)).forEach(function(H){Object.defineProperty(F,H,Object.getOwnPropertyDescriptor(U,H))})}return F}function dl(F,R,U){return R in F?Object.defineProperty(F,R,{value:U,enumerable:!0,configurable:!0,writable:!0}):F[R]=U,F}function qi(F,R){var U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(F!==null){var H=[],fe=[],ue=Ds(F,H,fe,U,R);return{data:ue,cleaned:H,unserializable:fe}}return null}function qo(F){var R,U,H=(R=F,U=new Set,JSON.stringify(R,function(de,W){if(of(W)===\"object\"&&W!==null){if(U.has(W))return;U.add(W)}return typeof W==\"bigint\"?W.toString()+\"n\":W})),fe=H===void 0?\"undefined\":H,ue=window.__REACT_DEVTOOLS_GLOBAL_HOOK__.clipboardCopyText;typeof ue==\"function\"?ue(fe).catch(function(de){}):Object(Ac.copy)(fe)}function kr(F,R){var U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,H=R[U],fe=Array.isArray(F)?F.slice():xs({},F);return U+1===R.length?Array.isArray(fe)?fe.splice(H,1):delete fe[H]:fe[H]=kr(F[H],R,U+1),fe}function Fr(F,R,U){var H=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,fe=R[H],ue=Array.isArray(F)?F.slice():xs({},F);if(H+1===R.length){var de=U[H];ue[de]=ue[fe],Array.isArray(ue)?ue.splice(fe,1):delete ue[fe]}else ue[fe]=Fr(F[fe],R,U,H+1);return ue}function si(F,R,U){var H=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(H>=R.length)return U;var fe=R[H],ue=Array.isArray(F)?F.slice():xs({},F);return ue[fe]=si(F[fe],R,U,H+1),ue}var H0=f(8);function b0(F,R){var U=Object.keys(F);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(F);R&&(H=H.filter(function(fe){return Object.getOwnPropertyDescriptor(F,fe).enumerable})),U.push.apply(U,H)}return U}function Bt(F){for(var R=1;R<arguments.length;R++){var U=arguments[R]!=null?arguments[R]:{};R%2?b0(Object(U),!0).forEach(function(H){Lu(F,H,U[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(F,Object.getOwnPropertyDescriptors(U)):b0(Object(U)).forEach(function(H){Object.defineProperty(F,H,Object.getOwnPropertyDescriptor(U,H))})}return F}function Lu(F,R,U){return R in F?Object.defineProperty(F,R,{value:U,enumerable:!0,configurable:!0,writable:!0}):F[R]=U,F}function c0(F){return function(R){if(Array.isArray(R))return uu(R)}(F)||function(R){if(typeof Symbol!=\"undefined\"&&Symbol.iterator in Object(R))return Array.from(R)}(F)||As(F)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ru(F,R){return function(U){if(Array.isArray(U))return U}(F)||function(U,H){if(!(typeof Symbol==\"undefined\"||!(Symbol.iterator in Object(U)))){var fe=[],ue=!0,de=!1,W=void 0;try{for(var ve,Fe=U[Symbol.iterator]();!(ue=(ve=Fe.next()).done)&&(fe.push(ve.value),!H||fe.length!==H);ue=!0);}catch(Ge){de=!0,W=Ge}finally{try{ue||Fe.return==null||Fe.return()}finally{if(de)throw W}}return fe}}(F,R)||As(F,R)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ks(F,R){var U;if(typeof Symbol==\"undefined\"||F[Symbol.iterator]==null){if(Array.isArray(F)||(U=As(F))||R&&F&&typeof F.length==\"number\"){U&&(F=U);var H=0,fe=function(){};return{s:fe,n:function(){return H>=F.length?{done:!0}:{done:!1,value:F[H++]}},e:function(ve){throw ve},f:fe}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ue,de=!0,W=!1;return{s:function(){U=F[Symbol.iterator]()},n:function(){var ve=U.next();return de=ve.done,ve},e:function(ve){W=!0,ue=ve},f:function(){try{de||U.return==null||U.return()}finally{if(W)throw ue}}}}function As(F,R){if(F){if(typeof F==\"string\")return uu(F,R);var U=Object.prototype.toString.call(F).slice(8,-1);return U===\"Object\"&&F.constructor&&(U=F.constructor.name),U===\"Map\"||U===\"Set\"?Array.from(F):U===\"Arguments\"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U)?uu(F,R):void 0}}function uu(F,R){(R==null||R>F.length)&&(R=F.length);for(var U=0,H=new Array(R);U<R;U++)H[U]=F[U];return H}function wo(F){return(wo=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(R){return typeof R}:function(R){return R&&typeof Symbol==\"function\"&&R.constructor===Symbol&&R!==Symbol.prototype?\"symbol\":typeof R})(F)}function zo(F){return F.flags!==void 0?F.flags:F.effectTag}var Os=(typeof performance==\"undefined\"?\"undefined\":wo(performance))===\"object\"&&typeof performance.now==\"function\"?function(){return performance.now()}:function(){return Date.now()};function Is(F){var R=null;function U(wt){var lt=wo(wt)===\"object\"&&wt!==null?wt.$$typeof:wt;return wo(lt)===\"symbol\"?lt.toString():lt}var H=R=Object(pt.gte)(F,\"17.0.0-alpha\")?{Block:22,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostPortal:4,HostRoot:3,HostText:6,IncompleteClassComponent:17,IndeterminateComponent:2,LazyComponent:16,MemoComponent:14,Mode:8,OffscreenComponent:23,Profiler:12,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,YieldComponent:-1}:Object(pt.gte)(F,\"16.6.0-beta.0\")?{Block:22,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostPortal:4,HostRoot:3,HostText:6,IncompleteClassComponent:17,IndeterminateComponent:2,LazyComponent:16,MemoComponent:14,Mode:8,OffscreenComponent:-1,Profiler:12,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,YieldComponent:-1}:Object(pt.gte)(F,\"16.4.3-alpha\")?{Block:-1,ClassComponent:2,ContextConsumer:11,ContextProvider:12,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:-1,ForwardRef:13,Fragment:9,FunctionComponent:0,HostComponent:7,HostPortal:6,HostRoot:5,HostText:8,IncompleteClassComponent:-1,IndeterminateComponent:4,LazyComponent:-1,MemoComponent:-1,Mode:10,OffscreenComponent:-1,Profiler:15,SimpleMemoComponent:-1,SuspenseComponent:16,SuspenseListComponent:-1,YieldComponent:-1}:{Block:-1,ClassComponent:2,ContextConsumer:12,ContextProvider:13,CoroutineComponent:7,CoroutineHandlerPhase:8,DehydratedSuspenseComponent:-1,ForwardRef:14,Fragment:10,FunctionComponent:1,HostComponent:5,HostPortal:4,HostRoot:3,HostText:6,IncompleteClassComponent:-1,IndeterminateComponent:0,LazyComponent:-1,MemoComponent:-1,Mode:11,OffscreenComponent:-1,Profiler:15,SimpleMemoComponent:-1,SuspenseComponent:16,SuspenseListComponent:-1,YieldComponent:9},fe=H.ClassComponent,ue=H.IncompleteClassComponent,de=H.FunctionComponent,W=H.IndeterminateComponent,ve=H.ForwardRef,Fe=H.HostRoot,Ge=H.HostComponent,K=H.HostPortal,xe=H.HostText,je=H.Fragment,Xe=H.MemoComponent,rt=H.SimpleMemoComponent,st=H.SuspenseComponent,xt=H.SuspenseListComponent;return{getDisplayNameForFiber:function(wt){var lt=wt.type,Rt=wt.tag,yn=lt;wo(lt)===\"object\"&&lt!==null&&(yn=function ar(rn){switch(U(rn)){case 60115:case\"Symbol(react.memo)\":return ar(rn.type);case 60112:case\"Symbol(react.forward_ref)\":return rn.render;default:return rn}}(lt));var sn=null;switch(Rt){case fe:case ue:return Uo(yn);case de:case W:return Uo(yn);case ve:return lt&&lt.displayName||Uo(yn,\"Anonymous\");case Fe:return null;case Ge:return lt;case K:case xe:case je:return null;case Xe:case rt:return Uo(yn,\"Anonymous\");case st:return\"Suspense\";case xt:return\"SuspenseList\";default:switch(U(lt)){case 60111:case\"Symbol(react.concurrent_mode)\":case\"Symbol(react.async_mode)\":return null;case 60109:case\"Symbol(react.provider)\":return sn=wt.type._context||wt.type.context,\"\".concat(sn.displayName||\"Context\",\".Provider\");case 60110:case\"Symbol(react.context)\":return sn=wt.type._context||wt.type,\"\".concat(sn.displayName||\"Context\",\".Consumer\");case 60108:case\"Symbol(react.strict_mode)\":return null;case 60114:case\"Symbol(react.profiler)\":return\"Profiler(\".concat(wt.memoizedProps.id,\")\");case 60119:case\"Symbol(react.scope)\":return\"Scope\";default:return null}}},getTypeSymbol:U,ReactPriorityLevels:{ImmediatePriority:99,UserBlockingPriority:98,NormalPriority:97,LowPriority:96,IdlePriority:95,NoPriority:90},ReactTypeOfWork:R,ReactTypeOfSideEffect:{NoFlags:0,PerformedWork:1,Placement:2}}}function uf(F,R,U,H){var fe=Is(U.version),ue=fe.getDisplayNameForFiber,de=fe.getTypeSymbol,W=fe.ReactPriorityLevels,ve=fe.ReactTypeOfWork,Fe=fe.ReactTypeOfSideEffect,Ge=Fe.NoFlags,K=Fe.PerformedWork,xe=Fe.Placement,je=ve.FunctionComponent,Xe=ve.ClassComponent,rt=ve.ContextConsumer,st=ve.DehydratedSuspenseComponent,xt=ve.Fragment,wt=ve.ForwardRef,lt=ve.HostRoot,Rt=ve.HostPortal,yn=ve.HostComponent,sn=ve.HostText,ar=ve.IncompleteClassComponent,rn=ve.IndeterminateComponent,Hn=ve.MemoComponent,d0=ve.OffscreenComponent,Cr=ve.SimpleMemoComponent,He=ve.SuspenseComponent,Qe=ve.SuspenseListComponent,Ne=W.ImmediatePriority,ft=W.UserBlockingPriority,St=W.NormalPriority,Qt=W.LowPriority,Cn=W.IdlePriority,bn=W.NoPriority,p0=U.overrideHookState,h0=U.overrideHookStateDeletePath,ci=U.overrideHookStateRenamePath,xi=U.overrideProps,E0=U.overridePropsDeletePath,qr=U.overridePropsRenamePath,Eo=U.setSuspenseHandler,So=U.scheduleUpdate,wl=typeof Eo==\"function\"&&typeof So==\"function\";zi(U);var js=window.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__!==!1,Dl=window.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__===!0;(js||Dl)&&Ho({appendComponentStack:js,breakOnConsoleErrors:Dl});var du=new Set,Yu=new Set,Us=new Set,oo=!1,Hi=new Set;function qs(X){Us.clear(),du.clear(),Yu.clear(),X.forEach(function(Y){if(Y.isEnabled)switch(Y.type){case 2:Y.isValid&&Y.value!==\"\"&&du.add(new RegExp(Y.value,\"i\"));break;case 1:Us.add(Y.value);break;case 3:Y.isValid&&Y.value!==\"\"&&Yu.add(new RegExp(Y.value,\"i\"));break;case 4:du.add(new RegExp(\"\\\\(\"));break;default:console.warn('Invalid component filter type \"'.concat(Y.type,'\"'))}})}function F0(X){var Y=X._debugSource,ye=X.tag,he=X.type;switch(ye){case st:return!0;case Rt:case sn:case xt:case d0:return!0;case lt:return!1;default:switch(de(he)){case 60111:case\"Symbol(react.concurrent_mode)\":case\"Symbol(react.async_mode)\":case 60108:case\"Symbol(react.strict_mode)\":return!0}}var We=Gr(X);if(Us.has(We))return!0;if(du.size>0){var et=ue(X);if(et!=null){var Dt,bt=ks(du);try{for(bt.s();!(Dt=bt.n()).done;)if(Dt.value.test(et))return!0}catch(fn){bt.e(fn)}finally{bt.f()}}}if(Y!=null&&Yu.size>0){var Zt,qt=Y.fileName,Ut=ks(Yu);try{for(Ut.s();!(Zt=Ut.n()).done;)if(Zt.value.test(qt))return!0}catch(fn){Ut.e(fn)}finally{Ut.f()}}return!1}function Gr(X){var Y=X.type;switch(X.tag){case Xe:case ar:return 1;case je:case rn:return 5;case wt:return 6;case lt:return 11;case yn:return 7;case Rt:case sn:case xt:return 9;case Hn:case Cr:return 8;case He:return 12;case Qe:return 13;default:switch(de(Y)){case 60111:case\"Symbol(react.concurrent_mode)\":case\"Symbol(react.async_mode)\":return 9;case 60109:case\"Symbol(react.provider)\":return 2;case 60110:case\"Symbol(react.context)\":return 2;case 60108:case\"Symbol(react.strict_mode)\":return 9;case 60114:case\"Symbol(react.profiler)\":return 10;default:return 9}}}function ir(X){if(Co.has(X))return X;var Y=X.alternate;return Y!=null&&Co.has(Y)?Y:(Co.add(X),X)}window.__REACT_DEVTOOLS_COMPONENT_FILTERS__!=null?qs(window.__REACT_DEVTOOLS_COMPONENT_FILTERS__):qs([{type:1,value:7,isEnabled:!0}]);var L0=new Map,Y0=new Map,Co=new Set,$u=new Map,Vo=new Map,Rr=-1;function Jn(X){if(!L0.has(X)){var Y=Ss();L0.set(X,Y),Y0.set(Y,X)}return L0.get(X)}function ai(X){switch(Gr(X)){case 1:if(N0!==null){var Y=Jn(ir(X)),ye=Vr(X);ye!==null&&N0.set(Y,ye)}}}var o0={};function Vr(X){switch(Gr(X)){case 1:var Y=X.stateNode,ye=o0,he=o0;return Y!=null&&(Y.constructor&&Y.constructor.contextType!=null?he=Y.context:(ye=Y.context)&&Object.keys(ye).length===0&&(ye=o0)),[ye,he];default:return null}}function ff(X){switch(Gr(X)){case 1:if(N0!==null){var Y=Jn(ir(X)),ye=N0.has(Y)?N0.get(Y):null,he=Vr(X);if(ye==null||he==null)return null;var We=Ru(ye,2),et=We[0],Dt=We[1],bt=Ru(he,2),Zt=bt[0],qt=bt[1];if(Zt!==o0)return $0(et,Zt);if(qt!==o0)return Dt!==qt}}return null}function cf(X,Y){if(X==null||Y==null)return!1;if(Y.hasOwnProperty(\"baseState\")&&Y.hasOwnProperty(\"memoizedState\")&&Y.hasOwnProperty(\"next\")&&Y.hasOwnProperty(\"queue\"))for(;Y!==null;){if(Y.memoizedState!==X.memoizedState)return!0;Y=Y.next,X=X.next}return!1}function $0(X,Y){if(X==null||Y==null||Y.hasOwnProperty(\"baseState\")&&Y.hasOwnProperty(\"memoizedState\")&&Y.hasOwnProperty(\"next\")&&Y.hasOwnProperty(\"queue\"))return null;var ye,he=[],We=ks(new Set([].concat(c0(Object.keys(X)),c0(Object.keys(Y)))));try{for(We.s();!(ye=We.n()).done;){var et=ye.value;X[et]!==Y[et]&&he.push(et)}}catch(Dt){We.e(Dt)}finally{We.f()}return he}function K0(X,Y){switch(Y.tag){case Xe:case je:case rt:case Hn:case Cr:return(zo(Y)&K)===K;default:return X.memoizedProps!==Y.memoizedProps||X.memoizedState!==Y.memoizedState||X.ref!==Y.ref}}var ae=[],Be=[],Ie=[],ht=[],mt=new Map,wn=0,Gn=null;function $t(X){ae.push(X)}function X0(X){if(ae.length!==0||Be.length!==0||Ie.length!==0||Gn!==null||u0){var Y=Be.length+Ie.length+(Gn===null?0:1),ye=new Array(3+wn+(Y>0?2+Y:0)+ae.length),he=0;if(ye[he++]=R,ye[he++]=Rr,ye[he++]=wn,mt.forEach(function(bt,Zt){ye[he++]=Zt.length;for(var qt=Cs(Zt),Ut=0;Ut<qt.length;Ut++)ye[he+Ut]=qt[Ut];he+=Zt.length}),Y>0){ye[he++]=2,ye[he++]=Y;for(var We=Be.length-1;We>=0;We--)ye[he++]=Be[We];for(var et=0;et<Ie.length;et++)ye[he+et]=Ie[et];he+=Ie.length,Gn!==null&&(ye[he]=Gn,he++)}for(var Dt=0;Dt<ae.length;Dt++)ye[he+Dt]=ae[Dt];he+=ae.length,ht!==null?ht.push(ye):F.emit(\"operations\",ye),ae.length=0,Be.length=0,Ie.length=0,Gn=null,mt.clear(),wn=0}}function ki(X){if(X===null)return 0;var Y=mt.get(X);if(Y!==void 0)return Y;var ye=mt.size+1;return mt.set(X,ye),wn+=X.length+1,ye}function Yr(X,Y){pi!==null&&(X!==pi&&X!==pi.alternate||lo(null));var ye=X.tag===lt,he=ir(X);if(L0.has(he)){var We=Jn(he);ye?Gn=We:F0(X)||(Y?Ie.push(We):Be.push(We)),L0.delete(he),Y0.delete(We),Co.delete(he),X.hasOwnProperty(\"treeBaseDuration\")&&(Vo.delete(We),$u.delete(We))}else Co.delete(he)}function $r(X,Y,ye,he){var We=function(Ut){if(Fn===null||!zr)return!1;var fn=Ut.return,_t=fn!==null?fn.alternate:null;if(pi===fn||pi===_t&&_t!==null){var _r=Ai(Ut),Wr=Fn[Br+1];if(Wr===void 0)throw new Error(\"Expected to see a frame at the next depth.\");if(_r.index===Wr.index&&_r.key===Wr.key&&_r.displayName===Wr.displayName)return pi=Ut,Br++,zr=Br!==Fn.length-1,!1}return zr=!1,!0}(X),et=!F0(X);if(et&&function(Ut,fn){var _t=Ut.tag===lt,_r=Jn(ir(Ut)),Wr=Ut.hasOwnProperty(\"_debugOwner\"),Ar=Ut.hasOwnProperty(\"treeBaseDuration\");if(_t)$t(1),$t(_r),$t(11),$t(Ar?1:0),$t(Wr?1:0),u0&&so!==null&&so.set(_r,hi(Ut));else{var z=Ut.key,dr=ue(Ut),Or=Gr(Ut),Qn=Ut._debugOwner,nn=Qn!=null?Jn(ir(Qn)):0,s0=fn?Jn(ir(fn)):0,t0=ki(dr),g0=ki(z===null?null:\"\"+z);$t(1),$t(_r),$t(Or),$t(s0),$t(nn),$t(t0),$t(g0)}Ar&&(Vo.set(_r,Rr),Tn(Ut))}(X,Y),oo&&he&&Gr(X)===7&&(Hi.add(X.stateNode),he=!1),X.tag===ve.SuspenseComponent)if(X.memoizedState!==null){var Dt=X.child,bt=Dt?Dt.sibling:null,Zt=bt?bt.child:null;Zt!==null&&$r(Zt,et?X:Y,!0,he)}else{var qt=null;d0===-1?qt=X.child:X.child!==null&&(qt=X.child.child),qt!==null&&$r(qt,et?X:Y,!0,he)}else X.child!==null&&$r(X.child,et?X:Y,!0,he);(function(Ut){zr=Ut})(We),ye&&X.sibling!==null&&$r(X.sibling,Y,!0,he)}function m0(X){var Y=X.tag===ve.SuspenseComponent&&X.memoizedState!==null,ye=X.child;if(Y){var he=X.child,We=he?he.sibling:null;ye=We?We.child:null}for(;ye!==null;)ye.return!==null&&(m0(ye),Yr(ye,!0)),ye=ye.sibling}function Tn(X){var Y=Jn(ir(X)),ye=X.actualDuration,he=X.treeBaseDuration;if($u.set(Y,he||0),u0){var We=X.alternate;if(We==null||he!==We.treeBaseDuration){var et=Math.floor(1e3*(he||0));$t(4),$t(Y),$t(et)}if((We==null||K0(We,X))&&ye!=null){for(var Dt=ye,bt=X.child;bt!==null;)Dt-=bt.actualDuration||0,bt=bt.sibling;var Zt=uo;if(Zt.durations.push(Y,ye,Dt),Zt.maxActualDuration=Math.max(Zt.maxActualDuration,ye),To){var qt=function(Ut,fn){switch(Gr(fn)){case 1:case 5:case 8:case 6:return Ut===null?{context:null,didHooksChange:!1,isFirstMount:!0,props:null,state:null}:{context:ff(fn),didHooksChange:cf(Ut.memoizedState,fn.memoizedState),isFirstMount:!1,props:$0(Ut.memoizedProps,fn.memoizedProps),state:$0(Ut.memoizedState,fn.memoizedState)};default:return null}}(We,X);qt!==null&&Zt.changeDescriptions!==null&&Zt.changeDescriptions.set(Y,qt),ai(X)}}}}function Yo(X,Y){if(F0(X)){var ye=X.child;if(X.tag===He&&X.memoizedState!==null){var he=X.child,We=he?he.sibling:null,et=We?We.child:null;et!==null&&(ye=et)}for(;ye!==null;)Yo(ye,Y),ye=ye.sibling}else Y.push(Jn(ir(X)))}function bi(X,Y,ye,he){if(oo){var We=Gr(X);he?We===7&&(Hi.add(X.stateNode),he=!1):We!==5&&We!==1&&We!==2||(he=K0(Y,X))}S0!==null&&S0.id===Jn(ir(X))&&K0(Y,X)&&(El=!0);var et=!F0(X),Dt=X.tag===He,bt=!1,Zt=Dt&&Y.memoizedState!==null,qt=Dt&&X.memoizedState!==null;if(Zt&&qt){var Ut=X.child,fn=Ut?Ut.sibling:null,_t=Y.child,_r=_t?_t.sibling:null;fn!=null&&_r!=null&&bi(fn,_r,X,he)&&(bt=!0)}else if(Zt&&!qt){var Wr=X.child;Wr!==null&&$r(Wr,et?X:ye,!0,he),bt=!0}else if(!Zt&&qt){m0(Y);var Ar=X.child,z=Ar?Ar.sibling:null;z!=null&&($r(z,et?X:ye,!0,he),bt=!0)}else if(X.child!==Y.child){for(var dr=X.child,Or=Y.child;dr;){if(dr.alternate){var Qn=dr.alternate;bi(dr,Qn,et?X:ye,he)&&(bt=!0),Qn!==Or&&(bt=!0)}else $r(dr,et?X:ye,!1,he),bt=!0;dr=dr.sibling,bt||Or===null||(Or=Or.sibling)}Or!==null&&(bt=!0)}else oo&&he&&or(Jn(ir(X))).forEach(function(t0){Hi.add(t0.stateNode)});if(et&&X.hasOwnProperty(\"treeBaseDuration\")&&Tn(X),bt){if(et){var nn=X.child;if(qt){var s0=X.child;nn=s0?s0.sibling:null}return nn!=null&&function(t0,g0){for(var Kr=[],_0=g0;_0!==null;)Yo(_0,Kr),_0=_0.sibling;var Gi=Kr.length;if(!(Gi<2)){$t(3),$t(Jn(ir(t0))),$t(Gi);for(var fo=0;fo<Kr.length;fo++)$t(Kr[fo])}}(X,nn),!1}return!0}return!1}function or(X){var Y=[],ye=J0(X);if(!ye)return Y;for(var he=ye;;){if(he.tag===yn||he.tag===sn)Y.push(he);else if(he.child){he.child.return=he,he=he.child;continue}if(he===ye)return Y;for(;!he.sibling;){if(!he.return||he.return===ye)return Y;he=he.return}he.sibling.return=he.return,he=he.sibling}return Y}function zs(X){try{var Y=J0(X);if(Y===null)return null;if(Y.tag===He&&Y.memoizedState!==null){var ye=Y.child&&Y.child.sibling;ye!=null&&(Y=ye)}return or(X).map(function(he){return he.stateNode}).filter(Boolean)}catch(he){return null}}function Ku(X){var Y=X;if(X.alternate)for(;Y.return;)Y=Y.return;else{if((zo(Y)&xe)!==Ge)return 1;for(;Y.return;)if((zo(Y=Y.return)&xe)!==Ge)return 1}return Y.tag===lt?2:3}function J0(X){var Y=Y0.get(X);if(Y==null)return console.warn('Could not find Fiber with id \"'.concat(X,'\"')),null;var ye=Y.alternate;if(!ye){var he=Ku(Y);if(he===3)throw Error(\"Unable to find node on an unmounted component.\");return he===1?null:Y}for(var We=Y,et=ye;;){var Dt=We.return;if(Dt===null)break;var bt=Dt.alternate;if(bt===null){var Zt=Dt.return;if(Zt!==null){We=et=Zt;continue}break}if(Dt.child===bt.child){for(var qt=Dt.child;qt;){if(qt===We){if(Ku(Dt)!==2)throw Error(\"Unable to find node on an unmounted component.\");return Y}if(qt===et){if(Ku(Dt)!==2)throw Error(\"Unable to find node on an unmounted component.\");return ye}qt=qt.sibling}throw Error(\"Unable to find node on an unmounted component.\")}if(We.return!==et.return)We=Dt,et=bt;else{for(var Ut=!1,fn=Dt.child;fn;){if(fn===We){Ut=!0,We=Dt,et=bt;break}if(fn===et){Ut=!0,et=Dt,We=bt;break}fn=fn.sibling}if(!Ut){for(fn=bt.child;fn;){if(fn===We){Ut=!0,We=bt,et=Dt;break}if(fn===et){Ut=!0,et=bt,We=Dt;break}fn=fn.sibling}if(!Ut)throw Error(\"Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.\")}}if(We.alternate!==et)throw Error(\"Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.\")}if(We.tag!==lt)throw Error(\"Unable to find node on an unmounted component.\");return We.stateNode.current===We?Y:ye}function af(X){var Y=J0(X);if(Y==null)return null;var ye=Y._debugOwner,he=Y._debugSource,We=Y.stateNode,et=Y.key,Dt=Y.memoizedProps,bt=Y.memoizedState,Zt=Y.dependencies,qt=Y.tag,Ut=Y.type,fn=Gr(Y),_t=!(qt!==je&&qt!==Cr&&qt!==wt||!bt&&!Zt),_r=de(Ut),Wr=!1,Ar=null;if(qt===Xe||qt===je||qt===ar||qt===rn||qt===Hn||qt===wt||qt===Cr)Wr=!0,We&&We.context!=null&&(fn===1&&!(Ut.contextTypes||Ut.contextType)||(Ar=We.context));else if(_r===60110||_r===\"Symbol(react.context)\"){var z=Ut._context||Ut;Ar=z._currentValue||null;for(var dr=Y.return;dr!==null;){var Or=dr.type,Qn=de(Or);if((Qn===60109||Qn===\"Symbol(react.provider)\")&&(Or._context||Or.context)===z){Ar=dr.memoizedProps.value;break}dr=dr.return}}var nn=!1;Ar!==null&&(nn=!!Ut.contextTypes,Ar={value:Ar});var s0=null;if(ye){s0=[];for(var t0=ye;t0!==null;)s0.push({displayName:ue(t0)||\"Anonymous\",id:Jn(ir(t0)),type:Gr(t0)}),t0=t0._debugOwner||null}var g0=qt===He&&bt!==null,Kr=null;if(_t){var _0={};for(var Gi in console)try{_0[Gi]=console[Gi],console[Gi]=function(){}}catch(df){}try{Kr=Object(H0.inspectHooksOfFiber)(Y,U.currentDispatcherRef)}finally{for(var fo in _0)try{console[fo]=_0[fo]}catch(df){}}}for(var x0=null,Xu=Y;Xu.return!==null;)Xu=Xu.return;var Z0=Xu.stateNode;return Z0!=null&&Z0._debugRootType!==null&&(x0=Z0._debugRootType),{id:X,canEditHooks:typeof p0==\"function\",canEditFunctionProps:typeof xi==\"function\",canEditHooksAndDeletePaths:typeof h0==\"function\",canEditHooksAndRenamePaths:typeof ci==\"function\",canEditFunctionPropsDeletePaths:typeof E0==\"function\",canEditFunctionPropsRenamePaths:typeof qr==\"function\",canToggleSuspense:wl&&(!g0||B0.has(X)),canViewSource:Wr,hasLegacyContext:nn,key:et!=null?et:null,displayName:ue(Y),type:fn,context:Ar,hooks:Kr,props:Dt,state:_t?null:bt,owners:s0,source:he||null,rootType:x0,rendererPackageName:U.rendererPackageName,rendererVersion:U.version}}var S0=null,El=!1,Q0={};function Tr(X){return S0!==null&&S0.id===X&&!El}function R0(X){var Y=Q0;X.forEach(function(ye){Y[ye]||(Y[ye]={}),Y=Y[ye]})}function Nr(X,Y){return function(ye){switch(Y){case\"hooks\":if(ye.length===1||ye[ye.length-1]===\"subHooks\"||ye[ye.length-2]===\"subHooks\")return!0}var he=X===null?Q0:Q0[X];if(!he)return!1;for(var We=0;We<ye.length;We++)if(!(he=he[ye[We]]))return!1;return!0}}var uo=null,so=null,N0=null,C0=null,di=null,u0=!1,v0=0,To=!1,pu=null;function Sl(X){u0||(To=X,so=new Map,C0=new Map($u),di=new Map(Vo),N0=new Map,F.getFiberRoots(R).forEach(function(Y){var ye=Jn(ir(Y.current));so.set(ye,hi(Y.current)),X&&function he(We){ai(We);for(var et=We.child;et!==null;)he(et),et=et.sibling}(Y.current)}),u0=!0,v0=Os(),pu=new Map)}function Cl(){return!1}D(\"React::DevTools::reloadAndProfile\")===\"true\"&&Sl(D(\"React::DevTools::recordChangeDescriptions\")===\"true\");var B0=new Set;function hu(X){var Y=Jn(ir(X));return B0.has(Y)}var Fn=null,pi=null,Br=-1,zr=!1;function lo(X){X===null&&(pi=null,Br=-1,zr=!1),Fn=X}var wr=new Map,kn=new Map;function T0(X,Y){var ye=hi(Y),he=kn.get(ye)||0;kn.set(ye,he+1);var We=\"\".concat(ye,\":\").concat(he);wr.set(X,We)}function hi(X){for(var Y=null,ye=null,he=X.child,We=0;We<3&&he!==null;We++){var et=ue(he);if(et!==null&&(typeof he.type==\"function\"?Y=et:ye===null&&(ye=et)),Y!==null)break;he=he.child}return Y||ye||\"Anonymous\"}function Ai(X){var Y=X.key,ye=ue(X),he=X.index;switch(X.tag){case lt:var We=Jn(ir(X)),et=wr.get(We);if(et===void 0)throw new Error(\"Expected mounted root to have known pseudo key.\");ye=et;break;case yn:ye=X.type}return{displayName:ye,key:Y,index:he}}var Kt=function(X){if(X==null)return\"Unknown\";switch(X){case Ne:return\"Immediate\";case ft:return\"User-Blocking\";case St:return\"Normal\";case Qt:return\"Low\";case Cn:return\"Idle\";case bn:default:return\"Unknown\"}};return{cleanup:function(){},copyElementPath:function(X,Y){Tr(X)&&qo(Ti(S0,Y))},deletePath:function(X,Y,ye,he){var We=J0(Y);if(We!==null){var et=We.stateNode;switch(X){case\"context\":switch(he=he.slice(1),We.tag){case Xe:he.length===0||Fu(et.context,he),et.forceUpdate()}break;case\"hooks\":typeof h0==\"function\"&&h0(We,ye,he);break;case\"props\":et===null?typeof E0==\"function\"&&E0(We,he):(We.pendingProps=kr(et.props,he),et.forceUpdate());break;case\"state\":Fu(et.state,he),et.forceUpdate()}}},findNativeNodesForFiberID:zs,flushInitialOperations:function(){var X=ht;ht=null,X!==null&&X.length>0?X.forEach(function(Y){F.emit(\"operations\",Y)}):(Fn!==null&&(zr=!0),F.getFiberRoots(R).forEach(function(Y){T0(Rr=Jn(ir(Y.current)),Y.current),u0&&Y.memoizedInteractions!=null&&(uo={changeDescriptions:To?new Map:null,durations:[],commitTime:Os()-v0,interactions:Array.from(Y.memoizedInteractions).map(function(ye){return Bt(Bt({},ye),{},{timestamp:ye.timestamp-v0})}),maxActualDuration:0,priorityLevel:null}),$r(Y.current,null,!1,!1),X0(),Rr=-1}))},getBestMatchForTrackedPath:function(){if(Fn===null||pi===null)return null;for(var X=pi;X!==null&&F0(X);)X=X.return;return X===null?null:{id:Jn(ir(X)),isFullMatch:Br===Fn.length-1}},getDisplayNameForFiberID:function(X){var Y=Y0.get(X);return Y!=null?ue(Y):null},getFiberIDForNative:function(X){var Y=arguments.length>1&&arguments[1]!==void 0&&arguments[1],ye=U.findFiberByHostInstance(X);if(ye!=null){if(Y)for(;ye!==null&&F0(ye);)ye=ye.return;return Jn(ir(ye))}return null},getInstanceAndStyle:function(X){var Y=null,ye=null,he=J0(X);return he!==null&&(Y=he.stateNode,he.memoizedProps!==null&&(ye=he.memoizedProps.style)),{instance:Y,style:ye}},getOwnersList:function(X){var Y=J0(X);if(Y==null)return null;var ye=Y._debugOwner,he=[{displayName:ue(Y)||\"Anonymous\",id:X,type:Gr(Y)}];if(ye)for(var We=ye;We!==null;)he.unshift({displayName:ue(We)||\"Anonymous\",id:Jn(ir(We)),type:Gr(We)}),We=We._debugOwner||null;return he},getPathForElement:function(X){var Y=Y0.get(X);if(Y==null)return null;for(var ye=[];Y!==null;)ye.push(Ai(Y)),Y=Y.return;return ye.reverse(),ye},getProfilingData:function(){var X=[];if(pu===null)throw Error(\"getProfilingData() called before any profiling data was recorded\");return pu.forEach(function(Y,ye){var he=[],We=[],et=new Map,Dt=new Map,bt=so!==null&&so.get(ye)||\"Unknown\";C0!=null&&C0.forEach(function(Zt,qt){di!=null&&di.get(qt)===ye&&We.push([qt,Zt])}),Y.forEach(function(Zt,qt){var Ut=Zt.changeDescriptions,fn=Zt.durations,_t=Zt.interactions,_r=Zt.maxActualDuration,Wr=Zt.priorityLevel,Ar=Zt.commitTime,z=[];_t.forEach(function(s0){et.has(s0.id)||et.set(s0.id,s0),z.push(s0.id);var t0=Dt.get(s0.id);t0!=null?t0.push(qt):Dt.set(s0.id,[qt])});for(var dr=[],Or=[],Qn=0;Qn<fn.length;Qn+=3){var nn=fn[Qn];dr.push([nn,fn[Qn+1]]),Or.push([nn,fn[Qn+2]])}he.push({changeDescriptions:Ut!==null?Array.from(Ut.entries()):null,duration:_r,fiberActualDurations:dr,fiberSelfDurations:Or,interactionIDs:z,priorityLevel:Wr,timestamp:Ar})}),X.push({commitData:he,displayName:bt,initialTreeBaseDurations:We,interactionCommits:Array.from(Dt.entries()),interactions:Array.from(et.entries()),rootID:ye})}),{dataForRoots:X,rendererID:R}},handleCommitFiberRoot:function(X,Y){var ye=X.current,he=ye.alternate;Rr=Jn(ir(ye)),Fn!==null&&(zr=!0),oo&&Hi.clear();var We=X.memoizedInteractions!=null;if(u0&&We&&(uo={changeDescriptions:To?new Map:null,durations:[],commitTime:Os()-v0,interactions:Array.from(X.memoizedInteractions).map(function(Zt){return Bt(Bt({},Zt),{},{timestamp:Zt.timestamp-v0})}),maxActualDuration:0,priorityLevel:Y==null?null:Kt(Y)}),he){var et=he.memoizedState!=null&&he.memoizedState.element!=null,Dt=ye.memoizedState!=null&&ye.memoizedState.element!=null;!et&&Dt?(T0(Rr,ye),$r(ye,null,!1,!1)):et&&Dt?bi(ye,he,null,!1):et&&!Dt&&(function(Zt){var qt=wr.get(Zt);if(qt===void 0)throw new Error(\"Expected root pseudo key to be known.\");var Ut=qt.substring(0,qt.lastIndexOf(\":\")),fn=kn.get(Ut);if(fn===void 0)throw new Error(\"Expected counter to be known.\");fn>1?kn.set(Ut,fn-1):kn.delete(Ut),wr.delete(Zt)}(Rr),Yr(ye,!1))}else T0(Rr,ye),$r(ye,null,!1,!1);if(u0&&We){var bt=pu.get(Rr);bt!=null?bt.push(uo):pu.set(Rr,[uo])}X0(),oo&&F.emit(\"traceUpdates\",Hi),Rr=-1},handleCommitFiberUnmount:function(X){Yr(X,!1)},inspectElement:function(X,Y){if(Tr(X)){if(Y!=null){R0(Y);var ye=null;return Y[0]===\"hooks\"&&(ye=\"hooks\"),{id:X,type:\"hydrated-path\",path:Y,value:qi(Ti(S0,Y),Nr(null,ye),Y)}}return{id:X,type:\"no-change\"}}if(El=!1,S0!==null&&S0.id===X||(Q0={}),(S0=af(X))===null)return{id:X,type:\"not-found\"};Y!=null&&R0(Y),function(We){var et=We.hooks,Dt=We.id,bt=We.props,Zt=Y0.get(Dt);if(Zt!=null){var qt=Zt.elementType,Ut=Zt.stateNode,fn=Zt.tag,_t=Zt.type;switch(fn){case Xe:case ar:case rn:H.$r=Ut;break;case je:H.$r={hooks:et,props:bt,type:_t};break;case wt:H.$r={props:bt,type:_t.render};break;case Hn:case Cr:H.$r={props:bt,type:qt!=null&&qt.type!=null?qt.type:_t};break;default:H.$r=null}}else console.warn('Could not find Fiber with id \"'.concat(Dt,'\"'))}(S0);var he=Bt({},S0);return he.context=qi(he.context,Nr(\"context\",null)),he.hooks=qi(he.hooks,Nr(\"hooks\",\"hooks\")),he.props=qi(he.props,Nr(\"props\",null)),he.state=qi(he.state,Nr(\"state\",null)),{id:X,type:\"full-data\",value:he}},logElementToConsole:function(X){var Y=Tr(X)?S0:af(X);if(Y!==null){var ye=typeof console.groupCollapsed==\"function\";ye&&console.groupCollapsed(\"[Click to expand] %c<\".concat(Y.displayName||\"Component\",\" />\"),\"color: var(--dom-tag-name-color); font-weight: normal;\"),Y.props!==null&&console.log(\"Props:\",Y.props),Y.state!==null&&console.log(\"State:\",Y.state),Y.hooks!==null&&console.log(\"Hooks:\",Y.hooks);var he=zs(X);he!==null&&console.log(\"Nodes:\",he),Y.source!==null&&console.log(\"Location:\",Y.source),(window.chrome||/firefox/i.test(navigator.userAgent))&&console.log(\"Right-click any value to save it as a global variable for further inspection.\"),ye&&console.groupEnd()}else console.warn('Could not find Fiber with id \"'.concat(X,'\"'))},prepareViewAttributeSource:function(X,Y){Tr(X)&&(window.$attribute=Ti(S0,Y))},prepareViewElementSource:function(X){var Y=Y0.get(X);if(Y!=null){var ye=Y.elementType,he=Y.tag,We=Y.type;switch(he){case Xe:case ar:case rn:case je:H.$type=We;break;case wt:H.$type=We.render;break;case Hn:case Cr:H.$type=ye!=null&&ye.type!=null?ye.type:We;break;default:H.$type=null}}else console.warn('Could not find Fiber with id \"'.concat(X,'\"'))},overrideSuspense:function(X,Y){if(typeof Eo!=\"function\"||typeof So!=\"function\")throw new Error(\"Expected overrideSuspense() to not get called for earlier React versions.\");Y?(B0.add(X),B0.size===1&&Eo(hu)):(B0.delete(X),B0.size===0&&Eo(Cl));var ye=Y0.get(X);ye!=null&&So(ye)},overrideValueAtPath:function(X,Y,ye,he,We){var et=J0(Y);if(et!==null){var Dt=et.stateNode;switch(X){case\"context\":switch(he=he.slice(1),et.tag){case Xe:he.length===0?Dt.context=We:fl(Dt.context,he,We),Dt.forceUpdate()}break;case\"hooks\":typeof p0==\"function\"&&p0(et,ye,he,We);break;case\"props\":switch(et.tag){case Xe:et.pendingProps=si(Dt.props,he,We),Dt.forceUpdate();break;default:typeof xi==\"function\"&&xi(et,he,We)}break;case\"state\":switch(et.tag){case Xe:fl(Dt.state,he,We),Dt.forceUpdate()}}}},renamePath:function(X,Y,ye,he,We){var et=J0(Y);if(et!==null){var Dt=et.stateNode;switch(X){case\"context\":switch(he=he.slice(1),We=We.slice(1),et.tag){case Xe:he.length===0||ll(Dt.context,he,We),Dt.forceUpdate()}break;case\"hooks\":typeof ci==\"function\"&&ci(et,ye,he,We);break;case\"props\":Dt===null?typeof qr==\"function\"&&qr(et,he,We):(et.pendingProps=Fr(Dt.props,he,We),Dt.forceUpdate());break;case\"state\":ll(Dt.state,he,We),Dt.forceUpdate()}}},renderer:U,setTraceUpdatesEnabled:function(X){oo=X},setTrackedPath:lo,startProfiling:Sl,stopProfiling:function(){u0=!1,To=!1},storeAsGlobal:function(X,Y,ye){if(Tr(X)){var he=Ti(S0,Y),We=\"$reactTemp\".concat(ye);window[We]=he,console.log(We),console.log(he)}},updateComponentFilters:function(X){if(u0)throw Error(\"Cannot modify filter preferences while profiling\");F.getFiberRoots(R).forEach(function(Y){Rr=Jn(ir(Y.current)),m0(Y.current),Yr(Y.current,!1),Rr=-1}),qs(X),kn.clear(),F.getFiberRoots(R).forEach(function(Y){T0(Rr=Jn(ir(Y.current)),Y.current),$r(Y.current,null,!1,!1),X0(Y),Rr=-1})}}}var _n;function Nu(F){return(Nu=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(R){return typeof R}:function(R){return R&&typeof Symbol==\"function\"&&R.constructor===Symbol&&R!==Symbol.prototype?\"symbol\":typeof R})(F)}function Wo(F,R,U){if(_n===void 0)try{throw Error()}catch(fe){var H=fe.stack.trim().match(/\\n( *(at )?)/);_n=H&&H[1]||\"\"}return`\n`+_n+F}var su=!1;function Ps(F,R,U){if(!F||su)return\"\";var H,fe=Error.prepareStackTrace;Error.prepareStackTrace=void 0,su=!0;var ue=U.current;U.current=null;try{if(R){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,\"props\",{set:function(){throw Error()}}),(typeof Reflect==\"undefined\"?\"undefined\":Nu(Reflect))===\"object\"&&Reflect.construct){try{Reflect.construct(de,[])}catch(xe){H=xe}Reflect.construct(F,[],de)}else{try{de.call()}catch(xe){H=xe}F.call(de.prototype)}}else{try{throw Error()}catch(xe){H=xe}F()}}catch(xe){if(xe&&H&&typeof xe.stack==\"string\"){for(var W=xe.stack.split(`\n`),ve=H.stack.split(`\n`),Fe=W.length-1,Ge=ve.length-1;Fe>=1&&Ge>=0&&W[Fe]!==ve[Ge];)Ge--;for(;Fe>=1&&Ge>=0;Fe--,Ge--)if(W[Fe]!==ve[Ge]){if(Fe!==1||Ge!==1)do if(Fe--,--Ge<0||W[Fe]!==ve[Ge])return`\n`+W[Fe].replace(\" at new \",\" at \");while(Fe>=1&&Ge>=0);break}}}finally{su=!1,Error.prepareStackTrace=fe,U.current=ue}var K=F?F.displayName||F.name:\"\";return K?Wo(K):\"\"}function pl(F,R,U,H){return Ps(F,!1,H)}function Vf(F,R,U){var H=F.HostComponent,fe=F.LazyComponent,ue=F.SuspenseComponent,de=F.SuspenseListComponent,W=F.FunctionComponent,ve=F.IndeterminateComponent,Fe=F.SimpleMemoComponent,Ge=F.ForwardRef,K=F.Block,xe=F.ClassComponent;switch(R.tag){case H:return Wo(R.type);case fe:return Wo(\"Lazy\");case ue:return Wo(\"Suspense\");case de:return Wo(\"SuspenseList\");case W:case ve:case Fe:return pl(R.type,0,0,U);case Ge:return pl(R.type.render,0,0,U);case K:return pl(R.type._render,0,0,U);case xe:return function(je,Xe,rt,st){return Ps(je,!0,st)}(R.type,0,0,U);default:return\"\"}}function hl(F,R,U){try{var H=\"\",fe=R;do H+=Vf(F,fe,U),fe=fe.return;while(fe);return H}catch(ue){return`\nError generating stack: `+ue.message+`\n`+ue.stack}}function Bu(F,R){var U;if(typeof Symbol==\"undefined\"||F[Symbol.iterator]==null){if(Array.isArray(F)||(U=function(ve,Fe){if(!!ve){if(typeof ve==\"string\")return ju(ve,Fe);var Ge=Object.prototype.toString.call(ve).slice(8,-1);if(Ge===\"Object\"&&ve.constructor&&(Ge=ve.constructor.name),Ge===\"Map\"||Ge===\"Set\")return Array.from(ve);if(Ge===\"Arguments\"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ge))return ju(ve,Fe)}}(F))||R&&F&&typeof F.length==\"number\"){U&&(F=U);var H=0,fe=function(){};return{s:fe,n:function(){return H>=F.length?{done:!0}:{done:!1,value:F[H++]}},e:function(ve){throw ve},f:fe}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ue,de=!0,W=!1;return{s:function(){U=F[Symbol.iterator]()},n:function(){var ve=U.next();return de=ve.done,ve},e:function(ve){W=!0,ue=ve},f:function(){try{de||U.return==null||U.return()}finally{if(W)throw ue}}}}function ju(F,R){(R==null||R>F.length)&&(R=F.length);for(var U=0,H=new Array(R);U<R;U++)H[U]=F[U];return H}var sf=[\"error\",\"trace\",\"warn\"],ro=/\\s{4}(in|at)\\s{1}/,Ms=/:\\d+:\\d+(\\n|$)/,ml=new Map,Uu=console,G0={};for(var Fs in console)G0[Fs]=console[Fs];var tt=null;function zi(F){var R=F.currentDispatcherRef,U=F.getCurrentFiber,H=F.findFiberByHostInstance,fe=F.version;if(typeof H==\"function\"&&R!=null&&typeof U==\"function\"){var ue=Is(fe).ReactTypeOfWork;ml.set(F,{currentDispatcherRef:R,getCurrentFiber:U,workTagMap:ue})}}var lu={appendComponentStack:!1,breakOnConsoleErrors:!1};function Ho(F){var R=F.appendComponentStack,U=F.breakOnConsoleErrors;if(lu.appendComponentStack=R,lu.breakOnConsoleErrors=U,tt===null){var H={};tt=function(){for(var fe in H)try{Uu[fe]=H[fe]}catch(ue){}},sf.forEach(function(fe){try{var ue=H[fe]=Uu[fe],de=function(){for(var W=lu.appendComponentStack,ve=(lu.breakOnConsoleErrors,arguments.length),Fe=new Array(ve),Ge=0;Ge<ve;Ge++)Fe[Ge]=arguments[Ge];if(W)try{var K=Fe.length>0?Fe[Fe.length-1]:null,xe=K!==null&&(ro.test(K)||Ms.test(K));if(!xe){var je,Xe=Bu(ml.values());try{for(Xe.s();!(je=Xe.n()).done;){var rt=je.value,st=rt.currentDispatcherRef,xt=rt.getCurrentFiber,wt=rt.workTagMap,lt=xt();if(lt!=null){var Rt=hl(wt,lt,st);Rt!==\"\"&&Fe.push(Rt);break}}}catch(yn){Xe.e(yn)}finally{Xe.f()}}}catch(yn){}ue.apply(void 0,Fe)};de.__REACT_DEVTOOLS_ORIGINAL_METHOD__=ue,Uu[fe]=de}catch(W){}})}}function O0(F){return(O0=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(R){return typeof R}:function(R){return R&&typeof Symbol==\"function\"&&R.constructor===Symbol&&R!==Symbol.prototype?\"symbol\":typeof R})(F)}function vl(F,R){for(var U=0;U<R.length;U++){var H=R[U];H.enumerable=H.enumerable||!1,H.configurable=!0,\"value\"in H&&(H.writable=!0),Object.defineProperty(F,H.key,H)}}function gl(F,R){return(gl=Object.setPrototypeOf||function(U,H){return U.__proto__=H,U})(F,R)}function fu(F){var R=function(){if(typeof Reflect==\"undefined\"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==\"function\")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(U){return!1}}();return function(){var U,H=gt(F);if(R){var fe=gt(this).constructor;U=Reflect.construct(H,arguments,fe)}else U=H.apply(this,arguments);return _l(this,U)}}function _l(F,R){return!R||O0(R)!==\"object\"&&typeof R!=\"function\"?Sn(F):R}function Sn(F){if(F===void 0)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return F}function gt(F){return(gt=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)})(F)}function en(F,R,U){return R in F?Object.defineProperty(F,R,{value:U,enumerable:!0,configurable:!0,writable:!0}):F[R]=U,F}var I0=function(F){(function(de,W){if(typeof W!=\"function\"&&W!==null)throw new TypeError(\"Super expression must either be null or a function\");de.prototype=Object.create(W&&W.prototype,{constructor:{value:de,writable:!0,configurable:!0}}),W&&gl(de,W)})(ue,F);var R,U,H,fe=fu(ue);function ue(de){var W;(function(K,xe){if(!(K instanceof xe))throw new TypeError(\"Cannot call a class as a function\")})(this,ue),en(Sn(W=fe.call(this)),\"_isProfiling\",!1),en(Sn(W),\"_recordChangeDescriptions\",!1),en(Sn(W),\"_rendererInterfaces\",{}),en(Sn(W),\"_persistedSelection\",null),en(Sn(W),\"_persistedSelectionMatch\",null),en(Sn(W),\"_traceUpdatesEnabled\",!1),en(Sn(W),\"copyElementPath\",function(K){var xe=K.id,je=K.path,Xe=K.rendererID,rt=W._rendererInterfaces[Xe];rt==null?console.warn('Invalid renderer id \"'.concat(Xe,'\" for element \"').concat(xe,'\"')):rt.copyElementPath(xe,je)}),en(Sn(W),\"deletePath\",function(K){var xe=K.hookID,je=K.id,Xe=K.path,rt=K.rendererID,st=K.type,xt=W._rendererInterfaces[rt];xt==null?console.warn('Invalid renderer id \"'.concat(rt,'\" for element \"').concat(je,'\"')):xt.deletePath(st,je,xe,Xe)}),en(Sn(W),\"getProfilingData\",function(K){var xe=K.rendererID,je=W._rendererInterfaces[xe];je==null&&console.warn('Invalid renderer id \"'.concat(xe,'\"')),W._bridge.send(\"profilingData\",je.getProfilingData())}),en(Sn(W),\"getProfilingStatus\",function(){W._bridge.send(\"profilingStatus\",W._isProfiling)}),en(Sn(W),\"getOwnersList\",function(K){var xe=K.id,je=K.rendererID,Xe=W._rendererInterfaces[je];if(Xe==null)console.warn('Invalid renderer id \"'.concat(je,'\" for element \"').concat(xe,'\"'));else{var rt=Xe.getOwnersList(xe);W._bridge.send(\"ownersList\",{id:xe,owners:rt})}}),en(Sn(W),\"inspectElement\",function(K){var xe=K.id,je=K.path,Xe=K.rendererID,rt=W._rendererInterfaces[Xe];rt==null?console.warn('Invalid renderer id \"'.concat(Xe,'\" for element \"').concat(xe,'\"')):(W._bridge.send(\"inspectedElement\",rt.inspectElement(xe,je)),W._persistedSelectionMatch!==null&&W._persistedSelectionMatch.id===xe||(W._persistedSelection=null,W._persistedSelectionMatch=null,rt.setTrackedPath(null),W._throttledPersistSelection(Xe,xe)))}),en(Sn(W),\"logElementToConsole\",function(K){var xe=K.id,je=K.rendererID,Xe=W._rendererInterfaces[je];Xe==null?console.warn('Invalid renderer id \"'.concat(je,'\" for element \"').concat(xe,'\"')):Xe.logElementToConsole(xe)}),en(Sn(W),\"overrideSuspense\",function(K){var xe=K.id,je=K.rendererID,Xe=K.forceFallback,rt=W._rendererInterfaces[je];rt==null?console.warn('Invalid renderer id \"'.concat(je,'\" for element \"').concat(xe,'\"')):rt.overrideSuspense(xe,Xe)}),en(Sn(W),\"overrideValueAtPath\",function(K){var xe=K.hookID,je=K.id,Xe=K.path,rt=K.rendererID,st=K.type,xt=K.value,wt=W._rendererInterfaces[rt];wt==null?console.warn('Invalid renderer id \"'.concat(rt,'\" for element \"').concat(je,'\"')):wt.overrideValueAtPath(st,je,xe,Xe,xt)}),en(Sn(W),\"overrideContext\",function(K){var xe=K.id,je=K.path,Xe=K.rendererID,rt=K.wasForwarded,st=K.value;rt||W.overrideValueAtPath({id:xe,path:je,rendererID:Xe,type:\"context\",value:st})}),en(Sn(W),\"overrideHookState\",function(K){var xe=K.id,je=(K.hookID,K.path),Xe=K.rendererID,rt=K.wasForwarded,st=K.value;rt||W.overrideValueAtPath({id:xe,path:je,rendererID:Xe,type:\"hooks\",value:st})}),en(Sn(W),\"overrideProps\",function(K){var xe=K.id,je=K.path,Xe=K.rendererID,rt=K.wasForwarded,st=K.value;rt||W.overrideValueAtPath({id:xe,path:je,rendererID:Xe,type:\"props\",value:st})}),en(Sn(W),\"overrideState\",function(K){var xe=K.id,je=K.path,Xe=K.rendererID,rt=K.wasForwarded,st=K.value;rt||W.overrideValueAtPath({id:xe,path:je,rendererID:Xe,type:\"state\",value:st})}),en(Sn(W),\"reloadAndProfile\",function(K){N(\"React::DevTools::reloadAndProfile\",\"true\"),N(\"React::DevTools::recordChangeDescriptions\",K?\"true\":\"false\"),W._bridge.send(\"reloadAppForProfiling\")}),en(Sn(W),\"renamePath\",function(K){var xe=K.hookID,je=K.id,Xe=K.newPath,rt=K.oldPath,st=K.rendererID,xt=K.type,wt=W._rendererInterfaces[st];wt==null?console.warn('Invalid renderer id \"'.concat(st,'\" for element \"').concat(je,'\"')):wt.renamePath(xt,je,xe,rt,Xe)}),en(Sn(W),\"setTraceUpdatesEnabled\",function(K){for(var xe in W._traceUpdatesEnabled=K,Yt(K),W._rendererInterfaces)W._rendererInterfaces[xe].setTraceUpdatesEnabled(K)}),en(Sn(W),\"syncSelectionFromNativeElementsPanel\",function(){var K=window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0;K!=null&&W.selectNode(K)}),en(Sn(W),\"shutdown\",function(){W.emit(\"shutdown\")}),en(Sn(W),\"startProfiling\",function(K){for(var xe in W._recordChangeDescriptions=K,W._isProfiling=!0,W._rendererInterfaces)W._rendererInterfaces[xe].startProfiling(K);W._bridge.send(\"profilingStatus\",W._isProfiling)}),en(Sn(W),\"stopProfiling\",function(){for(var K in W._isProfiling=!1,W._recordChangeDescriptions=!1,W._rendererInterfaces)W._rendererInterfaces[K].stopProfiling();W._bridge.send(\"profilingStatus\",W._isProfiling)}),en(Sn(W),\"storeAsGlobal\",function(K){var xe=K.count,je=K.id,Xe=K.path,rt=K.rendererID,st=W._rendererInterfaces[rt];st==null?console.warn('Invalid renderer id \"'.concat(rt,'\" for element \"').concat(je,'\"')):st.storeAsGlobal(je,Xe,xe)}),en(Sn(W),\"updateConsolePatchSettings\",function(K){var xe=K.appendComponentStack,je=K.breakOnConsoleErrors;xe||je?Ho({appendComponentStack:xe,breakOnConsoleErrors:je}):tt!==null&&(tt(),tt=null)}),en(Sn(W),\"updateComponentFilters\",function(K){for(var xe in W._rendererInterfaces)W._rendererInterfaces[xe].updateComponentFilters(K)}),en(Sn(W),\"viewAttributeSource\",function(K){var xe=K.id,je=K.path,Xe=K.rendererID,rt=W._rendererInterfaces[Xe];rt==null?console.warn('Invalid renderer id \"'.concat(Xe,'\" for element \"').concat(xe,'\"')):rt.prepareViewAttributeSource(xe,je)}),en(Sn(W),\"viewElementSource\",function(K){var xe=K.id,je=K.rendererID,Xe=W._rendererInterfaces[je];Xe==null?console.warn('Invalid renderer id \"'.concat(je,'\" for element \"').concat(xe,'\"')):Xe.prepareViewElementSource(xe)}),en(Sn(W),\"onTraceUpdates\",function(K){W.emit(\"traceUpdates\",K)}),en(Sn(W),\"onHookOperations\",function(K){if(W._bridge.send(\"operations\",K),W._persistedSelection!==null){var xe=K[0];if(W._persistedSelection.rendererID===xe){var je=W._rendererInterfaces[xe];if(je==null)console.warn('Invalid renderer id \"'.concat(xe,'\"'));else{var Xe=W._persistedSelectionMatch,rt=je.getBestMatchForTrackedPath();W._persistedSelectionMatch=rt;var st=Xe!==null?Xe.id:null,xt=rt!==null?rt.id:null;st!==xt&&xt!==null&&W._bridge.send(\"selectFiber\",xt),rt!==null&&rt.isFullMatch&&(W._persistedSelection=null,W._persistedSelectionMatch=null,je.setTrackedPath(null))}}}}),en(Sn(W),\"_throttledPersistSelection\",C()(function(K,xe){var je=W._rendererInterfaces[K],Xe=je!=null?je.getPathForElement(xe):null;Xe!==null?N(\"React::DevTools::lastSelection\",JSON.stringify({rendererID:K,path:Xe})):L(\"React::DevTools::lastSelection\")},1e3)),D(\"React::DevTools::reloadAndProfile\")===\"true\"&&(W._recordChangeDescriptions=D(\"React::DevTools::recordChangeDescriptions\")===\"true\",W._isProfiling=!0,L(\"React::DevTools::recordChangeDescriptions\"),L(\"React::DevTools::reloadAndProfile\"));var ve=D(\"React::DevTools::lastSelection\");ve!=null&&(W._persistedSelection=JSON.parse(ve)),W._bridge=de,de.addListener(\"copyElementPath\",W.copyElementPath),de.addListener(\"deletePath\",W.deletePath),de.addListener(\"getProfilingData\",W.getProfilingData),de.addListener(\"getProfilingStatus\",W.getProfilingStatus),de.addListener(\"getOwnersList\",W.getOwnersList),de.addListener(\"inspectElement\",W.inspectElement),de.addListener(\"logElementToConsole\",W.logElementToConsole),de.addListener(\"overrideSuspense\",W.overrideSuspense),de.addListener(\"overrideValueAtPath\",W.overrideValueAtPath),de.addListener(\"reloadAndProfile\",W.reloadAndProfile),de.addListener(\"renamePath\",W.renamePath),de.addListener(\"setTraceUpdatesEnabled\",W.setTraceUpdatesEnabled),de.addListener(\"startProfiling\",W.startProfiling),de.addListener(\"stopProfiling\",W.stopProfiling),de.addListener(\"storeAsGlobal\",W.storeAsGlobal),de.addListener(\"syncSelectionFromNativeElementsPanel\",W.syncSelectionFromNativeElementsPanel),de.addListener(\"shutdown\",W.shutdown),de.addListener(\"updateConsolePatchSettings\",W.updateConsolePatchSettings),de.addListener(\"updateComponentFilters\",W.updateComponentFilters),de.addListener(\"viewAttributeSource\",W.viewAttributeSource),de.addListener(\"viewElementSource\",W.viewElementSource),de.addListener(\"overrideContext\",W.overrideContext),de.addListener(\"overrideHookState\",W.overrideHookState),de.addListener(\"overrideProps\",W.overrideProps),de.addListener(\"overrideState\",W.overrideState),W._isProfiling&&de.send(\"profilingStatus\",!0);var Fe,Ge=!1;try{localStorage.getItem(\"test\"),Ge=!0}catch(K){}return de.send(\"isBackendStorageAPISupported\",Ge),ge(de,Sn(W)),Fe=Sn(W),Fe.addListener(\"traceUpdates\",cr),W}return R=ue,(U=[{key:\"getInstanceAndStyle\",value:function(de){var W=de.id,ve=de.rendererID,Fe=this._rendererInterfaces[ve];return Fe==null?(console.warn('Invalid renderer id \"'.concat(ve,'\"')),null):Fe.getInstanceAndStyle(W)}},{key:\"getIDForNode\",value:function(de){for(var W in this._rendererInterfaces){var ve=this._rendererInterfaces[W];try{var Fe=ve.getFiberIDForNative(de,!0);if(Fe!==null)return Fe}catch(Ge){}}return null}},{key:\"selectNode\",value:function(de){var W=this.getIDForNode(de);W!==null&&this._bridge.send(\"selectFiber\",W)}},{key:\"setRendererInterface\",value:function(de,W){this._rendererInterfaces[de]=W,this._isProfiling&&W.startProfiling(this._recordChangeDescriptions),W.setTraceUpdatesEnabled(this._traceUpdatesEnabled);var ve=this._persistedSelection;ve!==null&&ve.rendererID===de&&W.setTrackedPath(ve.path)}},{key:\"onUnsupportedRenderer\",value:function(de){this._bridge.send(\"unsupportedRendererVersion\",de)}},{key:\"rendererInterfaces\",get:function(){return this._rendererInterfaces}}])&&vl(R.prototype,U),H&&vl(R,H),ue}(g);function li(F){return(li=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(R){return typeof R}:function(R){return R&&typeof Symbol==\"function\"&&R.constructor===Symbol&&R!==Symbol.prototype?\"symbol\":typeof R})(F)}function qu(F){return function(R){if(Array.isArray(R))return Wi(R)}(F)||function(R){if(typeof Symbol!=\"undefined\"&&Symbol.iterator in Object(R))return Array.from(R)}(F)||function(R,U){if(!!R){if(typeof R==\"string\")return Wi(R,U);var H=Object.prototype.toString.call(R).slice(8,-1);if(H===\"Object\"&&R.constructor&&(H=R.constructor.name),H===\"Map\"||H===\"Set\")return Array.from(R);if(H===\"Arguments\"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(H))return Wi(R,U)}}(F)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Wi(F,R){(R==null||R>F.length)&&(R=F.length);for(var U=0,H=new Array(R);U<R;U++)H[U]=F[U];return H}function zu(F,R){for(var U=0;U<R.length;U++){var H=R[U];H.enumerable=H.enumerable||!1,H.configurable=!0,\"value\"in H&&(H.writable=!0),Object.defineProperty(F,H.key,H)}}function Wu(F,R){return(Wu=Object.setPrototypeOf||function(U,H){return U.__proto__=H,U})(F,R)}function Ls(F){var R=function(){if(typeof Reflect==\"undefined\"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==\"function\")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(U){return!1}}();return function(){var U,H=io(F);if(R){var fe=io(this).constructor;U=Reflect.construct(H,arguments,fe)}else U=H.apply(this,arguments);return fi(this,U)}}function fi(F,R){return!R||li(R)!==\"object\"&&typeof R!=\"function\"?e0(F):R}function e0(F){if(F===void 0)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return F}function io(F){return(io=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)})(F)}function D0(F,R,U){return R in F?Object.defineProperty(F,R,{value:U,enumerable:!0,configurable:!0,writable:!0}):F[R]=U,F}var Do=function(F){(function(de,W){if(typeof W!=\"function\"&&W!==null)throw new TypeError(\"Super expression must either be null or a function\");de.prototype=Object.create(W&&W.prototype,{constructor:{value:de,writable:!0,configurable:!0}}),W&&Wu(de,W)})(ue,F);var R,U,H,fe=Ls(ue);function ue(de){var W;return function(ve,Fe){if(!(ve instanceof Fe))throw new TypeError(\"Cannot call a class as a function\")}(this,ue),D0(e0(W=fe.call(this)),\"_isShutdown\",!1),D0(e0(W),\"_messageQueue\",[]),D0(e0(W),\"_timeoutID\",null),D0(e0(W),\"_wallUnlisten\",null),D0(e0(W),\"_flush\",function(){if(W._timeoutID!==null&&(clearTimeout(W._timeoutID),W._timeoutID=null),W._messageQueue.length){for(var ve=0;ve<W._messageQueue.length;ve+=2){var Fe;(Fe=W._wall).send.apply(Fe,[W._messageQueue[ve]].concat(qu(W._messageQueue[ve+1])))}W._messageQueue.length=0,W._timeoutID=setTimeout(W._flush,100)}}),D0(e0(W),\"overrideValueAtPath\",function(ve){var Fe=ve.id,Ge=ve.path,K=ve.rendererID,xe=ve.type,je=ve.value;switch(xe){case\"context\":W.send(\"overrideContext\",{id:Fe,path:Ge,rendererID:K,wasForwarded:!0,value:je});break;case\"hooks\":W.send(\"overrideHookState\",{id:Fe,path:Ge,rendererID:K,wasForwarded:!0,value:je});break;case\"props\":W.send(\"overrideProps\",{id:Fe,path:Ge,rendererID:K,wasForwarded:!0,value:je});break;case\"state\":W.send(\"overrideState\",{id:Fe,path:Ge,rendererID:K,wasForwarded:!0,value:je})}}),W._wall=de,W._wallUnlisten=de.listen(function(ve){e0(W).emit(ve.event,ve.payload)})||null,W.addListener(\"overrideValueAtPath\",W.overrideValueAtPath),W}return R=ue,(U=[{key:\"send\",value:function(de){if(this._isShutdown)console.warn('Cannot send message \"'.concat(de,'\" through a Bridge that has been shutdown.'));else{for(var W=arguments.length,ve=new Array(W>1?W-1:0),Fe=1;Fe<W;Fe++)ve[Fe-1]=arguments[Fe];this._messageQueue.push(de,ve),this._timeoutID||(this._timeoutID=setTimeout(this._flush,0))}}},{key:\"shutdown\",value:function(){if(this._isShutdown)console.warn(\"Bridge was already shutdown.\");else{this.send(\"shutdown\"),this._isShutdown=!0,this.addListener=function(){},this.emit=function(){},this.removeAllListeners();var de=this._wallUnlisten;de&&de();do this._flush();while(this._messageQueue.length);this._timeoutID!==null&&(clearTimeout(this._timeoutID),this._timeoutID=null)}}},{key:\"wall\",get:function(){return this._wall}}])&&zu(R.prototype,U),H&&zu(R,H),ue}(g);function i0(F,R,U){var H=F[R];return F[R]=function(fe){return U.call(this,H,arguments)},H}function Rs(F,R){for(var U in R)F[U]=R[U]}function a0(F){typeof F.forceUpdate==\"function\"?F.forceUpdate():F.updater!=null&&typeof F.updater.enqueueForceUpdate==\"function\"&&F.updater.enqueueForceUpdate(this,function(){},\"forceUpdate\")}function Hu(F,R){var U=Object.keys(F);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(F);R&&(H=H.filter(function(fe){return Object.getOwnPropertyDescriptor(F,fe).enumerable})),U.push.apply(U,H)}return U}function V0(F){for(var R=1;R<arguments.length;R++){var U=arguments[R]!=null?arguments[R]:{};R%2?Hu(Object(U),!0).forEach(function(H){bu(F,H,U[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(F,Object.getOwnPropertyDescriptors(U)):Hu(Object(U)).forEach(function(H){Object.defineProperty(F,H,Object.getOwnPropertyDescriptor(U,H))})}return F}function bu(F,R,U){return R in F?Object.defineProperty(F,R,{value:U,enumerable:!0,configurable:!0,writable:!0}):F[R]=U,F}function Ns(F){return(Ns=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(R){return typeof R}:function(R){return R&&typeof Symbol==\"function\"&&R.constructor===Symbol&&R!==Symbol.prototype?\"symbol\":typeof R})(F)}function bo(F){var R=null,U=null;if(F._currentElement!=null){F._currentElement.key&&(U=\"\"+F._currentElement.key);var H=F._currentElement.type;typeof H==\"string\"?R=H:typeof H==\"function\"&&(R=Uo(H))}return{displayName:R,key:U}}function P0(F){if(F._currentElement!=null){var R=F._currentElement.type;if(typeof R==\"function\")return F.getPublicInstance()!==null?1:5;if(typeof R==\"string\")return 7}return 9}function ln(F){var R=[];if(Ns(F)===\"object\"){if(!(F._currentElement===null||F._currentElement===!1)){if(F._renderedComponent){var U=F._renderedComponent;P0(U)!==9&&R.push(U)}else if(F._renderedChildren){var H=F._renderedChildren;for(var fe in H){var ue=H[fe];P0(ue)!==9&&R.push(ue)}}}}return R}function lf(F,R,U,H){var fe,ue=new Map,de=new WeakMap,W=new WeakMap,ve=null;function Fe(He){if(Ns(He)!==\"object\"||He===null)throw new Error(\"Invalid internal instance: \"+He);if(!de.has(He)){var Qe=Ss();de.set(He,Qe),ue.set(Qe,He)}return de.get(He)}function Ge(He,Qe){if(He.length!==Qe.length)return!1;for(var Ne=0;Ne<He.length;Ne++)if(He[Ne]!==Qe[Ne])return!1;return!0}U.ComponentTree?(ve=function(He,Qe){var Ne=U.ComponentTree.getClosestInstanceFromNode(He);return de.get(Ne)||null},fe=function(He){var Qe=ue.get(He);return U.ComponentTree.getNodeFromInstance(Qe)}):U.Mount.getID&&U.Mount.getNode&&(ve=function(He,Qe){return null},fe=function(He){return null});var K=[],xe=null;function je(He,Qe,Ne){if(Ne===0){var ft=He._currentElement!=null&&He._currentElement._owner!=null;sn(1),sn(Qe),sn(11),sn(0),sn(ft?1:0)}else{var St=P0(He),Qt=bo(He),Cn=Qt.displayName,bn=Qt.key,p0=He._currentElement!=null&&He._currentElement._owner!=null?Fe(He._currentElement._owner):0,h0=ar(Cn),ci=ar(bn);sn(1),sn(Qe),sn(St),sn(Ne),sn(p0),sn(h0),sn(ci)}}function Xe(He,Qe,Ne){sn(3),sn(Qe);var ft=Ne.map(Fe);sn(ft.length);for(var St=0;St<ft.length;St++)sn(ft[St])}function rt(He,Qe,Ne){var ft=ue.get(He);ft!=null&&(W.set(ft,Ne),je(ft,He,Qe),ln(ft).forEach(function(St){return rt(Fe(St),He,Ne)}))}U.Reconciler&&(xe=function(He,Qe){var Ne={};for(var ft in Qe)Ne[ft]=i0(He,ft,Qe[ft]);return Ne}(U.Reconciler,{mountComponent:function(He,Qe){var Ne=Qe[0],ft=Qe[3];if(P0(Ne)===9)return He.apply(this,Qe);if(ft._topLevelWrapper===void 0)return He.apply(this,Qe);var St=Fe(Ne);je(Ne,St,K.length>0?K[K.length-1]:0),K.push(St),W.set(Ne,Fe(ft._topLevelWrapper));try{var Qt=He.apply(this,Qe);return K.pop(),Qt}catch(bn){throw K=[],bn}finally{if(K.length===0){var Cn=W.get(Ne);if(Cn===void 0)throw new Error(\"Expected to find root ID.\");yn(Cn)}}},performUpdateIfNecessary:function(He,Qe){var Ne=Qe[0];if(P0(Ne)===9)return He.apply(this,Qe);var ft=Fe(Ne);K.push(ft);var St=ln(Ne);try{var Qt=He.apply(this,Qe),Cn=ln(Ne);return Ge(St,Cn)||Xe(Ne,ft,Cn),K.pop(),Qt}catch(p0){throw K=[],p0}finally{if(K.length===0){var bn=W.get(Ne);if(bn===void 0)throw new Error(\"Expected to find root ID.\");yn(bn)}}},receiveComponent:function(He,Qe){var Ne=Qe[0];if(P0(Ne)===9)return He.apply(this,Qe);var ft=Fe(Ne);K.push(ft);var St=ln(Ne);try{var Qt=He.apply(this,Qe),Cn=ln(Ne);return Ge(St,Cn)||Xe(Ne,ft,Cn),K.pop(),Qt}catch(p0){throw K=[],p0}finally{if(K.length===0){var bn=W.get(Ne);if(bn===void 0)throw new Error(\"Expected to find root ID.\");yn(bn)}}},unmountComponent:function(He,Qe){var Ne=Qe[0];if(P0(Ne)===9)return He.apply(this,Qe);var ft=Fe(Ne);K.push(ft);try{var St=He.apply(this,Qe);return K.pop(),function(Cn,bn){wt.push(bn),ue.delete(bn)}(0,ft),St}catch(Cn){throw K=[],Cn}finally{if(K.length===0){var Qt=W.get(Ne);if(Qt===void 0)throw new Error(\"Expected to find root ID.\");yn(Qt)}}}}));var st=[],xt=new Map,wt=[],lt=0,Rt=null;function yn(He){if(st.length!==0||wt.length!==0||Rt!==null){var Qe=wt.length+(Rt===null?0:1),Ne=new Array(3+lt+(Qe>0?2+Qe:0)+st.length),ft=0;if(Ne[ft++]=R,Ne[ft++]=He,Ne[ft++]=lt,xt.forEach(function(Cn,bn){Ne[ft++]=bn.length;for(var p0=Cs(bn),h0=0;h0<p0.length;h0++)Ne[ft+h0]=p0[h0];ft+=bn.length}),Qe>0){Ne[ft++]=2,Ne[ft++]=Qe;for(var St=0;St<wt.length;St++)Ne[ft++]=wt[St];Rt!==null&&(Ne[ft]=Rt,ft++)}for(var Qt=0;Qt<st.length;Qt++)Ne[ft+Qt]=st[Qt];ft+=st.length,F.emit(\"operations\",Ne),st.length=0,wt=[],Rt=null,xt.clear(),lt=0}}function sn(He){st.push(He)}function ar(He){if(He===null)return 0;var Qe=xt.get(He);if(Qe!==void 0)return Qe;var Ne=xt.size+1;return xt.set(He,Ne),lt+=He.length+1,Ne}var rn=null,Hn={};function d0(He){return function(Qe){var Ne=Hn[He];if(!Ne)return!1;for(var ft=0;ft<Qe.length;ft++)if(!(Ne=Ne[Qe[ft]]))return!1;return!0}}function Cr(He){var Qe=ue.get(He);if(Qe==null)return null;var Ne=bo(Qe),ft=Ne.displayName,St=Ne.key,Qt=P0(Qe),Cn=null,bn=null,p0=null,h0=null,ci=null,xi=Qe._currentElement;if(xi!==null){p0=xi.props,ci=xi._source!=null?xi._source:null;var E0=xi._owner;if(E0)for(bn=[];E0!=null;)bn.push({displayName:bo(E0).displayName||\"Unknown\",id:Fe(E0),type:P0(E0)}),E0._currentElement&&(E0=E0._currentElement._owner)}var qr=Qe._instance;return qr!=null&&(Cn=qr.context||null,h0=qr.state||null),{id:He,canEditHooks:!1,canEditFunctionProps:!1,canEditHooksAndDeletePaths:!1,canEditHooksAndRenamePaths:!1,canEditFunctionPropsDeletePaths:!1,canEditFunctionPropsRenamePaths:!1,canToggleSuspense:!1,canViewSource:Qt===1||Qt===5,hasLegacyContext:!0,displayName:ft,type:Qt,key:St!=null?St:null,context:Cn,hooks:null,props:p0,state:h0,owners:bn,source:ci,rootType:null,rendererPackageName:null,rendererVersion:null}}return{cleanup:function(){xe!==null&&(U.Component?Rs(U.Component.Mixin,xe):Rs(U.Reconciler,xe)),xe=null},copyElementPath:function(He,Qe){var Ne=Cr(He);Ne!==null&&qo(Ti(Ne,Qe))},deletePath:function(He,Qe,Ne,ft){var St=ue.get(Qe);if(St!=null){var Qt=St._instance;if(Qt!=null)switch(He){case\"context\":Fu(Qt.context,ft),a0(Qt);break;case\"hooks\":throw new Error(\"Hooks not supported by this renderer\");case\"props\":var Cn=St._currentElement;St._currentElement=V0(V0({},Cn),{},{props:kr(Cn.props,ft)}),a0(Qt);break;case\"state\":Fu(Qt.state,ft),a0(Qt)}}},flushInitialOperations:function(){var He=U.Mount._instancesByReactRootID||U.Mount._instancesByContainerID;for(var Qe in He){var Ne=Fe(He[Qe]);rt(Ne,0,Ne),yn(Ne)}},getBestMatchForTrackedPath:function(){return null},getDisplayNameForFiberID:function(He){var Qe=ue.get(He);return Qe?bo(Qe).displayName:null},getFiberIDForNative:ve,getInstanceAndStyle:function(He){var Qe=null,Ne=null,ft=ue.get(He);if(ft!=null){Qe=ft._instance||null;var St=ft._currentElement;St!=null&&St.props!=null&&(Ne=St.props.style||null)}return{instance:Qe,style:Ne}},findNativeNodesForFiberID:function(He){var Qe=fe(He);return Qe==null?null:[Qe]},getOwnersList:function(He){return null},getPathForElement:function(He){return null},getProfilingData:function(){throw new Error(\"getProfilingData not supported by this renderer\")},handleCommitFiberRoot:function(){throw new Error(\"handleCommitFiberRoot not supported by this renderer\")},handleCommitFiberUnmount:function(){throw new Error(\"handleCommitFiberUnmount not supported by this renderer\")},inspectElement:function(He,Qe){rn!==He&&(rn=He,Hn={});var Ne=Cr(He);return Ne===null?{id:He,type:\"not-found\"}:(Qe!=null&&function(ft){var St=Hn;ft.forEach(function(Qt){St[Qt]||(St[Qt]={}),St=St[Qt]})}(Qe),function(ft){var St=ue.get(ft);if(St!=null)switch(P0(St)){case 1:H.$r=St._instance;break;case 5:var Qt=St._currentElement;if(Qt==null)return void console.warn('Could not find element with id \"'.concat(ft,'\"'));H.$r={props:Qt.props,type:Qt.type};break;default:H.$r=null}else console.warn('Could not find instance with id \"'.concat(ft,'\"'))}(He),Ne.context=qi(Ne.context,d0(\"context\")),Ne.props=qi(Ne.props,d0(\"props\")),Ne.state=qi(Ne.state,d0(\"state\")),{id:He,type:\"full-data\",value:Ne})},logElementToConsole:function(He){var Qe=Cr(He);if(Qe!==null){var Ne=typeof console.groupCollapsed==\"function\";Ne&&console.groupCollapsed(\"[Click to expand] %c<\".concat(Qe.displayName||\"Component\",\" />\"),\"color: var(--dom-tag-name-color); font-weight: normal;\"),Qe.props!==null&&console.log(\"Props:\",Qe.props),Qe.state!==null&&console.log(\"State:\",Qe.state),Qe.context!==null&&console.log(\"Context:\",Qe.context);var ft=fe(He);ft!==null&&console.log(\"Node:\",ft),(window.chrome||/firefox/i.test(navigator.userAgent))&&console.log(\"Right-click any value to save it as a global variable for further inspection.\"),Ne&&console.groupEnd()}else console.warn('Could not find element with id \"'.concat(He,'\"'))},overrideSuspense:function(){throw new Error(\"overrideSuspense not supported by this renderer\")},overrideValueAtPath:function(He,Qe,Ne,ft,St){var Qt=ue.get(Qe);if(Qt!=null){var Cn=Qt._instance;if(Cn!=null)switch(He){case\"context\":fl(Cn.context,ft,St),a0(Cn);break;case\"hooks\":throw new Error(\"Hooks not supported by this renderer\");case\"props\":var bn=Qt._currentElement;Qt._currentElement=V0(V0({},bn),{},{props:si(bn.props,ft,St)}),a0(Cn);break;case\"state\":fl(Cn.state,ft,St),a0(Cn)}}},renamePath:function(He,Qe,Ne,ft,St){var Qt=ue.get(Qe);if(Qt!=null){var Cn=Qt._instance;if(Cn!=null)switch(He){case\"context\":ll(Cn.context,ft,St),a0(Cn);break;case\"hooks\":throw new Error(\"Hooks not supported by this renderer\");case\"props\":var bn=Qt._currentElement;Qt._currentElement=V0(V0({},bn),{},{props:Fr(bn.props,ft,St)}),a0(Cn);break;case\"state\":ll(Cn.state,ft,St),a0(Cn)}}},prepareViewAttributeSource:function(He,Qe){var Ne=Cr(He);Ne!==null&&(window.$attribute=Ti(Ne,Qe))},prepareViewElementSource:function(He){var Qe=ue.get(He);if(Qe!=null){var Ne=Qe._currentElement;Ne!=null?H.$type=Ne.type:console.warn('Could not find element with id \"'.concat(He,'\"'))}else console.warn('Could not find instance with id \"'.concat(He,'\"'))},renderer:U,setTraceUpdatesEnabled:function(He){},setTrackedPath:function(He){},startProfiling:function(){},stopProfiling:function(){},storeAsGlobal:function(He,Qe,Ne){var ft=Cr(He);if(ft!==null){var St=Ti(ft,Qe),Qt=\"$reactTemp\".concat(Ne);window[Qt]=St,console.log(Qt),console.log(St)}},updateComponentFilters:function(He){}}}function nr(F,R){var U=!1,H={bottom:0,left:0,right:0,top:0},fe=R[F];if(fe!=null){for(var ue=0,de=Object.keys(H);ue<de.length;ue++)H[de[ue]]=fe;U=!0}var W=R[F+\"Horizontal\"];if(W!=null)H.left=W,H.right=W,U=!0;else{var ve=R[F+\"Left\"];ve!=null&&(H.left=ve,U=!0);var Fe=R[F+\"Right\"];Fe!=null&&(H.right=Fe,U=!0);var Ge=R[F+\"End\"];Ge!=null&&(H.right=Ge,U=!0);var K=R[F+\"Start\"];K!=null&&(H.left=K,U=!0)}var xe=R[F+\"Vertical\"];if(xe!=null)H.bottom=xe,H.top=xe,U=!0;else{var je=R[F+\"Bottom\"];je!=null&&(H.bottom=je,U=!0);var Xe=R[F+\"Top\"];Xe!=null&&(H.top=Xe,U=!0)}return U?H:null}function rr(F){return(rr=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(R){return typeof R}:function(R){return R&&typeof Symbol==\"function\"&&R.constructor===Symbol&&R!==Symbol.prototype?\"symbol\":typeof R})(F)}function Go(F,R,U){return R in F?Object.defineProperty(F,R,{value:U,enumerable:!0,configurable:!0,writable:!0}):F[R]=U,F}function Gu(F,R,U,H){F.addListener(\"NativeStyleEditor_measure\",function(fe){var ue=fe.id,de=fe.rendererID;Bs(R,F,U,ue,de)}),F.addListener(\"NativeStyleEditor_renameAttribute\",function(fe){var ue=fe.id,de=fe.rendererID,W=fe.oldName,ve=fe.newName,Fe=fe.value;(function(Ge,K,xe,je,Xe,rt){var st,xt=Ge.getInstanceAndStyle({id:K,rendererID:xe});if(!(!xt||!xt.style)){var wt,lt=xt.instance,Rt=xt.style,yn=Xe?(Go(st={},je,void 0),Go(st,Xe,rt),st):Go({},je,void 0);if(lt!==null&&typeof lt.setNativeProps==\"function\"){var sn=cu.get(K);sn?Object.assign(sn,yn):cu.set(K,yn),lt.setNativeProps({style:yn})}else if(Array.isArray(Rt)){var ar=Rt.length-1;rr(Rt[ar])!==\"object\"||Array.isArray(Rt[ar])?Ge.overrideValueAtPath({type:\"props\",id:K,rendererID:xe,path:[\"style\"],value:Rt.concat([yn])}):(delete(wt=Vu(Rt[ar]))[je],Xe?wt[Xe]=rt:wt[je]=void 0,Ge.overrideValueAtPath({type:\"props\",id:K,rendererID:xe,path:[\"style\",ar],value:wt}))}else rr(Rt)===\"object\"?(delete(wt=Vu(Rt))[je],Xe?wt[Xe]=rt:wt[je]=void 0,Ge.overrideValueAtPath({type:\"props\",id:K,rendererID:xe,path:[\"style\"],value:wt})):Ge.overrideValueAtPath({type:\"props\",id:K,rendererID:xe,path:[\"style\"],value:[Rt,yn]});Ge.emit(\"hideNativeHighlight\")}})(R,ue,de,W,ve,Fe),setTimeout(function(){return Bs(R,F,U,ue,de)})}),F.addListener(\"NativeStyleEditor_setValue\",function(fe){var ue=fe.id,de=fe.rendererID,W=fe.name,ve=fe.value;(function(Fe,Ge,K,xe,je){var Xe=Fe.getInstanceAndStyle({id:Ge,rendererID:K});if(!(!Xe||!Xe.style)){var rt=Xe.instance,st=Xe.style,xt=Go({},xe,je);if(rt!==null&&typeof rt.setNativeProps==\"function\"){var wt=cu.get(Ge);wt?Object.assign(wt,xt):cu.set(Ge,xt),rt.setNativeProps({style:xt})}else if(Array.isArray(st)){var lt=st.length-1;rr(st[lt])!==\"object\"||Array.isArray(st[lt])?Fe.overrideValueAtPath({type:\"props\",id:Ge,rendererID:K,path:[\"style\"],value:st.concat([xt])}):Fe.overrideValueAtPath({type:\"props\",id:Ge,rendererID:K,path:[\"style\",lt,xe],value:je})}else Fe.overrideValueAtPath({type:\"props\",id:Ge,rendererID:K,path:[\"style\"],value:[st,xt]});Fe.emit(\"hideNativeHighlight\")}})(R,ue,de,W,ve),setTimeout(function(){return Bs(R,F,U,ue,de)})}),F.send(\"isNativeStyleEditorSupported\",{isSupported:!0,validAttributes:H})}var yl={top:0,left:0,right:0,bottom:0},cu=new Map;function Bs(F,R,U,H,fe){var ue=F.getInstanceAndStyle({id:H,rendererID:fe});if(ue&&ue.style){var de=ue.instance,W=U(ue.style),ve=cu.get(H);ve!=null&&(W=Object.assign({},W,ve)),de&&typeof de.measure==\"function\"?de.measure(function(Fe,Ge,K,xe,je,Xe){if(typeof Fe==\"number\"){var rt=W!=null&&nr(\"margin\",W)||yl,st=W!=null&&nr(\"padding\",W)||yl;R.send(\"NativeStyleEditor_styleAndLayout\",{id:H,layout:{x:Fe,y:Ge,width:K,height:xe,left:je,top:Xe,margin:rt,padding:st},style:W||null})}else R.send(\"NativeStyleEditor_styleAndLayout\",{id:H,layout:null,style:W||null})}):R.send(\"NativeStyleEditor_styleAndLayout\",{id:H,layout:null,style:W||null})}else R.send(\"NativeStyleEditor_styleAndLayout\",{id:H,layout:null,style:null})}function Vu(F){var R={};for(var U in F)R[U]=F[U];return R}(function(F){if(F.hasOwnProperty(\"__REACT_DEVTOOLS_GLOBAL_HOOK__\"))return null;var R=0,U=!1,H={},fe=new Map,ue={},de=new Map,W={rendererInterfaces:fe,listeners:ue,renderers:de,emit:function(ve,Fe){ue[ve]&&ue[ve].map(function(Ge){return Ge(Fe)})},getFiberRoots:function(ve){var Fe=H;return Fe[ve]||(Fe[ve]=new Set),Fe[ve]},inject:function(ve){var Fe=++R;de.set(Fe,ve);var Ge=U?\"deadcode\":function(rt){try{if(typeof rt.version==\"string\")return rt.bundleType>0?\"development\":\"production\";var st=Function.prototype.toString;if(rt.Mount&&rt.Mount._renderNewRootComponent){var xt=st.call(rt.Mount._renderNewRootComponent);return xt.indexOf(\"function\")!==0?\"production\":xt.indexOf(\"storedMeasure\")!==-1?\"development\":xt.indexOf(\"should be a pure function\")!==-1?xt.indexOf(\"NODE_ENV\")!==-1||xt.indexOf(\"development\")!==-1||xt.indexOf(\"true\")!==-1?\"development\":xt.indexOf(\"nextElement\")!==-1||xt.indexOf(\"nextComponent\")!==-1?\"unminified\":\"development\":xt.indexOf(\"nextElement\")!==-1||xt.indexOf(\"nextComponent\")!==-1?\"unminified\":\"outdated\"}}catch(wt){}return\"production\"}(ve);try{var K=window.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__!==!1,xe=window.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__===!0;(K||xe)&&(zi(ve),Ho({appendComponentStack:K,breakOnConsoleErrors:xe}))}catch(rt){}var je=F.__REACT_DEVTOOLS_ATTACH__;if(typeof je==\"function\"){var Xe=je(W,Fe,ve,F);W.rendererInterfaces.set(Fe,Xe)}return W.emit(\"renderer\",{id:Fe,renderer:ve,reactBuildType:Ge}),Fe},on:function(ve,Fe){ue[ve]||(ue[ve]=[]),ue[ve].push(Fe)},off:function(ve,Fe){if(ue[ve]){var Ge=ue[ve].indexOf(Fe);Ge!==-1&&ue[ve].splice(Ge,1),ue[ve].length||delete ue[ve]}},sub:function(ve,Fe){return W.on(ve,Fe),function(){return W.off(ve,Fe)}},supportsFiber:!0,checkDCE:function(ve){try{Function.prototype.toString.call(ve).indexOf(\"^_^\")>-1&&(U=!0,setTimeout(function(){throw new Error(\"React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build\")}))}catch(Fe){}},onCommitFiberUnmount:function(ve,Fe){var Ge=fe.get(ve);Ge!=null&&Ge.handleCommitFiberUnmount(Fe)},onCommitFiberRoot:function(ve,Fe,Ge){var K=W.getFiberRoots(ve),xe=Fe.current,je=K.has(Fe),Xe=xe.memoizedState==null||xe.memoizedState.element==null;je||Xe?je&&Xe&&K.delete(Fe):K.add(Fe);var rt=fe.get(ve);rt!=null&&rt.handleCommitFiberRoot(Fe,Ge)}};Object.defineProperty(F,\"__REACT_DEVTOOLS_GLOBAL_HOOK__\",{configurable:!1,enumerable:!1,get:function(){return W}})})(window);var M0=window.__REACT_DEVTOOLS_GLOBAL_HOOK__,au=[{type:1,value:7,isEnabled:!0}];function Lr(F){if(M0!=null){var R=F||{},U=R.host,H=U===void 0?\"localhost\":U,fe=R.nativeStyleEditorValidAttributes,ue=R.useHttps,de=ue!==void 0&&ue,W=R.port,ve=W===void 0?8097:W,Fe=R.websocket,Ge=R.resolveRNStyle,K=Ge===void 0?null:Ge,xe=R.isAppActive,je=de?\"wss\":\"ws\",Xe=null;if((xe===void 0?function(){return!0}:xe)()){var rt=null,st=[],xt=je+\"://\"+H+\":\"+ve,wt=Fe||new window.WebSocket(xt);wt.onclose=function(){rt!==null&&rt.emit(\"shutdown\"),lt()},wt.onerror=function(){lt()},wt.onmessage=function(Rt){var yn;try{if(typeof Rt.data!=\"string\")throw Error();yn=JSON.parse(Rt.data)}catch(sn){return void console.error(\"[React DevTools] Failed to parse JSON: \"+Rt.data)}st.forEach(function(sn){try{sn(yn)}catch(ar){throw console.log(\"[React DevTools] Error calling listener\",yn),console.log(\"error:\",ar),ar}})},wt.onopen=function(){(rt=new Do({listen:function(rn){return st.push(rn),function(){var Hn=st.indexOf(rn);Hn>=0&&st.splice(Hn,1)}},send:function(rn,Hn,d0){wt.readyState===wt.OPEN?wt.send(JSON.stringify({event:rn,payload:Hn})):(rt!==null&&rt.shutdown(),lt())}})).addListener(\"inspectElement\",function(rn){var Hn=rn.id,d0=rn.rendererID,Cr=Rt.rendererInterfaces[d0];if(Cr!=null){var He=Cr.findNativeNodesForFiberID(Hn);He!=null&&He[0]!=null&&Rt.emit(\"showNativeHighlight\",He[0])}}),rt.addListener(\"updateComponentFilters\",function(rn){au=rn}),window.__REACT_DEVTOOLS_COMPONENT_FILTERS__==null&&rt.send(\"overrideComponentFilters\",au);var Rt=new I0(rt);if(Rt.addListener(\"shutdown\",function(){M0.emit(\"shutdown\")}),function(rn,Hn,d0){if(rn==null)return function(){};var Cr=[rn.sub(\"renderer-attached\",function(Ne){var ft=Ne.id,St=(Ne.renderer,Ne.rendererInterface);Hn.setRendererInterface(ft,St),St.flushInitialOperations()}),rn.sub(\"unsupported-renderer-version\",function(Ne){Hn.onUnsupportedRenderer(Ne)}),rn.sub(\"operations\",Hn.onHookOperations),rn.sub(\"traceUpdates\",Hn.onTraceUpdates)],He=function(Ne,ft){var St=rn.rendererInterfaces.get(Ne);St==null&&(typeof ft.findFiberByHostInstance==\"function\"?St=uf(rn,Ne,ft,d0):ft.ComponentTree&&(St=lf(rn,Ne,ft,d0)),St!=null&&rn.rendererInterfaces.set(Ne,St)),St!=null?rn.emit(\"renderer-attached\",{id:Ne,renderer:ft,rendererInterface:St}):rn.emit(\"unsupported-renderer-version\",Ne)};rn.renderers.forEach(function(Ne,ft){He(ft,Ne)}),Cr.push(rn.sub(\"renderer\",function(Ne){var ft=Ne.id,St=Ne.renderer;He(ft,St)})),rn.emit(\"react-devtools\",Hn),rn.reactDevtoolsAgent=Hn;var Qe=function(){Cr.forEach(function(Ne){return Ne()}),rn.rendererInterfaces.forEach(function(Ne){Ne.cleanup()}),rn.reactDevtoolsAgent=null};Hn.addListener(\"shutdown\",Qe),Cr.push(function(){Hn.removeListener(\"shutdown\",Qe)})}(M0,Rt,window),K!=null||M0.resolveRNStyle!=null)Gu(rt,Rt,K||M0.resolveRNStyle,fe||M0.nativeStyleEditorValidAttributes||null);else{var yn,sn,ar=function(){rt!==null&&Gu(rt,Rt,yn,sn)};M0.hasOwnProperty(\"resolveRNStyle\")||Object.defineProperty(M0,\"resolveRNStyle\",{enumerable:!1,get:function(){return yn},set:function(rn){yn=rn,ar()}}),M0.hasOwnProperty(\"nativeStyleEditorValidAttributes\")||Object.defineProperty(M0,\"nativeStyleEditorValidAttributes\",{enumerable:!1,get:function(){return sn},set:function(rn){sn=rn,ar()}})}}}else lt()}function lt(){Xe===null&&(Xe=setTimeout(function(){return Lr(F)},2e3))}}}])})});var rS=Me(nS=>{\"use strict\";Object.defineProperty(nS,\"__esModule\",{value:!0});eS();var _j=tS();_j.connectToDevTools()});var lS=Me(x2=>{\"use strict\";var iS=x2&&x2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(x2,\"__esModule\",{value:!0});var oS=Ay(),yj=iS(lE()),uS=iS(hc()),no=Xy();process.env.DEV===\"true\"&&rS();var sS=i=>{i==null||i.unsetMeasureFunc(),i==null||i.freeRecursive()};x2.default=yj.default({schedulePassiveEffects:oS.unstable_scheduleCallback,cancelPassiveEffects:oS.unstable_cancelCallback,now:Date.now,getRootHostContext:()=>({isInsideText:!1}),prepareForCommit:()=>{},resetAfterCommit:i=>{if(i.isStaticDirty){i.isStaticDirty=!1,typeof i.onImmediateRender==\"function\"&&i.onImmediateRender();return}typeof i.onRender==\"function\"&&i.onRender()},getChildHostContext:(i,u)=>{let f=i.isInsideText,c=u===\"ink-text\"||u===\"ink-virtual-text\";return f===c?i:{isInsideText:c}},shouldSetTextContent:()=>!1,createInstance:(i,u,f,c)=>{if(c.isInsideText&&i===\"ink-box\")throw new Error(\"<Box> can\\u2019t be nested inside <Text> component\");let g=i===\"ink-text\"&&c.isInsideText?\"ink-virtual-text\":i,t=no.createNode(g);for(let[C,A]of Object.entries(u))C!==\"children\"&&(C===\"style\"?no.setStyle(t,A):C===\"internal_transform\"?t.internal_transform=A:C===\"internal_static\"?t.internal_static=!0:no.setAttribute(t,C,A));return t},createTextInstance:(i,u,f)=>{if(!f.isInsideText)throw new Error(`Text string \"${i}\" must be rendered inside <Text> component`);return no.createTextNode(i)},resetTextContent:()=>{},hideTextInstance:i=>{no.setTextNodeValue(i,\"\")},unhideTextInstance:(i,u)=>{no.setTextNodeValue(i,u)},getPublicInstance:i=>i,hideInstance:i=>{var u;(u=i.yogaNode)===null||u===void 0||u.setDisplay(uS.default.DISPLAY_NONE)},unhideInstance:i=>{var u;(u=i.yogaNode)===null||u===void 0||u.setDisplay(uS.default.DISPLAY_FLEX)},appendInitialChild:no.appendChildNode,appendChild:no.appendChildNode,insertBefore:no.insertBeforeNode,finalizeInitialChildren:(i,u,f,c)=>(i.internal_static&&(c.isStaticDirty=!0,c.staticNode=i),!1),supportsMutation:!0,appendChildToContainer:no.appendChildNode,insertInContainerBefore:no.insertBeforeNode,removeChildFromContainer:(i,u)=>{no.removeChildNode(i,u),sS(u.yogaNode)},prepareUpdate:(i,u,f,c,g)=>{i.internal_static&&(g.isStaticDirty=!0);let t={},C=Object.keys(c);for(let A of C)if(c[A]!==f[A]){if(A===\"style\"&&typeof c.style==\"object\"&&typeof f.style==\"object\"){let D=c.style,L=f.style,N=Object.keys(D);for(let j of N){if(j===\"borderStyle\"||j===\"borderColor\"){if(typeof t.style!=\"object\"){let $={};t.style=$}t.style.borderStyle=D.borderStyle,t.style.borderColor=D.borderColor}if(D[j]!==L[j]){if(typeof t.style!=\"object\"){let $={};t.style=$}t.style[j]=D[j]}}continue}t[A]=c[A]}return t},commitUpdate:(i,u)=>{for(let[f,c]of Object.entries(u))f!==\"children\"&&(f===\"style\"?no.setStyle(i,c):f===\"internal_transform\"?i.internal_transform=c:f===\"internal_static\"?i.internal_static=!0:no.setAttribute(i,f,c))},commitTextUpdate:(i,u,f)=>{no.setTextNodeValue(i,f)},removeChild:(i,u)=>{no.removeChildNode(i,u),sS(u.yogaNode)}})});var cS=Me((Jb,fS)=>{\"use strict\";fS.exports=(i,u=1,f)=>{if(f=dt({indent:\" \",includeEmptyLines:!1},f),typeof i!=\"string\")throw new TypeError(`Expected \\`input\\` to be a \\`string\\`, got \\`${typeof i}\\``);if(typeof u!=\"number\")throw new TypeError(`Expected \\`count\\` to be a \\`number\\`, got \\`${typeof u}\\``);if(typeof f.indent!=\"string\")throw new TypeError(`Expected \\`options.indent\\` to be a \\`string\\`, got \\`${typeof f.indent}\\``);if(u===0)return i;let c=f.includeEmptyLines?/^/gm:/^(?!\\s*$)/gm;return i.replace(c,f.indent.repeat(u))}});var aS=Me(k2=>{\"use strict\";var wj=k2&&k2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(k2,\"__esModule\",{value:!0});var Vh=wj(hc());k2.default=i=>i.getComputedWidth()-i.getComputedPadding(Vh.default.EDGE_LEFT)-i.getComputedPadding(Vh.default.EDGE_RIGHT)-i.getComputedBorder(Vh.default.EDGE_LEFT)-i.getComputedBorder(Vh.default.EDGE_RIGHT)});var pS=Me((Zb,dS)=>{dS.exports={single:{topLeft:\"\\u250C\",topRight:\"\\u2510\",bottomRight:\"\\u2518\",bottomLeft:\"\\u2514\",vertical:\"\\u2502\",horizontal:\"\\u2500\"},double:{topLeft:\"\\u2554\",topRight:\"\\u2557\",bottomRight:\"\\u255D\",bottomLeft:\"\\u255A\",vertical:\"\\u2551\",horizontal:\"\\u2550\"},round:{topLeft:\"\\u256D\",topRight:\"\\u256E\",bottomRight:\"\\u256F\",bottomLeft:\"\\u2570\",vertical:\"\\u2502\",horizontal:\"\\u2500\"},bold:{topLeft:\"\\u250F\",topRight:\"\\u2513\",bottomRight:\"\\u251B\",bottomLeft:\"\\u2517\",vertical:\"\\u2503\",horizontal:\"\\u2501\"},singleDouble:{topLeft:\"\\u2553\",topRight:\"\\u2556\",bottomRight:\"\\u255C\",bottomLeft:\"\\u2559\",vertical:\"\\u2551\",horizontal:\"\\u2500\"},doubleSingle:{topLeft:\"\\u2552\",topRight:\"\\u2555\",bottomRight:\"\\u255B\",bottomLeft:\"\\u2558\",vertical:\"\\u2502\",horizontal:\"\\u2550\"},classic:{topLeft:\"+\",topRight:\"+\",bottomRight:\"+\",bottomLeft:\"+\",vertical:\"|\",horizontal:\"-\"}}});var mS=Me((eG,m3)=>{\"use strict\";var hS=pS();m3.exports=hS;m3.exports.default=hS});var gS=Me((tG,vS)=>{\"use strict\";vS.exports=(i,u=process.argv)=>{let f=i.startsWith(\"-\")?\"\":i.length===1?\"-\":\"--\",c=u.indexOf(f+i),g=u.indexOf(\"--\");return c!==-1&&(g===-1||c<g)}});var wS=Me((nG,_S)=>{\"use strict\";var Dj=require(\"os\"),yS=require(\"tty\"),Pu=gS(),{env:oi}=process,qf;Pu(\"no-color\")||Pu(\"no-colors\")||Pu(\"color=false\")||Pu(\"color=never\")?qf=0:(Pu(\"color\")||Pu(\"colors\")||Pu(\"color=true\")||Pu(\"color=always\"))&&(qf=1);\"FORCE_COLOR\"in oi&&(oi.FORCE_COLOR===\"true\"?qf=1:oi.FORCE_COLOR===\"false\"?qf=0:qf=oi.FORCE_COLOR.length===0?1:Math.min(parseInt(oi.FORCE_COLOR,10),3));function v3(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function g3(i,u){if(qf===0)return 0;if(Pu(\"color=16m\")||Pu(\"color=full\")||Pu(\"color=truecolor\"))return 3;if(Pu(\"color=256\"))return 2;if(i&&!u&&qf===void 0)return 0;let f=qf||0;if(oi.TERM===\"dumb\")return f;if(process.platform===\"win32\"){let c=Dj.release().split(\".\");return Number(c[0])>=10&&Number(c[2])>=10586?Number(c[2])>=14931?3:2:1}if(\"CI\"in oi)return[\"TRAVIS\",\"CIRCLECI\",\"APPVEYOR\",\"GITLAB_CI\"].some(c=>c in oi)||oi.CI_NAME===\"codeship\"?1:f;if(\"TEAMCITY_VERSION\"in oi)return/^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(oi.TEAMCITY_VERSION)?1:0;if(\"GITHUB_ACTIONS\"in oi)return 1;if(oi.COLORTERM===\"truecolor\")return 3;if(\"TERM_PROGRAM\"in oi){let c=parseInt((oi.TERM_PROGRAM_VERSION||\"\").split(\".\")[0],10);switch(oi.TERM_PROGRAM){case\"iTerm.app\":return c>=3?3:2;case\"Apple_Terminal\":return 2}}return/-256(color)?$/i.test(oi.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(oi.TERM)||\"COLORTERM\"in oi?1:f}function Ej(i){let u=g3(i,i&&i.isTTY);return v3(u)}_S.exports={supportsColor:Ej,stdout:v3(g3(!0,yS.isatty(1))),stderr:v3(g3(!0,yS.isatty(2)))}});var ES=Me((rG,DS)=>{\"use strict\";var Sj=(i,u,f)=>{let c=i.indexOf(u);if(c===-1)return i;let g=u.length,t=0,C=\"\";do C+=i.substr(t,c-t)+u+f,t=c+g,c=i.indexOf(u,t);while(c!==-1);return C+=i.substr(t),C},Cj=(i,u,f,c)=>{let g=0,t=\"\";do{let C=i[c-1]===\"\\r\";t+=i.substr(g,(C?c-1:c)-g)+u+(C?`\\r\n`:`\n`)+f,g=c+1,c=i.indexOf(`\n`,g)}while(c!==-1);return t+=i.substr(g),t};DS.exports={stringReplaceAll:Sj,stringEncaseCRLFWithFirstIndex:Cj}});var kS=Me((iG,SS)=>{\"use strict\";var Tj=/(?:\\\\(u(?:[a-f\\d]{4}|\\{[a-f\\d]{1,6}\\})|x[a-f\\d]{2}|.))|(?:\\{(~)?(\\w+(?:\\([^)]*\\))?(?:\\.\\w+(?:\\([^)]*\\))?)*)(?:[ \\t]|(?=\\r?\\n)))|(\\})|((?:.|[\\r\\n\\f])+?)/gi,CS=/(?:^|\\.)(\\w+)(?:\\(([^)]*)\\))?/g,xj=/^(['\"])((?:\\\\.|(?!\\1)[^\\\\])*)\\1$/,kj=/\\\\(u(?:[a-f\\d]{4}|{[a-f\\d]{1,6}})|x[a-f\\d]{2}|.)|([^\\\\])/gi,Aj=new Map([[\"n\",`\n`],[\"r\",\"\\r\"],[\"t\",\"\t\"],[\"b\",\"\\b\"],[\"f\",\"\\f\"],[\"v\",\"\\v\"],[\"0\",\"\\0\"],[\"\\\\\",\"\\\\\"],[\"e\",\"\u001b\"],[\"a\",\"\\x07\"]]);function TS(i){let u=i[0]===\"u\",f=i[1]===\"{\";return u&&!f&&i.length===5||i[0]===\"x\"&&i.length===3?String.fromCharCode(parseInt(i.slice(1),16)):u&&f?String.fromCodePoint(parseInt(i.slice(2,-1),16)):Aj.get(i)||i}function Oj(i,u){let f=[],c=u.trim().split(/\\s*,\\s*/g),g;for(let t of c){let C=Number(t);if(!Number.isNaN(C))f.push(C);else if(g=t.match(xj))f.push(g[2].replace(kj,(A,x,D)=>x?TS(x):D));else throw new Error(`Invalid Chalk template style argument: ${t} (in style '${i}')`)}return f}function Ij(i){CS.lastIndex=0;let u=[],f;for(;(f=CS.exec(i))!==null;){let c=f[1];if(f[2]){let g=Oj(c,f[2]);u.push([c].concat(g))}else u.push([c])}return u}function xS(i,u){let f={};for(let g of u)for(let t of g.styles)f[t[0]]=g.inverse?null:t.slice(1);let c=i;for(let[g,t]of Object.entries(f))if(!!Array.isArray(t)){if(!(g in c))throw new Error(`Unknown Chalk style: ${g}`);c=t.length>0?c[g](...t):c[g]}return c}SS.exports=(i,u)=>{let f=[],c=[],g=[];if(u.replace(Tj,(t,C,A,x,D,L)=>{if(C)g.push(TS(C));else if(x){let N=g.join(\"\");g=[],c.push(f.length===0?N:xS(i,f)(N)),f.push({inverse:A,styles:Ij(x)})}else if(D){if(f.length===0)throw new Error(\"Found extraneous } in Chalk template literal\");c.push(xS(i,f)(g.join(\"\"))),g=[],f.pop()}else g.push(L)}),c.push(g.join(\"\")),f.length>0){let t=`Chalk template literal is missing ${f.length} closing bracket${f.length===1?\"\":\"s\"} (\\`}\\`)`;throw new Error(t)}return c.join(\"\")}});var Jh=Me((oG,AS)=>{\"use strict\";var A2=Rh(),{stdout:_3,stderr:y3}=wS(),{stringReplaceAll:Pj,stringEncaseCRLFWithFirstIndex:Mj}=ES(),{isArray:Yh}=Array,OS=[\"ansi\",\"ansi\",\"ansi256\",\"ansi16m\"],ka=Object.create(null),Fj=(i,u={})=>{if(u.level&&!(Number.isInteger(u.level)&&u.level>=0&&u.level<=3))throw new Error(\"The `level` option should be an integer from 0 to 3\");let f=_3?_3.level:0;i.level=u.level===void 0?f:u.level},IS=class{constructor(u){return PS(u)}},PS=i=>{let u={};return Fj(u,i),u.template=(...f)=>MS(u.template,...f),Object.setPrototypeOf(u,$h.prototype),Object.setPrototypeOf(u.template,u),u.template.constructor=()=>{throw new Error(\"`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.\")},u.template.Instance=IS,u.template};function $h(i){return PS(i)}for(let[i,u]of Object.entries(A2))ka[i]={get(){let f=Kh(this,w3(u.open,u.close,this._styler),this._isEmpty);return Object.defineProperty(this,i,{value:f}),f}};ka.visible={get(){let i=Kh(this,this._styler,!0);return Object.defineProperty(this,\"visible\",{value:i}),i}};var LS=[\"rgb\",\"hex\",\"keyword\",\"hsl\",\"hsv\",\"hwb\",\"ansi\",\"ansi256\"];for(let i of LS)ka[i]={get(){let{level:u}=this;return function(...f){let c=w3(A2.color[OS[u]][i](...f),A2.color.close,this._styler);return Kh(this,c,this._isEmpty)}}};for(let i of LS){let u=\"bg\"+i[0].toUpperCase()+i.slice(1);ka[u]={get(){let{level:f}=this;return function(...c){let g=w3(A2.bgColor[OS[f]][i](...c),A2.bgColor.close,this._styler);return Kh(this,g,this._isEmpty)}}}}var Lj=Object.defineProperties(()=>{},zn(dt({},ka),{level:{enumerable:!0,get(){return this._generator.level},set(i){this._generator.level=i}}})),w3=(i,u,f)=>{let c,g;return f===void 0?(c=i,g=u):(c=f.openAll+i,g=u+f.closeAll),{open:i,close:u,openAll:c,closeAll:g,parent:f}},Kh=(i,u,f)=>{let c=(...g)=>Yh(g[0])&&Yh(g[0].raw)?RS(c,MS(c,...g)):RS(c,g.length===1?\"\"+g[0]:g.join(\" \"));return Object.setPrototypeOf(c,Lj),c._generator=i,c._styler=u,c._isEmpty=f,c},RS=(i,u)=>{if(i.level<=0||!u)return i._isEmpty?\"\":u;let f=i._styler;if(f===void 0)return u;let{openAll:c,closeAll:g}=f;if(u.indexOf(\"\u001b\")!==-1)for(;f!==void 0;)u=Pj(u,f.close,f.open),f=f.parent;let t=u.indexOf(`\n`);return t!==-1&&(u=Mj(u,g,c,t)),c+u+g},D3,MS=(i,...u)=>{let[f]=u;if(!Yh(f)||!Yh(f.raw))return u.join(\" \");let c=u.slice(1),g=[f.raw[0]];for(let t=1;t<f.length;t++)g.push(String(c[t-1]).replace(/[{}\\\\]/g,\"\\\\$&\"),String(f.raw[t]));return D3===void 0&&(D3=kS()),D3(i,g.join(\"\"))};Object.defineProperties($h.prototype,ka);var Xh=$h();Xh.supportsColor=_3;Xh.stderr=$h({level:y3?y3.level:0});Xh.stderr.supportsColor=y3;AS.exports=Xh});var E3=Me(O2=>{\"use strict\";var Rj=O2&&O2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(O2,\"__esModule\",{value:!0});var I2=Rj(Jh()),Nj=/^(rgb|hsl|hsv|hwb)\\(\\s?(\\d+),\\s?(\\d+),\\s?(\\d+)\\s?\\)$/,Bj=/^(ansi|ansi256)\\(\\s?(\\d+)\\s?\\)$/,Qh=(i,u)=>u===\"foreground\"?i:\"bg\"+i[0].toUpperCase()+i.slice(1);O2.default=(i,u,f)=>{if(!u)return i;if(u in I2.default){let g=Qh(u,f);return I2.default[g](i)}if(u.startsWith(\"#\")){let g=Qh(\"hex\",f);return I2.default[g](u)(i)}if(u.startsWith(\"ansi\")){let g=Bj.exec(u);if(!g)return i;let t=Qh(g[1],f),C=Number(g[2]);return I2.default[t](C)(i)}if(u.startsWith(\"rgb\")||u.startsWith(\"hsl\")||u.startsWith(\"hsv\")||u.startsWith(\"hwb\")){let g=Nj.exec(u);if(!g)return i;let t=Qh(g[1],f),C=Number(g[2]),A=Number(g[3]),x=Number(g[4]);return I2.default[t](C,A,x)(i)}return i}});var BS=Me(P2=>{\"use strict\";var NS=P2&&P2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(P2,\"__esModule\",{value:!0});var jj=NS(mS()),S3=NS(E3());P2.default=(i,u,f,c)=>{if(typeof f.style.borderStyle==\"string\"){let g=f.yogaNode.getComputedWidth(),t=f.yogaNode.getComputedHeight(),C=f.style.borderColor,A=jj.default[f.style.borderStyle],x=S3.default(A.topLeft+A.horizontal.repeat(g-2)+A.topRight,C,\"foreground\"),D=(S3.default(A.vertical,C,\"foreground\")+`\n`).repeat(t-2),L=S3.default(A.bottomLeft+A.horizontal.repeat(g-2)+A.bottomRight,C,\"foreground\");c.write(i,u,x,{transformers:[]}),c.write(i,u+1,D,{transformers:[]}),c.write(i+g-1,u+1,D,{transformers:[]}),c.write(i,u+t-1,L,{transformers:[]})}}});var US=Me(M2=>{\"use strict\";var _c=M2&&M2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(M2,\"__esModule\",{value:!0});var Uj=_c(hc()),qj=_c(jy()),zj=_c(cS()),Wj=_c(Yy()),Hj=_c(aS()),bj=_c(Ky()),Gj=_c(BS()),Vj=(i,u)=>{var f;let c=(f=i.childNodes[0])===null||f===void 0?void 0:f.yogaNode;if(c){let g=c.getComputedLeft(),t=c.getComputedTop();u=`\n`.repeat(t)+zj.default(u,g)}return u},jS=(i,u,f)=>{var c;let{offsetX:g=0,offsetY:t=0,transformers:C=[],skipStaticElements:A}=f;if(A&&i.internal_static)return;let{yogaNode:x}=i;if(x){if(x.getDisplay()===Uj.default.DISPLAY_NONE)return;let D=g+x.getComputedLeft(),L=t+x.getComputedTop(),N=C;if(typeof i.internal_transform==\"function\"&&(N=[i.internal_transform,...C]),i.nodeName===\"ink-text\"){let j=bj.default(i);if(j.length>0){let $=qj.default(j),h=Hj.default(x);if($>h){let re=(c=i.style.textWrap)!==null&&c!==void 0?c:\"wrap\";j=Wj.default(j,h,re)}j=Vj(i,j),u.write(D,L,j,{transformers:N})}return}if(i.nodeName===\"ink-box\"&&Gj.default(D,L,i,u),i.nodeName===\"ink-root\"||i.nodeName===\"ink-box\")for(let j of i.childNodes)jS(j,u,{offsetX:D,offsetY:L,transformers:N,skipStaticElements:A})}};M2.default=jS});var zS=Me((fG,qS)=>{\"use strict\";qS.exports=i=>{i=Object.assign({onlyFirst:!1},i);let u=[\"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:[a-zA-Z\\\\d]*(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)\",\"(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-ntqry=><~]))\"].join(\"|\");return new RegExp(u,i.onlyFirst?void 0:\"g\")}});var HS=Me((cG,C3)=>{\"use strict\";var Yj=zS(),WS=i=>typeof i==\"string\"?i.replace(Yj(),\"\"):i;C3.exports=WS;C3.exports.default=WS});var VS=Me((aG,bS)=>{\"use strict\";var GS=\"[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]\";bS.exports=i=>i&&i.exact?new RegExp(`^${GS}$`):new RegExp(GS,\"g\")});var $S=Me((dG,T3)=>{\"use strict\";var $j=HS(),Kj=VS(),YS=i=>$j(i).replace(Kj(),\" \").length;T3.exports=YS;T3.exports.default=YS});var QS=Me(F2=>{\"use strict\";var KS=F2&&F2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(F2,\"__esModule\",{value:!0});var XS=KS(Gy()),Xj=KS($S()),JS=class{constructor(u){this.writes=[];let{width:f,height:c}=u;this.width=f,this.height=c}write(u,f,c,g){let{transformers:t}=g;!c||this.writes.push({x:u,y:f,text:c,transformers:t})}get(){let u=[];for(let c=0;c<this.height;c++)u.push(\" \".repeat(this.width));for(let c of this.writes){let{x:g,y:t,text:C,transformers:A}=c,x=C.split(`\n`),D=0;for(let L of x){let N=u[t+D];if(!N)continue;let j=Xj.default(L);for(let $ of A)L=$(L);u[t+D]=XS.default(N,0,g)+L+XS.default(N,g+j),D++}}return{output:u.map(c=>c.trimRight()).join(`\n`),height:u.length}}};F2.default=JS});var t5=Me(L2=>{\"use strict\";var x3=L2&&L2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(L2,\"__esModule\",{value:!0});var Jj=x3(hc()),ZS=x3(US()),e5=x3(QS());L2.default=(i,u)=>{var f;if(i.yogaNode.setWidth(u),i.yogaNode){i.yogaNode.calculateLayout(void 0,void 0,Jj.default.DIRECTION_LTR);let c=new e5.default({width:i.yogaNode.getComputedWidth(),height:i.yogaNode.getComputedHeight()});ZS.default(i,c,{skipStaticElements:!0});let g;((f=i.staticNode)===null||f===void 0?void 0:f.yogaNode)&&(g=new e5.default({width:i.staticNode.yogaNode.getComputedWidth(),height:i.staticNode.yogaNode.getComputedHeight()}),ZS.default(i.staticNode,g,{skipStaticElements:!1}));let{output:t,height:C}=c.get();return{output:t,outputHeight:C,staticOutput:g?`${g.get().output}\n`:\"\"}}return{output:\"\",outputHeight:0,staticOutput:\"\"}}});var o5=Me((mG,n5)=>{\"use strict\";var r5=require(\"stream\"),i5=[\"assert\",\"count\",\"countReset\",\"debug\",\"dir\",\"dirxml\",\"error\",\"group\",\"groupCollapsed\",\"groupEnd\",\"info\",\"log\",\"table\",\"time\",\"timeEnd\",\"timeLog\",\"trace\",\"warn\"],k3={},Qj=i=>{let u=new r5.PassThrough,f=new r5.PassThrough;u.write=g=>i(\"stdout\",g),f.write=g=>i(\"stderr\",g);let c=new console.Console(u,f);for(let g of i5)k3[g]=console[g],console[g]=c[g];return()=>{for(let g of i5)console[g]=k3[g];k3={}}};n5.exports=Qj});var O3=Me(A3=>{\"use strict\";Object.defineProperty(A3,\"__esModule\",{value:!0});A3.default=new WeakMap});var P3=Me(I3=>{\"use strict\";Object.defineProperty(I3,\"__esModule\",{value:!0});var Zj=lr(),u5=Zj.createContext({exit:()=>{}});u5.displayName=\"InternalAppContext\";I3.default=u5});var F3=Me(M3=>{\"use strict\";Object.defineProperty(M3,\"__esModule\",{value:!0});var eU=lr(),s5=eU.createContext({stdin:void 0,setRawMode:()=>{},isRawModeSupported:!1,internal_exitOnCtrlC:!0});s5.displayName=\"InternalStdinContext\";M3.default=s5});var R3=Me(L3=>{\"use strict\";Object.defineProperty(L3,\"__esModule\",{value:!0});var tU=lr(),l5=tU.createContext({stdout:void 0,write:()=>{}});l5.displayName=\"InternalStdoutContext\";L3.default=l5});var B3=Me(N3=>{\"use strict\";Object.defineProperty(N3,\"__esModule\",{value:!0});var nU=lr(),f5=nU.createContext({stderr:void 0,write:()=>{}});f5.displayName=\"InternalStderrContext\";N3.default=f5});var Zh=Me(j3=>{\"use strict\";Object.defineProperty(j3,\"__esModule\",{value:!0});var rU=lr(),c5=rU.createContext({activeId:void 0,add:()=>{},remove:()=>{},activate:()=>{},deactivate:()=>{},enableFocus:()=>{},disableFocus:()=>{},focusNext:()=>{},focusPrevious:()=>{}});c5.displayName=\"InternalFocusContext\";j3.default=c5});var d5=Me((EG,a5)=>{\"use strict\";var iU=/[|\\\\{}()[\\]^$+*?.-]/g;a5.exports=i=>{if(typeof i!=\"string\")throw new TypeError(\"Expected a string\");return i.replace(iU,\"\\\\$&\")}});var v5=Me((SG,p5)=>{\"use strict\";var oU=d5(),h5=[].concat(require(\"module\").builtinModules,\"bootstrap_node\",\"node\").map(i=>new RegExp(`(?:\\\\(${i}\\\\.js:\\\\d+:\\\\d+\\\\)$|^\\\\s*at ${i}\\\\.js:\\\\d+:\\\\d+$)`));h5.push(/\\(internal\\/[^:]+:\\d+:\\d+\\)$/,/\\s*at internal\\/[^:]+:\\d+:\\d+$/,/\\/\\.node-spawn-wrap-\\w+-\\w+\\/node:\\d+:\\d+\\)?$/);var em=class{constructor(u){u=dt({ignoredPackages:[]},u),\"internals\"in u||(u.internals=em.nodeInternals()),\"cwd\"in u||(u.cwd=process.cwd()),this._cwd=u.cwd.replace(/\\\\/g,\"/\"),this._internals=[].concat(u.internals,uU(u.ignoredPackages)),this._wrapCallSite=u.wrapCallSite||!1}static nodeInternals(){return[...h5]}clean(u,f=0){f=\" \".repeat(f),Array.isArray(u)||(u=u.split(`\n`)),!/^\\s*at /.test(u[0])&&/^\\s*at /.test(u[1])&&(u=u.slice(1));let c=!1,g=null,t=[];return u.forEach(C=>{if(C=C.replace(/\\\\/g,\"/\"),this._internals.some(x=>x.test(C)))return;let A=/^\\s*at /.test(C);c?C=C.trimEnd().replace(/^(\\s+)at /,\"$1\"):(C=C.trim(),A&&(C=C.slice(3))),C=C.replace(`${this._cwd}/`,\"\"),C&&(A?(g&&(t.push(g),g=null),t.push(C)):(c=!0,g=C))}),t.map(C=>`${f}${C}\n`).join(\"\")}captureString(u,f=this.captureString){typeof u==\"function\"&&(f=u,u=Infinity);let{stackTraceLimit:c}=Error;u&&(Error.stackTraceLimit=u);let g={};Error.captureStackTrace(g,f);let{stack:t}=g;return Error.stackTraceLimit=c,this.clean(t)}capture(u,f=this.capture){typeof u==\"function\"&&(f=u,u=Infinity);let{prepareStackTrace:c,stackTraceLimit:g}=Error;Error.prepareStackTrace=(A,x)=>this._wrapCallSite?x.map(this._wrapCallSite):x,u&&(Error.stackTraceLimit=u);let t={};Error.captureStackTrace(t,f);let{stack:C}=t;return Object.assign(Error,{prepareStackTrace:c,stackTraceLimit:g}),C}at(u=this.at){let[f]=this.capture(1,u);if(!f)return{};let c={line:f.getLineNumber(),column:f.getColumnNumber()};m5(c,f.getFileName(),this._cwd),f.isConstructor()&&(c.constructor=!0),f.isEval()&&(c.evalOrigin=f.getEvalOrigin()),f.isNative()&&(c.native=!0);let g;try{g=f.getTypeName()}catch(A){}g&&g!==\"Object\"&&g!==\"[object Object]\"&&(c.type=g);let t=f.getFunctionName();t&&(c.function=t);let C=f.getMethodName();return C&&t!==C&&(c.method=C),c}parseLine(u){let f=u&&u.match(sU);if(!f)return null;let c=f[1]===\"new\",g=f[2],t=f[3],C=f[4],A=Number(f[5]),x=Number(f[6]),D=f[7],L=f[8],N=f[9],j=f[10]===\"native\",$=f[11]===\")\",h,re={};if(L&&(re.line=Number(L)),N&&(re.column=Number(N)),$&&D){let ce=0;for(let Q=D.length-1;Q>0;Q--)if(D.charAt(Q)===\")\")ce++;else if(D.charAt(Q)===\"(\"&&D.charAt(Q-1)===\" \"&&(ce--,ce===-1&&D.charAt(Q-1)===\" \")){let oe=D.slice(0,Q-1);D=D.slice(Q+1),g+=` (${oe}`;break}}if(g){let ce=g.match(lU);ce&&(g=ce[1],h=ce[2])}return m5(re,D,this._cwd),c&&(re.constructor=!0),t&&(re.evalOrigin=t,re.evalLine=A,re.evalColumn=x,re.evalFile=C&&C.replace(/\\\\/g,\"/\")),j&&(re.native=!0),g&&(re.function=g),h&&g!==h&&(re.method=h),re}};function m5(i,u,f){u&&(u=u.replace(/\\\\/g,\"/\"),u.startsWith(`${f}/`)&&(u=u.slice(f.length+1)),i.file=u)}function uU(i){if(i.length===0)return[];let u=i.map(f=>oU(f));return new RegExp(`[/\\\\\\\\]node_modules[/\\\\\\\\](?:${u.join(\"|\")})[/\\\\\\\\][^:]+:\\\\d+:\\\\d+`)}var sU=new RegExp(\"^(?:\\\\s*at )?(?:(new) )?(?:(.*?) \\\\()?(?:eval at ([^ ]+) \\\\((.+?):(\\\\d+):(\\\\d+)\\\\), )?(?:(.+?):(\\\\d+):(\\\\d+)|(native))(\\\\)?)$\"),lU=/^(.*?) \\[as (.*?)\\]$/;p5.exports=em});var _5=Me((CG,g5)=>{\"use strict\";g5.exports=(i,u)=>i.replace(/^\\t+/gm,f=>\" \".repeat(f.length*(u||2)))});var w5=Me((TG,y5)=>{\"use strict\";var fU=_5(),cU=(i,u)=>{let f=[],c=i-u,g=i+u;for(let t=c;t<=g;t++)f.push(t);return f};y5.exports=(i,u,f)=>{if(typeof i!=\"string\")throw new TypeError(\"Source code is missing.\");if(!u||u<1)throw new TypeError(\"Line number must start from `1`.\");if(i=fU(i).split(/\\r?\\n/),!(u>i.length))return f=dt({around:3},f),cU(u,f.around).filter(c=>i[c-1]!==void 0).map(c=>({line:c,value:i[c-1]}))}});var tm=Me(hs=>{\"use strict\";var aU=hs&&hs.__createBinding||(Object.create?function(i,u,f,c){c===void 0&&(c=f),Object.defineProperty(i,c,{enumerable:!0,get:function(){return u[f]}})}:function(i,u,f,c){c===void 0&&(c=f),i[c]=u[f]}),dU=hs&&hs.__setModuleDefault||(Object.create?function(i,u){Object.defineProperty(i,\"default\",{enumerable:!0,value:u})}:function(i,u){i.default=u}),pU=hs&&hs.__importStar||function(i){if(i&&i.__esModule)return i;var u={};if(i!=null)for(var f in i)f!==\"default\"&&Object.hasOwnProperty.call(i,f)&&aU(u,i,f);return dU(u,i),u},hU=hs&&hs.__rest||function(i,u){var f={};for(var c in i)Object.prototype.hasOwnProperty.call(i,c)&&u.indexOf(c)<0&&(f[c]=i[c]);if(i!=null&&typeof Object.getOwnPropertySymbols==\"function\")for(var g=0,c=Object.getOwnPropertySymbols(i);g<c.length;g++)u.indexOf(c[g])<0&&Object.prototype.propertyIsEnumerable.call(i,c[g])&&(f[c[g]]=i[c[g]]);return f};Object.defineProperty(hs,\"__esModule\",{value:!0});var D5=pU(lr()),U3=D5.forwardRef((i,u)=>{var{children:f}=i,c=hU(i,[\"children\"]);let g=Object.assign(Object.assign({},c),{marginLeft:c.marginLeft||c.marginX||c.margin||0,marginRight:c.marginRight||c.marginX||c.margin||0,marginTop:c.marginTop||c.marginY||c.margin||0,marginBottom:c.marginBottom||c.marginY||c.margin||0,paddingLeft:c.paddingLeft||c.paddingX||c.padding||0,paddingRight:c.paddingRight||c.paddingX||c.padding||0,paddingTop:c.paddingTop||c.paddingY||c.padding||0,paddingBottom:c.paddingBottom||c.paddingY||c.padding||0});return D5.default.createElement(\"ink-box\",{ref:u,style:g},f)});U3.displayName=\"Box\";U3.defaultProps={flexDirection:\"row\",flexGrow:0,flexShrink:1};hs.default=U3});var W3=Me(R2=>{\"use strict\";var q3=R2&&R2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(R2,\"__esModule\",{value:!0});var mU=q3(lr()),Aa=q3(Jh()),E5=q3(E3()),z3=({color:i,backgroundColor:u,dimColor:f,bold:c,italic:g,underline:t,strikethrough:C,inverse:A,wrap:x,children:D})=>{if(D==null)return null;let L=N=>(f&&(N=Aa.default.dim(N)),i&&(N=E5.default(N,i,\"foreground\")),u&&(N=E5.default(N,u,\"background\")),c&&(N=Aa.default.bold(N)),g&&(N=Aa.default.italic(N)),t&&(N=Aa.default.underline(N)),C&&(N=Aa.default.strikethrough(N)),A&&(N=Aa.default.inverse(N)),N);return mU.default.createElement(\"ink-text\",{style:{flexGrow:0,flexShrink:1,flexDirection:\"row\",textWrap:x},internal_transform:L},D)};z3.displayName=\"Text\";z3.defaultProps={dimColor:!1,bold:!1,italic:!1,underline:!1,strikethrough:!1,wrap:\"wrap\"};R2.default=z3});var x5=Me(ms=>{\"use strict\";var vU=ms&&ms.__createBinding||(Object.create?function(i,u,f,c){c===void 0&&(c=f),Object.defineProperty(i,c,{enumerable:!0,get:function(){return u[f]}})}:function(i,u,f,c){c===void 0&&(c=f),i[c]=u[f]}),gU=ms&&ms.__setModuleDefault||(Object.create?function(i,u){Object.defineProperty(i,\"default\",{enumerable:!0,value:u})}:function(i,u){i.default=u}),_U=ms&&ms.__importStar||function(i){if(i&&i.__esModule)return i;var u={};if(i!=null)for(var f in i)f!==\"default\"&&Object.hasOwnProperty.call(i,f)&&vU(u,i,f);return gU(u,i),u},N2=ms&&ms.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ms,\"__esModule\",{value:!0});var S5=_U(require(\"fs\")),ui=N2(lr()),C5=N2(v5()),yU=N2(w5()),ef=N2(tm()),il=N2(W3()),T5=new C5.default({cwd:process.cwd(),internals:C5.default.nodeInternals()}),wU=({error:i})=>{let u=i.stack?i.stack.split(`\n`).slice(1):void 0,f=u?T5.parseLine(u[0]):void 0,c,g=0;if((f==null?void 0:f.file)&&(f==null?void 0:f.line)&&S5.existsSync(f.file)){let t=S5.readFileSync(f.file,\"utf8\");if(c=yU.default(t,f.line),c)for(let{line:C}of c)g=Math.max(g,String(C).length)}return ui.default.createElement(ef.default,{flexDirection:\"column\",padding:1},ui.default.createElement(ef.default,null,ui.default.createElement(il.default,{backgroundColor:\"red\",color:\"white\"},\" \",\"ERROR\",\" \"),ui.default.createElement(il.default,null,\" \",i.message)),f&&ui.default.createElement(ef.default,{marginTop:1},ui.default.createElement(il.default,{dimColor:!0},f.file,\":\",f.line,\":\",f.column)),f&&c&&ui.default.createElement(ef.default,{marginTop:1,flexDirection:\"column\"},c.map(({line:t,value:C})=>ui.default.createElement(ef.default,{key:t},ui.default.createElement(ef.default,{width:g+1},ui.default.createElement(il.default,{dimColor:t!==f.line,backgroundColor:t===f.line?\"red\":void 0,color:t===f.line?\"white\":void 0},String(t).padStart(g,\" \"),\":\")),ui.default.createElement(il.default,{key:t,backgroundColor:t===f.line?\"red\":void 0,color:t===f.line?\"white\":void 0},\" \"+C)))),i.stack&&ui.default.createElement(ef.default,{marginTop:1,flexDirection:\"column\"},i.stack.split(`\n`).slice(1).map(t=>{let C=T5.parseLine(t);return C?ui.default.createElement(ef.default,{key:t},ui.default.createElement(il.default,{dimColor:!0},\"- \"),ui.default.createElement(il.default,{dimColor:!0,bold:!0},C.function),ui.default.createElement(il.default,{dimColor:!0,color:\"gray\"},\" \",\"(\",C.file,\":\",C.line,\":\",C.column,\")\")):ui.default.createElement(ef.default,{key:t},ui.default.createElement(il.default,{dimColor:!0},\"- \"),ui.default.createElement(il.default,{dimColor:!0,bold:!0},t))})))};ms.default=wU});var A5=Me(vs=>{\"use strict\";var DU=vs&&vs.__createBinding||(Object.create?function(i,u,f,c){c===void 0&&(c=f),Object.defineProperty(i,c,{enumerable:!0,get:function(){return u[f]}})}:function(i,u,f,c){c===void 0&&(c=f),i[c]=u[f]}),EU=vs&&vs.__setModuleDefault||(Object.create?function(i,u){Object.defineProperty(i,\"default\",{enumerable:!0,value:u})}:function(i,u){i.default=u}),SU=vs&&vs.__importStar||function(i){if(i&&i.__esModule)return i;var u={};if(i!=null)for(var f in i)f!==\"default\"&&Object.hasOwnProperty.call(i,f)&&DU(u,i,f);return EU(u,i),u},yc=vs&&vs.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(vs,\"__esModule\",{value:!0});var wc=SU(lr()),k5=yc(gy()),CU=yc(P3()),TU=yc(F3()),xU=yc(R3()),kU=yc(B3()),AU=yc(Zh()),OU=yc(x5()),IU=\"\t\",PU=\"\u001b[Z\",MU=\"\u001b\",H3=class extends wc.PureComponent{constructor(){super(...arguments);this.state={isFocusEnabled:!0,activeFocusId:void 0,focusables:[],error:void 0},this.rawModeEnabledCount=0,this.handleSetRawMode=u=>{let{stdin:f}=this.props;if(!this.isRawModeSupported())throw f===process.stdin?new Error(`Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`):new Error(`Raw mode is not supported on the stdin provided to Ink.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(f.setEncoding(\"utf8\"),u){this.rawModeEnabledCount===0&&(f.addListener(\"data\",this.handleInput),f.resume(),f.setRawMode(!0)),this.rawModeEnabledCount++;return}--this.rawModeEnabledCount==0&&(f.setRawMode(!1),f.removeListener(\"data\",this.handleInput),f.pause())},this.handleInput=u=>{u===\"\u0003\"&&this.props.exitOnCtrlC&&this.handleExit(),u===MU&&this.state.activeFocusId&&this.setState({activeFocusId:void 0}),this.state.isFocusEnabled&&this.state.focusables.length>0&&(u===IU&&this.focusNext(),u===PU&&this.focusPrevious())},this.handleExit=u=>{this.isRawModeSupported()&&this.handleSetRawMode(!1),this.props.onExit(u)},this.enableFocus=()=>{this.setState({isFocusEnabled:!0})},this.disableFocus=()=>{this.setState({isFocusEnabled:!1})},this.focusNext=()=>{this.setState(u=>{let f=u.focusables[0].id;return{activeFocusId:this.findNextFocusable(u)||f}})},this.focusPrevious=()=>{this.setState(u=>{let f=u.focusables[u.focusables.length-1].id;return{activeFocusId:this.findPreviousFocusable(u)||f}})},this.addFocusable=(u,{autoFocus:f})=>{this.setState(c=>{let g=c.activeFocusId;return!g&&f&&(g=u),{activeFocusId:g,focusables:[...c.focusables,{id:u,isActive:!0}]}})},this.removeFocusable=u=>{this.setState(f=>({activeFocusId:f.activeFocusId===u?void 0:f.activeFocusId,focusables:f.focusables.filter(c=>c.id!==u)}))},this.activateFocusable=u=>{this.setState(f=>({focusables:f.focusables.map(c=>c.id!==u?c:{id:u,isActive:!0})}))},this.deactivateFocusable=u=>{this.setState(f=>({activeFocusId:f.activeFocusId===u?void 0:f.activeFocusId,focusables:f.focusables.map(c=>c.id!==u?c:{id:u,isActive:!1})}))},this.findNextFocusable=u=>{let f=u.focusables.findIndex(c=>c.id===u.activeFocusId);for(let c=f+1;c<u.focusables.length;c++)if(u.focusables[c].isActive)return u.focusables[c].id},this.findPreviousFocusable=u=>{let f=u.focusables.findIndex(c=>c.id===u.activeFocusId);for(let c=f-1;c>=0;c--)if(u.focusables[c].isActive)return u.focusables[c].id}}static getDerivedStateFromError(u){return{error:u}}isRawModeSupported(){return this.props.stdin.isTTY}render(){return wc.default.createElement(CU.default.Provider,{value:{exit:this.handleExit}},wc.default.createElement(TU.default.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC}},wc.default.createElement(xU.default.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},wc.default.createElement(kU.default.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},wc.default.createElement(AU.default.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deactivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious}},this.state.error?wc.default.createElement(OU.default,{error:this.state.error}):this.props.children)))))}componentDidMount(){k5.default.hide(this.props.stdout)}componentWillUnmount(){k5.default.show(this.props.stdout),this.isRawModeSupported()&&this.handleSetRawMode(!1)}componentDidCatch(u){this.handleExit(u)}};vs.default=H3;H3.displayName=\"InternalApp\"});var M5=Me(gs=>{\"use strict\";var FU=gs&&gs.__createBinding||(Object.create?function(i,u,f,c){c===void 0&&(c=f),Object.defineProperty(i,c,{enumerable:!0,get:function(){return u[f]}})}:function(i,u,f,c){c===void 0&&(c=f),i[c]=u[f]}),LU=gs&&gs.__setModuleDefault||(Object.create?function(i,u){Object.defineProperty(i,\"default\",{enumerable:!0,value:u})}:function(i,u){i.default=u}),RU=gs&&gs.__importStar||function(i){if(i&&i.__esModule)return i;var u={};if(i!=null)for(var f in i)f!==\"default\"&&Object.hasOwnProperty.call(i,f)&&FU(u,i,f);return LU(u,i),u},_s=gs&&gs.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(gs,\"__esModule\",{value:!0});var NU=_s(lr()),O5=AD(),BU=_s(WD()),jU=_s(ay()),UU=_s(KD()),qU=_s(JD()),nm=_s(lS()),zU=_s(t5()),WU=_s(vy()),HU=_s(o5()),bU=RU(Xy()),GU=_s(O3()),VU=_s(A5()),Oa=process.env.CI===\"false\"?!1:UU.default,I5=()=>{},P5=class{constructor(u){this.resolveExitPromise=()=>{},this.rejectExitPromise=()=>{},this.unsubscribeExit=()=>{},this.onRender=()=>{if(this.isUnmounted)return;let{output:f,outputHeight:c,staticOutput:g}=zU.default(this.rootNode,this.options.stdout.columns||80),t=g&&g!==`\n`;if(this.options.debug){t&&(this.fullStaticOutput+=g),this.options.stdout.write(this.fullStaticOutput+f);return}if(Oa){t&&this.options.stdout.write(g),this.lastOutput=f;return}if(t&&(this.fullStaticOutput+=g),c>=this.options.stdout.rows){this.options.stdout.write(jU.default.clearTerminal+this.fullStaticOutput+f),this.lastOutput=f;return}t&&(this.log.clear(),this.options.stdout.write(g),this.log(f)),!t&&f!==this.lastOutput&&this.throttledLog(f),this.lastOutput=f},qU.default(this),this.options=u,this.rootNode=bU.createNode(\"ink-root\"),this.rootNode.onRender=u.debug?this.onRender:O5.throttle(this.onRender,32,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=BU.default.create(u.stdout),this.throttledLog=u.debug?this.log:O5.throttle(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput=\"\",this.fullStaticOutput=\"\",this.container=nm.default.createContainer(this.rootNode,!1,!1),this.unsubscribeExit=WU.default(this.unmount,{alwaysLast:!1}),process.env.DEV===\"true\"&&nm.default.injectIntoDevTools({bundleType:0,version:\"16.13.1\",rendererPackageName:\"ink\"}),u.patchConsole&&this.patchConsole(),Oa||(u.stdout.on(\"resize\",this.onRender),this.unsubscribeResize=()=>{u.stdout.off(\"resize\",this.onRender)})}render(u){let f=NU.default.createElement(VU.default,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},u);nm.default.updateContainer(f,this.container,null,I5)}writeToStdout(u){if(!this.isUnmounted){if(this.options.debug){this.options.stdout.write(u+this.fullStaticOutput+this.lastOutput);return}if(Oa){this.options.stdout.write(u);return}this.log.clear(),this.options.stdout.write(u),this.log(this.lastOutput)}}writeToStderr(u){if(!this.isUnmounted){if(this.options.debug){this.options.stderr.write(u),this.options.stdout.write(this.fullStaticOutput+this.lastOutput);return}if(Oa){this.options.stderr.write(u);return}this.log.clear(),this.options.stderr.write(u),this.log(this.lastOutput)}}unmount(u){this.isUnmounted||(this.onRender(),this.unsubscribeExit(),typeof this.restoreConsole==\"function\"&&this.restoreConsole(),typeof this.unsubscribeResize==\"function\"&&this.unsubscribeResize(),Oa?this.options.stdout.write(this.lastOutput+`\n`):this.options.debug||this.log.done(),this.isUnmounted=!0,nm.default.updateContainer(null,this.container,null,I5),GU.default.delete(this.options.stdout),u instanceof Error?this.rejectExitPromise(u):this.resolveExitPromise())}waitUntilExit(){return this.exitPromise||(this.exitPromise=new Promise((u,f)=>{this.resolveExitPromise=u,this.rejectExitPromise=f})),this.exitPromise}clear(){!Oa&&!this.options.debug&&this.log.clear()}patchConsole(){this.options.debug||(this.restoreConsole=HU.default((u,f)=>{u===\"stdout\"&&this.writeToStdout(f),u===\"stderr\"&&(f.startsWith(\"The above error occurred\")||this.writeToStderr(f))}))}};gs.default=P5});var L5=Me(B2=>{\"use strict\";var F5=B2&&B2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(B2,\"__esModule\",{value:!0});var YU=F5(M5()),rm=F5(O3()),$U=require(\"stream\"),JU=(i,u)=>{let f=Object.assign({stdout:process.stdout,stdin:process.stdin,stderr:process.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0},KU(u)),c=XU(f.stdout,()=>new YU.default(f));return c.render(i),{rerender:c.render,unmount:()=>c.unmount(),waitUntilExit:c.waitUntilExit,cleanup:()=>rm.default.delete(f.stdout),clear:c.clear}};B2.default=JU;var KU=(i={})=>i instanceof $U.Stream?{stdout:i,stdin:process.stdin}:i,XU=(i,u)=>{let f;return rm.default.has(i)?f=rm.default.get(i):(f=u(),rm.default.set(i,f)),f}});var N5=Me(tf=>{\"use strict\";var QU=tf&&tf.__createBinding||(Object.create?function(i,u,f,c){c===void 0&&(c=f),Object.defineProperty(i,c,{enumerable:!0,get:function(){return u[f]}})}:function(i,u,f,c){c===void 0&&(c=f),i[c]=u[f]}),ZU=tf&&tf.__setModuleDefault||(Object.create?function(i,u){Object.defineProperty(i,\"default\",{enumerable:!0,value:u})}:function(i,u){i.default=u}),eq=tf&&tf.__importStar||function(i){if(i&&i.__esModule)return i;var u={};if(i!=null)for(var f in i)f!==\"default\"&&Object.hasOwnProperty.call(i,f)&&QU(u,i,f);return ZU(u,i),u};Object.defineProperty(tf,\"__esModule\",{value:!0});var j2=eq(lr()),R5=i=>{let{items:u,children:f,style:c}=i,[g,t]=j2.useState(0),C=j2.useMemo(()=>u.slice(g),[u,g]);j2.useLayoutEffect(()=>{t(u.length)},[u.length]);let A=C.map((D,L)=>f(D,g+L)),x=j2.useMemo(()=>Object.assign({position:\"absolute\",flexDirection:\"column\"},c),[c]);return j2.default.createElement(\"ink-box\",{internal_static:!0,style:x},A)};R5.displayName=\"Static\";tf.default=R5});var j5=Me(U2=>{\"use strict\";var tq=U2&&U2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(U2,\"__esModule\",{value:!0});var nq=tq(lr()),B5=({children:i,transform:u})=>i==null?null:nq.default.createElement(\"ink-text\",{style:{flexGrow:0,flexShrink:1,flexDirection:\"row\"},internal_transform:u},i);B5.displayName=\"Transform\";U2.default=B5});var q5=Me(q2=>{\"use strict\";var rq=q2&&q2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(q2,\"__esModule\",{value:!0});var iq=rq(lr()),U5=({count:i=1})=>iq.default.createElement(\"ink-text\",null,`\n`.repeat(i));U5.displayName=\"Newline\";q2.default=U5});var H5=Me(z2=>{\"use strict\";var z5=z2&&z2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(z2,\"__esModule\",{value:!0});var oq=z5(lr()),uq=z5(tm()),W5=()=>oq.default.createElement(uq.default,{flexGrow:1});W5.displayName=\"Spacer\";z2.default=W5});var im=Me(W2=>{\"use strict\";var sq=W2&&W2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(W2,\"__esModule\",{value:!0});var lq=lr(),fq=sq(F3()),cq=()=>lq.useContext(fq.default);W2.default=cq});var G5=Me(H2=>{\"use strict\";var aq=H2&&H2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(H2,\"__esModule\",{value:!0});var b5=lr(),dq=aq(im()),pq=(i,u={})=>{let{stdin:f,setRawMode:c,internal_exitOnCtrlC:g}=dq.default();b5.useEffect(()=>{if(u.isActive!==!1)return c(!0),()=>{c(!1)}},[u.isActive,c]),b5.useEffect(()=>{if(u.isActive===!1)return;let t=C=>{let A=String(C),x={upArrow:A===\"\u001b[A\",downArrow:A===\"\u001b[B\",leftArrow:A===\"\u001b[D\",rightArrow:A===\"\u001b[C\",pageDown:A===\"\u001b[6~\",pageUp:A===\"\u001b[5~\",return:A===\"\\r\",escape:A===\"\u001b\",ctrl:!1,shift:!1,tab:A===\"\t\"||A===\"\u001b[Z\",backspace:A===\"\\b\",delete:A===\"\\x7F\"||A===\"\u001b[3~\",meta:!1};A<=\"\u001a\"&&!x.return&&(A=String.fromCharCode(A.charCodeAt(0)+\"a\".charCodeAt(0)-1),x.ctrl=!0),A.startsWith(\"\u001b\")&&(A=A.slice(1),x.meta=!0);let D=A>=\"A\"&&A<=\"Z\",L=A>=\"\\u0410\"&&A<=\"\\u042F\";A.length===1&&(D||L)&&(x.shift=!0),x.tab&&A===\"[Z\"&&(x.shift=!0),(x.tab||x.backspace||x.delete)&&(A=\"\"),(!(A===\"c\"&&x.ctrl)||!g)&&i(A,x)};return f==null||f.on(\"data\",t),()=>{f==null||f.off(\"data\",t)}},[u.isActive,f,g,i])};H2.default=pq});var V5=Me(b2=>{\"use strict\";var hq=b2&&b2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(b2,\"__esModule\",{value:!0});var mq=lr(),vq=hq(P3()),gq=()=>mq.useContext(vq.default);b2.default=gq});var Y5=Me(G2=>{\"use strict\";var _q=G2&&G2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(G2,\"__esModule\",{value:!0});var yq=lr(),wq=_q(R3()),Dq=()=>yq.useContext(wq.default);G2.default=Dq});var $5=Me(V2=>{\"use strict\";var Eq=V2&&V2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(V2,\"__esModule\",{value:!0});var Sq=lr(),Cq=Eq(B3()),Tq=()=>Sq.useContext(Cq.default);V2.default=Tq});var X5=Me(Y2=>{\"use strict\";var K5=Y2&&Y2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Y2,\"__esModule\",{value:!0});var $2=lr(),xq=K5(Zh()),kq=K5(im()),Aq=({isActive:i=!0,autoFocus:u=!1}={})=>{let{isRawModeSupported:f,setRawMode:c}=kq.default(),{activeId:g,add:t,remove:C,activate:A,deactivate:x}=$2.useContext(xq.default),D=$2.useMemo(()=>Math.random().toString().slice(2,7),[]);return $2.useEffect(()=>(t(D,{autoFocus:u}),()=>{C(D)}),[D,u]),$2.useEffect(()=>{i?A(D):x(D)},[i,D]),$2.useEffect(()=>{if(!(!f||!i))return c(!0),()=>{c(!1)}},[i]),{isFocused:Boolean(D)&&g===D}};Y2.default=Aq});var J5=Me(K2=>{\"use strict\";var Oq=K2&&K2.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(K2,\"__esModule\",{value:!0});var Iq=lr(),Pq=Oq(Zh()),Mq=()=>{let i=Iq.useContext(Pq.default);return{enableFocus:i.enableFocus,disableFocus:i.disableFocus,focusNext:i.focusNext,focusPrevious:i.focusPrevious}};K2.default=Mq});var Q5=Me(b3=>{\"use strict\";Object.defineProperty(b3,\"__esModule\",{value:!0});b3.default=i=>{var u,f,c,g;return{width:(f=(u=i.yogaNode)===null||u===void 0?void 0:u.getComputedWidth())!==null&&f!==void 0?f:0,height:(g=(c=i.yogaNode)===null||c===void 0?void 0:c.getComputedHeight())!==null&&g!==void 0?g:0}}});var ys=Me(ji=>{\"use strict\";Object.defineProperty(ji,\"__esModule\",{value:!0});var Fq=L5();Object.defineProperty(ji,\"render\",{enumerable:!0,get:function(){return Fq.default}});var Lq=tm();Object.defineProperty(ji,\"Box\",{enumerable:!0,get:function(){return Lq.default}});var Rq=W3();Object.defineProperty(ji,\"Text\",{enumerable:!0,get:function(){return Rq.default}});var Nq=N5();Object.defineProperty(ji,\"Static\",{enumerable:!0,get:function(){return Nq.default}});var Bq=j5();Object.defineProperty(ji,\"Transform\",{enumerable:!0,get:function(){return Bq.default}});var jq=q5();Object.defineProperty(ji,\"Newline\",{enumerable:!0,get:function(){return jq.default}});var Uq=H5();Object.defineProperty(ji,\"Spacer\",{enumerable:!0,get:function(){return Uq.default}});var qq=G5();Object.defineProperty(ji,\"useInput\",{enumerable:!0,get:function(){return qq.default}});var zq=V5();Object.defineProperty(ji,\"useApp\",{enumerable:!0,get:function(){return zq.default}});var Wq=im();Object.defineProperty(ji,\"useStdin\",{enumerable:!0,get:function(){return Wq.default}});var Hq=Y5();Object.defineProperty(ji,\"useStdout\",{enumerable:!0,get:function(){return Hq.default}});var bq=$5();Object.defineProperty(ji,\"useStderr\",{enumerable:!0,get:function(){return bq.default}});var Gq=X5();Object.defineProperty(ji,\"useFocus\",{enumerable:!0,get:function(){return Gq.default}});var Vq=J5();Object.defineProperty(ji,\"useFocusManager\",{enumerable:!0,get:function(){return Vq.default}});var Yq=Q5();Object.defineProperty(ji,\"measureElement\",{enumerable:!0,get:function(){return Yq.default}})});var lC=Me(X2=>{\"use strict\";Object.defineProperty(X2,\"__esModule\",{value:!0});X2.UncontrolledTextInput=void 0;var oC=lr(),Y3=lr(),uC=ys(),Sc=Jh(),sC=({value:i,placeholder:u=\"\",focus:f=!0,mask:c,highlightPastedText:g=!1,showCursor:t=!0,onChange:C,onSubmit:A})=>{let[{cursorOffset:x,cursorWidth:D},L]=Y3.useState({cursorOffset:(i||\"\").length,cursorWidth:0});Y3.useEffect(()=>{L(re=>{if(!f||!t)return re;let ce=i||\"\";return re.cursorOffset>ce.length-1?{cursorOffset:ce.length,cursorWidth:0}:re})},[i,f,t]);let N=g?D:0,j=c?c.repeat(i.length):i,$=j,h=u?Sc.grey(u):void 0;if(t&&f){h=u.length>0?Sc.inverse(u[0])+Sc.grey(u.slice(1)):Sc.inverse(\" \"),$=j.length>0?\"\":Sc.inverse(\" \");let re=0;for(let ce of j)re>=x-N&&re<=x?$+=Sc.inverse(ce):$+=ce,re++;j.length>0&&x===j.length&&($+=Sc.inverse(\" \"))}return uC.useInput((re,ce)=>{if(ce.upArrow||ce.downArrow||ce.ctrl&&re===\"c\"||ce.tab||ce.shift&&ce.tab)return;if(ce.return){A&&A(i);return}let Q=x,oe=i,Se=0;ce.leftArrow?t&&Q--:ce.rightArrow?t&&Q++:ce.backspace||ce.delete?x>0&&(oe=i.slice(0,x-1)+i.slice(x,i.length),Q--):(oe=i.slice(0,x)+re+i.slice(x,i.length),Q+=re.length,re.length>1&&(Se=re.length)),x<0&&(Q=0),x>i.length&&(Q=i.length),L({cursorOffset:Q,cursorWidth:Se}),oe!==i&&C(oe)},{isActive:f}),oC.createElement(uC.Text,null,u?j.length>0?$:h:$)};X2.default=sC;X2.UncontrolledTextInput=i=>{let[u,f]=Y3.useState(\"\");return oC.createElement(sC,Object.assign({},i,{value:u,onChange:f}))}});var cC=Me(pm=>{\"use strict\";Object.defineProperty(pm,\"__esModule\",{value:!0});function J2(i){let u=[...i.caches],f=u.shift();return f===void 0?fC():{get(c,g,t={miss:()=>Promise.resolve()}){return f.get(c,g,t).catch(()=>J2({caches:u}).get(c,g,t))},set(c,g){return f.set(c,g).catch(()=>J2({caches:u}).set(c,g))},delete(c){return f.delete(c).catch(()=>J2({caches:u}).delete(c))},clear(){return f.clear().catch(()=>J2({caches:u}).clear())}}}function fC(){return{get(i,u,f={miss:()=>Promise.resolve()}){return u().then(g=>Promise.all([g,f.miss(g)])).then(([g])=>g)},set(i,u){return Promise.resolve(u)},delete(i){return Promise.resolve()},clear(){return Promise.resolve()}}}pm.createFallbackableCache=J2;pm.createNullCache=fC});var dC=Me((fV,aC)=>{aC.exports=cC()});var pC=Me($3=>{\"use strict\";Object.defineProperty($3,\"__esModule\",{value:!0});function $q(i={serializable:!0}){let u={};return{get(f,c,g={miss:()=>Promise.resolve()}){let t=JSON.stringify(f);if(t in u)return Promise.resolve(i.serializable?JSON.parse(u[t]):u[t]);let C=c(),A=g&&g.miss||(()=>Promise.resolve());return C.then(x=>A(x)).then(()=>C)},set(f,c){return u[JSON.stringify(f)]=i.serializable?JSON.stringify(c):c,Promise.resolve(c)},delete(f){return delete u[JSON.stringify(f)],Promise.resolve()},clear(){return u={},Promise.resolve()}}}$3.createInMemoryCache=$q});var mC=Me((aV,hC)=>{hC.exports=pC()});var gC=Me(ws=>{\"use strict\";Object.defineProperty(ws,\"__esModule\",{value:!0});function Kq(i,u,f){let c={\"x-algolia-api-key\":f,\"x-algolia-application-id\":u};return{headers(){return i===K3.WithinHeaders?c:{}},queryParameters(){return i===K3.WithinQueryParameters?c:{}}}}function Xq(i){let u=0,f=()=>(u++,new Promise(c=>{setTimeout(()=>{c(i(f))},Math.min(100*u,1e3))}));return i(f)}function vC(i,u=(f,c)=>Promise.resolve()){return Object.assign(i,{wait(f){return vC(i.then(c=>Promise.all([u(c,f),c])).then(c=>c[1]))}})}function Jq(i){let u=i.length-1;for(u;u>0;u--){let f=Math.floor(Math.random()*(u+1)),c=i[u];i[u]=i[f],i[f]=c}return i}function Qq(i,u){return Object.keys(u!==void 0?u:{}).forEach(f=>{i[f]=u[f](i)}),i}function Zq(i,...u){let f=0;return i.replace(/%s/g,()=>encodeURIComponent(u[f++]))}var ez=\"4.2.0\",tz=i=>()=>i.transporter.requester.destroy(),K3={WithinQueryParameters:0,WithinHeaders:1};ws.AuthMode=K3;ws.addMethods=Qq;ws.createAuth=Kq;ws.createRetryablePromise=Xq;ws.createWaitablePromise=vC;ws.destroy=tz;ws.encode=Zq;ws.shuffle=Jq;ws.version=ez});var Q2=Me((pV,_C)=>{_C.exports=gC()});var yC=Me(X3=>{\"use strict\";Object.defineProperty(X3,\"__esModule\",{value:!0});var nz={Delete:\"DELETE\",Get:\"GET\",Post:\"POST\",Put:\"PUT\"};X3.MethodEnum=nz});var Z2=Me((mV,wC)=>{wC.exports=yC()});var RC=Me(y0=>{\"use strict\";Object.defineProperty(y0,\"__esModule\",{value:!0});var DC=Z2();function J3(i,u){let f=i||{},c=f.data||{};return Object.keys(f).forEach(g=>{[\"timeout\",\"headers\",\"queryParameters\",\"data\",\"cacheable\"].indexOf(g)===-1&&(c[g]=f[g])}),{data:Object.entries(c).length>0?c:void 0,timeout:f.timeout||u,headers:f.headers||{},queryParameters:f.queryParameters||{},cacheable:f.cacheable}}var hm={Read:1,Write:2,Any:3},Ia={Up:1,Down:2,Timeouted:3},EC=2*60*1e3;function Q3(i,u=Ia.Up){return zn(dt({},i),{status:u,lastUpdate:Date.now()})}function SC(i){return i.status===Ia.Up||Date.now()-i.lastUpdate>EC}function CC(i){return i.status===Ia.Timeouted&&Date.now()-i.lastUpdate<=EC}function Z3(i){return{protocol:i.protocol||\"https\",url:i.url,accept:i.accept||hm.Any}}function rz(i,u){return Promise.all(u.map(f=>i.get(f,()=>Promise.resolve(Q3(f))))).then(f=>{let c=f.filter(A=>SC(A)),g=f.filter(A=>CC(A)),t=[...c,...g],C=t.length>0?t.map(A=>Z3(A)):u;return{getTimeout(A,x){return(g.length===0&&A===0?1:g.length+3+A)*x},statelessHosts:C}})}var iz=({isTimedOut:i,status:u})=>!i&&~~u==0,oz=i=>{let u=i.status;return i.isTimedOut||iz(i)||~~(u/100)!=2&&~~(u/100)!=4},uz=({status:i})=>~~(i/100)==2,sz=(i,u)=>oz(i)?u.onRetry(i):uz(i)?u.onSucess(i):u.onFail(i);function PC(i,u,f,c){let g=[],t=AC(f,c),C=OC(i,c),A=f.method,x=f.method!==DC.MethodEnum.Get?{}:dt(dt({},f.data),c.data),D=dt(dt(dt({\"x-algolia-agent\":i.userAgent.value},i.queryParameters),x),c.queryParameters),L=0,N=(j,$)=>{let h=j.pop();if(h===void 0)throw IC(ew(g));let re={data:t,headers:C,method:A,url:kC(h,f.path,D),connectTimeout:$(L,i.timeouts.connect),responseTimeout:$(L,c.timeout)},ce=oe=>{let Se={request:re,response:oe,host:h,triesLeft:j.length};return g.push(Se),Se},Q={onSucess:oe=>TC(oe),onRetry(oe){let Se=ce(oe);return oe.isTimedOut&&L++,Promise.all([i.logger.info(\"Retryable failure\",tw(Se)),i.hostsCache.set(h,Q3(h,oe.isTimedOut?Ia.Timeouted:Ia.Down))]).then(()=>N(j,$))},onFail(oe){throw ce(oe),xC(oe,ew(g))}};return i.requester.send(re).then(oe=>sz(oe,Q))};return rz(i.hostsCache,u).then(j=>N([...j.statelessHosts].reverse(),j.getTimeout))}function lz(i){let{hostsCache:u,logger:f,requester:c,requestsCache:g,responsesCache:t,timeouts:C,userAgent:A,hosts:x,queryParameters:D,headers:L}=i,N={hostsCache:u,logger:f,requester:c,requestsCache:g,responsesCache:t,timeouts:C,userAgent:A,headers:L,queryParameters:D,hosts:x.map(j=>Z3(j)),read(j,$){let h=J3($,N.timeouts.read),re=()=>PC(N,N.hosts.filter(oe=>(oe.accept&hm.Read)!=0),j,h);if((h.cacheable!==void 0?h.cacheable:j.cacheable)!==!0)return re();let Q={request:j,mappedRequestOptions:h,transporter:{queryParameters:N.queryParameters,headers:N.headers}};return N.responsesCache.get(Q,()=>N.requestsCache.get(Q,()=>N.requestsCache.set(Q,re()).then(oe=>Promise.all([N.requestsCache.delete(Q),oe]),oe=>Promise.all([N.requestsCache.delete(Q),Promise.reject(oe)])).then(([oe,Se])=>Se)),{miss:oe=>N.responsesCache.set(Q,oe)})},write(j,$){return PC(N,N.hosts.filter(h=>(h.accept&hm.Write)!=0),j,J3($,N.timeouts.write))}};return N}function fz(i){let u={value:`Algolia for JavaScript (${i})`,add(f){let c=`; ${f.segment}${f.version!==void 0?` (${f.version})`:\"\"}`;return u.value.indexOf(c)===-1&&(u.value=`${u.value}${c}`),u}};return u}function TC(i){try{return JSON.parse(i.content)}catch(u){throw MC(u.message,i)}}function xC({content:i,status:u},f){let c=i;try{c=JSON.parse(i).message}catch(g){}return FC(c,u,f)}function cz(i,...u){let f=0;return i.replace(/%s/g,()=>encodeURIComponent(u[f++]))}function kC(i,u,f){let c=LC(f),g=`${i.protocol}://${i.url}/${u.charAt(0)===\"/\"?u.substr(1):u}`;return c.length&&(g+=`?${c}`),g}function LC(i){let u=f=>Object.prototype.toString.call(f)===\"[object Object]\"||Object.prototype.toString.call(f)===\"[object Array]\";return Object.keys(i).map(f=>cz(\"%s=%s\",f,u(i[f])?JSON.stringify(i[f]):i[f])).join(\"&\")}function AC(i,u){if(i.method===DC.MethodEnum.Get||i.data===void 0&&u.data===void 0)return;let f=Array.isArray(i.data)?i.data:dt(dt({},i.data),u.data);return JSON.stringify(f)}function OC(i,u){let f=dt(dt({},i.headers),u.headers),c={};return Object.keys(f).forEach(g=>{let t=f[g];c[g.toLowerCase()]=t}),c}function ew(i){return i.map(u=>tw(u))}function tw(i){let u=i.request.headers[\"x-algolia-api-key\"]?{\"x-algolia-api-key\":\"*****\"}:{};return zn(dt({},i),{request:zn(dt({},i.request),{headers:dt(dt({},i.request.headers),u)})})}function FC(i,u,f){return{name:\"ApiError\",message:i,status:u,transporterStackTrace:f}}function MC(i,u){return{name:\"DeserializationError\",message:i,response:u}}function IC(i){return{name:\"RetryError\",message:\"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.\",transporterStackTrace:i}}y0.CallEnum=hm;y0.HostStatusEnum=Ia;y0.createApiError=FC;y0.createDeserializationError=MC;y0.createMappedRequestOptions=J3;y0.createRetryError=IC;y0.createStatefulHost=Q3;y0.createStatelessHost=Z3;y0.createTransporter=lz;y0.createUserAgent=fz;y0.deserializeFailure=xC;y0.deserializeSuccess=TC;y0.isStatefulHostTimeouted=CC;y0.isStatefulHostUp=SC;y0.serializeData=AC;y0.serializeHeaders=OC;y0.serializeQueryParameters=LC;y0.serializeUrl=kC;y0.stackFrameWithoutCredentials=tw;y0.stackTraceWithoutCredentials=ew});var ed=Me((gV,NC)=>{NC.exports=RC()});var BC=Me(Hf=>{\"use strict\";Object.defineProperty(Hf,\"__esModule\",{value:!0});var Pa=Q2(),az=ed(),td=Z2(),dz=i=>{let u=i.region||\"us\",f=Pa.createAuth(Pa.AuthMode.WithinHeaders,i.appId,i.apiKey),c=az.createTransporter(zn(dt({hosts:[{url:`analytics.${u}.algolia.com`}]},i),{headers:dt(zn(dt({},f.headers()),{\"content-type\":\"application/json\"}),i.headers),queryParameters:dt(dt({},f.queryParameters()),i.queryParameters)})),g=i.appId;return Pa.addMethods({appId:g,transporter:c},i.methods)},pz=i=>(u,f)=>i.transporter.write({method:td.MethodEnum.Post,path:\"2/abtests\",data:u},f),hz=i=>(u,f)=>i.transporter.write({method:td.MethodEnum.Delete,path:Pa.encode(\"2/abtests/%s\",u)},f),mz=i=>(u,f)=>i.transporter.read({method:td.MethodEnum.Get,path:Pa.encode(\"2/abtests/%s\",u)},f),vz=i=>u=>i.transporter.read({method:td.MethodEnum.Get,path:\"2/abtests\"},u),gz=i=>(u,f)=>i.transporter.write({method:td.MethodEnum.Post,path:Pa.encode(\"2/abtests/%s/stop\",u)},f);Hf.addABTest=pz;Hf.createAnalyticsClient=dz;Hf.deleteABTest=hz;Hf.getABTest=mz;Hf.getABTests=vz;Hf.stopABTest=gz});var UC=Me((yV,jC)=>{jC.exports=BC()});var zC=Me(nd=>{\"use strict\";Object.defineProperty(nd,\"__esModule\",{value:!0});var nw=Q2(),_z=ed(),qC=Z2(),yz=i=>{let u=i.region||\"us\",f=nw.createAuth(nw.AuthMode.WithinHeaders,i.appId,i.apiKey),c=_z.createTransporter(zn(dt({hosts:[{url:`recommendation.${u}.algolia.com`}]},i),{headers:dt(zn(dt({},f.headers()),{\"content-type\":\"application/json\"}),i.headers),queryParameters:dt(dt({},f.queryParameters()),i.queryParameters)}));return nw.addMethods({appId:i.appId,transporter:c},i.methods)},wz=i=>u=>i.transporter.read({method:qC.MethodEnum.Get,path:\"1/strategies/personalization\"},u),Dz=i=>(u,f)=>i.transporter.write({method:qC.MethodEnum.Post,path:\"1/strategies/personalization\",data:u},f);nd.createRecommendationClient=yz;nd.getPersonalizationStrategy=wz;nd.setPersonalizationStrategy=Dz});var HC=Me((DV,WC)=>{WC.exports=zC()});var nT=Me(yt=>{\"use strict\";Object.defineProperty(yt,\"__esModule\",{value:!0});var Wt=Q2(),jo=ed(),Rn=Z2(),Ez=require(\"crypto\");function mm(i){let u=f=>i.request(f).then(c=>{if(i.batch!==void 0&&i.batch(c.hits),!i.shouldStop(c))return c.cursor?u({cursor:c.cursor}):u({page:(f.page||0)+1})});return u({})}var Sz=i=>{let u=i.appId,f=Wt.createAuth(i.authMode!==void 0?i.authMode:Wt.AuthMode.WithinHeaders,u,i.apiKey),c=jo.createTransporter(zn(dt({hosts:[{url:`${u}-dsn.algolia.net`,accept:jo.CallEnum.Read},{url:`${u}.algolia.net`,accept:jo.CallEnum.Write}].concat(Wt.shuffle([{url:`${u}-1.algolianet.com`},{url:`${u}-2.algolianet.com`},{url:`${u}-3.algolianet.com`}]))},i),{headers:dt(zn(dt({},f.headers()),{\"content-type\":\"application/x-www-form-urlencoded\"}),i.headers),queryParameters:dt(dt({},f.queryParameters()),i.queryParameters)})),g={transporter:c,appId:u,addAlgoliaAgent(t,C){c.userAgent.add({segment:t,version:C})},clearCache(){return Promise.all([c.requestsCache.clear(),c.responsesCache.clear()]).then(()=>{})}};return Wt.addMethods(g,i.methods)};function bC(){return{name:\"MissingObjectIDError\",message:\"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option.\"}}function GC(){return{name:\"ObjectNotFoundError\",message:\"Object not found.\"}}function VC(){return{name:\"ValidUntilNotFoundError\",message:\"ValidUntil not found in given secured api key.\"}}var Cz=i=>(u,f)=>{let A=f||{},{queryParameters:c}=A,g=Si(A,[\"queryParameters\"]),t=dt({acl:u},c!==void 0?{queryParameters:c}:{}),C=(x,D)=>Wt.createRetryablePromise(L=>rd(i)(x.key,D).catch(N=>{if(N.status!==404)throw N;return L()}));return Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Post,path:\"1/keys\",data:t},g),C)},Tz=i=>(u,f,c)=>{let g=jo.createMappedRequestOptions(c);return g.queryParameters[\"X-Algolia-User-ID\"]=u,i.transporter.write({method:Rn.MethodEnum.Post,path:\"1/clusters/mapping\",data:{cluster:f}},g)},xz=i=>(u,f,c)=>i.transporter.write({method:Rn.MethodEnum.Post,path:\"1/clusters/mapping/batch\",data:{users:u,cluster:f}},c),vm=i=>(u,f,c)=>{let g=(t,C)=>id(i)(u,{methods:{waitTask:z0}}).waitTask(t.taskID,C);return Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Post,path:Wt.encode(\"1/indexes/%s/operation\",u),data:{operation:\"copy\",destination:f}},c),g)},kz=i=>(u,f,c)=>vm(i)(u,f,zn(dt({},c),{scope:[gm.Rules]})),Az=i=>(u,f,c)=>vm(i)(u,f,zn(dt({},c),{scope:[gm.Settings]})),Oz=i=>(u,f,c)=>vm(i)(u,f,zn(dt({},c),{scope:[gm.Synonyms]})),Iz=i=>(u,f)=>{let c=(g,t)=>Wt.createRetryablePromise(C=>rd(i)(u,t).then(C).catch(A=>{if(A.status!==404)throw A}));return Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Delete,path:Wt.encode(\"1/keys/%s\",u)},f),c)},Pz=()=>(i,u)=>{let f=jo.serializeQueryParameters(u),c=Ez.createHmac(\"sha256\",i).update(f).digest(\"hex\");return Buffer.from(c+f).toString(\"base64\")},rd=i=>(u,f)=>i.transporter.read({method:Rn.MethodEnum.Get,path:Wt.encode(\"1/keys/%s\",u)},f),Mz=i=>u=>i.transporter.read({method:Rn.MethodEnum.Get,path:\"1/logs\"},u),Fz=()=>i=>{let u=Buffer.from(i,\"base64\").toString(\"ascii\"),f=/validUntil=(\\d+)/,c=u.match(f);if(c===null)throw VC();return parseInt(c[1],10)-Math.round(new Date().getTime()/1e3)},Lz=i=>u=>i.transporter.read({method:Rn.MethodEnum.Get,path:\"1/clusters/mapping/top\"},u),Rz=i=>(u,f)=>i.transporter.read({method:Rn.MethodEnum.Get,path:Wt.encode(\"1/clusters/mapping/%s\",u)},f),Nz=i=>u=>{let g=u||{},{retrieveMappings:f}=g,c=Si(g,[\"retrieveMappings\"]);return f===!0&&(c.getClusters=!0),i.transporter.read({method:Rn.MethodEnum.Get,path:\"1/clusters/mapping/pending\"},c)},id=i=>(u,f={})=>{let c={transporter:i.transporter,appId:i.appId,indexName:u};return Wt.addMethods(c,f.methods)},Bz=i=>u=>i.transporter.read({method:Rn.MethodEnum.Get,path:\"1/keys\"},u),jz=i=>u=>i.transporter.read({method:Rn.MethodEnum.Get,path:\"1/clusters\"},u),Uz=i=>u=>i.transporter.read({method:Rn.MethodEnum.Get,path:\"1/indexes\"},u),qz=i=>u=>i.transporter.read({method:Rn.MethodEnum.Get,path:\"1/clusters/mapping\"},u),zz=i=>(u,f,c)=>{let g=(t,C)=>id(i)(u,{methods:{waitTask:z0}}).waitTask(t.taskID,C);return Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Post,path:Wt.encode(\"1/indexes/%s/operation\",u),data:{operation:\"move\",destination:f}},c),g)},Wz=i=>(u,f)=>{let c=(g,t)=>Promise.all(Object.keys(g.taskID).map(C=>id(i)(C,{methods:{waitTask:z0}}).waitTask(g.taskID[C],t)));return Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Post,path:\"1/indexes/*/batch\",data:{requests:u}},f),c)},Hz=i=>(u,f)=>i.transporter.read({method:Rn.MethodEnum.Post,path:\"1/indexes/*/objects\",data:{requests:u}},f),bz=i=>(u,f)=>{let c=u.map(g=>zn(dt({},g),{params:jo.serializeQueryParameters(g.params||{})}));return i.transporter.read({method:Rn.MethodEnum.Post,path:\"1/indexes/*/queries\",data:{requests:c},cacheable:!0},f)},Gz=i=>(u,f)=>Promise.all(u.map(c=>{let A=c.params,{facetName:g,facetQuery:t}=A,C=Si(A,[\"facetName\",\"facetQuery\"]);return id(i)(c.indexName,{methods:{searchForFacetValues:YC}}).searchForFacetValues(g,t,dt(dt({},f),C))})),Vz=i=>(u,f)=>{let c=jo.createMappedRequestOptions(f);return c.queryParameters[\"X-Algolia-User-ID\"]=u,i.transporter.write({method:Rn.MethodEnum.Delete,path:\"1/clusters/mapping\"},c)},Yz=i=>(u,f)=>{let c=(g,t)=>Wt.createRetryablePromise(C=>rd(i)(u,t).catch(A=>{if(A.status!==404)throw A;return C()}));return Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Post,path:Wt.encode(\"1/keys/%s/restore\",u)},f),c)},$z=i=>(u,f)=>i.transporter.read({method:Rn.MethodEnum.Post,path:\"1/clusters/mapping/search\",data:{query:u}},f),Kz=i=>(u,f)=>{let c=Object.assign({},f),L=f||{},{queryParameters:g}=L,t=Si(L,[\"queryParameters\"]),C=g?{queryParameters:g}:{},A=[\"acl\",\"indexes\",\"referers\",\"restrictSources\",\"queryParameters\",\"description\",\"maxQueriesPerIPPerHour\",\"maxHitsPerQuery\"],x=N=>Object.keys(c).filter(j=>A.indexOf(j)!==-1).every(j=>N[j]===c[j]),D=(N,j)=>Wt.createRetryablePromise($=>rd(i)(u,j).then(h=>x(h)?Promise.resolve():$()));return Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Put,path:Wt.encode(\"1/keys/%s\",u),data:C},t),D)},$C=i=>(u,f)=>{let c=(g,t)=>z0(i)(g.taskID,t);return Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Post,path:Wt.encode(\"1/indexes/%s/batch\",i.indexName),data:{requests:u}},f),c)},Xz=i=>u=>mm(zn(dt({},u),{shouldStop:f=>f.cursor===void 0,request:f=>i.transporter.read({method:Rn.MethodEnum.Post,path:Wt.encode(\"1/indexes/%s/browse\",i.indexName),data:f},u)})),Jz=i=>u=>{let f=dt({hitsPerPage:1e3},u);return mm(zn(dt({},f),{shouldStop:c=>c.hits.length<f.hitsPerPage,request(c){return KC(i)(\"\",dt(dt({},f),c)).then(g=>zn(dt({},g),{hits:g.hits.map(t=>(delete t._highlightResult,t))}))}}))},Qz=i=>u=>{let f=dt({hitsPerPage:1e3},u);return mm(zn(dt({},f),{shouldStop:c=>c.hits.length<f.hitsPerPage,request(c){return XC(i)(\"\",dt(dt({},f),c)).then(g=>zn(dt({},g),{hits:g.hits.map(t=>(delete t._highlightResult,t))}))}}))},_m=i=>(u,f,c)=>{let x=c||{},{batchSize:g}=x,t=Si(x,[\"batchSize\"]),C={taskIDs:[],objectIDs:[]},A=(D=0)=>{let L=[],N;for(N=D;N<u.length&&(L.push(u[N]),L.length!==(g||1e3));N++);return L.length===0?Promise.resolve(C):$C(i)(L.map(j=>({action:f,body:j})),t).then(j=>(C.objectIDs=C.objectIDs.concat(j.objectIDs),C.taskIDs.push(j.taskID),N++,A(N)))};return Wt.createWaitablePromise(A(),(D,L)=>Promise.all(D.taskIDs.map(N=>z0(i)(N,L))))},Zz=i=>u=>Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Post,path:Wt.encode(\"1/indexes/%s/clear\",i.indexName)},u),(f,c)=>z0(i)(f.taskID,c)),eW=i=>u=>{let t=u||{},{forwardToReplicas:f}=t,c=Si(t,[\"forwardToReplicas\"]),g=jo.createMappedRequestOptions(c);return f&&(g.queryParameters.forwardToReplicas=1),Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Post,path:Wt.encode(\"1/indexes/%s/rules/clear\",i.indexName)},g),(C,A)=>z0(i)(C.taskID,A))},tW=i=>u=>{let t=u||{},{forwardToReplicas:f}=t,c=Si(t,[\"forwardToReplicas\"]),g=jo.createMappedRequestOptions(c);return f&&(g.queryParameters.forwardToReplicas=1),Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Post,path:Wt.encode(\"1/indexes/%s/synonyms/clear\",i.indexName)},g),(C,A)=>z0(i)(C.taskID,A))},nW=i=>(u,f)=>Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Post,path:Wt.encode(\"1/indexes/%s/deleteByQuery\",i.indexName),data:u},f),(c,g)=>z0(i)(c.taskID,g)),rW=i=>u=>Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Delete,path:Wt.encode(\"1/indexes/%s\",i.indexName)},u),(f,c)=>z0(i)(f.taskID,c)),iW=i=>(u,f)=>Wt.createWaitablePromise(JC(i)([u],f).then(c=>({taskID:c.taskIDs[0]})),(c,g)=>z0(i)(c.taskID,g)),JC=i=>(u,f)=>{let c=u.map(g=>({objectID:g}));return _m(i)(c,Cc.DeleteObject,f)},oW=i=>(u,f)=>{let C=f||{},{forwardToReplicas:c}=C,g=Si(C,[\"forwardToReplicas\"]),t=jo.createMappedRequestOptions(g);return c&&(t.queryParameters.forwardToReplicas=1),Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Delete,path:Wt.encode(\"1/indexes/%s/rules/%s\",i.indexName,u)},t),(A,x)=>z0(i)(A.taskID,x))},uW=i=>(u,f)=>{let C=f||{},{forwardToReplicas:c}=C,g=Si(C,[\"forwardToReplicas\"]),t=jo.createMappedRequestOptions(g);return c&&(t.queryParameters.forwardToReplicas=1),Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Delete,path:Wt.encode(\"1/indexes/%s/synonyms/%s\",i.indexName,u)},t),(A,x)=>z0(i)(A.taskID,x))},sW=i=>u=>QC(i)(u).then(()=>!0).catch(f=>{if(f.status!==404)throw f;return!1}),lW=i=>(u,f)=>{let x=f||{},{query:c,paginate:g}=x,t=Si(x,[\"query\",\"paginate\"]),C=0,A=()=>ZC(i)(c||\"\",zn(dt({},t),{page:C})).then(D=>{for(let[L,N]of Object.entries(D.hits))if(u(N))return{object:N,position:parseInt(L,10),page:C};if(C++,g===!1||C>=D.nbPages)throw GC();return A()});return A()},fW=i=>(u,f)=>i.transporter.read({method:Rn.MethodEnum.Get,path:Wt.encode(\"1/indexes/%s/%s\",i.indexName,u)},f),cW=()=>(i,u)=>{for(let[f,c]of Object.entries(i.hits))if(c.objectID===u)return parseInt(f,10);return-1},aW=i=>(u,f)=>{let C=f||{},{attributesToRetrieve:c}=C,g=Si(C,[\"attributesToRetrieve\"]),t=u.map(A=>dt({indexName:i.indexName,objectID:A},c?{attributesToRetrieve:c}:{}));return i.transporter.read({method:Rn.MethodEnum.Post,path:\"1/indexes/*/objects\",data:{requests:t}},g)},dW=i=>(u,f)=>i.transporter.read({method:Rn.MethodEnum.Get,path:Wt.encode(\"1/indexes/%s/rules/%s\",i.indexName,u)},f),QC=i=>u=>i.transporter.read({method:Rn.MethodEnum.Get,path:Wt.encode(\"1/indexes/%s/settings\",i.indexName),data:{getVersion:2}},u),pW=i=>(u,f)=>i.transporter.read({method:Rn.MethodEnum.Get,path:Wt.encode(\"1/indexes/%s/synonyms/%s\",i.indexName,u)},f),eT=i=>(u,f)=>i.transporter.read({method:Rn.MethodEnum.Get,path:Wt.encode(\"1/indexes/%s/task/%s\",i.indexName,u.toString())},f),hW=i=>(u,f)=>Wt.createWaitablePromise(tT(i)([u],f).then(c=>({objectID:c.objectIDs[0],taskID:c.taskIDs[0]})),(c,g)=>z0(i)(c.taskID,g)),tT=i=>(u,f)=>{let C=f||{},{createIfNotExists:c}=C,g=Si(C,[\"createIfNotExists\"]),t=c?Cc.PartialUpdateObject:Cc.PartialUpdateObjectNoCreate;return _m(i)(u,t,g)},mW=i=>(u,f)=>{let h=f||{},{safe:c,autoGenerateObjectIDIfNotExist:g,batchSize:t}=h,C=Si(h,[\"safe\",\"autoGenerateObjectIDIfNotExist\",\"batchSize\"]),A=(re,ce,Q,oe)=>Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Post,path:Wt.encode(\"1/indexes/%s/operation\",re),data:{operation:Q,destination:ce}},oe),(Se,me)=>z0(i)(Se.taskID,me)),x=Math.random().toString(36).substring(7),D=`${i.indexName}_tmp_${x}`,L=rw({appId:i.appId,transporter:i.transporter,indexName:D}),N=[],j=A(i.indexName,D,\"copy\",zn(dt({},C),{scope:[\"settings\",\"synonyms\",\"rules\"]}));N.push(j);let $=(c?j.wait(C):j).then(()=>{let re=L(u,zn(dt({},C),{autoGenerateObjectIDIfNotExist:g,batchSize:t}));return N.push(re),c?re.wait(C):re}).then(()=>{let re=A(D,i.indexName,\"move\",C);return N.push(re),c?re.wait(C):re}).then(()=>Promise.all(N)).then(([re,ce,Q])=>({objectIDs:ce.objectIDs,taskIDs:[re.taskID,...ce.taskIDs,Q.taskID]}));return Wt.createWaitablePromise($,(re,ce)=>Promise.all(N.map(Q=>Q.wait(ce))))},vW=i=>(u,f)=>iw(i)(u,zn(dt({},f),{clearExistingRules:!0})),gW=i=>(u,f)=>ow(i)(u,zn(dt({},f),{replaceExistingSynonyms:!0})),_W=i=>(u,f)=>Wt.createWaitablePromise(rw(i)([u],f).then(c=>({objectID:c.objectIDs[0],taskID:c.taskIDs[0]})),(c,g)=>z0(i)(c.taskID,g)),rw=i=>(u,f)=>{let C=f||{},{autoGenerateObjectIDIfNotExist:c}=C,g=Si(C,[\"autoGenerateObjectIDIfNotExist\"]),t=c?Cc.AddObject:Cc.UpdateObject;if(t===Cc.UpdateObject){for(let A of u)if(A.objectID===void 0)return Wt.createWaitablePromise(Promise.reject(bC()))}return _m(i)(u,t,g)},yW=i=>(u,f)=>iw(i)([u],f),iw=i=>(u,f)=>{let A=f||{},{forwardToReplicas:c,clearExistingRules:g}=A,t=Si(A,[\"forwardToReplicas\",\"clearExistingRules\"]),C=jo.createMappedRequestOptions(t);return c&&(C.queryParameters.forwardToReplicas=1),g&&(C.queryParameters.clearExistingRules=1),Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Post,path:Wt.encode(\"1/indexes/%s/rules/batch\",i.indexName),data:u},C),(x,D)=>z0(i)(x.taskID,D))},wW=i=>(u,f)=>ow(i)([u],f),ow=i=>(u,f)=>{let A=f||{},{forwardToReplicas:c,replaceExistingSynonyms:g}=A,t=Si(A,[\"forwardToReplicas\",\"replaceExistingSynonyms\"]),C=jo.createMappedRequestOptions(t);return c&&(C.queryParameters.forwardToReplicas=1),g&&(C.queryParameters.replaceExistingSynonyms=1),Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Post,path:Wt.encode(\"1/indexes/%s/synonyms/batch\",i.indexName),data:u},C),(x,D)=>z0(i)(x.taskID,D))},ZC=i=>(u,f)=>i.transporter.read({method:Rn.MethodEnum.Post,path:Wt.encode(\"1/indexes/%s/query\",i.indexName),data:{query:u},cacheable:!0},f),YC=i=>(u,f,c)=>i.transporter.read({method:Rn.MethodEnum.Post,path:Wt.encode(\"1/indexes/%s/facets/%s/query\",i.indexName,u),data:{facetQuery:f},cacheable:!0},c),KC=i=>(u,f)=>i.transporter.read({method:Rn.MethodEnum.Post,path:Wt.encode(\"1/indexes/%s/rules/search\",i.indexName),data:{query:u}},f),XC=i=>(u,f)=>i.transporter.read({method:Rn.MethodEnum.Post,path:Wt.encode(\"1/indexes/%s/synonyms/search\",i.indexName),data:{query:u}},f),DW=i=>(u,f)=>{let C=f||{},{forwardToReplicas:c}=C,g=Si(C,[\"forwardToReplicas\"]),t=jo.createMappedRequestOptions(g);return c&&(t.queryParameters.forwardToReplicas=1),Wt.createWaitablePromise(i.transporter.write({method:Rn.MethodEnum.Put,path:Wt.encode(\"1/indexes/%s/settings\",i.indexName),data:u},t),(A,x)=>z0(i)(A.taskID,x))},z0=i=>(u,f)=>Wt.createRetryablePromise(c=>eT(i)(u,f).then(g=>g.status!==\"published\"?c():void 0)),EW={AddObject:\"addObject\",Analytics:\"analytics\",Browser:\"browse\",DeleteIndex:\"deleteIndex\",DeleteObject:\"deleteObject\",EditSettings:\"editSettings\",ListIndexes:\"listIndexes\",Logs:\"logs\",Recommendation:\"recommendation\",Search:\"search\",SeeUnretrievableAttributes:\"seeUnretrievableAttributes\",Settings:\"settings\",Usage:\"usage\"},Cc={AddObject:\"addObject\",UpdateObject:\"updateObject\",PartialUpdateObject:\"partialUpdateObject\",PartialUpdateObjectNoCreate:\"partialUpdateObjectNoCreate\",DeleteObject:\"deleteObject\"},gm={Settings:\"settings\",Synonyms:\"synonyms\",Rules:\"rules\"},SW={None:\"none\",StopIfEnoughMatches:\"stopIfEnoughMatches\"},CW={Synonym:\"synonym\",OneWaySynonym:\"oneWaySynonym\",AltCorrection1:\"altCorrection1\",AltCorrection2:\"altCorrection2\",Placeholder:\"placeholder\"};yt.ApiKeyACLEnum=EW;yt.BatchActionEnum=Cc;yt.ScopeEnum=gm;yt.StrategyEnum=SW;yt.SynonymEnum=CW;yt.addApiKey=Cz;yt.assignUserID=Tz;yt.assignUserIDs=xz;yt.batch=$C;yt.browseObjects=Xz;yt.browseRules=Jz;yt.browseSynonyms=Qz;yt.chunkedBatch=_m;yt.clearObjects=Zz;yt.clearRules=eW;yt.clearSynonyms=tW;yt.copyIndex=vm;yt.copyRules=kz;yt.copySettings=Az;yt.copySynonyms=Oz;yt.createBrowsablePromise=mm;yt.createMissingObjectIDError=bC;yt.createObjectNotFoundError=GC;yt.createSearchClient=Sz;yt.createValidUntilNotFoundError=VC;yt.deleteApiKey=Iz;yt.deleteBy=nW;yt.deleteIndex=rW;yt.deleteObject=iW;yt.deleteObjects=JC;yt.deleteRule=oW;yt.deleteSynonym=uW;yt.exists=sW;yt.findObject=lW;yt.generateSecuredApiKey=Pz;yt.getApiKey=rd;yt.getLogs=Mz;yt.getObject=fW;yt.getObjectPosition=cW;yt.getObjects=aW;yt.getRule=dW;yt.getSecuredApiKeyRemainingValidity=Fz;yt.getSettings=QC;yt.getSynonym=pW;yt.getTask=eT;yt.getTopUserIDs=Lz;yt.getUserID=Rz;yt.hasPendingMappings=Nz;yt.initIndex=id;yt.listApiKeys=Bz;yt.listClusters=jz;yt.listIndices=Uz;yt.listUserIDs=qz;yt.moveIndex=zz;yt.multipleBatch=Wz;yt.multipleGetObjects=Hz;yt.multipleQueries=bz;yt.multipleSearchForFacetValues=Gz;yt.partialUpdateObject=hW;yt.partialUpdateObjects=tT;yt.removeUserID=Vz;yt.replaceAllObjects=mW;yt.replaceAllRules=vW;yt.replaceAllSynonyms=gW;yt.restoreApiKey=Yz;yt.saveObject=_W;yt.saveObjects=rw;yt.saveRule=yW;yt.saveRules=iw;yt.saveSynonym=wW;yt.saveSynonyms=ow;yt.search=ZC;yt.searchForFacetValues=YC;yt.searchRules=KC;yt.searchSynonyms=XC;yt.searchUserIDs=$z;yt.setSettings=DW;yt.updateApiKey=Kz;yt.waitTask=z0});var iT=Me((SV,rT)=>{rT.exports=nT()});var oT=Me(ym=>{\"use strict\";Object.defineProperty(ym,\"__esModule\",{value:!0});function TW(){return{debug(i,u){return Promise.resolve()},info(i,u){return Promise.resolve()},error(i,u){return Promise.resolve()}}}var xW={Debug:1,Info:2,Error:3};ym.LogLevelEnum=xW;ym.createNullLogger=TW});var sT=Me((TV,uT)=>{uT.exports=oT()});var cT=Me(uw=>{\"use strict\";Object.defineProperty(uw,\"__esModule\",{value:!0});var lT=require(\"http\"),fT=require(\"https\"),kW=require(\"url\");function AW(){let i={keepAlive:!0},u=new lT.Agent(i),f=new fT.Agent(i);return{send(c){return new Promise(g=>{let t=kW.parse(c.url),C=t.query===null?t.pathname:`${t.pathname}?${t.query}`,A=dt({agent:t.protocol===\"https:\"?f:u,hostname:t.hostname,path:C,method:c.method,headers:c.headers},t.port!==void 0?{port:t.port||\"\"}:{}),x=(t.protocol===\"https:\"?fT:lT).request(A,j=>{let $=\"\";j.on(\"data\",h=>$+=h),j.on(\"end\",()=>{clearTimeout(L),clearTimeout(N),g({status:j.statusCode||0,content:$,isTimedOut:!1})})}),D=(j,$)=>setTimeout(()=>{x.abort(),g({status:0,content:$,isTimedOut:!0})},j*1e3),L=D(c.connectTimeout,\"Connection timeout\"),N;x.on(\"error\",j=>{clearTimeout(L),clearTimeout(N),g({status:0,content:j.message,isTimedOut:!1})}),x.once(\"response\",()=>{clearTimeout(L),N=D(c.responseTimeout,\"Socket timeout\")}),c.data!==void 0&&x.write(c.data),x.end()})},destroy(){return u.destroy(),f.destroy(),Promise.resolve()}}}uw.createNodeHttpRequester=AW});var dT=Me((kV,aT)=>{aT.exports=cT()});var vT=Me((AV,pT)=>{\"use strict\";var hT=dC(),OW=mC(),Ma=UC(),sw=Q2(),lw=HC(),Mt=iT(),IW=sT(),PW=dT(),MW=ed();function mT(i,u,f){let c={appId:i,apiKey:u,timeouts:{connect:2,read:5,write:30},requester:PW.createNodeHttpRequester(),logger:IW.createNullLogger(),responsesCache:hT.createNullCache(),requestsCache:hT.createNullCache(),hostsCache:OW.createInMemoryCache(),userAgent:MW.createUserAgent(sw.version).add({segment:\"Node.js\",version:process.versions.node})};return Mt.createSearchClient(zn(dt(dt({},c),f),{methods:{search:Mt.multipleQueries,searchForFacetValues:Mt.multipleSearchForFacetValues,multipleBatch:Mt.multipleBatch,multipleGetObjects:Mt.multipleGetObjects,multipleQueries:Mt.multipleQueries,copyIndex:Mt.copyIndex,copySettings:Mt.copySettings,copyRules:Mt.copyRules,copySynonyms:Mt.copySynonyms,moveIndex:Mt.moveIndex,listIndices:Mt.listIndices,getLogs:Mt.getLogs,listClusters:Mt.listClusters,multipleSearchForFacetValues:Mt.multipleSearchForFacetValues,getApiKey:Mt.getApiKey,addApiKey:Mt.addApiKey,listApiKeys:Mt.listApiKeys,updateApiKey:Mt.updateApiKey,deleteApiKey:Mt.deleteApiKey,restoreApiKey:Mt.restoreApiKey,assignUserID:Mt.assignUserID,assignUserIDs:Mt.assignUserIDs,getUserID:Mt.getUserID,searchUserIDs:Mt.searchUserIDs,listUserIDs:Mt.listUserIDs,getTopUserIDs:Mt.getTopUserIDs,removeUserID:Mt.removeUserID,hasPendingMappings:Mt.hasPendingMappings,generateSecuredApiKey:Mt.generateSecuredApiKey,getSecuredApiKeyRemainingValidity:Mt.getSecuredApiKeyRemainingValidity,destroy:sw.destroy,initIndex:g=>t=>Mt.initIndex(g)(t,{methods:{batch:Mt.batch,delete:Mt.deleteIndex,getObject:Mt.getObject,getObjects:Mt.getObjects,saveObject:Mt.saveObject,saveObjects:Mt.saveObjects,search:Mt.search,searchForFacetValues:Mt.searchForFacetValues,waitTask:Mt.waitTask,setSettings:Mt.setSettings,getSettings:Mt.getSettings,partialUpdateObject:Mt.partialUpdateObject,partialUpdateObjects:Mt.partialUpdateObjects,deleteObject:Mt.deleteObject,deleteObjects:Mt.deleteObjects,deleteBy:Mt.deleteBy,clearObjects:Mt.clearObjects,browseObjects:Mt.browseObjects,getObjectPosition:Mt.getObjectPosition,findObject:Mt.findObject,exists:Mt.exists,saveSynonym:Mt.saveSynonym,saveSynonyms:Mt.saveSynonyms,getSynonym:Mt.getSynonym,searchSynonyms:Mt.searchSynonyms,browseSynonyms:Mt.browseSynonyms,deleteSynonym:Mt.deleteSynonym,clearSynonyms:Mt.clearSynonyms,replaceAllObjects:Mt.replaceAllObjects,replaceAllSynonyms:Mt.replaceAllSynonyms,searchRules:Mt.searchRules,getRule:Mt.getRule,deleteRule:Mt.deleteRule,saveRule:Mt.saveRule,saveRules:Mt.saveRules,replaceAllRules:Mt.replaceAllRules,browseRules:Mt.browseRules,clearRules:Mt.clearRules}}),initAnalytics:()=>g=>Ma.createAnalyticsClient(zn(dt(dt({},c),g),{methods:{addABTest:Ma.addABTest,getABTest:Ma.getABTest,getABTests:Ma.getABTests,stopABTest:Ma.stopABTest,deleteABTest:Ma.deleteABTest}})),initRecommendation:()=>g=>lw.createRecommendationClient(zn(dt(dt({},c),g),{methods:{getPersonalizationStrategy:lw.getPersonalizationStrategy,setPersonalizationStrategy:lw.setPersonalizationStrategy}}))}}))}mT.version=sw.version;pT.exports=mT});var _T=Me((OV,fw)=>{var gT=vT();fw.exports=gT;fw.exports.default=gT});var rf=Me(dw=>{\"use strict\";Object.defineProperty(dw,\"__esModule\",{value:!0});dw.default=kT;function kT(){}kT.prototype={diff:function(u,f){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},g=c.callback;typeof c==\"function\"&&(g=c,c={}),this.options=c;var t=this;function C(re){return g?(setTimeout(function(){g(void 0,re)},0),!0):re}u=this.castInput(u),f=this.castInput(f),u=this.removeEmpty(this.tokenize(u)),f=this.removeEmpty(this.tokenize(f));var A=f.length,x=u.length,D=1,L=A+x,N=[{newPos:-1,components:[]}],j=this.extractCommon(N[0],f,u,0);if(N[0].newPos+1>=A&&j+1>=x)return C([{value:this.join(f),count:f.length}]);function $(){for(var re=-1*D;re<=D;re+=2){var ce=void 0,Q=N[re-1],oe=N[re+1],Se=(oe?oe.newPos:0)-re;Q&&(N[re-1]=void 0);var me=Q&&Q.newPos+1<A,De=oe&&0<=Se&&Se<x;if(!me&&!De){N[re]=void 0;continue}if(!me||De&&Q.newPos<oe.newPos?(ce=RW(oe),t.pushComponent(ce.components,void 0,!0)):(ce=Q,ce.newPos++,t.pushComponent(ce.components,!0,void 0)),Se=t.extractCommon(ce,f,u,re),ce.newPos+1>=A&&Se+1>=x)return C(LW(t,ce.components,f,u,t.useLongestToken));N[re]=ce}D++}if(g)(function re(){setTimeout(function(){if(D>L)return g();$()||re()},0)})();else for(;D<=L;){var h=$();if(h)return h}},pushComponent:function(u,f,c){var g=u[u.length-1];g&&g.added===f&&g.removed===c?u[u.length-1]={count:g.count+1,added:f,removed:c}:u.push({count:1,added:f,removed:c})},extractCommon:function(u,f,c,g){for(var t=f.length,C=c.length,A=u.newPos,x=A-g,D=0;A+1<t&&x+1<C&&this.equals(f[A+1],c[x+1]);)A++,x++,D++;return D&&u.components.push({count:D}),u.newPos=A,x},equals:function(u,f){return this.options.comparator?this.options.comparator(u,f):u===f||this.options.ignoreCase&&u.toLowerCase()===f.toLowerCase()},removeEmpty:function(u){for(var f=[],c=0;c<u.length;c++)u[c]&&f.push(u[c]);return f},castInput:function(u){return u},tokenize:function(u){return u.split(\"\")},join:function(u){return u.join(\"\")}};function LW(i,u,f,c,g){for(var t=0,C=u.length,A=0,x=0;t<C;t++){var D=u[t];if(D.removed){if(D.value=i.join(c.slice(x,x+D.count)),x+=D.count,t&&u[t-1].added){var N=u[t-1];u[t-1]=u[t],u[t]=N}}else{if(!D.added&&g){var L=f.slice(A,A+D.count);L=L.map(function($,h){var re=c[x+h];return re.length>$.length?re:$}),D.value=i.join(L)}else D.value=i.join(f.slice(A,A+D.count));A+=D.count,D.added||(x+=D.count)}}var j=u[C-1];return C>1&&typeof j.value==\"string\"&&(j.added||j.removed)&&i.equals(\"\",j.value)&&(u[C-2].value+=j.value,u.pop()),u}function RW(i){return{newPos:i.newPos,components:i.components.slice(0)}}});var OT=Me(ld=>{\"use strict\";Object.defineProperty(ld,\"__esModule\",{value:!0});ld.diffChars=NW;ld.characterDiff=void 0;var jW=BW(rf());function BW(i){return i&&i.__esModule?i:{default:i}}var AT=new jW.default;ld.characterDiff=AT;function NW(i,u,f){return AT.diff(i,u,f)}});var hw=Me(pw=>{\"use strict\";Object.defineProperty(pw,\"__esModule\",{value:!0});pw.generateOptions=UW;function UW(i,u){if(typeof i==\"function\")u.callback=i;else if(i)for(var f in i)i.hasOwnProperty(f)&&(u[f]=i[f]);return u}});var MT=Me(Fa=>{\"use strict\";Object.defineProperty(Fa,\"__esModule\",{value:!0});Fa.diffWords=qW;Fa.diffWordsWithSpace=zW;Fa.wordDiff=void 0;var HW=WW(rf()),bW=hw();function WW(i){return i&&i.__esModule?i:{default:i}}var IT=/^[A-Za-z\\xC0-\\u02C6\\u02C8-\\u02D7\\u02DE-\\u02FF\\u1E00-\\u1EFF]+$/,PT=/\\S/,fd=new HW.default;Fa.wordDiff=fd;fd.equals=function(i,u){return this.options.ignoreCase&&(i=i.toLowerCase(),u=u.toLowerCase()),i===u||this.options.ignoreWhitespace&&!PT.test(i)&&!PT.test(u)};fd.tokenize=function(i){for(var u=i.split(/(\\s+|[()[\\]{}'\"]|\\b)/),f=0;f<u.length-1;f++)!u[f+1]&&u[f+2]&&IT.test(u[f])&&IT.test(u[f+2])&&(u[f]+=u[f+2],u.splice(f+1,2),f--);return u};function qW(i,u,f){return f=(0,bW.generateOptions)(f,{ignoreWhitespace:!0}),fd.diff(i,u,f)}function zW(i,u,f){return fd.diff(i,u,f)}});var Em=Me(La=>{\"use strict\";Object.defineProperty(La,\"__esModule\",{value:!0});La.diffLines=GW;La.diffTrimmedLines=VW;La.lineDiff=void 0;var $W=YW(rf()),KW=hw();function YW(i){return i&&i.__esModule?i:{default:i}}var Dm=new $W.default;La.lineDiff=Dm;Dm.tokenize=function(i){var u=[],f=i.split(/(\\n|\\r\\n)/);f[f.length-1]||f.pop();for(var c=0;c<f.length;c++){var g=f[c];c%2&&!this.options.newlineIsToken?u[u.length-1]+=g:(this.options.ignoreWhitespace&&(g=g.trim()),u.push(g))}return u};function GW(i,u,f){return Dm.diff(i,u,f)}function VW(i,u,f){var c=(0,KW.generateOptions)(f,{ignoreWhitespace:!0});return Dm.diff(i,u,c)}});var FT=Me(cd=>{\"use strict\";Object.defineProperty(cd,\"__esModule\",{value:!0});cd.diffSentences=XW;cd.sentenceDiff=void 0;var QW=JW(rf());function JW(i){return i&&i.__esModule?i:{default:i}}var mw=new QW.default;cd.sentenceDiff=mw;mw.tokenize=function(i){return i.split(/(\\S.+?[.!?])(?=\\s+|$)/)};function XW(i,u,f){return mw.diff(i,u,f)}});var LT=Me(ad=>{\"use strict\";Object.defineProperty(ad,\"__esModule\",{value:!0});ad.diffCss=ZW;ad.cssDiff=void 0;var tH=eH(rf());function eH(i){return i&&i.__esModule?i:{default:i}}var vw=new tH.default;ad.cssDiff=vw;vw.tokenize=function(i){return i.split(/([{}:;,]|\\s+)/)};function ZW(i,u,f){return vw.diff(i,u,f)}});var NT=Me(Ra=>{\"use strict\";Object.defineProperty(Ra,\"__esModule\",{value:!0});Ra.diffJson=nH;Ra.canonicalize=Sm;Ra.jsonDiff=void 0;var RT=rH(rf()),iH=Em();function rH(i){return i&&i.__esModule?i:{default:i}}function Cm(i){return typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?Cm=function(f){return typeof f}:Cm=function(f){return f&&typeof Symbol==\"function\"&&f.constructor===Symbol&&f!==Symbol.prototype?\"symbol\":typeof f},Cm(i)}var oH=Object.prototype.toString,xc=new RT.default;Ra.jsonDiff=xc;xc.useLongestToken=!0;xc.tokenize=iH.lineDiff.tokenize;xc.castInput=function(i){var u=this.options,f=u.undefinedReplacement,c=u.stringifyReplacer,g=c===void 0?function(t,C){return typeof C==\"undefined\"?f:C}:c;return typeof i==\"string\"?i:JSON.stringify(Sm(i,null,null,g),g,\"  \")};xc.equals=function(i,u){return RT.default.prototype.equals.call(xc,i.replace(/,([\\r\\n])/g,\"$1\"),u.replace(/,([\\r\\n])/g,\"$1\"))};function nH(i,u,f){return xc.diff(i,u,f)}function Sm(i,u,f,c,g){u=u||[],f=f||[],c&&(i=c(g,i));var t;for(t=0;t<u.length;t+=1)if(u[t]===i)return f[t];var C;if(oH.call(i)===\"[object Array]\"){for(u.push(i),C=new Array(i.length),f.push(C),t=0;t<i.length;t+=1)C[t]=Sm(i[t],u,f,c,g);return u.pop(),f.pop(),C}if(i&&i.toJSON&&(i=i.toJSON()),Cm(i)===\"object\"&&i!==null){u.push(i),C={},f.push(C);var A=[],x;for(x in i)i.hasOwnProperty(x)&&A.push(x);for(A.sort(),t=0;t<A.length;t+=1)x=A[t],C[x]=Sm(i[x],u,f,c,x);u.pop(),f.pop()}else C=i;return C}});var BT=Me(dd=>{\"use strict\";Object.defineProperty(dd,\"__esModule\",{value:!0});dd.diffArrays=uH;dd.arrayDiff=void 0;var lH=sH(rf());function sH(i){return i&&i.__esModule?i:{default:i}}var pd=new lH.default;dd.arrayDiff=pd;pd.tokenize=function(i){return i.slice()};pd.join=pd.removeEmpty=function(i){return i};function uH(i,u,f){return pd.diff(i,u,f)}});var Tm=Me(gw=>{\"use strict\";Object.defineProperty(gw,\"__esModule\",{value:!0});gw.parsePatch=fH;function fH(i){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=i.split(/\\r\\n|[\\n\\v\\f\\r\\x85]/),c=i.match(/\\r\\n|[\\n\\v\\f\\r\\x85]/g)||[],g=[],t=0;function C(){var D={};for(g.push(D);t<f.length;){var L=f[t];if(/^(\\-\\-\\-|\\+\\+\\+|@@)\\s/.test(L))break;var N=/^(?:Index:|diff(?: -r \\w+)+)\\s+(.+?)\\s*$/.exec(L);N&&(D.index=N[1]),t++}for(A(D),A(D),D.hunks=[];t<f.length;){var j=f[t];if(/^(Index:|diff|\\-\\-\\-|\\+\\+\\+)\\s/.test(j))break;if(/^@@/.test(j))D.hunks.push(x());else{if(j&&u.strict)throw new Error(\"Unknown line \"+(t+1)+\" \"+JSON.stringify(j));t++}}}function A(D){var L=/^(---|\\+\\+\\+)\\s+(.*)$/.exec(f[t]);if(L){var N=L[1]===\"---\"?\"old\":\"new\",j=L[2].split(\"\t\",2),$=j[0].replace(/\\\\\\\\/g,\"\\\\\");/^\".*\"$/.test($)&&($=$.substr(1,$.length-2)),D[N+\"FileName\"]=$,D[N+\"Header\"]=(j[1]||\"\").trim(),t++}}function x(){for(var D=t,L=f[t++],N=L.split(/@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@/),j={oldStart:+N[1],oldLines:+N[2]||1,newStart:+N[3],newLines:+N[4]||1,lines:[],linedelimiters:[]},$=0,h=0;t<f.length&&!(f[t].indexOf(\"--- \")===0&&t+2<f.length&&f[t+1].indexOf(\"+++ \")===0&&f[t+2].indexOf(\"@@\")===0);t++){var re=f[t].length==0&&t!=f.length-1?\" \":f[t][0];if(re===\"+\"||re===\"-\"||re===\" \"||re===\"\\\\\")j.lines.push(f[t]),j.linedelimiters.push(c[t]||`\n`),re===\"+\"?$++:re===\"-\"?h++:re===\" \"&&($++,h++);else break}if(!$&&j.newLines===1&&(j.newLines=0),!h&&j.oldLines===1&&(j.oldLines=0),u.strict){if($!==j.newLines)throw new Error(\"Added line count did not match for hunk at line \"+(D+1));if(h!==j.oldLines)throw new Error(\"Removed line count did not match for hunk at line \"+(D+1))}return j}for(;t<f.length;)C();return g}});var jT=Me(_w=>{\"use strict\";Object.defineProperty(_w,\"__esModule\",{value:!0});_w.default=cH;function cH(i,u,f){var c=!0,g=!1,t=!1,C=1;return function A(){if(c&&!t){if(g?C++:c=!1,i+C<=f)return C;t=!0}if(!g)return t||(c=!0),u<=i-C?-C++:(g=!0,A())}}});var zT=Me(xm=>{\"use strict\";Object.defineProperty(xm,\"__esModule\",{value:!0});xm.applyPatch=UT;xm.applyPatches=aH;var qT=Tm(),pH=dH(jT());function dH(i){return i&&i.__esModule?i:{default:i}}function UT(i,u){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof u==\"string\"&&(u=(0,qT.parsePatch)(u)),Array.isArray(u)){if(u.length>1)throw new Error(\"applyPatch only works with a single input.\");u=u[0]}var c=i.split(/\\r\\n|[\\n\\v\\f\\r\\x85]/),g=i.match(/\\r\\n|[\\n\\v\\f\\r\\x85]/g)||[],t=u.hunks,C=f.compareLine||function(Ot,Nt,Je,V){return Nt===V},A=0,x=f.fuzzFactor||0,D=0,L=0,N,j;function $(Ot,Nt){for(var Je=0;Je<Ot.lines.length;Je++){var V=Ot.lines[Je],ne=V.length>0?V[0]:\" \",ge=V.length>0?V.substr(1):V;if(ne===\" \"||ne===\"-\"){if(!C(Nt+1,c[Nt],ne,ge)&&(A++,A>x))return!1;Nt++}}return!0}for(var h=0;h<t.length;h++){for(var re=t[h],ce=c.length-re.oldLines,Q=0,oe=L+re.oldStart-1,Se=(0,pH.default)(oe,D,ce);Q!==void 0;Q=Se())if($(re,oe+Q)){re.offset=L+=Q;break}if(Q===void 0)return!1;D=re.offset+re.oldStart+re.oldLines}for(var me=0,De=0;De<t.length;De++){var J=t[De],Te=J.oldStart+J.offset+me-1;me+=J.newLines-J.oldLines,Te<0&&(Te=0);for(var Oe=0;Oe<J.lines.length;Oe++){var Le=J.lines[Oe],ot=Le.length>0?Le[0]:\" \",ct=Le.length>0?Le.substr(1):Le,Ue=J.linedelimiters[Oe];if(ot===\" \")Te++;else if(ot===\"-\")c.splice(Te,1),g.splice(Te,1);else if(ot===\"+\")c.splice(Te,0,ct),g.splice(Te,0,Ue),Te++;else if(ot===\"\\\\\"){var be=J.lines[Oe-1]?J.lines[Oe-1][0]:null;be===\"+\"?N=!0:be===\"-\"&&(j=!0)}}}if(N)for(;!c[c.length-1];)c.pop(),g.pop();else j&&(c.push(\"\"),g.push(`\n`));for(var At=0;At<c.length-1;At++)c[At]=c[At]+g[At];return c.join(\"\")}function aH(i,u){typeof i==\"string\"&&(i=(0,qT.parsePatch)(i));var f=0;function c(){var g=i[f++];if(!g)return u.complete();u.loadFile(g,function(t,C){if(t)return u.complete(t);var A=UT(C,g,u);u.patched(g,A,function(x){if(x)return u.complete(x);c()})})}c()}});var ww=Me(hd=>{\"use strict\";Object.defineProperty(hd,\"__esModule\",{value:!0});hd.structuredPatch=WT;hd.createTwoFilesPatch=HT;hd.createPatch=hH;var mH=Em();function yw(i){return _H(i)||gH(i)||vH()}function vH(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}function gH(i){if(Symbol.iterator in Object(i)||Object.prototype.toString.call(i)===\"[object Arguments]\")return Array.from(i)}function _H(i){if(Array.isArray(i)){for(var u=0,f=new Array(i.length);u<i.length;u++)f[u]=i[u];return f}}function WT(i,u,f,c,g,t,C){C||(C={}),typeof C.context==\"undefined\"&&(C.context=4);var A=(0,mH.diffLines)(f,c,C);A.push({value:\"\",lines:[]});function x(Q){return Q.map(function(oe){return\" \"+oe})}for(var D=[],L=0,N=0,j=[],$=1,h=1,re=function(oe){var Se=A[oe],me=Se.lines||Se.value.replace(/\\n$/,\"\").split(`\n`);if(Se.lines=me,Se.added||Se.removed){var De;if(!L){var J=A[oe-1];L=$,N=h,J&&(j=C.context>0?x(J.lines.slice(-C.context)):[],L-=j.length,N-=j.length)}(De=j).push.apply(De,yw(me.map(function(At){return(Se.added?\"+\":\"-\")+At}))),Se.added?h+=me.length:$+=me.length}else{if(L)if(me.length<=C.context*2&&oe<A.length-2){var Te;(Te=j).push.apply(Te,yw(x(me)))}else{var Oe,Le=Math.min(me.length,C.context);(Oe=j).push.apply(Oe,yw(x(me.slice(0,Le))));var ot={oldStart:L,oldLines:$-L+Le,newStart:N,newLines:h-N+Le,lines:j};if(oe>=A.length-2&&me.length<=C.context){var ct=/\\n$/.test(f),Ue=/\\n$/.test(c),be=me.length==0&&j.length>ot.oldLines;!ct&&be&&j.splice(ot.oldLines,0,\"\\\\ No newline at end of file\"),(!ct&&!be||!Ue)&&j.push(\"\\\\ No newline at end of file\")}D.push(ot),L=0,N=0,j=[]}$+=me.length,h+=me.length}},ce=0;ce<A.length;ce++)re(ce);return{oldFileName:i,newFileName:u,oldHeader:g,newHeader:t,hunks:D}}function HT(i,u,f,c,g,t,C){var A=WT(i,u,f,c,g,t,C),x=[];i==u&&x.push(\"Index: \"+i),x.push(\"===================================================================\"),x.push(\"--- \"+A.oldFileName+(typeof A.oldHeader==\"undefined\"?\"\":\"\t\"+A.oldHeader)),x.push(\"+++ \"+A.newFileName+(typeof A.newHeader==\"undefined\"?\"\":\"\t\"+A.newHeader));for(var D=0;D<A.hunks.length;D++){var L=A.hunks[D];x.push(\"@@ -\"+L.oldStart+\",\"+L.oldLines+\" +\"+L.newStart+\",\"+L.newLines+\" @@\"),x.push.apply(x,L.lines)}return x.join(`\n`)+`\n`}function hH(i,u,f,c,g,t){return HT(i,i,u,f,c,g,t)}});var GT=Me(km=>{\"use strict\";Object.defineProperty(km,\"__esModule\",{value:!0});km.arrayEqual=yH;km.arrayStartsWith=bT;function yH(i,u){return i.length!==u.length?!1:bT(i,u)}function bT(i,u){if(u.length>i.length)return!1;for(var f=0;f<u.length;f++)if(u[f]!==i[f])return!1;return!0}});var n9=Me(Am=>{\"use strict\";Object.defineProperty(Am,\"__esModule\",{value:!0});Am.calcLineCount=VT;Am.merge=wH;var DH=ww(),EH=Tm(),Dw=GT();function Na(i){return TH(i)||CH(i)||SH()}function SH(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}function CH(i){if(Symbol.iterator in Object(i)||Object.prototype.toString.call(i)===\"[object Arguments]\")return Array.from(i)}function TH(i){if(Array.isArray(i)){for(var u=0,f=new Array(i.length);u<i.length;u++)f[u]=i[u];return f}}function VT(i){var u=Ew(i.lines),f=u.oldLines,c=u.newLines;f!==void 0?i.oldLines=f:delete i.oldLines,c!==void 0?i.newLines=c:delete i.newLines}function wH(i,u,f){i=YT(i,f),u=YT(u,f);var c={};(i.index||u.index)&&(c.index=i.index||u.index),(i.newFileName||u.newFileName)&&($T(i)?$T(u)?(c.oldFileName=Om(c,i.oldFileName,u.oldFileName),c.newFileName=Om(c,i.newFileName,u.newFileName),c.oldHeader=Om(c,i.oldHeader,u.oldHeader),c.newHeader=Om(c,i.newHeader,u.newHeader)):(c.oldFileName=i.oldFileName,c.newFileName=i.newFileName,c.oldHeader=i.oldHeader,c.newHeader=i.newHeader):(c.oldFileName=u.oldFileName||i.oldFileName,c.newFileName=u.newFileName||i.newFileName,c.oldHeader=u.oldHeader||i.oldHeader,c.newHeader=u.newHeader||i.newHeader)),c.hunks=[];for(var g=0,t=0,C=0,A=0;g<i.hunks.length||t<u.hunks.length;){var x=i.hunks[g]||{oldStart:Infinity},D=u.hunks[t]||{oldStart:Infinity};if(KT(x,D))c.hunks.push(XT(x,C)),g++,A+=x.newLines-x.oldLines;else if(KT(D,x))c.hunks.push(XT(D,A)),t++,C+=D.newLines-D.oldLines;else{var L={oldStart:Math.min(x.oldStart,D.oldStart),oldLines:0,newStart:Math.min(x.newStart+C,D.oldStart+A),newLines:0,lines:[]};xH(L,x.oldStart,x.lines,D.oldStart,D.lines),t++,g++,c.hunks.push(L)}}return c}function YT(i,u){if(typeof i==\"string\"){if(/^@@/m.test(i)||/^Index:/m.test(i))return(0,EH.parsePatch)(i)[0];if(!u)throw new Error(\"Must provide a base reference or pass in a patch\");return(0,DH.structuredPatch)(void 0,void 0,u,i)}return i}function $T(i){return i.newFileName&&i.newFileName!==i.oldFileName}function Om(i,u,f){return u===f?u:(i.conflict=!0,{mine:u,theirs:f})}function KT(i,u){return i.oldStart<u.oldStart&&i.oldStart+i.oldLines<u.oldStart}function XT(i,u){return{oldStart:i.oldStart,oldLines:i.oldLines,newStart:i.newStart+u,newLines:i.newLines,lines:i.lines}}function xH(i,u,f,c,g){var t={offset:u,lines:f,index:0},C={offset:c,lines:g,index:0};for(QT(i,t,C),QT(i,C,t);t.index<t.lines.length&&C.index<C.lines.length;){var A=t.lines[t.index],x=C.lines[C.index];if((A[0]===\"-\"||A[0]===\"+\")&&(x[0]===\"-\"||x[0]===\"+\"))kH(i,t,C);else if(A[0]===\"+\"&&x[0]===\" \"){var D;(D=i.lines).push.apply(D,Na(kc(t)))}else if(x[0]===\"+\"&&A[0]===\" \"){var L;(L=i.lines).push.apply(L,Na(kc(C)))}else A[0]===\"-\"&&x[0]===\" \"?JT(i,t,C):x[0]===\"-\"&&A[0]===\" \"?JT(i,C,t,!0):A===x?(i.lines.push(A),t.index++,C.index++):Sw(i,kc(t),kc(C))}ZT(i,t),ZT(i,C),VT(i)}function kH(i,u,f){var c=kc(u),g=kc(f);if(e9(c)&&e9(g)){if((0,Dw.arrayStartsWith)(c,g)&&t9(f,c,c.length-g.length)){var t;(t=i.lines).push.apply(t,Na(c));return}else if((0,Dw.arrayStartsWith)(g,c)&&t9(u,g,g.length-c.length)){var C;(C=i.lines).push.apply(C,Na(g));return}}else if((0,Dw.arrayEqual)(c,g)){var A;(A=i.lines).push.apply(A,Na(c));return}Sw(i,c,g)}function JT(i,u,f,c){var g=kc(u),t=AH(f,g);if(t.merged){var C;(C=i.lines).push.apply(C,Na(t.merged))}else Sw(i,c?t:g,c?g:t)}function Sw(i,u,f){i.conflict=!0,i.lines.push({conflict:!0,mine:u,theirs:f})}function QT(i,u,f){for(;u.offset<f.offset&&u.index<u.lines.length;){var c=u.lines[u.index++];i.lines.push(c),u.offset++}}function ZT(i,u){for(;u.index<u.lines.length;){var f=u.lines[u.index++];i.lines.push(f)}}function kc(i){for(var u=[],f=i.lines[i.index][0];i.index<i.lines.length;){var c=i.lines[i.index];if(f===\"-\"&&c[0]===\"+\"&&(f=\"+\"),f===c[0])u.push(c),i.index++;else break}return u}function AH(i,u){for(var f=[],c=[],g=0,t=!1,C=!1;g<u.length&&i.index<i.lines.length;){var A=i.lines[i.index],x=u[g];if(x[0]===\"+\")break;if(t=t||A[0]!==\" \",c.push(x),g++,A[0]===\"+\")for(C=!0;A[0]===\"+\";)f.push(A),A=i.lines[++i.index];x.substr(1)===A.substr(1)?(f.push(A),i.index++):C=!0}if((u[g]||\"\")[0]===\"+\"&&t&&(C=!0),C)return f;for(;g<u.length;)c.push(u[g++]);return{merged:c,changes:f}}function e9(i){return i.reduce(function(u,f){return u&&f[0]===\"-\"},!0)}function t9(i,u,f){for(var c=0;c<f;c++){var g=u[u.length-f+c].substr(1);if(i.lines[i.index+c]!==\" \"+g)return!1}return i.index+=f,!0}function Ew(i){var u=0,f=0;return i.forEach(function(c){if(typeof c!=\"string\"){var g=Ew(c.mine),t=Ew(c.theirs);u!==void 0&&(g.oldLines===t.oldLines?u+=g.oldLines:u=void 0),f!==void 0&&(g.newLines===t.newLines?f+=g.newLines:f=void 0)}else f!==void 0&&(c[0]===\"+\"||c[0]===\" \")&&f++,u!==void 0&&(c[0]===\"-\"||c[0]===\" \")&&u++}),{oldLines:u,newLines:f}}});var r9=Me(Cw=>{\"use strict\";Object.defineProperty(Cw,\"__esModule\",{value:!0});Cw.convertChangesToDMP=OH;function OH(i){for(var u=[],f,c,g=0;g<i.length;g++)f=i[g],f.added?c=1:f.removed?c=-1:c=0,u.push([c,f.value]);return u}});var i9=Me(Tw=>{\"use strict\";Object.defineProperty(Tw,\"__esModule\",{value:!0});Tw.convertChangesToXML=IH;function IH(i){for(var u=[],f=0;f<i.length;f++){var c=i[f];c.added?u.push(\"<ins>\"):c.removed&&u.push(\"<del>\"),u.push(PH(c.value)),c.added?u.push(\"</ins>\"):c.removed&&u.push(\"</del>\")}return u.join(\"\")}function PH(i){var u=i;return u=u.replace(/&/g,\"&amp;\"),u=u.replace(/</g,\"&lt;\"),u=u.replace(/>/g,\"&gt;\"),u=u.replace(/\"/g,\"&quot;\"),u}});var f9=Me(w0=>{\"use strict\";Object.defineProperty(w0,\"__esModule\",{value:!0});Object.defineProperty(w0,\"Diff\",{enumerable:!0,get:function(){return MH.default}});Object.defineProperty(w0,\"diffChars\",{enumerable:!0,get:function(){return FH.diffChars}});Object.defineProperty(w0,\"diffWords\",{enumerable:!0,get:function(){return o9.diffWords}});Object.defineProperty(w0,\"diffWordsWithSpace\",{enumerable:!0,get:function(){return o9.diffWordsWithSpace}});Object.defineProperty(w0,\"diffLines\",{enumerable:!0,get:function(){return u9.diffLines}});Object.defineProperty(w0,\"diffTrimmedLines\",{enumerable:!0,get:function(){return u9.diffTrimmedLines}});Object.defineProperty(w0,\"diffSentences\",{enumerable:!0,get:function(){return LH.diffSentences}});Object.defineProperty(w0,\"diffCss\",{enumerable:!0,get:function(){return RH.diffCss}});Object.defineProperty(w0,\"diffJson\",{enumerable:!0,get:function(){return s9.diffJson}});Object.defineProperty(w0,\"canonicalize\",{enumerable:!0,get:function(){return s9.canonicalize}});Object.defineProperty(w0,\"diffArrays\",{enumerable:!0,get:function(){return NH.diffArrays}});Object.defineProperty(w0,\"applyPatch\",{enumerable:!0,get:function(){return l9.applyPatch}});Object.defineProperty(w0,\"applyPatches\",{enumerable:!0,get:function(){return l9.applyPatches}});Object.defineProperty(w0,\"parsePatch\",{enumerable:!0,get:function(){return BH.parsePatch}});Object.defineProperty(w0,\"merge\",{enumerable:!0,get:function(){return jH.merge}});Object.defineProperty(w0,\"structuredPatch\",{enumerable:!0,get:function(){return xw.structuredPatch}});Object.defineProperty(w0,\"createTwoFilesPatch\",{enumerable:!0,get:function(){return xw.createTwoFilesPatch}});Object.defineProperty(w0,\"createPatch\",{enumerable:!0,get:function(){return xw.createPatch}});Object.defineProperty(w0,\"convertChangesToDMP\",{enumerable:!0,get:function(){return UH.convertChangesToDMP}});Object.defineProperty(w0,\"convertChangesToXML\",{enumerable:!0,get:function(){return qH.convertChangesToXML}});var MH=zH(rf()),FH=OT(),o9=MT(),u9=Em(),LH=FT(),RH=LT(),s9=NT(),NH=BT(),l9=zT(),BH=Tm(),jH=n9(),xw=ww(),UH=r9(),qH=i9();function zH(i){return i&&i.__esModule?i:{default:i}}});var HH={};jR(HH,{default:()=>GH});var wT=Er(require(\"@yarnpkg/cli\")),Tc=Er(require(\"@yarnpkg/core\"));var Z5=Er(ys()),Dc=Er(lr()),om=(0,Dc.memo)(({active:i})=>{let u=(0,Dc.useMemo)(()=>i?\"\\u25C9\":\"\\u25EF\",[i]),f=(0,Dc.useMemo)(()=>i?\"green\":\"yellow\",[i]);return Dc.default.createElement(Z5.Text,{color:f},u)});var Wf=Er(ys()),Bo=Er(lr());var eC=Er(ys()),um=Er(lr());function zf({active:i},u,f){let{stdin:c}=(0,eC.useStdin)(),g=(0,um.useCallback)((t,C)=>u(t,C),f);(0,um.useEffect)(()=>{if(!(!i||!c))return c.on(\"keypress\",g),()=>{c.off(\"keypress\",g)}},[i,g,c])}var sm;(function(f){f.BEFORE=\"before\",f.AFTER=\"after\"})(sm||(sm={}));var tC=function({active:i},u,f){zf({active:i},(c,g)=>{g.name===\"tab\"&&(g.shift?u(sm.BEFORE):u(sm.AFTER))},f)};var lm=function(i,u,{active:f,minus:c,plus:g,set:t,loop:C=!0}){zf({active:f},(A,x)=>{let D=u.indexOf(i);switch(x.name){case c:{let L=D-1;if(C){t(u[(u.length+L)%u.length]);return}if(L<0)return;t(u[L])}break;case g:{let L=D+1;if(C){t(u[L%u.length]);return}if(L>=u.length)return;t(u[L])}break}},[u,i,g,t,C])};var fm=({active:i=!0,children:u=[],radius:f=10,size:c=1,loop:g=!0,onFocusRequest:t,willReachEnd:C})=>{let A=ce=>{if(ce.key===null)throw new Error(\"Expected all children to have a key\");return ce.key},x=Bo.default.Children.map(u,ce=>A(ce)),D=x[0],[L,N]=(0,Bo.useState)(D),j=x.indexOf(L);(0,Bo.useEffect)(()=>{x.includes(L)||N(D)},[u]),(0,Bo.useEffect)(()=>{C&&j>=x.length-2&&C()},[j]),tC({active:i&&!!t},ce=>{t==null||t(ce)},[t]),lm(L,x,{active:i,minus:\"up\",plus:\"down\",set:N,loop:g});let $=j-f,h=j+f;h>x.length&&($-=h-x.length,h=x.length),$<0&&(h+=-$,$=0),h>=x.length&&(h=x.length-1);let re=[];for(let ce=$;ce<=h;++ce){let Q=x[ce],oe=i&&Q===L;re.push(Bo.default.createElement(Wf.Box,{key:Q,height:c},Bo.default.createElement(Wf.Box,{marginLeft:1,marginRight:1},Bo.default.createElement(Wf.Text,null,oe?Bo.default.createElement(Wf.Text,{color:\"cyan\",bold:!0},\">\"):\" \")),Bo.default.createElement(Wf.Box,null,Bo.default.cloneElement(u[ce],{active:oe}))))}return Bo.default.createElement(Wf.Box,{flexDirection:\"column\",width:\"100%\"},re)};var cm=Er(lr());var nC=Er(ys()),nf=Er(lr()),rC=Er(require(\"readline\")),G3=nf.default.createContext(null),iC=({children:i})=>{let{stdin:u,setRawMode:f}=(0,nC.useStdin)();(0,nf.useEffect)(()=>{f&&f(!0),u&&(0,rC.emitKeypressEvents)(u)},[u,f]);let[c,g]=(0,nf.useState)(new Map),t=(0,nf.useMemo)(()=>({getAll:()=>c,get:C=>c.get(C),set:(C,A)=>g(new Map([...c,[C,A]]))}),[c,g]);return nf.default.createElement(G3.Provider,{value:t,children:i})};function Ec(i,u){let f=(0,cm.useContext)(G3);if(f===null)throw new Error(\"Expected this hook to run with a ministore context attached\");if(typeof i==\"undefined\")return f.getAll();let c=(0,cm.useCallback)(t=>{f.set(i,t)},[i,f.set]),g=f.get(i);return typeof g==\"undefined\"&&(g=u),[g,c]}var am=Er(ys()),V3=Er(lr());async function dm(i,u){let f,c=t=>{let{exit:C}=(0,am.useApp)();zf({active:!0},(A,x)=>{x.name===\"return\"&&(f=t,C())},[C,t])},{waitUntilExit:g}=(0,am.render)(V3.default.createElement(iC,null,V3.default.createElement(i,zn(dt({},u),{useSubmit:c}))));return await g(),f}var DT=Er(require(\"clipanion\")),ET=Er(lC()),un=Er(ys()),Pt=Er(lr());var yT=Er(_T()),cw={appId:\"OFCNCOG2CU\",apiKey:\"6fe4476ee5a1832882e326b506d14126\",indexName:\"npm-search\"},FW=(0,yT.default)(cw.appId,cw.apiKey).initIndex(cw.indexName),aw=async(i,u=0)=>await FW.search(i,{analyticsTags:[\"yarn-plugin-interactive-tools\"],attributesToRetrieve:[\"name\",\"version\",\"owner\",\"repository\",\"humanDownloadsLast30Days\"],page:u,hitsPerPage:10});var od=[\"regular\",\"dev\",\"peer\"],ud=class extends wT.BaseCommand{async execute(){let u=await Tc.Configuration.find(this.context.cwd,this.context.plugins),f=()=>Pt.default.createElement(un.Box,{flexDirection:\"row\"},Pt.default.createElement(un.Box,{flexDirection:\"column\",width:48},Pt.default.createElement(un.Box,null,Pt.default.createElement(un.Text,null,\"Press \",Pt.default.createElement(un.Text,{bold:!0,color:\"cyanBright\"},\"<up>\"),\"/\",Pt.default.createElement(un.Text,{bold:!0,color:\"cyanBright\"},\"<down>\"),\" to move between packages.\")),Pt.default.createElement(un.Box,null,Pt.default.createElement(un.Text,null,\"Press \",Pt.default.createElement(un.Text,{bold:!0,color:\"cyanBright\"},\"<space>\"),\" to select a package.\")),Pt.default.createElement(un.Box,null,Pt.default.createElement(un.Text,null,\"Press \",Pt.default.createElement(un.Text,{bold:!0,color:\"cyanBright\"},\"<space>\"),\" again to change the target.\"))),Pt.default.createElement(un.Box,{flexDirection:\"column\"},Pt.default.createElement(un.Box,{marginLeft:1},Pt.default.createElement(un.Text,null,\"Press \",Pt.default.createElement(un.Text,{bold:!0,color:\"cyanBright\"},\"<enter>\"),\" to install the selected packages.\")),Pt.default.createElement(un.Box,{marginLeft:1},Pt.default.createElement(un.Text,null,\"Press \",Pt.default.createElement(un.Text,{bold:!0,color:\"cyanBright\"},\"<ctrl+c>\"),\" to abort.\")))),c=()=>Pt.default.createElement(Pt.default.Fragment,null,Pt.default.createElement(un.Box,{width:15},Pt.default.createElement(un.Text,{bold:!0,underline:!0,color:\"gray\"},\"Owner\")),Pt.default.createElement(un.Box,{width:11},Pt.default.createElement(un.Text,{bold:!0,underline:!0,color:\"gray\"},\"Version\")),Pt.default.createElement(un.Box,{width:10},Pt.default.createElement(un.Text,{bold:!0,underline:!0,color:\"gray\"},\"Downloads\"))),g=()=>Pt.default.createElement(un.Box,{width:17},Pt.default.createElement(un.Text,{bold:!0,underline:!0,color:\"gray\"},\"Target\")),t=({hit:$,active:h})=>{let[re,ce]=Ec($.name,null);zf({active:h},(Se,me)=>{if(me.name!==\"space\")return;if(!re){ce(od[0]);return}let De=od.indexOf(re)+1;De===od.length?ce(null):ce(od[De])},[re,ce]);let Q=Tc.structUtils.parseIdent($.name),oe=Tc.structUtils.prettyIdent(u,Q);return Pt.default.createElement(un.Box,null,Pt.default.createElement(un.Box,{width:45},Pt.default.createElement(un.Text,{bold:!0,wrap:\"wrap\"},oe)),Pt.default.createElement(un.Box,{width:14,marginLeft:1},Pt.default.createElement(un.Text,{bold:!0,wrap:\"truncate\"},$.owner.name)),Pt.default.createElement(un.Box,{width:10,marginLeft:1},Pt.default.createElement(un.Text,{italic:!0,wrap:\"truncate\"},$.version)),Pt.default.createElement(un.Box,{width:16,marginLeft:1},Pt.default.createElement(un.Text,null,$.humanDownloadsLast30Days)))},C=({name:$,active:h})=>{let[re]=Ec($,null),ce=Tc.structUtils.parseIdent($);return Pt.default.createElement(un.Box,null,Pt.default.createElement(un.Box,{width:47},Pt.default.createElement(un.Text,{bold:!0},\" - \",Tc.structUtils.prettyIdent(u,ce))),od.map(Q=>Pt.default.createElement(un.Box,{key:Q,width:14,marginLeft:1},Pt.default.createElement(un.Text,null,\" \",Pt.default.createElement(om,{active:re===Q}),\" \",Pt.default.createElement(un.Text,{bold:!0},Q)))))},A=()=>Pt.default.createElement(un.Box,{marginTop:1},Pt.default.createElement(un.Text,null,\"Powered by Algolia.\")),D=await dm(({useSubmit:$})=>{let h=Ec();$(h);let re=Array.from(h.keys()).filter(Le=>h.get(Le)!==null),[ce,Q]=(0,Pt.useState)(\"\"),[oe,Se]=(0,Pt.useState)(0),[me,De]=(0,Pt.useState)([]),J=Le=>{Le.match(/\\t| /)||Q(Le)},Te=async()=>{Se(0);let Le=await aw(ce);Le.query===ce&&De(Le.hits)},Oe=async()=>{let Le=await aw(ce,oe+1);Le.query===ce&&Le.page-1===oe&&(Se(Le.page),De([...me,...Le.hits]))};return(0,Pt.useEffect)(()=>{ce?Te():De([])},[ce]),Pt.default.createElement(un.Box,{flexDirection:\"column\"},Pt.default.createElement(f,null),Pt.default.createElement(un.Box,{flexDirection:\"row\",marginTop:1},Pt.default.createElement(un.Text,{bold:!0},\"Search: \"),Pt.default.createElement(un.Box,{width:41},Pt.default.createElement(ET.default,{value:ce,onChange:J,placeholder:\"i.e. babel, webpack, react...\",showCursor:!1})),Pt.default.createElement(c,null)),me.length?Pt.default.createElement(fm,{radius:2,loop:!1,children:me.map(Le=>Pt.default.createElement(t,{key:Le.name,hit:Le,active:!1})),willReachEnd:Oe}):Pt.default.createElement(un.Text,{color:\"gray\"},\"Start typing...\"),Pt.default.createElement(un.Box,{flexDirection:\"row\",marginTop:1},Pt.default.createElement(un.Box,{width:49},Pt.default.createElement(un.Text,{bold:!0},\"Selected:\")),Pt.default.createElement(g,null)),re.length?re.map(Le=>Pt.default.createElement(C,{key:Le,name:Le,active:!1})):Pt.default.createElement(un.Text,{color:\"gray\"},\"No selected packages...\"),Pt.default.createElement(A,null))},{});if(typeof D==\"undefined\")return 1;let L=Array.from(D.keys()).filter($=>D.get($)===\"regular\"),N=Array.from(D.keys()).filter($=>D.get($)===\"dev\"),j=Array.from(D.keys()).filter($=>D.get($)===\"peer\");return L.length&&await this.cli.run([\"add\",...L]),N.length&&await this.cli.run([\"add\",\"--dev\",...N]),j&&await this.cli.run([\"add\",\"--peer\",...j]),0}};ud.paths=[[\"search\"]],ud.usage=DT.Command.Usage({category:\"Interactive commands\",description:\"open the search interface\",details:`\n    This command opens a fullscreen terminal interface where you can search for and install packages from the npm registry.\n    `,examples:[[\"Open the search window\",\"yarn search\"]]});var ST=ud;var Im=Er(require(\"@yarnpkg/cli\")),W0=Er(require(\"@yarnpkg/core\"));var sd=Er(ys()),bf=Er(lr());var CT=Er(ys()),TT=Er(lr()),wm=({length:i,active:u})=>{if(i===0)return null;let f=i>1?` ${\"-\".repeat(i-1)}`:\" \";return TT.default.createElement(CT.Text,{dimColor:!u},f)};var xT=function({active:i,skewer:u,options:f,value:c,onChange:g,sizes:t=[]}){let C=f.filter(({label:x})=>!!x).map(({value:x})=>x),A=f.findIndex(x=>x.value===c&&x.label!=\"\");return lm(c,C,{active:i,minus:\"left\",plus:\"right\",set:g}),bf.default.createElement(bf.default.Fragment,null,f.map(({label:x},D)=>{let L=D===A,N=t[D]-1||0,j=x.replace(/[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,\"\"),$=Math.max(0,N-j.length-2);return x?bf.default.createElement(sd.Box,{key:x,width:N,marginLeft:1},bf.default.createElement(sd.Text,{wrap:\"truncate\"},bf.default.createElement(om,{active:L}),\" \",x),u?bf.default.createElement(wm,{active:i,length:$}):null):bf.default.createElement(sd.Box,{key:`spacer-${D}`,width:N,marginLeft:1})}))};var c9=Er(require(\"@yarnpkg/plugin-essentials\")),a9=Er(require(\"clipanion\")),d9=Er(f9()),tr=Er(ys()),pn=Er(lr()),p9=Er(require(\"semver\")),h9=/^((?:[\\^~]|>=?)?)([0-9]+)(\\.[0-9]+)(\\.[0-9]+)((?:-\\S+)?)$/,WH=10,md=class extends Im.BaseCommand{async execute(){let u=await W0.Configuration.find(this.context.cwd,this.context.plugins),{project:f,workspace:c}=await W0.Project.find(u,this.context.cwd),g=await W0.Cache.find(u);if(!c)throw new Im.WorkspaceRequiredError(f.cwd,this.context.cwd);await f.restoreInstallState({restoreResolutions:!1});let t=(Q,oe)=>{let Se=(0,d9.diffWords)(Q,oe),me=\"\";for(let De of Se)De.added?me+=W0.formatUtils.pretty(u,De.value,\"green\"):De.removed||(me+=De.value);return me},C=(Q,oe)=>{if(Q===oe)return oe;let Se=W0.structUtils.parseRange(Q),me=W0.structUtils.parseRange(oe),De=Se.selector.match(h9),J=me.selector.match(h9);if(!De||!J)return t(Q,oe);let Te=[\"gray\",\"red\",\"yellow\",\"green\",\"magenta\"],Oe=null,Le=\"\";for(let ot=1;ot<Te.length;++ot)Oe!==null||De[ot]!==J[ot]?(Oe===null&&(Oe=Te[ot-1]),Le+=W0.formatUtils.pretty(u,J[ot],Oe)):Le+=J[ot];return Le},A=async(Q,oe,Se)=>{let me=await c9.suggestUtils.fetchDescriptorFrom(Q,Se,{project:f,cache:g,preserveModifier:oe,workspace:c});return me!==null?me.range:Q.range},x=async Q=>{let oe=p9.default.valid(Q.range)?`^${Q.range}`:Q.range,[Se,me]=await Promise.all([A(Q,Q.range,oe).catch(()=>null),A(Q,Q.range,\"latest\").catch(()=>null)]),De=[{value:null,label:Q.range}];return Se&&Se!==Q.range?De.push({value:Se,label:C(Q.range,Se)}):De.push({value:null,label:\"\"}),me&&me!==Se&&me!==Q.range?De.push({value:me,label:C(Q.range,me)}):De.push({value:null,label:\"\"}),De},D=()=>pn.default.createElement(tr.Box,{flexDirection:\"row\"},pn.default.createElement(tr.Box,{flexDirection:\"column\",width:49},pn.default.createElement(tr.Box,{marginLeft:1},pn.default.createElement(tr.Text,null,\"Press \",pn.default.createElement(tr.Text,{bold:!0,color:\"cyanBright\"},\"<up>\"),\"/\",pn.default.createElement(tr.Text,{bold:!0,color:\"cyanBright\"},\"<down>\"),\" to select packages.\")),pn.default.createElement(tr.Box,{marginLeft:1},pn.default.createElement(tr.Text,null,\"Press \",pn.default.createElement(tr.Text,{bold:!0,color:\"cyanBright\"},\"<left>\"),\"/\",pn.default.createElement(tr.Text,{bold:!0,color:\"cyanBright\"},\"<right>\"),\" to select versions.\"))),pn.default.createElement(tr.Box,{flexDirection:\"column\"},pn.default.createElement(tr.Box,{marginLeft:1},pn.default.createElement(tr.Text,null,\"Press \",pn.default.createElement(tr.Text,{bold:!0,color:\"cyanBright\"},\"<enter>\"),\" to install.\")),pn.default.createElement(tr.Box,{marginLeft:1},pn.default.createElement(tr.Text,null,\"Press \",pn.default.createElement(tr.Text,{bold:!0,color:\"cyanBright\"},\"<ctrl+c>\"),\" to abort.\")))),L=()=>pn.default.createElement(tr.Box,{flexDirection:\"row\",paddingTop:1,paddingBottom:1},pn.default.createElement(tr.Box,{width:50},pn.default.createElement(tr.Text,{bold:!0},pn.default.createElement(tr.Text,{color:\"greenBright\"},\"?\"),\" Pick the packages you want to upgrade.\")),pn.default.createElement(tr.Box,{width:17},pn.default.createElement(tr.Text,{bold:!0,underline:!0,color:\"gray\"},\"Current\")),pn.default.createElement(tr.Box,{width:17},pn.default.createElement(tr.Text,{bold:!0,underline:!0,color:\"gray\"},\"Range\")),pn.default.createElement(tr.Box,{width:17},pn.default.createElement(tr.Text,{bold:!0,underline:!0,color:\"gray\"},\"Latest\"))),N=({active:Q,descriptor:oe,suggestions:Se})=>{let[me,De]=Ec(oe.descriptorHash,null),J=W0.structUtils.stringifyIdent(oe),Te=Math.max(0,45-J.length);return pn.default.createElement(pn.default.Fragment,null,pn.default.createElement(tr.Box,null,pn.default.createElement(tr.Box,{width:45},pn.default.createElement(tr.Text,{bold:!0},W0.structUtils.prettyIdent(u,oe)),pn.default.createElement(wm,{active:Q,length:Te})),Se!==null?pn.default.createElement(xT,{active:Q,options:Se,value:me,skewer:!0,onChange:De,sizes:[17,17,17]}):pn.default.createElement(tr.Box,{marginLeft:2},pn.default.createElement(tr.Text,{color:\"gray\"},\"Fetching suggestions...\"))))},j=({dependencies:Q})=>{let[oe,Se]=(0,pn.useState)(null),me=(0,pn.useRef)(!0);return(0,pn.useEffect)(()=>()=>{me.current=!1}),(0,pn.useEffect)(()=>{Promise.all(Q.map(De=>x(De))).then(De=>{let J=Q.map((Te,Oe)=>{let Le=De[Oe];return[Te,Le]}).filter(([Te,Oe])=>Oe.filter(Le=>Le.label!==\"\").length>1);me.current&&Se(J)})},[]),oe?oe.length?pn.default.createElement(fm,{radius:WH,children:oe.map(([De,J])=>pn.default.createElement(N,{key:De.descriptorHash,active:!1,descriptor:De,suggestions:J}))}):pn.default.createElement(tr.Text,null,\"No upgrades found\"):pn.default.createElement(tr.Text,null,\"Fetching suggestions...\")},h=await dm(({useSubmit:Q})=>{Q(Ec());let oe=new Map;for(let me of f.workspaces)for(let De of[\"dependencies\",\"devDependencies\"])for(let J of me.manifest[De].values())f.tryWorkspaceByDescriptor(J)===null&&oe.set(J.descriptorHash,J);let Se=W0.miscUtils.sortMap(oe.values(),me=>W0.structUtils.stringifyDescriptor(me));return pn.default.createElement(tr.Box,{flexDirection:\"column\"},pn.default.createElement(D,null),pn.default.createElement(L,null),pn.default.createElement(j,{dependencies:Se}))},{});if(typeof h==\"undefined\")return 1;let re=!1;for(let Q of f.workspaces)for(let oe of[\"dependencies\",\"devDependencies\"]){let Se=Q.manifest[oe];for(let me of Se.values()){let De=h.get(me.descriptorHash);typeof De!=\"undefined\"&&De!==null&&(Se.set(me.identHash,W0.structUtils.makeDescriptor(me,De)),re=!0)}}return re?(await W0.StreamReport.start({configuration:u,stdout:this.context.stdout,includeLogs:!this.context.quiet},async Q=>{await f.install({cache:g,report:Q})})).exitCode():0}};md.paths=[[\"upgrade-interactive\"]],md.usage=a9.Command.Usage({category:\"Interactive commands\",description:\"open the upgrade interface\",details:`\n      This command opens a fullscreen terminal interface where you can see any out of date packages used by your application, their status compared to the latest versions available on the remote registry, and select packages to upgrade.\n    `,examples:[[\"Open the upgrade window\",\"yarn upgrade-interactive\"]]});var m9=md;var bH={commands:[ST,m9]},GH=bH;return HH;})();\n/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n/**\n * @license\n * Lodash <https://lodash.com/>\n * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n/** @license React v0.0.0-experimental-51a3aa6af\n * react-debug-tools.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/** @license React v0.0.0-experimental-51a3aa6af\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/** @license React v0.0.0-experimental-51a3aa6af\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/** @license React v0.18.0\n * scheduler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/** @license React v0.24.0\n * react-reconciler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/** @license React v16.13.1\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nreturn plugin;\n}\n};\n"
  },
  {
    "path": ".yarnrc.yml",
    "content": "enableTelemetry: false\n\nnodeLinker: pnpm\n\nnpmRegistryServer: \"https://registry.npmjs.org/\"\n\nplugins:\n  - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs\n    spec: \"@yarnpkg/plugin-interactive-tools\"\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing\n\n## Reporting Bugs\n\nIf you've found a bug with SVGO, [create an issue](https://github.com/svg/svgo/issues) on GitHub.\n\nYour issue should ideally contain:\n\n- A concise description of the bug.\n- How you were using SVGO, the version of the tool, and any configuration or command-line options.\n- The SVG that was effected, or a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example).\n\nIf you haven't found a bug, but need help using SVGO in your project, please consider asking on [Stack Overflow](https://stackoverflow.com/questions/tagged/svgo) with the `[svgo]` tag, you'll get help faster there. You can still create an issue if the confusion stemmed from a lack of documentation.\n\n## Reporting Security Vulnerabilities\n\nSee our [Security Policy](https://github.com/svg/svgo/security/policy).\n\n## Development\n\n### Requirements\n\n- [Git](https://git-scm.com/)\n- [Node.js >=16](https://nodejs.org/) — Our CI pipeline includes Node.js v16, so even development code must be runnable in a Node.js v16 environment.\n\n### Getting Started\n\nClone the repository with Git.\n\n```sh\ngit clone https://github.com/svg/svgo.git\n```\n\nAs this is a Node.js project and uses Yarn for package management, install the dependencies.\n\n```sh\nyarn install\n```\n\nFinally, make sure all quality assurance checks pass before making changes. This will lint, build, and test the project.\n\n```sh\nyarn run qa\n```\n\n### Plugins\n\nSVGO uses a plugin architecture, so we ultimately perform many smaller tasks rather than a single monolithic task. This provides users a lot of flexibility for which optimizations they use, and in what order to run them.\n\nSee [`plugins/**`](./plugins/) for the list of existing plugins. This is where you can create new ones.\n\nYou should read our [Plugin Architecture](https://svgo.dev/docs/plugins-api/) documentation for the gist of how to create a new plugin. If you've created custom plugins before, it's mostly the same process.\n\n#### Plugin Parameters\n\nSVGO plugins can optionally have parameters. These can be consumed by the plugin to tailor the behavior.\n\nParameters must have types declared in a [`@typedef`](https://jsdoc.app/tags-typedef) at the top of the file. For new plugins, you must also append the appropriate type in [`lib/types.d.ts`](https://github.com/svg/svgo/blob/main/lib/types.d.ts). This way built-in plugins will have code completion and type checking as you'd expect while editing the plugin.\n\n### Testing\n\nOur regression test suite includes larger SVGs that may take a long time to optimize and render, especially on older machines. If an SVG can not be optimized within 10 minutes in CI, then that indicates a significant performance problem that must be addressed.\n\n> [!IMPORTANT]  \n> Regression test results vary between hosts. It's not known why yet, but it's likely related to the host environment, such as system packages, drivers, or hardware.\n>\n> Until regression tests are host-agnostic, all version controlled files such as configuration and known mismatches must cater to our CI environment, _not to development environments_.\n\n## Documentation\n\nOur documentation is maintained in [MDX](https://mdxjs.com/), which is Markdown with React components. The files are then pulled by [svg/svgo.dev](https://github.com/svg/svgo.dev) to build and deploy the SVGO website.\n\nTo preview local changes, follow the steps to run the website locally in [svg/svgo.dev](https://github.com/svg/svgo.dev).\n\nNew plugins, plugin parameters, and notable features should be paired with documentation in the [`docs/`](./docs/) directory and included in the same pull request.\n\n## Funding\n\nSponsoring the project helps keep it sustainable for current maintainers.\n\nSee: [SVGO on Open Collective](https://opencollective.com/svgo)\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) Kir Belevich\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "<div align=\"center\">\n  <img src=\"./logo/logo-web.svg\" width=\"348.61\" height=\"100\" alt=\"\"/>\n</div>\n\n# SVGO [![npm](https://img.shields.io/npm/v/svgo)](https://npmjs.org/package/svgo) [![chat](https://img.shields.io/discord/815166721315831868)](https://discord.gg/z8jX8NYxrE) [![docs](https://img.shields.io/badge/docs-svgo.dev-blue)](https://svgo.dev/)\n\nSVGO, short for **SVG O**ptimizer, is a Node.js library and command-line application for optimizing SVG files.\n\n## Why?\n\nSVG files, especially those exported from vector editors, usually contain a lot of redundant information. This includes editor metadata, comments, hidden elements, default or suboptimal values, and other stuff that can be safely removed or converted without impacting rendering.\n\n## Installation\n\nYou can install SVGO globally through npm, yarn, or pnpm. Alternatively, drop the global flag (`global`/`-g`) to use it in your Node.js project.\n\n```sh\n# npm\nnpm install -g svgo\n\n# yarn\nyarn global add svgo\n\n# pnpm\npnpm add -g svgo\n```\n\n## Command-line usage\n\nProcess single files:\n\n```sh\nsvgo one.svg two.svg -o one.min.svg two.min.svg\n```\n\nProcess a directory of files recursively with `-r`/`--recursive` and `-f`/`--folder`:\n\n```sh\nsvgo -rf path/to/directory_with_svgs -o path/to/output_directory\n```\n\nHelp for advanced usage:\n\n```sh\nsvgo --help\n```\n\n## Configuration\n\nSVGO has a plugin architecture. You can read more about all plugins in [Plugins | SVGO Documentation](https://svgo.dev/docs/plugins/), and the default plugins in [Preset Default | SVGO Documentation](https://svgo.dev/docs/preset-default/).\n\nSVGO reads the configuration from `svgo.config.mjs` or the `--config path/to/config.mjs` command-line option. Some other parameters can be configured though command-line options too.\n\n**`svgo.config.mjs`**\n\n```js\nexport default {\n  multipass: false, // boolean\n  datauri: 'base64', // 'base64'|'enc'|'unenc'\n  js2svg: {\n    indent: 4, // number\n    pretty: false, // boolean\n  },\n  plugins: [\n    'preset-default', // built-in plugins enabled by default\n    'prefixIds', // enable built-in plugins by name\n\n    // enable built-in plugins with an object to configure plugins\n    {\n      name: 'prefixIds',\n      params: {\n        prefix: 'uwu',\n      },\n    },\n  ],\n};\n```\n\n### Default preset\n\nInstead of configuring SVGO from scratch, you can tweak the default preset to suit your needs by configuring or disabling the respective plugin.\n\n**`svgo.config.mjs`**\n\n```js\nexport default {\n  plugins: [\n    {\n      name: 'preset-default',\n      params: {\n        overrides: {\n          // disable a default plugin\n          cleanupIds: false,\n\n          // customize the params of a default plugin\n          inlineStyles: {\n            onlyMatchedOnce: false,\n          },\n        },\n      },\n    },\n  ],\n};\n```\n\nYou can find a list of the default plugins in the order they run in [Preset Default | SVGO Documentation](https://svgo.dev/docs/preset-default/#plugins-list).\n\n### Custom plugins\n\nYou can also specify custom plugins:\n\n**`svgo.config.mjs`**\n\n```js\nimport importedPlugin from './imported-plugin';\n\nexport default {\n  plugins: [\n    // plugin imported from another JavaScript file\n    importedPlugin,\n\n    // plugin defined inline\n    {\n      name: 'customPlugin',\n      params: {\n        paramName: 'paramValue',\n      },\n      fn: (ast, params, info) => {},\n    },\n  ],\n};\n```\n\n## API usage\n\nSVGO provides a few low level utilities.\n\n### optimize\n\nThe core of SVGO is `optimize` function.\n\n```js\nimport { optimize } from 'svgo';\n\nconst result = optimize(svgString, {\n  path: 'path-to.svg', // recommended\n  multipass: true, // all other config fields are available here\n});\n\nconst optimizedSvgString = result.data;\n```\n\n### loadConfig\n\nIf you write a tool on top of SVGO you may want to resolve the `svgo.config.mjs` file.\n\n```js\nimport { loadConfig } from 'svgo';\n\nconst config = await loadConfig();\n```\n\nYou can also specify a path and customize the current working directory.\n\n```js\nconst config = await loadConfig(configFile, cwd);\n```\n\n## Donors\n\n| [<img src=\"https://sheetjs.com/sketch128.png\" width=\"80\">](https://sheetjs.com/) | [<img src=\"https://raw.githubusercontent.com/fontello/fontello/8.0.0/fontello-image.svg\" width=\"80\">](https://fontello.com/) |\n| :------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------: |\n|                       [SheetJS LLC](https://sheetjs.com/)                        |                                              [Fontello](https://fontello.com/)                                               |\n\n## License and Copyright\n\nThis software is released under the terms of the [MIT license](https://github.com/svg/svgo/blob/main/LICENSE).\n\nLogo by [André Castillo](https://github.com/DerianAndre).\n"
  },
  {
    "path": "bin/svgo.js",
    "content": "#!/usr/bin/env node\n\nimport colors from 'picocolors';\nimport { program } from 'commander';\nimport makeProgram from '../lib/svgo/coa.js';\nmakeProgram(program);\nprogram.parseAsync(process.argv).catch((error) => {\n  console.error(colors.red(error.stack));\n  process.exit(1);\n});\n"
  },
  {
    "path": "cspell.jsonc",
    "content": "{\n  \"$schema\": \"https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json\",\n  \"version\": \"0.2\",\n  \"allowCompoundWords\": true,\n  \"words\": [\n    \"deoptimizations\",\n    \"deoptimize\",\n    \"deoptimized\",\n    \"Fontello\",\n    \"inlines\",\n    // Abbreviations\n    \"elems\", // elements\n    \"unenc\", // unencoded\n    // SVG Nodes / Attributes and CSS Properties, including plurals\n    \"bbox\",\n    \"hkern\",\n    \"horiz\",\n    \"hrefs\",\n    \"mpath\",\n    \"onbegin\",\n    \"onrepeat\",\n    \"panose\",\n    \"stemh\",\n    \"stemv\",\n    \"SVGs\",\n    \"vkern\",\n    // Storage\n    \"kibibytes\",\n    // Software\n    \"SVGOMG\",\n    // Names\n    \"André\",\n    \"Baranovskiy\",\n    \"Dmitry\",\n    \"Keerthi\",\n  ],\n  \"ignorePaths\": [\n    \"*.svg.txt\",\n    \"*.svg\",\n    \"coverage/\",\n    \"cspell.jsonc\",\n    \"dist/\",\n    \"LICENSE\",\n    \"test/regression/lists/\",\n  ],\n  \"ignoreRegExpList\": [\n    \"(?:xlink|sodipodi)(?::[a-z]+)?\", // Common SVG namespaces\n    \"[a-z]+: '#[a-f\\\\d]+',\", // Color names in _collection.js\n    \"[a-z]+…\", // Words that have been cut off by an ellipsis\n    \"@author .+\", // JSDoc author tag line, usually names\n    \"\\\"name\\\": .+\", // package.json author name property\n    \"\\\\*\\\\*SVG O\\\\*\\\\*ptimizer\", // README\n    \"\\\\b[aprs]data\\\\b\",\n    \"&.+?;\", // HTML entity\n    \"<svg.+>\", // Inline SVG in code\n    \"Atrule\", // At-rule\n    \"data:image/.+\", // Data URI\n    \"datauri\", // Data URI\n    \"descs\", // Abbreviation of \"descriptions\"\n    \"ENOCLS|ENOATTRS\",\n    \"import .+\", // Import statements in Javascript\n    \"onwarn\", // Rollup API,\n    \"QRAB|QRCD\",\n    \"rrggbb\",\n    \"sax\\\\..+\", // Any properties of the sax API\n  ],\n}\n"
  },
  {
    "path": "docs/01-index.mdx",
    "content": "---\ntitle: Introduction\nslug: 'introduction'\n---\n\nSVGO (short for SVG Optimizer) is a Node.js library and command-line application for optimizing SVG files.\n\nSVG files, especially those exported from vector editors, usually contain a lot of redundant information. This includes editor metadata, comments, hidden elements, default or suboptimal values, and other stuff that can be safely removed or converted without affecting the rendering result.\n\n## Installation\n\n### System Requirements\n\n- [Node.js >=16](https://nodejs.org/)\n\n<Tabs>\n  <TabItem value=\"npm\" label=\"npm\" default>\n\n```sh\nnpm install -g svgo\n```\n\n  </TabItem>\n  <TabItem value=\"yarn\" label=\"Yarn\">\n\n```sh\nyarn global add svgo\n```\n\n  </TabItem>\n  <TabItem value=\"pnpm\" label=\"pnpm\">\n\n```sh\npnpm add -g svgo\n```\n\n  </TabItem>\n</Tabs>\n"
  },
  {
    "path": "docs/02-usage/01-node.mdx",
    "content": "---\ntitle: Node.js\nslug: 'node'\n---\n\nTo minimally use SVGO in Node.js, ensure you've installed the dependency by following the instructions in [Getting Started](../01-index.mdx#installation), then import the `optimize` function.\n\nHere's a minimal example:\n\n```js\nimport { optimize } from 'svgo';\n\nconst svg = `\n<svg xmlns=\"http://www.w3.org/2000/svg\"\n  xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n  viewBox=\"0 0 100 100\">\n  <text x=\"50\" y=\"50\" text-anchor=\"middle\">•ᴗ•</text>\n</svg>\n`;\n\nconst { data } = optimize(svg);\nconsole.log(data);\n// <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\"><text x=\"50\" y=\"50\" text-anchor=\"middle\">•ᴗ•</text></svg>\n```\n"
  },
  {
    "path": "docs/02-usage/02-browser.mdx",
    "content": "---\ntitle: Browser\n---\n\nSVGO can run in the browser, but how to use it depends on the structure of your project.\n\n## With Build Tools\n\nThese instructions are for when you're writing your website in a Node.js environment, probably with tools like [webpack](https://webpack.js.org/) or [Rollup](https://rollupjs.org/) to build it.\n\nEnsure you've installed the dependency by following the instructions in [Getting Started](../01-index.mdx#installation), then you can import `svgo/browser` to use SVGO on client-side.\n\nHere's a minimal example using [React](https://react.dev/):\n\n```js\nimport React from 'react';\nimport { optimize } from 'svgo/browser';\n\nexport default function SvgoDemo(props) {\n  const { svg, svgoConfig } = props;\n  const { data } = optimize(svg, svgoConfig);\n\n  return (\n    <>\n      <span id=\"before\">{svg}</span>\n      <span id=\"after\">{data}</span>\n    </>\n  );\n}\n```\n\n## Without Build Tools\n\nThese instructions are for when you want to fetch the SVGO browser bundle from client-side. For example, when you're building a static website with a templating engine like Handlebars, SSG like Jekyll, or just plain old HTML.\n\nYou'll have to somehow serve a copy of `svgo.browser.js`, you could either:\n\n- Download the latest version of `svgo.browser.js` from our [GitHub Releases](https://github.com/svg/svgo/releases), and place it in your project directory to self-serve it.\n- Use a public CDN like [unpkg](https://unpkg.com/svgo/dist/svgo.browser.js) or [jsDelivr](https://cdn.jsdelivr.net/npm/svgo/dist/svgo.browser.js).\n\nHere's a minimal example:\n\n```html\n<!doctype html>\n<html lang=\"en\">\n  <head>\n    <title>SVGO Browser Example</title>\n    <script type=\"module\">\n      import { VERSION } from '/svgo.browser.js';\n      // You could also do:\n      // import { VERSION } from 'https://unpkg.com/svgo/dist/svgo.browser.js';\n\n      document.addEventListener('DOMContentLoaded', () => {\n        document.getElementById('version').innerHTML = VERSION;\n      });\n    </script>\n  </head>\n\n  <body>\n    <span id=\"version\"></span>\n  </body>\n</html>\n```\n"
  },
  {
    "path": "docs/02-usage/index.mdx",
    "content": "---\ntitle: Usage\n---\n\nWe officially support four interfaces for SVGO:\n\n- Command-line application - Get help with `svgo --help`, or read a [tl;dr](https://github.com/tldr-pages/tldr/blob/main/pages/common/svgo.md)!\n- [Node.js library](./01-node.mdx) - For general use in Node.js.\n- [Browser bundle](./02-browser.mdx) - For using SVGO on client-side in the browser.\n- [Webpack loader](https://www.npmjs.com/package/svgo-loader) - Optimizes SVG imports with SVGO and returns a [Data URL](https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Schemes/data).\n\n## Community\n\nThanks to the community who have integrated, wrapped, or otherwise adapted SVGO to play well with other tools, and ultimately made SVGO more accessible for everyone.\n\nThis section showcases reputable projects that are stable and well maintained. Please check the project's website for more information on how to use it.\n\n### Integrations\n\nDepending on your project stack, you may want to try one of these integrations to seamlessly incorporate SVGO into your workflow:\n\n- [SVGR](https://react-svgr.com) - Webpack loader that optimizes and transforms SVGs into React components.\n- [grunt-svgmin](https://www.npmjs.com/package/grunt-svgmin) - Grunt task to optimize SVGs.\n- [postcss-svgo](https://www.npmjs.com/package/postcss-svgo) - PostCSS plugin that optimizes inline SVGs in CSS.\n- [@figma-export](https://github.com/marcomontalbano/figma-export) - Node.js library to transforms Figma components into optimized SVGs.\n\n### Frontends\n\nThe community have developed many frontends for SVGO, and some even have additional features on top:\n\n- [SVGOMG](https://jakearchibald.github.io/svgomg/) - Web application that wraps SVGO.\n- [Oh My SVG](https://flathub.org/apps/re.sonny.OhMySVG) - Linux desktop application that wraps SVGO.\n- [SVG Gobbler](https://svggobbler.com) - Browser extension for finding, optimizing, and exporting SVGs.\n"
  },
  {
    "path": "docs/03-preset-default.mdx",
    "content": "---\ntitle: Preset Default\n---\n\nSVGO runs with a default preset that has the plugin ID `preset-default`. This is the default set of plugins that are used when not explicitly specified or overridden elsewhere.\n\n:::info\n\nIf you aren't using SVGO directly, like through [SVGR](https://github.com/gregberge/svgr), the default plugins may differ from the default preset.\n\n:::\n\n## Plugins List\n\nThe following plugins are included in `preset-default`, in the order that they're executed:\n\n- [removeDoctype](/docs/plugins/removeDoctype/)\n- [removeXMLProcInst](/docs/plugins/removeXMLProcInst/)\n- [removeComments](/docs/plugins/removeComments/)\n- [removeMetadata](/docs/plugins/removeMetadata/)\n- [removeEditorsNSData](/docs/plugins/removeEditorsNSData/)\n- [cleanupAttrs](/docs/plugins/cleanupAttrs/)\n- [mergeStyles](/docs/plugins/mergeStyles/)\n- [inlineStyles](/docs/plugins/inlineStyles/)\n- [minifyStyles](/docs/plugins/minifyStyles/)\n- [cleanupIds](/docs/plugins/cleanupIds/)\n- [removeUselessDefs](/docs/plugins/removeUselessDefs/)\n- [cleanupNumericValues](/docs/plugins/cleanupNumericValues/)\n- [convertColors](/docs/plugins/convertColors/)\n- [removeUnknownsAndDefaults](/docs/plugins/removeUnknownsAndDefaults/)\n- [removeNonInheritableGroupAttrs](/docs/plugins/removeNonInheritableGroupAttrs/)\n- [removeUselessStrokeAndFill](/docs/plugins/removeUselessStrokeAndFill/)\n- [cleanupEnableBackground](/docs/plugins/cleanupEnableBackground/)\n- [removeHiddenElems](/docs/plugins/removeHiddenElems/)\n- [removeEmptyText](/docs/plugins/removeEmptyText/)\n- [convertShapeToPath](/docs/plugins/convertShapeToPath/)\n- [convertEllipseToCircle](/docs/plugins/convertEllipseToCircle/)\n- [moveElemsAttrsToGroup](/docs/plugins/moveElemsAttrsToGroup/)\n- [moveGroupAttrsToElems](/docs/plugins/moveGroupAttrsToElems/)\n- [collapseGroups](/docs/plugins/collapseGroups/)\n- [convertPathData](/docs/plugins/convertPathData/)\n- [convertTransform](/docs/plugins/convertTransform/)\n- [removeEmptyAttrs](/docs/plugins/removeEmptyAttrs/)\n- [removeEmptyContainers](/docs/plugins/removeEmptyContainers/)\n- [removeUnusedNS](/docs/plugins/removeUnusedNS/)\n- [mergePaths](/docs/plugins/mergePaths/)\n- [sortAttrs](/docs/plugins/sortAttrs/)\n- [sortDefsChildren](/docs/plugins/sortDefsChildren/)\n- [removeDesc](/docs/plugins/removeDesc/)\n\n## Disable a Plugin\n\nSometimes a specific plugin might not be appropriate for your workflow. You can continue using `preset-default` while disabling any plugin by using the `overrides` parameter.\n\nIn `overrides`, reference the plugin ID and set it to `false` to disable it:\n\n```js\nmodule.exports = {\n  plugins: [\n    {\n      name: 'preset-default',\n      params: {\n        overrides: {\n          cleanupIds: false,\n        },\n      },\n    },\n  ],\n};\n```\n\nAlternatively, you can drop `preset-default` entirely, and configure your own plugin pipeline from scratch, with only the desirable plugins:\n\n```js\nmodule.exports = {\n  plugins: [\n    'removeDoctype',\n    'removeXMLProcInst',\n    'minifyStyles',\n    'sortAttrs',\n    'sortDefsChildren',\n  ],\n};\n```\n"
  },
  {
    "path": "docs/04-plugins/addAttributesToSVGElement.mdx",
    "content": "---\ntitle: addAttributesToSVGElement\nsvgo:\n  pluginId: addAttributesToSVGElement\n  parameters:\n    attributes:\n      description: Attributes to add to the `<svg>` element. If key/value pairs are passed, the attributes are added with the paired value. If an array is passed, attributes are added with no key associated with them.\n      default: null\n    attribute:\n---\n\nAdds attributes to the outer most [`<svg>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg) element in the document. This is not an optimization and will increase the size of SVG documents.\n\n:::danger\n\nThis plugin is only safe to use when a map of key/value pairs is passed. If you pass an array of keys to declare empty attributes, this will produce an malformed SVG that's only usable inline an HTML document.\n\n:::\n"
  },
  {
    "path": "docs/04-plugins/addClassesToSVGElement.mdx",
    "content": "---\ntitle: addClassesToSVGElement\nsvgo:\n  pluginId: addClassesToSVGElement\n  parameters:\n    classNames:\n      description: Adds the specified class names to the outer most `<svg>` element.\n      default: null\n    className:\n      description: Adds the specified class name to the outer most `<svg>` element. If `classNames` is specified, this is ignored.\n---\n\nOverrides the `class` attribute in the outer most `<svg>` element, omitting duplicates or null classes if found in your configuration.\n\n:::caution\n\nIf there is no `class` attribute to begin with, it will be added. However, if the there were already classes assigned, these are removed and replaced with the classes configured in this plugin.\n\n:::\n\nIf you have a standalone SVG, this is not an optimization and will increase the size of the SVG document. This plugin is only relevant when considering multiple SVGs that may be inlined a parent document.\n\nBy adding classes, if the parent document is aware, you can share styles across all inlined SVG elements.\n"
  },
  {
    "path": "docs/04-plugins/cleanupAttrs.mdx",
    "content": "---\ntitle: cleanupAttrs\nsvgo:\n  pluginId: cleanupAttrs\n  defaultPlugin: true\n  parameters:\n    newlines:\n      description: Replace instances of a newline with a single whitespace.\n      type: boolean\n      default: true\n    trim:\n      description: Trim whitespace characters from the start and end of attribute values.\n      type: boolean\n      default: true\n    spaces:\n      description: Replace all instances of 2 or more whitespace characters with a single whitespace.\n      type: boolean\n      default: true\n---\n\nRemoves redundant whitespaces from attribute values.\n\nThis will not modify the attribute keys, nor remove them if the value becomes empty after optimization.\n"
  },
  {
    "path": "docs/04-plugins/cleanupEnableBackground.mdx",
    "content": "---\ntitle: cleanupEnableBackground\nsvgo:\n  pluginId: cleanupEnableBackground\n  defaultPlugin: true\n---\n\nCleans up [`enable-background`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/enable-background), unless the document uses [`<filter>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/filter) elements.\n\nOnly cleans up attribute values and inline-styles, but does not affect stylesheets in [`<style>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/style) nodes.\n\nThis plugin will:\n\n- Drop `enable-background` when the width and height values match the width and height of the `<svg>` node.\n- Replace the value with `new` when the width and height values match the width and height of a `<mask>` or `<pattern>` node.\n\n:::info\n\nSome browsers don't support `enable-background`, so it's best to avoid the attribute regardless.\n\n:::\n"
  },
  {
    "path": "docs/04-plugins/cleanupIds.mdx",
    "content": "---\ntitle: cleanupIds\nsvgo:\n  pluginId: cleanupIds\n  parameters:\n    remove:\n      description: If to remove all unreferenced IDs.\n      default: true\n    minify:\n      description: If to minify referenced IDs.\n      default: true\n    preserve:\n      description: Elements with one of these IDs will be ignored.\n      default: []\n    preservePrefixes:\n      description: Elements with an ID that starts with one of these prefixes will be ignored.\n      default: []\n    force:\n      description: This plugin normally does nothing if a `<script>` or `<style>` element is found. Setting this to true will bypass that behavior, which may result in destructive changes.\n      default: false\n  defaultPlugin: true\n---\n\nRemoves unused IDs, and minifies IDs that are referenced by other elements.\n\nBy default, we back off from removing and minifying IDs if a `<script>` or `<style>` element is present in the document. You can bypass this behavior by setting the `force` parameter to `true`.\n\n:::info\n\nBetween v2 and v3, the plugin was renamed from `cleanupIDs` to `cleanupIds`, if you've recently migrated and having issues, please double-check the capitalization!\n\n:::\n\n:::caution\n\nThis plugin has been known to cause problems when inlining multiple SVGs in the same parent document. Due to the predictable algorithm used to minify IDs, separate documents that are run though SVGO may end up with clashing IDs.\n\nYou can work around this by enabling the [prefixIds](/docs/plugins/prefixIds/) plugin. Alternatively, you can set the `minify` parameter to `false`, however this will not resolve the issue if your SVGs already had clashing IDs to start with.\n\nSee [facebook/docusaurus#8297](https://github.com/facebook/docusaurus/issues/8297) for more context.\n\n:::\n"
  },
  {
    "path": "docs/04-plugins/cleanupListOfValues.mdx",
    "content": "---\ntitle: cleanupListOfValues\nsvgo:\n  pluginId: cleanupListOfValues\n  parameters:\n    floatPrecision:\n      description: Number of decimal places to round to, using conventional rounding rules.\n      default: 3\n    leadingZero:\n      description: If to trim leading zeros.\n      default: true\n    defaultPx:\n      description: If to remove the units when it's `px`, as this is the default if not specified.\n      default: true\n    convertToPx:\n      description: If to convert absolute units like `cm` and `in` to `px`.\n      default: true\n---\n\nRounds numeric values in attributes, such as those found in [`viewBox`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox), [`enable-background`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/enable-background), and [`points`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/points).\n"
  },
  {
    "path": "docs/04-plugins/cleanupNumericValues.mdx",
    "content": "---\ntitle: cleanupNumericValues\nsvgo:\n  pluginId: cleanupNumericValues\n  defaultPlugin: true\n  parameters:\n    floatPrecision:\n      description: Number of decimal places to round to, using conventional rounding rules.\n      default: 3\n    leadingZero:\n      description: If to trim leading zeros.\n      default: true\n    defaultPx:\n      description: If to remove the units when it's `px`, as this is the default if not specified.\n      default: true\n    convertToPx:\n      description: If to convert absolute units like `cm` and `in` to `px`.\n      default: true\n---\n\nRounds numeric values, removes the unit when it's `px` as this is the default, and removes redundant spaces around and between numbers.\n"
  },
  {
    "path": "docs/04-plugins/collapseGroups.mdx",
    "content": "---\ntitle: collapseGroups\nsvgo:\n  pluginId: collapseGroups\n  defaultPlugin: true\n---\n\nFinds groups that effectively do nothing and flattens them, preserving the contents of the groups.\n\nGroups can be formed using the [`<g>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g) element. They're used for organizing the document, or applying [presentation attributes](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Presentation) to all children contained in a group.\n\n:::info\n\nThis plugin doesn't remove empty groups. That's handled by the [removeEmptyContainers](/docs/plugins/removeEmptyContainers/) plugin which is enabled by default.\n\n:::\n"
  },
  {
    "path": "docs/04-plugins/convertColors.mdx",
    "content": "---\ntitle: convertColors\nsvgo:\n  pluginId: convertColors\n  defaultPlugin: true\n  parameters:\n    currentColor:\n      description: If to convert all instances of a color to `currentColor`. This means to inherit the active foreground color, for example in HTML5 this would be the [`color`](https://developer.mozilla.org/en-US/docs/Web/CSS/color) property in CSS.\n      default: false\n    names2hex:\n      description: If to convert color names to the hex equivalent.\n      default: true\n    rgb2hex:\n      description: If to convert RGB colors to the hex equivalent, ignores RGBA.\n      default: true\n    convertCase:\n      description: Convert all color values to either upper or lower case by setting this to `'upper'` or `'lower'` respectively to improve compression. Set to `false` to disable this behavior.\n      default: 'lower'\n    shorthex:\n      description: If to convert 6 character hex colors to the 3 character equivalent where possible.\n      default: true\n    shortname:\n      description: If to convert hex colors to the color name, if the color name is shorter then the hex equivalent.\n      default: true\n---\n\nConverts color references to the shortest equivalent.\n\nColors can be represented in various notations, the following table showcases some equivalent colors:\n\n| Name     | rgb()              | #rrggbb   | #rgb   |\n| -------- | ------------------ | --------- | ------ |\n| `red`    | `rgb(255, 0, 0)`   | `#ff0000` | `#f00` |\n| `orange` | `rgb(255, 165, 0)` | `#ffa500` |        |\n| `yellow` | `rgb(255, 255, 0)` | `#ffff00` | `#ff0` |\n| `green`  | `rgb(0, 128, 0)`   | `#008000` |        |\n| `blue`   | `rgb(0, 0, 255)`   | `#0000FF` | `#00f` |\n| `purple` | `rgb(128, 0, 128)` | `#800080` |        |\n\nIt makes no difference which format is received by a client, and each one has wide support across browsers and image viewing software.\n"
  },
  {
    "path": "docs/04-plugins/convertEllipseToCircle.mdx",
    "content": "---\ntitle: convertEllipseToCircle\nsvgo:\n  pluginId: convertEllipseToCircle\n  defaultPlugin: true\n---\n\nConvert non-eccentric [`<ellipse>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/ellipse) elements to [`<circle>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/circle) elements.\n"
  },
  {
    "path": "docs/04-plugins/convertOneStopGradients.mdx",
    "content": "---\ntitle: convertOneStopGradients\nsvgo:\n  pluginId: convertOneStopGradients\n---\n\nConverts the [`<linearGradient>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/linearGradient) and [`<radialGradient>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/radialGradient) nodes that are effectively a solid color to the color.\n\nThese nodes contain [`<stop>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/stop) elements, which represent various colors to transition between. However, if a gradient only contains a single `<stop>`, then it's effectively a solid fill.\n\nDefinitions of the gradients are removed, and the parent [`<defs>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs) node is removed if it has no children after optimization. The `xlink:href` namespace is also removed if there are no remaining elements using this attribute.\n"
  },
  {
    "path": "docs/04-plugins/convertPathData.mdx",
    "content": "---\ntitle: convertPathData\nsvgo:\n  pluginId: convertPathData\n  defaultPlugin: true\n  parameters:\n    applyTransforms:\n      description: If to apply transforms.\n      default: true\n    applyTransformsStroked:\n      description: If to apply transforms to paths with a stroke.\n      default: true\n    makeArcs:\n      description: If to convert from curves to arcs when possible. This is an object with two properties, `threshold` and `tolerance`.\n    straightCurves:\n      description: If to convert curve commands that are effectively straight lines to line commands.\n      default: true\n    convertToQ:\n      description: If to convert cubic Bézier curves to quadratic Bézier curves when they effectively are.\n      default: true\n    lineShorthands:\n      description: If to convert regular lines to an explicit horizontal or vertical line where possible.\n      default: true\n    convertToZ:\n      description: If to convert lines that go to the start to a `z` command.\n      default: true\n    curveSmoothShorthands:\n      description: If to convert curves to smooth curves where possible.\n      default: true\n    floatPrecision:\n      description: Number of decimal places to round to, using conventional rounding rules.\n      default: 3\n    transformPrecision:\n      description: Number of decimal places to round to, using conventional rounding rules.\n      default: 5\n    smartArcRounding:\n      description: Round the radius of circular arcs when the effective change is under the error. The effective change is determined using the [sagitta](https://wikipedia.org/wiki/Sagitta_(geometry)) of the arc.\n      default: true\n    removeUseless:\n      description: Remove redundant path commands that don't draw anything.\n      default: true\n    collapseRepeated:\n      description: Collapse repeated commands when they can be merged into one.\n      default: true\n    utilizeAbsolute:\n      description: If to convert between absolute or relative coordinates, whichever is shortest.\n      default: true\n    negativeExtraSpace:\n      default: true\n    forceAbsolutePath:\n      description: If to always convert to absolute coordinates, even if it adds more bytes.\n      default: false\n---\n\nOptimize path commands found in `<path>`, `<glyph>`, and `<missing-glyph>` elements. Path commands are the syntax used in the `d` attribute, each character represents an instruction to draw paths.\n\n:::info\n\nYou can get more context on path commands on [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#path_commands).\n\n:::\n\nThis plugin uses multiple techniques to either reduce the number of instructions or reduce the attribute length:\n\n- Convert between relative or absolute coordinates, whichever is shortest.\n- Convert between commands. For example, a Bézier curve that behaves like a straight line might as well use a line instruction.\n- Remove redundant commands. For example, a command that moves to the current position can be removed.\n- Trim redundant delimiters and leading zeros.\n- Round numeric values using conventional rounding rules.\n\nYou can read more about the plugins capabilities by going through the individual parameters.\n"
  },
  {
    "path": "docs/04-plugins/convertShapeToPath.mdx",
    "content": "---\ntitle: convertShapeToPath\nsvgo:\n  pluginId: convertShapeToPath\n  defaultPlugin: true\n  parameters:\n    convertArcs:\n      description: If to convert `<circle>` and `<ellipse>` elements to paths.\n      default: false\n    floatPrecision:\n      description: Number of decimal places to round to, using conventional rounding rules.\n      default: null\n---\n\nConvert basic shapes to [`<path>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/path) elements.\n"
  },
  {
    "path": "docs/04-plugins/convertStyleToAttrs.mdx",
    "content": "---\ntitle: convertStyleToAttrs\nsvgo:\n  pluginId: convertStyleToAttrs\n  parameters:\n    keepImportant:\n      description: If to always keep [`!important`](https://developer.mozilla.org/en-US/docs/Web/CSS/important) styles.\n      type: boolean\n      default: false\n---\n\nConverts [presentation attributes](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Presentation) in element styles to the equivalent XML attribute.\n\nPresentation attributes can be used in both attributes and styles, but in most cases it'll take fewer bytes to use attributes. Consider the following:\n\n```xml\n<rect width=\"100\" height=\"100\" style=\"fill:red\"/>\n<!-- vs -->\n<rect width=\"100\" height=\"100\" fill=\"red\"/>\n```\n\nHowever, because the `style` attribute doesn't require quotes between values, given enough presentation attributes, it can increase the size of the document:\n\n```xml\n<rect width=\"100\" height=\"100\" style=\"fill:red;opacity:.5;stroke-dasharray:1;stroke:blue;stroke-opacity:.5\"/>\n<!-- vs -->\n<rect width=\"100\" height=\"100\" fill=\"red\" opacity=\".5\" stroke-dasharray=\"1\" stroke=\"blue\" stroke-opacity=\".5\"/>\n```\n"
  },
  {
    "path": "docs/04-plugins/convertTransform.mdx",
    "content": "---\ntitle: convertTransform\nsvgo:\n  pluginId: convertTransform\n  defaultPlugin: true\n  parameters:\n    convertToShorts:\n      description: Convert transforms to their shorthand alternatives.\n      default: true\n    degPrecision:\n      description: Number of decimal places to round degrees values to, using conventional rounding rules. Used for `rotate` and `skew`.\n    floatPrecision:\n      description: Number of decimal places to round to, using conventional rounding rules.\n      default: 3\n    transformPrecision:\n      description: Number of decimal places to round to, using conventional rounding rules.\n      default: 5\n    matrixToTransform:\n      description: If to decompose matrices into simple transforms. See [Decomposition of 2D-transform matrices](https://frederic-wang.fr/2013/12/01/decomposition-of-2d-transform-matrices/) for more context.\n      default: true\n    shortTranslate:\n      description: If to shorten references to `translate` with redundant parameters to omit them. i.e. `translate(10 0)` → `translate(10)`\n      default: true\n    shortScale:\n      description: If to shorten references to `scale` with redundant parameters to omit them. i.e. `scale(2 2)` → `scale(2)`\n      default: true\n    shortRotate:\n      description: If to shorten references to `rotate` with redundant parameters to omit them. i.e. `translate(cx cy) rotate(a) translate(-cx -cy)` → `rotate(a cx cy)`\n      default: true\n    removeUseless:\n      description: If to remove redundant transforms like `translate(0)`, `skewX(0)`, or `skewY(0)`.\n      default: true\n    collapseIntoOne:\n      description: If to multiply transforms into one.\n      default: true\n---\n\nCollapse multiple transforms into one, convert matrices to the short aliases, and much more.\n"
  },
  {
    "path": "docs/04-plugins/index.mdx",
    "content": "---\ntitle: Plugins\n---\n\nAll optimizations performed by SVGO are through the various plugins that are either built-in, or provided in your SVGO config.\n\nBuilt-in plugins are focused around either optimizations or compatibility. However, the plugin architecture is very flexible, so plugins can be made to do effectively anything.\n\n## Presets\n\nPresets are generalized SVGO plugin pipelines, though there is only one built-in to SVGO called [preset-default](/docs/preset-default/).\n\nThe preset-default pipeline can be used by either:\n\n- Not defining a `plugins` property in the config.\n- Omitting the config altogether.\n- Specifying the `preset-default` plugin.\n"
  },
  {
    "path": "docs/04-plugins/inlineStyles.mdx",
    "content": "---\ntitle: inlineStyles\nsvgo:\n  pluginId: inlineStyles\n  defaultPlugin: true\n  parameters:\n    onlyMatchedOnce:\n      description: If to only inline styles if the selector matches one element.\n      default: true\n    removeMatchedSelectors:\n      description: If to remove the selector and styles from the stylesheet while inlining the styles. This does not remove selectors that did not match any elements.\n      default: true\n    useMqs:\n      description: An array of media query conditions to use, such as `screen`. An empty string signifies all selectors outside of a media query.\n    usePseudos:\n      description: What pseudo-classes and pseudo-elements to use. An empty string signifies all non-pseudo-classes and non-pseudo-elements.\n---\n\nMerge and inline CSS declarations from a `<style>` element to the `style` attribute of selected elements.\n"
  },
  {
    "path": "docs/04-plugins/mergePaths.mdx",
    "content": "---\ntitle: mergePaths\nsvgo:\n  pluginId: mergePaths\n  defaultPlugin: true\n  parameters:\n    force:\n      default: false\n    floatPrecision:\n      description: Number of decimal places to round to, using conventional rounding rules.\n      default: 3\n    noSpaceAfterFlags:\n      description: If to omit spaces after flags. Flags are values that can only be `0` or `1` and are used by some path commands, namely [`A` and `a`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#elliptical_arc_curve).\n      default: false\n---\n\nMerge multiple paths into one.\n"
  },
  {
    "path": "docs/04-plugins/mergeStyles.mdx",
    "content": "---\ntitle: mergeStyles\nsvgo:\n  pluginId: mergeStyles\n  defaultPlugin: true\n---\n\nMerge multiple `<style>` elements into one.\n"
  },
  {
    "path": "docs/04-plugins/minifyStyles.mdx",
    "content": "---\ntitle: minifyStyles\nsvgo:\n  pluginId: minifyStyles\n  defaultPlugin: true\n  parameters:\n    usage:\n      description: If to collect usage data such as tags, classes, and IDs to pass to CSSO. This is an object with four properties, which are each configured with a boolean, `tags`, `ids`, `classes`, and `force`. By default, if a script is found this does not pass usage data to CSSO, but this can be overridden with `force`, which may yield destructive changes.\n      default: true\n---\n\nMinify `<style>` elements with [CSSO](https://github.com/css/csso).\n"
  },
  {
    "path": "docs/04-plugins/moveElemsAttrsToGroup.mdx",
    "content": "---\ntitle: moveElemsAttrsToGroup\nsvgo:\n  pluginId: moveElemsAttrsToGroup\n  defaultPlugin: true\n---\n\nMove an elements attributes to their enclosing group.\n"
  },
  {
    "path": "docs/04-plugins/moveGroupAttrsToElems.mdx",
    "content": "---\ntitle: moveGroupAttrsToElems\nsvgo:\n  pluginId: moveGroupAttrsToElems\n  defaultPlugin: true\n---\n\nMove some group attributes to the contained elements.\n"
  },
  {
    "path": "docs/04-plugins/prefixIds.mdx",
    "content": "---\ntitle: prefixIds\nsvgo:\n  pluginId: prefixIds\n  parameters:\n    delim:\n      description: Content to insert between the prefix and original value.\n      default: '__'\n    prefix:\n      description: Either a string or a function that resolves to a string.\n    prefixIds:\n      description: If to prefix `id` attributes.\n      default: true\n    prefixClassNames:\n      description: If to prefix classes in the `class` attribute.\n      default: true\n---\n\nPrefix element IDs and class names with the filename or another arbitrary string. This is useful for reducing the likeliness of ID conflicts when multiple vectors are inlined into the same document.\n\n## Prefer Reproducible IDs\n\nIt's acceptable to generate IDs that have no relation to the node or file they're for, such as through a counter, random number generator, or UUID. Consider the following SVGO config:\n\n```js title=\"svgo.config.js\"\nlet prefixCounter = 0;\n\nmodule.exports = {\n  plugins: [\n    {\n      name: 'prefixIds',\n      params: {\n        delim: '',\n        prefix: () => prefixCounter++,\n      },\n    },\n  ],\n};\n```\n\nHowever, a solution like this can not guarantee a reproducible prefix. Unpredictable IDs can pose an issue for tooling, namely React, and anything that depends on it like Next.js and Docusaurus.\n\nWith unpredictable IDs, if you're prerendering or use SSR (Server-Side Rendering), the client-side and server-side HTML may mismatch, leading to errors on client-side and regenerating the tree.\n\nFor this reason, it's preferred to use reproducible prefixes where possible. Consider using the filename or node as a seed to produce a shorter string, rather than generating something from scratch.\n"
  },
  {
    "path": "docs/04-plugins/removeAttributesBySelector.mdx",
    "content": "---\ntitle: removeAttributesBySelector\nsvgo:\n  pluginId: removeAttributesBySelector\n  parameters:\n    selectors:\n      description: An array of objects with two properties, `selector`, and `attributes`, which represent a CSS selector and the attributes to remove respectively.\n      default: null\n---\n\nRemoves specific attributes from elements that match a CSS selector.\n"
  },
  {
    "path": "docs/04-plugins/removeAttrs.mdx",
    "content": "---\ntitle: removeAttrs\nsvgo:\n  pluginId: removeAttrs\n  parameters:\n    attrs:\n      description: A selector that matches attributes.\n      default: null\n    elemSeparator:\n      description: The pattern syntax used by this plugin is `element:attribute:value`, this changes the delimiter from `:` to another string.\n      default: ':'\n    preserveCurrentColor:\n      description: If to ignore the attribute when it's set to `currentColor`.\n      default: false\n---\n\nRemove attributes from elements matching a custom syntax.\n\nThe format accepted is `[ element* : attribute* : value* ]`, where:\n\n- `element`: A regular expression matching element names. An asterisk or omission matches all elements.\n- `attribute`: A regular expression matching attribute names.\n- `value`: A regular expression matching attribute values. An asterisk or omission matches all values.\n\nFor example, `path:fill` matches all `fill` attributes in `<path>` elements.\n"
  },
  {
    "path": "docs/04-plugins/removeComments.mdx",
    "content": "---\ntitle: removeComments\nsvgo:\n  pluginId: removeComments\n  defaultPlugin: true\n  parameters:\n    preservePatterns:\n      description: An array of regular expressions ([RegExp](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) or string). If the comment matches any of these, including partial matches, the comment is preserved. Set to `false` to disable this behavior and remove comments indiscriminately.\n      default:\n        - '^!'\n---\n\nRemoves XML comments from the document.\n\nXML comments are the content between the `<!--` and `-->` syntax, and do not effect rendering. From an optimization perspective, these can always be safely removed.\n\nBy default, this plugin ignores legal comments, also known as \"special comments\" or \"protected comments\". These are comments that start with an exclamation point (`!`) and are often used for legal information like copyright notices, licensing, or attribution.\n\nFor example, the following comment can be found in [Font Awesome Free](https://fontawesome.com/license/free) icons:\n\n```svg\n<!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. -->\n```\n\nRemoving a comment like this may be considered a breach of the license terms, as Font Awesome Free is released under [CC-BY-4.0 (Creative Commons Attribution)](https://creativecommons.org/licenses/by/4.0/), but removing the comment would strip away that attribution.\n\n## Legal Comments\n\nIt's unclear if there are authoritative resources promoting this syntax for legal comments. However, the convention to preserve them based on this can be seen by a number of minification and build tools:\n\n- [clean-css](https://github.com/clean-css/clean-css#how-to-preserve-a-comment-block)\n- [CSSO](https://github.com/css/csso#syntaxcompressast-options)\n- [esbuild](https://esbuild.github.io/api/#legal-comments)\n- [Sass](https://sass-lang.com/documentation/syntax/comments/)\n- [Terser](https://github.com/terser/terser#keeping-copyright-notices-or-other-comments) / [terser-webpack-plugin](https://github.com/webpack-contrib/terser-webpack-plugin#preserve-comments)\n- [UglifyJS](https://github.com/mishoo/UglifyJS#keeping-copyright-notices-or-other-comments)\n- [YUI Compressor](https://github.com/yui/yuicompressor#notes)\n"
  },
  {
    "path": "docs/04-plugins/removeDeprecatedAttrs.mdx",
    "content": "---\ntitle: removeDeprecatedAttrs\nsvgo:\n  pluginId: removeDeprecatedAttrs\n  defaultPlugin: true\n  parameters:\n    removeAny:\n      description: By default, this plugin only removes safe deprecated attributes that do not change the rendered image. Enabling this will remove all deprecated attributes which may impact rendering.\n      type: boolean\n      default: false\n---\n\nRemoves deprecated attributes from elements in the document.\n\nThis plugin does not remove attributes from the deprecated XLink namespace. To remove them, use the [removeXlink](/docs/plugins/removeXlink/) plugin.\n"
  },
  {
    "path": "docs/04-plugins/removeDesc.mdx",
    "content": "---\ntitle: removeDesc\nsvgo:\n  pluginId: removeDesc\n  defaultPlugin: true\n  parameters:\n    removeAny:\n      description: By default, this plugin only removes descriptions that are either empty or contain editor attribution. Enabling this removes the `<desc>` element indiscriminately.\n      type: boolean\n      default: false\n---\n\nRemoves the [`<desc>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/desc) element from the document in one of the following conditions:\n\n- The `<desc>` element is empty.\n- The `<desc>` element appears to only contain editor attribution.\n\nThis plugin does not remove the `<desc>` indiscriminately by default, as it is a crucial aspect of accessibility for users of assistive technologies.\n"
  },
  {
    "path": "docs/04-plugins/removeDimensions.mdx",
    "content": "---\ntitle: removeDimensions\nsvgo:\n  pluginId: removeDimensions\n---\n\nRemoves the [`width`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/width) and [`height`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/height) attribute from the top-most [`<svg>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg) element if specified, and replaces it with the [`viewBox`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox) attribute if it's missing.\n\n:::info\n\nThis is effectively the opposite of the [removeViewBox](/docs/plugins/removeViewBox/) plugin, ensure that is disabled before using this one.\n\n:::\n"
  },
  {
    "path": "docs/04-plugins/removeDoctype.mdx",
    "content": "---\ntitle: removeDoctype\nsvgo:\n  pluginId: removeDoctype\n  defaultPlugin: true\n---\n\nRemoves the [Document Type Definition](https://en.wikipedia.org/wiki/Document_type_definition), also known as the DOCTYPE, from the document.\n"
  },
  {
    "path": "docs/04-plugins/removeEditorsNSData.mdx",
    "content": "---\ntitle: removeEditorsNSData\nsvgo:\n  pluginId: removeEditorsNSData\n  defaultPlugin: true\n  parameters:\n    additionalNamespaces:\n      description: If you want to remove additional XML namespaces, you can provide them in a list.\n      default: []\n---\n\nRemoves all XML [namespaces](https://developer.mozilla.org/en-US/docs/Web/SVG/Namespaces_Crash_Course), elements, and attributes associated with popular vector editing software.\n\nThis plugin is completely safe to use before redistributing your SVG or incorporating it into a larger document.\n\nThe kinds of elements that are removed are usually editor specific workspace settings. You should keep a backup of your original SVG to preserve that meta-data and continue to maintain your SVG, while you serve the optimized version to users.\n\nYou can find a list of removed editor namespaces in [`_collections.js`](https://github.com/search?q=repo%3Asvg%2Fsvgo+editorNamespaces&type=code), which includes software like [Inkscape](https://inkscape.org/), Adobe Illustrator, and Figma.\n"
  },
  {
    "path": "docs/04-plugins/removeElementsByAttr.mdx",
    "content": "---\ntitle: removeElementsByAttr\nsvgo:\n  pluginId: removeElementsByAttr\n  parameters:\n    id:\n      description: Remove elements where one of these IDs will be match the element ID.\n      default: []\n    class:\n      description: Remove elements where the `class` attribute includes at least one of these classes.\n      default: []\n---\n\nRemoves arbitrary elements by ID or className.\n"
  },
  {
    "path": "docs/04-plugins/removeEmptyAttrs.mdx",
    "content": "---\ntitle: removeEmptyAttrs\nsvgo:\n  pluginId: removeEmptyAttrs\n  defaultPlugin: true\n---\n\nRemove empty attributes from elements in the document.\n\nThis ignores the following attributes, as they're used for conditional rendering:\n\n- `requiredFeatures`\n- `requiredExtensions`\n- `systemLanguage`\n"
  },
  {
    "path": "docs/04-plugins/removeEmptyContainers.mdx",
    "content": "---\ntitle: removeEmptyContainers\nsvgo:\n  pluginId: removeEmptyContainers\n  defaultPlugin: true\n---\n\nRemove container elements in the document that have no children or meaningful attributes, excluding the `<svg>` element which is ignored.\n\nA container, as defined in the [SVG specifications](https://www.w3.org/TR/SVG11/intro.html#TermContainerElement), is an SVG element that can have graphical child elements. Container elements include:\n\n- [`<a>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/a)\n- [`<defs>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs)\n- [`<glyph>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/glyph)\n- [`<g>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g)\n- [`<marker>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/marker)\n- [`<mask>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/mask)\n- [`<missing-glyph>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/missing-glyph)\n- [`<pattern>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/pattern)\n- [`<svg>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg)\n- [`<switch>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/switch)\n- [`<symbol>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol)\n"
  },
  {
    "path": "docs/04-plugins/removeEmptyText.mdx",
    "content": "---\ntitle: removeEmptyText\nsvgo:\n  pluginId: removeEmptyText\n  defaultPlugin: true\n  parameters:\n    text:\n      description: If to remove empty [`<text>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/text) elements.\n      default: true\n    tspan:\n      description: If to remove empty [`<tspan>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/tspan) elements.\n      default: true\n    tref:\n      description: If to remove empty [`<tref>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/tref) elements.\n      default: true\n---\n\nRemoves empty [`<text>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/text) and [`<tspan>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/tspan) elements, and [`<tref>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/tref) elements that don't reference another node in the document.\n\n:::info\n\nNo browsers supports `<tref>`, so it's best to avoid that element regardless.\n\n:::\n"
  },
  {
    "path": "docs/04-plugins/removeHiddenElems.mdx",
    "content": "---\ntitle: removeHiddenElems\nsvgo:\n  pluginId: removeHiddenElems\n  defaultPlugin: true\n  parameters:\n    isHidden:\n      description: Removes elements where [`visibility`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/visibility) is `hidden`, unless a child element has `visibility` set to `visible`.\n      default: true\n    displayNone:\n      description: Removes elements where [`display`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/display) is `none`.\n      default: true\n    opacity0:\n      description: Removes element where [`opacity`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/opacity) is `0`.\n      default: true\n    circleR0:\n      description: Removes [`<circle>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/circle) elements with a [radius](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/r) of `0`.\n      default: true\n    ellipseRX0:\n      description: Removes [`<ellipse>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/ellipse) elements where [`rx`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/rx) is `0`.\n      default: true\n    ellipseRY0:\n      description: Removes [`<ellipse>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/ellipse) elements where [`ry`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/ry) is `0`.\n      default: true\n    rectWidth0:\n      description: Removes [`<rect>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/rect) elements where [`width`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/width) is `0`.\n      default: true\n    rectHeight0:\n      description: Removes [`height`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/rect) is `0`.\n      default: true\n    patternWidth0:\n      description: Removes [`width`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/pattern) is `0`.\n      default: true\n    patternHeight0:\n      description: Removes [`height`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/pattern) is `0`.\n      default: true\n    imageWidth0:\n      description: Removes [`width`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/image) is `0`.\n      default: true\n    imageHeight0:\n      description: Removes [`height`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/image) is `0`.\n      default: true\n    pathEmptyD:\n      description: Remove [`marker`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/path).\n      default: true\n    polylineEmptyPoints:\n      description: Removes [points](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/polyline) defined.\n      default: true\n    polygonEmptyPoints:\n      description: Removes [points](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/polygon) defined.\n      default: true\n---\n\nRemove hidden or invisible elements from the document. This can be elements with 0 width and height defined, or elements that were just hidden with CSS.\n\nThis plugin ignores non-rendering elements, such as [`<clipPath>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/clipPath) and [`<linearGradient>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/linearGradient), which still apply regardless of styles, unless they are unused.\n\nRefer to the parameters for the conditions this plugin looks for. All checks enabled by default.\n"
  },
  {
    "path": "docs/04-plugins/removeMetadata.mdx",
    "content": "---\ntitle: removeMetadata\nsvgo:\n  pluginId: removeMetadata\n  defaultPlugin: true\n---\n\nRemoves the [`<metadata>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/metadata) element from the document.\n\nMetadata doesn't effect rendering. From an optimization perspective, these can always be safely removed.\n\nThere may be cases you'd want to disable this plugin, as some SVGs include copyright and licensing information in the metadata. In particular, documents that reference the [Creative Commons](http://creativecommons.org/ns#) namespace.\n\n:::info\n\nYou can learn more about referencing copyright and licensing on the [SVG Tiny 1.2 specifications](https://www.w3.org/TR/SVGTiny12/metadata.html#metadataElementExample), or by reading [The Creative Commons Rights Expression Language](https://opensource.creativecommons.org/ccrel/).\n\n:::\n"
  },
  {
    "path": "docs/04-plugins/removeNonInheritableGroupAttrs.mdx",
    "content": "---\ntitle: removeNonInheritableGroupAttrs\nsvgo:\n  pluginId: removeNonInheritableGroupAttrs\n  defaultPlugin: true\n---\n\nRemoves non-inheritable [presentation attributes](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Presentation) from groups.\n"
  },
  {
    "path": "docs/04-plugins/removeOffCanvasPaths.mdx",
    "content": "---\ntitle: removeOffCanvasPaths\nsvgo:\n  pluginId: removeOffCanvasPaths\n---\n\nIf a [`viewBox`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox) is present,\nremoves [`<path>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/path) elements that are drawn outside of it.\n\nElements with a [`transform`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform) attribute are ignored, to avoid falsely removing elements that are brought into view through styles or an animation.\n"
  },
  {
    "path": "docs/04-plugins/removeRasterImages.mdx",
    "content": "---\ntitle: removeRasterImages\nsvgo:\n  pluginId: removeRasterImages\n---\n\nRemoves inline JPEGs, PNGs, and GIFs from the document.\n"
  },
  {
    "path": "docs/04-plugins/removeScripts.mdx",
    "content": "---\ntitle: removeScripts\nsvgo:\n  pluginId: removeScripts\n---\n\nRemoves all scripts from the document.\n\nSVGs can be interactive through JavaScript. However, unless the SVG is coming from a trusted source, it's strongly advised to strip off JavaScript to avoid [XSS](https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting) attacks.\n\n:::caution\n\nThis **will** break interactive SVGs that rely on JavaScript.\n\n:::\n\nThis plugin performs the following operations:\n\n- Removes [`<script>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/script) elements.\n- Removes [SVG event attributes](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Events), such as `onload`, `onclick`, and `oninput`, preserving the element itself.\n- Collapses [`<a>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/a) elements, moving children up to the parent element.\n\n:::info\n\nBetween v3 and v4, the plugin was renamed from `removeScriptElement` to `removeScripts` to reflect that it does more than just remove the `<script>` tag.\n\n:::\n"
  },
  {
    "path": "docs/04-plugins/removeStyleElement.mdx",
    "content": "---\ntitle: removeStyleElement\nsvgo:\n  pluginId: removeStyleElement\n---\n\nRemove all [`<style>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/style) elements from the document.\n"
  },
  {
    "path": "docs/04-plugins/removeTitle.mdx",
    "content": "---\ntitle: removeTitle\nsvgo:\n  pluginId: removeTitle\n---\n\nRemoves the [`<title>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title) element from the document.\n\nThis plugin may have significant accessibility implications. The purpose of `<title>` is to provide users of assistive technologies the means to get a summary of the SVG if they're not able to view it.\n\nIt can be sensible to remove the `<title>` element in one of the following scenarios:\n\n- The SVG is purely aesthetic and has no impact on the user-experience.\n- Accessibility is handled elsewhere, such as in the [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) or [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby) attributes in an HTML document.\n\nConsider doing the free [Introduction to Web Accessibility](https://www.w3.org/WAI/courses/foundations-course/) course by W3Cx for more information.\n"
  },
  {
    "path": "docs/04-plugins/removeUnknownsAndDefaults.mdx",
    "content": "---\ntitle: removeUnknownsAndDefaults\nsvgo:\n  pluginId: removeUnknownsAndDefaults\n  defaultPlugin: true\n  parameters:\n    unknownContent:\n      description: If to remove elements that are not known or can't be the child of its parent element.\n      default: true\n    unknownAttrs:\n      description: If to remove attributes that are not assignable to the respective element.\n      default: true\n    defaultAttrs:\n      description: If to remove attributes that are assigned their default value anyway.\n      default: true\n    defaultMarkupDeclarations:\n      description: If to remove XML declarations that are assigned their default value. XML declarations are the properties in the `<?xml … ?>` block at the top of the document.\n      default: true\n    uselessOverrides:\n      description: If to remove attributes that are being if the same value is being inherited by it's parent element anyway.\n      default: true\n    keepDataAttrs:\n      description: If to keep [`data-*`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/data-*) attributes. Set to `false` to remove data attributes.\n      default: true\n    keepAriaAttrs:\n      description: If to keep [ARIA (Accessible Rich Internet Applications)](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) attributes, used for accessibility. This excludes `role`, which is managed with the `keepRoleAttr` parameter.\n      default: true\n    keepRoleAttr:\n      description: If to keep the ARIA [`role`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles) attribute.\n      default: false\n---\n\nRemoves unknown elements and attributes, as well as attributes that are set to their default value.\n\nThis can also remove defaults from the XML declaration if present in the document, namely [`standalone`](https://www.w3.org/TR/REC-xml/#sec-rmd) if it's set to `no`.\n"
  },
  {
    "path": "docs/04-plugins/removeUnusedNS.mdx",
    "content": "---\ntitle: removeUnusedNS\nsvgo:\n  pluginId: removeUnusedNS\n  defaultPlugin: true\n---\n\nRemoves unused namespace declarations from the document.\n\n:::caution\n\nThis plugin currently only removes unused namespaces from the top-most `<svg>` element. It does not check for unused namespaces that may be present in child elements further down the document.\n\n:::\n"
  },
  {
    "path": "docs/04-plugins/removeUselessDefs.mdx",
    "content": "---\ntitle: removeUselessDefs\nsvgo:\n  pluginId: removeUselessDefs\n  defaultPlugin: true\n---\n\nRemoves children of [`<defs>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs) element that do not have an ID to reference.\n"
  },
  {
    "path": "docs/04-plugins/removeUselessStrokeAndFill.mdx",
    "content": "---\ntitle: removeUselessStrokeAndFill\nsvgo:\n  pluginId: removeUselessStrokeAndFill\n  defaultPlugin: true\n  parameters:\n    stroke:\n      description: If to remove redundant strokes.\n      default: true\n    fill:\n      description: If to remove redundant fills.\n      default: true\n    removeNone:\n      description: If to remove elements where both the `fill` and `stroke` attributes are `none`.\n      default: false\n---\n\nRemoves useless `stroke` and `fill` attributes.\n\nAssigning these attributes can sometimes change nothing in the document. For example, in most cases assigning a `stroke` color is redundant if the elements [`stroke-width`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width) or [`stroke-opacity`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-opacity) is `0`.\n"
  },
  {
    "path": "docs/04-plugins/removeViewBox.mdx",
    "content": "---\ntitle: removeViewBox\nsvgo:\n  pluginId: removeViewBox\n---\n\nRemoves the [`viewBox`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox) attribute where it matches the documents width and height.\n\n:::danger\n\nThis plugin prevents SVGs from scaling, so they will not fill their parent container, or may clip if the container is too small.\n\nSee [svg/svgo#1128](https://github.com/svg/svgo/issues/1128) for more context.\n\n:::\n"
  },
  {
    "path": "docs/04-plugins/removeXMLNS.mdx",
    "content": "---\ntitle: removeXMLNS\nsvgo:\n  pluginId: removeXMLNS\n---\n\nRemoves the `xmlns` attribute from the top-most `<svg>` element in the document.\n\nIt's recommended to use this plugin if you intend to inline SVGs into an HTML document. HTML does not support explicit namespaces, so these are ignored by the browser anyway.\n\n:::tip\n\nThis plugin pairs well with the [removeXlink](/docs/plugins/removeXlink/) plugin, which drops XLink namespaces and migrates references the modern equivalent, supported by SVG 2 and inline an HTML document. When using removeXMLNS, it's recommended to enable removeXlink too.\n\n:::\n\n:::caution\n\nThis plugin renders SVGs unusable as standalone assets, in HTML `<img>` elements, or CSS [pseudo-elements](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_pseudo-elements).\n\n:::\n"
  },
  {
    "path": "docs/04-plugins/removeXMLProcInst.mdx",
    "content": "---\ntitle: removeXMLProcInst\nsvgo:\n  pluginId: removeXMLProcInst\n  defaultPlugin: true\n---\n\nRemoves the [XML declaration](https://developer.mozilla.org/en-US/docs/Web/XML/XML_introduction#xml_declaration) from the document.\n\nThe SVG language is based on XML, and is XML compatible, so editors often include an XML declaration.\n\nAn XML declaration is the line at the top of an XML file to indicate document meta-data, like encoding and which version of the XML specifications it adheres to.\n\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n```\n\nThe XML declaration is optional in [XML 1.0](https://www.w3.org/TR/REC-xml/#sec-prolog-dtd), but mandatory in the [XML 1.1](https://www.w3.org/TR/2006/REC-xml11-20060816/#sec-prolog-dtd). If the XML declaration is omitted, the document is assumed to follow the XML 1.0 specifications, which won't impact SVG documents.\n\nIt can be safely removed without impacting compatibility with SVG clients. However, some tools may fail to detect the MIME-type as `image/svg+xml` if this is removed.\n"
  },
  {
    "path": "docs/04-plugins/removeXlink.mdx",
    "content": "---\ntitle: removeXlink\nsvgo:\n  pluginId: removeXlink\n  parameters:\n    includeLegacy:\n      description: If to update references to XLink in elements that don't support the SVG 2 href attribute, like `<filter>` and `<tref>`.\n      default: false\n---\n\nRemoves XLink namespace prefixes and converts references to XLink attributes to the native SVG equivalent by performing the following operations:\n\n- Convert `*:href` to [`href`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/href).\n- Convert `*:show` to [`target`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/target).\n- Convert `*:title` to [`<title>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title).\n- Drop all other references to the XLink namespace.\n- Remove XLink namespace declarations.\n\n:::tip\n\nWhen using this plugin, it's recommended to put it toward the end of your pipeline. Other SVGO plugins may add the XLink namespace, and these won't be migrated if they're added after this plugin has already executed.\n\n:::\n\nIn most cases this will remove all references to XLink, but if legacy elements that are deprecated or removed in SVG 2 are found, the references are preserved as those elements do not support the SVG 2 `href` attribute. You can set `includeLegacy` to `true` to apply the plugin in this case too.\n\nThe following support `xlink:href` but not the SVG 2 `href` attribute:\n\n- [`<cursor>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/cursor)\n- [`<filter>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/filter)\n- [`<font-face-uri>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/font-face-uri)\n- [`<glyphRef>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/glyphRef)\n- [`<tref>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/tref)\n\nIt's recommended to use this plugin if you intend to inline SVGs into an HTML document, `includeLegacy` can be safely set to `true` in this case too. HTML does not support explicit namespaces, so namespace prefixes are ignored by the browser anyway.\n\n:::danger\n\nThis replaces XLink with features that are only supported in the SVGO 2 spec, so breaks compatibility with the SVG 1.1.\n\n:::\n"
  },
  {
    "path": "docs/04-plugins/reusePaths.mdx",
    "content": "---\ntitle: reusePaths\nsvgo:\n  pluginId: reusePaths\n---\n\nCreates a definition for similar paths, and swaps the [`<path>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/path) elements to [`<use>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/use) elements that will reference a single `<path>` definition.\n\nIt looks for `<path>` elements that have the same [`d`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d), [`fill`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill), and [`stroke`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke) attribute values, then copies them into a `<path>` in the [`defs`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs) element, creating it if it doesn't exist.\n\nIf the path contains other attributes, such as `style` or `transform`, they will be preserved in the `<use>` element that supersedes it.\n\n:::tip\n\nIf you only need SVG 2 or inline HTML compatibility, it's recommended to include the [removeXlink](/docs/plugins/removeXlink/) plugin towards the end of your pipeline to convert references to `xlink:href` to the SVG 2 `href` attribute.\n\n:::\n"
  },
  {
    "path": "docs/04-plugins/sortAttrs.mdx",
    "content": "---\ntitle: sortAttrs\nsvgo:\n  pluginId: sortAttrs\n  defaultPlugin: true\n  parameters:\n    order:\n      description: An array of attribute keys to order by. Attributes not found in the array are sorted alphabetically.\n      default:\n        - 'id'\n        - 'width'\n        - 'height'\n        - 'x'\n        - 'x1'\n        - 'x2'\n        - 'y'\n        - 'y1'\n        - 'y2'\n        - 'cx'\n        - 'cy'\n        - 'r'\n        - 'fill'\n        - 'stroke'\n        - 'marker'\n        - 'd'\n        - 'points'\n    xmlnsOrder:\n      description: Set to `'front'` if XML namespaces should be placed in front of all other attributes.\n      default: 'front'\n---\n\nSorts attributes in all elements in the document. This does not reduce the size of the SVG, but improves readability and _may_ improve how compression algorithms perform on it.\n\nHere is a demonstration of SVGs that have been gzipped by [NGINX](https://nginx.org/en/docs/http/ngx_http_gzip_module.html) using the default compression level of 1.\n\n| SVG                                                                                           | Unsorted ¹ | Sorted ²  | Reduced (%)    |\n| --------------------------------------------------------------------------------------------- | ---------- | --------- | -------------- |\n| [Arch Linux Logo](https://archlinux.org/art/)                                                 | 2.61 kB    | 2.61 kB   | 0 kB (0%)      |\n| [Blobs](https://gitlab.gnome.org/GNOME/gnome-backgrounds/-/blob/main/backgrounds/blobs-d.svg) | 13.89 kB   | 13.88 kB  | 0.01 kB (0.1%) |\n| [Isometric Madness](https://inkscape.org/~Denis_Kuznetsky/%E2%98%85isometric-madness)         | 123.87 kB  | 120.09 kB | 3.78 kB (3.1%) |\n| [tldr-pages Banner](https://github.com/tldr-pages/tldr/blob/main/images/banner.svg)           | 791 B      | 786 B     | 5 B (0.6%)     |\n| [Wikipedia Logo](https://en.wikipedia.org/wiki/File:Wikipedia-logo-v2.svg)                    | 53.96 kB   | 53.87 kB  | 0.09 kB (0.2%) |\n\n¹ Uses the default plugins preset excluding `sortAttr` and `sortDefsChildren`.\n² Uses the default plugins preset as-is.\n"
  },
  {
    "path": "docs/04-plugins/sortDefsChildren.mdx",
    "content": "---\ntitle: sortDefsChildren\nsvgo:\n  pluginId: sortDefsChildren\n  defaultPlugin: true\n---\n\nSorts all children in the `<defs>` element. This does not reduce the size of the SVG, but _may_ improve how compression algorithms perform on it.\n\nTo group similar nodes together, elements are sorted by the following attributes:\n\n- Frequency\n- Element name length\n- Element name\n\nHere is a demonstration of SVGs that have been gzipped by [NGINX](https://nginx.org/en/docs/http/ngx_http_gzip_module.html) using the default compression level of 1.\n\n| SVG                                                                                           | Unsorted ¹ | Sorted ²  | Reduced (%)    |\n| --------------------------------------------------------------------------------------------- | ---------- | --------- | -------------- |\n| [Arch Linux Logo](https://archlinux.org/art/)                                                 | 2.61 kB    | 2.61 kB   | 0 kB (0%)      |\n| [Blobs](https://gitlab.gnome.org/GNOME/gnome-backgrounds/-/blob/main/backgrounds/blobs-d.svg) | 13.89 kB   | 13.88 kB  | 0.01 kB (0.1%) |\n| [Isometric Madness](https://inkscape.org/~Denis_Kuznetsky/%E2%98%85isometric-madness)         | 123.87 kB  | 120.09 kB | 3.78 kB (3.1%) |\n| [tldr-pages Banner](https://github.com/tldr-pages/tldr/blob/main/images/banner.svg)           | 791 B      | 786 B     | 5 B (0.6%)     |\n| [Wikipedia Logo](https://en.wikipedia.org/wiki/File:Wikipedia-logo-v2.svg)                    | 53.96 kB   | 53.87 kB  | 0.09 kB (0.2%) |\n\n¹ Uses the default plugins preset excluding `sortAttr` and `sortDefsChildren`.\n² Uses the default plugins preset as-is.\n"
  },
  {
    "path": "docs/05-plugins-api.mdx",
    "content": "---\ntitle: Plugin Architecture\n---\n\nSVGO is primarily an optimizer, and is evolving as the community continue to propose or implement better optimizations.\n\nSince SVGO v2, our plugins API use the [xast](https://github.com/syntax-tree/xast) specification, and the more practical visitor pattern.\n\nA minimal plugin looks like this:\n\n```js\nexport const myPlugin = {\n  name: 'myPlugin',\n  description: 'A plugin that does nothing.',\n  fn: () => {},\n};\n```\n\nIt currently does nothing, but can still be referenced in your `svgo.config.js`:\n\n```js\nimport { myPlugin } from './myPlugin.js';\n\nexport default {\n  plugins: [myPlugin],\n};\n```\n\nThe visitor pattern lets you to access nodes as the parser enters and exits them, in the order that the respective tag appears.\n\nThe following JavaScript shows all of the types of nodes you can implement a callback for, which all callbacks are optional.\n\n```js\nconst myPlugin = {\n  name: 'pluginName',\n  description: 'A plugin that does a lot of nothing.',\n  fn: () => {\n    return {\n      root: {\n        enter: (node) => {},\n        exit: (node) => {},\n      },\n      element: {\n        enter: (node, parentNode) => {},\n        exit: (node, parentNode) => {},\n      },\n      doctype: {\n        enter: (node, parentNode) => {},\n        exit: (node, parentNode) => {},\n      },\n      instruction: {\n        enter: (node, parentNode) => {},\n        exit: (node, parentNode) => {},\n      },\n      comment: {\n        enter: (node, parentNode) => {},\n        exit: (node, parentNode) => {},\n      },\n      cdata: {\n        enter: (node, parentNode) => {},\n        exit: (node, parentNode) => {},\n      },\n      text: {\n        enter: (node, parentNode) => {},\n        exit: (node, parentNode) => {},\n      },\n    };\n  },\n};\n```\n\nWhere a parent node is present, it will always be a direct child of the current node.\n\n## Common Operations\n\nFinding specific nodes to modify their attributes:\n\n```js\nconst myPlugin = {\n  name: 'makeEverythingPink',\n  description: 'Change all fill attribute values to pink.',\n  fn: () => {\n    return {\n      element: {\n        enter: (node, parentNode) => {\n          if (node.attributes.fill == null) {\n            return;\n          }\n\n          node.attributes.fill = 'pink';\n        },\n      },\n    };\n  },\n};\n```\n\nRemove a node from its parent:\n\n```js\nconst removeNoAttributes = {\n  name: 'removeNoAttributes',\n  description: 'Removes nodes with no attributes.',\n  fn: () => {\n    return {\n      element: {\n        enter: (node, parentNode) => {\n          if (Object.keys(node.attributes).length !== 0) {\n            return;\n          }\n\n          parentNode.children = parentNode.children.filter(\n            (child) => child !== node,\n          );\n        },\n      },\n    };\n  },\n};\n```\n"
  },
  {
    "path": "docs/06-migrations/01-migration-from-v3-to-v4.mdx",
    "content": "---\ntitle: Migration from v3 to v4\n---\n\nThis is a summary of the changes necessary to migrate from SVGO v3 to SVGO v4. If you want more details or have any questions, please refer to our [release notes for SVGO v4.0.0](https://github.com/svg/svgo/releases/tag/v4.0.0) or related pull requests. You're encouraged to leave comments in pull requests if the existing content doesn't answer your question.\n\n## Version Requirements\n\nSVGO now requires [Node.js >=16.0.0](https://nodejs.org/blog/release/v16.0.0).\n\n## Default Behavior\n\nThe following changes have been made to default plugins, also known as [preset-default](/docs/preset-default/):\n\n- **[removeViewBox](/docs/plugins/removeViewBox/)** is no longer a default plugin to preserve scalability.\n- **[removeTitle](/docs/plugins/removeTitle)** is no longer a default plugin to preserve accessibility.\n\nTo continue using removeViewBox or removeTitle, configure it in the SVGO config. See the [README](https://github.com/svg/svgo?tab=readme-ov-file#configuration) for more context, but please consider reading the warnings in the respective plugin's documentation first:\n\n```diff\n  export default {\n    plugins: [\n      'preset-default', // built-in plugins enabled by default\n+     'removeViewBox',\n+     'removeTitle',\n    ],\n  };\n```\n\n## Plugins\n\nThe removeScriptElement plugin has been renamed to **[removeScripts](/docs/plugins/removeScripts)**, as it not only removes the `<script>` element but also event handlers and script URIs. If you were using the removeScriptElement plugin, amend your SVGO config to use removeScripts instead:\n\n```diff\n  export default {\n    plugins: [\n      'preset-default', // built-in plugins enabled by default\n-     'removeScriptElement',\n+     'removeScripts',\n    ],\n  };\n```\n\n## Public vs. Internal API\n\nWe now enforce a boundary between public and internal APIs. It's no longer possible to arbitrarily import any code declared by SVGO, but rather only the public API we declare as part of our semantic versioning.\n\nThere are two ways to import SVGO:\n\n- `svgo` — for normal usage, such as scripts or server-side applications.\n- `svgo/browser` — for browser usage.\n\n### Browser Bundle\n\nIf you use the browser bundle, you must amend how you import it:\n\n```diff\n- import { optimize } from 'svgo/dist/svgo.browser.js';\n+ import { optimize } from 'svgo/browser';\n```\n\n### Importing Helpers or Plugins\n\nIf you `import`/`require` helpers, the array of built-in plugins, or a single plugin during runtime, this is now a top-level export instead:\n\n```diff\n// import helpers\n- import { querySelector, querySelectorAll } from 'svgo/lib/xast.js';\n+ import { querySelector, querySelectorAll } from 'svgo';\n\n// import the array of built-in plugins\n- import { builtin } from 'svgo/lib/builtin';\n+ import { builtinPlugins } from 'svgo';\n\n// getting a single plugin\n- import presetDefault from 'svgo/plugins/preset-default';\n+ import { builtinPlugins } from 'svgo';\n+ const presetDefault = builtinPlugins.find(plugin => plugin.name === 'preset-default');\n\n// getting a map of plugin names to implementations\nimport { builtinPlugins } from 'svgo';\nconst pluginMap = builtinPlugins.reduce((acc, val) => acc.set(val.name, val), new Map());\n```\n\n### Selector Helpers\n\nXast/CSS helpers for selecting nodes must be imported from `svgo` instead and have different behavior. This affects custom plugins that use any of the following functions, where the `selector` (2nd) argument could reference parent or sibling nodes (i.e. `div > span`):\n\n- `querySelectorAll`\n- `querySelector`\n- `matches`\n\nIf this applies to you, then you need to pass a `Map` of nodes to their parent node as a third argument.\n\nA helper has been provided named `#mapNodesToParents`, which does this for you. This can be used to easily migrate to the new API. If you're not sure if you need it, then it's safer to take this approach. The third argument won't be necessary if `selector` doesn't traverse nodes. For example, querying using one or more attributes of a single node.\n\n```diff\n- import { querySelectorAll } from 'svgo';\n- const nodes = querySelectorAll(childNode, selector);\n+ import { querySelectorAll, mapNodesToParents } from 'svgo';\n+ const nodes = querySelectorAll(childNode, selector, mapNodesToParents(rootNode));\n```\n\nThe new API for these functions is as follows:\n\n```js\n// applies `selector` with context of the `childNode` and its descendants\nconst nodes = querySelectorAll(childNode, selector);\n\n// applies `selector` with context of the node tree relative from `childNode`\n// `rootNode` is required if result depends on a parent/sibling of `childNode`\nconst nodes = querySelectorAll(childNode, selector, rootNode);\n\n// same behavior as v3, as `rootNode` is already the entire node tree\nconst nodes = querySelectorAll(rootNode, selector);\n```\n\n## Named vs. Default Exports\n\nSVGO now only has named exports—there are no default exports in the public API.\n\nIf you use SVGO from the CLI, have a Common JS project (you import SVGO using `require`), or are already using named exports, you don't have to do anything.\n\nIf one way or another you're using the `import` keyword to import SVGO, then any instance where you use the default export must be replaced with the named equivalent.\n\n```diff\n- import svgo from 'svgo';\n- svgo.optimize('<svg></svg>');\n\n// Option 1. Use named exports!\n+ import { optimize } from 'svgo';\n+ optimize('<svg></svg>');\n\n// Option 2. Or import everything as svgo!\n+ import * as svgo from 'svgo';\n+ svgo.optimize('<svg></svg>');\n```\n"
  },
  {
    "path": "docs/06-migrations/02-migration-from-v2-to-v3.mdx",
    "content": "---\ntitle: Migration from v2 to v3\n---\n\nThis is a summary of the changes necessary to migrate from SVGO v2 to SVGO v3. If you want more details or have any questions, please refer to our [release notes for SVGO v3.0.0](https://github.com/svg/svgo/releases/tag/v3.0.0).\n\n## Version Requirements\n\nSVGO now requires [Node.js >=14.0.0](https://nodejs.org/blog/release/v14.0.0).\n\n## Default Behavior\n\nThe **[sortAttrs](/docs/plugins/sortAttrs)** plugin is now enabled by default to improve gzip compression.\n\nTo disable this behavior, configure it in the SVGO config. See the [README](https://github.com/svg/svgo?tab=readme-ov-file#configuration) for more context.\n\n```diff\n  export default {\n    plugins: [\n-     'preset-default',\n+     {\n+       name: 'preset-default',\n+       params: {\n+         overrides: {\n+           sortAttrs: false,\n+         },\n+       },\n+     },\n    ],\n  };\n```\n\n## Plugins\n\nThe cleanupIDs plugin has been renamed to **[cleanupIds](/docs/plugins/cleanupIds)** to bring more consistency between plugin names. If you were using cleanupIDs explicitly, amend your SVGO config to use cleanupIds instead:\n\n```diff\n  export default {\n    plugins: [\n-     'cleanupIDs',\n+     'cleanupIds',\n    ],\n  };\n```\n\nThe cleanupIds plugin no longer accepts the `prefix` parameter. Use the **[prefixIds](/docs/plugins/prefixIds)** plugin instead. You must put prefixIds **_after_** cleanupIds. Doing so the other way around would just remove the prefixes again.\n\n```diff\n  export default {\n    plugins: [\n      {\n        name: 'cleanupIds',\n-       params: {\n-         prefix: 'my-prefix',\n-       },\n      },\n+     {\n+       name: 'prefixIds',\n+       params: {\n+         prefix: 'my-prefix',\n+       },\n+     },\n    ]\n  }\n```\n\n## Configuration\n\n### Active Plugins\n\nPlugins defined in the `plugins` array no longer accept the property `active`. A plugin is enabled if it is named, and disabled if it is not named. Remove these entries from your config outright if you do not want them enabled.\n\n```diff\n  export default {\n    plugins: [\n      {\n        name: 'removeDoctype',\n-       active: true,\n      },\n-     {\n-       name: 'removeComments',\n-       active: false,\n-     },\n    ],\n  }\n```\n\n### Overriding Default Plugins\n\nThe `extendDefaultPlugins` helper utility has been removed. You can disable plugins that are enabled by default in `preset-default` through the `override` parameter instead.\n\n```diff\n- import { extendDefaultPlugins } from 'svgo';\n\n  export default {\n-   plugins: extendDefaultPlugins([\n-     {\n-       name: 'collapseGroups',\n-       active: false,\n-     },\n-   ]),\n+   plugins: [\n+     {\n+       name: 'preset-default',\n+       params: {\n+         overrides: {\n+           collapseGroups: false,\n+         },\n+       },\n+     },\n+   ],\n  }\n```\n\n## JavaScript API\n\nWe've removed the `info` property from the optimization result. This means we no longer return a width and height of the SVG. We've also removed `error` and `modernError` from the optimization result. All exceptions are thrown to the caller.\n\n```diff\n- const {data, error, modernError } = optimize(svg)\n+ try {\n+   const { data } = optimize(svg)\n+ } catch (error) {\n+   if (error.name === 'SvgoParserError') {\n+     error.toString(); // formatted error\n+   } else {\n+     // other runtime error\n+   }\n+ }\n```\n\n## Custom Plugins\n\nWe previously supported different types of plugins: `full`, `perItem`, `perItemReverse`, and `visitor`.\n\nWe now only support the `visitor` plugin API. Any other type would need to be migrated to it. See the [Plugin Architecture documentation](/docs/plugins-api) for more information.\n\n## TypeScript\n\nSVGO now bundles TypeScript declarations in the npm package. There is no need to install `@types/svgo` separately. This does not affect users that never depended on `@types/svgo` directly or indirectly. You can check your lockfile to be sure.\n\nIf you depended on `@types/svgo` before, uninstall it:\n\n```sh\n# npm\nnpm uninstall @types/svgo\n\n# Yarn\nyarn remove @types/svgo\n```\n"
  },
  {
    "path": "docs/06-migrations/_category_.json",
    "content": "{\n  \"label\": \"Migrations\"\n}\n"
  },
  {
    "path": "eslint.config.mjs",
    "content": "import js from '@eslint/js';\nimport globals from 'globals';\n\n/** @type {import('eslint').Linter.Config[]} */\nexport default [\n  {\n    ignores: [\n      '.yarn/**',\n      '.yarnrc.yml',\n      'node_modules/**',\n      'dist/**',\n      'test/cli/output/**',\n      'coverage/**',\n    ],\n  },\n  {\n    languageOptions: {\n      ecmaVersion: 'latest',\n      globals: {\n        ...globals.nodeBuiltin,\n      },\n    },\n    linterOptions: {\n      reportUnusedDisableDirectives: 'error',\n    },\n  },\n  js.configs.recommended,\n  {\n    files: ['**/*.js', '**/*.mjs'],\n    rules: {\n      'one-var': ['error', 'never'],\n      curly: 'error',\n      strict: 'error',\n    },\n  },\n  {\n    files: ['**/*.test.js'],\n    languageOptions: {\n      globals: {\n        ...globals.jest,\n      },\n    },\n  },\n];\n"
  },
  {
    "path": "lib/builtin.js",
    "content": "import presetDefault from '../plugins/preset-default.js';\nimport * as addAttributesToSVGElement from '../plugins/addAttributesToSVGElement.js';\nimport * as addClassesToSVGElement from '../plugins/addClassesToSVGElement.js';\nimport * as cleanupAttrs from '../plugins/cleanupAttrs.js';\nimport * as cleanupEnableBackground from '../plugins/cleanupEnableBackground.js';\nimport * as cleanupIds from '../plugins/cleanupIds.js';\nimport * as cleanupListOfValues from '../plugins/cleanupListOfValues.js';\nimport * as cleanupNumericValues from '../plugins/cleanupNumericValues.js';\nimport * as collapseGroups from '../plugins/collapseGroups.js';\nimport * as convertColors from '../plugins/convertColors.js';\nimport * as convertEllipseToCircle from '../plugins/convertEllipseToCircle.js';\nimport * as convertOneStopGradients from '../plugins/convertOneStopGradients.js';\nimport * as convertPathData from '../plugins/convertPathData.js';\nimport * as convertShapeToPath from '../plugins/convertShapeToPath.js';\nimport * as convertStyleToAttrs from '../plugins/convertStyleToAttrs.js';\nimport * as convertTransform from '../plugins/convertTransform.js';\nimport * as mergeStyles from '../plugins/mergeStyles.js';\nimport * as inlineStyles from '../plugins/inlineStyles.js';\nimport * as mergePaths from '../plugins/mergePaths.js';\nimport * as minifyStyles from '../plugins/minifyStyles.js';\nimport * as moveElemsAttrsToGroup from '../plugins/moveElemsAttrsToGroup.js';\nimport * as moveGroupAttrsToElems from '../plugins/moveGroupAttrsToElems.js';\nimport * as prefixIds from '../plugins/prefixIds.js';\nimport * as removeAttributesBySelector from '../plugins/removeAttributesBySelector.js';\nimport * as removeAttrs from '../plugins/removeAttrs.js';\nimport * as removeComments from '../plugins/removeComments.js';\nimport * as removeDeprecatedAttrs from '../plugins/removeDeprecatedAttrs.js';\nimport * as removeDesc from '../plugins/removeDesc.js';\nimport * as removeDimensions from '../plugins/removeDimensions.js';\nimport * as removeDoctype from '../plugins/removeDoctype.js';\nimport * as removeEditorsNSData from '../plugins/removeEditorsNSData.js';\nimport * as removeElementsByAttr from '../plugins/removeElementsByAttr.js';\nimport * as removeEmptyAttrs from '../plugins/removeEmptyAttrs.js';\nimport * as removeEmptyContainers from '../plugins/removeEmptyContainers.js';\nimport * as removeEmptyText from '../plugins/removeEmptyText.js';\nimport * as removeHiddenElems from '../plugins/removeHiddenElems.js';\nimport * as removeMetadata from '../plugins/removeMetadata.js';\nimport * as removeNonInheritableGroupAttrs from '../plugins/removeNonInheritableGroupAttrs.js';\nimport * as removeOffCanvasPaths from '../plugins/removeOffCanvasPaths.js';\nimport * as removeRasterImages from '../plugins/removeRasterImages.js';\nimport * as removeScripts from '../plugins/removeScripts.js';\nimport * as removeStyleElement from '../plugins/removeStyleElement.js';\nimport * as removeTitle from '../plugins/removeTitle.js';\nimport * as removeUnknownsAndDefaults from '../plugins/removeUnknownsAndDefaults.js';\nimport * as removeUnusedNS from '../plugins/removeUnusedNS.js';\nimport * as removeUselessDefs from '../plugins/removeUselessDefs.js';\nimport * as removeUselessStrokeAndFill from '../plugins/removeUselessStrokeAndFill.js';\nimport * as removeViewBox from '../plugins/removeViewBox.js';\nimport * as removeXlink from '../plugins/removeXlink.js';\nimport * as removeXMLNS from '../plugins/removeXMLNS.js';\nimport * as removeXMLProcInst from '../plugins/removeXMLProcInst.js';\nimport * as reusePaths from '../plugins/reusePaths.js';\nimport * as sortAttrs from '../plugins/sortAttrs.js';\nimport * as sortDefsChildren from '../plugins/sortDefsChildren.js';\n\n/**\n * Plugins that are bundled with SVGO. This includes plugin presets, and plugins\n * that are not enabled by default.\n *\n * @type {ReadonlyArray<{[Name in keyof import('./types.js').PluginsParams]: import('./types.js').BuiltinPluginOrPreset<Name, import('./types.js').PluginsParams[Name]>;}[keyof import('./types.js').PluginsParams]>}\n */\nexport const builtinPlugins = Object.freeze([\n  presetDefault,\n  addAttributesToSVGElement,\n  addClassesToSVGElement,\n  cleanupAttrs,\n  cleanupEnableBackground,\n  cleanupIds,\n  cleanupListOfValues,\n  cleanupNumericValues,\n  collapseGroups,\n  convertColors,\n  convertEllipseToCircle,\n  convertOneStopGradients,\n  convertPathData,\n  convertShapeToPath,\n  convertStyleToAttrs,\n  convertTransform,\n  inlineStyles,\n  mergePaths,\n  mergeStyles,\n  minifyStyles,\n  moveElemsAttrsToGroup,\n  moveGroupAttrsToElems,\n  prefixIds,\n  removeAttributesBySelector,\n  removeAttrs,\n  removeComments,\n  removeDeprecatedAttrs,\n  removeDesc,\n  removeDimensions,\n  removeDoctype,\n  removeEditorsNSData,\n  removeElementsByAttr,\n  removeEmptyAttrs,\n  removeEmptyContainers,\n  removeEmptyText,\n  removeHiddenElems,\n  removeMetadata,\n  removeNonInheritableGroupAttrs,\n  removeOffCanvasPaths,\n  removeRasterImages,\n  removeScripts,\n  removeStyleElement,\n  removeTitle,\n  removeUnknownsAndDefaults,\n  removeUnusedNS,\n  removeUselessDefs,\n  removeUselessStrokeAndFill,\n  removeViewBox,\n  removeXlink,\n  removeXMLNS,\n  removeXMLProcInst,\n  reusePaths,\n  sortAttrs,\n  sortDefsChildren,\n]);\n"
  },
  {
    "path": "lib/parser.js",
    "content": "import SAX from 'sax';\nimport { textElems } from '../plugins/_collections.js';\n\nexport class SvgoParserError extends Error {\n  /**\n   * @param {string} message\n   * @param {number} line\n   * @param {number} column\n   * @param {string} source\n   * @param {string=} file\n   */\n  constructor(message, line, column, source, file) {\n    super(message);\n    this.name = 'SvgoParserError';\n    this.message = `${file || '<input>'}:${line}:${column}: ${message}`;\n    this.reason = message;\n    this.line = line;\n    this.column = column;\n    this.source = source;\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, SvgoParserError);\n    }\n  }\n\n  toString() {\n    const lines = this.source.split(/\\r?\\n/);\n    const startLine = Math.max(this.line - 3, 0);\n    const endLine = Math.min(this.line + 2, lines.length);\n    const lineNumberWidth = String(endLine).length;\n    const startColumn = Math.max(this.column - 54, 0);\n    const endColumn = Math.max(this.column + 20, 80);\n    const code = lines\n      .slice(startLine, endLine)\n      .map((line, index) => {\n        const lineSlice = line.slice(startColumn, endColumn);\n        let ellipsisPrefix = '';\n        let ellipsisSuffix = '';\n        if (startColumn !== 0) {\n          ellipsisPrefix = startColumn > line.length - 1 ? ' ' : '…';\n        }\n        if (endColumn < line.length - 1) {\n          ellipsisSuffix = '…';\n        }\n        const number = startLine + 1 + index;\n        const gutter = ` ${number.toString().padStart(lineNumberWidth)} | `;\n        if (number === this.line) {\n          const gutterSpacing = gutter.replace(/[^|]/g, ' ');\n          const lineSpacing = (\n            ellipsisPrefix + line.slice(startColumn, this.column - 1)\n          ).replace(/[^\\t]/g, ' ');\n          const spacing = gutterSpacing + lineSpacing;\n          return `>${gutter}${ellipsisPrefix}${lineSlice}${ellipsisSuffix}\\n ${spacing}^`;\n        }\n        return ` ${gutter}${ellipsisPrefix}${lineSlice}${ellipsisSuffix}`;\n      })\n      .join('\\n');\n    return `${this.name}: ${this.message}\\n\\n${code}\\n`;\n  }\n}\n\nconst entityDeclaration = /<!ENTITY\\s+(\\S+)\\s+(?:'([^']+)'|\"([^\"]+)\")\\s*>/g;\n\nconst config = {\n  strict: true,\n  trim: false,\n  normalize: false,\n  lowercase: true,\n  xmlns: true,\n  position: true,\n  unparsedEntities: true,\n};\n\n/**\n * Convert SVG (XML) string to SVG-as-JS object.\n *\n * @param {string} data\n * @param {string=} from\n * @returns {import('./types.js').XastRoot}\n */\nexport const parseSvg = (data, from) => {\n  const sax = SAX.parser(config.strict, config);\n  /** @type {import('./types.js').XastRoot} */\n  const root = { type: 'root', children: [] };\n  /** @type {import('./types.js').XastParent} */\n  let current = root;\n  /** @type {import('./types.js').XastParent[]} */\n  const stack = [root];\n\n  /**\n   * @param {import('./types.js').XastChild} node\n   */\n  const pushToContent = (node) => {\n    current.children.push(node);\n  };\n\n  sax.ondoctype = (doctype) => {\n    /** @type {import('./types.js').XastDoctype} */\n    const node = {\n      type: 'doctype',\n      // TODO parse doctype for name, public and system to match xast\n      name: 'svg',\n      data: {\n        doctype,\n      },\n    };\n    pushToContent(node);\n    const subsetStart = doctype.indexOf('[');\n    if (subsetStart >= 0) {\n      entityDeclaration.lastIndex = subsetStart;\n      let entityMatch = entityDeclaration.exec(data);\n      while (entityMatch != null) {\n        sax.ENTITIES[entityMatch[1]] = entityMatch[2] || entityMatch[3];\n        entityMatch = entityDeclaration.exec(data);\n      }\n    }\n  };\n\n  sax.onprocessinginstruction = (data) => {\n    /** @type {import('./types.js').XastInstruction} */\n    const node = {\n      type: 'instruction',\n      name: data.name,\n      value: data.body,\n    };\n    pushToContent(node);\n  };\n\n  sax.oncomment = (comment) => {\n    /** @type {import('./types.js').XastComment} */\n    const node = {\n      type: 'comment',\n      value: comment.trim(),\n    };\n    pushToContent(node);\n  };\n\n  sax.oncdata = (cdata) => {\n    /** @type {import('./types.js').XastCdata} */\n    const node = {\n      type: 'cdata',\n      value: cdata,\n    };\n    pushToContent(node);\n  };\n\n  sax.onopentag = (data) => {\n    /** @type {import('./types.js').XastElement} */\n    const element = {\n      type: 'element',\n      name: data.name,\n      attributes: {},\n      children: [],\n    };\n    for (const [name, attr] of Object.entries(data.attributes)) {\n      element.attributes[name] = attr.value;\n    }\n    pushToContent(element);\n    current = element;\n    stack.push(element);\n  };\n\n  sax.ontext = (text) => {\n    if (current.type === 'element') {\n      // prevent trimming of meaningful whitespace inside textual tags\n      if (textElems.has(current.name)) {\n        /** @type {import('./types.js').XastText} */\n        const node = {\n          type: 'text',\n          value: text,\n        };\n        pushToContent(node);\n      } else {\n        const value = text.trim();\n\n        if (value !== '') {\n          /** @type {import('./types.js').XastText} */\n          const node = {\n            type: 'text',\n            value,\n          };\n          pushToContent(node);\n        }\n      }\n    }\n  };\n\n  sax.onclosetag = () => {\n    stack.pop();\n    current = stack[stack.length - 1];\n  };\n\n  sax.onerror = (e) => {\n    const reason = e.message.split('\\n')[0];\n    const error = new SvgoParserError(\n      reason,\n      sax.line + 1,\n      sax.column,\n      data,\n      from,\n    );\n    if (e.message.indexOf('Unexpected end') === -1) {\n      throw error;\n    }\n  };\n\n  sax.write(data).close();\n  return root;\n};\n"
  },
  {
    "path": "lib/parser.test.js",
    "content": "import { parseSvg } from './parser.js';\nimport { stringifySvg } from './stringifier.js';\n\nconst input = `<svg xmlns=\"http://www.w3.org/2000/svg\">\n<text x=\"10\" y=\"35\" xml:space=\"preserve\">\n    <a href=\"x\">\nthis is a test\n    </a>\n</text>\n<text x=\"10\" y=\"35\" xml:space=\"preserve\">\n    <tspan>\nthis is a test\n    </tspan>\n</text>\n</svg>`;\n\nconst expected = `<svg xmlns=\"http://www.w3.org/2000/svg\"><text x=\"10\" y=\"35\" xml:space=\"preserve\">\n    <a href=\"x\">\nthis is a test\n    </a>\n</text><text x=\"10\" y=\"35\" xml:space=\"preserve\">\n    <tspan>\nthis is a test\n    </tspan>\n</text></svg>`;\n\ntest('a text preserved', () => {\n  const parsed = parseSvg(input);\n  const actual = stringifySvg(parsed, {});\n\n  expect(actual).toBe(expected);\n});\n"
  },
  {
    "path": "lib/path.js",
    "content": "/**\n * @fileoverview Based on https://www.w3.org/TR/SVG11/paths.html#PathDataBNF.\n */\n\nimport { removeLeadingZero, toFixed } from './svgo/tools.js';\n\n/**\n * @typedef {'none' | 'sign' | 'whole' | 'decimal_point' | 'decimal' | 'e' | 'exponent_sign' | 'exponent'} ReadNumberState\n *\n * @typedef StringifyPathDataOptions\n * @property {ReadonlyArray<import('./types.js').PathDataItem>} pathData\n * @property {number=} precision\n * @property {boolean=} disableSpaceAfterFlags\n */\n\nconst argsCountPerCommand = {\n  M: 2,\n  m: 2,\n  Z: 0,\n  z: 0,\n  L: 2,\n  l: 2,\n  H: 1,\n  h: 1,\n  V: 1,\n  v: 1,\n  C: 6,\n  c: 6,\n  S: 4,\n  s: 4,\n  Q: 4,\n  q: 4,\n  T: 2,\n  t: 2,\n  A: 7,\n  a: 7,\n};\n\n/**\n * @param {string} c\n * @returns {c is import('./types.js').PathDataCommand}\n */\nconst isCommand = (c) => {\n  return c in argsCountPerCommand;\n};\n\n/**\n * @param {string} c\n * @returns {boolean}\n */\nconst isWhiteSpace = (c) => {\n  return c === ' ' || c === '\\t' || c === '\\r' || c === '\\n';\n};\n\n/**\n * @param {string} c\n * @returns {boolean}\n */\nconst isDigit = (c) => {\n  const codePoint = c.codePointAt(0);\n  if (codePoint == null) {\n    return false;\n  }\n  return 48 <= codePoint && codePoint <= 57;\n};\n\n/**\n * @param {string} string\n * @param {number} cursor\n * @returns {[number, ?number]}\n */\nconst readNumber = (string, cursor) => {\n  let i = cursor;\n  let value = '';\n  /** @type {ReadNumberState} */\n  let state = 'none';\n  for (; i < string.length; i += 1) {\n    const c = string[i];\n    if (c === '+' || c === '-') {\n      if (state === 'none') {\n        state = 'sign';\n        value += c;\n        continue;\n      }\n      if (state === 'e') {\n        state = 'exponent_sign';\n        value += c;\n        continue;\n      }\n    }\n    if (isDigit(c)) {\n      if (state === 'none' || state === 'sign' || state === 'whole') {\n        state = 'whole';\n        value += c;\n        continue;\n      }\n      if (state === 'decimal_point' || state === 'decimal') {\n        state = 'decimal';\n        value += c;\n        continue;\n      }\n      if (state === 'e' || state === 'exponent_sign' || state === 'exponent') {\n        state = 'exponent';\n        value += c;\n        continue;\n      }\n    }\n    if (c === '.') {\n      if (state === 'none' || state === 'sign' || state === 'whole') {\n        state = 'decimal_point';\n        value += c;\n        continue;\n      }\n    }\n    if (c === 'E' || c == 'e') {\n      if (\n        state === 'whole' ||\n        state === 'decimal_point' ||\n        state === 'decimal'\n      ) {\n        state = 'e';\n        value += c;\n        continue;\n      }\n    }\n    break;\n  }\n  const number = Number.parseFloat(value);\n  if (Number.isNaN(number)) {\n    return [cursor, null];\n  } else {\n    // step back to delegate iteration to parent loop\n    return [i - 1, number];\n  }\n};\n\n/**\n * @param {string} string\n * @returns {import('./types.js').PathDataItem[]}\n */\nexport const parsePathData = (string) => {\n  /** @type {import('./types.js').PathDataItem[]} */\n  const pathData = [];\n  /** @type {?import('./types.js').PathDataCommand} */\n  let command = null;\n  let args = /** @type {number[]} */ ([]);\n  let argsCount = 0;\n  let canHaveComma = false;\n  let hadComma = false;\n  for (let i = 0; i < string.length; i += 1) {\n    const c = string.charAt(i);\n    if (isWhiteSpace(c)) {\n      continue;\n    }\n    // allow comma only between arguments\n    if (canHaveComma && c === ',') {\n      if (hadComma) {\n        break;\n      }\n      hadComma = true;\n      continue;\n    }\n    if (isCommand(c)) {\n      if (hadComma) {\n        return pathData;\n      }\n      if (command == null) {\n        // moveto should be leading command\n        if (c !== 'M' && c !== 'm') {\n          return pathData;\n        }\n      } else if (args.length !== 0) {\n        // stop if previous command arguments are not flushed\n        return pathData;\n      }\n      command = c;\n      args = [];\n      argsCount = argsCountPerCommand[command];\n      canHaveComma = false;\n      // flush command without arguments\n      if (argsCount === 0) {\n        pathData.push({ command, args });\n      }\n      continue;\n    }\n    // avoid parsing arguments if no command detected\n    if (command == null) {\n      return pathData;\n    }\n    // read next argument\n    let newCursor = i;\n    let number = null;\n    if (command === 'A' || command === 'a') {\n      const position = args.length;\n      if (\n        position === 0 ||\n        position === 1 ||\n        position === 2 ||\n        position === 5 ||\n        position === 6\n      ) {\n        [newCursor, number] = readNumber(string, i);\n      }\n      if (position === 3 || position === 4) {\n        // read flags\n        if (c === '0') {\n          number = 0;\n        }\n        if (c === '1') {\n          number = 1;\n        }\n      }\n    } else {\n      [newCursor, number] = readNumber(string, i);\n    }\n    if (number == null) {\n      return pathData;\n    }\n    args.push(number);\n    canHaveComma = true;\n    hadComma = false;\n    i = newCursor;\n    // flush arguments when necessary count is reached\n    if (args.length === argsCount) {\n      if (command === 'A' || command === 'a') {\n        args[0] = Math.abs(args[0]);\n        args[1] = Math.abs(args[1]);\n      }\n      pathData.push({ command, args });\n      // subsequent moveto coordinates are treated as implicit lineto commands\n      if (command === 'M') {\n        command = 'L';\n      }\n      if (command === 'm') {\n        command = 'l';\n      }\n      args = [];\n    }\n  }\n  return pathData;\n};\n\n/**\n * @param {number} number\n * @param {number=} precision\n * @returns {{ roundedStr: string, rounded: number }}\n */\nconst roundAndStringify = (number, precision) => {\n  if (precision != null) {\n    number = toFixed(number, precision);\n  }\n\n  return {\n    roundedStr: removeLeadingZero(number),\n    rounded: number,\n  };\n};\n\n/**\n * Elliptical arc large-arc and sweep flags are rendered with spaces\n * because many non-browser environments are not able to parse such paths\n *\n * @param {string} command\n * @param {ReadonlyArray<number>} args\n * @param {number=} precision\n * @param {boolean=} disableSpaceAfterFlags\n * @returns {string}\n */\nconst stringifyArgs = (command, args, precision, disableSpaceAfterFlags) => {\n  let result = '';\n  let previous;\n\n  for (let i = 0; i < args.length; i++) {\n    const { roundedStr, rounded } = roundAndStringify(args[i], precision);\n    if (\n      disableSpaceAfterFlags &&\n      (command === 'A' || command === 'a') &&\n      // consider combined arcs\n      (i % 7 === 4 || i % 7 === 5)\n    ) {\n      result += roundedStr;\n    } else if (i === 0 || rounded < 0) {\n      // avoid space before first and negative numbers\n      result += roundedStr;\n    } else if (!Number.isInteger(previous) && !isDigit(roundedStr[0])) {\n      // remove space before decimal with zero whole\n      // only when previous number is also decimal\n      result += roundedStr;\n    } else {\n      result += ` ${roundedStr}`;\n    }\n    previous = rounded;\n  }\n\n  return result;\n};\n\n/**\n * @param {StringifyPathDataOptions} options\n * @returns {string}\n */\nexport const stringifyPathData = ({\n  pathData,\n  precision,\n  disableSpaceAfterFlags,\n}) => {\n  if (pathData.length === 1) {\n    const { command, args } = pathData[0];\n    return (\n      command + stringifyArgs(command, args, precision, disableSpaceAfterFlags)\n    );\n  }\n\n  let result = '';\n  let prev = { ...pathData[0] };\n\n  // match leading moveto with following lineto\n  if (pathData[1].command === 'L') {\n    prev.command = 'M';\n  } else if (pathData[1].command === 'l') {\n    prev.command = 'm';\n  }\n\n  for (let i = 1; i < pathData.length; i++) {\n    const { command, args } = pathData[i];\n    if (\n      (prev.command === command &&\n        prev.command !== 'M' &&\n        prev.command !== 'm') ||\n      // combine matching moveto and lineto sequences\n      (prev.command === 'M' && command === 'L') ||\n      (prev.command === 'm' && command === 'l')\n    ) {\n      prev.args = [...prev.args, ...args];\n      if (i === pathData.length - 1) {\n        result +=\n          prev.command +\n          stringifyArgs(\n            prev.command,\n            prev.args,\n            precision,\n            disableSpaceAfterFlags,\n          );\n      }\n    } else {\n      result +=\n        prev.command +\n        stringifyArgs(\n          prev.command,\n          prev.args,\n          precision,\n          disableSpaceAfterFlags,\n        );\n\n      if (i === pathData.length - 1) {\n        result +=\n          command +\n          stringifyArgs(command, args, precision, disableSpaceAfterFlags);\n      } else {\n        prev = { command, args };\n      }\n    }\n  }\n\n  return result;\n};\n"
  },
  {
    "path": "lib/path.test.js",
    "content": "import { parsePathData, stringifyPathData } from './path.js';\n\ndescribe('parse path data', () => {\n  it('should allow spaces between commands', () => {\n    expect(parsePathData('M0 10 L \\n\\r\\t20 30')).toStrictEqual([\n      { command: 'M', args: [0, 10] },\n      { command: 'L', args: [20, 30] },\n    ]);\n  });\n  it('should allow spaces and commas between arguments', () => {\n    expect(parsePathData('M0 , 10 L 20 \\n\\r\\t30,40,50')).toStrictEqual([\n      { command: 'M', args: [0, 10] },\n      { command: 'L', args: [20, 30] },\n      { command: 'L', args: [40, 50] },\n    ]);\n  });\n  it('should forbid commas before commands', () => {\n    expect(parsePathData(', M0 10')).toStrictEqual([]);\n  });\n  it('should forbid commas between commands', () => {\n    expect(parsePathData('M0,10 , L 20,30')).toStrictEqual([\n      { command: 'M', args: [0, 10] },\n    ]);\n  });\n  it('should forbid commas between command name and argument', () => {\n    expect(parsePathData('M0,10 L,20,30')).toStrictEqual([\n      { command: 'M', args: [0, 10] },\n    ]);\n  });\n  it('should forbid multiple commas in a row', () => {\n    expect(parsePathData('M0 , , 10')).toStrictEqual([]);\n  });\n  it('should stop when unknown char appears', () => {\n    expect(parsePathData('M0 10 , L 20 #40')).toStrictEqual([\n      { command: 'M', args: [0, 10] },\n    ]);\n  });\n  it('should stop when not enough arguments', () => {\n    expect(parsePathData('M0 10 L 20 L 30 40')).toStrictEqual([\n      { command: 'M', args: [0, 10] },\n    ]);\n  });\n  it('should stop if moveto not the first command', () => {\n    expect(parsePathData('L 10 20')).toStrictEqual([]);\n    expect(parsePathData('10 20')).toStrictEqual([]);\n  });\n  it('should stop on invalid scientific notation', () => {\n    expect(parsePathData('M 0 5e++1 L 0 0')).toStrictEqual([\n      { command: 'M', args: [0, 5] },\n    ]);\n  });\n  it('should stop on invalid numbers', () => {\n    expect(parsePathData('M ...')).toStrictEqual([]);\n  });\n  it('should handle arcs', () => {\n    expect(\n      parsePathData(\n        `\n          M600,350\n          l 50,-25\n          a25,25 -30 0,1 50,-25\n          25,50 -30 0,1 50,-25\n          25,75 -30 01.2,-25\n          a25,100 -30 0150,-25\n          l 50,-25\n        `,\n      ),\n    ).toStrictEqual([\n      { command: 'M', args: [600, 350] },\n      { command: 'l', args: [50, -25] },\n      { command: 'a', args: [25, 25, -30, 0, 1, 50, -25] },\n      { command: 'a', args: [25, 50, -30, 0, 1, 50, -25] },\n      { command: 'a', args: [25, 75, -30, 0, 1, 0.2, -25] },\n      { command: 'a', args: [25, 100, -30, 0, 1, 50, -25] },\n      { command: 'l', args: [50, -25] },\n    ]);\n  });\n  it('should normalize signed arc radii', () => {\n    expect(\n      parsePathData('M0 0A-10 +20 0 0 1 30 40a+50 -60 0 1 0 70 80'),\n    ).toStrictEqual([\n      { command: 'M', args: [0, 0] },\n      { command: 'A', args: [10, 20, 0, 0, 1, 30, 40] },\n      { command: 'a', args: [50, 60, 0, 1, 0, 70, 80] },\n    ]);\n  });\n});\n\ndescribe('stringify path data', () => {\n  it('should combine sequence of the same commands', () => {\n    expect(\n      stringifyPathData({\n        pathData: [\n          { command: 'M', args: [0, 0] },\n          { command: 'h', args: [10] },\n          { command: 'h', args: [20] },\n          { command: 'h', args: [30] },\n          { command: 'H', args: [40] },\n          { command: 'H', args: [50] },\n        ],\n      }),\n    ).toBe('M0 0h10 20 30H40 50');\n  });\n  it('should not combine sequence of moveto', () => {\n    expect(\n      stringifyPathData({\n        pathData: [\n          { command: 'M', args: [0, 0] },\n          { command: 'M', args: [10, 10] },\n          { command: 'm', args: [20, 30] },\n          { command: 'm', args: [40, 50] },\n        ],\n      }),\n    ).toBe('M0 0M10 10m20 30m40 50');\n  });\n  it('should combine moveto and sequence of lineto', () => {\n    expect(\n      stringifyPathData({\n        pathData: [\n          { command: 'M', args: [0, 0] },\n          { command: 'l', args: [10, 10] },\n          { command: 'M', args: [0, 0] },\n          { command: 'l', args: [10, 10] },\n          { command: 'M', args: [0, 0] },\n          { command: 'L', args: [10, 10] },\n        ],\n      }),\n    ).toBe('m0 0 10 10M0 0l10 10M0 0 10 10');\n    expect(\n      stringifyPathData({\n        pathData: [\n          { command: 'm', args: [0, 0] },\n          { command: 'L', args: [10, 10] },\n        ],\n      }),\n    ).toBe('M0 0 10 10');\n  });\n  it('should avoid space before first, negative and decimals', () => {\n    expect(\n      stringifyPathData({\n        pathData: [\n          { command: 'M', args: [0, -1.2] },\n          { command: 'L', args: [0.3, 4] },\n          { command: 'L', args: [5, -0.6] },\n          { command: 'L', args: [7, 0.8] },\n        ],\n      }),\n    ).toBe('M0-1.2.3 4 5-.6 7 .8');\n  });\n  it('should have a space before scientific notation', () => {\n    expect(\n      stringifyPathData({\n        pathData: [\n          { command: 'M', args: [0.1, 1e-7] },\n          { command: 'L', args: [2, 2] },\n        ],\n        precision: 7,\n      }),\n    ).toBe('M.1 1e-7 2 2');\n  });\n  it('should configure precision', () => {\n    /** @type {ReadonlyArray<import('../lib/types.js').PathDataItem>} */\n    const pathData = [\n      { command: 'M', args: [0, -1.9876] },\n      { command: 'L', args: [0.3, 3.14159265] },\n      { command: 'L', args: [-0.3, -3.14159265] },\n      { command: 'L', args: [100, 200] },\n    ];\n    expect(\n      stringifyPathData({\n        pathData,\n        precision: 3,\n      }),\n    ).toBe('M0-1.988.3 3.142-.3-3.142 100 200');\n    expect(\n      stringifyPathData({\n        pathData,\n        precision: 0,\n      }),\n    ).toBe('M0-2 0 3 0-3 100 200');\n  });\n  it('allows to avoid spaces after arc flags', () => {\n    /** @type {ReadonlyArray<import('../lib/types.js').PathDataItem>} */\n    const pathData = [\n      { command: 'M', args: [0, 0] },\n      { command: 'A', args: [50, 50, 10, 1, 0, 0.2, 20] },\n      { command: 'a', args: [50, 50, 10, 1, 0, 0.2, 20] },\n      { command: 'a', args: [50, 50, 10, 1, 0, 0.2, 20] },\n    ];\n    expect(\n      stringifyPathData({\n        pathData,\n        disableSpaceAfterFlags: false,\n      }),\n    ).toBe('M0 0A50 50 10 1 0 .2 20a50 50 10 1 0 .2 20 50 50 10 1 0 .2 20');\n    expect(\n      stringifyPathData({\n        pathData,\n        disableSpaceAfterFlags: true,\n      }),\n    ).toBe('M0 0A50 50 10 10.2 20a50 50 10 10.2 20 50 50 10 10.2 20');\n  });\n});\n"
  },
  {
    "path": "lib/stringifier.js",
    "content": "import { textElems } from '../plugins/_collections.js';\n\n/**\n * @typedef {Required<import('./types.js').StringifyOptions>} Options\n *\n * @typedef State\n * @property {string} indent\n * @property {?import('./types.js').XastElement} textContext\n * @property {number} indentLevel\n */\n\n/**\n * @param {string} char\n * @returns {string}\n */\nconst encodeEntity = (char) => {\n  return entities[char];\n};\n\n/** @type {Options} */\nconst defaults = {\n  doctypeStart: '<!DOCTYPE',\n  doctypeEnd: '>',\n  procInstStart: '<?',\n  procInstEnd: '?>',\n  tagOpenStart: '<',\n  tagOpenEnd: '>',\n  tagCloseStart: '</',\n  tagCloseEnd: '>',\n  tagShortStart: '<',\n  tagShortEnd: '/>',\n  attrStart: '=\"',\n  attrEnd: '\"',\n  commentStart: '<!--',\n  commentEnd: '-->',\n  cdataStart: '<![CDATA[',\n  cdataEnd: ']]>',\n  textStart: '',\n  textEnd: '',\n  indent: 4,\n  regEntities: /[&'\"<>]/g,\n  regValEntities: /[&\"<>]/g,\n  encodeEntity,\n  pretty: false,\n  useShortTags: true,\n  eol: 'lf',\n  finalNewline: false,\n};\n\n/** @type {Record<string, string>} */\nconst entities = {\n  '&': '&amp;',\n  \"'\": '&apos;',\n  '\"': '&quot;',\n  '>': '&gt;',\n  '<': '&lt;',\n};\n\n/**\n * Converts XAST to SVG string.\n *\n * @param {import('./types.js').XastRoot} data\n * @param {import('./types.js').StringifyOptions=} userOptions\n * @returns {string}\n */\nexport const stringifySvg = (data, userOptions = {}) => {\n  /** @type {Options} */\n  const config = { ...defaults, ...userOptions };\n  const indent = config.indent;\n  let newIndent = '    ';\n  if (typeof indent === 'number' && Number.isNaN(indent) === false) {\n    newIndent = indent < 0 ? '\\t' : ' '.repeat(indent);\n  } else if (typeof indent === 'string') {\n    newIndent = indent;\n  }\n  /** @type {State} */\n  const state = {\n    indent: newIndent,\n    textContext: null,\n    indentLevel: 0,\n  };\n  const eol = config.eol === 'crlf' ? '\\r\\n' : '\\n';\n  if (config.pretty) {\n    config.doctypeEnd += eol;\n    config.procInstEnd += eol;\n    config.commentEnd += eol;\n    config.cdataEnd += eol;\n    config.tagShortEnd += eol;\n    config.tagOpenEnd += eol;\n    config.tagCloseEnd += eol;\n    config.textEnd += eol;\n  }\n  let svg = stringifyNode(data, config, state);\n  if (config.finalNewline && svg.length > 0 && !svg.endsWith('\\n')) {\n    svg += eol;\n  }\n  return svg;\n};\n\n/**\n * @param {import('./types.js').XastParent} data\n * @param {Options} config\n * @param {State} state\n * @returns {string}\n */\nconst stringifyNode = (data, config, state) => {\n  let svg = '';\n  state.indentLevel++;\n  for (const item of data.children) {\n    switch (item.type) {\n      case 'element':\n        svg += stringifyElement(item, config, state);\n        break;\n      case 'text':\n        svg += stringifyText(item, config, state);\n        break;\n      case 'doctype':\n        svg += stringifyDoctype(item, config);\n        break;\n      case 'instruction':\n        svg += stringifyInstruction(item, config);\n        break;\n      case 'comment':\n        svg += stringifyComment(item, config);\n        break;\n      case 'cdata':\n        svg += stringifyCdata(item, config, state);\n    }\n  }\n  state.indentLevel--;\n  return svg;\n};\n\n/**\n * Create indent string in accordance with the current node level.\n *\n * @param {Options} config\n * @param {State} state\n * @returns {string}\n */\nconst createIndent = (config, state) => {\n  let indent = '';\n  if (config.pretty && state.textContext == null) {\n    indent = state.indent.repeat(state.indentLevel - 1);\n  }\n  return indent;\n};\n\n/**\n * @param {import('./types.js').XastDoctype} node\n * @param {Options} config\n * @returns {string}\n */\nconst stringifyDoctype = (node, config) => {\n  return config.doctypeStart + node.data.doctype + config.doctypeEnd;\n};\n\n/**\n * @param {import('./types.js').XastInstruction} node\n * @param {Options} config\n * @returns {string}\n */\nconst stringifyInstruction = (node, config) => {\n  return (\n    config.procInstStart + node.name + ' ' + node.value + config.procInstEnd\n  );\n};\n\n/**\n * @param {import('./types.js').XastComment} node\n * @param {Options} config\n * @returns {string}\n */\nconst stringifyComment = (node, config) => {\n  return config.commentStart + node.value + config.commentEnd;\n};\n\n/**\n * @param {import('./types.js').XastCdata} node\n * @param {Options} config\n * @param {State} state\n * @returns {string}\n */\nconst stringifyCdata = (node, config, state) => {\n  return (\n    createIndent(config, state) +\n    config.cdataStart +\n    node.value +\n    config.cdataEnd\n  );\n};\n\n/**\n * @param {import('./types.js').XastElement} node\n * @param {Options} config\n * @param {State} state\n * @returns {string}\n */\nconst stringifyElement = (node, config, state) => {\n  // empty element and short tag\n  if (node.children.length === 0) {\n    if (config.useShortTags) {\n      return (\n        createIndent(config, state) +\n        config.tagShortStart +\n        node.name +\n        stringifyAttributes(node, config) +\n        config.tagShortEnd\n      );\n    }\n\n    return (\n      createIndent(config, state) +\n      config.tagShortStart +\n      node.name +\n      stringifyAttributes(node, config) +\n      config.tagOpenEnd +\n      config.tagCloseStart +\n      node.name +\n      config.tagCloseEnd\n    );\n  }\n\n  // non-empty element\n  let tagOpenStart = config.tagOpenStart;\n  let tagOpenEnd = config.tagOpenEnd;\n  let tagCloseStart = config.tagCloseStart;\n  let tagCloseEnd = config.tagCloseEnd;\n  let openIndent = createIndent(config, state);\n  let closeIndent = createIndent(config, state);\n\n  if (state.textContext) {\n    tagOpenStart = defaults.tagOpenStart;\n    tagOpenEnd = defaults.tagOpenEnd;\n    tagCloseStart = defaults.tagCloseStart;\n    tagCloseEnd = defaults.tagCloseEnd;\n    openIndent = '';\n  } else if (textElems.has(node.name)) {\n    tagOpenEnd = defaults.tagOpenEnd;\n    tagCloseStart = defaults.tagCloseStart;\n    closeIndent = '';\n    state.textContext = node;\n  }\n\n  const children = stringifyNode(node, config, state);\n\n  if (state.textContext === node) {\n    state.textContext = null;\n  }\n\n  return (\n    openIndent +\n    tagOpenStart +\n    node.name +\n    stringifyAttributes(node, config) +\n    tagOpenEnd +\n    children +\n    closeIndent +\n    tagCloseStart +\n    node.name +\n    tagCloseEnd\n  );\n};\n\n/**\n * @param {import('./types.js').XastElement} node\n * @param {Options} config\n * @returns {string}\n */\nconst stringifyAttributes = (node, config) => {\n  let attrs = '';\n  for (const [name, value] of Object.entries(node.attributes)) {\n    attrs += ' ' + name;\n\n    if (value !== undefined) {\n      const encodedValue = value\n        .toString()\n        .replace(config.regValEntities, config.encodeEntity);\n      attrs += config.attrStart + encodedValue + config.attrEnd;\n    }\n  }\n  return attrs;\n};\n\n/**\n * @param {import('./types.js').XastText} node\n * @param {Options} config\n * @param {State} state\n * @returns {string}\n */\nconst stringifyText = (node, config, state) => {\n  return (\n    createIndent(config, state) +\n    config.textStart +\n    node.value.replace(config.regEntities, config.encodeEntity) +\n    (state.textContext ? '' : config.textEnd)\n  );\n};\n"
  },
  {
    "path": "lib/style.js",
    "content": "import * as csstree from 'css-tree';\nimport * as csswhat from 'css-what';\nimport { syntax } from 'csso';\nimport { matches } from './xast.js';\nimport { visit } from './util/visit.js';\nimport {\n  attrsGroups,\n  inheritableAttrs,\n  presentationNonInheritableGroupAttrs,\n} from '../plugins/_collections.js';\n\nconst csstreeWalkSkip = csstree.walk.skip;\n\n/**\n * @param {import('css-tree').Rule} ruleNode\n * @param {boolean} dynamic\n * @returns {import('./types.js').StylesheetRule[]}\n */\nconst parseRule = (ruleNode, dynamic) => {\n  /** @type {import('./types.js').StylesheetDeclaration[]} */\n  const declarations = [];\n  // collect declarations\n  ruleNode.block.children.forEach((cssNode) => {\n    if (cssNode.type === 'Declaration') {\n      declarations.push({\n        name: cssNode.property,\n        value: csstree.generate(cssNode.value),\n        important: cssNode.important === true,\n      });\n    }\n  });\n\n  /** @type {import('./types.js').StylesheetRule[]} */\n  const rules = [];\n  csstree.walk(ruleNode.prelude, (node) => {\n    if (node.type === 'Selector') {\n      const newNode = csstree.clone(node);\n      let hasPseudoClasses = false;\n      csstree.walk(newNode, (pseudoClassNode, item, list) => {\n        if (pseudoClassNode.type === 'PseudoClassSelector') {\n          hasPseudoClasses = true;\n          list.remove(item);\n        }\n      });\n      rules.push({\n        specificity: syntax.specificity(node),\n        dynamic: hasPseudoClasses || dynamic,\n        // compute specificity from original node to consider pseudo classes\n        selector: csstree.generate(newNode),\n        declarations,\n      });\n    }\n  });\n\n  return rules;\n};\n\n/**\n * @param {string} css\n * @param {boolean} dynamic\n * @returns {import('./types.js').StylesheetRule[]}\n */\nconst parseStylesheet = (css, dynamic) => {\n  /** @type {import('./types.js').StylesheetRule[]} */\n  const rules = [];\n  const ast = csstree.parse(css, {\n    parseValue: false,\n    parseAtrulePrelude: false,\n  });\n  csstree.walk(ast, (cssNode) => {\n    if (cssNode.type === 'Rule') {\n      rules.push(...parseRule(cssNode, dynamic || false));\n      return csstreeWalkSkip;\n    }\n    if (cssNode.type === 'Atrule') {\n      if (\n        [\n          'keyframes',\n          '-webkit-keyframes',\n          '-o-keyframes',\n          '-moz-keyframes',\n        ].includes(cssNode.name)\n      ) {\n        return csstreeWalkSkip;\n      }\n      csstree.walk(cssNode, (ruleNode) => {\n        if (ruleNode.type === 'Rule') {\n          rules.push(...parseRule(ruleNode, dynamic || true));\n          return csstreeWalkSkip;\n        }\n      });\n      return csstreeWalkSkip;\n    }\n  });\n  return rules;\n};\n\n/**\n * @param {string} css\n * @returns {import('./types.js').StylesheetDeclaration[]}\n */\nconst parseStyleDeclarations = (css) => {\n  /** @type {import('./types.js').StylesheetDeclaration[]} */\n  const declarations = [];\n  const ast = csstree.parse(css, {\n    context: 'declarationList',\n    parseValue: false,\n  });\n  csstree.walk(ast, (cssNode) => {\n    if (cssNode.type === 'Declaration') {\n      declarations.push({\n        name: cssNode.property,\n        value: csstree.generate(cssNode.value),\n        important: cssNode.important === true,\n      });\n    }\n  });\n  return declarations;\n};\n\n/**\n * @param {import('./types.js').Stylesheet} stylesheet\n * @param {import('./types.js').XastElement} node\n * @param {Map<import('./types.js').XastNode, import('./types.js').XastParent>=} parents\n * @returns {import('./types.js').ComputedStyles}\n */\nconst computeOwnStyle = (stylesheet, node, parents) => {\n  /** @type {import('./types.js').ComputedStyles} */\n  const computedStyle = {};\n  const importantStyles = new Map();\n\n  // collect attributes\n  for (const [name, value] of Object.entries(node.attributes)) {\n    if (attrsGroups.presentation.has(name)) {\n      computedStyle[name] = { type: 'static', inherited: false, value };\n      importantStyles.set(name, false);\n    }\n  }\n\n  // collect matching rules\n  for (const { selector, declarations, dynamic } of stylesheet.rules) {\n    if (matches(node, selector, parents)) {\n      for (const { name, value, important } of declarations) {\n        const computed = computedStyle[name];\n        if (computed && computed.type === 'dynamic') {\n          continue;\n        }\n        if (dynamic) {\n          computedStyle[name] = { type: 'dynamic', inherited: false };\n          continue;\n        }\n        if (\n          computed == null ||\n          important === true ||\n          importantStyles.get(name) === false\n        ) {\n          computedStyle[name] = { type: 'static', inherited: false, value };\n          importantStyles.set(name, important);\n        }\n      }\n    }\n  }\n\n  // collect inline styles\n  const styleDeclarations =\n    node.attributes.style == null\n      ? []\n      : parseStyleDeclarations(node.attributes.style);\n  for (const { name, value, important } of styleDeclarations) {\n    const computed = computedStyle[name];\n    if (computed && computed.type === 'dynamic') {\n      continue;\n    }\n    if (\n      computed == null ||\n      important === true ||\n      importantStyles.get(name) === false\n    ) {\n      computedStyle[name] = { type: 'static', inherited: false, value };\n      importantStyles.set(name, important);\n    }\n  }\n\n  return computedStyle;\n};\n\n/**\n * Compares selector specificities.\n * Derived from https://github.com/keeganstreet/specificity/blob/8757133ddd2ed0163f120900047ff0f92760b536/specificity.js#L207\n *\n * @param {import('./types.js').Specificity} a\n * @param {import('./types.js').Specificity} b\n * @returns {number}\n */\nexport const compareSpecificity = (a, b) => {\n  for (let i = 0; i < 4; i += 1) {\n    if (a[i] < b[i]) {\n      return -1;\n    } else if (a[i] > b[i]) {\n      return 1;\n    }\n  }\n\n  return 0;\n};\n\n/**\n * @param {import('./types.js').XastRoot} root\n * @returns {import('./types.js').Stylesheet}\n */\nexport const collectStylesheet = (root) => {\n  /** @type {import('./types.js').StylesheetRule[]} */\n  const rules = [];\n  /** @type {Map<import('./types.js').XastElement, import('./types.js').XastParent>} */\n  const parents = new Map();\n\n  visit(root, {\n    element: {\n      enter: (node, parentNode) => {\n        parents.set(node, parentNode);\n\n        if (node.name !== 'style') {\n          return;\n        }\n\n        if (\n          node.attributes.type == null ||\n          node.attributes.type === '' ||\n          node.attributes.type === 'text/css'\n        ) {\n          const dynamic =\n            node.attributes.media != null && node.attributes.media !== 'all';\n\n          for (const child of node.children) {\n            if (child.type === 'text' || child.type === 'cdata') {\n              rules.push(...parseStylesheet(child.value, dynamic));\n            }\n          }\n        }\n      },\n    },\n  });\n  // sort by selectors specificity\n  rules.sort((a, b) => compareSpecificity(a.specificity, b.specificity));\n  return { rules, parents };\n};\n\n/**\n * @param {import('./types.js').Stylesheet} stylesheet\n * @param {import('./types.js').XastElement} node\n * @returns {import('./types.js').ComputedStyles}\n */\nexport const computeStyle = (stylesheet, node) => {\n  const { parents } = stylesheet;\n  const computedStyles = computeOwnStyle(stylesheet, node, parents);\n  let parent = parents.get(node);\n  while (parent != null && parent.type !== 'root') {\n    const inheritedStyles = computeOwnStyle(stylesheet, parent, parents);\n    for (const [name, computed] of Object.entries(inheritedStyles)) {\n      if (\n        computedStyles[name] == null &&\n        inheritableAttrs.has(name) &&\n        !presentationNonInheritableGroupAttrs.has(name)\n      ) {\n        computedStyles[name] = { ...computed, inherited: true };\n      }\n    }\n    parent = parents.get(parent);\n  }\n  return computedStyles;\n};\n\n/**\n * Determines if the CSS selector includes or traverses the given attribute.\n *\n * Classes and IDs are generated as attribute selectors, so you can check for if\n * a `.class` or `#id` is included by passing `name=class` or `name=id`\n * respectively.\n *\n * @param {csstree.ListItem<csstree.CssNode> | string} selector\n * @param {string} name\n * @param {?string} value\n * @param {boolean} traversed\n * @returns {boolean}\n */\nexport const includesAttrSelector = (\n  selector,\n  name,\n  value = null,\n  traversed = false,\n) => {\n  const selectors =\n    typeof selector === 'string'\n      ? csswhat.parse(selector)\n      : csswhat.parse(csstree.generate(selector.data));\n\n  for (const subselector of selectors) {\n    const hasAttrSelector = subselector.some((segment, index) => {\n      if (traversed) {\n        if (index === subselector.length - 1) {\n          return false;\n        }\n\n        const isNextTraversal = csswhat.isTraversal(subselector[index + 1]);\n\n        if (!isNextTraversal) {\n          return false;\n        }\n      }\n\n      if (segment.type !== 'attribute' || segment.name !== name) {\n        return false;\n      }\n\n      return value == null ? true : segment.value === value;\n    });\n\n    if (hasAttrSelector) {\n      return true;\n    }\n  }\n\n  return false;\n};\n"
  },
  {
    "path": "lib/style.test.js",
    "content": "import { collectStylesheet, computeStyle } from './style.js';\nimport { visit } from './util/visit.js';\nimport { parseSvg } from './parser.js';\n\n/**\n * @param {import('./types.js').XastParent} node\n * @param {string} id\n * @returns {import('./types.js').XastElement}\n */\nconst getElementById = (node, id) => {\n  /** @type {?import('./types.js').XastElement} */\n  let matched = null;\n  visit(node, {\n    element: {\n      enter: (node) => {\n        if (node.attributes.id === id) {\n          matched = node;\n        }\n      },\n    },\n  });\n  if (matched == null) {\n    throw Error('Assert node');\n  }\n  return matched;\n};\n\nit('collects styles', () => {\n  const root = parseSvg(`\n      <svg>\n        <rect id=\"class\" class=\"a\" />\n        <rect id=\"two-classes\" class=\"b a\" />\n        <rect id=\"attribute\" fill=\"purple\" />\n        <rect id=\"inline-style\" style=\"fill: grey;\" />\n        <g fill=\"yellow\">\n          <rect id=\"inheritance\" />\n          <g style=\"fill: blue;\">\n            <g>\n              <rect id=\"nested-inheritance\" />\n            </g>\n          </g>\n        </g>\n        <style>\n          .a { fill: red; }\n        </style>\n        <style>\n          <![CDATA[\n            .b { fill: green; stroke: black; }\n          ]]>\n        </style>\n      </svg>\n    `);\n  const stylesheet = collectStylesheet(root);\n  expect(computeStyle(stylesheet, getElementById(root, 'class'))).toStrictEqual(\n    {\n      fill: { type: 'static', inherited: false, value: 'red' },\n    },\n  );\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'two-classes')),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: false, value: 'green' },\n    stroke: { type: 'static', inherited: false, value: 'black' },\n  });\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'attribute')),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: false, value: 'purple' },\n  });\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'inline-style')),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: false, value: 'grey' },\n  });\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'inheritance')),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: true, value: 'yellow' },\n  });\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'nested-inheritance')),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: true, value: 'blue' },\n  });\n});\n\nit('prioritizes different kinds of styles', () => {\n  const root = parseSvg(`\n      <svg>\n        <style>\n          g > .a, .c { fill: red; }\n          .a { fill: green; }\n          .b { fill: blue; }\n        </style>\n        <g fill=\"yellow\">\n          <rect id=\"complex-selector\" class=\"a\" />\n          <rect id=\"override-selector\" class=\"c b\" />\n          <rect id=\"attribute-over-inheritance\" fill=\"orange\" />\n          <rect id=\"style-rule-over-attribute\" class=\"b\" fill=\"grey\" />\n          <rect id=\"inline-style-over-style-rule\" style=\"fill: purple;\" class=\"b\" />\n        </g>\n      </svg>\n    `);\n  const stylesheet = collectStylesheet(root);\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'complex-selector')),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: false, value: 'red' },\n  });\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'override-selector')),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: false, value: 'blue' },\n  });\n  expect(\n    computeStyle(\n      stylesheet,\n      getElementById(root, 'attribute-over-inheritance'),\n    ),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: false, value: 'orange' },\n  });\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'style-rule-over-attribute')),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: false, value: 'blue' },\n  });\n  expect(\n    computeStyle(\n      stylesheet,\n      getElementById(root, 'inline-style-over-style-rule'),\n    ),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: false, value: 'purple' },\n  });\n});\n\nit('prioritizes important styles', () => {\n  const root = parseSvg(`\n      <svg>\n        <style>\n          g > .a { fill: red; }\n          .b { fill: green !important; }\n        </style>\n        <rect id=\"complex-selector\" class=\"a b\" />\n        <rect id=\"style-rule-over-inline-style\" style=\"fill: orange;\" class=\"b\" />\n        <rect id=\"inline-style-over-style-rule\" style=\"fill: purple !important;\" class=\"b\" />\n      </svg>\n    `);\n  const stylesheet = collectStylesheet(root);\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'complex-selector')),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: false, value: 'green' },\n  });\n  expect(\n    computeStyle(\n      stylesheet,\n      getElementById(root, 'style-rule-over-inline-style'),\n    ),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: false, value: 'green' },\n  });\n  expect(\n    computeStyle(\n      stylesheet,\n      getElementById(root, 'inline-style-over-style-rule'),\n    ),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: false, value: 'purple' },\n  });\n});\n\nit('treats at-rules and pseudo-classes as dynamic styles', () => {\n  const root = parseSvg(`\n      <svg>\n        <style>\n          @media screen {\n            .a { fill: red; }\n          }\n          .b:hover { fill: green; }\n          .c { fill: blue; }\n          .d { fill: purple; }\n        </style>\n        <rect id=\"media-query\" class=\"a d\" style=\"fill: orange;\" />\n        <rect id=\"hover\" class=\"b\" style=\"fill: yellow;\" />\n        <g class=\"a\">\n          <rect id=\"inherited\" />\n          <rect id=\"inherited-overridden\" class=\"c\" />\n        </g>\n        <rect id=\"static\" class=\"c\" style=\"fill: black\" />\n      </svg>\n    `);\n  const stylesheet = collectStylesheet(root);\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'media-query')),\n  ).toStrictEqual({\n    fill: { type: 'dynamic', inherited: false },\n  });\n  expect(computeStyle(stylesheet, getElementById(root, 'hover'))).toStrictEqual(\n    {\n      fill: { type: 'dynamic', inherited: false },\n    },\n  );\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'inherited')),\n  ).toStrictEqual({\n    fill: { type: 'dynamic', inherited: true },\n  });\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'inherited-overridden')),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: false, value: 'blue' },\n  });\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'static')),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: false, value: 'black' },\n  });\n});\n\nit('considers <style> media attribute', () => {\n  const root = parseSvg(`\n      <svg>\n        <style media=\"print\">\n          @media screen {\n            .a { fill: red; }\n          }\n          .b { fill: green; }\n        </style>\n        <style media=\"all\">\n          .c { fill: blue; }\n        </style>\n        <rect id=\"media-query\" class=\"a\" />\n        <rect id=\"kinda-static\" class=\"b\" />\n        <rect id=\"static\" class=\"c\" />\n      </svg>\n    `);\n  const stylesheet = collectStylesheet(root);\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'media-query')),\n  ).toStrictEqual({\n    fill: { type: 'dynamic', inherited: false },\n  });\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'kinda-static')),\n  ).toStrictEqual({\n    fill: { type: 'dynamic', inherited: false },\n  });\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'static')),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: false, value: 'blue' },\n  });\n});\n\nit('ignores <style> with invalid type', () => {\n  const root = parseSvg(`\n      <svg>\n        <style type=\"text/css\">\n          .a { fill: red; }\n        </style>\n        <style type=\"\">\n          .b { fill: green; }\n        </style>\n        <style type=\"text/invalid\">\n          .c { fill: blue; }\n        </style>\n        <rect id=\"valid-type\" class=\"a\" />\n        <rect id=\"empty-type\" class=\"b\" />\n        <rect id=\"invalid-type\" class=\"c\" />\n      </svg>\n    `);\n  const stylesheet = collectStylesheet(root);\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'valid-type')),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: false, value: 'red' },\n  });\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'empty-type')),\n  ).toStrictEqual({\n    fill: { type: 'static', inherited: false, value: 'green' },\n  });\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'invalid-type')),\n  ).toStrictEqual({});\n});\n\nit('ignores keyframes atrule', () => {\n  const root = parseSvg(`\n      <svg>\n        <style>\n          .a {\n            animation: loading 4s linear infinite;\n          }\n          @keyframes loading {\n            0% {\n              stroke-dashoffset: 440;\n            }\n            50% {\n              stroke-dashoffset: 0;\n            }\n            50.1% {\n              stroke-dashoffset: 880;\n            }\n          }\n        </style>\n        <rect id=\"element\" class=\"a\" />\n      </svg>\n    `);\n  const stylesheet = collectStylesheet(root);\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'element')),\n  ).toStrictEqual({\n    animation: {\n      type: 'static',\n      inherited: false,\n      value: 'loading 4s linear infinite',\n    },\n  });\n});\n\nit('ignores @-webkit-keyframes atrule', () => {\n  const root = parseSvg(`\n      <svg>\n        <style>\n          .a {\n            animation: loading 4s linear infinite;\n          }\n          @-webkit-keyframes loading {\n            0% {\n              stroke-dashoffset: 440;\n            }\n            50% {\n              stroke-dashoffset: 0;\n            }\n          }\n        </style>\n        <rect id=\"element\" class=\"a\" />\n      </svg>\n    `);\n  const stylesheet = collectStylesheet(root);\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'element')),\n  ).toStrictEqual({\n    animation: {\n      type: 'static',\n      inherited: false,\n      value: 'loading 4s linear infinite',\n    },\n  });\n});\nit('ignores @-moz-keyframes atrule', () => {\n  const root = parseSvg(`\n      <svg>\n        <style>\n          .a {\n            animation: loading 4s linear infinite;\n          }\n          @-moz-keyframes loading {\n            0% {\n              stroke-dashoffset: 440;\n            }\n            50% {\n              stroke-dashoffset: 0;\n            }\n          }\n        </style>\n        <rect id=\"element\" class=\"a\" />\n      </svg>\n    `);\n  const stylesheet = collectStylesheet(root);\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'element')),\n  ).toStrictEqual({\n    animation: {\n      type: 'static',\n      inherited: false,\n      value: 'loading 4s linear infinite',\n    },\n  });\n});\n\nit('ignores @-o-keyframes atrule', () => {\n  const root = parseSvg(`\n      <svg>\n        <style>\n          .a {\n            animation: loading 4s linear infinite;\n          }\n          @-o-keyframes loading {\n            0% {\n              stroke-dashoffset: 440;\n            }\n            50% {\n              stroke-dashoffset: 0;\n            }\n          }\n        </style>\n        <rect id=\"element\" class=\"a\" />\n      </svg>\n    `);\n  const stylesheet = collectStylesheet(root);\n  expect(\n    computeStyle(stylesheet, getElementById(root, 'element')),\n  ).toStrictEqual({\n    animation: {\n      type: 'static',\n      inherited: false,\n      value: 'loading 4s linear infinite',\n    },\n  });\n});\n"
  },
  {
    "path": "lib/svgo/coa.js",
    "content": "import fs from 'fs';\nimport path from 'path';\nimport colors from 'picocolors';\nimport { fileURLToPath } from 'url';\nimport { decodeSVGDatauri } from './tools.js';\nimport { loadConfig, optimize } from '../svgo-node.js';\nimport { builtinPlugins } from '../builtin.js';\nimport { SvgoParserError } from '../parser.js';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\nconst pkgPath = path.join(__dirname, '../../package.json');\nconst PKG = JSON.parse(await fs.promises.readFile(pkgPath, 'utf-8'));\n\n/**\n * Synchronously check if path is a directory. Tolerant to errors like ENOENT.\n *\n * @param {string} filePath\n */\nexport function checkIsDir(filePath) {\n  try {\n    return fs.lstatSync(filePath).isDirectory();\n  } catch {\n    return filePath.endsWith(path.sep);\n  }\n}\n\n/**\n * @param {import('commander').Command} program\n */\nexport default function makeProgram(program) {\n  program\n    .name(PKG.name)\n    .description(PKG.description)\n    .version(PKG.version, '-v, --version')\n    .argument('[INPUT...]', 'Alias to --input')\n    .option('-i, --input <INPUT...>', 'Input files, \"-\" for STDIN')\n    .option('-s, --string <STRING>', 'Input SVG data string')\n    .option(\n      '-f, --folder <FOLDER>',\n      'Input folder, optimize and rewrite all *.svg files',\n    )\n    .option(\n      '-o, --output <OUTPUT...>',\n      'Output file or folder (by default the same as the input), \"-\" for STDOUT',\n    )\n    .option(\n      '-p, --precision <INTEGER>',\n      'Set number of digits in the fractional part, overrides plugins params',\n    )\n    .option(\n      '--config <CONFIG>',\n      'Custom config file, only .js, .mjs, and .cjs is supported',\n    )\n    .option(\n      '--datauri <FORMAT>',\n      'Output as Data URI string (base64), URI encoded (enc) or unencoded (unenc)',\n    )\n    .option(\n      '--multipass',\n      'Pass over SVGs multiple times to ensure all optimizations are applied',\n    )\n    .option('--pretty', 'Make SVG pretty printed')\n    .option('--indent <INTEGER>', 'Indent number when pretty printing SVGs')\n    .option(\n      '--eol <EOL>',\n      'Line break to use when outputting SVG: lf, crlf. If unspecified, uses platform default.',\n    )\n    .option('--final-newline', 'Ensure SVG ends with a line break')\n    .option(\n      '-r, --recursive',\n      \"Use with '--folder'. Optimizes *.svg files in folders recursively.\",\n    )\n    .option(\n      '--exclude <PATTERN...>',\n      \"Use with '--folder'. Exclude files matching regular expression pattern.\",\n    )\n    .option(\n      '-q, --quiet',\n      'Only output error messages, not regular status messages',\n    )\n    .option('--show-plugins', 'Show available plugins and exit')\n    // used by picocolors internally\n    .option('--no-color', 'Output plain text without color')\n    .action(action);\n}\n\n/**\n * @param {ReadonlyArray<string>} args\n * @param {any} opts\n * @param {import('commander').Command} command\n * @returns\n */\nasync function action(args, opts, command) {\n  const input = opts.input || args;\n  let output = opts.output;\n  /** @type {any} */\n  let config = {};\n\n  if (opts.datauri != null) {\n    if (\n      opts.datauri !== 'base64' &&\n      opts.datauri !== 'enc' &&\n      opts.datauri !== 'unenc'\n    ) {\n      console.error(\n        \"error: option '--datauri' must have one of the following values: 'base64', 'enc' or 'unenc'\",\n      );\n      process.exit(1);\n    }\n  }\n\n  if (opts.indent != null) {\n    const number = Number.parseInt(opts.indent, 10);\n    if (Number.isNaN(number)) {\n      console.error(\n        \"error: option '--indent' argument must be an integer number\",\n      );\n      process.exit(1);\n    } else {\n      opts.indent = number;\n    }\n  }\n\n  if (opts.eol != null && opts.eol !== 'lf' && opts.eol !== 'crlf') {\n    console.error(\n      \"error: option '--eol' must have one of the following values: 'lf' or 'crlf'\",\n    );\n    process.exit(1);\n  }\n\n  // --show-plugins\n  if (opts.showPlugins) {\n    showAvailablePlugins();\n    return;\n  }\n\n  // w/o anything\n  if (\n    (input.length === 0 || input[0] === '-') &&\n    !opts.string &&\n    !opts.stdin &&\n    !opts.folder &&\n    process.stdin.isTTY\n  ) {\n    return command.help();\n  }\n\n  if (process?.versions?.node && PKG.engines.node) {\n    // @ts-expect-error We control this and ensure it is never null.\n    const nodeVersion = String(PKG.engines.node).match(/\\d*(\\.\\d+)*/)[0];\n    if (parseFloat(process.versions.node) < parseFloat(nodeVersion)) {\n      throw Error(\n        `${PKG.name} requires Node.js version ${nodeVersion} or higher.`,\n      );\n    }\n  }\n\n  // --config\n  const loadedConfig = await loadConfig(opts.config);\n  if (loadedConfig != null) {\n    config = loadedConfig;\n  }\n\n  // --quiet\n  if (opts.quiet) {\n    config.quiet = opts.quiet;\n  }\n\n  // --recursive\n  if (opts.recursive) {\n    config.recursive = opts.recursive;\n  }\n\n  // --exclude\n  config.exclude = opts.exclude\n    ? opts.exclude.map((/** @type {string} */ pattern) => RegExp(pattern))\n    : [];\n\n  // --precision\n  if (opts.precision != null) {\n    const number = Number.parseInt(opts.precision, 10);\n    if (Number.isNaN(number)) {\n      console.error(\n        \"error: option '-p, --precision' argument must be an integer number\",\n      );\n      process.exit(1);\n    } else {\n      config.floatPrecision = Math.min(Math.max(0, number), 20);\n    }\n  }\n\n  // --multipass\n  if (opts.multipass) {\n    config.multipass = true;\n  }\n\n  // --pretty\n  if (opts.pretty) {\n    config.js2svg = config.js2svg || {};\n    config.js2svg.pretty = true;\n    if (opts.indent != null) {\n      config.js2svg.indent = opts.indent;\n    }\n  }\n\n  // --eol\n  if (opts.eol) {\n    config.js2svg = config.js2svg || {};\n    config.js2svg.eol = opts.eol;\n  }\n\n  // --final-newline\n  if (opts.finalNewline) {\n    config.js2svg = config.js2svg || {};\n    config.js2svg.finalNewline = true;\n  }\n\n  // --output\n  if (output) {\n    if (input.length && input[0] != '-') {\n      if (output.length == 1 && checkIsDir(output[0])) {\n        const dir = output[0];\n        for (let i = 0; i < input.length; i++) {\n          output[i] = checkIsDir(input[i])\n            ? input[i]\n            : path.resolve(dir, path.basename(input[i]));\n        }\n      } else if (output.length < input.length) {\n        output = output.concat(input.slice(output.length));\n      }\n    }\n  } else if (input.length) {\n    output = input;\n  } else if (opts.string) {\n    output = '-';\n  }\n\n  if (opts.datauri) {\n    config.datauri = opts.datauri;\n  }\n\n  // --folder\n  if (opts.folder) {\n    const outputFolder = (output && output[0]) || opts.folder;\n    await optimizeFolder(config, opts.folder, outputFolder);\n  }\n\n  // --input\n  if (input.length !== 0) {\n    // STDIN\n    if (input[0] === '-') {\n      return new Promise((resolve, reject) => {\n        let data = '';\n        const file = output[0];\n\n        process.stdin\n          .on('data', (chunk) => (data += chunk))\n          .once('end', () =>\n            processSVGData(config, null, data, file).then(resolve, reject),\n          );\n      });\n      // file\n    } else {\n      await Promise.all(\n        input.map((/** @type {string} */ file, /** @type {number} */ n) =>\n          optimizeFile(config, file, output[n]),\n        ),\n      );\n    }\n\n    // --string\n  } else if (opts.string) {\n    const data = decodeSVGDatauri(opts.string);\n\n    return processSVGData(config, null, data, output[0]);\n  }\n}\n\n/**\n * Optimize SVG files in a directory.\n *\n * @param {any} config options\n * @param {string} dir input directory\n * @param {string} output output directory\n * @return {Promise<any>}\n */\nfunction optimizeFolder(config, dir, output) {\n  if (!config.quiet) {\n    console.log(`Processing directory '${dir}':\\n`);\n  }\n  return fs.promises\n    .readdir(dir)\n    .then((files) => processDirectory(config, dir, files, output));\n}\n\n/**\n * Process given files, take only SVG.\n *\n * @param {any} config options\n * @param {string} dir input directory\n * @param {ReadonlyArray<string>} files list of file names in the directory\n * @param {string} output output directory\n * @return {Promise<any>}\n */\nfunction processDirectory(config, dir, files, output) {\n  // take only *.svg files, recursively if necessary\n  const svgFilesDescriptions = getFilesDescriptions(config, dir, files, output);\n\n  return svgFilesDescriptions.length\n    ? Promise.all(\n        svgFilesDescriptions.map((fileDescription) =>\n          optimizeFile(\n            config,\n            fileDescription.inputPath,\n            fileDescription.outputPath,\n          ),\n        ),\n      )\n    : Promise.reject(\n        new Error(`No SVG files have been found in '${dir}' directory.`),\n      );\n}\n\n/**\n * Get SVG files descriptions.\n *\n * @param {any} config options\n * @param {string} dir input directory\n * @param {ReadonlyArray<string>} files list of file names in the directory\n * @param {string} output output directory\n * @return {any[]}\n */\nfunction getFilesDescriptions(config, dir, files, output) {\n  const filesInThisFolder = files\n    .filter(\n      (name) =>\n        name.slice(-4).toLowerCase() === '.svg' &&\n        !config.exclude.some((/** @type {RegExp} */ regExclude) =>\n          regExclude.test(name),\n        ),\n    )\n    .map((name) => ({\n      inputPath: path.resolve(dir, name),\n      outputPath: path.resolve(output, name),\n    }));\n\n  if (!config.recursive) {\n    return filesInThisFolder;\n  }\n\n  return filesInThisFolder.concat(\n    files\n      .filter((name) => checkIsDir(path.resolve(dir, name)))\n      .map((subFolderName) => {\n        const subFolderPath = path.resolve(dir, subFolderName);\n        const subFolderFiles = fs.readdirSync(subFolderPath);\n        const subFolderOutput = path.resolve(output, subFolderName);\n        return getFilesDescriptions(\n          config,\n          subFolderPath,\n          subFolderFiles,\n          subFolderOutput,\n        );\n      })\n      .reduce((a, b) => a.concat(b), []),\n  );\n}\n\n/**\n * Read SVG file and pass to processing.\n *\n * @param {any} config options\n * @param {string} file\n * @param {string} output\n * @return {Promise<any>}\n */\nfunction optimizeFile(config, file, output) {\n  return fs.promises.readFile(file, 'utf8').then(\n    (data) => processSVGData(config, { path: file }, data, output, file),\n    (error) => checkOptimizeFileError(config, file, output, error),\n  );\n}\n\n/**\n * Optimize SVG data.\n *\n * @param {any} config options\n * @param {?{ path: string }} info\n * @param {string} data SVG content to optimize\n * @param {string} output where to write optimized file\n * @param {any=} input input file name (being used if output is a directory)\n * @return {Promise<any>}\n */\nfunction processSVGData(config, info, data, output, input) {\n  const startTime = Date.now();\n  const prevFileSize = Buffer.byteLength(data, 'utf8');\n\n  let result;\n  try {\n    result = optimize(data, { ...config, ...info });\n  } catch (error) {\n    if (error instanceof SvgoParserError) {\n      console.error(colors.red(error.toString()));\n      process.exit(1);\n    } else {\n      throw error;\n    }\n  }\n  const resultFileSize = Buffer.byteLength(result.data, 'utf8');\n  const processingTime = Date.now() - startTime;\n\n  return writeOutput(input, output, result.data).then(\n    function () {\n      if (!config.quiet && output != '-') {\n        if (input) {\n          console.log(`\\n${path.basename(input)}:`);\n        }\n        printTimeInfo(processingTime);\n        printProfitInfo(prevFileSize, resultFileSize);\n      }\n    },\n    (error) =>\n      Promise.reject(\n        new Error(\n          error.code === 'ENOTDIR'\n            ? `Error: output '${output}' is not a directory.`\n            : error,\n        ),\n      ),\n  );\n}\n\n/**\n * Write result of an optimization.\n *\n * @param {string} input\n * @param {string} output output file name. '-' for stdout\n * @param {string} data data to write\n * @return {Promise<void>}\n */\nasync function writeOutput(input, output, data) {\n  if (output == '-') {\n    process.stdout.write(data);\n    return Promise.resolve();\n  }\n\n  await fs.promises.mkdir(path.dirname(output), { recursive: true });\n\n  return fs.promises\n    .writeFile(output, data, 'utf8')\n    .catch((error) => checkWriteFileError(input, output, data, error));\n}\n\n/**\n * Write time taken to optimize.\n *\n * @param {number} time time in milliseconds.\n */\nfunction printTimeInfo(time) {\n  console.log(`Done in ${time} ms!`);\n}\n\n/**\n * Write optimizing stats in a human-readable format.\n *\n * @param {number} inBytes size before optimization.\n * @param {number} outBytes size after optimization.\n */\nfunction printProfitInfo(inBytes, outBytes) {\n  const profitPercent = 100 - (outBytes * 100) / inBytes;\n  /** @type {[string, Function]} */\n  const ui = profitPercent < 0 ? ['+', colors.red] : ['-', colors.green];\n\n  console.log(\n    Math.round((inBytes / 1024) * 1000) / 1000 + ' KiB',\n    ui[0],\n    ui[1](Math.abs(Math.round(profitPercent * 10) / 10) + '%'),\n    '=',\n    Math.round((outBytes / 1024) * 1000) / 1000 + ' KiB',\n  );\n}\n\n/**\n * Check for errors, if it's a dir optimize the dir.\n *\n * @param {any} config\n * @param {string} input\n * @param {string} output\n * @param {Error & { code: string, path: string }} error\n * @return {Promise<void>}\n */\nfunction checkOptimizeFileError(config, input, output, error) {\n  if (error.code == 'EISDIR') {\n    return optimizeFolder(config, input, output);\n  } else if (error.code == 'ENOENT') {\n    return Promise.reject(\n      new Error(`Error: no such file or directory '${error.path}'.`),\n    );\n  }\n  return Promise.reject(error);\n}\n\n/**\n * Check for saving file error. If the output is a dir, then write file there.\n *\n * @param {string} input\n * @param {string} output\n * @param {string} data\n * @param {Error & { code: string }} error\n * @return {Promise<void>}\n */\nfunction checkWriteFileError(input, output, data, error) {\n  if (error.code == 'EISDIR' && input) {\n    return fs.promises.writeFile(\n      path.resolve(output, path.basename(input)),\n      data,\n      'utf8',\n    );\n  } else {\n    return Promise.reject(error);\n  }\n}\n\n/**\n * Show list of available plugins with short description with the presets it belongs to.\n */\nfunction showAvailablePlugins() {\n  const pluginToPresetsMap = new Map();\n\n  for (const plugin of builtinPlugins) {\n    if (plugin.isPreset) {\n      for (const presetPlugins of plugin.plugins) {\n        if (!pluginToPresetsMap.has(presetPlugins.name)) {\n          pluginToPresetsMap.set(presetPlugins.name, [plugin.name]);\n        } else {\n          pluginToPresetsMap.get(presetPlugins.name).push(plugin.name);\n        }\n      }\n    }\n  }\n  const list = builtinPlugins\n    .map((plugin) => {\n      const name = plugin.name;\n      let description = plugin.description || '';\n      const presetsForThisPlugin = pluginToPresetsMap.get(name) || [];\n      if (presetsForThisPlugin && presetsForThisPlugin.length > 0) {\n        description += ` (${presetsForThisPlugin.join(', ')})`;\n      }\n      return ` [ ${colors.green(name)} ] ${description}`;\n    })\n    .join('\\n');\n  console.log('Currently available plugins:\\n' + list);\n}\n"
  },
  {
    "path": "lib/svgo/css-select-adapter.js",
    "content": "import { mapNodesToParents } from '../util/map-nodes-to-parents.js';\n\n/** @type {Required<import('css-select').Options<import('../types.js').XastNode & { children?: any }, import('../types.js').XastElement>>['adapter']['isTag']} */\nconst isTag = (node) => {\n  return node.type === 'element';\n};\n\n/** @type {Required<import('css-select').Options<import('../types.js').XastNode & { children?: any }, import('../types.js').XastElement>>['adapter']['existsOne']} */\nconst existsOne = (test, elems) => {\n  return elems.some((elem) => {\n    return isTag(elem) && (test(elem) || existsOne(test, getChildren(elem)));\n  });\n};\n\n/** @type {Required<import('css-select').Options<import('../types.js').XastNode & { children?: any }, import('../types.js').XastElement>>['adapter']['getAttributeValue']} */\nconst getAttributeValue = (elem, name) => {\n  return elem.attributes[name];\n};\n\n/** @type {Required<import('css-select').Options<import('../types.js').XastNode & { children?: any }, import('../types.js').XastElement>>['adapter']['getChildren']} */\nconst getChildren = (node) => {\n  return node.children || [];\n};\n\n/** @type {Required<import('css-select').Options<import('../types.js').XastNode & { children?: any }, import('../types.js').XastElement>>['adapter']['getName']} */\nconst getName = (elemAst) => {\n  return elemAst.name;\n};\n\n/** @type {Required<import('css-select').Options<import('../types.js').XastNode & { children?: any }, import('../types.js').XastElement>>['adapter']['getText']} */\nconst getText = (node) => {\n  if (node.children[0].type === 'text' || node.children[0].type === 'cdata') {\n    return node.children[0].value;\n  }\n  return '';\n};\n\n/** @type {Required<import('css-select').Options<import('../types.js').XastNode & { children?: any }, import('../types.js').XastElement>>['adapter']['hasAttrib']} */\nconst hasAttrib = (elem, name) => {\n  return elem.attributes[name] !== undefined;\n};\n\n/** @type {Required<import('css-select').Options<import('../types.js').XastNode & { children?: any }, import('../types.js').XastElement>>['adapter']['findAll']} */\nconst findAll = (test, elems) => {\n  const result = [];\n  for (const elem of elems) {\n    if (isTag(elem)) {\n      if (test(elem)) {\n        result.push(elem);\n      }\n      result.push(...findAll(test, getChildren(elem)));\n    }\n  }\n  return result;\n};\n\n/** @type {Required<import('css-select').Options<import('../types.js').XastNode & { children?: any }, import('../types.js').XastElement>>['adapter']['findOne']} */\nconst findOne = (test, elems) => {\n  for (const elem of elems) {\n    if (isTag(elem)) {\n      if (test(elem)) {\n        return elem;\n      }\n      const result = findOne(test, getChildren(elem));\n      if (result) {\n        return result;\n      }\n    }\n  }\n  return null;\n};\n\n/**\n * @param {import('../types.js').XastParent} relativeNode\n * @param {Map<import('../types.js').XastNode, import('../types.js').XastParent>=} parents\n * @returns {Required<import('css-select').Options<import('../types.js').XastNode & { children?: any }, import('../types.js').XastElement>>['adapter']}\n */\nexport function createAdapter(relativeNode, parents) {\n  /** @type {Required<import('css-select').Options<import('../types.js').XastNode & { children?: any }, import('../types.js').XastElement>>['adapter']['getParent']} */\n  const getParent = (node) => {\n    if (!parents) {\n      parents = mapNodesToParents(relativeNode);\n    }\n\n    return parents.get(node) || null;\n  };\n\n  /**\n   * @param {any} elem\n   * @returns {any}\n   */\n  const getSiblings = (elem) => {\n    const parent = getParent(elem);\n    return parent ? getChildren(parent) : [];\n  };\n\n  /**\n   * @param {any} nodes\n   * @returns {any}\n   */\n  const removeSubsets = (nodes) => {\n    let idx = nodes.length;\n    let node;\n    let ancestor;\n    let replace;\n    // Check if each node (or one of its ancestors) is already contained in the\n    // array.\n    while (--idx > -1) {\n      node = ancestor = nodes[idx];\n      // Temporarily remove the node under consideration\n      nodes[idx] = null;\n      replace = true;\n      while (ancestor) {\n        if (nodes.includes(ancestor)) {\n          replace = false;\n          nodes.splice(idx, 1);\n          break;\n        }\n        ancestor = getParent(ancestor);\n      }\n      // If the node has been found to be unique, re-insert it.\n      if (replace) {\n        nodes[idx] = node;\n      }\n    }\n    return nodes;\n  };\n\n  return {\n    isTag,\n    existsOne,\n    getAttributeValue,\n    getChildren,\n    getName,\n    getParent,\n    getSiblings,\n    getText,\n    hasAttrib,\n    removeSubsets,\n    findAll,\n    findOne,\n  };\n}\n"
  },
  {
    "path": "lib/svgo/plugins.js",
    "content": "import { visit } from '../util/visit.js';\n\n/**\n * Plugins engine.\n *\n * @module plugins\n *\n * @param {import('../types.js').XastNode} ast Input AST.\n * @param {any} info Extra information.\n * @param {ReadonlyArray<any>} plugins Plugins property from config.\n * @param {any} overrides\n * @param {any} globalOverrides\n */\nexport const invokePlugins = (\n  ast,\n  info,\n  plugins,\n  overrides,\n  globalOverrides,\n) => {\n  for (const plugin of plugins) {\n    const override = overrides?.[plugin.name];\n    if (override === false) {\n      continue;\n    }\n    const params = { ...plugin.params, ...globalOverrides, ...override };\n\n    const visitor = plugin.fn(ast, params, info);\n    if (visitor != null) {\n      visit(ast, visitor);\n    }\n  }\n};\n\n/**\n * @template {`preset-${string}`} T\n * @param {{ name: T, plugins: ReadonlyArray<import('../types.js').BuiltinPlugin<string, any>> }} arg0\n * @returns {import('../types.js').BuiltinPluginOrPreset<T, any>}\n */\nexport const createPreset = ({ name, plugins }) => {\n  return {\n    name,\n    isPreset: true,\n    plugins: Object.freeze(plugins),\n    fn: (ast, params, info) => {\n      const { floatPrecision, overrides } = params;\n      const globalOverrides = {};\n      if (floatPrecision != null) {\n        globalOverrides.floatPrecision = floatPrecision;\n      }\n      if (overrides) {\n        const pluginNames = plugins.map(({ name }) => name);\n        for (const pluginName of Object.keys(overrides)) {\n          if (!pluginNames.includes(pluginName)) {\n            console.warn(\n              `You are trying to configure ${pluginName} which is not part of ${name}.\\n` +\n                `Try to put it before or after, for example\\n\\n` +\n                `plugins: [\\n` +\n                `  {\\n` +\n                `    name: '${name}',\\n` +\n                `  },\\n` +\n                `  '${pluginName}'\\n` +\n                `]\\n`,\n            );\n          }\n        }\n      }\n      invokePlugins(ast, info, plugins, overrides, globalOverrides);\n    },\n  };\n};\n"
  },
  {
    "path": "lib/svgo/tools.js",
    "content": "import { attrsGroups, referencesProps } from '../../plugins/_collections.js';\n\n/**\n * @typedef CleanupOutDataParams\n * @property {boolean=} noSpaceAfterFlags\n * @property {boolean=} leadingZero\n * @property {boolean=} negativeExtraSpace\n */\n\nconst regReferencesUrl = /\\burl\\(([\"'])?#(.+?)\\1\\)/g;\nconst regReferencesHref = /^#(.+?)$/;\nconst regReferencesBegin = /(\\w+)\\.[a-zA-Z]/;\n\n/**\n * Encode plain SVG data string into Data URI string.\n *\n * @param {string} str\n * @param {import('../types.js').DataUri=} type\n * @returns {string}\n */\nexport const encodeSVGDatauri = (str, type) => {\n  let prefix = 'data:image/svg+xml';\n  if (!type || type === 'base64') {\n    // base64\n    prefix += ';base64,';\n    str = prefix + Buffer.from(str).toString('base64');\n  } else if (type === 'enc') {\n    // URI encoded\n    str = prefix + ',' + encodeURIComponent(str);\n  } else if (type === 'unenc') {\n    // unencoded\n    str = prefix + ',' + str;\n  }\n  return str;\n};\n\n/**\n * Decode SVG Data URI string into plain SVG string.\n *\n * @param {string} str\n * @returns {string}\n */\nexport const decodeSVGDatauri = (str) => {\n  const regexp = /data:image\\/svg\\+xml(;charset=[^;,]*)?(;base64)?,(.*)/;\n  const match = regexp.exec(str);\n\n  // plain string\n  if (!match) {\n    return str;\n  }\n\n  const data = match[3];\n\n  if (match[2]) {\n    // base64\n    str = Buffer.from(data, 'base64').toString('utf8');\n  } else if (data.charAt(0) === '%') {\n    // URI encoded\n    str = decodeURIComponent(data);\n  } else if (data.charAt(0) === '<') {\n    // unencoded\n    str = data;\n  }\n  return str;\n};\n\n/**\n * Convert a row of numbers to an optimized string view.\n *\n * @example\n * [0, -1, .5, .5] → \"0-1 .5.5\"\n *\n * @param {ReadonlyArray<number>} data\n * @param {CleanupOutDataParams} params\n * @param {import('../types.js').PathDataCommand=} command\n * @returns {string}\n */\nexport const cleanupOutData = (data, params, command) => {\n  let str = '';\n  let delimiter;\n  /** @type {number} */\n  let prev;\n\n  data.forEach((item, i) => {\n    // space delimiter by default\n    delimiter = ' ';\n\n    // no extra space in front of first number\n    if (i == 0) {\n      delimiter = '';\n    }\n\n    // no extra space after arc command flags (large-arc and sweep flags)\n    // a20 60 45 0 1 30 20 → a20 60 45 0130 20\n    if (params.noSpaceAfterFlags && (command == 'A' || command == 'a')) {\n      const pos = i % 7;\n      if (pos == 4 || pos == 5) {\n        delimiter = '';\n      }\n    }\n\n    // remove floating-point numbers leading zeros\n    // 0.5 → .5\n    // -0.5 → -.5\n    const itemStr = params.leadingZero\n      ? removeLeadingZero(item)\n      : item.toString();\n\n    // no extra space in front of negative number or\n    // in front of a floating number if a previous number is floating too\n    if (\n      params.negativeExtraSpace &&\n      delimiter != '' &&\n      (item < 0 || (itemStr.charAt(0) === '.' && prev % 1 !== 0))\n    ) {\n      delimiter = '';\n    }\n    // save prev item value\n    prev = item;\n    str += delimiter + itemStr;\n  });\n  return str;\n};\n\n/**\n * Remove floating-point numbers leading zero.\n *\n * @param {number} value\n * @returns {string}\n * @example\n * 0.5 → .5\n * -0.5 → -.5\n */\nexport const removeLeadingZero = (value) => {\n  const strValue = value.toString();\n\n  if (0 < value && value < 1 && strValue.startsWith('0')) {\n    return strValue.slice(1);\n  }\n\n  if (-1 < value && value < 0 && strValue[1] === '0') {\n    return strValue[0] + strValue.slice(2);\n  }\n\n  return strValue;\n};\n\nconst hasScriptsEventAttrs = [\n  ...attrsGroups.animationEvent,\n  ...attrsGroups.documentEvent,\n  ...attrsGroups.documentElementEvent,\n  ...attrsGroups.globalEvent,\n  ...attrsGroups.graphicalEvent,\n];\n\n/**\n * If the current node contains any scripts. This does not check parents or\n * children of the node, only the properties and attributes of the node itself.\n *\n * @param {import('../types.js').XastElement} node Current node to check against.\n * @returns {boolean} If the current node contains scripts.\n */\nexport const hasScripts = (node) => {\n  if (node.name === 'script' && node.children.length !== 0) {\n    return true;\n  }\n\n  if (node.name === 'a') {\n    const hasJsLinks = Object.entries(node.attributes).some(\n      ([attrKey, attrValue]) =>\n        (attrKey === 'href' || attrKey.endsWith(':href')) &&\n        attrValue != null &&\n        attrValue.trimStart().startsWith('javascript:'),\n    );\n\n    if (hasJsLinks) {\n      return true;\n    }\n  }\n\n  return hasScriptsEventAttrs.some((attr) => node.attributes[attr] != null);\n};\n\n/**\n * For example, a string that contains one or more of following would match and\n * return true:\n *\n * * `url(#gradient001)`\n * * `url('#gradient001')`\n *\n * @param {string} body\n * @returns {boolean} If the given string includes a URL reference.\n */\nexport const includesUrlReference = (body) => {\n  return new RegExp(regReferencesUrl).test(body);\n};\n\n/**\n * @param {string} attribute\n * @param {string} value\n * @returns {string[]}\n */\nexport const findReferences = (attribute, value) => {\n  const results = [];\n\n  if (referencesProps.has(attribute)) {\n    const matches = value.matchAll(regReferencesUrl);\n    for (const match of matches) {\n      results.push(match[2]);\n    }\n  }\n\n  if (attribute === 'href' || attribute.endsWith(':href')) {\n    const match = regReferencesHref.exec(value);\n    if (match != null) {\n      results.push(match[1]);\n    }\n  }\n\n  if (attribute === 'begin') {\n    const match = regReferencesBegin.exec(value);\n    if (match != null) {\n      results.push(match[1]);\n    }\n  }\n\n  return results.map((body) => decodeURI(body));\n};\n\n/**\n * Does the same as {@link Number.toFixed} but without casting\n * the return value to a string.\n *\n * @param {number} num\n * @param {number} precision\n * @returns {number}\n */\nexport const toFixed = (num, precision) => {\n  const pow = 10 ** precision;\n  return Math.round(num * pow) / pow;\n};\n"
  },
  {
    "path": "lib/svgo-node.js",
    "content": "import os from 'os';\nimport fs from 'fs/promises';\nimport path from 'path';\nimport * as svgo from './svgo.js';\nimport url from 'url';\n\n/**\n * @param {string} configFile\n * @returns {Promise<import('./types.js').Config>}\n */\nconst importConfig = async (configFile) => {\n  const resolvedPath = path.resolve(configFile);\n  const imported = await import(url.pathToFileURL(resolvedPath).toString());\n  const config = imported.default;\n\n  if (config == null || typeof config !== 'object' || Array.isArray(config)) {\n    throw Error(`Invalid config file \"${configFile}\"`);\n  }\n  return config;\n};\n\n/**\n * @param {string} file\n * @returns {Promise<boolean>}\n */\nconst isFile = async (file) => {\n  try {\n    const stats = await fs.stat(file);\n    return stats.isFile();\n  } catch {\n    return false;\n  }\n};\n\nexport * from './svgo.js';\n\n/**\n * If you write a tool on top of svgo you might need a way to load svgo config.\n * You can also specify relative or absolute path and customize current working\n * directory.\n *\n * @type {<T extends string | null>(configFile?: T, cwd?: string) => Promise<T extends string ? import('./svgo.js').Config : import('./svgo.js').Config | null>}\n */\nexport const loadConfig = async (configFile, cwd = process.cwd()) => {\n  if (configFile != null) {\n    if (path.isAbsolute(configFile)) {\n      return importConfig(configFile);\n    } else {\n      return importConfig(path.join(cwd, configFile));\n    }\n  }\n  let dir = cwd;\n\n  while (true) {\n    const js = path.join(dir, 'svgo.config.js');\n    if (await isFile(js)) {\n      return importConfig(js);\n    }\n    const mjs = path.join(dir, 'svgo.config.mjs');\n    if (await isFile(mjs)) {\n      return importConfig(mjs);\n    }\n    const cjs = path.join(dir, 'svgo.config.cjs');\n    if (await isFile(cjs)) {\n      return importConfig(cjs);\n    }\n    const parent = path.dirname(dir);\n    if (dir === parent) {\n      // @ts-expect-error https://github.com/microsoft/TypeScript/issues/33912\n      return null;\n    }\n    dir = parent;\n  }\n};\n\n/**\n * The core of SVGO.\n *\n * @param {string} input\n * @param {import('./svgo.js').Config=} config\n * @returns {import('./svgo.js').Output}\n */\nexport const optimize = (input, config) => {\n  if (config == null) {\n    config = {};\n  }\n  if (typeof config !== 'object') {\n    throw Error('Config should be an object');\n  }\n  return svgo.optimize(input, {\n    ...config,\n    js2svg: {\n      // platform specific default for end of line\n      eol: os.EOL === '\\r\\n' ? 'crlf' : 'lf',\n      ...config.js2svg,\n    },\n  });\n};\n"
  },
  {
    "path": "lib/svgo-node.test.js",
    "content": "import os from 'os';\nimport path from 'path';\nimport { loadConfig, optimize } from './svgo-node.js';\n\nconst describeLF = os.EOL === '\\r\\n' ? describe.skip : describe;\nconst describeCRLF = os.EOL === '\\r\\n' ? describe : describe.skip;\n\ndescribeLF('with LF line-endings', () => {\n  test('should work', () => {\n    const svg = `\n      <?xml version=\"1.0\" encoding=\"utf-8\"?>\n      <svg viewBox=\"0 0 120 120\">\n        <desc>\n          Created with love\n        </desc>\n        <circle fill=\"#ff0000\" cx=\"60\" cy=\"60\" r=\"50\"/>\n      </svg>\n    `;\n    const { data } = optimize(svg);\n    expect(data).toBe(\n      '<svg viewBox=\"0 0 120 120\"><circle cx=\"60\" cy=\"60\" r=\"50\" fill=\"red\"/></svg>',\n    );\n  });\n\n  test('should respect config', () => {\n    const svg = `\n      <?xml version=\"1.0\" encoding=\"utf-8\"?>\n      <svg viewBox=\"0 0 120 120\">\n        <desc>\n          Created with love\n        </desc>\n        <circle fill=\"#ff0000\" cx=\"60\" cy=\"60\" r=\"50\"/>\n      </svg>\n    `;\n    const { data } = optimize(svg, {\n      js2svg: { pretty: true, indent: 2 },\n    });\n    expect(data).toBe(\n      '<svg viewBox=\"0 0 120 120\">\\n  <circle cx=\"60\" cy=\"60\" r=\"50\" fill=\"red\"/>\\n</svg>\\n',\n    );\n  });\n\n  test('should respect line-ending config', () => {\n    const svg = `\n      <?xml version=\"1.0\" encoding=\"utf-8\"?>\n      <svg viewBox=\"0 0 120 120\">\n        <desc>\n          Created with love\n        </desc>\n        <circle fill=\"#ff0000\" cx=\"60\" cy=\"60\" r=\"50\"/>\n      </svg>\n    `;\n    const { data } = optimize(svg, {\n      js2svg: { eol: 'crlf', pretty: true, indent: 2 },\n    });\n    expect(data).toBe(\n      '<svg viewBox=\"0 0 120 120\">\\r\\n  <circle cx=\"60\" cy=\"60\" r=\"50\" fill=\"red\"/>\\r\\n</svg>\\r\\n',\n    );\n  });\n});\n\ndescribeCRLF('with CRLF line-endings', () => {\n  test('should work', () => {\n    const svg = `\n      <?xml version=\"1.0\" encoding=\"utf-8\"?>\n      <svg viewBox=\"0 0 120 120\">\n        <desc>\n          Created with love\n        </desc>\n        <circle fill=\"#ff0000\" cx=\"60\" cy=\"60\" r=\"50\"/>\n      </svg>\n    `;\n    const { data } = optimize(svg);\n    expect(data).toBe(\n      '<svg viewBox=\"0 0 120 120\"><circle cx=\"60\" cy=\"60\" r=\"50\" fill=\"red\"/></svg>',\n    );\n  });\n\n  test('should respect config', () => {\n    const svg = `\n      <?xml version=\"1.0\" encoding=\"utf-8\"?>\n      <svg viewBox=\"0 0 120 120\">\n        <desc>\n          Created with love\n        </desc>\n        <circle fill=\"#ff0000\" cx=\"60\" cy=\"60\" r=\"50\"/>\n      </svg>\n    `;\n    const { data } = optimize(svg, {\n      js2svg: { pretty: true, indent: 2 },\n    });\n    expect(data).toBe(\n      '<svg viewBox=\"0 0 120 120\">\\r\\n  <circle cx=\"60\" cy=\"60\" r=\"50\" fill=\"red\"/>\\r\\n</svg>\\r\\n',\n    );\n  });\n\n  test('should respect line-ending config', () => {\n    const svg = `\n      <?xml version=\"1.0\" encoding=\"utf-8\"?>\n      <svg viewBox=\"0 0 120 120\">\n        <desc>\n          Created with love\n        </desc>\n        <circle fill=\"#ff0000\" cx=\"60\" cy=\"60\" r=\"50\"/>\n      </svg>\n    `;\n    const { data } = optimize(svg, {\n      js2svg: { eol: 'lf', pretty: true, indent: 2 },\n    });\n    expect(data).toBe(\n      '<svg viewBox=\"0 0 120 120\">\\n  <circle cx=\"60\" cy=\"60\" r=\"50\" fill=\"red\"/>\\n</svg>\\n',\n    );\n  });\n});\n\ndescribe('loadConfig', () => {\n  const cwd = process.cwd();\n  const fixtures = path.join(cwd, './test/fixtures/config-loader');\n\n  test('loads by absolute path', async () => {\n    expect(\n      await loadConfig(path.join(fixtures, 'one/two/config.js')),\n    ).toStrictEqual({\n      plugins: [],\n    });\n  });\n\n  test('loads by relative path to cwd', async () => {\n    const config = await loadConfig('one/two/config.js', fixtures);\n    expect(config).toStrictEqual({ plugins: [] });\n  });\n\n  test('searches in cwd and up', async () => {\n    expect(\n      await loadConfig(null, path.join(fixtures, 'one/two')),\n    ).toStrictEqual({\n      plugins: [],\n    });\n    expect(\n      await loadConfig(null, path.join(cwd, './test/fixtures/missing')),\n    ).toBeNull();\n    expect(await loadConfig(null, path.join(fixtures, 'mjs'))).toStrictEqual({\n      plugins: ['mjs'],\n    });\n    expect(await loadConfig(null, path.join(fixtures, 'cjs'))).toStrictEqual({\n      plugins: ['cjs'],\n    });\n  });\n\n  test('fails when specified config does not exist', async () => {\n    await expect(loadConfig('{}')).rejects.toThrow(/Cannot find module/);\n  });\n\n  test('fails when exported config not an object', async () => {\n    await expect(\n      loadConfig(path.join(fixtures, 'invalid-null.js')),\n    ).rejects.toThrow(/Invalid config file/);\n    await expect(\n      loadConfig(path.join(fixtures, 'invalid-array.js')),\n    ).rejects.toThrow(/Invalid config file/);\n    await expect(\n      loadConfig(path.join(fixtures, 'invalid-string.js')),\n    ).rejects.toThrow(/Invalid config file/);\n  });\n\n  test('handles runtime errors properly', async () => {\n    await expect(\n      loadConfig(path.join(fixtures, 'invalid-runtime.js')),\n    ).rejects.toThrow(/plugins is not defined/);\n    await expect(\n      loadConfig(path.join(fixtures, 'invalid-runtime.mjs')),\n    ).rejects.toThrow(/plugins is not defined/);\n  });\n\n  test('handles MODULE_NOT_FOUND properly', async () => {\n    await expect(\n      loadConfig(path.join(fixtures, 'module-not-found.js')),\n    ).rejects.toThrow(/Cannot find module 'unknown-module'/);\n  });\n});\n"
  },
  {
    "path": "lib/svgo.js",
    "content": "import { builtinPlugins } from './builtin.js';\nimport { encodeSVGDatauri } from './svgo/tools.js';\nimport { invokePlugins } from './svgo/plugins.js';\nimport { querySelector, querySelectorAll } from './xast.js';\nimport { mapNodesToParents } from './util/map-nodes-to-parents.js';\nimport { parseSvg } from './parser.js';\nimport { stringifySvg } from './stringifier.js';\nimport { VERSION } from './version.js';\nimport * as _collections from '../plugins/_collections.js';\n\nconst pluginsMap = new Map();\nfor (const plugin of builtinPlugins) {\n  pluginsMap.set(plugin.name, plugin);\n}\n\n/**\n * @param {string} name\n * @returns {import('./types.js').BuiltinPluginOrPreset<?, ?>}\n */\nfunction getPlugin(name) {\n  if (name === 'removeScriptElement') {\n    console.warn(\n      'Warning: removeScriptElement has been renamed to removeScripts, please update your SVGO config',\n    );\n    return pluginsMap.get('removeScripts');\n  }\n\n  return pluginsMap.get(name);\n}\n\n/**\n * @param {string | import('./types.js').PluginConfig} plugin\n * @returns {?import('./types.js').PluginConfig}\n */\nconst resolvePluginConfig = (plugin) => {\n  if (typeof plugin === 'string') {\n    // resolve builtin plugin specified as string\n    const builtinPlugin = getPlugin(plugin);\n    if (builtinPlugin == null) {\n      throw Error(`Unknown builtin plugin \"${plugin}\" specified.`);\n    }\n    return {\n      name: plugin,\n      params: {},\n      fn: builtinPlugin.fn,\n    };\n  }\n  if (typeof plugin === 'object' && plugin != null) {\n    if (plugin.name == null) {\n      throw Error(`Plugin name must be specified`);\n    }\n    // use custom plugin implementation\n    // @ts-expect-error Checking for CustomPlugin with the presence of fn\n    let fn = plugin.fn;\n    if (fn == null) {\n      // resolve builtin plugin implementation\n      const builtinPlugin = getPlugin(plugin.name);\n      if (builtinPlugin == null) {\n        throw Error(`Unknown builtin plugin \"${plugin.name}\" specified.`);\n      }\n      fn = builtinPlugin.fn;\n    }\n    return {\n      name: plugin.name,\n      params: plugin.params,\n      fn,\n    };\n  }\n  return null;\n};\n\nexport * from './types.js';\n\n/**\n * The core of SVGO.\n *\n * @param {string} input\n * @param {import('./types.js').Config=} config\n * @returns {import('./types.js').Output}\n */\nexport const optimize = (input, config) => {\n  if (config == null) {\n    config = {};\n  }\n  if (typeof config !== 'object') {\n    throw Error('Config should be an object');\n  }\n  const maxPassCount = config.multipass ? 10 : 1;\n  let prevResultSize = Number.POSITIVE_INFINITY;\n  let output = '';\n  const info = {};\n  if (config.path != null) {\n    info.path = config.path;\n  }\n  for (let i = 0; i < maxPassCount; i += 1) {\n    info.multipassCount = i;\n    const ast = parseSvg(input, config.path);\n    const plugins = config.plugins || ['preset-default'];\n    if (!Array.isArray(plugins)) {\n      throw Error(\n        'malformed config, `plugins` property must be an array.\\nSee more info here: https://github.com/svg/svgo#configuration',\n      );\n    }\n    const resolvedPlugins = plugins\n      .filter((plugin) => plugin != null)\n      .map(resolvePluginConfig);\n\n    if (resolvedPlugins.length < plugins.length) {\n      console.warn(\n        'Warning: plugins list includes null or undefined elements, these will be ignored.',\n      );\n    }\n\n    /** @type {import('./types.js').Config} */\n    const globalOverrides = {};\n    if (config.floatPrecision != null) {\n      globalOverrides.floatPrecision = config.floatPrecision;\n    }\n    invokePlugins(ast, info, resolvedPlugins, null, globalOverrides);\n    output = stringifySvg(ast, config.js2svg);\n    if (output.length < prevResultSize) {\n      input = output;\n      prevResultSize = output.length;\n    } else {\n      break;\n    }\n  }\n  if (config.datauri) {\n    output = encodeSVGDatauri(output, config.datauri);\n  }\n  return {\n    data: output,\n  };\n};\n\nexport {\n  VERSION,\n  builtinPlugins,\n  mapNodesToParents,\n  querySelector,\n  querySelectorAll,\n  _collections,\n};\n"
  },
  {
    "path": "lib/svgo.test.js",
    "content": "import { jest } from '@jest/globals';\nimport { optimize } from './svgo.js';\nimport { SvgoParserError } from './parser.js';\n\ntest('allow to setup default preset', () => {\n  const svg = `\n    <?xml version=\"1.0\" encoding=\"utf-8\"?>\n    <svg viewBox=\"0 0 120 120\">\n      <desc>\n        Created with love\n      </desc>\n      <circle fill=\"#ff0000\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    </svg>\n  `;\n  const { data } = optimize(svg, {\n    plugins: ['preset-default'],\n    js2svg: { pretty: true, indent: 2 },\n  });\n  expect(data).toMatchInlineSnapshot(`\n    \"<svg viewBox=\"0 0 120 120\">\n      <circle cx=\"60\" cy=\"60\" r=\"50\" fill=\"red\"/>\n    </svg>\n    \"\n  `);\n});\n\ntest('allow to disable and customize plugins in preset', () => {\n  const svg = `\n    <?xml version=\"1.0\" encoding=\"utf-8\"?>\n    <svg viewBox=\"0 0 120 120\">\n      <desc>\n        Not standard description\n      </desc>\n      <circle fill=\"#ff0000\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    </svg>\n  `;\n  const { data } = optimize(svg, {\n    plugins: [\n      {\n        name: 'preset-default',\n        params: {\n          overrides: {\n            removeXMLProcInst: false,\n            removeDesc: {\n              removeAny: true,\n            },\n          },\n        },\n      },\n    ],\n    js2svg: { pretty: true, indent: 2 },\n  });\n  expect(data).toMatchInlineSnapshot(`\n    \"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n    <svg viewBox=\"0 0 120 120\">\n      <circle cx=\"60\" cy=\"60\" r=\"50\" fill=\"red\"/>\n    </svg>\n    \"\n  `);\n});\n\ntest('warn when user tries enable plugins in preset', () => {\n  const svg = `\n    <svg viewBox=\"0 0 120 120\"></svg>\n  `;\n  const warn = jest.spyOn(console, 'warn');\n  optimize(svg, {\n    plugins: [\n      // @ts-expect-error Testing if we receive config that diverges from type definitions.\n      {\n        name: 'preset-default',\n        params: {\n          overrides: {\n            cleanupListOfValues: true,\n          },\n        },\n      },\n    ],\n    js2svg: { pretty: true, indent: 2 },\n  });\n  expect(warn)\n    .toBeCalledWith(`You are trying to configure cleanupListOfValues which is not part of preset-default.\nTry to put it before or after, for example\n\nplugins: [\n  {\n    name: 'preset-default',\n  },\n  'cleanupListOfValues'\n]\n`);\n  warn.mockRestore();\n});\n\ndescribe('allow to configure EOL', () => {\n  test('should respect EOL set to LF', () => {\n    const svg = `\n      <?xml version=\"1.0\" encoding=\"utf-8\"?>\n      <svg viewBox=\"0 0 120 120\">\n        <desc>\n          Created with love\n        </desc>\n        <circle fill=\"#ff0000\" cx=\"60\" cy=\"60\" r=\"50\"/>\n      </svg>\n    `;\n    const { data } = optimize(svg, {\n      js2svg: { eol: 'lf', pretty: true, indent: 2 },\n    });\n    expect(data).toBe(\n      '<svg viewBox=\"0 0 120 120\">\\n  <circle cx=\"60\" cy=\"60\" r=\"50\" fill=\"red\"/>\\n</svg>\\n',\n    );\n  });\n\n  test('should respect EOL set to CRLF', () => {\n    const svg = `\n      <?xml version=\"1.0\" encoding=\"utf-8\"?>\n      <svg viewBox=\"0 0 120 120\">\n        <desc>\n          Created with love\n        </desc>\n        <circle fill=\"#ff0000\" cx=\"60\" cy=\"60\" r=\"50\"/>\n      </svg>\n    `;\n    const { data } = optimize(svg, {\n      js2svg: { eol: 'crlf', pretty: true, indent: 2 },\n    });\n    expect(data).toBe(\n      '<svg viewBox=\"0 0 120 120\">\\r\\n  <circle cx=\"60\" cy=\"60\" r=\"50\" fill=\"red\"/>\\r\\n</svg>\\r\\n',\n    );\n  });\n\n  test('should default to LF line break for any other EOL values', () => {\n    const svg = `\n      <?xml version=\"1.0\" encoding=\"utf-8\"?>\n      <svg viewBox=\"0 0 120 120\">\n        <desc>\n          Created with love\n        </desc>\n        <circle cx=\"60\" cy=\"60\" fill=\"#ff0000\" r=\"50\"/>\n      </svg>\n    `;\n    const { data } = optimize(svg, {\n      // @ts-expect-error Testing if we receive config that diverges from type definitions.\n      js2svg: { eol: 'invalid', pretty: true, indent: 2 },\n    });\n    expect(data).toBe(\n      '<svg viewBox=\"0 0 120 120\">\\n  <circle cx=\"60\" cy=\"60\" r=\"50\" fill=\"red\"/>\\n</svg>\\n',\n    );\n  });\n});\n\ndescribe('allow to configure final newline', () => {\n  test('should not add final newline when unset', () => {\n    const svg = `\n      <?xml version=\"1.0\" encoding=\"utf-8\"?>\n      <svg viewBox=\"0 0 120 120\">\n        <desc>\n          Created with love\n        </desc>\n        <circle cx=\"60\" cy=\"60\" r=\"50\" fill=\"#ff0000\"/>\n      </svg>\n    `;\n    const { data } = optimize(svg, { js2svg: { eol: 'lf' } });\n    expect(data).toBe(\n      '<svg viewBox=\"0 0 120 120\"><circle cx=\"60\" cy=\"60\" r=\"50\" fill=\"red\"/></svg>',\n    );\n  });\n\n  test('should add final newline when set', () => {\n    const svg = `\n      <?xml version=\"1.0\" encoding=\"utf-8\"?>\n      <svg viewBox=\"0 0 120 120\">\n        <desc>\n          Created with love\n        </desc>\n        <circle fill=\"#ff0000\" cx=\"60\" cy=\"60\" r=\"50\"/>\n      </svg>\n    `;\n    const { data } = optimize(svg, {\n      js2svg: { finalNewline: true, eol: 'lf' },\n    });\n    expect(data).toBe(\n      '<svg viewBox=\"0 0 120 120\"><circle cx=\"60\" cy=\"60\" r=\"50\" fill=\"red\"/></svg>\\n',\n    );\n  });\n\n  test('should not add extra newlines when using pretty: true', () => {\n    const svg = `\n      <?xml version=\"1.0\" encoding=\"utf-8\"?>\n      <svg viewBox=\"0 0 120 120\">\n        <desc>\n          Created with love\n        </desc>\n        <circle fill=\"#ff0000\" cx=\"60\" cy=\"60\" r=\"50\"/>\n      </svg>\n    `;\n    const { data } = optimize(svg, {\n      js2svg: { finalNewline: true, pretty: true, indent: 2, eol: 'lf' },\n    });\n    expect(data).toBe(\n      '<svg viewBox=\"0 0 120 120\">\\n  <circle cx=\"60\" cy=\"60\" r=\"50\" fill=\"red\"/>\\n</svg>\\n',\n    );\n  });\n});\n\ntest('allow to customize precision for preset', () => {\n  const svg = `\n    <svg viewBox=\"0 0 120 120\">\n      <circle fill=\"#ff0000\" cx=\"60.444444\" cy=\"60\" r=\"50\"/>\n    </svg>\n  `;\n  const { data } = optimize(svg, {\n    plugins: [\n      {\n        name: 'preset-default',\n        params: {\n          floatPrecision: 4,\n        },\n      },\n    ],\n    js2svg: { pretty: true, indent: 2 },\n  });\n  expect(data).toMatchInlineSnapshot(`\n    \"<svg viewBox=\"0 0 120 120\">\n      <circle cx=\"60.4444\" cy=\"60\" r=\"50\" fill=\"red\"/>\n    </svg>\n    \"\n  `);\n});\n\ntest('plugin precision should override preset precision', () => {\n  const svg = `\n    <svg viewBox=\"0 0 120 120\">\n      <circle fill=\"#ff0000\" cx=\"60.444444\" cy=\"60\" r=\"50\"/>\n    </svg>\n  `;\n  const { data } = optimize(svg, {\n    plugins: [\n      {\n        name: 'preset-default',\n        params: {\n          floatPrecision: 4,\n          overrides: {\n            cleanupNumericValues: {\n              floatPrecision: 5,\n            },\n          },\n        },\n      },\n    ],\n    js2svg: { pretty: true, indent: 2 },\n  });\n  expect(data).toMatchInlineSnapshot(`\n    \"<svg viewBox=\"0 0 120 120\">\n      <circle cx=\"60.44444\" cy=\"60\" r=\"50\" fill=\"red\"/>\n    </svg>\n    \"\n  `);\n});\n\ntest('provides informative error in result', () => {\n  const svg = `<svg viewBox=\"0 0 120 120\">\n      <circle fill=\"#ff0000\" cx=60.444444\" cy=\"60\" r=\"50\"/>\n    </svg>\n  `;\n  const error = new SvgoParserError(\n    'Unquoted attribute value',\n    2,\n    33,\n    svg,\n    'test.svg',\n  );\n  expect(() => optimize(svg, { path: 'test.svg' })).toThrow(error);\n  expect(error.name).toBe('SvgoParserError');\n  expect(error.message).toBe('test.svg:2:33: Unquoted attribute value');\n});\n\ntest('provides code snippet in rendered error', () => {\n  const svg = `<svg viewBox=\"0 0 120 120\">\n  <circle fill=\"#ff0000\" cx=60.444444\" cy=\"60\" r=\"50\"/>\n</svg>\n`;\n  const error = new SvgoParserError(\n    'Unquoted attribute value',\n    2,\n    29,\n    svg,\n    'test.svg',\n  );\n  expect(() => optimize(svg, { path: 'test.svg' })).toThrow(error);\n  expect(error.toString())\n    .toBe(`SvgoParserError: test.svg:2:29: Unquoted attribute value\n\n  1 | <svg viewBox=\"0 0 120 120\">\n> 2 |   <circle fill=\"#ff0000\" cx=60.444444\" cy=\"60\" r=\"50\"/>\n    |                             ^\n  3 | </svg>\n  4 | \n`);\n});\n\ntest('supports errors without path', () => {\n  const svg = `<svg viewBox=\"0 0 120 120\">\n  <circle/>\n  <circle/>\n  <circle/>\n  <circle/>\n  <circle/>\n  <circle/>\n  <circle/>\n  <circle/>\n  <circle/>\n  <circle fill=\"#ff0000\" cx=60.444444\" cy=\"60\" r=\"50\"/>\n</svg>\n`;\n  const error = new SvgoParserError('Unquoted attribute value', 11, 29, svg);\n  expect(() => optimize(svg)).toThrow(error);\n  expect(error.toString())\n    .toBe(`SvgoParserError: <input>:11:29: Unquoted attribute value\n\n   9 |   <circle/>\n  10 |   <circle/>\n> 11 |   <circle fill=\"#ff0000\" cx=60.444444\" cy=\"60\" r=\"50\"/>\n     |                             ^\n  12 | </svg>\n  13 | \n`);\n});\n\ntest('slices long line in error code snippet', () => {\n  const svg = `<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" viewBox=\"0 0 230 120\">\n  <path d=\"M318.198 551.135 530.33 918.56l-289.778-77.646 38.823-144.889c77.646-289.778 294.98-231.543 256.156-86.655s178.51 203.124 217.334 58.235q58.234-217.334 250.955 222.534t579.555 155.292z stroke-width=\"1.5\" fill=\"red\" stroke=\"red\" />\n</svg>\n`;\n  const error = new SvgoParserError('Invalid attribute name', 2, 211, svg);\n\n  expect(() => optimize(svg)).toThrow(error);\n  expect(error.toString())\n    .toBe(`SvgoParserError: <input>:2:211: Invalid attribute name\n\n  1 | …-0.dtd\" viewBox=\"0 0 230 120\">\n> 2 | …7.334 250.955 222.534t579.555 155.292z stroke-width=\"1.5\" fill=\"red\" strok…\n    |                                                       ^\n  3 |  \n  4 |  \n`);\n});\n\ntest('multipass option should trigger plugins multiple times', () => {\n  const svg = `<svg id=\"abcdefghijklmnopqrstuvwxyz\"></svg>`;\n  /** @type {number[]} */\n  const list = [];\n  /** @type {import('./types.js').CustomPlugin} */\n  const testPlugin = {\n    name: 'testPlugin',\n    fn: (_root, _params, info) => {\n      list.push(info.multipassCount);\n      return {\n        element: {\n          enter: (node) => {\n            node.attributes.id = node.attributes.id.slice(1);\n          },\n        },\n      };\n    },\n  };\n  const { data } = optimize(svg, { multipass: true, plugins: [testPlugin] });\n  expect(list).toStrictEqual([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);\n  expect(data).toBe(`<svg id=\"klmnopqrstuvwxyz\"/>`);\n});\n\ntest('encode as datauri', () => {\n  const input = `\n    <svg xmlns=\"http://www.w3.org/2000/svg\">\n        <g transform=\"matrix(0.707 -0.707 0.707 0.707 255.03 111.21) scale(2)\"/>\n    </svg>\n    `;\n  const { data: dataSinglePass } = optimize(input, {\n    datauri: 'enc',\n    plugins: ['convertTransform'],\n  });\n  expect(dataSinglePass).toMatchInlineSnapshot(\n    `\"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20transform%3D%22rotate(-45%20261.757%20-252.243)scale(2)%22%2F%3E%3C%2Fsvg%3E\"`,\n  );\n  const { data: dataMultiPass } = optimize(input, {\n    multipass: true,\n    datauri: 'enc',\n    plugins: ['convertTransform'],\n  });\n  expect(dataMultiPass).toMatchInlineSnapshot(\n    `\"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20transform%3D%22rotate(-45%20261.757%20-252.243)scale(2)%22%2F%3E%3C%2Fsvg%3E\"`,\n  );\n});\n"
  },
  {
    "path": "lib/types.js",
    "content": "export default {};\n"
  },
  {
    "path": "lib/types.ts",
    "content": "import { AddAttributesToSVGElementParams } from '../plugins/addAttributesToSVGElement.js';\nimport { AddClassesToSVGElementParams } from '../plugins/addClassesToSVGElement.js';\nimport { CleanupAttrsParams } from '../plugins/cleanupAttrs.js';\nimport { CleanupIdsParams } from '../plugins/cleanupIds.js';\nimport { CleanupListOfValuesParams } from '../plugins/cleanupListOfValues.js';\nimport { CleanupNumericValuesParams } from '../plugins/cleanupNumericValues.js';\nimport { ConvertColorsParams } from '../plugins/convertColors.js';\nimport { ConvertPathDataParams } from '../plugins/convertPathData.js';\nimport { ConvertShapeToPathParams } from '../plugins/convertShapeToPath.js';\nimport { ConvertStyleToAttrsParams } from '../plugins/convertStyleToAttrs.js';\nimport { ConvertTransformParams } from '../plugins/convertTransform.js';\nimport { InlineStylesParams } from '../plugins/inlineStyles.js';\nimport { MergePathsParams } from '../plugins/mergePaths.js';\nimport { MinifyStylesParams } from '../plugins/minifyStyles.js';\nimport { PrefixIdsParams } from '../plugins/prefixIds.js';\nimport { RemoveAttrsParams } from '../plugins/removeAttrs.js';\nimport { RemoveCommentsParams } from '../plugins/removeComments.js';\nimport { RemoveDeprecatedAttrsParams } from '../plugins/removeDeprecatedAttrs.js';\nimport { RemoveDescParams } from '../plugins/removeDesc.js';\nimport { RemoveEditorsNSDataParams } from '../plugins/removeEditorsNSData.js';\nimport { RemoveElementsByAttrParams } from '../plugins/removeElementsByAttr.js';\nimport { RemoveEmptyTextParams } from '../plugins/removeEmptyText.js';\nimport { RemoveHiddenElemsParams } from '../plugins/removeHiddenElems.js';\nimport { RemoveUnknownsAndDefaultsParams } from '../plugins/removeUnknownsAndDefaults.js';\nimport { RemoveUselessStrokeAndFillParams } from '../plugins/removeUselessStrokeAndFill.js';\nimport { RemoveXlinkParams } from '../plugins/removeXlink.js';\nimport { SortAttrsParams } from '../plugins/sortAttrs.js';\n\nexport type DefaultPlugins = {\n  cleanupAttrs: CleanupAttrsParams;\n  cleanupEnableBackground: null;\n  cleanupIds: CleanupIdsParams;\n  cleanupNumericValues: CleanupNumericValuesParams;\n  collapseGroups: null;\n  convertColors: ConvertColorsParams;\n  convertEllipseToCircle: null;\n  convertPathData: ConvertPathDataParams;\n  convertShapeToPath: ConvertShapeToPathParams;\n  convertTransform: ConvertTransformParams;\n  mergeStyles: null;\n  inlineStyles: InlineStylesParams;\n  mergePaths: MergePathsParams;\n  minifyStyles: MinifyStylesParams;\n  moveElemsAttrsToGroup: null;\n  moveGroupAttrsToElems: null;\n  removeComments: RemoveCommentsParams;\n  removeDeprecatedAttrs: RemoveDeprecatedAttrsParams;\n  removeDesc: RemoveDescParams;\n  removeDoctype: null;\n  removeEditorsNSData: RemoveEditorsNSDataParams;\n  removeEmptyAttrs: null;\n  removeEmptyContainers: null;\n  removeEmptyText: RemoveEmptyTextParams;\n  removeHiddenElems: RemoveHiddenElemsParams;\n  removeMetadata: null;\n  removeNonInheritableGroupAttrs: null;\n  removeUnknownsAndDefaults: RemoveUnknownsAndDefaultsParams;\n  removeUnusedNS: null;\n  removeUselessDefs: null;\n  removeUselessStrokeAndFill: RemoveUselessStrokeAndFillParams;\n  removeXMLProcInst: null;\n  sortAttrs: SortAttrsParams;\n  sortDefsChildren: null;\n};\n\nexport type PresetDefaultOverrides = {\n  [Name in keyof DefaultPlugins]?: DefaultPlugins[Name] | false;\n};\n\nexport type BuiltinsWithOptionalParams = DefaultPlugins & {\n  'preset-default': {\n    floatPrecision?: number;\n    /**\n     * All default plugins can be customized or disabled here\n     * for example\n     * {\n     *   sortAttrs: { xmlnsOrder: \"alphabetical\" },\n     *   cleanupAttrs: false,\n     * }\n     */\n    overrides?: PresetDefaultOverrides;\n  };\n  cleanupListOfValues: CleanupListOfValuesParams;\n  convertOneStopGradients: null;\n  convertStyleToAttrs: ConvertStyleToAttrsParams;\n  prefixIds: PrefixIdsParams;\n  removeDimensions: null;\n  removeOffCanvasPaths: null;\n  removeRasterImages: null;\n  removeScripts: null;\n  removeStyleElement: null;\n  removeTitle: null;\n  removeViewBox: null;\n  removeXlink: RemoveXlinkParams;\n  removeXMLNS: null;\n  reusePaths: null;\n};\n\nexport type BuiltinsWithRequiredParams = {\n  addAttributesToSVGElement: AddAttributesToSVGElementParams;\n  addClassesToSVGElement: AddClassesToSVGElementParams;\n  removeAttributesBySelector: any;\n  removeAttrs: RemoveAttrsParams;\n  removeElementsByAttr: RemoveElementsByAttrParams;\n};\n\nexport type PluginsParams = BuiltinsWithOptionalParams &\n  BuiltinsWithRequiredParams;\n\nexport type CustomPlugin<T = any> = {\n  name: string;\n  fn: Plugin<T>;\n  params?: T;\n};\n\nexport type PluginConfig =\n  | keyof BuiltinsWithOptionalParams\n  | {\n      [Name in keyof BuiltinsWithOptionalParams]: {\n        name: Name;\n        params?: BuiltinsWithOptionalParams[Name];\n      };\n    }[keyof BuiltinsWithOptionalParams]\n  | {\n      [Name in keyof BuiltinsWithRequiredParams]: {\n        name: Name;\n        params: BuiltinsWithRequiredParams[Name];\n      };\n    }[keyof BuiltinsWithRequiredParams]\n  | CustomPlugin;\n\nexport type BuiltinPlugin<Name extends string, Params> = {\n  /** Name of the plugin, also known as the plugin ID. */\n  name: Name;\n  description?: string;\n  fn: Plugin<Params>;\n};\n\ntype PresetProperties<IsPreset extends boolean> = {\n  name: IsPreset extends true ? `preset-${string}` : string;\n\n  /** If the plugin is itself a preset that invokes other plugins. */\n  isPreset: IsPreset extends true ? true : undefined;\n\n  /**\n   * If {@link #isPreset} is true, an array of the plugins in the preset\n   * in the order that they are invoked.\n   */\n  plugins: IsPreset extends true\n    ? ReadonlyArray<BuiltinPlugin<string, Object>>\n    : undefined;\n};\n\nexport type BuiltinPluginOrPreset<Name extends string, Params> = BuiltinPlugin<\n  Name,\n  Params\n> &\n  (PresetProperties<true> | Partial<PresetProperties<false>>);\n\nexport type XastDoctype = {\n  type: 'doctype';\n  name: string;\n  data: {\n    doctype: string;\n  };\n};\n\nexport type XastInstruction = {\n  type: 'instruction';\n  name: string;\n  value: string;\n};\n\nexport type XastComment = {\n  type: 'comment';\n  value: string;\n};\n\nexport type XastCdata = {\n  type: 'cdata';\n  value: string;\n};\n\nexport type XastText = {\n  type: 'text';\n  value: string;\n};\n\nexport type XastElement = {\n  type: 'element';\n  name: string;\n  attributes: Record<string, string>;\n  children: XastChild[];\n};\n\nexport type XastChild =\n  | XastDoctype\n  | XastInstruction\n  | XastComment\n  | XastCdata\n  | XastText\n  | XastElement;\n\nexport type XastRoot = {\n  type: 'root';\n  children: XastChild[];\n};\n\nexport type XastParent = XastRoot | XastElement;\n\nexport type XastNode = XastRoot | XastChild;\n\nexport type StringifyOptions = {\n  doctypeStart?: string;\n  doctypeEnd?: string;\n  procInstStart?: string;\n  procInstEnd?: string;\n  tagOpenStart?: string;\n  tagOpenEnd?: string;\n  tagCloseStart?: string;\n  tagCloseEnd?: string;\n  tagShortStart?: string;\n  tagShortEnd?: string;\n  attrStart?: string;\n  attrEnd?: string;\n  commentStart?: string;\n  commentEnd?: string;\n  cdataStart?: string;\n  cdataEnd?: string;\n  textStart?: string;\n  textEnd?: string;\n  indent?: number | string;\n  regEntities?: RegExp;\n  regValEntities?: RegExp;\n  encodeEntity?: (char: string) => string;\n  pretty?: boolean;\n  useShortTags?: boolean;\n  eol?: 'lf' | 'crlf';\n  finalNewline?: boolean;\n};\n\nexport type VisitorNode<Node> = {\n  enter?: (node: Node, parentNode: XastParent) => void | symbol;\n  exit?: (node: Node, parentNode: XastParent) => void;\n};\n\nexport type VisitorRoot = {\n  enter?: (node: XastRoot, parentNode: null) => void;\n  exit?: (node: XastRoot, parentNode: null) => void;\n};\n\nexport type Visitor = {\n  doctype?: VisitorNode<XastDoctype>;\n  instruction?: VisitorNode<XastInstruction>;\n  comment?: VisitorNode<XastComment>;\n  cdata?: VisitorNode<XastCdata>;\n  text?: VisitorNode<XastText>;\n  element?: VisitorNode<XastElement>;\n  root?: VisitorRoot;\n};\n\nexport type PluginInfo = {\n  path?: string;\n  multipassCount: number;\n};\n\nexport type Plugin<P = null> = (\n  root: XastRoot,\n  params: P,\n  info: PluginInfo,\n) => Visitor | null | void;\n\nexport type Specificity = [number, number, number];\n\nexport type StylesheetDeclaration = {\n  name: string;\n  value: string;\n  important: boolean;\n};\n\nexport type StylesheetRule = {\n  dynamic: boolean;\n  selector: string;\n  specificity: Specificity;\n  declarations: StylesheetDeclaration[];\n};\n\nexport type Stylesheet = {\n  rules: StylesheetRule[];\n  parents: Map<XastElement, XastParent>;\n};\n\nexport type StaticStyle = {\n  type: 'static';\n  inherited: boolean;\n  value: string;\n};\n\nexport type DynamicStyle = {\n  type: 'dynamic';\n  inherited: boolean;\n};\n\nexport type ComputedStyles = Record<string, StaticStyle | DynamicStyle>;\n\nexport type PathDataCommand =\n  | 'M'\n  | 'm'\n  | 'Z'\n  | 'z'\n  | 'L'\n  | 'l'\n  | 'H'\n  | 'h'\n  | 'V'\n  | 'v'\n  | 'C'\n  | 'c'\n  | 'S'\n  | 's'\n  | 'Q'\n  | 'q'\n  | 'T'\n  | 't'\n  | 'A'\n  | 'a';\n\nexport type PathDataItem = {\n  command: PathDataCommand;\n  args: number[];\n};\n\nexport type DataUri = 'base64' | 'enc' | 'unenc';\n\nexport type Config = {\n  /** Can be used by plugins, for example prefixIds. */\n  path?: string;\n  /** Pass over SVGs multiple times to ensure all optimizations are applied. */\n  multipass?: boolean;\n  /**\n   * Precision of floating point numbers. Will be passed to each plugin that\n   * supports this param.\n   */\n  floatPrecision?: number;\n  /**\n   * Plugins configuration. By default SVGO uses `preset-default`, but may\n   * contain builtin or custom plugins.\n   */\n  plugins?: PluginConfig[];\n  /** Options for rendering optimized SVG from AST. */\n  js2svg?: StringifyOptions;\n  /** Output as Data URI string. */\n  datauri?: DataUri;\n};\n\nexport type Output = {\n  data: string;\n};\n"
  },
  {
    "path": "lib/util/map-nodes-to-parents.js",
    "content": "import { visit } from './visit.js';\n\n/**\n * Maps all nodes to their parent node recursively.\n *\n * @param {import('../types.js').XastParent} node\n * @returns {Map<import('../types.js').XastNode, import('../types.js').XastParent>}\n */\nexport function mapNodesToParents(node) {\n  /** @type {Map<import('../types.js').XastNode, import('../types.js').XastParent>} */\n  const parents = new Map();\n\n  for (const child of node.children) {\n    parents.set(child, node);\n    visit(\n      child,\n      {\n        element: {\n          enter: (child, parent) => {\n            parents.set(child, parent);\n          },\n        },\n      },\n      node,\n    );\n  }\n\n  return parents;\n}\n"
  },
  {
    "path": "lib/util/visit.js",
    "content": "export const visitSkip = Symbol();\n\n/**\n * @param {import('../types.js').XastNode} node\n * @param {import('../types.js').Visitor} visitor\n * @param {any=} parentNode\n */\nexport const visit = (node, visitor, parentNode) => {\n  const callbacks = visitor[node.type];\n  if (callbacks?.enter) {\n    // @ts-expect-error hard to infer\n    const symbol = callbacks.enter(node, parentNode);\n    if (symbol === visitSkip) {\n      return;\n    }\n  }\n  // visit root children\n  if (node.type === 'root') {\n    // copy children array to not lose cursor when children is spliced\n    for (const child of node.children) {\n      visit(child, visitor, node);\n    }\n  }\n  // visit element children if still attached to parent\n  if (node.type === 'element') {\n    if (parentNode.children.includes(node)) {\n      for (const child of node.children) {\n        visit(child, visitor, node);\n      }\n    }\n  }\n  if (callbacks?.exit) {\n    // @ts-expect-error hard to infer\n    callbacks.exit(node, parentNode);\n  }\n};\n"
  },
  {
    "path": "lib/version.js",
    "content": "/**\n * Version of SVGO.\n *\n * @type {string}\n * @since 4.0.0\n */\nexport const VERSION = '4.0.1';\n"
  },
  {
    "path": "lib/xast.js",
    "content": "import { is, selectAll, selectOne } from 'css-select';\nimport { createAdapter } from './svgo/css-select-adapter.js';\n\n/**\n * @param {import('./types.js').XastParent} relativeNode\n * @param {Map<import('./types.js').XastNode, import('./types.js').XastParent>=} parents\n * @returns {import('css-select').Options<import('./types.js').XastNode & { children?: any }, import('./types.js').XastElement>}\n */\nfunction createCssSelectOptions(relativeNode, parents) {\n  return {\n    xmlMode: true,\n    adapter: createAdapter(relativeNode, parents),\n  };\n}\n\n/**\n * @param {import('./types.js').XastParent} node Element to query the children of.\n * @param {string} selector CSS selector string.\n * @param {Map<import('./types.js').XastNode, import('./types.js').XastParent>=} parents\n * @returns {import('./types.js').XastChild[]} All matching elements.\n */\nexport const querySelectorAll = (node, selector, parents) => {\n  return selectAll(selector, node, createCssSelectOptions(node, parents));\n};\n\n/**\n * @param {import('./types.js').XastParent} node Element to query the children of.\n * @param {string} selector CSS selector string.\n * @param {Map<import('./types.js').XastNode, import('./types.js').XastParent>=} parents\n * @returns {?import('./types.js').XastChild} First match, or null if there was no match.\n */\nexport const querySelector = (node, selector, parents) => {\n  return selectOne(selector, node, createCssSelectOptions(node, parents));\n};\n\n/**\n * @param {import('./types.js').XastElement} node\n * @param {string} selector\n * @param {Map<import('./types.js').XastNode, import('./types.js').XastParent>=} parents\n * @returns {boolean}\n */\nexport const matches = (node, selector, parents) => {\n  return is(node, selector, createCssSelectOptions(node, parents));\n};\n\n/**\n * @param {import('./types.js').XastChild} node\n * @param {import('./types.js').XastParent} parentNode\n */\nexport const detachNodeFromParent = (node, parentNode) => {\n  // avoid splice to not break for loops\n  parentNode.children = parentNode.children.filter((child) => child !== node);\n};\n"
  },
  {
    "path": "lib/xast.test.js",
    "content": "import { detachNodeFromParent } from './xast.js';\nimport { visit, visitSkip } from './util/visit.js';\n\n/**\n * @param {import('./types.js').XastElement[]} children\n * @returns {import('./types.js').XastRoot}\n */\nconst root = (children) => {\n  return { type: 'root', children };\n};\n\n/**\n * @param {string} name\n * @param {?Record<string, string>} attrs\n * @param {import('./types.js').XastElement[]} children\n * @returns {import('./types.js').XastElement}\n */\nconst x = (name, attrs = null, children = []) => {\n  return { type: 'element', name, attributes: attrs || {}, children };\n};\n\ntest('visit enters into nodes', () => {\n  const ast = root([x('g', null, [x('rect'), x('circle')]), x('ellipse')]);\n  /** @type {string[]} */\n  const entered = [];\n  visit(ast, {\n    root: {\n      enter: (node) => {\n        entered.push(node.type);\n      },\n    },\n    element: {\n      enter: (node) => {\n        entered.push(`${node.type}:${node.name}`);\n      },\n    },\n  });\n  expect(entered).toStrictEqual([\n    'root',\n    'element:g',\n    'element:rect',\n    'element:circle',\n    'element:ellipse',\n  ]);\n});\n\ntest('visit exits from nodes', () => {\n  const ast = root([x('g', null, [x('rect'), x('circle')]), x('ellipse')]);\n  /** @type {string[]} */\n  const exited = [];\n  visit(ast, {\n    root: {\n      exit: (node) => {\n        exited.push(node.type);\n      },\n    },\n    element: {\n      exit: (node) => {\n        exited.push(`${node.type}:${node.name}`);\n      },\n    },\n  });\n  expect(exited).toStrictEqual([\n    'element:rect',\n    'element:circle',\n    'element:g',\n    'element:ellipse',\n    'root',\n  ]);\n});\n\ntest('visit skips entering children if node is detached', () => {\n  const ast = root([x('g', null, [x('rect'), x('circle')]), x('ellipse')]);\n  /** @type {string[]} */\n  const entered = [];\n  visit(ast, {\n    element: {\n      enter: (node, parentNode) => {\n        entered.push(node.name);\n        if (node.name === 'g') {\n          detachNodeFromParent(node, parentNode);\n        }\n      },\n    },\n  });\n  expect(entered).toStrictEqual(['g', 'ellipse']);\n  expect(ast).toStrictEqual(root([x('ellipse')]));\n});\n\ntest('visit skips entering children when symbol is passed', () => {\n  const ast = root([x('g', null, [x('rect'), x('circle')]), x('ellipse')]);\n  /** @type {string[]} */\n  const entered = [];\n  visit(ast, {\n    element: {\n      enter: (node) => {\n        entered.push(node.name);\n        if (node.name === 'g') {\n          return visitSkip;\n        }\n      },\n    },\n  });\n  expect(entered).toStrictEqual(['g', 'ellipse']);\n  expect(ast).toStrictEqual(\n    root([x('g', null, [x('rect'), x('circle')]), x('ellipse')]),\n  );\n});\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"packageManager\": \"yarn@3.8.7\",\n  \"name\": \"svgo\",\n  \"version\": \"4.0.1\",\n  \"description\": \"SVGO is a Node.js library and command-line application for optimizing vector images.\",\n  \"license\": \"MIT\",\n  \"type\": \"module\",\n  \"keywords\": [\n    \"svgo\",\n    \"svg\",\n    \"optimize\",\n    \"minify\"\n  ],\n  \"homepage\": \"https://svgo.dev\",\n  \"bugs\": {\n    \"url\": \"https://github.com/svg/svgo/issues\"\n  },\n  \"author\": {\n    \"name\": \"Kir Belevich\",\n    \"email\": \"kir@belevi.ch\",\n    \"url\": \"https://github.com/deepsweet\"\n  },\n  \"contributors\": [\n    {\n      \"name\": \"Sergey Belov\",\n      \"email\": \"peimei@ya.ru\",\n      \"url\": \"https://github.com/arikon\"\n    },\n    {\n      \"name\": \"Lev Solntsev\",\n      \"email\": \"lev.sun@ya.ru\",\n      \"url\": \"https://github.com/GreLI\"\n    },\n    {\n      \"name\": \"Bogdan Chadkin\",\n      \"email\": \"trysound@yandex.ru\",\n      \"url\": \"https://github.com/TrySound\"\n    },\n    {\n      \"name\": \"Seth Falco\",\n      \"email\": \"seth@falco.fun\",\n      \"url\": \"https://falco.fun/\"\n    }\n  ],\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/svg/svgo.git\"\n  },\n  \"funding\": {\n    \"type\": \"opencollective\",\n    \"url\": \"https://opencollective.com/svgo\"\n  },\n  \"bin\": \"./bin/svgo.js\",\n  \"types\": \"./types/lib/svgo-node.d.ts\",\n  \"exports\": {\n    \".\": {\n      \"import\": \"./lib/svgo-node.js\",\n      \"require\": \"./dist/svgo-node.cjs\",\n      \"types\": \"./types/lib/svgo-node.d.ts\"\n    },\n    \"./browser\": {\n      \"import\": \"./dist/svgo.browser.js\",\n      \"types\": \"./types/lib/svgo.d.ts\"\n    }\n  },\n  \"files\": [\n    \"bin\",\n    \"dist\",\n    \"lib\",\n    \"plugins\",\n    \"types\",\n    \"!**/*.test.js\"\n  ],\n  \"engines\": {\n    \"node\": \">=16\"\n  },\n  \"scripts\": {\n    \"build\": \"node scripts/sync-version.js && yarn build:bundles && yarn build:types\",\n    \"build:bundles\": \"yarn clean:build && rollup -c\",\n    \"build:types\": \"yarn clean:types && tsc && tsc -p tsconfig.build.json\",\n    \"lint\": \"eslint . && prettier --check .\",\n    \"lint:fix\": \"eslint --fix . && prettier --write .\",\n    \"test\": \"cross-env NODE_OPTIONS=--experimental-vm-modules jest --maxWorkers=4 --coverage\",\n    \"test:bundles\": \"yarn build:bundles && node ./test/svgo.cjs && node ./test/browser.js\",\n    \"test:types\": \"yarn build:types && tsc && tsd\",\n    \"test:regression\": \"node ./test/regression/extract.js && node ./test/regression/optimize.js && cross-env NO_DIFF=1 node ./test/regression/compare.js\",\n    \"qa\": \"yarn lint && yarn test:types && yarn test && yarn test:bundles && yarn test:regression\",\n    \"clean\": \"yarn clean:build && yarn clean:types\",\n    \"clean:build\": \"rimraf dist\",\n    \"clean:types\": \"rimraf types\",\n    \"spellcheck\": \"cspell -u .\",\n    \"prepublishOnly\": \"yarn clean && yarn build\"\n  },\n  \"jest\": {\n    \"coveragePathIgnorePatterns\": [\n      \"fixtures\"\n    ],\n    \"coverageReporters\": [\n      \"html\",\n      \"lcov\",\n      \"text\"\n    ]\n  },\n  \"dependencies\": {\n    \"commander\": \"^11.1.0\",\n    \"css-select\": \"^5.1.0\",\n    \"css-tree\": \"^3.0.1\",\n    \"css-what\": \"^6.1.0\",\n    \"csso\": \"^5.0.5\",\n    \"picocolors\": \"^1.1.1\",\n    \"sax\": \"^1.5.0\"\n  },\n  \"devDependencies\": {\n    \"@eslint/js\": \"^9.25.1\",\n    \"@jest/globals\": \"^29.7.0\",\n    \"@rollup/plugin-commonjs\": \"^26.0.3\",\n    \"@rollup/plugin-node-resolve\": \"^15.2.3\",\n    \"@rollup/plugin-terser\": \"^0.4.4\",\n    \"@types/css-tree\": \"^2.3.10\",\n    \"@types/csso\": \"^5.0.4\",\n    \"@types/jest\": \"^29.5.14\",\n    \"@types/node\": \"^22.15.3\",\n    \"@types/pngjs\": \"^6.0.5\",\n    \"@types/sax\": \"^1.2.7\",\n    \"@types/tar-stream\": \"^3.1.3\",\n    \"cross-env\": \"^7.0.3\",\n    \"cspell\": \"^9.2.2\",\n    \"eslint\": \"^9.25.1\",\n    \"globals\": \"^14.0.0\",\n    \"jest\": \"^29.7.0\",\n    \"pixelmatch\": \"^7.1.0\",\n    \"playwright\": \"1.53.2\",\n    \"pngjs\": \"^7.0.0\",\n    \"prettier\": \"^3.5.3\",\n    \"rimraf\": \"^5.0.10\",\n    \"rollup\": \"^4.22.4\",\n    \"tar-stream\": \"^3.1.7\",\n    \"tsd\": \"^0.32.0\",\n    \"typescript\": \"^5.8.3\"\n  },\n  \"resolutions\": {\n    \"sax@^1.5.0\": \"patch:sax@npm%3A1.5.0#./.yarn/patches/sax-npm-1.5.0-d40bca2226.patch\"\n  }\n}\n"
  },
  {
    "path": "plugins/_collections.js",
    "content": "/**\n * @fileoverview Based on https://www.w3.org/TR/SVG11/intro.html#Definitions.\n */\n\n/**\n * @type {Readonly<Record<string, Set<string>>>}\n */\nexport const elemsGroups = {\n  animation: new Set([\n    'animate',\n    'animateColor',\n    'animateMotion',\n    'animateTransform',\n    'set',\n  ]),\n  descriptive: new Set(['desc', 'metadata', 'title']),\n  shape: new Set([\n    'circle',\n    'ellipse',\n    'line',\n    'path',\n    'polygon',\n    'polyline',\n    'rect',\n  ]),\n  structural: new Set(['defs', 'g', 'svg', 'symbol', 'use']),\n  paintServer: new Set([\n    'hatch',\n    'linearGradient',\n    'meshGradient',\n    'pattern',\n    'radialGradient',\n    'solidColor',\n  ]),\n  nonRendering: new Set([\n    'clipPath',\n    'filter',\n    'linearGradient',\n    'marker',\n    'mask',\n    'pattern',\n    'radialGradient',\n    'solidColor',\n    'symbol',\n  ]),\n  container: new Set([\n    'a',\n    'defs',\n    'foreignObject',\n    'g',\n    'marker',\n    'mask',\n    'missing-glyph',\n    'pattern',\n    'svg',\n    'switch',\n    'symbol',\n  ]),\n  textContent: new Set([\n    'a',\n    'altGlyph',\n    'altGlyphDef',\n    'altGlyphItem',\n    'glyph',\n    'glyphRef',\n    'text',\n    'textPath',\n    'tref',\n    'tspan',\n  ]),\n  textContentChild: new Set(['altGlyph', 'textPath', 'tref', 'tspan']),\n  lightSource: new Set([\n    'feDiffuseLighting',\n    'feDistantLight',\n    'fePointLight',\n    'feSpecularLighting',\n    'feSpotLight',\n  ]),\n  filterPrimitive: new Set([\n    'feBlend',\n    'feColorMatrix',\n    'feComponentTransfer',\n    'feComposite',\n    'feConvolveMatrix',\n    'feDiffuseLighting',\n    'feDisplacementMap',\n    'feDropShadow',\n    'feFlood',\n    'feFuncA',\n    'feFuncB',\n    'feFuncG',\n    'feFuncR',\n    'feGaussianBlur',\n    'feImage',\n    'feMerge',\n    'feMergeNode',\n    'feMorphology',\n    'feOffset',\n    'feSpecularLighting',\n    'feTile',\n    'feTurbulence',\n  ]),\n};\n\n/**\n * Elements where adding or removing whitespace may affect rendering, metadata,\n * or semantic meaning.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre\n * @type {Readonly<Set<string>>}\n */\nexport const textElems = new Set([...elemsGroups.textContent, 'pre', 'title']);\n\n/**\n * @type {Readonly<Set<string>>}\n */\nexport const pathElems = new Set(['glyph', 'missing-glyph', 'path']);\n\n/**\n * @type {Readonly<Record<string, Set<string>>>}\n * @see https://www.w3.org/TR/SVG11/intro.html#Definitions\n */\nexport const attrsGroups = {\n  animationAddition: new Set(['additive', 'accumulate']),\n  animationAttributeTarget: new Set(['attributeType', 'attributeName']),\n  animationEvent: new Set(['onbegin', 'onend', 'onrepeat', 'onload']),\n  animationTiming: new Set([\n    'begin',\n    'dur',\n    'end',\n    'fill',\n    'max',\n    'min',\n    'repeatCount',\n    'repeatDur',\n    'restart',\n  ]),\n  animationValue: new Set([\n    'by',\n    'calcMode',\n    'from',\n    'keySplines',\n    'keyTimes',\n    'to',\n    'values',\n  ]),\n  conditionalProcessing: new Set([\n    'requiredExtensions',\n    'requiredFeatures',\n    'systemLanguage',\n  ]),\n  core: new Set(['id', 'tabindex', 'xml:base', 'xml:lang', 'xml:space']),\n  graphicalEvent: new Set([\n    'onactivate',\n    'onclick',\n    'onfocusin',\n    'onfocusout',\n    'onload',\n    'onmousedown',\n    'onmousemove',\n    'onmouseout',\n    'onmouseover',\n    'onmouseup',\n  ]),\n  presentation: new Set([\n    'alignment-baseline',\n    'baseline-shift',\n    'clip-path',\n    'clip-rule',\n    'clip',\n    'color-interpolation-filters',\n    'color-interpolation',\n    'color-profile',\n    'color-rendering',\n    'color',\n    'cursor',\n    'direction',\n    'display',\n    'dominant-baseline',\n    'enable-background',\n    'fill-opacity',\n    'fill-rule',\n    'fill',\n    'filter',\n    'flood-color',\n    'flood-opacity',\n    'font-family',\n    'font-size-adjust',\n    'font-size',\n    'font-stretch',\n    'font-style',\n    'font-variant',\n    'font-weight',\n    'glyph-orientation-horizontal',\n    'glyph-orientation-vertical',\n    'image-rendering',\n    'letter-spacing',\n    'lighting-color',\n    'marker-end',\n    'marker-mid',\n    'marker-start',\n    'mask',\n    'opacity',\n    'overflow',\n    'paint-order',\n    'pointer-events',\n    'shape-rendering',\n    'stop-color',\n    'stop-opacity',\n    'stroke-dasharray',\n    'stroke-dashoffset',\n    'stroke-linecap',\n    'stroke-linejoin',\n    'stroke-miterlimit',\n    'stroke-opacity',\n    'stroke-width',\n    'stroke',\n    'text-anchor',\n    'text-decoration',\n    'text-overflow',\n    'text-rendering',\n    'transform-origin',\n    'transform',\n    'unicode-bidi',\n    'vector-effect',\n    'visibility',\n    'word-spacing',\n    'writing-mode',\n  ]),\n  xlink: new Set([\n    'xlink:actuate',\n    'xlink:arcrole',\n    'xlink:href',\n    'xlink:role',\n    'xlink:show',\n    'xlink:title',\n    'xlink:type',\n  ]),\n  documentEvent: new Set([\n    'onabort',\n    'onerror',\n    'onresize',\n    'onscroll',\n    'onunload',\n    'onzoom',\n  ]),\n  documentElementEvent: new Set(['oncopy', 'oncut', 'onpaste']),\n  globalEvent: new Set([\n    'oncancel',\n    'oncanplay',\n    'oncanplaythrough',\n    'onchange',\n    'onclick',\n    'onclose',\n    'oncuechange',\n    'ondblclick',\n    'ondrag',\n    'ondragend',\n    'ondragenter',\n    'ondragleave',\n    'ondragover',\n    'ondragstart',\n    'ondrop',\n    'ondurationchange',\n    'onemptied',\n    'onended',\n    'onerror',\n    'onfocus',\n    'oninput',\n    'oninvalid',\n    'onkeydown',\n    'onkeypress',\n    'onkeyup',\n    'onload',\n    'onloadeddata',\n    'onloadedmetadata',\n    'onloadstart',\n    'onmousedown',\n    'onmouseenter',\n    'onmouseleave',\n    'onmousemove',\n    'onmouseout',\n    'onmouseover',\n    'onmouseup',\n    'onmousewheel',\n    'onpause',\n    'onplay',\n    'onplaying',\n    'onprogress',\n    'onratechange',\n    'onreset',\n    'onresize',\n    'onscroll',\n    'onseeked',\n    'onseeking',\n    'onselect',\n    'onshow',\n    'onstalled',\n    'onsubmit',\n    'onsuspend',\n    'ontimeupdate',\n    'ontoggle',\n    'onvolumechange',\n    'onwaiting',\n  ]),\n  filterPrimitive: new Set(['x', 'y', 'width', 'height', 'result']),\n  transferFunction: new Set([\n    'amplitude',\n    'exponent',\n    'intercept',\n    'offset',\n    'slope',\n    'tableValues',\n    'type',\n  ]),\n};\n\n/**\n * @type {Readonly<Record<string, Record<string, string>>>}\n */\nexport const attrsGroupsDefaults = {\n  core: { 'xml:space': 'default' },\n  presentation: {\n    clip: 'auto',\n    'clip-path': 'none',\n    'clip-rule': 'nonzero',\n    mask: 'none',\n    opacity: '1',\n    'stop-color': '#000',\n    'stop-opacity': '1',\n    'fill-opacity': '1',\n    'fill-rule': 'nonzero',\n    fill: '#000',\n    stroke: 'none',\n    'stroke-width': '1',\n    'stroke-linecap': 'butt',\n    'stroke-linejoin': 'miter',\n    'stroke-miterlimit': '4',\n    'stroke-dasharray': 'none',\n    'stroke-dashoffset': '0',\n    'stroke-opacity': '1',\n    'paint-order': 'normal',\n    'vector-effect': 'none',\n    display: 'inline',\n    visibility: 'visible',\n    'marker-start': 'none',\n    'marker-mid': 'none',\n    'marker-end': 'none',\n    'color-interpolation': 'sRGB',\n    'color-interpolation-filters': 'linearRGB',\n    'color-rendering': 'auto',\n    'shape-rendering': 'auto',\n    'text-rendering': 'auto',\n    'image-rendering': 'auto',\n    'font-style': 'normal',\n    'font-variant': 'normal',\n    'font-weight': 'normal',\n    'font-stretch': 'normal',\n    'font-size': 'medium',\n    'font-size-adjust': 'none',\n    kerning: 'auto',\n    'letter-spacing': 'normal',\n    'word-spacing': 'normal',\n    'text-decoration': 'none',\n    'text-anchor': 'start',\n    'text-overflow': 'clip',\n    'writing-mode': 'lr-tb',\n    'glyph-orientation-vertical': 'auto',\n    'glyph-orientation-horizontal': '0deg',\n    direction: 'ltr',\n    'unicode-bidi': 'normal',\n    'dominant-baseline': 'auto',\n    'alignment-baseline': 'baseline',\n    'baseline-shift': 'baseline',\n  },\n  transferFunction: {\n    slope: '1',\n    intercept: '0',\n    amplitude: '1',\n    exponent: '1',\n    offset: '0',\n  },\n};\n\n/**\n * @type {Readonly<Record<string, { safe?: Set<string>; unsafe?: Set<string> }>>}\n * @see https://www.w3.org/TR/SVG11/intro.html#Definitions\n */\nexport const attrsGroupsDeprecated = {\n  animationAttributeTarget: { unsafe: new Set(['attributeType']) },\n  conditionalProcessing: { unsafe: new Set(['requiredFeatures']) },\n  core: { unsafe: new Set(['xml:base', 'xml:lang', 'xml:space']) },\n  presentation: {\n    unsafe: new Set([\n      'clip',\n      'color-profile',\n      'enable-background',\n      'glyph-orientation-horizontal',\n      'glyph-orientation-vertical',\n      'kerning',\n    ]),\n  },\n};\n\n/**\n * @type {Readonly<Record<string, {\n *   attrsGroups: Set<string>,\n *   attrs?: Set<string>,\n *   defaults?: Record<string, string>,\n *   deprecated?: {\n *     safe?: Set<string>,\n *     unsafe?: Set<string>,\n *   },\n *   contentGroups?: Set<string>,\n *   content?: Set<string>,\n * }>>}\n * @see https://www.w3.org/TR/SVG11/eltindex.html\n */\nexport const elems = {\n  a: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n      'xlink',\n    ]),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'style',\n      'target',\n      'transform',\n    ]),\n    defaults: {\n      target: '_self',\n    },\n    contentGroups: new Set([\n      'animation',\n      'descriptive',\n      'paintServer',\n      'shape',\n      'structural',\n    ]),\n    content: new Set([\n      'a',\n      'altGlyphDef',\n      'clipPath',\n      'color-profile',\n      'cursor',\n      'filter',\n      'font-face',\n      'font',\n      'foreignObject',\n      'image',\n      'marker',\n      'mask',\n      'pattern',\n      'script',\n      'style',\n      'switch',\n      'text',\n      'view',\n      // not spec compliant\n      'tspan',\n    ]),\n  },\n  altGlyph: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n      'xlink',\n    ]),\n    attrs: new Set([\n      'class',\n      'dx',\n      'dy',\n      'externalResourcesRequired',\n      'format',\n      'glyphRef',\n      'rotate',\n      'style',\n      'x',\n      'y',\n    ]),\n  },\n  altGlyphDef: {\n    attrsGroups: new Set(['core']),\n    content: new Set(['glyphRef']),\n  },\n  altGlyphItem: {\n    attrsGroups: new Set(['core']),\n    content: new Set(['glyphRef', 'altGlyphItem']),\n  },\n  animate: {\n    attrsGroups: new Set([\n      'animationAddition',\n      'animationAttributeTarget',\n      'animationEvent',\n      'animationTiming',\n      'animationValue',\n      'conditionalProcessing',\n      'core',\n      'presentation',\n      'xlink',\n    ]),\n    attrs: new Set(['externalResourcesRequired']),\n    contentGroups: new Set(['descriptive']),\n  },\n  animateColor: {\n    attrsGroups: new Set([\n      'animationAddition',\n      'animationAttributeTarget',\n      'animationEvent',\n      'animationTiming',\n      'animationValue',\n      'conditionalProcessing',\n      'core',\n      'presentation',\n      'xlink',\n    ]),\n    attrs: new Set(['externalResourcesRequired']),\n    contentGroups: new Set(['descriptive']),\n  },\n  animateMotion: {\n    attrsGroups: new Set([\n      'animationAddition',\n      'animationEvent',\n      'animationTiming',\n      'animationValue',\n      'conditionalProcessing',\n      'core',\n      'xlink',\n    ]),\n    attrs: new Set([\n      'externalResourcesRequired',\n      'keyPoints',\n      'origin',\n      'path',\n      'rotate',\n    ]),\n    defaults: {\n      rotate: '0',\n    },\n    contentGroups: new Set(['descriptive']),\n    content: new Set(['mpath']),\n  },\n  animateTransform: {\n    attrsGroups: new Set([\n      'animationAddition',\n      'animationAttributeTarget',\n      'animationEvent',\n      'animationTiming',\n      'animationValue',\n      'conditionalProcessing',\n      'core',\n      'xlink',\n    ]),\n    attrs: new Set(['externalResourcesRequired', 'type']),\n    contentGroups: new Set(['descriptive']),\n  },\n  circle: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n    ]),\n    attrs: new Set([\n      'class',\n      'cx',\n      'cy',\n      'externalResourcesRequired',\n      'r',\n      'style',\n      'transform',\n    ]),\n    defaults: {\n      cx: '0',\n      cy: '0',\n    },\n    contentGroups: new Set(['animation', 'descriptive']),\n  },\n  clipPath: {\n    attrsGroups: new Set(['conditionalProcessing', 'core', 'presentation']),\n    attrs: new Set([\n      'class',\n      'clipPathUnits',\n      'externalResourcesRequired',\n      'style',\n      'transform',\n    ]),\n    defaults: {\n      clipPathUnits: 'userSpaceOnUse',\n    },\n    contentGroups: new Set(['animation', 'descriptive', 'shape']),\n    content: new Set(['text', 'use']),\n  },\n  'color-profile': {\n    attrsGroups: new Set(['core', 'xlink']),\n    attrs: new Set(['local', 'name', 'rendering-intent']),\n    defaults: {\n      name: 'sRGB',\n      'rendering-intent': 'auto',\n    },\n    deprecated: { unsafe: new Set(['name']) },\n    contentGroups: new Set(['descriptive']),\n  },\n  cursor: {\n    attrsGroups: new Set(['core', 'conditionalProcessing', 'xlink']),\n    attrs: new Set(['externalResourcesRequired', 'x', 'y']),\n    defaults: {\n      x: '0',\n      y: '0',\n    },\n    contentGroups: new Set(['descriptive']),\n  },\n  defs: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n    ]),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'style',\n      'transform',\n    ]),\n    contentGroups: new Set([\n      'animation',\n      'descriptive',\n      'paintServer',\n      'shape',\n      'structural',\n    ]),\n    content: new Set([\n      'a',\n      'altGlyphDef',\n      'clipPath',\n      'color-profile',\n      'cursor',\n      'filter',\n      'font-face',\n      'font',\n      'foreignObject',\n      'image',\n      'marker',\n      'mask',\n      'pattern',\n      'script',\n      'style',\n      'switch',\n      'text',\n      'view',\n    ]),\n  },\n  desc: {\n    attrsGroups: new Set(['core']),\n    attrs: new Set(['class', 'style']),\n  },\n  ellipse: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n    ]),\n    attrs: new Set([\n      'class',\n      'cx',\n      'cy',\n      'externalResourcesRequired',\n      'rx',\n      'ry',\n      'style',\n      'transform',\n    ]),\n    defaults: {\n      cx: '0',\n      cy: '0',\n    },\n    contentGroups: new Set(['animation', 'descriptive']),\n  },\n  feBlend: {\n    attrsGroups: new Set(['core', 'presentation', 'filterPrimitive']),\n    attrs: new Set([\n      'class',\n      'style',\n      // TODO: in - 'If no value is provided and this is the first filter primitive,\n      // then this filter primitive will use SourceGraphic as its input'\n      'in',\n      'in2',\n      'mode',\n    ]),\n    defaults: {\n      mode: 'normal',\n    },\n    content: new Set(['animate', 'set']),\n  },\n  feColorMatrix: {\n    attrsGroups: new Set(['core', 'presentation', 'filterPrimitive']),\n    attrs: new Set(['class', 'style', 'in', 'type', 'values']),\n    defaults: {\n      type: 'matrix',\n    },\n    content: new Set(['animate', 'set']),\n  },\n  feComponentTransfer: {\n    attrsGroups: new Set(['core', 'presentation', 'filterPrimitive']),\n    attrs: new Set(['class', 'style', 'in']),\n    content: new Set(['feFuncA', 'feFuncB', 'feFuncG', 'feFuncR']),\n  },\n  feComposite: {\n    attrsGroups: new Set(['core', 'presentation', 'filterPrimitive']),\n    attrs: new Set([\n      'class',\n      'in',\n      'in2',\n      'k1',\n      'k2',\n      'k3',\n      'k4',\n      'operator',\n      'style',\n    ]),\n    defaults: {\n      operator: 'over',\n      k1: '0',\n      k2: '0',\n      k3: '0',\n      k4: '0',\n    },\n    content: new Set(['animate', 'set']),\n  },\n  feConvolveMatrix: {\n    attrsGroups: new Set(['core', 'presentation', 'filterPrimitive']),\n    attrs: new Set([\n      'class',\n      'in',\n      'kernelMatrix',\n      'order',\n      'style',\n      // TODO: divisor - 'The default value is the sum of all values in kernelMatrix,\n      // with the exception that if the sum is zero, then the divisor is set to 1'\n      'bias',\n      'divisor',\n      // TODO: targetX - 'By default, the convolution matrix is centered in X over each\n      // pixel of the input image (i.e., targetX = floor ( orderX / 2 ))'\n      'edgeMode',\n      'targetX',\n      'targetY',\n      // TODO: kernelUnitLength - 'The first number is the <dx> value. The second number\n      // is the <dy> value. If the <dy> value is not specified, it defaults to the same value as <dx>'\n      'kernelUnitLength',\n      'preserveAlpha',\n    ]),\n    defaults: {\n      order: '3',\n      bias: '0',\n      edgeMode: 'duplicate',\n      preserveAlpha: 'false',\n    },\n    content: new Set(['animate', 'set']),\n  },\n  feDiffuseLighting: {\n    attrsGroups: new Set(['core', 'presentation', 'filterPrimitive']),\n    attrs: new Set([\n      'class',\n      'diffuseConstant',\n      'in',\n      'kernelUnitLength',\n      'style',\n      'surfaceScale',\n    ]),\n    defaults: {\n      surfaceScale: '1',\n      diffuseConstant: '1',\n    },\n    contentGroups: new Set(['descriptive']),\n    content: new Set([\n      // TODO: 'exactly one light source element, in any order'\n      'feDistantLight',\n      'fePointLight',\n      'feSpotLight',\n    ]),\n  },\n  feDisplacementMap: {\n    attrsGroups: new Set(['core', 'presentation', 'filterPrimitive']),\n    attrs: new Set([\n      'class',\n      'in',\n      'in2',\n      'scale',\n      'style',\n      'xChannelSelector',\n      'yChannelSelector',\n    ]),\n    defaults: {\n      scale: '0',\n      xChannelSelector: 'A',\n      yChannelSelector: 'A',\n    },\n    content: new Set(['animate', 'set']),\n  },\n  feDistantLight: {\n    attrsGroups: new Set(['core']),\n    attrs: new Set(['azimuth', 'elevation']),\n    defaults: {\n      azimuth: '0',\n      elevation: '0',\n    },\n    content: new Set(['animate', 'set']),\n  },\n  feFlood: {\n    attrsGroups: new Set(['core', 'presentation', 'filterPrimitive']),\n    attrs: new Set(['class', 'style']),\n    content: new Set(['animate', 'animateColor', 'set']),\n  },\n  feFuncA: {\n    attrsGroups: new Set(['core', 'transferFunction']),\n    content: new Set(['set', 'animate']),\n  },\n  feFuncB: {\n    attrsGroups: new Set(['core', 'transferFunction']),\n    content: new Set(['set', 'animate']),\n  },\n  feFuncG: {\n    attrsGroups: new Set(['core', 'transferFunction']),\n    content: new Set(['set', 'animate']),\n  },\n  feFuncR: {\n    attrsGroups: new Set(['core', 'transferFunction']),\n    content: new Set(['set', 'animate']),\n  },\n  feGaussianBlur: {\n    attrsGroups: new Set(['core', 'presentation', 'filterPrimitive']),\n    attrs: new Set(['class', 'style', 'in', 'stdDeviation']),\n    defaults: {\n      stdDeviation: '0',\n    },\n    content: new Set(['set', 'animate']),\n  },\n  feImage: {\n    attrsGroups: new Set(['core', 'presentation', 'filterPrimitive', 'xlink']),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'href',\n      'preserveAspectRatio',\n      'style',\n      'xlink:href',\n    ]),\n    defaults: {\n      preserveAspectRatio: 'xMidYMid meet',\n    },\n    content: new Set(['animate', 'animateTransform', 'set']),\n  },\n  feMerge: {\n    attrsGroups: new Set(['core', 'presentation', 'filterPrimitive']),\n    attrs: new Set(['class', 'style']),\n    content: new Set(['feMergeNode']),\n  },\n  feMergeNode: {\n    attrsGroups: new Set(['core']),\n    attrs: new Set(['in']),\n    content: new Set(['animate', 'set']),\n  },\n  feMorphology: {\n    attrsGroups: new Set(['core', 'presentation', 'filterPrimitive']),\n    attrs: new Set(['class', 'style', 'in', 'operator', 'radius']),\n    defaults: {\n      operator: 'erode',\n      radius: '0',\n    },\n    content: new Set(['animate', 'set']),\n  },\n  feOffset: {\n    attrsGroups: new Set(['core', 'presentation', 'filterPrimitive']),\n    attrs: new Set(['class', 'style', 'in', 'dx', 'dy']),\n    defaults: {\n      dx: '0',\n      dy: '0',\n    },\n    content: new Set(['animate', 'set']),\n  },\n  fePointLight: {\n    attrsGroups: new Set(['core']),\n    attrs: new Set(['x', 'y', 'z']),\n    defaults: {\n      x: '0',\n      y: '0',\n      z: '0',\n    },\n    content: new Set(['animate', 'set']),\n  },\n  feSpecularLighting: {\n    attrsGroups: new Set(['core', 'presentation', 'filterPrimitive']),\n    attrs: new Set([\n      'class',\n      'in',\n      'kernelUnitLength',\n      'specularConstant',\n      'specularExponent',\n      'style',\n      'surfaceScale',\n    ]),\n    defaults: {\n      surfaceScale: '1',\n      specularConstant: '1',\n      specularExponent: '1',\n    },\n    contentGroups: new Set([\n      'descriptive',\n      // TODO: exactly one 'light source element'\n      'lightSource',\n    ]),\n  },\n  feSpotLight: {\n    attrsGroups: new Set(['core']),\n    attrs: new Set([\n      'limitingConeAngle',\n      'pointsAtX',\n      'pointsAtY',\n      'pointsAtZ',\n      'specularExponent',\n      'x',\n      'y',\n      'z',\n    ]),\n    defaults: {\n      x: '0',\n      y: '0',\n      z: '0',\n      pointsAtX: '0',\n      pointsAtY: '0',\n      pointsAtZ: '0',\n      specularExponent: '1',\n    },\n    content: new Set(['animate', 'set']),\n  },\n  feTile: {\n    attrsGroups: new Set(['core', 'presentation', 'filterPrimitive']),\n    attrs: new Set(['class', 'style', 'in']),\n    content: new Set(['animate', 'set']),\n  },\n  feTurbulence: {\n    attrsGroups: new Set(['core', 'presentation', 'filterPrimitive']),\n    attrs: new Set([\n      'baseFrequency',\n      'class',\n      'numOctaves',\n      'seed',\n      'stitchTiles',\n      'style',\n      'type',\n    ]),\n    defaults: {\n      baseFrequency: '0',\n      numOctaves: '1',\n      seed: '0',\n      stitchTiles: 'noStitch',\n      type: 'turbulence',\n    },\n    content: new Set(['animate', 'set']),\n  },\n  filter: {\n    attrsGroups: new Set(['core', 'presentation', 'xlink']),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'filterRes',\n      'filterUnits',\n      'height',\n      'href',\n      'primitiveUnits',\n      'style',\n      'width',\n      'x',\n      'xlink:href',\n      'y',\n    ]),\n    defaults: {\n      primitiveUnits: 'userSpaceOnUse',\n      x: '-10%',\n      y: '-10%',\n      width: '120%',\n      height: '120%',\n    },\n    deprecated: { unsafe: new Set(['filterRes']) },\n    contentGroups: new Set(['descriptive', 'filterPrimitive']),\n    content: new Set(['animate', 'set']),\n  },\n  font: {\n    attrsGroups: new Set(['core', 'presentation']),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'horiz-adv-x',\n      'horiz-origin-x',\n      'horiz-origin-y',\n      'style',\n      'vert-adv-y',\n      'vert-origin-x',\n      'vert-origin-y',\n    ]),\n    defaults: {\n      'horiz-origin-x': '0',\n      'horiz-origin-y': '0',\n    },\n    deprecated: {\n      unsafe: new Set([\n        'horiz-origin-x',\n        'horiz-origin-y',\n        'vert-adv-y',\n        'vert-origin-x',\n        'vert-origin-y',\n      ]),\n    },\n    contentGroups: new Set(['descriptive']),\n    content: new Set(['font-face', 'glyph', 'hkern', 'missing-glyph', 'vkern']),\n  },\n  'font-face': {\n    attrsGroups: new Set(['core']),\n    attrs: new Set([\n      'font-family',\n      'font-style',\n      'font-variant',\n      'font-weight',\n      'font-stretch',\n      'font-size',\n      'unicode-range',\n      'units-per-em',\n      'panose-1',\n      'stemv',\n      'stemh',\n      'slope',\n      'cap-height',\n      'x-height',\n      'accent-height',\n      'ascent',\n      'descent',\n      'widths',\n      'bbox',\n      'ideographic',\n      'alphabetic',\n      'mathematical',\n      'hanging',\n      'v-ideographic',\n      'v-alphabetic',\n      'v-mathematical',\n      'v-hanging',\n      'underline-position',\n      'underline-thickness',\n      'strikethrough-position',\n      'strikethrough-thickness',\n      'overline-position',\n      'overline-thickness',\n    ]),\n    defaults: {\n      'font-style': 'all',\n      'font-variant': 'normal',\n      'font-weight': 'all',\n      'font-stretch': 'normal',\n      'unicode-range': 'U+0-10FFFF',\n      'units-per-em': '1000',\n      'panose-1': '0 0 0 0 0 0 0 0 0 0',\n      slope: '0',\n    },\n    deprecated: {\n      unsafe: new Set([\n        'accent-height',\n        'alphabetic',\n        'ascent',\n        'bbox',\n        'cap-height',\n        'descent',\n        'hanging',\n        'ideographic',\n        'mathematical',\n        'panose-1',\n        'slope',\n        'stemh',\n        'stemv',\n        'unicode-range',\n        'units-per-em',\n        'v-alphabetic',\n        'v-hanging',\n        'v-ideographic',\n        'v-mathematical',\n        'widths',\n        'x-height',\n      ]),\n    },\n    contentGroups: new Set(['descriptive']),\n    content: new Set([\n      // TODO: \"at most one 'font-face-src' element\"\n      'font-face-src',\n    ]),\n  },\n  // TODO: empty content\n  'font-face-format': {\n    attrsGroups: new Set(['core']),\n    attrs: new Set(['string']),\n    deprecated: { unsafe: new Set(['string']) },\n  },\n  'font-face-name': {\n    attrsGroups: new Set(['core']),\n    attrs: new Set(['name']),\n    deprecated: { unsafe: new Set(['name']) },\n  },\n  'font-face-src': {\n    attrsGroups: new Set(['core']),\n    content: new Set(['font-face-name', 'font-face-uri']),\n  },\n  'font-face-uri': {\n    attrsGroups: new Set(['core', 'xlink']),\n    attrs: new Set(['href', 'xlink:href']),\n    content: new Set(['font-face-format']),\n  },\n  foreignObject: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n    ]),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'height',\n      'style',\n      'transform',\n      'width',\n      'x',\n      'y',\n    ]),\n    defaults: {\n      x: '0',\n      y: '0',\n    },\n  },\n  g: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n    ]),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'style',\n      'transform',\n    ]),\n    contentGroups: new Set([\n      'animation',\n      'descriptive',\n      'paintServer',\n      'shape',\n      'structural',\n    ]),\n    content: new Set([\n      'a',\n      'altGlyphDef',\n      'clipPath',\n      'color-profile',\n      'cursor',\n      'filter',\n      'font-face',\n      'font',\n      'foreignObject',\n      'image',\n      'marker',\n      'mask',\n      'pattern',\n      'script',\n      'style',\n      'switch',\n      'text',\n      'view',\n    ]),\n  },\n  glyph: {\n    attrsGroups: new Set(['core', 'presentation']),\n    attrs: new Set([\n      'arabic-form',\n      'class',\n      'd',\n      'glyph-name',\n      'horiz-adv-x',\n      'lang',\n      'orientation',\n      'style',\n      'unicode',\n      'vert-adv-y',\n      'vert-origin-x',\n      'vert-origin-y',\n    ]),\n    defaults: {\n      'arabic-form': 'initial',\n    },\n    deprecated: {\n      unsafe: new Set([\n        'arabic-form',\n        'glyph-name',\n        'horiz-adv-x',\n        'orientation',\n        'unicode',\n        'vert-adv-y',\n        'vert-origin-x',\n        'vert-origin-y',\n      ]),\n    },\n    contentGroups: new Set([\n      'animation',\n      'descriptive',\n      'paintServer',\n      'shape',\n      'structural',\n    ]),\n    content: new Set([\n      'a',\n      'altGlyphDef',\n      'clipPath',\n      'color-profile',\n      'cursor',\n      'filter',\n      'font-face',\n      'font',\n      'foreignObject',\n      'image',\n      'marker',\n      'mask',\n      'pattern',\n      'script',\n      'style',\n      'switch',\n      'text',\n      'view',\n    ]),\n  },\n  glyphRef: {\n    attrsGroups: new Set(['core', 'presentation']),\n    attrs: new Set([\n      'class',\n      'd',\n      'horiz-adv-x',\n      'style',\n      'vert-adv-y',\n      'vert-origin-x',\n      'vert-origin-y',\n    ]),\n    deprecated: {\n      unsafe: new Set([\n        'horiz-adv-x',\n        'vert-adv-y',\n        'vert-origin-x',\n        'vert-origin-y',\n      ]),\n    },\n    contentGroups: new Set([\n      'animation',\n      'descriptive',\n      'paintServer',\n      'shape',\n      'structural',\n    ]),\n    content: new Set([\n      'a',\n      'altGlyphDef',\n      'clipPath',\n      'color-profile',\n      'cursor',\n      'filter',\n      'font-face',\n      'font',\n      'foreignObject',\n      'image',\n      'marker',\n      'mask',\n      'pattern',\n      'script',\n      'style',\n      'switch',\n      'text',\n      'view',\n    ]),\n  },\n  hatch: {\n    attrsGroups: new Set(['core', 'presentation', 'xlink']),\n    attrs: new Set([\n      'class',\n      'hatchContentUnits',\n      'hatchUnits',\n      'pitch',\n      'rotate',\n      'style',\n      'transform',\n      'x',\n      'y',\n    ]),\n    defaults: {\n      hatchUnits: 'objectBoundingBox',\n      hatchContentUnits: 'userSpaceOnUse',\n      x: '0',\n      y: '0',\n      pitch: '0',\n      rotate: '0',\n    },\n    contentGroups: new Set(['animation', 'descriptive']),\n    content: new Set(['hatchPath']),\n  },\n  hatchPath: {\n    attrsGroups: new Set(['core', 'presentation', 'xlink']),\n    attrs: new Set(['class', 'style', 'd', 'offset']),\n    defaults: {\n      offset: '0',\n    },\n    contentGroups: new Set(['animation', 'descriptive']),\n  },\n  hkern: {\n    attrsGroups: new Set(['core']),\n    attrs: new Set(['u1', 'g1', 'u2', 'g2', 'k']),\n    deprecated: { unsafe: new Set(['g1', 'g2', 'k', 'u1', 'u2']) },\n  },\n  image: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n      'xlink',\n    ]),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'height',\n      'href',\n      'preserveAspectRatio',\n      'style',\n      'transform',\n      'width',\n      'x',\n      'xlink:href',\n      'y',\n    ]),\n    defaults: {\n      x: '0',\n      y: '0',\n      preserveAspectRatio: 'xMidYMid meet',\n    },\n    contentGroups: new Set(['animation', 'descriptive']),\n  },\n  line: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n    ]),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'style',\n      'transform',\n      'x1',\n      'x2',\n      'y1',\n      'y2',\n    ]),\n    defaults: {\n      x1: '0',\n      y1: '0',\n      x2: '0',\n      y2: '0',\n    },\n    contentGroups: new Set(['animation', 'descriptive']),\n  },\n  linearGradient: {\n    attrsGroups: new Set(['core', 'presentation', 'xlink']),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'gradientTransform',\n      'gradientUnits',\n      'href',\n      'spreadMethod',\n      'style',\n      'x1',\n      'x2',\n      'xlink:href',\n      'y1',\n      'y2',\n    ]),\n    defaults: {\n      x1: '0',\n      y1: '0',\n      x2: '100%',\n      y2: '0',\n      spreadMethod: 'pad',\n    },\n    contentGroups: new Set(['descriptive']),\n    content: new Set(['animate', 'animateTransform', 'set', 'stop']),\n  },\n  marker: {\n    attrsGroups: new Set(['core', 'presentation']),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'markerHeight',\n      'markerUnits',\n      'markerWidth',\n      'orient',\n      'preserveAspectRatio',\n      'refX',\n      'refY',\n      'style',\n      'viewBox',\n    ]),\n    defaults: {\n      markerUnits: 'strokeWidth',\n      refX: '0',\n      refY: '0',\n      markerWidth: '3',\n      markerHeight: '3',\n    },\n    contentGroups: new Set([\n      'animation',\n      'descriptive',\n      'paintServer',\n      'shape',\n      'structural',\n    ]),\n    content: new Set([\n      'a',\n      'altGlyphDef',\n      'clipPath',\n      'color-profile',\n      'cursor',\n      'filter',\n      'font-face',\n      'font',\n      'foreignObject',\n      'image',\n      'marker',\n      'mask',\n      'pattern',\n      'script',\n      'style',\n      'switch',\n      'text',\n      'view',\n    ]),\n  },\n  mask: {\n    attrsGroups: new Set(['conditionalProcessing', 'core', 'presentation']),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'height',\n      'mask-type',\n      'maskContentUnits',\n      'maskUnits',\n      'style',\n      'width',\n      'x',\n      'y',\n    ]),\n    defaults: {\n      maskUnits: 'objectBoundingBox',\n      maskContentUnits: 'userSpaceOnUse',\n      x: '-10%',\n      y: '-10%',\n      width: '120%',\n      height: '120%',\n    },\n    contentGroups: new Set([\n      'animation',\n      'descriptive',\n      'paintServer',\n      'shape',\n      'structural',\n    ]),\n    content: new Set([\n      'a',\n      'altGlyphDef',\n      'clipPath',\n      'color-profile',\n      'cursor',\n      'filter',\n      'font-face',\n      'font',\n      'foreignObject',\n      'image',\n      'marker',\n      'mask',\n      'pattern',\n      'script',\n      'style',\n      'switch',\n      'text',\n      'view',\n    ]),\n  },\n  metadata: {\n    attrsGroups: new Set(['core']),\n  },\n  'missing-glyph': {\n    attrsGroups: new Set(['core', 'presentation']),\n    attrs: new Set([\n      'class',\n      'd',\n      'horiz-adv-x',\n      'style',\n      'vert-adv-y',\n      'vert-origin-x',\n      'vert-origin-y',\n    ]),\n    deprecated: {\n      unsafe: new Set([\n        'horiz-adv-x',\n        'vert-adv-y',\n        'vert-origin-x',\n        'vert-origin-y',\n      ]),\n    },\n    contentGroups: new Set([\n      'animation',\n      'descriptive',\n      'paintServer',\n      'shape',\n      'structural',\n    ]),\n    content: new Set([\n      'a',\n      'altGlyphDef',\n      'clipPath',\n      'color-profile',\n      'cursor',\n      'filter',\n      'font-face',\n      'font',\n      'foreignObject',\n      'image',\n      'marker',\n      'mask',\n      'pattern',\n      'script',\n      'style',\n      'switch',\n      'text',\n      'view',\n    ]),\n  },\n  mpath: {\n    attrsGroups: new Set(['core', 'xlink']),\n    attrs: new Set(['externalResourcesRequired', 'href', 'xlink:href']),\n    contentGroups: new Set(['descriptive']),\n  },\n  path: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n    ]),\n    attrs: new Set([\n      'class',\n      'd',\n      'externalResourcesRequired',\n      'pathLength',\n      'style',\n      'transform',\n    ]),\n    contentGroups: new Set(['animation', 'descriptive']),\n  },\n  pattern: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'presentation',\n      'xlink',\n    ]),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'height',\n      'href',\n      'patternContentUnits',\n      'patternTransform',\n      'patternUnits',\n      'preserveAspectRatio',\n      'style',\n      'viewBox',\n      'width',\n      'x',\n      'xlink:href',\n      'y',\n    ]),\n    defaults: {\n      patternUnits: 'objectBoundingBox',\n      patternContentUnits: 'userSpaceOnUse',\n      x: '0',\n      y: '0',\n      width: '0',\n      height: '0',\n      preserveAspectRatio: 'xMidYMid meet',\n    },\n    contentGroups: new Set([\n      'animation',\n      'descriptive',\n      'paintServer',\n      'shape',\n      'structural',\n    ]),\n    content: new Set([\n      'a',\n      'altGlyphDef',\n      'clipPath',\n      'color-profile',\n      'cursor',\n      'filter',\n      'font-face',\n      'font',\n      'foreignObject',\n      'image',\n      'marker',\n      'mask',\n      'pattern',\n      'script',\n      'style',\n      'switch',\n      'text',\n      'view',\n    ]),\n  },\n  polygon: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n    ]),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'points',\n      'style',\n      'transform',\n    ]),\n    contentGroups: new Set(['animation', 'descriptive']),\n  },\n  polyline: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n    ]),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'points',\n      'style',\n      'transform',\n    ]),\n    contentGroups: new Set(['animation', 'descriptive']),\n  },\n  radialGradient: {\n    attrsGroups: new Set(['core', 'presentation', 'xlink']),\n    attrs: new Set([\n      'class',\n      'cx',\n      'cy',\n      'externalResourcesRequired',\n      'fr',\n      'fx',\n      'fy',\n      'gradientTransform',\n      'gradientUnits',\n      'href',\n      'r',\n      'spreadMethod',\n      'style',\n      'xlink:href',\n    ]),\n    defaults: {\n      gradientUnits: 'objectBoundingBox',\n      cx: '50%',\n      cy: '50%',\n      r: '50%',\n    },\n    contentGroups: new Set(['descriptive']),\n    content: new Set(['animate', 'animateTransform', 'set', 'stop']),\n  },\n  meshGradient: {\n    attrsGroups: new Set(['core', 'presentation', 'xlink']),\n    attrs: new Set(['class', 'style', 'x', 'y', 'gradientUnits', 'transform']),\n    contentGroups: new Set(['descriptive', 'paintServer', 'animation']),\n    content: new Set(['meshRow']),\n  },\n  meshRow: {\n    attrsGroups: new Set(['core', 'presentation']),\n    attrs: new Set(['class', 'style']),\n    contentGroups: new Set(['descriptive']),\n    content: new Set(['meshPatch']),\n  },\n  meshPatch: {\n    attrsGroups: new Set(['core', 'presentation']),\n    attrs: new Set(['class', 'style']),\n    contentGroups: new Set(['descriptive']),\n    content: new Set(['stop']),\n  },\n  rect: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n    ]),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'height',\n      'rx',\n      'ry',\n      'style',\n      'transform',\n      'width',\n      'x',\n      'y',\n    ]),\n    defaults: {\n      x: '0',\n      y: '0',\n    },\n    contentGroups: new Set(['animation', 'descriptive']),\n  },\n  script: {\n    attrsGroups: new Set(['core', 'xlink']),\n    attrs: new Set(['externalResourcesRequired', 'type', 'href', 'xlink:href']),\n  },\n  set: {\n    attrsGroups: new Set([\n      'animation',\n      'animationAttributeTarget',\n      'animationTiming',\n      'conditionalProcessing',\n      'core',\n      'xlink',\n    ]),\n    attrs: new Set(['externalResourcesRequired', 'to']),\n    contentGroups: new Set(['descriptive']),\n  },\n  solidColor: {\n    attrsGroups: new Set(['core', 'presentation']),\n    attrs: new Set(['class', 'style']),\n    contentGroups: new Set(['paintServer']),\n  },\n  stop: {\n    attrsGroups: new Set(['core', 'presentation']),\n    attrs: new Set(['class', 'style', 'offset', 'path']),\n    content: new Set(['animate', 'animateColor', 'set']),\n  },\n  style: {\n    attrsGroups: new Set(['core']),\n    attrs: new Set(['type', 'media', 'title']),\n    defaults: {\n      type: 'text/css',\n    },\n  },\n  svg: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'documentEvent',\n      'graphicalEvent',\n      'presentation',\n    ]),\n    attrs: new Set([\n      'baseProfile',\n      'class',\n      'contentScriptType',\n      'contentStyleType',\n      'height',\n      'preserveAspectRatio',\n      'style',\n      'version',\n      'viewBox',\n      'width',\n      'x',\n      'y',\n      'zoomAndPan',\n    ]),\n    defaults: {\n      x: '0',\n      y: '0',\n      width: '100%',\n      height: '100%',\n      preserveAspectRatio: 'xMidYMid meet',\n      zoomAndPan: 'magnify',\n      version: '1.1',\n      baseProfile: 'none',\n      contentScriptType: 'application/ecmascript',\n      contentStyleType: 'text/css',\n    },\n    deprecated: {\n      safe: new Set(['version']),\n      unsafe: new Set([\n        'baseProfile',\n        'contentScriptType',\n        'contentStyleType',\n        'zoomAndPan',\n      ]),\n    },\n    contentGroups: new Set([\n      'animation',\n      'descriptive',\n      'paintServer',\n      'shape',\n      'structural',\n    ]),\n    content: new Set([\n      'a',\n      'altGlyphDef',\n      'clipPath',\n      'color-profile',\n      'cursor',\n      'filter',\n      'font-face',\n      'font',\n      'foreignObject',\n      'image',\n      'marker',\n      'mask',\n      'pattern',\n      'script',\n      'style',\n      'switch',\n      'text',\n      'view',\n    ]),\n  },\n  switch: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n    ]),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'style',\n      'transform',\n    ]),\n    contentGroups: new Set(['animation', 'descriptive', 'shape']),\n    content: new Set([\n      'a',\n      'foreignObject',\n      'g',\n      'image',\n      'svg',\n      'switch',\n      'text',\n      'use',\n    ]),\n  },\n  symbol: {\n    attrsGroups: new Set(['core', 'graphicalEvent', 'presentation']),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'preserveAspectRatio',\n      'refX',\n      'refY',\n      'style',\n      'viewBox',\n    ]),\n    defaults: {\n      refX: '0',\n      refY: '0',\n    },\n    contentGroups: new Set([\n      'animation',\n      'descriptive',\n      'paintServer',\n      'shape',\n      'structural',\n    ]),\n    content: new Set([\n      'a',\n      'altGlyphDef',\n      'clipPath',\n      'color-profile',\n      'cursor',\n      'filter',\n      'font-face',\n      'font',\n      'foreignObject',\n      'image',\n      'marker',\n      'mask',\n      'pattern',\n      'script',\n      'style',\n      'switch',\n      'text',\n      'view',\n    ]),\n  },\n  text: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n    ]),\n    attrs: new Set([\n      'class',\n      'dx',\n      'dy',\n      'externalResourcesRequired',\n      'lengthAdjust',\n      'rotate',\n      'style',\n      'textLength',\n      'transform',\n      'x',\n      'y',\n    ]),\n    defaults: {\n      x: '0',\n      y: '0',\n      lengthAdjust: 'spacing',\n    },\n    contentGroups: new Set(['animation', 'descriptive', 'textContentChild']),\n    content: new Set(['a']),\n  },\n  textPath: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n      'xlink',\n    ]),\n    attrs: new Set([\n      'class',\n      'd',\n      'externalResourcesRequired',\n      'href',\n      'method',\n      'spacing',\n      'startOffset',\n      'style',\n      'xlink:href',\n    ]),\n    defaults: {\n      startOffset: '0',\n      method: 'align',\n      spacing: 'exact',\n    },\n    contentGroups: new Set(['descriptive']),\n    content: new Set([\n      'a',\n      'altGlyph',\n      'animate',\n      'animateColor',\n      'set',\n      'tref',\n      'tspan',\n    ]),\n  },\n  title: {\n    attrsGroups: new Set(['core']),\n    attrs: new Set(['class', 'style']),\n  },\n  tref: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n      'xlink',\n    ]),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'href',\n      'style',\n      'xlink:href',\n    ]),\n    contentGroups: new Set(['descriptive']),\n    content: new Set(['animate', 'animateColor', 'set']),\n  },\n  tspan: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n    ]),\n    attrs: new Set([\n      'class',\n      'dx',\n      'dy',\n      'externalResourcesRequired',\n      'lengthAdjust',\n      'rotate',\n      'style',\n      'textLength',\n      'x',\n      'y',\n    ]),\n    contentGroups: new Set(['descriptive']),\n    content: new Set([\n      'a',\n      'altGlyph',\n      'animate',\n      'animateColor',\n      'set',\n      'tref',\n      'tspan',\n    ]),\n  },\n  use: {\n    attrsGroups: new Set([\n      'conditionalProcessing',\n      'core',\n      'graphicalEvent',\n      'presentation',\n      'xlink',\n    ]),\n    attrs: new Set([\n      'class',\n      'externalResourcesRequired',\n      'height',\n      'href',\n      'style',\n      'transform',\n      'width',\n      'x',\n      'xlink:href',\n      'y',\n    ]),\n    defaults: {\n      x: '0',\n      y: '0',\n    },\n    contentGroups: new Set(['animation', 'descriptive']),\n  },\n  view: {\n    attrsGroups: new Set(['core']),\n    attrs: new Set([\n      'externalResourcesRequired',\n      'preserveAspectRatio',\n      'viewBox',\n      'viewTarget',\n      'zoomAndPan',\n    ]),\n    deprecated: { unsafe: new Set(['viewTarget', 'zoomAndPan']) },\n    contentGroups: new Set(['descriptive']),\n  },\n  vkern: {\n    attrsGroups: new Set(['core']),\n    attrs: new Set(['u1', 'g1', 'u2', 'g2', 'k']),\n    deprecated: { unsafe: new Set(['g1', 'g2', 'k', 'u1', 'u2']) },\n  },\n};\n\n/**\n * @type {Readonly<Set<string>>}\n * @see https://wiki.inkscape.org/wiki/index.php/Inkscape-specific_XML_attributes\n */\nexport const editorNamespaces = new Set([\n  'http://creativecommons.org/ns#',\n  'http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd',\n  'http://krita.org/namespaces/svg/krita',\n  'http://ns.adobe.com/AdobeIllustrator/10.0/',\n  'http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/',\n  'http://ns.adobe.com/Extensibility/1.0/',\n  'http://ns.adobe.com/Flows/1.0/',\n  'http://ns.adobe.com/GenericCustomNamespace/1.0/',\n  'http://ns.adobe.com/Graphs/1.0/',\n  'http://ns.adobe.com/ImageReplacement/1.0/',\n  'http://ns.adobe.com/SaveForWeb/1.0/',\n  'http://ns.adobe.com/Variables/1.0/',\n  'http://ns.adobe.com/XPath/1.0/',\n  'http://purl.org/dc/elements/1.1/',\n  'http://schemas.microsoft.com/visio/2003/SVGExtensions/',\n  'http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd',\n  'http://taptrix.com/vectorillustrator/svg_extensions',\n  'http://www.bohemiancoding.com/sketch/ns',\n  'http://www.figma.com/figma/ns',\n  'http://www.inkscape.org/namespaces/inkscape',\n  'http://www.serif.com/',\n  'http://www.vector.evaxdesign.sk',\n  'http://www.w3.org/1999/02/22-rdf-syntax-ns#',\n  'https://boxy-svg.com',\n]);\n\n/**\n * @type {Readonly<Set<string>>}\n * @see https://www.w3.org/TR/SVG11/linking.html#processingIRI\n */\nexport const referencesProps = new Set([\n  'clip-path',\n  'color-profile',\n  'fill',\n  'filter',\n  'marker-end',\n  'marker-mid',\n  'marker-start',\n  'mask',\n  'stroke',\n  'style',\n]);\n\n/**\n * @type {Readonly<Set<string>>}\n * @see https://www.w3.org/TR/SVG11/propidx.html\n */\nexport const inheritableAttrs = new Set([\n  'clip-rule',\n  'color-interpolation-filters',\n  'color-interpolation',\n  'color-profile',\n  'color-rendering',\n  'color',\n  'cursor',\n  'direction',\n  'dominant-baseline',\n  'fill-opacity',\n  'fill-rule',\n  'fill',\n  'font-family',\n  'font-size-adjust',\n  'font-size',\n  'font-stretch',\n  'font-style',\n  'font-variant',\n  'font-weight',\n  'font',\n  'glyph-orientation-horizontal',\n  'glyph-orientation-vertical',\n  'image-rendering',\n  'letter-spacing',\n  'marker-end',\n  'marker-mid',\n  'marker-start',\n  'marker',\n  'paint-order',\n  'pointer-events',\n  'shape-rendering',\n  'stroke-dasharray',\n  'stroke-dashoffset',\n  'stroke-linecap',\n  'stroke-linejoin',\n  'stroke-miterlimit',\n  'stroke-opacity',\n  'stroke-width',\n  'stroke',\n  'text-anchor',\n  'text-rendering',\n  'transform',\n  'visibility',\n  'word-spacing',\n  'writing-mode',\n]);\n\n/**\n * @type {Readonly<Set<string>>}\n */\nexport const presentationNonInheritableGroupAttrs = new Set([\n  'clip-path',\n  'display',\n  'filter',\n  'mask',\n  'opacity',\n  'text-decoration',\n  'transform',\n  'unicode-bidi',\n]);\n\n/**\n * @type {Readonly<Record<string, string>>}\n * @see https://www.w3.org/TR/SVG11/single-page.html#types-ColorKeywords\n */\nexport const colorsNames = {\n  aliceblue: '#f0f8ff',\n  antiquewhite: '#faebd7',\n  aqua: '#0ff',\n  aquamarine: '#7fffd4',\n  azure: '#f0ffff',\n  beige: '#f5f5dc',\n  bisque: '#ffe4c4',\n  black: '#000',\n  blanchedalmond: '#ffebcd',\n  blue: '#00f',\n  blueviolet: '#8a2be2',\n  brown: '#a52a2a',\n  burlywood: '#deb887',\n  cadetblue: '#5f9ea0',\n  chartreuse: '#7fff00',\n  chocolate: '#d2691e',\n  coral: '#ff7f50',\n  cornflowerblue: '#6495ed',\n  cornsilk: '#fff8dc',\n  crimson: '#dc143c',\n  cyan: '#0ff',\n  darkblue: '#00008b',\n  darkcyan: '#008b8b',\n  darkgoldenrod: '#b8860b',\n  darkgray: '#a9a9a9',\n  darkgreen: '#006400',\n  darkgrey: '#a9a9a9',\n  darkkhaki: '#bdb76b',\n  darkmagenta: '#8b008b',\n  darkolivegreen: '#556b2f',\n  darkorange: '#ff8c00',\n  darkorchid: '#9932cc',\n  darkred: '#8b0000',\n  darksalmon: '#e9967a',\n  darkseagreen: '#8fbc8f',\n  darkslateblue: '#483d8b',\n  darkslategray: '#2f4f4f',\n  darkslategrey: '#2f4f4f',\n  darkturquoise: '#00ced1',\n  darkviolet: '#9400d3',\n  deeppink: '#ff1493',\n  deepskyblue: '#00bfff',\n  dimgray: '#696969',\n  dimgrey: '#696969',\n  dodgerblue: '#1e90ff',\n  firebrick: '#b22222',\n  floralwhite: '#fffaf0',\n  forestgreen: '#228b22',\n  fuchsia: '#f0f',\n  gainsboro: '#dcdcdc',\n  ghostwhite: '#f8f8ff',\n  gold: '#ffd700',\n  goldenrod: '#daa520',\n  gray: '#808080',\n  green: '#008000',\n  greenyellow: '#adff2f',\n  grey: '#808080',\n  honeydew: '#f0fff0',\n  hotpink: '#ff69b4',\n  indianred: '#cd5c5c',\n  indigo: '#4b0082',\n  ivory: '#fffff0',\n  khaki: '#f0e68c',\n  lavender: '#e6e6fa',\n  lavenderblush: '#fff0f5',\n  lawngreen: '#7cfc00',\n  lemonchiffon: '#fffacd',\n  lightblue: '#add8e6',\n  lightcoral: '#f08080',\n  lightcyan: '#e0ffff',\n  lightgoldenrodyellow: '#fafad2',\n  lightgray: '#d3d3d3',\n  lightgreen: '#90ee90',\n  lightgrey: '#d3d3d3',\n  lightpink: '#ffb6c1',\n  lightsalmon: '#ffa07a',\n  lightseagreen: '#20b2aa',\n  lightskyblue: '#87cefa',\n  lightslategray: '#789',\n  lightslategrey: '#789',\n  lightsteelblue: '#b0c4de',\n  lightyellow: '#ffffe0',\n  lime: '#0f0',\n  limegreen: '#32cd32',\n  linen: '#faf0e6',\n  magenta: '#f0f',\n  maroon: '#800000',\n  mediumaquamarine: '#66cdaa',\n  mediumblue: '#0000cd',\n  mediumorchid: '#ba55d3',\n  mediumpurple: '#9370db',\n  mediumseagreen: '#3cb371',\n  mediumslateblue: '#7b68ee',\n  mediumspringgreen: '#00fa9a',\n  mediumturquoise: '#48d1cc',\n  mediumvioletred: '#c71585',\n  midnightblue: '#191970',\n  mintcream: '#f5fffa',\n  mistyrose: '#ffe4e1',\n  moccasin: '#ffe4b5',\n  navajowhite: '#ffdead',\n  navy: '#000080',\n  oldlace: '#fdf5e6',\n  olive: '#808000',\n  olivedrab: '#6b8e23',\n  orange: '#ffa500',\n  orangered: '#ff4500',\n  orchid: '#da70d6',\n  palegoldenrod: '#eee8aa',\n  palegreen: '#98fb98',\n  paleturquoise: '#afeeee',\n  palevioletred: '#db7093',\n  papayawhip: '#ffefd5',\n  peachpuff: '#ffdab9',\n  peru: '#cd853f',\n  pink: '#ffc0cb',\n  plum: '#dda0dd',\n  powderblue: '#b0e0e6',\n  purple: '#800080',\n  rebeccapurple: '#639',\n  red: '#f00',\n  rosybrown: '#bc8f8f',\n  royalblue: '#4169e1',\n  saddlebrown: '#8b4513',\n  salmon: '#fa8072',\n  sandybrown: '#f4a460',\n  seagreen: '#2e8b57',\n  seashell: '#fff5ee',\n  sienna: '#a0522d',\n  silver: '#c0c0c0',\n  skyblue: '#87ceeb',\n  slateblue: '#6a5acd',\n  slategray: '#708090',\n  slategrey: '#708090',\n  snow: '#fffafa',\n  springgreen: '#00ff7f',\n  steelblue: '#4682b4',\n  tan: '#d2b48c',\n  teal: '#008080',\n  thistle: '#d8bfd8',\n  tomato: '#ff6347',\n  turquoise: '#40e0d0',\n  violet: '#ee82ee',\n  wheat: '#f5deb3',\n  white: '#fff',\n  whitesmoke: '#f5f5f5',\n  yellow: '#ff0',\n  yellowgreen: '#9acd32',\n};\n\n/**\n * @type {Readonly<Record<string, string>>}\n */\nexport const colorsShortNames = {\n  '#f0ffff': 'azure',\n  '#f5f5dc': 'beige',\n  '#ffe4c4': 'bisque',\n  '#a52a2a': 'brown',\n  '#ff7f50': 'coral',\n  '#ffd700': 'gold',\n  '#808080': 'gray',\n  '#008000': 'green',\n  '#4b0082': 'indigo',\n  '#fffff0': 'ivory',\n  '#f0e68c': 'khaki',\n  '#faf0e6': 'linen',\n  '#800000': 'maroon',\n  '#000080': 'navy',\n  '#808000': 'olive',\n  '#ffa500': 'orange',\n  '#da70d6': 'orchid',\n  '#cd853f': 'peru',\n  '#ffc0cb': 'pink',\n  '#dda0dd': 'plum',\n  '#800080': 'purple',\n  '#f00': 'red',\n  '#ff0000': 'red',\n  '#fa8072': 'salmon',\n  '#a0522d': 'sienna',\n  '#c0c0c0': 'silver',\n  '#fffafa': 'snow',\n  '#d2b48c': 'tan',\n  '#008080': 'teal',\n  '#ff6347': 'tomato',\n  '#ee82ee': 'violet',\n  '#f5deb3': 'wheat',\n};\n\n/**\n * @type {Readonly<Set<string>>}\n * @see https://www.w3.org/TR/SVG11/single-page.html#types-DataTypeColor\n */\nexport const colorsProps = new Set([\n  'color',\n  'fill',\n  'flood-color',\n  'lighting-color',\n  'stop-color',\n  'stroke',\n]);\n\n/**\n * @type {Readonly<Record<string, Set<string>>>}\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes\n */\nexport const pseudoClasses = {\n  displayState: new Set(['fullscreen', 'modal', 'picture-in-picture']),\n  input: new Set([\n    'autofill',\n    'blank',\n    'checked',\n    'default',\n    'disabled',\n    'enabled',\n    'in-range',\n    'indeterminate',\n    'invalid',\n    'optional',\n    'out-of-range',\n    'placeholder-shown',\n    'read-only',\n    'read-write',\n    'required',\n    'user-invalid',\n    'valid',\n  ]),\n  linguistic: new Set(['dir', 'lang']),\n  location: new Set([\n    'any-link',\n    'link',\n    'local-link',\n    'scope',\n    'target-within',\n    'target',\n    'visited',\n  ]),\n  resourceState: new Set(['playing', 'paused']),\n  timeDimensional: new Set(['current', 'past', 'future']),\n  treeStructural: new Set([\n    'empty',\n    'first-child',\n    'first-of-type',\n    'last-child',\n    'last-of-type',\n    'nth-child',\n    'nth-last-child',\n    'nth-last-of-type',\n    'nth-of-type',\n    'only-child',\n    'only-of-type',\n    'root',\n  ]),\n  userAction: new Set([\n    'active',\n    'focus-visible',\n    'focus-within',\n    'focus',\n    'hover',\n  ]),\n  functional: new Set(['is', 'not', 'where', 'has']),\n};\n"
  },
  {
    "path": "plugins/_path.js",
    "content": "import { parsePathData, stringifyPathData } from '../lib/path.js';\n\n/**\n * @typedef Js2PathParams\n * @property {number=} floatPrecision\n * @property {boolean=} noSpaceAfterFlags\n *\n * @typedef Point\n * @property {number[][]} list\n * @property {number} minX\n * @property {number} minY\n * @property {number} maxX\n * @property {number} maxY\n *\n * @typedef Points\n * @property {Point[]} list\n * @property {number} minX\n * @property {number} minY\n * @property {number} maxX\n * @property {number} maxY\n */\n\n/** @type {[number, number]} */\nlet prevCtrlPoint;\n\n/**\n * Convert path string to JS representation.\n *\n * @param {import('../lib/types.js').XastElement} path\n * @returns {import('../lib/types.js').PathDataItem[]}\n */\nexport const path2js = (path) => {\n  // @ts-expect-error legacy\n  if (path.pathJS) {\n    // @ts-expect-error legacy\n    return path.pathJS;\n  }\n  /** @type {import('../lib/types.js').PathDataItem[]} */\n  const pathData = []; // JS representation of the path data\n  const newPathData = parsePathData(path.attributes.d);\n  for (const { command, args } of newPathData) {\n    pathData.push({ command, args });\n  }\n  // First moveto is actually absolute. Subsequent coordinates were separated above.\n  if (pathData.length && pathData[0].command == 'm') {\n    pathData[0].command = 'M';\n  }\n  // @ts-expect-error legacy\n  path.pathJS = pathData;\n  return pathData;\n};\n\n/**\n * Convert relative Path data to absolute.\n *\n * @param {ReadonlyArray<import('../lib/types.js').PathDataItem>} data\n * @returns {import('../lib/types.js').PathDataItem[]}\n */\nconst convertRelativeToAbsolute = (data) => {\n  /** @type {import('../lib/types.js').PathDataItem[]} */\n  const newData = [];\n  const start = [0, 0];\n  const cursor = [0, 0];\n\n  for (let { command, args } of data) {\n    args = args.slice();\n\n    // moveto (x y)\n    if (command === 'm') {\n      args[0] += cursor[0];\n      args[1] += cursor[1];\n      command = 'M';\n    }\n    if (command === 'M') {\n      cursor[0] = args[0];\n      cursor[1] = args[1];\n      start[0] = cursor[0];\n      start[1] = cursor[1];\n    }\n\n    // horizontal lineto (x)\n    if (command === 'h') {\n      args[0] += cursor[0];\n      command = 'H';\n    }\n    if (command === 'H') {\n      cursor[0] = args[0];\n    }\n\n    // vertical lineto (y)\n    if (command === 'v') {\n      args[0] += cursor[1];\n      command = 'V';\n    }\n    if (command === 'V') {\n      cursor[1] = args[0];\n    }\n\n    // lineto (x y)\n    if (command === 'l') {\n      args[0] += cursor[0];\n      args[1] += cursor[1];\n      command = 'L';\n    }\n    if (command === 'L') {\n      cursor[0] = args[0];\n      cursor[1] = args[1];\n    }\n\n    // curveto (x1 y1 x2 y2 x y)\n    if (command === 'c') {\n      args[0] += cursor[0];\n      args[1] += cursor[1];\n      args[2] += cursor[0];\n      args[3] += cursor[1];\n      args[4] += cursor[0];\n      args[5] += cursor[1];\n      command = 'C';\n    }\n    if (command === 'C') {\n      cursor[0] = args[4];\n      cursor[1] = args[5];\n    }\n\n    // smooth curveto (x2 y2 x y)\n    if (command === 's') {\n      args[0] += cursor[0];\n      args[1] += cursor[1];\n      args[2] += cursor[0];\n      args[3] += cursor[1];\n      command = 'S';\n    }\n    if (command === 'S') {\n      cursor[0] = args[2];\n      cursor[1] = args[3];\n    }\n\n    // quadratic Bézier curveto (x1 y1 x y)\n    if (command === 'q') {\n      args[0] += cursor[0];\n      args[1] += cursor[1];\n      args[2] += cursor[0];\n      args[3] += cursor[1];\n      command = 'Q';\n    }\n    if (command === 'Q') {\n      cursor[0] = args[2];\n      cursor[1] = args[3];\n    }\n\n    // smooth quadratic Bézier curveto (x y)\n    if (command === 't') {\n      args[0] += cursor[0];\n      args[1] += cursor[1];\n      command = 'T';\n    }\n    if (command === 'T') {\n      cursor[0] = args[0];\n      cursor[1] = args[1];\n    }\n\n    // elliptical arc (rx ry x-axis-rotation large-arc-flag sweep-flag x y)\n    if (command === 'a') {\n      args[5] += cursor[0];\n      args[6] += cursor[1];\n      command = 'A';\n    }\n    if (command === 'A') {\n      cursor[0] = args[5];\n      cursor[1] = args[6];\n    }\n\n    // closepath\n    if (command === 'z' || command === 'Z') {\n      cursor[0] = start[0];\n      cursor[1] = start[1];\n      command = 'z';\n    }\n\n    newData.push({ command, args });\n  }\n  return newData;\n};\n\n/**\n * Convert path array to string.\n *\n * @param {import('../lib/types.js').XastElement} path\n * @param {ReadonlyArray<import('../lib/types.js').PathDataItem>} data\n * @param {Js2PathParams} params\n */\nexport const js2path = function (path, data, params) {\n  // @ts-expect-error legacy\n  path.pathJS = data;\n\n  const pathData = [];\n  for (const item of data) {\n    // remove moveto commands which are followed by moveto commands\n    if (\n      pathData.length !== 0 &&\n      (item.command === 'M' || item.command === 'm')\n    ) {\n      const last = pathData[pathData.length - 1];\n      if (last.command === 'M' || last.command === 'm') {\n        pathData.pop();\n      }\n    }\n    pathData.push({\n      command: item.command,\n      args: item.args,\n    });\n  }\n\n  path.attributes.d = stringifyPathData({\n    pathData,\n    precision: params.floatPrecision,\n    disableSpaceAfterFlags: params.noSpaceAfterFlags,\n  });\n};\n\n/**\n * @param {number[]} dest\n * @param {ReadonlyArray<number>} source\n * @returns {number[]}\n */\nfunction set(dest, source) {\n  dest[0] = source[source.length - 2];\n  dest[1] = source[source.length - 1];\n  return dest;\n}\n\n/**\n * Checks if two paths have an intersection by checking convex hulls\n * collision using Gilbert-Johnson-Keerthi distance algorithm\n * https://web.archive.org/web/20180822200027/http://entropyinteractive.com/2011/04/gjk-algorithm/\n *\n * @param {ReadonlyArray<import('../lib/types.js').PathDataItem>} path1\n * @param {ReadonlyArray<import('../lib/types.js').PathDataItem>} path2\n * @returns {boolean}\n */\nexport const intersects = function (path1, path2) {\n  // Collect points of every subpath.\n  const points1 = gatherPoints(convertRelativeToAbsolute(path1));\n  const points2 = gatherPoints(convertRelativeToAbsolute(path2));\n\n  // Axis-aligned bounding box check.\n  if (\n    points1.maxX <= points2.minX ||\n    points2.maxX <= points1.minX ||\n    points1.maxY <= points2.minY ||\n    points2.maxY <= points1.minY ||\n    points1.list.every((set1) => {\n      return points2.list.every((set2) => {\n        return (\n          set1.list[set1.maxX][0] <= set2.list[set2.minX][0] ||\n          set2.list[set2.maxX][0] <= set1.list[set1.minX][0] ||\n          set1.list[set1.maxY][1] <= set2.list[set2.minY][1] ||\n          set2.list[set2.maxY][1] <= set1.list[set1.minY][1]\n        );\n      });\n    })\n  ) {\n    return false;\n  }\n\n  // Get a convex hull from points of each subpath. Has the most complexity O(n·log n).\n  const hullNest1 = points1.list.map(convexHull);\n  const hullNest2 = points2.list.map(convexHull);\n\n  // Check intersection of every subpath of the first path with every subpath of the second.\n  return hullNest1.some(function (hull1) {\n    if (hull1.list.length < 3) {\n      return false;\n    }\n\n    return hullNest2.some(function (hull2) {\n      if (hull2.list.length < 3) {\n        return false;\n      }\n\n      const simplex = [getSupport(hull1, hull2, [1, 0])]; // create the initial simplex\n      const direction = minus(simplex[0]); // set the direction to point towards the origin\n\n      let iterations = 1e4; // infinite loop protection, 10 000 iterations is more than enough\n\n      while (true) {\n        if (iterations-- == 0) {\n          console.error(\n            'Error: infinite loop while processing mergePaths plugin.',\n          );\n          return true; // true is the safe value that means “do nothing with paths”\n        }\n        // add a new point\n        simplex.push(getSupport(hull1, hull2, direction));\n        // see if the new point was on the correct side of the origin\n        if (dot(direction, simplex[simplex.length - 1]) <= 0) {\n          return false;\n        }\n        // process the simplex\n        if (processSimplex(simplex, direction)) {\n          return true;\n        }\n      }\n    });\n  });\n\n  /**\n   * @param {Point} a\n   * @param {Point} b\n   * @param {ReadonlyArray<number>} direction\n   * @returns {number[]}\n   */\n  function getSupport(a, b, direction) {\n    return sub(supportPoint(a, direction), supportPoint(b, minus(direction)));\n  }\n\n  /**\n   * Computes farthest polygon point in particular direction. Thanks to\n   * knowledge of min/max x and y coordinates we can choose a quadrant to search\n   * in. Since we're working on convex hull, the dot product is increasing until\n   * we find the farthest point.\n   *\n   * @param {Point} polygon\n   * @param {ReadonlyArray<number>} direction\n   * @returns {number[]}\n   */\n  function supportPoint(polygon, direction) {\n    let index =\n      direction[1] >= 0\n        ? direction[0] < 0\n          ? polygon.maxY\n          : polygon.maxX\n        : direction[0] < 0\n          ? polygon.minX\n          : polygon.minY;\n    let max = -Infinity;\n    let value;\n    while ((value = dot(polygon.list[index], direction)) > max) {\n      max = value;\n      index = ++index % polygon.list.length;\n    }\n    return polygon.list[(index || polygon.list.length) - 1];\n  }\n};\n\n/**\n * @param {number[][]} simplex\n * @param {number[]} direction\n * @returns {boolean}\n */\nfunction processSimplex(simplex, direction) {\n  // we only need to handle to 1-simplex and 2-simplex\n  if (simplex.length == 2) {\n    // 1-simplex\n    const a = simplex[1];\n    const b = simplex[0];\n    const AO = minus(simplex[1]);\n    const AB = sub(b, a);\n    // AO is in the same direction as AB\n    if (dot(AO, AB) > 0) {\n      // get the vector perpendicular to AB facing O\n      set(direction, orth(AB, a));\n    } else {\n      set(direction, AO);\n      // only A remains in the simplex\n      simplex.shift();\n    }\n  } else {\n    // 2-simplex\n    const a = simplex[2]; // [a, b, c] = simplex\n    const b = simplex[1];\n    const c = simplex[0];\n    const AB = sub(b, a);\n    const AC = sub(c, a);\n    const AO = minus(a);\n    const ACB = orth(AB, AC); // the vector perpendicular to AB facing away from C\n    const ABC = orth(AC, AB); // the vector perpendicular to AC facing away from B\n\n    if (dot(ACB, AO) > 0) {\n      if (dot(AB, AO) > 0) {\n        // region 4\n        set(direction, ACB);\n        simplex.shift(); // simplex = [b, a]\n      } else {\n        // region 5\n        set(direction, AO);\n        simplex.splice(0, 2); // simplex = [a]\n      }\n    } else if (dot(ABC, AO) > 0) {\n      if (dot(AC, AO) > 0) {\n        // region 6\n        set(direction, ABC);\n        simplex.splice(1, 1); // simplex = [c, a]\n      } else {\n        // region 5 (again)\n        set(direction, AO);\n        simplex.splice(0, 2); // simplex = [a]\n      }\n    } // region 7\n    else {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * @param {ReadonlyArray<number>} v\n * @returns {number[]}\n */\nfunction minus(v) {\n  return [-v[0], -v[1]];\n}\n\n/**\n * @param {ReadonlyArray<number>} v1\n * @param {ReadonlyArray<number>} v2\n * @returns {number[]}\n */\nfunction sub(v1, v2) {\n  return [v1[0] - v2[0], v1[1] - v2[1]];\n}\n\n/**\n * @param {ReadonlyArray<number>} v1\n * @param {ReadonlyArray<number>} v2\n * @returns {number}\n */\nfunction dot(v1, v2) {\n  return v1[0] * v2[0] + v1[1] * v2[1];\n}\n\n/**\n * @param {ReadonlyArray<number>} v\n * @param {ReadonlyArray<number>} from\n * @returns {number[]}\n */\nfunction orth(v, from) {\n  const o = [-v[1], v[0]];\n  return dot(o, minus(from)) < 0 ? minus(o) : o;\n}\n\n/**\n * @param {ReadonlyArray<import('../lib/types.js').PathDataItem>} pathData\n * @returns {Points}\n */\nfunction gatherPoints(pathData) {\n  /** @type {Points} */\n  const points = { list: [], minX: 0, minY: 0, maxX: 0, maxY: 0 };\n\n  /**\n   * Writes data about the extreme points on each axle.\n   *\n   * @param {Point} path\n   * @param {number[]} point\n   */\n  const addPoint = (path, point) => {\n    if (!path.list.length || point[1] > path.list[path.maxY][1]) {\n      path.maxY = path.list.length;\n      points.maxY = points.list.length\n        ? Math.max(point[1], points.maxY)\n        : point[1];\n    }\n    if (!path.list.length || point[0] > path.list[path.maxX][0]) {\n      path.maxX = path.list.length;\n      points.maxX = points.list.length\n        ? Math.max(point[0], points.maxX)\n        : point[0];\n    }\n    if (!path.list.length || point[1] < path.list[path.minY][1]) {\n      path.minY = path.list.length;\n      points.minY = points.list.length\n        ? Math.min(point[1], points.minY)\n        : point[1];\n    }\n    if (!path.list.length || point[0] < path.list[path.minX][0]) {\n      path.minX = path.list.length;\n      points.minX = points.list.length\n        ? Math.min(point[0], points.minX)\n        : point[0];\n    }\n    path.list.push(point);\n  };\n\n  for (let i = 0; i < pathData.length; i += 1) {\n    const pathDataItem = pathData[i];\n    let subPath =\n      points.list.length === 0\n        ? { list: [], minX: 0, minY: 0, maxX: 0, maxY: 0 }\n        : points.list[points.list.length - 1];\n    const prev = i === 0 ? null : pathData[i - 1];\n    let basePoint =\n      subPath.list.length === 0 ? null : subPath.list[subPath.list.length - 1];\n    const data = pathDataItem.args;\n    let ctrlPoint = basePoint;\n\n    // TODO fix null hack\n    /**\n     * @param {number} n\n     * @param {number} i\n     * @returns {number}\n     */\n    const toAbsolute = (n, i) => n + (basePoint == null ? 0 : basePoint[i % 2]);\n\n    switch (pathDataItem.command) {\n      case 'M':\n        subPath = { list: [], minX: 0, minY: 0, maxX: 0, maxY: 0 };\n        points.list.push(subPath);\n        break;\n\n      case 'H':\n        if (basePoint != null) {\n          addPoint(subPath, [data[0], basePoint[1]]);\n        }\n        break;\n\n      case 'V':\n        if (basePoint != null) {\n          addPoint(subPath, [basePoint[0], data[0]]);\n        }\n        break;\n\n      case 'Q':\n        addPoint(subPath, data.slice(0, 2));\n        prevCtrlPoint = [data[2] - data[0], data[3] - data[1]]; // Save control point for shorthand\n        break;\n\n      case 'T':\n        if (\n          basePoint != null &&\n          prev != null &&\n          (prev.command == 'Q' || prev.command == 'T')\n        ) {\n          ctrlPoint = [\n            basePoint[0] + prevCtrlPoint[0],\n            basePoint[1] + prevCtrlPoint[1],\n          ];\n          addPoint(subPath, ctrlPoint);\n          prevCtrlPoint = [data[0] - ctrlPoint[0], data[1] - ctrlPoint[1]];\n        }\n        break;\n\n      case 'C':\n        if (basePoint != null) {\n          // Approximate cubic Bezier curve with middle points between control points\n          addPoint(subPath, [\n            0.5 * (basePoint[0] + data[0]),\n            0.5 * (basePoint[1] + data[1]),\n          ]);\n        }\n        addPoint(subPath, [\n          0.5 * (data[0] + data[2]),\n          0.5 * (data[1] + data[3]),\n        ]);\n        addPoint(subPath, [\n          0.5 * (data[2] + data[4]),\n          0.5 * (data[3] + data[5]),\n        ]);\n        prevCtrlPoint = [data[4] - data[2], data[5] - data[3]]; // Save control point for shorthand\n        break;\n\n      case 'S':\n        if (\n          basePoint != null &&\n          prev != null &&\n          (prev.command == 'C' || prev.command == 'S')\n        ) {\n          addPoint(subPath, [\n            basePoint[0] + 0.5 * prevCtrlPoint[0],\n            basePoint[1] + 0.5 * prevCtrlPoint[1],\n          ]);\n          ctrlPoint = [\n            basePoint[0] + prevCtrlPoint[0],\n            basePoint[1] + prevCtrlPoint[1],\n          ];\n        }\n        if (ctrlPoint != null) {\n          addPoint(subPath, [\n            0.5 * (ctrlPoint[0] + data[0]),\n            0.5 * (ctrlPoint[1] + data[1]),\n          ]);\n        }\n        addPoint(subPath, [\n          0.5 * (data[0] + data[2]),\n          0.5 * (data[1] + data[3]),\n        ]);\n        prevCtrlPoint = [data[2] - data[0], data[3] - data[1]];\n        break;\n\n      case 'A':\n        if (basePoint != null) {\n          // Convert the arc to Bézier curves and use the same approximation\n          // @ts-expect-error no idea what's going on here\n          const curves = a2c.apply(0, basePoint.concat(data));\n          for (\n            var cData;\n            (cData = curves.splice(0, 6).map(toAbsolute)).length;\n\n          ) {\n            if (basePoint != null) {\n              addPoint(subPath, [\n                0.5 * (basePoint[0] + cData[0]),\n                0.5 * (basePoint[1] + cData[1]),\n              ]);\n            }\n            addPoint(subPath, [\n              0.5 * (cData[0] + cData[2]),\n              0.5 * (cData[1] + cData[3]),\n            ]);\n            addPoint(subPath, [\n              0.5 * (cData[2] + cData[4]),\n              0.5 * (cData[3] + cData[5]),\n            ]);\n            if (curves.length) {\n              addPoint(subPath, (basePoint = cData.slice(-2)));\n            }\n          }\n        }\n        break;\n    }\n\n    // Save final command coordinates\n    if (data.length >= 2) {\n      addPoint(subPath, data.slice(-2));\n    }\n  }\n\n  return points;\n}\n\n/**\n * Forms a convex hull from set of points of every subpath using monotone chain\n * convex hull algorithm.\n *\n * @see https://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain\n * @param {Point} points\n * @returns {Point}\n */\nfunction convexHull(points) {\n  points.list.sort(function (a, b) {\n    return a[0] == b[0] ? a[1] - b[1] : a[0] - b[0];\n  });\n\n  const lower = [];\n  let minY = 0;\n  let bottom = 0;\n  for (let i = 0; i < points.list.length; i++) {\n    while (\n      lower.length >= 2 &&\n      cross(lower[lower.length - 2], lower[lower.length - 1], points.list[i]) <=\n        0\n    ) {\n      lower.pop();\n    }\n    if (points.list[i][1] < points.list[minY][1]) {\n      minY = i;\n      bottom = lower.length;\n    }\n    lower.push(points.list[i]);\n  }\n\n  const upper = [];\n  let maxY = points.list.length - 1;\n  let top = 0;\n  for (let i = points.list.length; i--; ) {\n    while (\n      upper.length >= 2 &&\n      cross(upper[upper.length - 2], upper[upper.length - 1], points.list[i]) <=\n        0\n    ) {\n      upper.pop();\n    }\n    if (points.list[i][1] > points.list[maxY][1]) {\n      maxY = i;\n      top = upper.length;\n    }\n    upper.push(points.list[i]);\n  }\n\n  // last points are equal to starting points of the other part\n  upper.pop();\n  lower.pop();\n\n  const hullList = lower.concat(upper);\n\n  /** @type {Point} */\n  const hull = {\n    list: hullList,\n    minX: 0, // by sorting\n    maxX: lower.length,\n    minY: bottom,\n    maxY: (lower.length + top) % hullList.length,\n  };\n\n  return hull;\n}\n\n/**\n * @param {ReadonlyArray<number>} o\n * @param {ReadonlyArray<number>} a\n * @param {ReadonlyArray<number>} b\n * @returns {number}\n */\nfunction cross(o, a, b) {\n  return (a[0] - o[0]) * (b[1] - o[1]) - (a[1] - o[1]) * (b[0] - o[0]);\n}\n\n/**\n * Based on code from [Snap.svg](http://snapsvg.io/) (Apache 2 license). Thanks\n * to Dmitry Baranovskiy for his great work!\n *\n * @param {number} x1\n * @param {number} y1\n * @param {number} rx\n * @param {number} ry\n * @param {number} angle\n * @param {number} large_arc_flag\n * @param {number} sweep_flag\n * @param {number} x2\n * @param {number} y2\n * @param {ReadonlyArray<number>} recursive\n * @returns {number[]}\n */\nconst a2c = (\n  x1,\n  y1,\n  rx,\n  ry,\n  angle,\n  large_arc_flag,\n  sweep_flag,\n  x2,\n  y2,\n  recursive,\n) => {\n  // for more information of where this Math came from visit:\n  // https://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes\n  const _120 = (Math.PI * 120) / 180;\n  const rad = (Math.PI / 180) * (+angle || 0);\n  /** @type {number[]} */\n  let res = [];\n  /**\n   * @param {number} x\n   * @param {number} y\n   * @param {number} rad\n   * @returns {number}\n   */\n  const rotateX = (x, y, rad) => {\n    return x * Math.cos(rad) - y * Math.sin(rad);\n  };\n\n  /**\n   * @param {number} x\n   * @param {number} y\n   * @param {number} rad\n   * @returns {number}\n   */\n  const rotateY = (x, y, rad) => {\n    return x * Math.sin(rad) + y * Math.cos(rad);\n  };\n  if (!recursive) {\n    x1 = rotateX(x1, y1, -rad);\n    y1 = rotateY(x1, y1, -rad);\n    x2 = rotateX(x2, y2, -rad);\n    y2 = rotateY(x2, y2, -rad);\n    const x = (x1 - x2) / 2;\n    const y = (y1 - y2) / 2;\n    let h = (x * x) / (rx * rx) + (y * y) / (ry * ry);\n    if (h > 1) {\n      h = Math.sqrt(h);\n      rx = h * rx;\n      ry = h * ry;\n    }\n    const rx2 = rx * rx;\n    const ry2 = ry * ry;\n    const k =\n      (large_arc_flag == sweep_flag ? -1 : 1) *\n      Math.sqrt(\n        Math.abs(\n          (rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x),\n        ),\n      );\n    var cx = (k * rx * y) / ry + (x1 + x2) / 2;\n    var cy = (k * -ry * x) / rx + (y1 + y2) / 2;\n    var f1 = Math.asin(Number(((y1 - cy) / ry).toFixed(9)));\n    var f2 = Math.asin(Number(((y2 - cy) / ry).toFixed(9)));\n\n    f1 = x1 < cx ? Math.PI - f1 : f1;\n    f2 = x2 < cx ? Math.PI - f2 : f2;\n    f1 < 0 && (f1 = Math.PI * 2 + f1);\n    f2 < 0 && (f2 = Math.PI * 2 + f2);\n    if (sweep_flag && f1 > f2) {\n      f1 = f1 - Math.PI * 2;\n    }\n    if (!sweep_flag && f2 > f1) {\n      f2 = f2 - Math.PI * 2;\n    }\n  } else {\n    f1 = recursive[0];\n    f2 = recursive[1];\n    cx = recursive[2];\n    cy = recursive[3];\n  }\n  let df = f2 - f1;\n  if (Math.abs(df) > _120) {\n    const f2old = f2;\n    const x2old = x2;\n    const y2old = y2;\n    f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);\n    x2 = cx + rx * Math.cos(f2);\n    y2 = cy + ry * Math.sin(f2);\n    res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [\n      f2,\n      f2old,\n      cx,\n      cy,\n    ]);\n  }\n  df = f2 - f1;\n  const c1 = Math.cos(f1);\n  const s1 = Math.sin(f1);\n  const c2 = Math.cos(f2);\n  const s2 = Math.sin(f2);\n  const t = Math.tan(df / 4);\n  const hx = (4 / 3) * rx * t;\n  const hy = (4 / 3) * ry * t;\n  const m = [\n    -hx * s1,\n    hy * c1,\n    x2 + hx * s2 - x1,\n    y2 - hy * c2 - y1,\n    x2 - x1,\n    y2 - y1,\n  ];\n  if (recursive) {\n    return m.concat(res);\n  } else {\n    res = m.concat(res);\n    const newres = [];\n    for (let i = 0, n = res.length; i < n; i++) {\n      newres[i] =\n        i % 2\n          ? rotateY(res[i - 1], res[i], rad)\n          : rotateX(res[i], res[i + 1], rad);\n    }\n    return newres;\n  }\n};\n"
  },
  {
    "path": "plugins/_transforms.js",
    "content": "import { cleanupOutData, toFixed } from '../lib/svgo/tools.js';\n\n/**\n * @typedef TransformItem\n * @property {string} name\n * @property {number[]} data\n *\n * @typedef TransformParams\n * @property {boolean} convertToShorts\n * @property {number=} degPrecision\n * @property {number} floatPrecision\n * @property {number} transformPrecision\n * @property {boolean} matrixToTransform\n * @property {boolean} shortTranslate\n * @property {boolean} shortScale\n * @property {boolean} shortRotate\n * @property {boolean} removeUseless\n * @property {boolean} collapseIntoOne\n * @property {boolean} leadingZero\n * @property {boolean} negativeExtraSpace\n *\n */\n\nconst transformTypes = new Set([\n  'matrix',\n  'rotate',\n  'scale',\n  'skewX',\n  'skewY',\n  'translate',\n]);\n\nconst regTransformSplit =\n  /\\s*(matrix|translate|scale|rotate|skewX|skewY)\\s*\\(\\s*(.+?)\\s*\\)[\\s,]*/;\nconst regNumericValues = /[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?/g;\n\n/**\n * Convert transform string to JS representation.\n *\n * @param {string} transformString\n * @returns {TransformItem[]} Object representation of transform, or an empty array if it was malformed.\n */\nexport const transform2js = (transformString) => {\n  /** @type {TransformItem[]} */\n  const transforms = [];\n  /** @type {?TransformItem} */\n  let currentTransform = null;\n\n  // split value into ['', 'translate', '10 50', '', 'scale', '2', '', 'rotate', '-45', '']\n  for (const item of transformString.split(regTransformSplit)) {\n    if (!item) {\n      continue;\n    }\n\n    if (transformTypes.has(item)) {\n      currentTransform = { name: item, data: [] };\n      transforms.push(currentTransform);\n    } else {\n      let num;\n      // then split it into [10, 50] and collect as context.data\n      while ((num = regNumericValues.exec(item))) {\n        num = Number(num);\n        if (currentTransform != null) {\n          currentTransform.data.push(num);\n        }\n      }\n    }\n  }\n\n  return currentTransform == null || currentTransform.data.length == 0\n    ? []\n    : transforms;\n};\n/**\n * Multiply transforms into one.\n *\n * @param {ReadonlyArray<TransformItem>} transforms\n * @returns {TransformItem}\n */\nexport const transformsMultiply = (transforms) => {\n  const matrixData = transforms.map((transform) => {\n    if (transform.name === 'matrix') {\n      return transform.data;\n    }\n    return transformToMatrix(transform);\n  });\n\n  const matrixTransform = {\n    name: 'matrix',\n    data:\n      matrixData.length > 0 ? matrixData.reduce(multiplyTransformMatrices) : [],\n  };\n\n  return matrixTransform;\n};\n\n/**\n * Math utilities in radians.\n */\nconst mth = {\n  /**\n   * @param {number} deg\n   * @returns {number}\n   */\n  rad: (deg) => {\n    return (deg * Math.PI) / 180;\n  },\n\n  /**\n   * @param {number} rad\n   * @returns {number}\n   */\n  deg: (rad) => {\n    return (rad * 180) / Math.PI;\n  },\n\n  /**\n   * @param {number} deg\n   * @returns {number}\n   */\n  cos: (deg) => {\n    return Math.cos(mth.rad(deg));\n  },\n\n  /**\n   * @param {number} val\n   * @param {number} floatPrecision\n   * @returns {number}\n   */\n  acos: (val, floatPrecision) => {\n    return toFixed(mth.deg(Math.acos(val)), floatPrecision);\n  },\n\n  /**\n   * @param {number} deg\n   * @returns {number}\n   */\n  sin: (deg) => {\n    return Math.sin(mth.rad(deg));\n  },\n\n  /**\n   * @param {number} val\n   * @param {number} floatPrecision\n   * @returns {number}\n   */\n  asin: (val, floatPrecision) => {\n    return toFixed(mth.deg(Math.asin(val)), floatPrecision);\n  },\n\n  /**\n   * @param {number} deg\n   * @returns {number}\n   */\n  tan: (deg) => {\n    return Math.tan(mth.rad(deg));\n  },\n\n  /**\n   * @param {number} val\n   * @param {number} floatPrecision\n   * @returns {number}\n   */\n  atan: (val, floatPrecision) => {\n    return toFixed(mth.deg(Math.atan(val)), floatPrecision);\n  },\n};\n\n/**\n * @param {TransformItem} matrix\n * @returns {TransformItem[][]}\n */\nconst getDecompositions = (matrix) => {\n  const decompositions = [];\n  const qrab = decomposeQRAB(matrix);\n  const qrcd = decomposeQRCD(matrix);\n\n  if (qrab) {\n    decompositions.push(qrab);\n  }\n  if (qrcd) {\n    decompositions.push(qrcd);\n  }\n  return decompositions;\n};\n\n/**\n * @param {TransformItem} matrix\n * @returns {TransformItem[] | undefined}\n * @see {@link https://frederic-wang.fr/2013/12/01/decomposition-of-2d-transform-matrices/} Where applicable, variables are named in accordance with this document.\n */\nconst decomposeQRAB = (matrix) => {\n  const data = matrix.data;\n\n  const [a, b, c, d, e, f] = data;\n  const delta = a * d - b * c;\n  if (delta === 0) {\n    return;\n  }\n  const r = Math.hypot(a, b);\n\n  if (r === 0) {\n    return;\n  }\n\n  const decomposition = [];\n  const cosOfRotationAngle = a / r;\n\n  // [..., ..., ..., ..., tx, ty] → translate(tx, ty)\n  if (e || f) {\n    decomposition.push({\n      name: 'translate',\n      data: [e, f],\n    });\n  }\n\n  if (cosOfRotationAngle !== 1) {\n    const rotationAngleRads = Math.acos(cosOfRotationAngle);\n    decomposition.push({\n      name: 'rotate',\n      data: [mth.deg(b < 0 ? -rotationAngleRads : rotationAngleRads), 0, 0],\n    });\n  }\n\n  const sx = r;\n  const sy = delta / sx;\n  if (sx !== 1 || sy !== 1) {\n    decomposition.push({ name: 'scale', data: [sx, sy] });\n  }\n\n  const ac_plus_bd = a * c + b * d;\n  if (ac_plus_bd) {\n    decomposition.push({\n      name: 'skewX',\n      data: [mth.deg(Math.atan(ac_plus_bd / (a * a + b * b)))],\n    });\n  }\n\n  return decomposition;\n};\n\n/**\n * @param {TransformItem} matrix\n * @returns {TransformItem[] | undefined}\n * @see {@link https://frederic-wang.fr/2013/12/01/decomposition-of-2d-transform-matrices/} Where applicable, variables are named in accordance with this document.\n */\nconst decomposeQRCD = (matrix) => {\n  const data = matrix.data;\n\n  const [a, b, c, d, e, f] = data;\n  const delta = a * d - b * c;\n  if (delta === 0) {\n    return;\n  }\n  const s = Math.hypot(c, d);\n  if (s === 0) {\n    return;\n  }\n\n  const decomposition = [];\n\n  if (e || f) {\n    decomposition.push({\n      name: 'translate',\n      data: [e, f],\n    });\n  }\n\n  const rotationAngleRads = Math.PI / 2 - (d < 0 ? -1 : 1) * Math.acos(-c / s);\n  decomposition.push({\n    name: 'rotate',\n    data: [mth.deg(rotationAngleRads), 0, 0],\n  });\n\n  const sx = delta / s;\n  const sy = s;\n  if (sx !== 1 || sy !== 1) {\n    decomposition.push({ name: 'scale', data: [sx, sy] });\n  }\n\n  const ac_plus_bd = a * c + b * d;\n  if (ac_plus_bd) {\n    decomposition.push({\n      name: 'skewY',\n      data: [mth.deg(Math.atan(ac_plus_bd / (c * c + d * d)))],\n    });\n  }\n\n  return decomposition;\n};\n\n/**\n * Convert translate(tx,ty)rotate(a) to rotate(a,cx,cy).\n * @param {number} tx\n * @param {number} ty\n * @param {number} a\n * @returns {TransformItem}\n */\nconst mergeTranslateAndRotate = (tx, ty, a) => {\n  // From https://www.w3.org/TR/SVG11/coords.html#TransformAttribute:\n  // We have translate(tx,ty) rotate(a). This is equivalent to [cos(a) sin(a) -sin(a) cos(a) tx ty].\n  //\n  // rotate(a,cx,cy) is equivalent to translate(cx, cy) rotate(a) translate(-cx, -cy).\n  // Multiplying the right side gives the matrix\n  //   [cos(a) sin(a) -sin(a) cos(a)\n  //   -cx * cos(a) + cy * sin(a) + cx\n  //   -cx * sin(a) - cy * cos(a) + cy\n  // ]\n  //\n  // We need cx and cy such that\n  //   tx = -cx * cos(a) + cy * sin(a) + cx\n  //   ty = -cx * sin(a) - cy * cos(a) + cy\n  //\n  // Solving these for cx and cy gives\n  //   cy = (d * ty + e * tx)/(d^2 + e^2)\n  //   cx = (tx - e * cy) / d\n  // where d = 1 - cos(a) and e = sin(a)\n\n  const rotationAngleRads = mth.rad(a);\n  const d = 1 - Math.cos(rotationAngleRads);\n  const e = Math.sin(rotationAngleRads);\n  const cy = (d * ty + e * tx) / (d * d + e * e);\n  const cx = (tx - e * cy) / d;\n  return { name: 'rotate', data: [a, cx, cy] };\n};\n\n/**\n * @param {TransformItem} t\n * @returns {Boolean}\n */\nconst isIdentityTransform = (t) => {\n  switch (t.name) {\n    case 'rotate':\n    case 'skewX':\n    case 'skewY':\n      return t.data[0] === 0;\n    case 'scale':\n      return t.data[0] === 1 && t.data[1] === 1;\n    case 'translate':\n      return t.data[0] === 0 && t.data[1] === 0;\n  }\n  return false;\n};\n\n/**\n * Optimize matrix of simple transforms.\n * @param {ReadonlyArray<TransformItem>} roundedTransforms\n * @param {ReadonlyArray<TransformItem>} rawTransforms\n * @returns {TransformItem[]}\n */\nconst optimize = (roundedTransforms, rawTransforms) => {\n  const optimizedTransforms = [];\n\n  for (let index = 0; index < roundedTransforms.length; index++) {\n    const roundedTransform = roundedTransforms[index];\n\n    // Don't include any identity transforms.\n    if (isIdentityTransform(roundedTransform)) {\n      continue;\n    }\n    const data = roundedTransform.data;\n    switch (roundedTransform.name) {\n      case 'rotate':\n        switch (data[0]) {\n          case 180:\n          case -180:\n            {\n              // If the next element is a scale, invert it, and don't add the rotate to the optimized array.\n              const next = roundedTransforms[index + 1];\n              if (next && next.name === 'scale') {\n                optimizedTransforms.push(\n                  createScaleTransform(next.data.map((v) => -v)),\n                );\n                index++;\n              } else {\n                // Otherwise replace the rotate with a scale(-1).\n                optimizedTransforms.push({\n                  name: 'scale',\n                  data: [-1],\n                });\n              }\n            }\n            continue;\n        }\n        optimizedTransforms.push({\n          name: 'rotate',\n          data: data.slice(0, data[1] || data[2] ? 3 : 1),\n        });\n        break;\n\n      case 'scale':\n        optimizedTransforms.push(createScaleTransform(data));\n        break;\n\n      case 'skewX':\n      case 'skewY':\n        optimizedTransforms.push({\n          name: roundedTransform.name,\n          data: [data[0]],\n        });\n        break;\n\n      case 'translate':\n        {\n          // If the next item is a rotate(a,0,0), merge the translate and rotate.\n          // If the rotation angle is +/-180, assume it will be optimized out, and don't do the merge.\n          const next = roundedTransforms[index + 1];\n          if (\n            next &&\n            next.name === 'rotate' &&\n            next.data[0] !== 180 &&\n            next.data[0] !== -180 &&\n            next.data[0] !== 0 &&\n            next.data[1] === 0 &&\n            next.data[2] === 0\n          ) {\n            // Use the un-rounded data to do the merge.\n            const data = rawTransforms[index].data;\n            optimizedTransforms.push(\n              mergeTranslateAndRotate(\n                data[0],\n                data[1],\n                rawTransforms[index + 1].data[0],\n              ),\n            );\n            // Skip over the rotate.\n            index++;\n            continue;\n          }\n        }\n        optimizedTransforms.push({\n          name: 'translate',\n          data: data.slice(0, data[1] ? 2 : 1),\n        });\n        break;\n    }\n  }\n\n  // If everything was optimized out, return identity transform scale(1).\n  return optimizedTransforms.length\n    ? optimizedTransforms\n    : [{ name: 'scale', data: [1] }];\n};\n\n/**\n * @param {ReadonlyArray<number>} data\n * @returns {TransformItem}\n */\nconst createScaleTransform = (data) => {\n  const scaleData = data.slice(0, data[0] === data[1] ? 1 : 2);\n  return {\n    name: 'scale',\n    data: scaleData,\n  };\n};\n\n/**\n * Decompose matrix into simple transforms and optimize.\n * @param {TransformItem} origMatrix\n * @param {TransformParams} params\n * @returns {TransformItem[]}\n */\nexport const matrixToTransform = (origMatrix, params) => {\n  const decomposed = getDecompositions(origMatrix);\n\n  let shortest;\n  let shortestLen = Number.MAX_VALUE;\n\n  for (const decomposition of decomposed) {\n    // Make a copy of the decomposed matrix, and round all data. We need to keep the original decomposition,\n    // at full precision, to perform some optimizations.\n    const roundedTransforms = decomposition.map((transformItem) => {\n      const transformCopy = {\n        name: transformItem.name,\n        data: [...transformItem.data],\n      };\n      return roundTransform(transformCopy, params);\n    });\n\n    const optimized = optimize(roundedTransforms, decomposition);\n    const len = js2transform(optimized, params).length;\n    if (len < shortestLen) {\n      shortest = optimized;\n      shortestLen = len;\n    }\n  }\n\n  return shortest ?? [origMatrix];\n};\n\n/**\n * Convert transform to the matrix data.\n *\n * @param {TransformItem} transform\n * @returns {number[]}\n */\nconst transformToMatrix = (transform) => {\n  if (transform.name === 'matrix') {\n    return transform.data;\n  }\n  switch (transform.name) {\n    case 'translate':\n      // [1, 0, 0, 1, tx, ty]\n      return [1, 0, 0, 1, transform.data[0], transform.data[1] || 0];\n    case 'scale':\n      // [sx, 0, 0, sy, 0, 0]\n      return [\n        transform.data[0],\n        0,\n        0,\n        transform.data[1] ?? transform.data[0],\n        0,\n        0,\n      ];\n    case 'rotate':\n      // [cos(a), sin(a), -sin(a), cos(a), x, y]\n      var cos = mth.cos(transform.data[0]);\n      var sin = mth.sin(transform.data[0]);\n      var cx = transform.data[1] || 0;\n      var cy = transform.data[2] || 0;\n      return [\n        cos,\n        sin,\n        -sin,\n        cos,\n        (1 - cos) * cx + sin * cy,\n        (1 - cos) * cy - sin * cx,\n      ];\n    case 'skewX':\n      // [1, 0, tan(a), 1, 0, 0]\n      return [1, 0, mth.tan(transform.data[0]), 1, 0, 0];\n    case 'skewY':\n      // [1, tan(a), 0, 1, 0, 0]\n      return [1, mth.tan(transform.data[0]), 0, 1, 0, 0];\n    default:\n      throw Error(`Unknown transform ${transform.name}`);\n  }\n};\n\n/**\n * Applies transformation to an arc. To do so, we represent ellipse as a matrix,\n * multiply it by the transformation matrix and use a singular value\n * decomposition to represent in a form rotate(θ)·scale(a b)·rotate(φ). This\n * gives us new ellipse params a, b and θ. SVD is being done with the formulae\n * provided by Wolfram|Alpha (svd {{m0, m2}, {m1, m3}})\n *\n * @param {[number, number]} cursor\n * @param {number[]} arc\n * @param {ReadonlyArray<number>} transform\n * @returns {number[]}\n */\nexport const transformArc = (cursor, arc, transform) => {\n  const x = arc[5] - cursor[0];\n  const y = arc[6] - cursor[1];\n  let a = arc[0];\n  let b = arc[1];\n  const rot = (arc[2] * Math.PI) / 180;\n  const cos = Math.cos(rot);\n  const sin = Math.sin(rot);\n  // skip if radius is 0\n  if (a > 0 && b > 0) {\n    let h =\n      Math.pow(x * cos + y * sin, 2) / (4 * a * a) +\n      Math.pow(y * cos - x * sin, 2) / (4 * b * b);\n    if (h > 1) {\n      h = Math.sqrt(h);\n      a *= h;\n      b *= h;\n    }\n  }\n  const ellipse = [a * cos, a * sin, -b * sin, b * cos, 0, 0];\n  const m = multiplyTransformMatrices(transform, ellipse);\n  // Decompose the new ellipse matrix\n  const lastCol = m[2] * m[2] + m[3] * m[3];\n  const squareSum = m[0] * m[0] + m[1] * m[1] + lastCol;\n  const root =\n    Math.hypot(m[0] - m[3], m[1] + m[2]) * Math.hypot(m[0] + m[3], m[1] - m[2]);\n\n  if (!root) {\n    // circle\n    arc[0] = arc[1] = Math.sqrt(squareSum / 2);\n    arc[2] = 0;\n  } else {\n    const majorAxisSqr = (squareSum + root) / 2;\n    const minorAxisSqr = (squareSum - root) / 2;\n    const major = Math.abs(majorAxisSqr - lastCol) > 1e-6;\n    const sub = (major ? majorAxisSqr : minorAxisSqr) - lastCol;\n    const rowsSum = m[0] * m[2] + m[1] * m[3];\n    const term1 = m[0] * sub + m[2] * rowsSum;\n    const term2 = m[1] * sub + m[3] * rowsSum;\n    arc[0] = Math.sqrt(majorAxisSqr);\n    arc[1] = Math.sqrt(minorAxisSqr);\n    arc[2] =\n      (((major ? term2 < 0 : term1 > 0) ? -1 : 1) *\n        Math.acos((major ? term1 : term2) / Math.hypot(term1, term2)) *\n        180) /\n      Math.PI;\n  }\n\n  if (transform[0] < 0 !== transform[3] < 0) {\n    // Flip the sweep flag if coordinates are being flipped horizontally XOR vertically\n    arc[4] = 1 - arc[4];\n  }\n\n  return arc;\n};\n\n/**\n * Multiply transformation matrices.\n *\n * @param {ReadonlyArray<number>} a\n * @param {ReadonlyArray<number>} b\n * @returns {number[]}\n */\nconst multiplyTransformMatrices = (a, b) => {\n  return [\n    a[0] * b[0] + a[2] * b[1],\n    a[1] * b[0] + a[3] * b[1],\n    a[0] * b[2] + a[2] * b[3],\n    a[1] * b[2] + a[3] * b[3],\n    a[0] * b[4] + a[2] * b[5] + a[4],\n    a[1] * b[4] + a[3] * b[5] + a[5],\n  ];\n};\n\n/**\n * @param {TransformItem} transform\n * @param {TransformParams} params\n * @returns {TransformItem}\n */\nexport const roundTransform = (transform, params) => {\n  switch (transform.name) {\n    case 'translate':\n      transform.data = floatRound(transform.data, params);\n      break;\n    case 'rotate':\n      transform.data = [\n        ...degRound(transform.data.slice(0, 1), params),\n        ...floatRound(transform.data.slice(1), params),\n      ];\n      break;\n    case 'skewX':\n    case 'skewY':\n      transform.data = degRound(transform.data, params);\n      break;\n    case 'scale':\n      transform.data = transformRound(transform.data, params);\n      break;\n    case 'matrix':\n      transform.data = [\n        ...transformRound(transform.data.slice(0, 4), params),\n        ...floatRound(transform.data.slice(4), params),\n      ];\n      break;\n  }\n  return transform;\n};\n\n/**\n * @param {number[]} data\n * @param {TransformParams} params\n * @returns {number[]}\n */\nconst degRound = (data, params) => {\n  if (\n    params.degPrecision != null &&\n    params.degPrecision >= 1 &&\n    params.floatPrecision < 20\n  ) {\n    return smartRound(params.degPrecision, data);\n  } else {\n    return round(data);\n  }\n};\n\n/**\n * @param {number[]} data\n * @param {TransformParams} params\n * @returns {number[]}\n */\nconst floatRound = (data, params) => {\n  if (params.floatPrecision >= 1 && params.floatPrecision < 20) {\n    return smartRound(params.floatPrecision, data);\n  } else {\n    return round(data);\n  }\n};\n\n/**\n * @param {number[]} data\n * @param {TransformParams} params\n * @returns {number[]}\n */\nconst transformRound = (data, params) => {\n  if (params.transformPrecision >= 1 && params.floatPrecision < 20) {\n    return smartRound(params.transformPrecision, data);\n  } else {\n    return round(data);\n  }\n};\n\n/**\n * Rounds numbers in array.\n *\n * @param {ReadonlyArray<number>} data\n * @returns {number[]}\n */\nconst round = (data) => {\n  return data.map(Math.round);\n};\n\n/**\n * Decrease accuracy of floating-point numbers in transforms keeping a specified\n * number of decimals. Smart rounds values like 2.349 to 2.35.\n *\n * @param {number} precision\n * @param {number[]} data\n * @returns {number[]}\n */\nconst smartRound = (precision, data) => {\n  for (\n    let i = data.length,\n      tolerance = +Math.pow(0.1, precision).toFixed(precision);\n    i--;\n\n  ) {\n    if (toFixed(data[i], precision) !== data[i]) {\n      const rounded = +data[i].toFixed(precision - 1);\n      data[i] =\n        +Math.abs(rounded - data[i]).toFixed(precision + 1) >= tolerance\n          ? +data[i].toFixed(precision)\n          : rounded;\n    }\n  }\n\n  return data;\n};\n\n/**\n * Convert transforms JS representation to string.\n *\n * @param {ReadonlyArray<TransformItem>} transformJS\n * @param {TransformParams} params\n * @returns {string}\n */\nexport const js2transform = (transformJS, params) => {\n  const transformString = transformJS\n    .map((transform) => {\n      roundTransform(transform, params);\n      return `${transform.name}(${cleanupOutData(transform.data, params)})`;\n    })\n    .join('');\n\n  return transformString;\n};\n"
  },
  {
    "path": "plugins/addAttributesToSVGElement.js",
    "content": "/**\n * @typedef AddAttributesToSVGElementParams\n * @property {string | Record<string, null | string>=} attribute\n * @property {Array<string | Record<string, null | string>>=} attributes\n */\n\nexport const name = 'addAttributesToSVGElement';\nexport const description = 'adds attributes to an outer <svg> element';\n\nconst ENOCLS = `Error in plugin \"addAttributesToSVGElement\": absent parameters.\nIt should have a list of \"attributes\" or one \"attribute\".\nConfig example:\n\nplugins: [\n  {\n    name: 'addAttributesToSVGElement',\n    params: {\n      attribute: \"mySvg\"\n    }\n  }\n]\n\nplugins: [\n  {\n    name: 'addAttributesToSVGElement',\n    params: {\n      attributes: [\"mySvg\", \"size-big\"]\n    }\n  }\n]\n\nplugins: [\n  {\n    name: 'addAttributesToSVGElement',\n    params: {\n      attributes: [\n        {\n          focusable: false\n        },\n        {\n          'data-image': icon\n        }\n      ]\n    }\n  }\n]\n`;\n\n/**\n * Add attributes to an outer <svg> element.\n *\n * @author April Arcus\n *\n * @type {import('../lib/types.js').Plugin<AddAttributesToSVGElementParams>}\n */\nexport const fn = (root, params) => {\n  if (!Array.isArray(params.attributes) && !params.attribute) {\n    console.error(ENOCLS);\n    return null;\n  }\n  const attributes = params.attributes || [params.attribute];\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        if (node.name === 'svg' && parentNode.type === 'root') {\n          for (const attribute of attributes) {\n            if (typeof attribute === 'string') {\n              if (node.attributes[attribute] == null) {\n                // @ts-expect-error disallow explicit nullable attribute value\n                node.attributes[attribute] = undefined;\n              }\n            }\n            if (typeof attribute === 'object') {\n              for (const key of Object.keys(attribute)) {\n                if (node.attributes[key] == null) {\n                  // @ts-expect-error disallow explicit nullable attribute value\n                  node.attributes[key] = attribute[key];\n                }\n              }\n            }\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/addClassesToSVGElement.js",
    "content": "/**\n * @typedef AddClassesToSVGElementParams\n * @property {string | ((node: import('../lib/types.js').XastElement, info: import('../lib/types.js').PluginInfo) => string)=} className\n * @property {Array<string | ((node: import('../lib/types.js').XastElement, info: import('../lib/types.js').PluginInfo) => string)>=} classNames\n */\n\nexport const name = 'addClassesToSVGElement';\nexport const description = 'adds classnames to an outer <svg> element';\n\nconst ENOCLS = `Error in plugin \"addClassesToSVGElement\": absent parameters.\nIt should have a list of classes in \"classNames\" or one \"className\".\nConfig example:\n\nplugins: [\n  {\n    name: \"addClassesToSVGElement\",\n    params: {\n      className: \"mySvg\"\n    }\n  }\n]\n\nplugins: [\n  {\n    name: \"addClassesToSVGElement\",\n    params: {\n      classNames: [\"mySvg\", \"size-big\"]\n    }\n  }\n]\n`;\n\n/**\n * Add classnames to an outer <svg> element. Example config:\n *\n * plugins: [\n *   {\n *     name: \"addClassesToSVGElement\",\n *     params: {\n *       className: \"mySvg\"\n *     }\n *   }\n * ]\n *\n * plugins: [\n *   {\n *     name: \"addClassesToSVGElement\",\n *     params: {\n *       classNames: [\"mySvg\", \"size-big\"]\n *     }\n *   }\n * ]\n *\n * @author April Arcus\n *\n * @type {import('../lib/types.js').Plugin<AddClassesToSVGElementParams>}\n */\nexport const fn = (root, params, info) => {\n  if (\n    !(Array.isArray(params.classNames) && params.classNames.length !== 0) &&\n    !params.className\n  ) {\n    console.error(ENOCLS);\n    return null;\n  }\n  const classNames = params.classNames || [params.className];\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        if (node.name === 'svg' && parentNode.type === 'root') {\n          const classList = new Set(\n            node.attributes.class == null\n              ? null\n              : node.attributes.class.split(' '),\n          );\n          for (const className of classNames) {\n            if (className != null) {\n              const classToAdd =\n                typeof className === 'string'\n                  ? className\n                  : className(node, info);\n              classList.add(classToAdd);\n            }\n          }\n          node.attributes.class = Array.from(classList).join(' ');\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/applyTransforms.js",
    "content": "import { path2js } from './_path.js';\nimport {\n  transform2js,\n  transformArc,\n  transformsMultiply,\n} from './_transforms.js';\nimport { attrsGroupsDefaults, referencesProps } from './_collections.js';\nimport { collectStylesheet, computeStyle } from '../lib/style.js';\n\nimport { includesUrlReference, removeLeadingZero } from '../lib/svgo/tools.js';\n\nconst regNumericValues = /[-+]?(\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?/g;\n\n/**\n * Apply transformation(s) to the Path data.\n *\n * @type {import('../lib/types.js').Plugin<{\n *   transformPrecision: number,\n *   applyTransformsStroked: boolean,\n * }>}\n */\nexport const applyTransforms = (root, params) => {\n  const stylesheet = collectStylesheet(root);\n  return {\n    element: {\n      enter: (node) => {\n        if (node.attributes.d == null) {\n          return;\n        }\n\n        // stroke and stroke-width can be redefined with <use>\n        if (node.attributes.id != null) {\n          return;\n        }\n\n        // if there are no 'stroke' attr and references to other objects such as\n        // gradients or clip-path which are also subjects to transform.\n        if (\n          node.attributes.transform == null ||\n          node.attributes.transform === '' ||\n          // styles are not considered when applying transform\n          // can be fixed properly with new style engine\n          node.attributes.style != null ||\n          Object.entries(node.attributes).some(\n            ([name, value]) =>\n              referencesProps.has(name) && includesUrlReference(value),\n          )\n        ) {\n          return;\n        }\n\n        const computedStyle = computeStyle(stylesheet, node);\n        const transformStyle = computedStyle.transform;\n\n        // Transform overridden in <style> tag which is not considered\n        if (\n          transformStyle.type === 'static' &&\n          transformStyle.value !== node.attributes.transform\n        ) {\n          return;\n        }\n\n        const matrix = transformsMultiply(\n          transform2js(node.attributes.transform),\n        );\n\n        const stroke =\n          computedStyle.stroke?.type === 'static'\n            ? computedStyle.stroke.value\n            : null;\n\n        const strokeWidth =\n          computedStyle['stroke-width']?.type === 'static'\n            ? computedStyle['stroke-width'].value\n            : null;\n        const transformPrecision = params.transformPrecision;\n\n        if (\n          computedStyle.stroke?.type === 'dynamic' ||\n          computedStyle['stroke-width']?.type === 'dynamic'\n        ) {\n          return;\n        }\n\n        const scale = Number(\n          Math.hypot(matrix.data[0], matrix.data[1]).toFixed(\n            transformPrecision,\n          ),\n        );\n\n        if (stroke && stroke != 'none') {\n          if (!params.applyTransformsStroked) {\n            return;\n          }\n\n          // stroke cannot be transformed with different vertical and horizontal scale or skew\n          if (\n            (matrix.data[0] !== matrix.data[3] ||\n              matrix.data[1] !== -matrix.data[2]) &&\n            (matrix.data[0] !== -matrix.data[3] ||\n              matrix.data[1] !== matrix.data[2])\n          ) {\n            return;\n          }\n\n          // apply transform to stroke-width, stroke-dashoffset and stroke-dasharray\n          if (scale !== 1) {\n            if (node.attributes['vector-effect'] !== 'non-scaling-stroke') {\n              node.attributes['stroke-width'] = (\n                strokeWidth || attrsGroupsDefaults.presentation['stroke-width']\n              )\n                .trim()\n                .replace(regNumericValues, (num) =>\n                  removeLeadingZero(Number(num) * scale),\n                );\n\n              if (node.attributes['stroke-dashoffset'] != null) {\n                node.attributes['stroke-dashoffset'] = node.attributes[\n                  'stroke-dashoffset'\n                ]\n                  .trim()\n                  .replace(regNumericValues, (num) =>\n                    removeLeadingZero(Number(num) * scale),\n                  );\n              }\n\n              if (node.attributes['stroke-dasharray'] != null) {\n                node.attributes['stroke-dasharray'] = node.attributes[\n                  'stroke-dasharray'\n                ]\n                  .trim()\n                  .replace(regNumericValues, (num) =>\n                    removeLeadingZero(Number(num) * scale),\n                  );\n              }\n            }\n          }\n        }\n\n        const pathData = path2js(node);\n        applyMatrixToPathData(pathData, matrix.data);\n\n        // remove transform attr\n        delete node.attributes.transform;\n      },\n    },\n  };\n};\n\n/**\n * @param {ReadonlyArray<number>} matrix\n * @param {number} x\n * @param {number} y\n * @returns {[number, number]}\n */\nconst transformAbsolutePoint = (matrix, x, y) => {\n  const newX = matrix[0] * x + matrix[2] * y + matrix[4];\n  const newY = matrix[1] * x + matrix[3] * y + matrix[5];\n  return [newX, newY];\n};\n\n/**\n * @param {ReadonlyArray<number>} matrix\n * @param {number} x\n * @param {number} y\n * @returns {[number, number]}\n */\nconst transformRelativePoint = (matrix, x, y) => {\n  const newX = matrix[0] * x + matrix[2] * y;\n  const newY = matrix[1] * x + matrix[3] * y;\n  return [newX, newY];\n};\n\n/**\n * @param {ReadonlyArray<import('../lib/types.js').PathDataItem>} pathData\n * @param {ReadonlyArray<number>} matrix\n */\nconst applyMatrixToPathData = (pathData, matrix) => {\n  /** @type {[number, number]} */\n  const start = [0, 0];\n  /** @type {[number, number]} */\n  const cursor = [0, 0];\n\n  for (const pathItem of pathData) {\n    let { command, args } = pathItem;\n\n    // moveto (x y)\n    if (command === 'M') {\n      cursor[0] = args[0];\n      cursor[1] = args[1];\n      start[0] = cursor[0];\n      start[1] = cursor[1];\n      const [x, y] = transformAbsolutePoint(matrix, args[0], args[1]);\n      args[0] = x;\n      args[1] = y;\n    }\n    if (command === 'm') {\n      cursor[0] += args[0];\n      cursor[1] += args[1];\n      start[0] = cursor[0];\n      start[1] = cursor[1];\n      const [x, y] = transformRelativePoint(matrix, args[0], args[1]);\n      args[0] = x;\n      args[1] = y;\n    }\n\n    // horizontal lineto (x)\n    // convert to lineto to handle two-dimensional transforms\n    if (command === 'H') {\n      command = 'L';\n      args = [args[0], cursor[1]];\n    }\n    if (command === 'h') {\n      command = 'l';\n      args = [args[0], 0];\n    }\n\n    // vertical lineto (y)\n    // convert to lineto to handle two-dimensional transforms\n    if (command === 'V') {\n      command = 'L';\n      args = [cursor[0], args[0]];\n    }\n    if (command === 'v') {\n      command = 'l';\n      args = [0, args[0]];\n    }\n\n    // lineto (x y)\n    if (command === 'L') {\n      cursor[0] = args[0];\n      cursor[1] = args[1];\n      const [x, y] = transformAbsolutePoint(matrix, args[0], args[1]);\n      args[0] = x;\n      args[1] = y;\n    }\n    if (command === 'l') {\n      cursor[0] += args[0];\n      cursor[1] += args[1];\n      const [x, y] = transformRelativePoint(matrix, args[0], args[1]);\n      args[0] = x;\n      args[1] = y;\n    }\n\n    // curveto (x1 y1 x2 y2 x y)\n    if (command === 'C') {\n      cursor[0] = args[4];\n      cursor[1] = args[5];\n      const [x1, y1] = transformAbsolutePoint(matrix, args[0], args[1]);\n      const [x2, y2] = transformAbsolutePoint(matrix, args[2], args[3]);\n      const [x, y] = transformAbsolutePoint(matrix, args[4], args[5]);\n      args[0] = x1;\n      args[1] = y1;\n      args[2] = x2;\n      args[3] = y2;\n      args[4] = x;\n      args[5] = y;\n    }\n    if (command === 'c') {\n      cursor[0] += args[4];\n      cursor[1] += args[5];\n      const [x1, y1] = transformRelativePoint(matrix, args[0], args[1]);\n      const [x2, y2] = transformRelativePoint(matrix, args[2], args[3]);\n      const [x, y] = transformRelativePoint(matrix, args[4], args[5]);\n      args[0] = x1;\n      args[1] = y1;\n      args[2] = x2;\n      args[3] = y2;\n      args[4] = x;\n      args[5] = y;\n    }\n\n    // smooth curveto (x2 y2 x y)\n    if (command === 'S') {\n      cursor[0] = args[2];\n      cursor[1] = args[3];\n      const [x2, y2] = transformAbsolutePoint(matrix, args[0], args[1]);\n      const [x, y] = transformAbsolutePoint(matrix, args[2], args[3]);\n      args[0] = x2;\n      args[1] = y2;\n      args[2] = x;\n      args[3] = y;\n    }\n    if (command === 's') {\n      cursor[0] += args[2];\n      cursor[1] += args[3];\n      const [x2, y2] = transformRelativePoint(matrix, args[0], args[1]);\n      const [x, y] = transformRelativePoint(matrix, args[2], args[3]);\n      args[0] = x2;\n      args[1] = y2;\n      args[2] = x;\n      args[3] = y;\n    }\n\n    // quadratic Bézier curveto (x1 y1 x y)\n    if (command === 'Q') {\n      cursor[0] = args[2];\n      cursor[1] = args[3];\n      const [x1, y1] = transformAbsolutePoint(matrix, args[0], args[1]);\n      const [x, y] = transformAbsolutePoint(matrix, args[2], args[3]);\n      args[0] = x1;\n      args[1] = y1;\n      args[2] = x;\n      args[3] = y;\n    }\n    if (command === 'q') {\n      cursor[0] += args[2];\n      cursor[1] += args[3];\n      const [x1, y1] = transformRelativePoint(matrix, args[0], args[1]);\n      const [x, y] = transformRelativePoint(matrix, args[2], args[3]);\n      args[0] = x1;\n      args[1] = y1;\n      args[2] = x;\n      args[3] = y;\n    }\n\n    // smooth quadratic Bézier curveto (x y)\n    if (command === 'T') {\n      cursor[0] = args[0];\n      cursor[1] = args[1];\n      const [x, y] = transformAbsolutePoint(matrix, args[0], args[1]);\n      args[0] = x;\n      args[1] = y;\n    }\n    if (command === 't') {\n      cursor[0] += args[0];\n      cursor[1] += args[1];\n      const [x, y] = transformRelativePoint(matrix, args[0], args[1]);\n      args[0] = x;\n      args[1] = y;\n    }\n\n    // elliptical arc (rx ry x-axis-rotation large-arc-flag sweep-flag x y)\n    if (command === 'A') {\n      transformArc(cursor, args, matrix);\n      cursor[0] = args[5];\n      cursor[1] = args[6];\n      // reduce number of digits in rotation angle\n      if (Math.abs(args[2]) > 80) {\n        const a = args[0];\n        const rotation = args[2];\n        args[0] = args[1];\n        args[1] = a;\n        args[2] = rotation + (rotation > 0 ? -90 : 90);\n      }\n      const [x, y] = transformAbsolutePoint(matrix, args[5], args[6]);\n      args[5] = x;\n      args[6] = y;\n    }\n    if (command === 'a') {\n      transformArc([0, 0], args, matrix);\n      cursor[0] += args[5];\n      cursor[1] += args[6];\n      // reduce number of digits in rotation angle\n      if (Math.abs(args[2]) > 80) {\n        const a = args[0];\n        const rotation = args[2];\n        args[0] = args[1];\n        args[1] = a;\n        args[2] = rotation + (rotation > 0 ? -90 : 90);\n      }\n      const [x, y] = transformRelativePoint(matrix, args[5], args[6]);\n      args[5] = x;\n      args[6] = y;\n    }\n\n    // closepath\n    if (command === 'z' || command === 'Z') {\n      cursor[0] = start[0];\n      cursor[1] = start[1];\n    }\n\n    pathItem.command = command;\n    pathItem.args = args;\n  }\n};\n"
  },
  {
    "path": "plugins/cleanupAttrs.js",
    "content": "/**\n * @typedef CleanupAttrsParams\n * @property {boolean=} newlines\n * @property {boolean=} trim\n * @property {boolean=} spaces\n */\n\nexport const name = 'cleanupAttrs';\nexport const description =\n  'cleanups attributes from newlines, trailing and repeating spaces';\n\nconst regNewlinesNeedSpace = /(\\S)\\r?\\n(\\S)/g;\nconst regNewlines = /\\r?\\n/g;\nconst regSpaces = /\\s{2,}/g;\n\n/**\n * Cleanup attributes values from newlines, trailing and repeating spaces.\n *\n * @author Kir Belevich\n * @type {import('../lib/types.js').Plugin<CleanupAttrsParams>}\n */\nexport const fn = (root, params) => {\n  const { newlines = true, trim = true, spaces = true } = params;\n  return {\n    element: {\n      enter: (node) => {\n        for (const name of Object.keys(node.attributes)) {\n          if (newlines) {\n            // new line which requires a space instead\n            node.attributes[name] = node.attributes[name].replace(\n              regNewlinesNeedSpace,\n              (match, p1, p2) => p1 + ' ' + p2,\n            );\n            // simple new line\n            node.attributes[name] = node.attributes[name].replace(\n              regNewlines,\n              '',\n            );\n          }\n          if (trim) {\n            node.attributes[name] = node.attributes[name].trim();\n          }\n          if (spaces) {\n            node.attributes[name] = node.attributes[name].replace(\n              regSpaces,\n              ' ',\n            );\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/cleanupEnableBackground.js",
    "content": "import * as csstree from 'css-tree';\nimport { visit } from '../lib/util/visit.js';\n\nexport const name = 'cleanupEnableBackground';\nexport const description =\n  'remove or cleanup enable-background attribute when possible';\n\nconst regEnableBackground =\n  /^new\\s0\\s0\\s([-+]?\\d*\\.?\\d+([eE][-+]?\\d+)?)\\s([-+]?\\d*\\.?\\d+([eE][-+]?\\d+)?)$/;\n\n/**\n * Remove or cleanup enable-background attr which coincides with a width/height\n * box.\n *\n * @see https://www.w3.org/TR/SVG11/filters.html#EnableBackgroundProperty\n * @example\n * <svg width=\"100\" height=\"50\" enable-background=\"new 0 0 100 50\">\n *   ⬇\n * <svg width=\"100\" height=\"50\">\n * @author Kir Belevich\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = (root) => {\n  let hasFilter = false;\n\n  visit(root, {\n    element: {\n      enter: (node) => {\n        if (node.name === 'filter') {\n          hasFilter = true;\n        }\n      },\n    },\n  });\n\n  return {\n    element: {\n      enter: (node) => {\n        /** @type {?csstree.CssNode} */\n        let newStyle = null;\n        /** @type {?csstree.ListItem<csstree.CssNode>} */\n        let enableBackgroundDeclaration = null;\n\n        if (node.attributes.style != null) {\n          newStyle = csstree.parse(node.attributes.style, {\n            context: 'declarationList',\n          });\n\n          if (newStyle.type === 'DeclarationList') {\n            /** @type {csstree.ListItem<csstree.CssNode>[]} */\n            const enableBackgroundDeclarations = [];\n\n            csstree.walk(newStyle, (node, nodeItem) => {\n              if (\n                node.type === 'Declaration' &&\n                node.property === 'enable-background'\n              ) {\n                enableBackgroundDeclarations.push(nodeItem);\n                enableBackgroundDeclaration = nodeItem;\n              }\n            });\n\n            for (let i = 0; i < enableBackgroundDeclarations.length - 1; i++) {\n              newStyle.children.remove(enableBackgroundDeclarations[i]);\n            }\n          }\n        }\n\n        if (!hasFilter) {\n          delete node.attributes['enable-background'];\n\n          if (newStyle?.type === 'DeclarationList') {\n            if (enableBackgroundDeclaration) {\n              newStyle.children.remove(enableBackgroundDeclaration);\n            }\n\n            if (newStyle.children.isEmpty) {\n              delete node.attributes.style;\n            } else {\n              node.attributes.style = csstree.generate(newStyle);\n            }\n          }\n\n          return;\n        }\n\n        const hasDimensions =\n          node.attributes.width != null && node.attributes.height != null;\n\n        if (\n          (node.name === 'svg' ||\n            node.name === 'mask' ||\n            node.name === 'pattern') &&\n          hasDimensions\n        ) {\n          const attrValue = node.attributes['enable-background'];\n          const attrCleaned = cleanupValue(\n            attrValue,\n            node.name,\n            node.attributes.width,\n            node.attributes.height,\n          );\n\n          if (attrCleaned) {\n            node.attributes['enable-background'] = attrCleaned;\n          } else {\n            delete node.attributes['enable-background'];\n          }\n\n          if (\n            newStyle?.type === 'DeclarationList' &&\n            enableBackgroundDeclaration\n          ) {\n            const styleValue = csstree.generate(\n              // @ts-expect-error\n              enableBackgroundDeclaration.data.value,\n            );\n            const styleCleaned = cleanupValue(\n              styleValue,\n              node.name,\n              node.attributes.width,\n              node.attributes.height,\n            );\n\n            if (styleCleaned) {\n              // @ts-expect-error\n              enableBackgroundDeclaration.data.value = {\n                type: 'Raw',\n                value: styleCleaned,\n              };\n            } else {\n              newStyle.children.remove(enableBackgroundDeclaration);\n            }\n          }\n        }\n\n        if (newStyle?.type === 'DeclarationList') {\n          if (newStyle.children.isEmpty) {\n            delete node.attributes.style;\n          } else {\n            node.attributes.style = csstree.generate(newStyle);\n          }\n        }\n      },\n    },\n  };\n};\n\n/**\n * @param {string} value Value of an enable-background attribute or style declaration.\n * @param {string} nodeName Name of the node the value was assigned to.\n * @param {string} width Width of the node the value was assigned to.\n * @param {string} height Height of the node the value was assigned to.\n * @returns {string | undefined} Cleaned up value, or undefined if it's redundant.\n */\nconst cleanupValue = (value, nodeName, width, height) => {\n  const match = regEnableBackground.exec(value);\n\n  if (match != null && width === match[1] && height === match[3]) {\n    return nodeName === 'svg' ? undefined : 'new';\n  }\n\n  return value;\n};\n"
  },
  {
    "path": "plugins/cleanupIds.js",
    "content": "import { visitSkip } from '../lib/util/visit.js';\nimport { findReferences, hasScripts } from '../lib/svgo/tools.js';\n\n/**\n * @typedef CleanupIdsParams\n * @property {boolean=} remove\n * @property {boolean=} minify\n * @property {string[]=} preserve\n * @property {string[]=} preservePrefixes\n * @property {boolean=} force\n */\n\nexport const name = 'cleanupIds';\nexport const description = 'removes unused IDs and minifies used';\n\nconst generateIdChars = [\n  'a',\n  'b',\n  'c',\n  'd',\n  'e',\n  'f',\n  'g',\n  'h',\n  'i',\n  'j',\n  'k',\n  'l',\n  'm',\n  'n',\n  'o',\n  'p',\n  'q',\n  'r',\n  's',\n  't',\n  'u',\n  'v',\n  'w',\n  'x',\n  'y',\n  'z',\n  'A',\n  'B',\n  'C',\n  'D',\n  'E',\n  'F',\n  'G',\n  'H',\n  'I',\n  'J',\n  'K',\n  'L',\n  'M',\n  'N',\n  'O',\n  'P',\n  'Q',\n  'R',\n  'S',\n  'T',\n  'U',\n  'V',\n  'W',\n  'X',\n  'Y',\n  'Z',\n];\nconst maxIdIndex = generateIdChars.length - 1;\n\n/**\n * Check if an ID starts with any one of a list of strings.\n *\n * @param {string} string\n * @param {ReadonlyArray<string>} prefixes\n * @returns {boolean}\n */\nconst hasStringPrefix = (string, prefixes) => {\n  for (const prefix of prefixes) {\n    if (string.startsWith(prefix)) {\n      return true;\n    }\n  }\n  return false;\n};\n\n/**\n * Generate unique minimal ID.\n *\n * @param {?number[]} currentId\n * @returns {number[]}\n */\nconst generateId = (currentId) => {\n  if (currentId == null) {\n    return [0];\n  }\n  currentId[currentId.length - 1] += 1;\n  for (let i = currentId.length - 1; i > 0; i--) {\n    if (currentId[i] > maxIdIndex) {\n      currentId[i] = 0;\n      if (currentId[i - 1] !== undefined) {\n        currentId[i - 1]++;\n      }\n    }\n  }\n  if (currentId[0] > maxIdIndex) {\n    currentId[0] = 0;\n    currentId.unshift(0);\n  }\n  return currentId;\n};\n\n/**\n * Get string from generated ID array.\n *\n * @param {ReadonlyArray<number>} arr\n * @returns {string}\n */\nconst getIdString = (arr) => {\n  return arr.map((i) => generateIdChars[i]).join('');\n};\n\n/**\n * Remove unused and minify used IDs (only if there are no `<style>` or\n * `<script>` nodes).\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin<CleanupIdsParams>}\n */\nexport const fn = (_root, params) => {\n  const {\n    remove = true,\n    minify = true,\n    preserve = [],\n    preservePrefixes = [],\n    force = false,\n  } = params;\n  const preserveIds = new Set(\n    Array.isArray(preserve) ? preserve : preserve ? [preserve] : [],\n  );\n  const preserveIdPrefixes = Array.isArray(preservePrefixes)\n    ? preservePrefixes\n    : preservePrefixes\n      ? [preservePrefixes]\n      : [];\n  /** @type {Map<string, import('../lib/types.js').XastElement>} */\n  const nodeById = new Map();\n  /** @type {Map<string, {element: import('../lib/types.js').XastElement, name: string }[]>} */\n  const referencesById = new Map();\n  let deoptimized = false;\n\n  return {\n    element: {\n      enter: (node) => {\n        if (!force) {\n          // deoptimize if style or scripts are present\n          if (\n            (node.name === 'style' && node.children.length !== 0) ||\n            hasScripts(node)\n          ) {\n            deoptimized = true;\n            return;\n          }\n\n          // avoid removing IDs if the whole SVG consists only of defs\n          if (node.name === 'svg') {\n            let hasDefsOnly = true;\n            for (const child of node.children) {\n              if (child.type !== 'element' || child.name !== 'defs') {\n                hasDefsOnly = false;\n                break;\n              }\n            }\n            if (hasDefsOnly) {\n              return visitSkip;\n            }\n          }\n        }\n\n        for (const [name, value] of Object.entries(node.attributes)) {\n          if (name === 'id') {\n            // collect all ids\n            const id = value;\n            if (nodeById.has(id)) {\n              delete node.attributes.id; // remove repeated id\n            } else {\n              nodeById.set(id, node);\n            }\n          } else {\n            const ids = findReferences(name, value);\n            for (const id of ids) {\n              let refs = referencesById.get(id);\n              if (refs == null) {\n                refs = [];\n                referencesById.set(id, refs);\n              }\n              refs.push({ element: node, name });\n            }\n          }\n        }\n      },\n    },\n\n    root: {\n      exit: () => {\n        if (deoptimized) {\n          return;\n        }\n        /**\n         * @param {string} id\n         * @returns {boolean}\n         */\n        const isIdPreserved = (id) =>\n          preserveIds.has(id) || hasStringPrefix(id, preserveIdPrefixes);\n        /** @type {?number[]} */\n        let currentId = null;\n        for (const [id, refs] of referencesById) {\n          const node = nodeById.get(id);\n          if (node != null) {\n            // replace referenced IDs with the minified ones\n            if (minify && isIdPreserved(id) === false) {\n              /** @type {?string} */\n              let currentIdString;\n              do {\n                currentId = generateId(currentId);\n                currentIdString = getIdString(currentId);\n              } while (\n                isIdPreserved(currentIdString) ||\n                (referencesById.has(currentIdString) &&\n                  nodeById.get(currentIdString) == null)\n              );\n              node.attributes.id = currentIdString;\n              for (const { element, name } of refs) {\n                const value = element.attributes[name];\n                if (value.includes('#')) {\n                  // replace id in href and url()\n                  element.attributes[name] = value\n                    .replace(`#${encodeURI(id)}`, `#${currentIdString}`)\n                    .replace(`#${id}`, `#${currentIdString}`);\n                } else {\n                  // replace id in begin attribute\n                  element.attributes[name] = value.replace(\n                    `${id}.`,\n                    `${currentIdString}.`,\n                  );\n                }\n              }\n            }\n            // keep referenced node\n            nodeById.delete(id);\n          }\n        }\n        // remove non-referenced IDs attributes from elements\n        if (remove) {\n          for (const [id, node] of nodeById) {\n            if (isIdPreserved(id) === false) {\n              delete node.attributes.id;\n            }\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/cleanupListOfValues.js",
    "content": "import { removeLeadingZero } from '../lib/svgo/tools.js';\n\n/**\n * @typedef CleanupListOfValuesParams\n * @property {number=} floatPrecision\n * @property {boolean=} leadingZero\n * @property {boolean=} defaultPx\n * @property {boolean=} convertToPx\n */\n\nexport const name = 'cleanupListOfValues';\nexport const description = 'rounds list of values to the fixed precision';\n\nconst regNumericValues =\n  /^([-+]?\\d*\\.?\\d+([eE][-+]?\\d+)?)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/;\nconst regSeparator = /\\s+,?\\s*|,\\s*/;\nconst absoluteLengths = {\n  // relative to px\n  cm: 96 / 2.54,\n  mm: 96 / 25.4,\n  in: 96,\n  pt: 4 / 3,\n  pc: 16,\n  px: 1,\n};\n\n/**\n * Round list of values to the fixed precision.\n *\n * @example\n * <svg viewBox=\"0 0 200.28423 200.28423\" enable-background=\"new 0 0 200.28423 200.28423\">\n *  ⬇\n * <svg viewBox=\"0 0 200.284 200.284\" enable-background=\"new 0 0 200.284 200.284\">\n *\n * <polygon points=\"208.250977 77.1308594 223.069336 ... \"/>\n *  ⬇\n * <polygon points=\"208.251 77.131 223.069 ... \"/>\n *\n * @author kiyopikko\n *\n * @type {import('../lib/types.js').Plugin<CleanupListOfValuesParams>}\n */\nexport const fn = (_root, params) => {\n  const {\n    floatPrecision = 3,\n    leadingZero = true,\n    defaultPx = true,\n    convertToPx = true,\n  } = params;\n\n  /**\n   * @param {string} lists\n   * @returns {string}\n   */\n  const roundValues = (lists) => {\n    const roundedList = [];\n\n    for (const elem of lists.split(regSeparator)) {\n      const match = elem.match(regNumericValues);\n      const matchNew = elem.match(/new/);\n\n      // if attribute value matches regNumericValues\n      if (match) {\n        // round it to the fixed precision\n        let num = Number(Number(match[1]).toFixed(floatPrecision));\n        /** @type {any} */\n        const matchedUnit = match[3] || '';\n        /** @type {'' | keyof typeof absoluteLengths} */\n        let units = matchedUnit;\n\n        // convert absolute values to pixels\n        if (convertToPx && units && units in absoluteLengths) {\n          const pxNum = Number(\n            (absoluteLengths[units] * Number(match[1])).toFixed(floatPrecision),\n          );\n\n          if (pxNum.toString().length < match[0].length) {\n            num = pxNum;\n            units = 'px';\n          }\n        }\n\n        // and remove leading zero\n        let str;\n        if (leadingZero) {\n          str = removeLeadingZero(num);\n        } else {\n          str = num.toString();\n        }\n\n        // remove default 'px' units\n        if (defaultPx && units === 'px') {\n          units = '';\n        }\n\n        roundedList.push(str + units);\n      }\n      // if attribute value is \"new\"(only enable-background).\n      else if (matchNew) {\n        roundedList.push('new');\n      } else if (elem) {\n        roundedList.push(elem);\n      }\n    }\n\n    return roundedList.join(' ');\n  };\n\n  return {\n    element: {\n      enter: (node) => {\n        if (node.attributes.points != null) {\n          node.attributes.points = roundValues(node.attributes.points);\n        }\n\n        if (node.attributes['enable-background'] != null) {\n          node.attributes['enable-background'] = roundValues(\n            node.attributes['enable-background'],\n          );\n        }\n\n        if (node.attributes.viewBox != null) {\n          node.attributes.viewBox = roundValues(node.attributes.viewBox);\n        }\n\n        if (node.attributes['stroke-dasharray'] != null) {\n          node.attributes['stroke-dasharray'] = roundValues(\n            node.attributes['stroke-dasharray'],\n          );\n        }\n\n        if (node.attributes.dx != null) {\n          node.attributes.dx = roundValues(node.attributes.dx);\n        }\n\n        if (node.attributes.dy != null) {\n          node.attributes.dy = roundValues(node.attributes.dy);\n        }\n\n        if (node.attributes.x != null) {\n          node.attributes.x = roundValues(node.attributes.x);\n        }\n\n        if (node.attributes.y != null) {\n          node.attributes.y = roundValues(node.attributes.y);\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/cleanupNumericValues.js",
    "content": "import { removeLeadingZero } from '../lib/svgo/tools.js';\n\n/**\n * @typedef CleanupNumericValuesParams\n * @property {number=} floatPrecision\n * @property {boolean=} leadingZero\n * @property {boolean=} defaultPx\n * @property {boolean=} convertToPx\n */\n\nexport const name = 'cleanupNumericValues';\nexport const description =\n  'rounds numeric values to the fixed precision, removes default \"px\" units';\n\nconst regNumericValues =\n  /^([-+]?\\d*\\.?\\d+([eE][-+]?\\d+)?)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/;\n\nconst absoluteLengths = {\n  // relative to px\n  cm: 96 / 2.54,\n  mm: 96 / 25.4,\n  in: 96,\n  pt: 4 / 3,\n  pc: 16,\n  px: 1,\n};\n\n/**\n * Round numeric values to the fixed precision, remove default 'px' units.\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin<CleanupNumericValuesParams>}\n */\nexport const fn = (_root, params) => {\n  const {\n    floatPrecision = 3,\n    leadingZero = true,\n    defaultPx = true,\n    convertToPx = true,\n  } = params;\n\n  return {\n    element: {\n      enter: (node) => {\n        if (node.attributes.viewBox != null) {\n          const numbers = node.attributes.viewBox\n            .trim()\n            .split(/(?:\\s,?|,)\\s*/g);\n          node.attributes.viewBox = numbers\n            .map((value) => {\n              const num = Number(value);\n              return Number.isNaN(num)\n                ? value\n                : Number(num.toFixed(floatPrecision));\n            })\n            .join(' ');\n        }\n\n        for (const [name, value] of Object.entries(node.attributes)) {\n          // The `version` attribute is a text string and cannot be rounded\n          if (name === 'version') {\n            continue;\n          }\n\n          const match = regNumericValues.exec(value);\n\n          // if attribute value matches regNumericValues\n          if (match) {\n            // round it to the fixed precision\n            let num = Number(Number(match[1]).toFixed(floatPrecision));\n            /** @type {any} */\n            const matchedUnit = match[3] || '';\n            /** @type {'' | keyof typeof absoluteLengths} */\n            let units = matchedUnit;\n\n            // convert absolute values to pixels\n            if (convertToPx && units !== '' && units in absoluteLengths) {\n              const pxNum = Number(\n                (absoluteLengths[units] * Number(match[1])).toFixed(\n                  floatPrecision,\n                ),\n              );\n              if (pxNum.toString().length < match[0].length) {\n                num = pxNum;\n                units = 'px';\n              }\n            }\n\n            // and remove leading zero\n            let str;\n            if (leadingZero) {\n              str = removeLeadingZero(num);\n            } else {\n              str = num.toString();\n            }\n\n            // remove default 'px' units\n            if (defaultPx && units === 'px') {\n              units = '';\n            }\n\n            node.attributes[name] = str + units;\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/collapseGroups.js",
    "content": "import { collectStylesheet, computeStyle } from '../lib/style.js';\nimport { elemsGroups, inheritableAttrs } from './_collections.js';\n\nexport const name = 'collapseGroups';\nexport const description = 'collapses useless groups';\n\n/**\n * @param {import('../lib/types.js').XastNode} node\n * @param {string} name\n * @returns {boolean}\n */\nconst hasAnimatedAttr = (node, name) => {\n  if (node.type === 'element') {\n    if (\n      elemsGroups.animation.has(node.name) &&\n      node.attributes.attributeName === name\n    ) {\n      return true;\n    }\n    for (const child of node.children) {\n      if (hasAnimatedAttr(child, name)) {\n        return true;\n      }\n    }\n  }\n  return false;\n};\n\n/**\n * Collapse useless groups.\n *\n * @example\n * <g>\n *     <g attr1=\"val1\">\n *         <path d=\"...\"/>\n *     </g>\n * </g>\n *  ⬇\n * <g>\n *     <g>\n *         <path attr1=\"val1\" d=\"...\"/>\n *     </g>\n * </g>\n *  ⬇\n * <path attr1=\"val1\" d=\"...\"/>\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = (root) => {\n  const stylesheet = collectStylesheet(root);\n\n  return {\n    element: {\n      exit: (node, parentNode) => {\n        if (parentNode.type === 'root' || parentNode.name === 'switch') {\n          return;\n        }\n        // non-empty groups\n        if (node.name !== 'g' || node.children.length === 0) {\n          return;\n        }\n\n        // move group attributes to the single child element\n        if (\n          Object.keys(node.attributes).length !== 0 &&\n          node.children.length === 1\n        ) {\n          const firstChild = node.children[0];\n          const nodeHasFilter = !!(\n            node.attributes.filter || computeStyle(stylesheet, node).filter\n          );\n          // TODO untangle this mess\n          if (\n            firstChild.type === 'element' &&\n            firstChild.attributes.id == null &&\n            !nodeHasFilter &&\n            (node.attributes.class == null ||\n              firstChild.attributes.class == null) &&\n            ((node.attributes['clip-path'] == null &&\n              node.attributes.mask == null) ||\n              (firstChild.name === 'g' &&\n                node.attributes.transform == null &&\n                firstChild.attributes.transform == null))\n          ) {\n            const newChildElemAttrs = { ...firstChild.attributes };\n\n            for (const [name, value] of Object.entries(node.attributes)) {\n              // avoid copying to not conflict with animated attribute\n              if (hasAnimatedAttr(firstChild, name)) {\n                return;\n              }\n\n              if (newChildElemAttrs[name] == null) {\n                newChildElemAttrs[name] = value;\n              } else if (name === 'transform') {\n                newChildElemAttrs[name] = value + ' ' + newChildElemAttrs[name];\n              } else if (newChildElemAttrs[name] === 'inherit') {\n                newChildElemAttrs[name] = value;\n              } else if (\n                !inheritableAttrs.has(name) &&\n                newChildElemAttrs[name] !== value\n              ) {\n                return;\n              }\n            }\n\n            node.attributes = {};\n            firstChild.attributes = newChildElemAttrs;\n          }\n        }\n\n        // collapse groups without attributes\n        if (Object.keys(node.attributes).length === 0) {\n          // animation elements \"add\" attributes to group\n          // group should be preserved\n          for (const child of node.children) {\n            if (\n              child.type === 'element' &&\n              elemsGroups.animation.has(child.name)\n            ) {\n              return;\n            }\n          }\n          // replace current node with all its children\n          const index = parentNode.children.indexOf(node);\n          parentNode.children.splice(index, 1, ...node.children);\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/convertColors.js",
    "content": "import { colorsNames, colorsProps, colorsShortNames } from './_collections.js';\nimport { includesUrlReference } from '../lib/svgo/tools.js';\n\n/**\n * @typedef ConvertColorsParams\n * @property {boolean | string | RegExp=} currentColor\n * @property {boolean=} names2hex\n * @property {boolean=} rgb2hex\n * @property {false | 'lower' | 'upper'=} convertCase\n * @property {boolean=} shorthex\n * @property {boolean=} shortname\n */\n\nexport const name = 'convertColors';\nexport const description =\n  'converts colors: rgb() to #rrggbb and #rrggbb to #rgb';\n\nconst rNumber = '([+-]?(?:\\\\d*\\\\.\\\\d+|\\\\d+\\\\.?)%?)';\nconst rComma = '(?:\\\\s*,\\\\s*|\\\\s+)';\nconst regRGB = new RegExp(\n  '^rgb\\\\(\\\\s*' + rNumber + rComma + rNumber + rComma + rNumber + '\\\\s*\\\\)$',\n);\nconst regHEX = /^#(([a-fA-F0-9])\\2){3}$/;\n\n/**\n * Convert [r, g, b] to #rrggbb.\n *\n * @see https://gist.github.com/983535\n *\n * @example\n * rgb2hex([255, 255, 255]) // '#ffffff'\n *\n * @author Jed Schmidt\n *\n * @param {ReadonlyArray<number>} param0\n * @returns {string}\n */\nconst convertRgbToHex = ([r, g, b]) => {\n  // combine the octets into a 32-bit integer as: [1][r][g][b]\n  const hexNumber =\n    // operator precedence is (+) > (<<) > (|)\n    ((((256 + // [1][0]\n      r) << // [1][r]\n      8) | // [1][r][0]\n      g) << // [1][r][g]\n      8) | // [1][r][g][0]\n    b;\n  // serialize [1][r][g][b] to a hex string, and\n  // remove the 1 to get the number with 0s intact\n  return '#' + hexNumber.toString(16).slice(1).toUpperCase();\n};\n\n/**\n * Convert different colors formats in element attributes to hex.\n *\n * @see https://www.w3.org/TR/SVG11/types.html#DataTypeColor\n * @see https://www.w3.org/TR/SVG11/single-page.html#types-ColorKeywords\n *\n * @example\n * Convert color name keyword to long hex:\n * fuchsia ➡ #ff00ff\n *\n * Convert rgb() to long hex:\n * rgb(255, 0, 255) ➡ #ff00ff\n * rgb(50%, 100, 100%) ➡ #7f64ff\n *\n * Convert long hex to short hex:\n * #aabbcc ➡ #abc\n *\n * Convert hex to short name\n * #000080 ➡ navy\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin<ConvertColorsParams>}\n */\nexport const fn = (_root, params) => {\n  const {\n    currentColor = false,\n    names2hex = true,\n    rgb2hex = true,\n    convertCase = 'lower',\n    shorthex = true,\n    shortname = true,\n  } = params;\n\n  let maskCounter = 0;\n\n  return {\n    element: {\n      enter: (node) => {\n        if (node.name === 'mask') {\n          maskCounter++;\n        }\n        for (const [name, value] of Object.entries(node.attributes)) {\n          if (colorsProps.has(name)) {\n            let val = value;\n\n            // convert colors to currentColor\n            if (currentColor && maskCounter === 0) {\n              let matched;\n              if (typeof currentColor === 'string') {\n                matched = val === currentColor;\n              } else if (currentColor instanceof RegExp) {\n                matched = currentColor.exec(val) != null;\n              } else {\n                matched = val !== 'none';\n              }\n              if (matched) {\n                val = 'currentColor';\n              }\n            }\n\n            // convert color name keyword to long hex\n            if (names2hex) {\n              const colorName = val.toLowerCase();\n              if (colorsNames[colorName] != null) {\n                val = colorsNames[colorName];\n              }\n            }\n\n            // convert rgb() to long hex\n            if (rgb2hex) {\n              const match = val.match(regRGB);\n              if (match != null) {\n                const numbers = match.slice(1, 4).map((m) => {\n                  let n;\n                  if (m.indexOf('%') > -1) {\n                    n = Math.round(parseFloat(m) * 2.55);\n                  } else {\n                    n = Number(m);\n                  }\n                  return Math.max(0, Math.min(n, 255));\n                });\n                val = convertRgbToHex(numbers);\n              }\n            }\n\n            if (\n              convertCase &&\n              !includesUrlReference(val) &&\n              val !== 'currentColor'\n            ) {\n              if (convertCase === 'lower') {\n                val = val.toLowerCase();\n              } else if (convertCase === 'upper') {\n                val = val.toUpperCase();\n              }\n            }\n\n            // convert long hex to short hex\n            if (shorthex) {\n              const match = regHEX.exec(val);\n              if (match != null) {\n                val = '#' + match[0][1] + match[0][3] + match[0][5];\n              }\n            }\n\n            // convert hex to short name\n            if (shortname) {\n              const colorName = val.toLowerCase();\n              if (colorsShortNames[colorName] != null) {\n                val = colorsShortNames[colorName];\n              }\n            }\n\n            node.attributes[name] = val;\n          }\n        }\n      },\n      exit: (node) => {\n        if (node.name === 'mask') {\n          maskCounter--;\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/convertEllipseToCircle.js",
    "content": "export const name = 'convertEllipseToCircle';\nexport const description = 'converts non-eccentric <ellipse>s to <circle>s';\n\n/**\n * Converts non-eccentric <ellipse>s to <circle>s.\n *\n * @see https://www.w3.org/TR/SVG11/shapes.html\n *\n * @author Taylor Hunt\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  return {\n    element: {\n      enter: (node) => {\n        if (node.name === 'ellipse') {\n          const rx = node.attributes.rx || '0';\n          const ry = node.attributes.ry || '0';\n          if (\n            rx === ry ||\n            rx === 'auto' ||\n            ry === 'auto' // SVG2\n          ) {\n            node.name = 'circle';\n            const radius = rx === 'auto' ? ry : rx;\n            delete node.attributes.rx;\n            delete node.attributes.ry;\n            node.attributes.r = radius;\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/convertOneStopGradients.js",
    "content": "import { attrsGroupsDefaults, colorsProps } from './_collections.js';\nimport {\n  detachNodeFromParent,\n  querySelector,\n  querySelectorAll,\n} from '../lib/xast.js';\nimport { collectStylesheet, computeStyle } from '../lib/style.js';\n\nexport const name = 'convertOneStopGradients';\nexport const description =\n  'converts one-stop (single color) gradients to a plain color';\n\n/**\n * Converts one-stop (single color) gradients to a plain color.\n *\n * @author Seth Falco <seth@falco.fun>\n * @type {import('../lib/types.js').Plugin}\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/linearGradient\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/radialGradient\n */\nexport const fn = (root) => {\n  const stylesheet = collectStylesheet(root);\n\n  /**\n   * Parent defs that had gradients elements removed from them.\n   *\n   * @type {Set<import('../lib/types.js').XastElement>}\n   */\n  const effectedDefs = new Set();\n\n  /** @type {Map<import('../lib/types.js').XastElement, import('../lib/types.js').XastParent>} */\n  const allDefs = new Map();\n\n  /** @type {Map<import('../lib/types.js').XastElement, import('../lib/types.js').XastParent>} */\n  const gradientsToDetach = new Map();\n\n  /** Number of references to the xlink:href attribute. */\n  let xlinkHrefCount = 0;\n\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        if (node.attributes['xlink:href'] != null) {\n          xlinkHrefCount++;\n        }\n\n        if (node.name === 'defs') {\n          allDefs.set(node, parentNode);\n          return;\n        }\n\n        if (node.name !== 'linearGradient' && node.name !== 'radialGradient') {\n          return;\n        }\n\n        const stops = node.children.filter((child) => {\n          return child.type === 'element' && child.name === 'stop';\n        });\n\n        const href = node.attributes['xlink:href'] || node.attributes['href'];\n        const effectiveNode =\n          stops.length === 0 && href != null && href.startsWith('#')\n            ? querySelector(root, href)\n            : node;\n\n        if (effectiveNode == null || effectiveNode.type !== 'element') {\n          gradientsToDetach.set(node, parentNode);\n          return;\n        }\n\n        const effectiveStops = effectiveNode.children.filter((child) => {\n          return child.type === 'element' && child.name === 'stop';\n        });\n\n        if (\n          effectiveStops.length !== 1 ||\n          effectiveStops[0].type !== 'element'\n        ) {\n          return;\n        }\n\n        if (parentNode.type === 'element' && parentNode.name === 'defs') {\n          effectedDefs.add(parentNode);\n        }\n\n        gradientsToDetach.set(node, parentNode);\n\n        let color;\n        const style = computeStyle(stylesheet, effectiveStops[0])['stop-color'];\n        if (style != null && style.type === 'static') {\n          color = style.value;\n        }\n\n        const selectorVal = `url(#${node.attributes.id})`;\n\n        const selector = [...colorsProps]\n          .map((attr) => `[${attr}=\"${selectorVal}\"]`)\n          .join(',');\n        const elements = querySelectorAll(root, selector);\n        for (const element of elements) {\n          if (element.type !== 'element') {\n            continue;\n          }\n\n          for (const attr of colorsProps) {\n            if (element.attributes[attr] !== selectorVal) {\n              continue;\n            }\n\n            if (color != null) {\n              element.attributes[attr] = color;\n            } else {\n              delete element.attributes[attr];\n            }\n          }\n        }\n\n        const styledElements = querySelectorAll(\n          root,\n          `[style*=${selectorVal}]`,\n        );\n        for (const element of styledElements) {\n          if (element.type !== 'element') {\n            continue;\n          }\n\n          element.attributes.style = element.attributes.style.replace(\n            selectorVal,\n            color || attrsGroupsDefaults.presentation['stop-color'],\n          );\n        }\n      },\n\n      exit: (node) => {\n        if (node.name === 'svg') {\n          for (const [gradient, parent] of gradientsToDetach.entries()) {\n            if (gradient.attributes['xlink:href'] != null) {\n              xlinkHrefCount--;\n            }\n\n            detachNodeFromParent(gradient, parent);\n          }\n\n          if (xlinkHrefCount === 0) {\n            delete node.attributes['xmlns:xlink'];\n          }\n\n          for (const [defs, parent] of allDefs.entries()) {\n            if (effectedDefs.has(defs) && defs.children.length === 0) {\n              detachNodeFromParent(defs, parent);\n            }\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/convertPathData.js",
    "content": "import { js2path, path2js } from './_path.js';\nimport { pathElems } from './_collections.js';\nimport { applyTransforms } from './applyTransforms.js';\nimport { collectStylesheet, computeStyle } from '../lib/style.js';\nimport { visit } from '../lib/util/visit.js';\nimport { cleanupOutData, toFixed } from '../lib/svgo/tools.js';\n\n/**\n * @typedef {[number, number]} Point\n *\n * @typedef Circle\n * @property {Point} center\n * @property {number} radius\n *\n * @typedef MakeArcs\n * @property {number} threshold\n * @property {number} tolerance\n *\n * @typedef ConvertPathDataParams\n * @property {boolean=} applyTransforms\n * @property {boolean=} applyTransformsStroked\n * @property {MakeArcs=} makeArcs\n * @property {boolean=} straightCurves\n * @property {boolean=} convertToQ\n * @property {boolean=} lineShorthands\n * @property {boolean=} convertToZ\n * @property {boolean=} curveSmoothShorthands\n * @property {number | false=} floatPrecision\n * @property {number=} transformPrecision\n * @property {boolean=} smartArcRounding\n * @property {boolean=} removeUseless\n * @property {boolean=} collapseRepeated\n * @property {boolean=} utilizeAbsolute\n * @property {boolean=} leadingZero\n * @property {boolean=} negativeExtraSpace\n * @property {boolean=} noSpaceAfterFlags\n * @property {boolean=} forceAbsolutePath\n *\n * @typedef {Required<ConvertPathDataParams>} InternalParams\n */\n\nexport const name = 'convertPathData';\nexport const description =\n  'optimizes path data: writes in shorter form, applies transformations';\n\n/** @type {(data: number[]) => number[]} */\nlet roundData;\n/** @type {number | false} */\nlet precision;\n/** @type {number} */\nlet error;\n/** @type {number} */\nlet arcThreshold;\n/** @type {number} */\nlet arcTolerance;\n\n/**\n * Convert absolute Path to relative,\n * collapse repeated instructions,\n * detect and convert Lineto shorthands,\n * remove useless instructions like \"l0,0\",\n * trim useless delimiters and leading zeros,\n * decrease accuracy of floating-point numbers.\n *\n * @see https://www.w3.org/TR/SVG11/paths.html#PathData\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin<ConvertPathDataParams>}\n */\nexport const fn = (root, params) => {\n  const {\n    // TODO convert to separate plugin in v3\n    applyTransforms: _applyTransforms = true,\n    applyTransformsStroked = true,\n    makeArcs = {\n      threshold: 2.5, // coefficient of rounding error\n      tolerance: 0.5, // percentage of radius\n    },\n    straightCurves = true,\n    convertToQ = true,\n    lineShorthands = true,\n    convertToZ = true,\n    curveSmoothShorthands = true,\n    floatPrecision = 3,\n    transformPrecision = 5,\n    smartArcRounding = true,\n    removeUseless = true,\n    collapseRepeated = true,\n    utilizeAbsolute = true,\n    leadingZero = true,\n    negativeExtraSpace = true,\n    noSpaceAfterFlags = false, // a20 60 45 0 1 30 20 → a20 60 45 0130 20\n    forceAbsolutePath = false,\n  } = params;\n\n  /** @type {InternalParams} */\n  const newParams = {\n    applyTransforms: _applyTransforms,\n    applyTransformsStroked,\n    makeArcs,\n    straightCurves,\n    convertToQ,\n    lineShorthands,\n    convertToZ,\n    curveSmoothShorthands,\n    floatPrecision,\n    transformPrecision,\n    smartArcRounding,\n    removeUseless,\n    collapseRepeated,\n    utilizeAbsolute,\n    leadingZero,\n    negativeExtraSpace,\n    noSpaceAfterFlags,\n    forceAbsolutePath,\n  };\n\n  // invoke applyTransforms plugin\n  if (_applyTransforms) {\n    visit(\n      root,\n      // @ts-expect-error\n      applyTransforms(root, {\n        transformPrecision,\n        applyTransformsStroked,\n      }),\n    );\n  }\n\n  const stylesheet = collectStylesheet(root);\n  return {\n    element: {\n      enter: (node) => {\n        if (pathElems.has(node.name) && node.attributes.d != null) {\n          const computedStyle = computeStyle(stylesheet, node);\n          precision = floatPrecision;\n          error =\n            precision !== false\n              ? +Math.pow(0.1, precision).toFixed(precision)\n              : 1e-2;\n          roundData =\n            precision && precision > 0 && precision < 20 ? strongRound : round;\n          if (makeArcs) {\n            arcThreshold = makeArcs.threshold;\n            arcTolerance = makeArcs.tolerance;\n          }\n          const hasMarkerMid = computedStyle['marker-mid'] != null;\n\n          const maybeHasStroke =\n            computedStyle.stroke &&\n            (computedStyle.stroke.type === 'dynamic' ||\n              computedStyle.stroke.value !== 'none');\n          const maybeHasLinecap =\n            computedStyle['stroke-linecap'] &&\n            (computedStyle['stroke-linecap'].type === 'dynamic' ||\n              computedStyle['stroke-linecap'].value !== 'butt');\n          const isSafeToUseZ = maybeHasStroke\n            ? computedStyle['stroke-linecap']?.type === 'static' &&\n              computedStyle['stroke-linecap'].value === 'round' &&\n              computedStyle['stroke-linejoin']?.type === 'static' &&\n              computedStyle['stroke-linejoin'].value === 'round'\n            : true;\n          const isSafeToRemove = (\n            /** @type {boolean} */ isFirstDraw,\n            /** @type {boolean} */ safeIfNotFirstDraw,\n          ) => {\n            if (!maybeHasStroke) {\n              return true;\n            }\n            if (isFirstDraw) {\n              return !maybeHasLinecap;\n            } else {\n              return safeIfNotFirstDraw;\n            }\n          };\n\n          let data = path2js(node);\n\n          // TODO: get rid of functions returns\n          if (data.length) {\n            const includesVertices = data.some(\n              (item) => item.command !== 'm' && item.command !== 'M',\n            );\n            convertToRelative(data);\n\n            data = filters(data, newParams, {\n              isSafeToUseZ,\n              isSafeToRemove,\n              hasMarkerMid,\n            });\n\n            if (utilizeAbsolute) {\n              data = convertToMixed(data, newParams);\n            }\n\n            const hasMarker =\n              node.attributes['marker-start'] != null ||\n              node.attributes['marker-end'] != null;\n            const isMarkersOnlyPath =\n              hasMarker &&\n              includesVertices &&\n              data.every(\n                (item) => item.command === 'm' || item.command === 'M',\n              );\n\n            if (isMarkersOnlyPath) {\n              data.push({\n                command: 'z',\n                args: [],\n              });\n            }\n\n            // @ts-expect-error\n            js2path(node, data, newParams);\n          }\n        }\n      },\n    },\n  };\n};\n\n/**\n * Convert absolute path data coordinates to relative.\n *\n * @param {import('../lib/types.js').PathDataItem[]} pathData\n * @returns {import('../lib/types.js').PathDataItem[]}\n */\nconst convertToRelative = (pathData) => {\n  const start = [0, 0];\n  const cursor = [0, 0];\n  let prevCoords = [0, 0];\n\n  for (let i = 0; i < pathData.length; i += 1) {\n    const pathItem = pathData[i];\n    let { command, args } = pathItem;\n\n    // moveto (x y)\n    if (command === 'm') {\n      // update start and cursor\n      cursor[0] += args[0];\n      cursor[1] += args[1];\n      start[0] = cursor[0];\n      start[1] = cursor[1];\n    } else if (command === 'M') {\n      // M → m\n      // skip first moveto\n      if (i !== 0) {\n        command = 'm';\n      }\n      args[0] -= cursor[0];\n      args[1] -= cursor[1];\n      // update start and cursor\n      cursor[0] += args[0];\n      cursor[1] += args[1];\n      start[0] = cursor[0];\n      start[1] = cursor[1];\n    }\n\n    // lineto (x y)\n    else if (command === 'l') {\n      cursor[0] += args[0];\n      cursor[1] += args[1];\n    } else if (command === 'L') {\n      // L → l\n      command = 'l';\n      args[0] -= cursor[0];\n      args[1] -= cursor[1];\n      cursor[0] += args[0];\n      cursor[1] += args[1];\n    }\n\n    // horizontal lineto (x)\n    else if (command === 'h') {\n      cursor[0] += args[0];\n    } else if (command === 'H') {\n      // H → h\n      command = 'h';\n      args[0] -= cursor[0];\n      cursor[0] += args[0];\n    }\n\n    // vertical lineto (y)\n    else if (command === 'v') {\n      cursor[1] += args[0];\n    } else if (command === 'V') {\n      // V → v\n      command = 'v';\n      args[0] -= cursor[1];\n      cursor[1] += args[0];\n    }\n\n    // curveto (x1 y1 x2 y2 x y)\n    else if (command === 'c') {\n      cursor[0] += args[4];\n      cursor[1] += args[5];\n    } else if (command === 'C') {\n      // C → c\n      command = 'c';\n      args[0] -= cursor[0];\n      args[1] -= cursor[1];\n      args[2] -= cursor[0];\n      args[3] -= cursor[1];\n      args[4] -= cursor[0];\n      args[5] -= cursor[1];\n      cursor[0] += args[4];\n      cursor[1] += args[5];\n    }\n\n    // smooth curveto (x2 y2 x y)\n    else if (command === 's') {\n      cursor[0] += args[2];\n      cursor[1] += args[3];\n    } else if (command === 'S') {\n      // S → s\n      command = 's';\n      args[0] -= cursor[0];\n      args[1] -= cursor[1];\n      args[2] -= cursor[0];\n      args[3] -= cursor[1];\n      cursor[0] += args[2];\n      cursor[1] += args[3];\n    }\n\n    // quadratic Bézier curveto (x1 y1 x y)\n    else if (command === 'q') {\n      cursor[0] += args[2];\n      cursor[1] += args[3];\n    } else if (command === 'Q') {\n      // Q → q\n      command = 'q';\n      args[0] -= cursor[0];\n      args[1] -= cursor[1];\n      args[2] -= cursor[0];\n      args[3] -= cursor[1];\n      cursor[0] += args[2];\n      cursor[1] += args[3];\n    }\n\n    // smooth quadratic Bézier curveto (x y)\n    else if (command === 't') {\n      cursor[0] += args[0];\n      cursor[1] += args[1];\n    } else if (command === 'T') {\n      // T → t\n      command = 't';\n      args[0] -= cursor[0];\n      args[1] -= cursor[1];\n      cursor[0] += args[0];\n      cursor[1] += args[1];\n    }\n\n    // elliptical arc (rx ry x-axis-rotation large-arc-flag sweep-flag x y)\n    else if (command === 'a') {\n      cursor[0] += args[5];\n      cursor[1] += args[6];\n    } else if (command === 'A') {\n      // A → a\n      command = 'a';\n      args[5] -= cursor[0];\n      args[6] -= cursor[1];\n      cursor[0] += args[5];\n      cursor[1] += args[6];\n    }\n\n    // closepath\n    else if (command === 'Z' || command === 'z') {\n      // reset cursor\n      cursor[0] = start[0];\n      cursor[1] = start[1];\n    }\n\n    pathItem.command = command;\n    pathItem.args = args;\n    // store absolute coordinates for later use\n    // base should preserve reference from other element\n    // @ts-expect-error\n    pathItem.base = prevCoords;\n    // @ts-expect-error\n    pathItem.coords = [cursor[0], cursor[1]];\n    // @ts-expect-error\n    prevCoords = pathItem.coords;\n  }\n\n  return pathData;\n};\n\n/**\n * Main filters loop.\n *\n * @param {import('../lib/types.js').PathDataItem[]} path\n * @param {InternalParams} params\n * @param {{ isSafeToUseZ: boolean, isSafeToRemove: (isFirstDraw: boolean, safeIfNotFirstDraw: boolean) => boolean, hasMarkerMid: boolean }} param2\n * @returns {import('../lib/types.js').PathDataItem[]}\n */\nfunction filters(path, params, { isSafeToUseZ, isSafeToRemove, hasMarkerMid }) {\n  const stringify = data2Path.bind(null, params);\n  const relSubpoint = [0, 0];\n  const pathBase = [0, 0];\n  /** @type {any} */\n  let prev = {};\n  /** @type {Point | undefined} */\n  let prevQControlPoint;\n\n  path = path.filter(function (item, index, path) {\n    const qControlPoint = prevQControlPoint;\n\n    let command = item.command;\n    let data = item.args;\n    let next = path[index + 1];\n\n    if (command !== 'Z' && command !== 'z') {\n      let sdata = data;\n      let circle;\n\n      if (command === 's') {\n        sdata = [0, 0].concat(data);\n\n        const pdata = prev.args;\n        const n = pdata.length;\n\n        // (-x, -y) of the prev tangent point relative to the current point\n        sdata[0] = pdata[n - 2] - pdata[n - 4];\n        sdata[1] = pdata[n - 1] - pdata[n - 3];\n      }\n\n      // convert curves to arcs if possible\n      if (\n        params.makeArcs &&\n        (command == 'c' || command == 's') &&\n        isConvex(sdata) &&\n        (circle = findCircle(sdata))\n      ) {\n        const r = roundData([circle.radius])[0];\n        let angle = findArcAngle(sdata, circle);\n        const sweep = sdata[5] * sdata[0] - sdata[4] * sdata[1] > 0 ? 1 : 0;\n        /** @type {import('../lib/types.js').PathDataItem} */\n        let arc = {\n          command: 'a',\n          args: [r, r, 0, 0, sweep, sdata[4], sdata[5]],\n          // @ts-expect-error\n          coords: item.coords.slice(),\n          // @ts-expect-error\n          base: item.base,\n        };\n        /** @type {import('../lib/types.js').PathDataItem[]} */\n        const output = [arc];\n        // relative coordinates to adjust the found circle\n        /** @type {Point} */\n        const relCenter = [\n          circle.center[0] - sdata[4],\n          circle.center[1] - sdata[5],\n        ];\n        const relCircle = { center: relCenter, radius: circle.radius };\n        const arcCurves = [item];\n        let hasPrev = 0;\n        let suffix = '';\n        let nextLonghand;\n\n        if (\n          (prev.command == 'c' &&\n            isConvex(prev.args) &&\n            isArcPrev(prev.args, circle)) ||\n          (prev.command == 'a' && prev.sdata && isArcPrev(prev.sdata, circle))\n        ) {\n          arcCurves.unshift(prev);\n          // @ts-expect-error\n          arc.base = prev.base;\n          // @ts-expect-error\n          arc.args[5] = arc.coords[0] - arc.base[0];\n          // @ts-expect-error\n          arc.args[6] = arc.coords[1] - arc.base[1];\n          const prevData = prev.command == 'a' ? prev.sdata : prev.args;\n          const prevAngle = findArcAngle(prevData, {\n            center: [\n              prevData[4] + circle.center[0],\n              prevData[5] + circle.center[1],\n            ],\n            radius: circle.radius,\n          });\n          angle += prevAngle;\n          if (angle > Math.PI) {\n            arc.args[3] = 1;\n          }\n          hasPrev = 1;\n        }\n\n        // check if next curves are fitting the arc\n        for (\n          var j = index;\n          (next = path[++j]) && (next.command === 'c' || next.command === 's');\n\n        ) {\n          let nextData = next.args;\n          if (next.command == 's') {\n            nextLonghand = makeLonghand(\n              { command: 's', args: next.args.slice() },\n              path[j - 1].args,\n            );\n            nextData = nextLonghand.args;\n            nextLonghand.args = nextData.slice(0, 2);\n            suffix = stringify([nextLonghand]);\n          }\n          if (isConvex(nextData) && isArc(nextData, relCircle)) {\n            angle += findArcAngle(nextData, relCircle);\n            if (angle - 2 * Math.PI > 1e-3) {\n              break;\n            } // more than 360°\n            if (angle > Math.PI) {\n              arc.args[3] = 1;\n            }\n            arcCurves.push(next);\n            if (2 * Math.PI - angle > 1e-3) {\n              // less than 360°\n              // @ts-expect-error\n              arc.coords = next.coords;\n              // @ts-expect-error\n              arc.args[5] = arc.coords[0] - arc.base[0];\n              // @ts-expect-error\n              arc.args[6] = arc.coords[1] - arc.base[1];\n            } else {\n              // full circle, make a half-circle arc and add a second one\n              arc.args[5] = 2 * (relCircle.center[0] - nextData[4]);\n              arc.args[6] = 2 * (relCircle.center[1] - nextData[5]);\n              // @ts-expect-error\n              arc.coords = [\n                // @ts-expect-error\n                arc.base[0] + arc.args[5],\n                // @ts-expect-error\n                arc.base[1] + arc.args[6],\n              ];\n              arc = {\n                command: 'a',\n                args: [\n                  r,\n                  r,\n                  0,\n                  0,\n                  sweep,\n                  // @ts-expect-error\n                  next.coords[0] - arc.coords[0],\n                  // @ts-expect-error\n                  next.coords[1] - arc.coords[1],\n                ],\n                // @ts-expect-error\n                coords: next.coords,\n                // @ts-expect-error\n                base: arc.coords,\n              };\n              output.push(arc);\n              j++;\n              break;\n            }\n            relCenter[0] -= nextData[4];\n            relCenter[1] -= nextData[5];\n          } else {\n            break;\n          }\n        }\n\n        if ((stringify(output) + suffix).length < stringify(arcCurves).length) {\n          if (path[j] && path[j].command == 's') {\n            makeLonghand(path[j], path[j - 1].args);\n          }\n          if (hasPrev) {\n            const prevArc = output.shift();\n            // @ts-expect-error\n            roundData(prevArc.args);\n            // @ts-expect-error\n            relSubpoint[0] += prevArc.args[5] - prev.args[prev.args.length - 2];\n            // @ts-expect-error\n            relSubpoint[1] += prevArc.args[6] - prev.args[prev.args.length - 1];\n            prev.command = 'a';\n            // @ts-expect-error\n            prev.args = prevArc.args;\n            // @ts-expect-error\n            item.base = prev.coords = prevArc.coords;\n          }\n          // @ts-expect-error\n          arc = output.shift();\n          if (arcCurves.length == 1) {\n            // @ts-expect-error\n            item.sdata = sdata.slice(); // preserve curve data for future checks\n          } else if (arcCurves.length - 1 - hasPrev > 0) {\n            // filter out consumed next items\n            path.splice(index + 1, arcCurves.length - 1 - hasPrev, ...output);\n          }\n          if (!arc) {\n            return false;\n          }\n          command = 'a';\n          data = arc.args;\n          // @ts-expect-error\n          item.coords = arc.coords;\n        }\n      }\n\n      // Rounding relative coordinates, taking in account accumulating error\n      // to get closer to absolute coordinates. Sum of rounded value remains same:\n      // l .25 3 .25 2 .25 3 .25 2 -> l .3 3 .2 2 .3 3 .2 2\n      if (precision !== false) {\n        if (\n          command === 'm' ||\n          command === 'l' ||\n          command === 't' ||\n          command === 'q' ||\n          command === 's' ||\n          command === 'c'\n        ) {\n          for (let i = data.length; i--; ) {\n            // @ts-expect-error\n            data[i] += item.base[i % 2] - relSubpoint[i % 2];\n          }\n        } else if (command == 'h') {\n          // @ts-expect-error\n          data[0] += item.base[0] - relSubpoint[0];\n        } else if (command == 'v') {\n          // @ts-expect-error\n          data[0] += item.base[1] - relSubpoint[1];\n        } else if (command == 'a') {\n          // @ts-expect-error\n          data[5] += item.base[0] - relSubpoint[0];\n          // @ts-expect-error\n          data[6] += item.base[1] - relSubpoint[1];\n        }\n        roundData(data);\n\n        if (command == 'h') {\n          relSubpoint[0] += data[0];\n        } else if (command == 'v') {\n          relSubpoint[1] += data[0];\n        } else {\n          relSubpoint[0] += data[data.length - 2];\n          relSubpoint[1] += data[data.length - 1];\n        }\n        roundData(relSubpoint);\n\n        if (command === 'M' || command === 'm') {\n          pathBase[0] = relSubpoint[0];\n          pathBase[1] = relSubpoint[1];\n        }\n      }\n\n      // round arc radius more accurately\n      // eg m 0 0 a 1234.567 1234.567 0 0 1 10 0 -> m 0 0 a 1235 1235 0 0 1 10 0\n      const sagitta = command === 'a' ? calculateSagitta(data) : undefined;\n      if (params.smartArcRounding && sagitta !== undefined && precision) {\n        for (let precisionNew = precision; precisionNew >= 0; precisionNew--) {\n          const radius = toFixed(data[0], precisionNew);\n          const sagittaNew = /** @type {number} */ (\n            calculateSagitta([radius, radius, ...data.slice(2)])\n          );\n          if (Math.abs(sagitta - sagittaNew) < error) {\n            data[0] = radius;\n            data[1] = radius;\n          } else {\n            break;\n          }\n        }\n      }\n\n      // convert straight curves into lines segments\n      if (params.straightCurves) {\n        if (\n          (command === 'c' && isCurveStraightLine(data)) ||\n          (command === 's' && isCurveStraightLine(sdata))\n        ) {\n          if (next && next.command == 's') {\n            makeLonghand(next, data);\n          } // fix up next curve\n          command = 'l';\n          data = data.slice(-2);\n        } else if (\n          (command === 'q' && isCurveStraightLine(data)) ||\n          (command === 't' && prev.command !== 'q' && prev.command !== 't')\n        ) {\n          if (command == 'q' && next && next.command == 't') {\n            makeLonghand(next, data);\n          } // fix up next curve\n          if (command == 't' && next && next.command == 't') {\n            next.command = 'q';\n            next.args.unshift(\n              // @ts-expect-error\n              // prettier-ignore\n              (2 * item.coords[0] - item.base[0]) - item.coords[0],\n              // @ts-expect-error\n              // prettier-ignore\n              (2 * item.coords[1] - item.base[1]) - item.coords[1],\n            );\n          } // fix up next curve\n          command = 'l';\n          data = data.slice(-2);\n        } else if (\n          command === 'a' &&\n          (data[0] === 0 ||\n            data[1] === 0 ||\n            (sagitta !== undefined && sagitta < error))\n        ) {\n          command = 'l';\n          data = data.slice(-2);\n        }\n      }\n\n      // degree-lower c to q when possible\n      // m 0 12 C 4 4 8 4 12 12 → M 0 12 Q 6 0 12 12\n      if (params.convertToQ && command == 'c') {\n        const x1 =\n          // @ts-expect-error\n          0.75 * (item.base[0] + data[0]) - 0.25 * item.base[0];\n        const x2 =\n          // @ts-expect-error\n          0.75 * (item.base[0] + data[2]) - 0.25 * (item.base[0] + data[4]);\n        if (Math.abs(x1 - x2) < error * 2) {\n          const y1 =\n            // @ts-expect-error\n            0.75 * (item.base[1] + data[1]) - 0.25 * item.base[1];\n          const y2 =\n            // @ts-expect-error\n            0.75 * (item.base[1] + data[3]) - 0.25 * (item.base[1] + data[5]);\n          if (Math.abs(y1 - y2) < error * 2) {\n            const newData = data.slice();\n            newData.splice(\n              0,\n              4,\n              // @ts-expect-error\n              x1 + x2 - item.base[0],\n              // @ts-expect-error\n              y1 + y2 - item.base[1],\n            );\n            roundData(newData);\n            const originalLength = cleanupOutData(data, params).length;\n            const newLength = cleanupOutData(newData, params).length;\n            if (newLength < originalLength) {\n              command = 'q';\n              data = newData;\n              if (next && next.command == 's') {\n                makeLonghand(next, data);\n              } // fix up next curve\n            }\n          }\n        }\n      }\n\n      // horizontal and vertical line shorthands\n      // l 50 0 → h 50\n      // l 0 50 → v 50\n      if (params.lineShorthands && command === 'l') {\n        if (data[1] === 0) {\n          command = 'h';\n          data.pop();\n        } else if (data[0] === 0) {\n          command = 'v';\n          data.shift();\n        }\n      }\n\n      // collapse repeated commands\n      // h 20 h 30 -> h 50\n      if (\n        params.collapseRepeated &&\n        hasMarkerMid === false &&\n        (command === 'm' || command === 'h' || command === 'v') &&\n        prev.command &&\n        command == prev.command.toLowerCase() &&\n        ((command != 'h' && command != 'v') ||\n          prev.args[0] >= 0 == data[0] >= 0)\n      ) {\n        prev.args[0] += data[0];\n        if (command != 'h' && command != 'v') {\n          prev.args[1] += data[1];\n        }\n        // @ts-expect-error\n        prev.coords = item.coords;\n        path[index] = prev;\n        return false;\n      }\n\n      // convert curves into smooth shorthands\n      if (params.curveSmoothShorthands && prev.command) {\n        // curveto\n        if (command === 'c') {\n          // c + c → c + s\n          if (\n            prev.command === 'c' &&\n            Math.abs(data[0] - -(prev.args[2] - prev.args[4])) < error &&\n            Math.abs(data[1] - -(prev.args[3] - prev.args[5])) < error\n          ) {\n            command = 's';\n            data = data.slice(2);\n          }\n\n          // s + c → s + s\n          else if (\n            prev.command === 's' &&\n            Math.abs(data[0] - -(prev.args[0] - prev.args[2])) < error &&\n            Math.abs(data[1] - -(prev.args[1] - prev.args[3])) < error\n          ) {\n            command = 's';\n            data = data.slice(2);\n          }\n\n          // [^cs] + c → [^cs] + s\n          else if (\n            prev.command !== 'c' &&\n            prev.command !== 's' &&\n            Math.abs(data[0]) < error &&\n            Math.abs(data[1]) < error\n          ) {\n            command = 's';\n            data = data.slice(2);\n          }\n        }\n\n        // quadratic Bézier curveto\n        else if (command === 'q') {\n          // q + q → q + t\n          if (\n            prev.command === 'q' &&\n            Math.abs(data[0] - (prev.args[2] - prev.args[0])) < error &&\n            Math.abs(data[1] - (prev.args[3] - prev.args[1])) < error\n          ) {\n            command = 't';\n            data = data.slice(2);\n          }\n\n          // t + q → t + t\n          else if (prev.command === 't') {\n            const predictedControlPoint = reflectPoint(\n              // @ts-expect-error\n              qControlPoint,\n              // @ts-expect-error\n              item.base,\n            );\n            const realControlPoint = [\n              // @ts-expect-error\n              data[0] + item.base[0],\n              // @ts-expect-error\n              data[1] + item.base[1],\n            ];\n            if (\n              Math.abs(predictedControlPoint[0] - realControlPoint[0]) <\n                error &&\n              Math.abs(predictedControlPoint[1] - realControlPoint[1]) < error\n            ) {\n              command = 't';\n              data = data.slice(2);\n            }\n          }\n        }\n      }\n\n      // remove useless non-first path segments\n      if (\n        params.removeUseless &&\n        isSafeToRemove(prev.command == 'm' || prev.command == 'M', true)\n      ) {\n        // l 0,0 / h 0 / v 0 / q 0,0 0,0 / t 0,0 / c 0,0 0,0 0,0 / s 0,0 0,0\n        if (\n          (command === 'l' ||\n            command === 'h' ||\n            command === 'v' ||\n            command === 'q' ||\n            command === 't' ||\n            command === 'c' ||\n            command === 's') &&\n          data.every(function (i) {\n            return i === 0;\n          })\n        ) {\n          path[index] = prev;\n          return false;\n        }\n\n        // a 25,25 -30 0,1 0,0\n        if (command === 'a' && data[5] === 0 && data[6] === 0) {\n          path[index] = prev;\n          return false;\n        }\n      }\n\n      // convert going home to z\n      // m 0 0 h 5 v 5 l -5 -5 -> m 0 0 h 5 v 5 z\n      if (\n        params.convertToZ &&\n        (isSafeToUseZ || next?.command === 'Z' || next?.command === 'z') &&\n        (command === 'l' || command === 'h' || command === 'v')\n      ) {\n        if (\n          // @ts-expect-error\n          Math.abs(pathBase[0] - item.coords[0]) < error &&\n          // @ts-expect-error\n          Math.abs(pathBase[1] - item.coords[1]) < error\n        ) {\n          command = 'z';\n          data = [];\n        }\n      }\n\n      item.command = command;\n      item.args = data;\n    } else {\n      // z resets coordinates\n      relSubpoint[0] = pathBase[0];\n      relSubpoint[1] = pathBase[1];\n      if (prev.command === 'Z' || prev.command === 'z') {\n        return false;\n      }\n    }\n    if (\n      (command === 'Z' || command === 'z') &&\n      params.removeUseless &&\n      isSafeToRemove(\n        prev.command == 'm' || prev.command == 'M',\n        isSafeToUseZ,\n      ) &&\n      // @ts-expect-error\n      Math.abs(item.base[0] - item.coords[0]) < error / 10 &&\n      // @ts-expect-error\n      Math.abs(item.base[1] - item.coords[1]) < error / 10\n    ) {\n      return false;\n    }\n\n    if (command === 'q') {\n      // @ts-expect-error\n      prevQControlPoint = [data[0] + item.base[0], data[1] + item.base[1]];\n    } else if (command === 't') {\n      if (qControlPoint) {\n        // @ts-expect-error\n        prevQControlPoint = reflectPoint(qControlPoint, item.base);\n      } else {\n        // @ts-expect-error\n        prevQControlPoint = item.coords;\n      }\n    } else {\n      prevQControlPoint = undefined;\n    }\n    prev = item;\n    return true;\n  });\n\n  return path;\n}\n\n/**\n * Writes data in shortest form using absolute or relative coordinates.\n *\n * @param {import('../lib/types.js').PathDataItem[]} path\n * @param {InternalParams} params\n * @returns {import('../lib/types.js').PathDataItem[]}\n */\nfunction convertToMixed(path, params) {\n  let prev = path[0];\n\n  path = path.filter(function (item, index) {\n    if (index == 0) {\n      return true;\n    }\n    if (item.command === 'Z' || item.command === 'z') {\n      prev = item;\n      return true;\n    }\n\n    const command = item.command;\n    const data = item.args;\n    const adata = data.slice();\n    const rdata = data.slice();\n\n    if (\n      command === 'm' ||\n      command === 'l' ||\n      command === 't' ||\n      command === 'q' ||\n      command === 's' ||\n      command === 'c'\n    ) {\n      for (let i = adata.length; i--; ) {\n        // @ts-expect-error\n        adata[i] += item.base[i % 2];\n      }\n    } else if (command == 'h') {\n      // @ts-expect-error\n      adata[0] += item.base[0];\n    } else if (command == 'v') {\n      // @ts-expect-error\n      adata[0] += item.base[1];\n    } else if (command == 'a') {\n      // @ts-expect-error\n      adata[5] += item.base[0];\n      // @ts-expect-error\n      adata[6] += item.base[1];\n    }\n\n    roundData(adata);\n    roundData(rdata);\n\n    const absoluteDataStr = cleanupOutData(adata, params);\n    const relativeDataStr = cleanupOutData(rdata, params);\n\n    // Convert to absolute coordinates if it's shorter or forceAbsolutePath is true.\n    // v-20 -> V0\n    // Don't convert if it fits following previous command.\n    // l20 30-10-50 instead of l20 30L20 30\n    if (\n      params.forceAbsolutePath ||\n      (absoluteDataStr.length < relativeDataStr.length &&\n        !(\n          params.negativeExtraSpace &&\n          command == prev.command &&\n          prev.command.charCodeAt(0) > 96 &&\n          absoluteDataStr.length == relativeDataStr.length - 1 &&\n          (data[0] < 0 ||\n            (Math.floor(data[0]) === 0 &&\n              !Number.isInteger(data[0]) &&\n              prev.args[prev.args.length - 1] % 1))\n        ))\n    ) {\n      // @ts-expect-error\n      item.command = command.toUpperCase();\n      item.args = adata;\n    }\n\n    prev = item;\n    return true;\n  });\n\n  return path;\n}\n\n/**\n * Checks if curve is convex. Control points of such a curve must form a convex\n * quadrilateral with diagonals crosspoint inside of it.\n *\n * @param {ReadonlyArray<number>} data\n * @returns {boolean}\n */\nfunction isConvex(data) {\n  const center = getIntersection([\n    0,\n    0,\n    data[2],\n    data[3],\n    data[0],\n    data[1],\n    data[4],\n    data[5],\n  ]);\n\n  return (\n    center != null &&\n    data[2] < center[0] == center[0] < 0 &&\n    data[3] < center[1] == center[1] < 0 &&\n    data[4] < center[0] == center[0] < data[0] &&\n    data[5] < center[1] == center[1] < data[1]\n  );\n}\n\n/**\n * Computes lines equations by two points and returns their intersection point.\n *\n * @param {ReadonlyArray<number>} coords\n * @returns {Point | undefined}\n */\nfunction getIntersection(coords) {\n  // Prev line equation parameters.\n  const a1 = coords[1] - coords[3]; // y1 - y2\n  const b1 = coords[2] - coords[0]; // x2 - x1\n  const c1 = coords[0] * coords[3] - coords[2] * coords[1]; // x1 * y2 - x2 * y1\n  // Next line equation parameters\n  const a2 = coords[5] - coords[7]; // y1 - y2\n  const b2 = coords[6] - coords[4]; // x2 - x1\n  const c2 = coords[4] * coords[7] - coords[5] * coords[6]; // x1 * y2 - x2 * y1\n  const denom = a1 * b2 - a2 * b1;\n\n  if (!denom) {\n    return;\n  } // parallel lines haven't an intersection\n\n  /** @type {Point} */\n  const cross = [(b1 * c2 - b2 * c1) / denom, (a1 * c2 - a2 * c1) / -denom];\n  if (\n    !isNaN(cross[0]) &&\n    !isNaN(cross[1]) &&\n    isFinite(cross[0]) &&\n    isFinite(cross[1])\n  ) {\n    return cross;\n  }\n}\n\n/**\n * Decrease accuracy of floating-point numbers in path data keeping a specified\n * number of decimals. Smart rounds values like 2.3491 to 2.35 instead of 2.349.\n * Doesn't apply \"smartness\" if the number precision fits already.\n *\n * @param {number[]} data\n * @returns {number[]}\n */\nfunction strongRound(data) {\n  const precisionNum = precision || 0;\n  for (let i = data.length; i-- > 0; ) {\n    const fixed = toFixed(data[i], precisionNum);\n    if (fixed !== data[i]) {\n      const rounded = toFixed(data[i], precisionNum - 1);\n      data[i] =\n        toFixed(Math.abs(rounded - data[i]), precisionNum + 1) >= error\n          ? fixed\n          : rounded;\n    }\n  }\n  return data;\n}\n\n/**\n * Simple rounding function if precision is 0.\n *\n * @param {number[]} data\n * @returns {number[]}\n */\nfunction round(data) {\n  for (let i = data.length; i-- > 0; ) {\n    data[i] = Math.round(data[i]);\n  }\n  return data;\n}\n\n/**\n * Checks if a curve is a straight line by measuring distance from middle points\n * to the line formed by end points.\n *\n * @param {ReadonlyArray<number>} data\n * @returns {boolean}\n */\nfunction isCurveStraightLine(data) {\n  // Get line equation a·x + b·y + c = 0 coefficients a, b (c = 0) by start and end points.\n  let i = data.length - 2;\n  const a = -data[i + 1]; // y1 − y2 (y1 = 0)\n  const b = data[i]; // x2 − x1 (x1 = 0)\n  const d = 1 / (a * a + b * b); // same part for all points\n\n  if (i <= 1 || !isFinite(d)) {\n    return false;\n  } // curve that ends at start point isn't the case\n\n  // Distance from point (x0, y0) to the line is sqrt((c − a·x0 − b·y0)² / (a² + b²))\n  while ((i -= 2) >= 0) {\n    if (Math.sqrt(Math.pow(a * data[i] + b * data[i + 1], 2) * d) > error) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\n/**\n * Calculates the sagitta of an arc if possible.\n *\n * @see https://wikipedia.org/wiki/Sagitta_(geometry)#Formulas\n * @param {ReadonlyArray<number>} data\n * @returns {number | undefined}\n */\nfunction calculateSagitta(data) {\n  if (data[3] === 1) {\n    return undefined;\n  }\n  const [rx, ry] = data;\n  if (Math.abs(rx - ry) > error) {\n    return undefined;\n  }\n  const chord = Math.hypot(data[5], data[6]);\n  if (chord > rx * 2) {\n    return undefined;\n  }\n  return rx - Math.sqrt(rx ** 2 - 0.25 * chord ** 2);\n}\n\n/**\n * Converts next curve from shorthand to full form using the current curve data.\n *\n * @param {import('../lib/types.js').PathDataItem} item\n * @param {ReadonlyArray<number>} data\n * @returns {import('../lib/types.js').PathDataItem}\n */\nfunction makeLonghand(item, data) {\n  switch (item.command) {\n    case 's':\n      item.command = 'c';\n      break;\n    case 't':\n      item.command = 'q';\n      break;\n  }\n  item.args.unshift(\n    data[data.length - 2] - data[data.length - 4],\n    data[data.length - 1] - data[data.length - 3],\n  );\n  return item;\n}\n\n/**\n * Returns distance between two points\n *\n * @param {Point} point1\n * @param {Point} point2\n * @returns {number}\n */\nfunction getDistance(point1, point2) {\n  return Math.hypot(point1[0] - point2[0], point1[1] - point2[1]);\n}\n\n/**\n * Reflects point across another point.\n *\n * @param {Point} controlPoint\n * @param {Point} base\n * @returns {Point}\n */\nfunction reflectPoint(controlPoint, base) {\n  return [2 * base[0] - controlPoint[0], 2 * base[1] - controlPoint[1]];\n}\n\n/**\n * Returns coordinates of the curve point corresponding to the certain t\n * a·(1 - t)³·p1 + b·(1 - t)²·t·p2 + c·(1 - t)·t²·p3 + d·t³·p4,\n * where pN are control points and p1 is zero due to relative coordinates.\n *\n * @param {ReadonlyArray<number>} curve\n * @param {number} t\n * @returns {Point}\n */\nfunction getCubicBezierPoint(curve, t) {\n  const sqrT = t * t;\n  const cubT = sqrT * t;\n  const mt = 1 - t;\n  const sqrMt = mt * mt;\n\n  return [\n    3 * sqrMt * t * curve[0] + 3 * mt * sqrT * curve[2] + cubT * curve[4],\n    3 * sqrMt * t * curve[1] + 3 * mt * sqrT * curve[3] + cubT * curve[5],\n  ];\n}\n\n/**\n * Finds circle by 3 points of the curve and checks if the curve fits the found circle.\n *\n * @param {ReadonlyArray<number>} curve\n * @returns {Circle | undefined}\n */\nfunction findCircle(curve) {\n  const midPoint = getCubicBezierPoint(curve, 1 / 2);\n  const m1 = [midPoint[0] / 2, midPoint[1] / 2];\n  const m2 = [(midPoint[0] + curve[4]) / 2, (midPoint[1] + curve[5]) / 2];\n  const center = getIntersection([\n    m1[0],\n    m1[1],\n    m1[0] + m1[1],\n    m1[1] - m1[0],\n    m2[0],\n    m2[1],\n    m2[0] + (m2[1] - midPoint[1]),\n    m2[1] - (m2[0] - midPoint[0]),\n  ]);\n  const radius = center && getDistance([0, 0], center);\n  const tolerance = Math.min(\n    arcThreshold * error,\n    // @ts-expect-error\n    (arcTolerance * radius) / 100,\n  );\n\n  if (\n    center &&\n    // @ts-expect-error\n    radius < 1e15 &&\n    [1 / 4, 3 / 4].every(function (point) {\n      return (\n        Math.abs(\n          // @ts-expect-error\n          getDistance(getCubicBezierPoint(curve, point), center) - radius,\n        ) <= tolerance\n      );\n    })\n  ) {\n    // @ts-expect-error\n    return { center: center, radius: radius };\n  }\n}\n\n/**\n * Checks if a curve fits the given circle.\n *\n * @param {ReadonlyArray<number>} curve\n * @param {Circle} circle\n * @returns {boolean}\n */\nfunction isArc(curve, circle) {\n  const tolerance = Math.min(\n    arcThreshold * error,\n    (arcTolerance * circle.radius) / 100,\n  );\n\n  return [0, 1 / 4, 1 / 2, 3 / 4, 1].every(function (point) {\n    return (\n      Math.abs(\n        getDistance(getCubicBezierPoint(curve, point), circle.center) -\n          circle.radius,\n      ) <= tolerance\n    );\n  });\n}\n\n/**\n * Checks if a previous curve fits the given circle.\n *\n * @param {ReadonlyArray<number>} curve\n * @param {Circle} circle\n * @returns {boolean}\n */\nfunction isArcPrev(curve, circle) {\n  return isArc(curve, {\n    center: [circle.center[0] + curve[4], circle.center[1] + curve[5]],\n    radius: circle.radius,\n  });\n}\n\n/**\n * Finds angle of a curve fitting the given arc.\n *\n * @param {ReadonlyArray<number>} curve\n * @param {Circle} relCircle\n * @returns {number}\n */\nfunction findArcAngle(curve, relCircle) {\n  const x1 = -relCircle.center[0];\n  const y1 = -relCircle.center[1];\n  const x2 = curve[4] - relCircle.center[0];\n  const y2 = curve[5] - relCircle.center[1];\n\n  return Math.acos(\n    (x1 * x2 + y1 * y2) / Math.sqrt((x1 * x1 + y1 * y1) * (x2 * x2 + y2 * y2)),\n  );\n}\n\n/**\n * Converts given path data to string.\n *\n * @param {InternalParams} params\n * @param {ReadonlyArray<import('../lib/types.js').PathDataItem>} pathData\n * @returns {string}\n */\nfunction data2Path(params, pathData) {\n  return pathData.reduce(function (pathString, item) {\n    let strData = '';\n    if (item.args) {\n      strData = cleanupOutData(roundData(item.args.slice()), params);\n    }\n    return pathString + item.command + strData;\n  }, '');\n}\n"
  },
  {
    "path": "plugins/convertShapeToPath.js",
    "content": "import { stringifyPathData } from '../lib/path.js';\nimport { detachNodeFromParent } from '../lib/xast.js';\n\n/**\n * @typedef ConvertShapeToPathParams\n * @property {boolean=} convertArcs\n * @property {number=} floatPrecision\n */\n\nexport const name = 'convertShapeToPath';\nexport const description = 'converts basic shapes to more compact path form';\n\nconst regNumber = /[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?/g;\n\n/**\n * Converts basic shape to more compact path. It also allows further\n * optimizations like combining paths with similar attributes.\n *\n * @see https://www.w3.org/TR/SVG11/shapes.html\n *\n * @author Lev Solntsev\n *\n * @type {import('../lib/types.js').Plugin<ConvertShapeToPathParams>}\n */\nexport const fn = (root, params) => {\n  const { convertArcs = false, floatPrecision: precision } = params;\n\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        // convert rect to path\n        if (\n          node.name === 'rect' &&\n          node.attributes.width != null &&\n          node.attributes.height != null &&\n          node.attributes.rx == null &&\n          node.attributes.ry == null\n        ) {\n          const x = Number(node.attributes.x || '0');\n          const y = Number(node.attributes.y || '0');\n          const width = Number(node.attributes.width);\n          const height = Number(node.attributes.height);\n          // Values like '100%' compute to NaN, thus running after\n          // cleanupNumericValues when 'px' units has already been removed.\n          // TODO: Calculate sizes from % and non-px units if possible.\n          if (Number.isNaN(x - y + width - height)) {\n            return;\n          }\n          /** @type {import('../lib/types.js').PathDataItem[]} */\n          const pathData = [\n            { command: 'M', args: [x, y] },\n            { command: 'H', args: [x + width] },\n            { command: 'V', args: [y + height] },\n            { command: 'H', args: [x] },\n            { command: 'z', args: [] },\n          ];\n          node.name = 'path';\n          node.attributes.d = stringifyPathData({ pathData, precision });\n          delete node.attributes.x;\n          delete node.attributes.y;\n          delete node.attributes.width;\n          delete node.attributes.height;\n        }\n\n        // convert line to path\n        if (node.name === 'line') {\n          const x1 = Number(node.attributes.x1 || '0');\n          const y1 = Number(node.attributes.y1 || '0');\n          const x2 = Number(node.attributes.x2 || '0');\n          const y2 = Number(node.attributes.y2 || '0');\n          if (Number.isNaN(x1 - y1 + x2 - y2)) {\n            return;\n          }\n          /** @type {import('../lib/types.js').PathDataItem[]} */\n          const pathData = [\n            { command: 'M', args: [x1, y1] },\n            { command: 'L', args: [x2, y2] },\n          ];\n          node.name = 'path';\n          node.attributes.d = stringifyPathData({ pathData, precision });\n          delete node.attributes.x1;\n          delete node.attributes.y1;\n          delete node.attributes.x2;\n          delete node.attributes.y2;\n        }\n\n        // convert polyline and polygon to path\n        if (\n          (node.name === 'polyline' || node.name === 'polygon') &&\n          node.attributes.points != null\n        ) {\n          const coords = (node.attributes.points.match(regNumber) || []).map(\n            Number,\n          );\n          if (coords.length < 4) {\n            detachNodeFromParent(node, parentNode);\n            return;\n          }\n          /** @type {import('../lib/types.js').PathDataItem[]} */\n          const pathData = [];\n          for (let i = 0; i < coords.length; i += 2) {\n            pathData.push({\n              command: i === 0 ? 'M' : 'L',\n              args: coords.slice(i, i + 2),\n            });\n          }\n          if (node.name === 'polygon') {\n            pathData.push({ command: 'z', args: [] });\n          }\n          node.name = 'path';\n          node.attributes.d = stringifyPathData({ pathData, precision });\n          delete node.attributes.points;\n        }\n\n        //  optionally convert circle\n        if (node.name === 'circle' && convertArcs) {\n          const cx = Number(node.attributes.cx || '0');\n          const cy = Number(node.attributes.cy || '0');\n          const r = Number(node.attributes.r || '0');\n          if (Number.isNaN(cx - cy + r)) {\n            return;\n          }\n          /** @type {import('../lib/types.js').PathDataItem[]} */\n          const pathData = [\n            { command: 'M', args: [cx, cy - r] },\n            { command: 'A', args: [r, r, 0, 1, 0, cx, cy + r] },\n            { command: 'A', args: [r, r, 0, 1, 0, cx, cy - r] },\n            { command: 'z', args: [] },\n          ];\n          node.name = 'path';\n          node.attributes.d = stringifyPathData({ pathData, precision });\n          delete node.attributes.cx;\n          delete node.attributes.cy;\n          delete node.attributes.r;\n        }\n\n        // optionally convert ellipse\n        if (node.name === 'ellipse' && convertArcs) {\n          const ecx = Number(node.attributes.cx || '0');\n          const ecy = Number(node.attributes.cy || '0');\n          const rx = Number(node.attributes.rx || '0');\n          const ry = Number(node.attributes.ry || '0');\n          if (Number.isNaN(ecx - ecy + rx - ry)) {\n            return;\n          }\n          /** @type {import('../lib/types.js').PathDataItem[]} */\n          const pathData = [\n            { command: 'M', args: [ecx, ecy - ry] },\n            { command: 'A', args: [rx, ry, 0, 1, 0, ecx, ecy + ry] },\n            { command: 'A', args: [rx, ry, 0, 1, 0, ecx, ecy - ry] },\n            { command: 'z', args: [] },\n          ];\n          node.name = 'path';\n          node.attributes.d = stringifyPathData({ pathData, precision });\n          delete node.attributes.cx;\n          delete node.attributes.cy;\n          delete node.attributes.rx;\n          delete node.attributes.ry;\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/convertStyleToAttrs.js",
    "content": "import { attrsGroups } from './_collections.js';\n\n/**\n * @typedef ConvertStyleToAttrsParams\n * @property {boolean=} keepImportant\n */\n\nexport const name = 'convertStyleToAttrs';\nexport const description = 'converts style to attributes';\n\n/**\n * @param {...string} args\n * @returns {string}\n */\nconst g = (...args) => {\n  return '(?:' + args.join('|') + ')';\n};\n\nconst stylingProps = attrsGroups.presentation;\nconst rEscape = '\\\\\\\\(?:[0-9a-f]{1,6}\\\\s?|\\\\r\\\\n|.)'; // Like \\\" or \\2051. Code points consume one space.\n\n/** Pattern to match attribute name like: 'fill' */\nconst rAttr = '\\\\s*(' + g('[^:;\\\\\\\\]', rEscape) + '*?)\\\\s*';\n\n/** Pattern to match string in single quotes like: 'foo' */\nconst rSingleQuotes = \"'(?:[^'\\\\n\\\\r\\\\\\\\]|\" + rEscape + \")*?(?:'|$)\";\n\n/** Pattern to match string in double quotes like: \"foo\" */\nconst rQuotes = '\"(?:[^\"\\\\n\\\\r\\\\\\\\]|' + rEscape + ')*?(?:\"|$)';\n\nconst rQuotedString = new RegExp('^' + g(rSingleQuotes, rQuotes) + '$');\n// Parentheses, E.g.: url(data:image/png;base64,iVBO...).\n// ':' and ';' inside of it should be treated as is. (Just like in strings.)\nconst rParenthesis =\n  '\\\\(' + g('[^\\'\"()\\\\\\\\]+', rEscape, rSingleQuotes, rQuotes) + '*?' + '\\\\)';\n// The value. It can have strings and parentheses (see above). Fallbacks to anything in case of unexpected input.\nconst rValue =\n  '\\\\s*(' +\n  g(\n    '[^!\\'\"();\\\\\\\\]+?',\n    rEscape,\n    rSingleQuotes,\n    rQuotes,\n    rParenthesis,\n    '[^;]*?',\n  ) +\n  '*?' +\n  ')';\n// End of declaration. Spaces outside of capturing groups help to do natural trimming.\nconst rDeclEnd = '\\\\s*(?:;\\\\s*|$)';\n// Important rule\nconst rImportant = '(\\\\s*!important(?![-(\\\\w]))?';\n// Final RegExp to parse CSS declarations.\nconst regDeclarationBlock = new RegExp(\n  rAttr + ':' + rValue + rImportant + rDeclEnd,\n  'ig',\n);\n// Comments expression. Honors escape sequences and strings.\nconst regStripComments = new RegExp(\n  g(rEscape, rSingleQuotes, rQuotes, '/\\\\*[^]*?\\\\*/'),\n  'ig',\n);\n\n/**\n * Convert style in attributes. Cleanups comments and illegal declarations (without colon) as a side effect.\n *\n * @example\n * <g style=\"fill:#000; color: #fff;\">\n *  ⬇\n * <g fill=\"#000\" color=\"#fff\">\n *\n * @example\n * <g style=\"fill:#000; color: #fff; -webkit-blah: blah\">\n *  ⬇\n * <g fill=\"#000\" color=\"#fff\" style=\"-webkit-blah: blah\">\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin<ConvertStyleToAttrsParams>}\n */\nexport const fn = (_root, params) => {\n  const { keepImportant = false } = params;\n  return {\n    element: {\n      enter: (node) => {\n        if (node.attributes.style != null) {\n          // ['opacity: 1', 'color: #000']\n          let styles = [];\n          /** @type {Record<string, string>} */\n          const newAttributes = {};\n\n          // Strip CSS comments preserving escape sequences and strings.\n          const styleValue = node.attributes.style.replace(\n            regStripComments,\n            (match) => {\n              return match[0] == '/'\n                ? ''\n                : match[0] == '\\\\' && /[-g-z]/i.test(match[1])\n                  ? match[1]\n                  : match;\n            },\n          );\n\n          regDeclarationBlock.lastIndex = 0;\n          for (var rule; (rule = regDeclarationBlock.exec(styleValue)); ) {\n            if (!keepImportant || !rule[3]) {\n              styles.push([rule[1], rule[2]]);\n            }\n          }\n\n          if (styles.length) {\n            styles = styles.filter(function (style) {\n              if (style[0]) {\n                const prop = style[0].toLowerCase();\n                let val = style[1];\n\n                if (rQuotedString.test(val)) {\n                  val = val.slice(1, -1);\n                }\n\n                if (stylingProps.has(prop)) {\n                  newAttributes[prop] = val;\n\n                  return false;\n                }\n              }\n\n              return true;\n            });\n\n            Object.assign(node.attributes, newAttributes);\n\n            if (styles.length) {\n              node.attributes.style = styles\n                .map((declaration) => declaration.join(':'))\n                .join(';');\n            } else {\n              delete node.attributes.style;\n            }\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/convertTransform.js",
    "content": "import {\n  js2transform,\n  matrixToTransform,\n  roundTransform,\n  transform2js,\n  transformsMultiply,\n} from './_transforms.js';\n\n/**\n * @typedef ConvertTransformParams\n * @property {boolean=} convertToShorts\n * @property {number=} degPrecision\n * @property {number=} floatPrecision\n * @property {number=} transformPrecision\n * @property {boolean=} matrixToTransform\n * @property {boolean=} shortTranslate\n * @property {boolean=} shortScale\n * @property {boolean=} shortRotate\n * @property {boolean=} removeUseless\n * @property {boolean=} collapseIntoOne\n * @property {boolean=} leadingZero\n * @property {boolean=} negativeExtraSpace\n *\n * @typedef TransformParams\n * @property {boolean} convertToShorts\n * @property {number=} degPrecision\n * @property {number} floatPrecision\n * @property {number} transformPrecision\n * @property {boolean} matrixToTransform\n * @property {boolean} shortTranslate\n * @property {boolean} shortScale\n * @property {boolean} shortRotate\n * @property {boolean} removeUseless\n * @property {boolean} collapseIntoOne\n * @property {boolean} leadingZero\n * @property {boolean} negativeExtraSpace\n *\n * @typedef TransformItem\n * @property {string} name\n * @property {number[]} data\n */\n\nexport const name = 'convertTransform';\nexport const description =\n  'collapses multiple transformations and optimizes it';\n\n/**\n * Convert matrices to the short aliases,\n * convert long translate, scale or rotate transform notations to the shorts ones,\n * convert transforms to the matrices and multiply them all into one,\n * remove useless transforms.\n *\n * @see https://www.w3.org/TR/SVG11/coords.html#TransformMatrixDefined\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin<ConvertTransformParams>}\n */\nexport const fn = (_root, params) => {\n  const {\n    convertToShorts = true,\n    // degPrecision = 3, // transformPrecision (or matrix precision) - 2 by default\n    degPrecision,\n    floatPrecision = 3,\n    transformPrecision = 5,\n    matrixToTransform = true,\n    shortTranslate = true,\n    shortScale = true,\n    shortRotate = true,\n    removeUseless = true,\n    collapseIntoOne = true,\n    leadingZero = true,\n    negativeExtraSpace = false,\n  } = params;\n  const newParams = {\n    convertToShorts,\n    degPrecision,\n    floatPrecision,\n    transformPrecision,\n    matrixToTransform,\n    shortTranslate,\n    shortScale,\n    shortRotate,\n    removeUseless,\n    collapseIntoOne,\n    leadingZero,\n    negativeExtraSpace,\n  };\n  return {\n    element: {\n      enter: (node) => {\n        if (node.attributes.transform != null) {\n          convertTransform(node, 'transform', newParams);\n        }\n\n        if (node.attributes.gradientTransform != null) {\n          convertTransform(node, 'gradientTransform', newParams);\n        }\n\n        if (node.attributes.patternTransform != null) {\n          convertTransform(node, 'patternTransform', newParams);\n        }\n      },\n    },\n  };\n};\n\n/**\n * @param {import('../lib/types.js').XastElement} item\n * @param {string} attrName\n * @param {TransformParams} params\n */\nconst convertTransform = (item, attrName, params) => {\n  let data = transform2js(item.attributes[attrName]);\n  params = definePrecision(data, params);\n\n  if (params.collapseIntoOne && data.length > 1) {\n    data = [transformsMultiply(data)];\n  }\n\n  if (params.convertToShorts) {\n    data = convertToShorts(data, params);\n  } else {\n    data.forEach((item) => roundTransform(item, params));\n  }\n\n  if (params.removeUseless) {\n    data = removeUseless(data);\n  }\n\n  if (data.length) {\n    item.attributes[attrName] = js2transform(data, params);\n  } else {\n    delete item.attributes[attrName];\n  }\n};\n\n/**\n * Defines precision to work with certain parts.\n *\n * - `transformPrecision` - for scale and four first matrix parameters (needs a better precision due to multiplying).\n * - `floatPrecision` - for translate including two last matrix and rotate parameters.\n * - `degPrecision` - for rotate and skew. By default it's equal to (roughly).\n * - `transformPrecision` - 2 or floatPrecision whichever is lower. Can be set in params.\n *\n * Clone parameters so that it doesn't affect other element transformations.\n *\n * @param {ReadonlyArray<TransformItem>} data\n * @param {TransformParams} param1\n * @returns {TransformParams}\n */\nconst definePrecision = (data, { ...newParams }) => {\n  const matrixData = [];\n  for (const item of data) {\n    if (item.name == 'matrix') {\n      matrixData.push(...item.data.slice(0, 4));\n    }\n  }\n  let numberOfDigits = newParams.transformPrecision;\n  // Limit transform precision with matrix one. Calculating with larger precision doesn't add any value.\n  if (matrixData.length) {\n    newParams.transformPrecision = Math.min(\n      newParams.transformPrecision,\n      Math.max.apply(Math, matrixData.map(floatDigits)) ||\n        newParams.transformPrecision,\n    );\n    numberOfDigits = Math.max.apply(\n      Math,\n      matrixData.map(\n        (n) => n.toString().replace(/\\D+/g, '').length, // Number of digits in a number. 123.45 → 5\n      ),\n    );\n  }\n  // No sense in angle precision more than number of significant digits in matrix.\n  if (newParams.degPrecision == null) {\n    newParams.degPrecision = Math.max(\n      0,\n      Math.min(newParams.floatPrecision, numberOfDigits - 2),\n    );\n  }\n  return newParams;\n};\n\n/**\n * Returns number of digits after the point.\n *\n * @example 0.125 → 3\n * @param {number} n\n * @returns {number}\n */\nconst floatDigits = (n) => {\n  const str = n.toString();\n  return str.slice(str.indexOf('.')).length - 1;\n};\n\n/**\n * Convert transforms to the shorthand alternatives.\n *\n * @param {TransformItem[]} transforms\n * @param {TransformParams} params\n * @returns {TransformItem[]}\n */\nconst convertToShorts = (transforms, params) => {\n  for (let i = 0; i < transforms.length; i++) {\n    let transform = transforms[i];\n\n    // convert matrix to the short aliases\n    if (params.matrixToTransform && transform.name === 'matrix') {\n      const decomposed = matrixToTransform(transform, params);\n      if (\n        js2transform(decomposed, params).length <=\n        js2transform([transform], params).length\n      ) {\n        transforms.splice(i, 1, ...decomposed);\n      }\n      transform = transforms[i];\n    }\n\n    // fixed-point numbers\n    // 12.754997 → 12.755\n    roundTransform(transform, params);\n\n    // convert long translate transform notation to the shorts one\n    // translate(10 0) → translate(10)\n    if (\n      params.shortTranslate &&\n      transform.name === 'translate' &&\n      transform.data.length === 2 &&\n      !transform.data[1]\n    ) {\n      transform.data.pop();\n    }\n\n    // convert long scale transform notation to the shorts one\n    // scale(2 2) → scale(2)\n    if (\n      params.shortScale &&\n      transform.name === 'scale' &&\n      transform.data.length === 2 &&\n      transform.data[0] === transform.data[1]\n    ) {\n      transform.data.pop();\n    }\n\n    // convert long rotate transform notation to the short one\n    // translate(cx cy) rotate(a) translate(-cx -cy) → rotate(a cx cy)\n    if (\n      params.shortRotate &&\n      transforms[i - 2]?.name === 'translate' &&\n      transforms[i - 1].name === 'rotate' &&\n      transforms[i].name === 'translate' &&\n      transforms[i - 2].data[0] === -transforms[i].data[0] &&\n      transforms[i - 2].data[1] === -transforms[i].data[1]\n    ) {\n      transforms.splice(i - 2, 3, {\n        name: 'rotate',\n        data: [\n          transforms[i - 1].data[0],\n          transforms[i - 2].data[0],\n          transforms[i - 2].data[1],\n        ],\n      });\n\n      // splice compensation\n      i -= 2;\n    }\n  }\n\n  return transforms;\n};\n\n/**\n * Remove useless transforms.\n *\n * @param {ReadonlyArray<TransformItem>} transforms\n * @returns {TransformItem[]}\n */\nconst removeUseless = (transforms) => {\n  return transforms.filter((transform) => {\n    // translate(0), rotate(0[, cx, cy]), skewX(0), skewY(0)\n    if (\n      (['translate', 'rotate', 'skewX', 'skewY'].indexOf(transform.name) > -1 &&\n        (transform.data.length == 1 || transform.name == 'rotate') &&\n        !transform.data[0]) ||\n      // translate(0, 0)\n      (transform.name == 'translate' &&\n        !transform.data[0] &&\n        !transform.data[1]) ||\n      // scale(1)\n      (transform.name == 'scale' &&\n        transform.data[0] == 1 &&\n        (transform.data.length < 2 || transform.data[1] == 1)) ||\n      // matrix(1 0 0 1 0 0)\n      (transform.name == 'matrix' &&\n        transform.data[0] == 1 &&\n        transform.data[3] == 1 &&\n        !(\n          transform.data[1] ||\n          transform.data[2] ||\n          transform.data[4] ||\n          transform.data[5]\n        ))\n    ) {\n      return false;\n    }\n\n    return true;\n  });\n};\n"
  },
  {
    "path": "plugins/inlineStyles.js",
    "content": "import * as csstree from 'css-tree';\nimport { syntax } from 'csso';\nimport { attrsGroups, pseudoClasses } from './_collections.js';\nimport { detachNodeFromParent, querySelectorAll } from '../lib/xast.js';\nimport { visitSkip } from '../lib/util/visit.js';\nimport { compareSpecificity, includesAttrSelector } from '../lib/style.js';\n\n/**\n * @typedef InlineStylesParams\n * @property {boolean=} onlyMatchedOnce Inlines selectors that match once only.\n * @property {boolean=} removeMatchedSelectors\n *   Clean up matched selectors. Unused selects are left as-is.\n * @property {string[]=} useMqs\n *   Media queries to use. An empty string indicates all selectors outside of\n *   media queries.\n * @property {string[]=} usePseudos\n *   Pseudo-classes and elements to use. An empty string indicates all\n *   non-pseudo-classes and elements.\n */\n\nexport const name = 'inlineStyles';\nexport const description = 'inline styles (additional options)';\n\n/**\n * Some pseudo-classes can only be calculated by clients, like :visited,\n * :future, or :hover, but there are other pseudo-classes that we can evaluate\n * during optimization.\n *\n * Pseudo-classes that we can evaluate during optimization, and shouldn't be\n * toggled conditionally through the `usePseudos` parameter.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes\n */\nconst preservedPseudos = [\n  ...pseudoClasses.functional,\n  ...pseudoClasses.treeStructural,\n];\n\n/**\n * Merges styles from style nodes into inline styles.\n *\n * @type {import('../lib/types.js').Plugin<InlineStylesParams>}\n * @author strarsis <strarsis@gmail.com>\n */\nexport const fn = (root, params) => {\n  const {\n    onlyMatchedOnce = true,\n    removeMatchedSelectors = true,\n    useMqs = ['', 'screen'],\n    usePseudos = [''],\n  } = params;\n\n  /**\n   * @type {{\n   *   node: import('../lib/types.js').XastElement,\n   *   parentNode: import('../lib/types.js').XastParent,\n   *   cssAst: csstree.StyleSheet\n   * }[]}\n   */\n  const styles = [];\n  /**\n   * @type {{\n   *   node: csstree.Selector,\n   *   item: csstree.ListItem<csstree.CssNode>,\n   *   rule: csstree.Rule,\n   *   matchedElements?: import('../lib/types.js').XastElement[]\n   * }[]}\n   */\n  const selectors = [];\n\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        if (node.name === 'foreignObject') {\n          return visitSkip;\n        }\n        if (node.name !== 'style' || node.children.length === 0) {\n          return;\n        }\n        if (\n          node.attributes.type != null &&\n          node.attributes.type !== '' &&\n          node.attributes.type !== 'text/css'\n        ) {\n          return;\n        }\n\n        const cssText = node.children\n          .filter((child) => child.type === 'text' || child.type === 'cdata')\n          .map((child) => child.value)\n          .join('');\n\n        /** @type {?csstree.CssNode} */\n        let cssAst = null;\n        try {\n          cssAst = csstree.parse(cssText, {\n            parseValue: false,\n            parseCustomProperty: false,\n          });\n        } catch {\n          return;\n        }\n        if (cssAst.type === 'StyleSheet') {\n          styles.push({ node, parentNode, cssAst });\n        }\n\n        // collect selectors\n        csstree.walk(cssAst, {\n          visit: 'Rule',\n          enter(node) {\n            const atrule = this.atrule;\n\n            // skip media queries not included into useMqs param\n            let mediaQuery = '';\n            if (atrule != null) {\n              mediaQuery = atrule.name;\n              if (atrule.prelude != null) {\n                mediaQuery += ` ${csstree.generate(atrule.prelude)}`;\n              }\n            }\n            if (!useMqs.includes(mediaQuery)) {\n              return;\n            }\n\n            if (node.prelude.type === 'SelectorList') {\n              node.prelude.children.forEach((childNode, item) => {\n                if (childNode.type === 'Selector') {\n                  /**\n                   * @type {{\n                   *   item: csstree.ListItem<csstree.CssNode>,\n                   *   list: csstree.List<csstree.CssNode>\n                   * }[]}\n                   */\n                  const pseudos = [];\n\n                  childNode.children.forEach(\n                    (grandchildNode, grandchildItem, grandchildList) => {\n                      const isPseudo =\n                        grandchildNode.type === 'PseudoClassSelector' ||\n                        grandchildNode.type === 'PseudoElementSelector';\n\n                      if (\n                        isPseudo &&\n                        !preservedPseudos.includes(grandchildNode.name)\n                      ) {\n                        pseudos.push({\n                          item: grandchildItem,\n                          list: grandchildList,\n                        });\n                      }\n                    },\n                  );\n\n                  const pseudoSelectors = csstree.generate({\n                    type: 'Selector',\n                    children: new csstree.List().fromArray(\n                      pseudos.map((pseudo) => pseudo.item.data),\n                    ),\n                  });\n\n                  if (usePseudos.includes(pseudoSelectors)) {\n                    for (const pseudo of pseudos) {\n                      pseudo.list.remove(pseudo.item);\n                    }\n                  }\n\n                  selectors.push({ node: childNode, rule: node, item: item });\n                }\n              });\n            }\n          },\n        });\n      },\n    },\n\n    root: {\n      exit: () => {\n        if (styles.length === 0) {\n          return;\n        }\n        const sortedSelectors = selectors\n          .slice()\n          .sort((a, b) => {\n            const aSpecificity = syntax.specificity(a.item.data);\n            const bSpecificity = syntax.specificity(b.item.data);\n            return compareSpecificity(aSpecificity, bSpecificity);\n          })\n          .reverse();\n\n        for (const selector of sortedSelectors) {\n          // match selectors\n          const selectorText = csstree.generate(selector.item.data);\n          /** @type {import('../lib/types.js').XastElement[]} */\n          const matchedElements = [];\n          try {\n            for (const node of querySelectorAll(root, selectorText)) {\n              if (node.type === 'element') {\n                matchedElements.push(node);\n              }\n            }\n          } catch {\n            continue;\n          }\n          // nothing selected\n          if (matchedElements.length === 0) {\n            continue;\n          }\n\n          // apply styles to matched elements\n          // skip selectors that match more than once if option onlyMatchedOnce is enabled\n          if (onlyMatchedOnce && matchedElements.length > 1) {\n            continue;\n          }\n\n          // apply <style/> to matched elements\n          for (const selectedEl of matchedElements) {\n            const styleDeclarationList = csstree.parse(\n              selectedEl.attributes.style ?? '',\n              {\n                context: 'declarationList',\n                parseValue: false,\n              },\n            );\n            if (styleDeclarationList.type !== 'DeclarationList') {\n              continue;\n            }\n            const styleDeclarationItems = new Map();\n\n            /** @type {csstree.ListItem<csstree.CssNode>} */\n            let firstListItem;\n\n            csstree.walk(styleDeclarationList, {\n              visit: 'Declaration',\n              enter(node, item) {\n                if (firstListItem == null) {\n                  firstListItem = item;\n                }\n\n                styleDeclarationItems.set(node.property.toLowerCase(), item);\n              },\n            });\n            // merge declarations\n            csstree.walk(selector.rule, {\n              visit: 'Declaration',\n              enter(ruleDeclaration) {\n                // existing inline styles have higher priority\n                // no inline styles, external styles,                                    external styles used\n                // inline styles,    external styles same   priority as inline styles,   inline   styles used\n                // inline styles,    external styles higher priority than inline styles, external styles used\n                const property = ruleDeclaration.property;\n\n                if (\n                  attrsGroups.presentation.has(property) &&\n                  !selectors.some((selector) =>\n                    includesAttrSelector(selector.item, property),\n                  )\n                ) {\n                  delete selectedEl.attributes[property];\n                }\n\n                const matchedItem = styleDeclarationItems.get(property);\n                const ruleDeclarationItem =\n                  styleDeclarationList.children.createItem(ruleDeclaration);\n                if (matchedItem == null) {\n                  styleDeclarationList.children.insert(\n                    ruleDeclarationItem,\n                    firstListItem,\n                  );\n                } else if (\n                  matchedItem.data.important !== true &&\n                  ruleDeclaration.important === true\n                ) {\n                  styleDeclarationList.children.replace(\n                    matchedItem,\n                    ruleDeclarationItem,\n                  );\n                  styleDeclarationItems.set(property, ruleDeclarationItem);\n                }\n              },\n            });\n\n            const newStyles = csstree.generate(styleDeclarationList);\n            if (newStyles.length !== 0) {\n              selectedEl.attributes.style = newStyles;\n            }\n          }\n\n          if (\n            removeMatchedSelectors &&\n            matchedElements.length !== 0 &&\n            selector.rule.prelude.type === 'SelectorList'\n          ) {\n            // clean up matching simple selectors if option removeMatchedSelectors is enabled\n            selector.rule.prelude.children.remove(selector.item);\n          }\n          selector.matchedElements = matchedElements;\n        }\n\n        // no further processing required\n        if (!removeMatchedSelectors) {\n          return;\n        }\n\n        // clean up matched class + ID attribute values\n        for (const selector of sortedSelectors) {\n          if (selector.matchedElements == null) {\n            continue;\n          }\n\n          if (onlyMatchedOnce && selector.matchedElements.length > 1) {\n            // skip selectors that match more than once if option onlyMatchedOnce is enabled\n            continue;\n          }\n\n          for (const selectedEl of selector.matchedElements) {\n            // class\n            const classList = new Set(\n              selectedEl.attributes.class == null\n                ? null\n                : selectedEl.attributes.class.split(' '),\n            );\n\n            for (const child of selector.node.children) {\n              if (\n                child.type === 'ClassSelector' &&\n                !selectors.some((selector) =>\n                  includesAttrSelector(\n                    selector.item,\n                    'class',\n                    child.name,\n                    true,\n                  ),\n                )\n              ) {\n                classList.delete(child.name);\n              }\n            }\n\n            if (classList.size === 0) {\n              delete selectedEl.attributes.class;\n            } else {\n              selectedEl.attributes.class = Array.from(classList).join(' ');\n            }\n\n            // ID\n            const firstSubSelector = selector.node.children.first;\n            if (\n              firstSubSelector?.type === 'IdSelector' &&\n              selectedEl.attributes.id === firstSubSelector.name &&\n              !selectors.some((selector) =>\n                includesAttrSelector(\n                  selector.item,\n                  'id',\n                  firstSubSelector.name,\n                  true,\n                ),\n              )\n            ) {\n              delete selectedEl.attributes.id;\n            }\n          }\n        }\n\n        for (const style of styles) {\n          csstree.walk(style.cssAst, {\n            visit: 'Rule',\n            enter: function (node, item, list) {\n              // clean up <style/> rulesets without any css selectors left\n              if (\n                node.type === 'Rule' &&\n                node.prelude.type === 'SelectorList' &&\n                node.prelude.children.isEmpty\n              ) {\n                list.remove(item);\n              }\n            },\n          });\n\n          if (style.cssAst.children.isEmpty) {\n            // remove empty style element\n            detachNodeFromParent(style.node, style.parentNode);\n          } else {\n            // update style element if any styles left\n            const firstChild = style.node.children[0];\n            if (firstChild.type === 'text' || firstChild.type === 'cdata') {\n              firstChild.value = csstree.generate(style.cssAst);\n            }\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/mergePaths.js",
    "content": "import { collectStylesheet, computeStyle } from '../lib/style.js';\nimport { intersects, js2path, path2js } from './_path.js';\nimport { includesUrlReference } from '../lib/svgo/tools.js';\n\n/**\n * @typedef MergePathsParams\n * @property {boolean=} force\n * @property {number=} floatPrecision\n * @property {boolean=} noSpaceAfterFlags\n */\n\nexport const name = 'mergePaths';\nexport const description = 'merges multiple paths in one if possible';\n\n/**\n * @param {import('../lib/types.js').ComputedStyles} computedStyle\n * @param {string} attName\n * @returns {boolean}\n */\nfunction elementHasUrl(computedStyle, attName) {\n  const style = computedStyle[attName];\n\n  if (style?.type === 'static') {\n    return includesUrlReference(style.value);\n  }\n\n  return false;\n}\n\n/**\n * Merge multiple Paths into one.\n *\n * @author Kir Belevich, Lev Solntsev\n *\n * @type {import('../lib/types.js').Plugin<MergePathsParams>}\n */\nexport const fn = (root, params) => {\n  const {\n    force = false,\n    floatPrecision = 3,\n    noSpaceAfterFlags = false, // a20 60 45 0 1 30 20 → a20 60 45 0130 20\n  } = params;\n  const stylesheet = collectStylesheet(root);\n\n  return {\n    element: {\n      enter: (node) => {\n        if (node.children.length <= 1) {\n          return;\n        }\n\n        /** @type {import('../lib/types.js').XastChild[]} */\n        const elementsToRemove = [];\n        let prevChild = node.children[0];\n        let prevPathData = null;\n\n        /**\n         * @param {import('../lib/types.js').XastElement} child\n         * @param {ReadonlyArray<import(\"../lib/types.js\").PathDataItem>} pathData\n         */\n        const updatePreviousPath = (child, pathData) => {\n          js2path(child, pathData, {\n            floatPrecision,\n            noSpaceAfterFlags,\n          });\n          prevPathData = null;\n        };\n\n        for (let i = 1; i < node.children.length; i++) {\n          const child = node.children[i];\n\n          if (\n            prevChild.type !== 'element' ||\n            prevChild.name !== 'path' ||\n            prevChild.children.length !== 0 ||\n            prevChild.attributes.d == null\n          ) {\n            if (prevPathData && prevChild.type === 'element') {\n              updatePreviousPath(prevChild, prevPathData);\n            }\n            prevChild = child;\n            continue;\n          }\n\n          if (\n            child.type !== 'element' ||\n            child.name !== 'path' ||\n            child.children.length !== 0 ||\n            child.attributes.d == null\n          ) {\n            if (prevPathData) {\n              updatePreviousPath(prevChild, prevPathData);\n            }\n            prevChild = child;\n            continue;\n          }\n\n          const computedStyle = computeStyle(stylesheet, child);\n          if (\n            computedStyle['marker-start'] ||\n            computedStyle['marker-mid'] ||\n            computedStyle['marker-end'] ||\n            computedStyle['clip-path'] ||\n            computedStyle['mask'] ||\n            computedStyle['mask-image'] ||\n            ['fill', 'filter', 'stroke'].some((attName) =>\n              elementHasUrl(computedStyle, attName),\n            )\n          ) {\n            if (prevPathData) {\n              updatePreviousPath(prevChild, prevPathData);\n            }\n            prevChild = child;\n            continue;\n          }\n          const childAttrs = Object.keys(child.attributes);\n          if (childAttrs.length !== Object.keys(prevChild.attributes).length) {\n            if (prevPathData) {\n              updatePreviousPath(prevChild, prevPathData);\n            }\n            prevChild = child;\n            continue;\n          }\n\n          const areAttrsEqual = childAttrs.some((attr) => {\n            return (\n              attr !== 'd' &&\n              prevChild.type === 'element' &&\n              prevChild.attributes[attr] !== child.attributes[attr]\n            );\n          });\n\n          if (areAttrsEqual) {\n            if (prevPathData) {\n              updatePreviousPath(prevChild, prevPathData);\n            }\n            prevChild = child;\n            continue;\n          }\n\n          const hasPrevPath = prevPathData != null;\n          const currentPathData = path2js(child);\n          prevPathData = prevPathData ?? path2js(prevChild);\n\n          if (force || !intersects(prevPathData, currentPathData)) {\n            prevPathData.push(...currentPathData);\n            elementsToRemove.push(child);\n            continue;\n          }\n\n          if (hasPrevPath) {\n            updatePreviousPath(prevChild, prevPathData);\n          }\n\n          prevChild = child;\n          prevPathData = null;\n        }\n\n        if (prevPathData && prevChild.type === 'element') {\n          updatePreviousPath(prevChild, prevPathData);\n        }\n\n        node.children = node.children.filter(\n          (child) => !elementsToRemove.includes(child),\n        );\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/mergeStyles.js",
    "content": "import { detachNodeFromParent } from '../lib/xast.js';\nimport { visitSkip } from '../lib/util/visit.js';\n\nexport const name = 'mergeStyles';\nexport const description = 'merge multiple style elements into one';\n\n/**\n * Merge multiple style elements into one.\n *\n * @author strarsis <strarsis@gmail.com>\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  /** @type {?import('../lib/types.js').XastElement} */\n  let firstStyleElement = null;\n  let collectedStyles = '';\n  /** @type {'text' | 'cdata'} */\n  let styleContentType = 'text';\n\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        // skip <foreignObject> content\n        if (node.name === 'foreignObject') {\n          return visitSkip;\n        }\n\n        // collect style elements\n        if (node.name !== 'style') {\n          return;\n        }\n\n        // skip <style> with invalid type attribute\n        if (\n          node.attributes.type != null &&\n          node.attributes.type !== '' &&\n          node.attributes.type !== 'text/css'\n        ) {\n          return;\n        }\n\n        // extract style element content\n        let css = '';\n        for (const child of node.children) {\n          if (child.type === 'text') {\n            css += child.value;\n          }\n          if (child.type === 'cdata') {\n            styleContentType = 'cdata';\n            css += child.value;\n          }\n        }\n\n        // remove empty style elements\n        if (css.trim().length === 0) {\n          detachNodeFromParent(node, parentNode);\n          return;\n        }\n\n        // collect css and wrap with media query if present in attribute\n        if (node.attributes.media == null) {\n          collectedStyles += css;\n        } else {\n          collectedStyles += `@media ${node.attributes.media}{${css}}`;\n          delete node.attributes.media;\n        }\n\n        // combine collected styles in the first style element\n        if (firstStyleElement == null) {\n          firstStyleElement = node;\n        } else {\n          detachNodeFromParent(node, parentNode);\n          /** @type {import('../lib/types.js').XastChild} */\n          const child = { type: styleContentType, value: collectedStyles };\n          firstStyleElement.children = [child];\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/minifyStyles.js",
    "content": "import * as csso from 'csso';\nimport { detachNodeFromParent } from '../lib/xast.js';\nimport { hasScripts } from '../lib/svgo/tools.js';\n\n/**\n * @typedef Usage\n * @property {boolean=} force\n * @property {boolean=} ids\n * @property {boolean=} classes\n * @property {boolean=} tags\n *\n * @typedef MinifyStylesParams\n * @property {boolean=} restructure Disable or enable a structure optimizations.\n * @property {boolean=} forceMediaMerge\n *   Enables merging of `@media` rules with the same media query split by other\n *   rules. Unsafe in general, but should work fine in most cases. Use it on\n *   your own risk.\n * @property {'exclamation' | 'first-exclamation' | boolean=} comments\n *   Specify what comments to leave:\n *   - `'exclamation'` or `true` — leave all exclamation comments\n *   - `'first-exclamation'` — remove every comment except first one\n *   - `false` — remove all comments\n * @property {boolean | Usage=} usage Advanced optimizations.\n */\n\nexport const name = 'minifyStyles';\nexport const description = 'minifies styles and removes unused styles';\n\n/**\n * Minifies styles (<style> element + style attribute) using CSSO.\n *\n * @author strarsis <strarsis@gmail.com>\n * @type {import('../lib/types.js').Plugin<MinifyStylesParams>}\n */\nexport const fn = (_root, { usage, ...params }) => {\n  /** @type {Map<import('../lib/types.js').XastElement, import('../lib/types.js').XastParent>} */\n  const styleElements = new Map();\n\n  /** @type {import('../lib/types.js').XastElement[]} */\n  const elementsWithStyleAttributes = [];\n\n  /** @type {Set<string>} */\n  const tagsUsage = new Set();\n\n  /** @type {Set<string>} */\n  const idsUsage = new Set();\n\n  /** @type {Set<string>} */\n  const classesUsage = new Set();\n\n  let enableTagsUsage = true;\n  let enableIdsUsage = true;\n  let enableClassesUsage = true;\n\n  /**\n   * Force to use usage data even if it unsafe. For example, the document\n   * contains scripts or in attributes.\n   */\n  let forceUsageDeoptimized = false;\n\n  if (typeof usage === 'boolean') {\n    enableTagsUsage = usage;\n    enableIdsUsage = usage;\n    enableClassesUsage = usage;\n  } else if (usage) {\n    enableTagsUsage = usage.tags == null ? true : usage.tags;\n    enableIdsUsage = usage.ids == null ? true : usage.ids;\n    enableClassesUsage = usage.classes == null ? true : usage.classes;\n    forceUsageDeoptimized = usage.force == null ? false : usage.force;\n  }\n\n  let deoptimized = false;\n\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        // detect deoptimizations\n        if (hasScripts(node)) {\n          deoptimized = true;\n        }\n\n        // collect tags, ids and classes usage\n        tagsUsage.add(node.name);\n        if (node.attributes.id != null) {\n          idsUsage.add(node.attributes.id);\n        }\n        if (node.attributes.class != null) {\n          for (const className of node.attributes.class.split(/\\s+/)) {\n            classesUsage.add(className);\n          }\n        }\n        // collect style elements or elements with style attribute\n        if (node.name === 'style' && node.children.length !== 0) {\n          styleElements.set(node, parentNode);\n        } else if (node.attributes.style != null) {\n          elementsWithStyleAttributes.push(node);\n        }\n      },\n    },\n\n    root: {\n      exit: () => {\n        /** @type {csso.Usage} */\n        const cssoUsage = {};\n        if (!deoptimized || forceUsageDeoptimized) {\n          if (enableTagsUsage) {\n            cssoUsage.tags = Array.from(tagsUsage);\n          }\n          if (enableIdsUsage) {\n            cssoUsage.ids = Array.from(idsUsage);\n          }\n          if (enableClassesUsage) {\n            cssoUsage.classes = Array.from(classesUsage);\n          }\n        }\n        // minify style elements\n        for (const [styleNode, styleNodeParent] of styleElements.entries()) {\n          if (\n            styleNode.children[0].type === 'text' ||\n            styleNode.children[0].type === 'cdata'\n          ) {\n            const cssText = styleNode.children[0].value;\n            const minified = csso.minify(cssText, {\n              ...params,\n              usage: cssoUsage,\n            }).css;\n\n            if (minified.length === 0) {\n              detachNodeFromParent(styleNode, styleNodeParent);\n              continue;\n            }\n\n            // preserve cdata if necessary\n            // TODO split cdata -> text optimization into separate plugin\n            if (cssText.indexOf('>') >= 0 || cssText.indexOf('<') >= 0) {\n              styleNode.children[0].type = 'cdata';\n              styleNode.children[0].value = minified;\n            } else {\n              styleNode.children[0].type = 'text';\n              styleNode.children[0].value = minified;\n            }\n          }\n        }\n        // minify style attributes\n        for (const node of elementsWithStyleAttributes) {\n          // style attribute\n          const elemStyle = node.attributes.style;\n          node.attributes.style = csso.minifyBlock(elemStyle, {\n            ...params,\n          }).css;\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/moveElemsAttrsToGroup.js",
    "content": "import { visit } from '../lib/util/visit.js';\nimport { inheritableAttrs, pathElems } from './_collections.js';\n\nexport const name = 'moveElemsAttrsToGroup';\nexport const description =\n  'Move common attributes of group children to the group';\n\n/**\n * Move common attributes of group children to the group\n *\n * @example\n * <g attr1=\"val1\">\n *     <g attr2=\"val2\">\n *         text\n *     </g>\n *     <circle attr2=\"val2\" attr3=\"val3\"/>\n * </g>\n *  ⬇\n * <g attr1=\"val1\" attr2=\"val2\">\n *     <g>\n *         text\n *     </g>\n *    <circle attr3=\"val3\"/>\n * </g>\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = (root) => {\n  // find if any style element is present\n  let deoptimizedWithStyles = false;\n  visit(root, {\n    element: {\n      enter: (node) => {\n        if (node.name === 'style') {\n          deoptimizedWithStyles = true;\n        }\n      },\n    },\n  });\n\n  return {\n    element: {\n      exit: (node) => {\n        // process only groups with more than 1 child\n        if (node.name !== 'g' || node.children.length <= 1) {\n          return;\n        }\n\n        // deoptimize the plugin when style elements are present\n        // selectors may rely on id, classes or tag names\n        if (deoptimizedWithStyles) {\n          return;\n        }\n\n        /**\n         * Find common attributes in group children.\n         *\n         * @type {Map<string, string>}\n         */\n        const commonAttributes = new Map();\n        let initial = true;\n        let everyChildIsPath = true;\n        for (const child of node.children) {\n          if (child.type === 'element') {\n            if (!pathElems.has(child.name)) {\n              everyChildIsPath = false;\n            }\n            if (initial) {\n              initial = false;\n              // collect all inheritable attributes from first child element\n              for (const [name, value] of Object.entries(child.attributes)) {\n                // consider only inheritable attributes\n                if (inheritableAttrs.has(name)) {\n                  commonAttributes.set(name, value);\n                }\n              }\n            } else {\n              // exclude uncommon attributes from initial list\n              for (const [name, value] of commonAttributes) {\n                if (child.attributes[name] !== value) {\n                  commonAttributes.delete(name);\n                }\n              }\n            }\n          }\n        }\n\n        // preserve transform on children when group has filter or clip-path or mask\n        if (\n          node.attributes['filter'] != null ||\n          node.attributes['clip-path'] != null ||\n          node.attributes.mask != null\n        ) {\n          commonAttributes.delete('transform');\n        }\n\n        // preserve transform when all children are paths\n        // so the transform could be applied to path data by other plugins\n        if (everyChildIsPath) {\n          commonAttributes.delete('transform');\n        }\n\n        // add common children attributes to group\n        for (const [name, value] of commonAttributes) {\n          if (name === 'transform') {\n            if (node.attributes.transform != null) {\n              node.attributes.transform = `${node.attributes.transform} ${value}`;\n            } else {\n              node.attributes.transform = value;\n            }\n          } else {\n            node.attributes[name] = value;\n          }\n        }\n\n        // delete common attributes from children\n        for (const child of node.children) {\n          if (child.type === 'element') {\n            for (const [name] of commonAttributes) {\n              delete child.attributes[name];\n            }\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/moveGroupAttrsToElems.js",
    "content": "import { pathElems, referencesProps } from './_collections.js';\nimport { includesUrlReference } from '../lib/svgo/tools.js';\n\nexport const name = 'moveGroupAttrsToElems';\nexport const description =\n  'moves some group attributes to the content elements';\n\nconst pathElemsWithGroupsAndText = [...pathElems, 'g', 'text'];\n\n/**\n * Move group attrs to the content elements.\n *\n * @example\n * <g transform=\"scale(2)\">\n *     <path transform=\"rotate(45)\" d=\"M0,0 L10,20\"/>\n *     <path transform=\"translate(10, 20)\" d=\"M0,10 L20,30\"/>\n * </g>\n *  ⬇\n * <g>\n *     <path transform=\"scale(2) rotate(45)\" d=\"M0,0 L10,20\"/>\n *     <path transform=\"scale(2) translate(10, 20)\" d=\"M0,10 L20,30\"/>\n * </g>\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  return {\n    element: {\n      enter: (node) => {\n        // move group transform attr to content's pathElems\n        if (\n          node.name === 'g' &&\n          node.children.length !== 0 &&\n          node.attributes.transform != null &&\n          Object.entries(node.attributes).some(\n            ([name, value]) =>\n              referencesProps.has(name) && includesUrlReference(value),\n          ) === false &&\n          node.children.every(\n            (child) =>\n              child.type === 'element' &&\n              pathElemsWithGroupsAndText.includes(child.name) &&\n              child.attributes.id == null,\n          )\n        ) {\n          for (const child of node.children) {\n            const value = node.attributes.transform;\n            if (child.type === 'element') {\n              if (child.attributes.transform != null) {\n                child.attributes.transform = `${value} ${child.attributes.transform}`;\n              } else {\n                child.attributes.transform = value;\n              }\n            }\n          }\n\n          delete node.attributes.transform;\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/prefixIds.js",
    "content": "import * as csstree from 'css-tree';\nimport { referencesProps } from './_collections.js';\n\n/**\n * @typedef PrefixIdsParams\n * @property {boolean | string | ((node: import('../lib/types.js').XastElement, info: import('../lib/types.js').PluginInfo) => string)=} prefix\n * @property {string=} delim\n * @property {boolean=} prefixIds\n * @property {boolean=} prefixClassNames\n */\n\nexport const name = 'prefixIds';\nexport const description = 'prefix IDs';\n\n/**\n * Extract basename from path.\n *\n * @param {string} path\n * @returns {string}\n */\nconst getBasename = (path) => {\n  // extract everything after latest slash or backslash\n  const matched = /[/\\\\]?([^/\\\\]+)$/.exec(path);\n  if (matched) {\n    return matched[1];\n  }\n  return '';\n};\n\n/**\n * Escapes a string for being used as ID.\n *\n * @param {string} str\n * @returns {string}\n */\nconst escapeIdentifierName = (str) => {\n  return str.replace(/[. ]/g, '_');\n};\n\n/**\n * @param {string} string\n * @returns {string}\n */\nconst unquote = (string) => {\n  if (\n    (string.startsWith('\"') && string.endsWith('\"')) ||\n    (string.startsWith(\"'\") && string.endsWith(\"'\"))\n  ) {\n    return string.slice(1, -1);\n  }\n  return string;\n};\n\n/**\n * Prefix the given string, unless it already starts with the generated prefix.\n *\n * @param {(id: string) => string} prefixGenerator Function to generate a prefix.\n * @param {string} body An arbitrary string.\n * @returns {string} The given string with a prefix prepended to it.\n */\nconst prefixId = (prefixGenerator, body) => {\n  const prefix = prefixGenerator(body);\n  if (body.startsWith(prefix)) {\n    return body;\n  }\n  return prefix + body;\n};\n\n/**\n * Insert the prefix in a reference string. A reference string is already\n * prefixed with #, so the prefix is inserted after the first character.\n *\n * @param {(id: string) => string} prefixGenerator Function to generate a prefix.\n * @param {string} reference An arbitrary string, should start with \"#\".\n * @returns {?string} The given string with a prefix inserted, or null if the string did not start with \"#\".\n */\nconst prefixReference = (prefixGenerator, reference) => {\n  if (reference.startsWith('#')) {\n    return '#' + prefixId(prefixGenerator, reference.slice(1));\n  }\n  return null;\n};\n\n/**\n * Generates a prefix for the given string.\n *\n * @param {string} body An arbitrary string.\n * @param {import('../lib/types.js').XastElement} node XML node that the identifier belongs to.\n * @param {import('../lib/types.js').PluginInfo} info\n * @param {((node: import('../lib/types.js').XastElement, info: import('../lib/types.js').PluginInfo) => string) | string | boolean | undefined} prefixGenerator Some way of obtaining a prefix.\n * @param {string} delim Content to insert between the prefix and original value.\n * @param {Map<string, string>} history Map of previously generated prefixes to IDs.\n * @returns {string} A generated prefix.\n */\nconst generatePrefix = (body, node, info, prefixGenerator, delim, history) => {\n  if (typeof prefixGenerator === 'function') {\n    let prefix = history.get(body);\n\n    if (prefix != null) {\n      return prefix;\n    }\n\n    prefix = prefixGenerator(node, info) + delim;\n    history.set(body, prefix);\n    return prefix;\n  }\n\n  if (typeof prefixGenerator === 'string') {\n    return prefixGenerator + delim;\n  }\n\n  if (prefixGenerator === false) {\n    return '';\n  }\n\n  if (info.path != null && info.path.length > 0) {\n    return escapeIdentifierName(getBasename(info.path)) + delim;\n  }\n\n  return 'prefix' + delim;\n};\n\n/**\n * Prefixes identifiers\n *\n * @author strarsis <strarsis@gmail.com>\n * @type {import('../lib/types.js').Plugin<PrefixIdsParams>}\n */\nexport const fn = (_root, params, info) => {\n  const {\n    delim = '__',\n    prefix,\n    prefixIds = true,\n    prefixClassNames = true,\n  } = params;\n\n  /** @type {Map<string, string>} */\n  const prefixMap = new Map();\n\n  return {\n    element: {\n      enter: (node) => {\n        /**\n         * @param {string} id A node identifier or class.\n         * @returns {string} Given string with a prefix inserted, or null if the string did not start with \"#\".\n         */\n        const prefixGenerator = (id) =>\n          generatePrefix(id, node, info, prefix, delim, prefixMap);\n\n        // prefix id/class selectors and url() references in styles\n        if (node.name === 'style') {\n          // skip empty <style/> elements\n          if (node.children.length === 0) {\n            return;\n          }\n\n          for (const child of node.children) {\n            if (child.type !== 'text' && child.type !== 'cdata') {\n              continue;\n            }\n\n            const cssText = child.value;\n            /** @type {?csstree.CssNode} */\n            let cssAst;\n            try {\n              cssAst = csstree.parse(cssText, {\n                parseValue: true,\n                parseCustomProperty: false,\n              });\n            } catch {\n              return;\n            }\n\n            csstree.walk(cssAst, (node) => {\n              if (\n                (prefixIds && node.type === 'IdSelector') ||\n                (prefixClassNames && node.type === 'ClassSelector')\n              ) {\n                node.name = prefixId(prefixGenerator, node.name);\n                return;\n              }\n              if (node.type === 'Url' && node.value.length > 0) {\n                const prefixed = prefixReference(\n                  prefixGenerator,\n                  unquote(node.value),\n                );\n                if (prefixed != null) {\n                  node.value = prefixed;\n                }\n              }\n            });\n\n            child.value = csstree.generate(cssAst);\n          }\n        }\n\n        // prefix an ID attribute value\n        if (\n          prefixIds &&\n          node.attributes.id != null &&\n          node.attributes.id.length !== 0\n        ) {\n          node.attributes.id = prefixId(prefixGenerator, node.attributes.id);\n        }\n\n        // prefix a class attribute value\n        if (\n          prefixClassNames &&\n          node.attributes.class != null &&\n          node.attributes.class.length !== 0\n        ) {\n          node.attributes.class = node.attributes.class\n            .split(/\\s+/)\n            .map((name) => prefixId(prefixGenerator, name))\n            .join(' ');\n        }\n\n        // prefix an href attribute value\n        // xlink:href is deprecated, must be still supported\n        for (const name of ['href', 'xlink:href']) {\n          if (\n            node.attributes[name] != null &&\n            node.attributes[name].length !== 0\n          ) {\n            const prefixed = prefixReference(\n              prefixGenerator,\n              node.attributes[name],\n            );\n            if (prefixed != null) {\n              node.attributes[name] = prefixed;\n            }\n          }\n        }\n\n        // prefix a URL attribute value\n        for (const name of referencesProps) {\n          if (\n            node.attributes[name] != null &&\n            node.attributes[name].length !== 0\n          ) {\n            node.attributes[name] = node.attributes[name].replace(\n              /\\burl\\(([\"'])?(#.+?)\\1\\)/gi,\n              (match, _, url) => {\n                const prefixed = prefixReference(prefixGenerator, url);\n                if (prefixed == null) {\n                  return match;\n                }\n                return `url(${prefixed})`;\n              },\n            );\n          }\n        }\n\n        // prefix begin/end attribute value\n        for (const name of ['begin', 'end']) {\n          if (\n            node.attributes[name] != null &&\n            node.attributes[name].length !== 0\n          ) {\n            const parts = node.attributes[name].split(/\\s*;\\s+/).map((val) => {\n              if (val.endsWith('.end') || val.endsWith('.start')) {\n                const [id, postfix] = val.split('.');\n                return `${prefixId(prefixGenerator, id)}.${postfix}`;\n              }\n              return val;\n            });\n            node.attributes[name] = parts.join('; ');\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/preset-default.js",
    "content": "import { createPreset } from '../lib/svgo/plugins.js';\nimport * as removeDoctype from './removeDoctype.js';\nimport * as removeXMLProcInst from './removeXMLProcInst.js';\nimport * as removeComments from './removeComments.js';\nimport * as removeDeprecatedAttrs from './removeDeprecatedAttrs.js';\nimport * as removeMetadata from './removeMetadata.js';\nimport * as removeEditorsNSData from './removeEditorsNSData.js';\nimport * as cleanupAttrs from './cleanupAttrs.js';\nimport * as mergeStyles from './mergeStyles.js';\nimport * as inlineStyles from './inlineStyles.js';\nimport * as minifyStyles from './minifyStyles.js';\nimport * as cleanupIds from './cleanupIds.js';\nimport * as removeUselessDefs from './removeUselessDefs.js';\nimport * as cleanupNumericValues from './cleanupNumericValues.js';\nimport * as convertColors from './convertColors.js';\nimport * as removeUnknownsAndDefaults from './removeUnknownsAndDefaults.js';\nimport * as removeNonInheritableGroupAttrs from './removeNonInheritableGroupAttrs.js';\nimport * as removeUselessStrokeAndFill from './removeUselessStrokeAndFill.js';\nimport * as cleanupEnableBackground from './cleanupEnableBackground.js';\nimport * as removeHiddenElems from './removeHiddenElems.js';\nimport * as removeEmptyText from './removeEmptyText.js';\nimport * as convertShapeToPath from './convertShapeToPath.js';\nimport * as convertEllipseToCircle from './convertEllipseToCircle.js';\nimport * as moveElemsAttrsToGroup from './moveElemsAttrsToGroup.js';\nimport * as moveGroupAttrsToElems from './moveGroupAttrsToElems.js';\nimport * as collapseGroups from './collapseGroups.js';\nimport * as convertPathData from './convertPathData.js';\nimport * as convertTransform from './convertTransform.js';\nimport * as removeEmptyAttrs from './removeEmptyAttrs.js';\nimport * as removeEmptyContainers from './removeEmptyContainers.js';\nimport * as mergePaths from './mergePaths.js';\nimport * as removeUnusedNS from './removeUnusedNS.js';\nimport * as sortAttrs from './sortAttrs.js';\nimport * as sortDefsChildren from './sortDefsChildren.js';\nimport * as removeDesc from './removeDesc.js';\n\nconst presetDefault = createPreset({\n  name: 'preset-default',\n  plugins: [\n    removeDoctype,\n    removeXMLProcInst,\n    removeComments,\n    removeDeprecatedAttrs,\n    removeMetadata,\n    removeEditorsNSData,\n    cleanupAttrs,\n    mergeStyles,\n    inlineStyles,\n    minifyStyles,\n    cleanupIds,\n    removeUselessDefs,\n    cleanupNumericValues,\n    convertColors,\n    removeUnknownsAndDefaults,\n    removeNonInheritableGroupAttrs,\n    removeUselessStrokeAndFill,\n    cleanupEnableBackground,\n    removeHiddenElems,\n    removeEmptyText,\n    convertShapeToPath,\n    convertEllipseToCircle,\n    moveElemsAttrsToGroup,\n    moveGroupAttrsToElems,\n    collapseGroups,\n    convertPathData,\n    convertTransform,\n    removeEmptyAttrs,\n    removeEmptyContainers,\n    mergePaths,\n    removeUnusedNS,\n    sortAttrs,\n    sortDefsChildren,\n    removeDesc,\n  ],\n});\n\nexport default presetDefault;\n"
  },
  {
    "path": "plugins/removeAttributesBySelector.js",
    "content": "import { querySelectorAll } from '../lib/xast.js';\n\nexport const name = 'removeAttributesBySelector';\nexport const description =\n  'removes attributes of elements that match a css selector';\n\n/**\n * Removes attributes of elements that match a css selector.\n *\n * @example\n * <caption>A selector removing a single attribute</caption>\n * plugins: [\n *   {\n *     name: \"removeAttributesBySelector\",\n *     params: {\n *       selector: \"[fill='#00ff00']\"\n *       attributes: \"fill\"\n *     }\n *   }\n * ]\n *\n * <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" fill=\"#00ff00\" stroke=\"#00ff00\"/>\n *   ↓\n * <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" stroke=\"#00ff00\"/>\n *\n * <caption>A selector removing multiple attributes</caption>\n * plugins: [\n *   {\n *     name: \"removeAttributesBySelector\",\n *     params: {\n *       selector: \"[fill='#00ff00']\",\n *       attributes: [\n *         \"fill\",\n *         \"stroke\"\n *       ]\n *     }\n *   }\n * ]\n *\n * <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" fill=\"#00ff00\" stroke=\"#00ff00\"/>\n *   ↓\n * <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\"/>\n *\n * <caption>Multiple selectors removing attributes</caption>\n * plugins: [\n *   {\n *     name: \"removeAttributesBySelector\",\n *     params: {\n *       selectors: [\n *         {\n *           selector: \"[fill='#00ff00']\",\n *           attributes: \"fill\"\n *         },\n *         {\n *           selector: \"#remove\",\n *           attributes: [\n *             \"stroke\",\n *             \"id\"\n *           ]\n *         }\n *       ]\n *     }\n *   }\n * ]\n *\n * <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" fill=\"#00ff00\" stroke=\"#00ff00\"/>\n *   ↓\n * <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\"/>\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors|MDN CSS Selectors\n *\n * @author Bradley Mease\n *\n * @type {import('../lib/types.js').Plugin<any>}\n */\nexport const fn = (root, params) => {\n  const selectors = Array.isArray(params.selectors)\n    ? params.selectors\n    : [params];\n  for (const { selector, attributes } of selectors) {\n    const nodes = querySelectorAll(root, selector);\n    for (const node of nodes) {\n      if (node.type === 'element') {\n        if (Array.isArray(attributes)) {\n          for (const name of attributes) {\n            delete node.attributes[name];\n          }\n        } else {\n          delete node.attributes[attributes];\n        }\n      }\n    }\n  }\n  return {};\n};\n"
  },
  {
    "path": "plugins/removeAttrs.js",
    "content": "/**\n * @typedef RemoveAttrsParams\n * @property {string=} elemSeparator\n * @property {boolean=} preserveCurrentColor\n * @property {string | string[]} attrs\n */\n\nexport const name = 'removeAttrs';\nexport const description = 'removes specified attributes';\n\nconst DEFAULT_SEPARATOR = ':';\nconst ENOATTRS = `Warning: The plugin \"removeAttrs\" requires the \"attrs\" parameter.\nIt should have a pattern to remove, otherwise the plugin is a noop.\nConfig example:\n\nplugins: [\n  {\n    name: \"removeAttrs\",\n    params: {\n      attrs: \"(fill|stroke)\"\n    }\n  }\n]\n`;\n\n/**\n * Remove attributes\n *\n * @example elemSeparator\n *   format: string\n *\n * @example preserveCurrentColor\n *   format: boolean\n *\n * @example attrs:\n *\n *   format: [ element* : attribute* : value* ]\n *\n *   element   : regexp (wrapped into ^...$), single * or omitted > all elements (must be present when value is used)\n *   attribute : regexp (wrapped into ^...$)\n *   value     : regexp (wrapped into ^...$), single * or omitted > all values\n *\n *   examples:\n *\n *     > basic: remove fill attribute\n *     ---\n *     removeAttrs:\n *       attrs: 'fill'\n *\n *     > remove fill attribute on path element\n *     ---\n *       attrs: 'path:fill'\n *\n *     > remove fill attribute on path element where value is none\n *     ---\n *       attrs: 'path:fill:none'\n *\n *\n *     > remove all fill and stroke attribute\n *     ---\n *       attrs:\n *         - 'fill'\n *         - 'stroke'\n *\n *     [is same as]\n *\n *       attrs: '(fill|stroke)'\n *\n *     [is same as]\n *\n *       attrs: '*:(fill|stroke)'\n *\n *     [is same as]\n *\n *       attrs: '.*:(fill|stroke)'\n *\n *     [is same as]\n *\n *       attrs: '.*:(fill|stroke):.*'\n *\n *\n *     > remove all stroke related attributes\n *     ----\n *     attrs: 'stroke.*'\n *\n *\n * @author Benny Schudel\n *\n * @type {import('../lib/types.js').Plugin<RemoveAttrsParams>}\n */\nexport const fn = (root, params) => {\n  if (typeof params.attrs == 'undefined') {\n    console.warn(ENOATTRS);\n    return null;\n  }\n\n  const elemSeparator =\n    typeof params.elemSeparator == 'string'\n      ? params.elemSeparator\n      : DEFAULT_SEPARATOR;\n  const preserveCurrentColor =\n    typeof params.preserveCurrentColor == 'boolean'\n      ? params.preserveCurrentColor\n      : false;\n  const attrs = Array.isArray(params.attrs) ? params.attrs : [params.attrs];\n\n  return {\n    element: {\n      enter: (node) => {\n        for (let pattern of attrs) {\n          // if no element separators (:), assume it's attribute name, and apply to all elements *regardless of value*\n          if (!pattern.includes(elemSeparator)) {\n            pattern = ['.*', pattern, '.*'].join(elemSeparator);\n            // if only 1 separator, assume it's element and attribute name, and apply regardless of attribute value\n          } else if (pattern.split(elemSeparator).length < 3) {\n            pattern = [pattern, '.*'].join(elemSeparator);\n          }\n\n          // create regexps for element, attribute name, and attribute value\n          const list = pattern.split(elemSeparator).map((value) => {\n            // adjust single * to match anything\n            if (value === '*') {\n              value = '.*';\n            }\n            return new RegExp(['^', value, '$'].join(''), 'i');\n          });\n\n          // matches element\n          if (list[0].test(node.name)) {\n            // loop attributes\n            for (const [name, value] of Object.entries(node.attributes)) {\n              const isCurrentColor = value.toLowerCase() === 'currentcolor';\n              const isFillCurrentColor =\n                preserveCurrentColor && name == 'fill' && isCurrentColor;\n              const isStrokeCurrentColor =\n                preserveCurrentColor && name == 'stroke' && isCurrentColor;\n              if (\n                !isFillCurrentColor &&\n                !isStrokeCurrentColor &&\n                // matches attribute name\n                list[1].test(name) &&\n                // matches attribute value\n                list[2].test(value)\n              ) {\n                delete node.attributes[name];\n              }\n            }\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeComments.js",
    "content": "import { detachNodeFromParent } from '../lib/xast.js';\n\n/**\n * @typedef RemoveCommentsParams\n * @property {ReadonlyArray<RegExp | string> | false=} preservePatterns\n */\n\nexport const name = 'removeComments';\nexport const description = 'removes comments';\n\n/**\n * If a comment matches one of the following patterns, it will be\n * preserved by default. Particularly for copyright/license information.\n */\nconst DEFAULT_PRESERVE_PATTERNS = [/^!/];\n\n/**\n * Remove comments.\n *\n * @example\n * <!-- Generator: Adobe Illustrator 15.0.0, SVG Export\n * Plug-In . SVG Version: 6.00 Build 0)  -->\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin<RemoveCommentsParams>}\n */\nexport const fn = (_root, params) => {\n  const { preservePatterns = DEFAULT_PRESERVE_PATTERNS } = params;\n\n  return {\n    comment: {\n      enter: (node, parentNode) => {\n        if (preservePatterns) {\n          if (!Array.isArray(preservePatterns)) {\n            throw Error(\n              `Expected array in removeComments preservePatterns parameter but received ${preservePatterns}`,\n            );\n          }\n\n          const matches = preservePatterns.some((pattern) => {\n            return new RegExp(pattern).test(node.value);\n          });\n\n          if (matches) {\n            return;\n          }\n        }\n\n        detachNodeFromParent(node, parentNode);\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeDeprecatedAttrs.js",
    "content": "import * as csswhat from 'css-what';\nimport { attrsGroupsDeprecated, elems } from './_collections.js';\nimport { collectStylesheet } from '../lib/style.js';\n\n/**\n * @typedef RemoveDeprecatedAttrsParams\n * @property {boolean=} removeUnsafe\n */\n\nexport const name = 'removeDeprecatedAttrs';\nexport const description = 'removes deprecated attributes';\n\n/**\n * @param {import('../lib/types.js').Stylesheet} stylesheet\n * @returns {Set<string>}\n */\nfunction extractAttributesInStylesheet(stylesheet) {\n  const attributesInStylesheet = new Set();\n\n  stylesheet.rules.forEach((rule) => {\n    const selectors = csswhat.parse(rule.selector);\n    selectors.forEach((subselector) => {\n      subselector.forEach((segment) => {\n        if (segment.type !== 'attribute') {\n          return;\n        }\n\n        attributesInStylesheet.add(segment.name);\n      });\n    });\n  });\n\n  return attributesInStylesheet;\n}\n\n/**\n * @param {import('../lib/types.js').XastElement} node\n * @param {{ safe?: Set<string>; unsafe?: Set<string> }|undefined} deprecatedAttrs\n * @param {import('../lib/types.js').DefaultPlugins['removeDeprecatedAttrs']} params\n * @param {Set<string>} attributesInStylesheet\n */\nfunction processAttributes(\n  node,\n  deprecatedAttrs,\n  params,\n  attributesInStylesheet,\n) {\n  if (!deprecatedAttrs) {\n    return;\n  }\n\n  if (deprecatedAttrs.safe) {\n    deprecatedAttrs.safe.forEach((name) => {\n      if (attributesInStylesheet.has(name)) {\n        return;\n      }\n      delete node.attributes[name];\n    });\n  }\n\n  if (params.removeUnsafe && deprecatedAttrs.unsafe) {\n    deprecatedAttrs.unsafe.forEach((name) => {\n      if (attributesInStylesheet.has(name)) {\n        return;\n      }\n      delete node.attributes[name];\n    });\n  }\n}\n\n/**\n * Remove deprecated attributes.\n *\n * @type {import('../lib/types.js').Plugin<RemoveDeprecatedAttrsParams>}\n */\nexport function fn(root, params) {\n  const stylesheet = collectStylesheet(root);\n  const attributesInStylesheet = extractAttributesInStylesheet(stylesheet);\n\n  return {\n    element: {\n      enter: (node) => {\n        const elemConfig = elems[node.name];\n        if (!elemConfig) {\n          return;\n        }\n\n        // Special cases\n\n        // Removing deprecated xml:lang is safe when the lang attribute exists.\n        if (\n          elemConfig.attrsGroups.has('core') &&\n          node.attributes['xml:lang'] &&\n          !attributesInStylesheet.has('xml:lang') &&\n          node.attributes['lang']\n        ) {\n          delete node.attributes['xml:lang'];\n        }\n\n        // General cases\n\n        elemConfig.attrsGroups.forEach((attrsGroup) => {\n          processAttributes(\n            node,\n            attrsGroupsDeprecated[attrsGroup],\n            params,\n            attributesInStylesheet,\n          );\n        });\n\n        processAttributes(\n          node,\n          elemConfig.deprecated,\n          params,\n          attributesInStylesheet,\n        );\n      },\n    },\n  };\n}\n"
  },
  {
    "path": "plugins/removeDesc.js",
    "content": "import { detachNodeFromParent } from '../lib/xast.js';\n\n/**\n * @typedef RemoveDescParams\n * @property {boolean=} removeAny\n */\n\nexport const name = 'removeDesc';\nexport const description = 'removes <desc>';\n\nconst standardDescs = /^(Created with|Created using)/;\n\n/**\n * Removes <desc>.\n * Removes only standard editors content or empty elements because it can be\n * used for accessibility. Enable parameter 'removeAny' to remove any\n * description.\n *\n * @author Daniel Wabyick\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/desc\n *\n * @type {import('../lib/types.js').Plugin<RemoveDescParams>}\n */\nexport const fn = (root, params) => {\n  const { removeAny = false } = params;\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        if (node.name === 'desc') {\n          if (\n            removeAny ||\n            node.children.length === 0 ||\n            (node.children[0].type === 'text' &&\n              standardDescs.test(node.children[0].value))\n          ) {\n            detachNodeFromParent(node, parentNode);\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeDimensions.js",
    "content": "export const name = 'removeDimensions';\nexport const description =\n  'removes width and height in presence of viewBox (opposite to removeViewBox)';\n\n/**\n * Remove width/height attributes and add the viewBox attribute if it's missing\n *\n * @example\n * <svg width=\"100\" height=\"50\" />\n *   ↓\n * <svg viewBox=\"0 0 100 50\" />\n *\n * @author Benny Schudel\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  return {\n    element: {\n      enter: (node) => {\n        if (node.name === 'svg') {\n          if (node.attributes.viewBox != null) {\n            delete node.attributes.width;\n            delete node.attributes.height;\n          } else if (\n            node.attributes.width != null &&\n            node.attributes.height != null &&\n            Number.isNaN(Number(node.attributes.width)) === false &&\n            Number.isNaN(Number(node.attributes.height)) === false\n          ) {\n            const width = Number(node.attributes.width);\n            const height = Number(node.attributes.height);\n            node.attributes.viewBox = `0 0 ${width} ${height}`;\n            delete node.attributes.width;\n            delete node.attributes.height;\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeDoctype.js",
    "content": "import { detachNodeFromParent } from '../lib/xast.js';\n\nexport const name = 'removeDoctype';\nexport const description = 'removes doctype declaration';\n\n/**\n * Remove DOCTYPE declaration.\n *\n * \"Unfortunately the SVG DTDs are a source of so many\n * issues that the SVG WG has decided not to write one\n * for the upcoming SVG 1.2 standard. In fact SVG WG\n * members are even telling people not to use a DOCTYPE\n * declaration in SVG 1.0 and 1.1 documents\"\n * https://jwatt.org/svg/authoring/#doctype-declaration\n *\n * @example\n * <!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n * q\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n *\n * @example\n * <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n * \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" [\n *     <!-- an internal subset can be embedded here -->\n * ]>\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  return {\n    doctype: {\n      enter: (node, parentNode) => {\n        detachNodeFromParent(node, parentNode);\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeEditorsNSData.js",
    "content": "import { editorNamespaces } from './_collections.js';\nimport { detachNodeFromParent } from '../lib/xast.js';\n\n/**\n * @typedef RemoveEditorsNSDataParams\n * @property {string[]=} additionalNamespaces\n */\n\nexport const name = 'removeEditorsNSData';\nexport const description =\n  'removes editors namespaces, elements and attributes';\n\n/**\n * Remove editors namespaces, elements and attributes.\n *\n * @example\n * <svg xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\">\n * <sodipodi:namedview/>\n * <path sodipodi:nodetypes=\"cccc\"/>\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin<RemoveEditorsNSDataParams>}\n */\nexport const fn = (_root, params) => {\n  let namespaces = [...editorNamespaces];\n  if (Array.isArray(params.additionalNamespaces)) {\n    namespaces = [...editorNamespaces, ...params.additionalNamespaces];\n  }\n  /** @type {string[]} */\n  const prefixes = [];\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        // collect namespace prefixes from svg element\n        if (node.name === 'svg') {\n          for (const [name, value] of Object.entries(node.attributes)) {\n            if (name.startsWith('xmlns:') && namespaces.includes(value)) {\n              prefixes.push(name.slice('xmlns:'.length));\n              // <svg xmlns:sodipodi=\"\">\n              delete node.attributes[name];\n            }\n          }\n        }\n        // remove editor attributes, for example\n        // <* sodipodi:*=\"\">\n        for (const name of Object.keys(node.attributes)) {\n          if (name.includes(':')) {\n            const [prefix] = name.split(':');\n            if (prefixes.includes(prefix)) {\n              delete node.attributes[name];\n            }\n          }\n        }\n        // remove editor elements, for example\n        // <sodipodi:*>\n        if (node.name.includes(':')) {\n          const [prefix] = node.name.split(':');\n          if (prefixes.includes(prefix)) {\n            detachNodeFromParent(node, parentNode);\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeElementsByAttr.js",
    "content": "import { detachNodeFromParent } from '../lib/xast.js';\n\n/**\n * @typedef RemoveElementsByAttrParams\n * @property {string | string[]=} id\n * @property {string | string[]=} class\n */\n\nexport const name = 'removeElementsByAttr';\nexport const description = 'removes arbitrary elements by ID or className';\n\n/**\n * Remove arbitrary SVG elements by ID or className.\n *\n * @example id\n *     > single: remove element with ID of `elementID`\n *     ---\n *     removeElementsByAttr:\n *       id: 'elementID'\n *\n *     > list: remove multiple elements by ID\n *     ---\n *     removeElementsByAttr:\n *       id:\n *         - 'elementID'\n *         - 'anotherID'\n *\n * @example class\n *     > single: remove all elements with class of `elementClass`\n *     ---\n *     removeElementsByAttr:\n *       class: 'elementClass'\n *\n *     > list: remove all elements with class of `elementClass` or `anotherClass`\n *     ---\n *     removeElementsByAttr:\n *       class:\n *         - 'elementClass'\n *         - 'anotherClass'\n *\n * @author Eli Dupuis (@elidupuis)\n *\n * @type {import('../lib/types.js').Plugin<RemoveElementsByAttrParams>}\n */\nexport const fn = (root, params) => {\n  const ids =\n    params.id == null ? [] : Array.isArray(params.id) ? params.id : [params.id];\n  const classes =\n    params.class == null\n      ? []\n      : Array.isArray(params.class)\n        ? params.class\n        : [params.class];\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        // remove element if it's `id` matches configured `id` params\n        if (node.attributes.id != null && ids.length !== 0) {\n          if (ids.includes(node.attributes.id)) {\n            detachNodeFromParent(node, parentNode);\n          }\n        }\n        // remove element if it's `class` contains any of the configured `class` params\n        if (node.attributes.class && classes.length !== 0) {\n          const classList = node.attributes.class.split(' ');\n          for (const item of classes) {\n            if (classList.includes(item)) {\n              detachNodeFromParent(node, parentNode);\n              break;\n            }\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeEmptyAttrs.js",
    "content": "import { attrsGroups } from './_collections.js';\n\nexport const name = 'removeEmptyAttrs';\nexport const description = 'removes empty attributes';\n\n/**\n * Remove attributes with empty values.\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  return {\n    element: {\n      enter: (node) => {\n        for (const [name, value] of Object.entries(node.attributes)) {\n          if (\n            value === '' &&\n            // empty conditional processing attributes prevents elements from rendering\n            !attrsGroups.conditionalProcessing.has(name)\n          ) {\n            delete node.attributes[name];\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeEmptyContainers.js",
    "content": "import { elemsGroups } from './_collections.js';\nimport { detachNodeFromParent } from '../lib/xast.js';\nimport { collectStylesheet, computeStyle } from '../lib/style.js';\nimport { findReferences } from '../lib/svgo/tools.js';\n\nexport const name = 'removeEmptyContainers';\nexport const description = 'removes empty container elements';\n\n/**\n * Remove empty containers.\n *\n * @see https://www.w3.org/TR/SVG11/intro.html#TermContainerElement\n *\n * @example\n * <defs/>\n *\n * @example\n * <g><marker><a/></marker></g>\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = (root) => {\n  const stylesheet = collectStylesheet(root);\n  const removedIds = new Set();\n  /**\n   * @type {Map<string, {\n   *   node: import('../lib/types.js').XastElement,\n   *   parent: import('../lib/types.js').XastParent,\n   * }[]>}\n   */\n  const usesById = new Map();\n\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        if (node.name === 'use') {\n          // Record uses so those referencing empty containers can be removed.\n          for (const [name, value] of Object.entries(node.attributes)) {\n            const ids = findReferences(name, value);\n            for (const id of ids) {\n              let references = usesById.get(id);\n              if (references === undefined) {\n                references = [];\n                usesById.set(id, references);\n              }\n              references.push({ node: node, parent: parentNode });\n            }\n          }\n        }\n      },\n      exit: (node, parentNode) => {\n        // remove only empty non-svg containers\n        if (\n          node.name === 'svg' ||\n          !elemsGroups.container.has(node.name) ||\n          node.children.length !== 0\n        ) {\n          return;\n        }\n        // empty patterns may contain reusable configuration\n        if (\n          node.name === 'pattern' &&\n          Object.keys(node.attributes).length !== 0\n        ) {\n          return;\n        }\n\n        // empty <mask> hides masked element\n        if (node.name === 'mask' && node.attributes.id != null) {\n          return;\n        }\n        if (parentNode.type === 'element' && parentNode.name === 'switch') {\n          return;\n        }\n\n        // The <g> may not have content, but the filter may cause a rectangle\n        // to be created and filled with pattern.\n        if (\n          node.name === 'g' &&\n          (node.attributes.filter != null ||\n            computeStyle(stylesheet, node).filter)\n        ) {\n          return;\n        }\n\n        detachNodeFromParent(node, parentNode);\n        if (node.attributes.id) {\n          removedIds.add(node.attributes.id);\n        }\n      },\n    },\n    root: {\n      exit: () => {\n        // Remove any <use> elements that referenced an empty container.\n        for (const id of removedIds) {\n          const uses = usesById.get(id);\n          if (uses) {\n            for (const use of uses) {\n              detachNodeFromParent(use.node, use.parent);\n            }\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeEmptyText.js",
    "content": "import { detachNodeFromParent } from '../lib/xast.js';\n\n/**\n * @typedef RemoveEmptyTextParams\n * @property {boolean=} text\n * @property {boolean=} tspan\n * @property {boolean=} tref\n */\n\nexport const name = 'removeEmptyText';\nexport const description = 'removes empty <text> elements';\n\n/**\n * Remove empty Text elements.\n *\n * @see https://www.w3.org/TR/SVG11/text.html\n *\n * @example\n * Remove empty text element:\n * <text/>\n *\n * Remove empty tspan element:\n * <tspan/>\n *\n * Remove tref with empty xlink:href attribute:\n * <tref xlink:href=\"\"/>\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin<RemoveEmptyTextParams>}\n */\nexport const fn = (root, params) => {\n  const { text = true, tspan = true, tref = true } = params;\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        // Remove empty text element\n        if (text && node.name === 'text' && node.children.length === 0) {\n          detachNodeFromParent(node, parentNode);\n        }\n        // Remove empty tspan element\n        if (tspan && node.name === 'tspan' && node.children.length === 0) {\n          detachNodeFromParent(node, parentNode);\n        }\n        // Remove tref with empty xlink:href attribute\n        if (\n          tref &&\n          node.name === 'tref' &&\n          node.attributes['xlink:href'] == null\n        ) {\n          detachNodeFromParent(node, parentNode);\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeHiddenElems.js",
    "content": "import { elemsGroups } from './_collections.js';\nimport { detachNodeFromParent, querySelector } from '../lib/xast.js';\nimport { visit, visitSkip } from '../lib/util/visit.js';\nimport { collectStylesheet, computeStyle } from '../lib/style.js';\nimport { parsePathData } from '../lib/path.js';\nimport { findReferences, hasScripts } from '../lib/svgo/tools.js';\n\n/**\n * @typedef RemoveHiddenElemsParams\n * @property {boolean=} isHidden\n * @property {boolean=} displayNone\n * @property {boolean=} opacity0\n * @property {boolean=} circleR0\n * @property {boolean=} ellipseRX0\n * @property {boolean=} ellipseRY0\n * @property {boolean=} rectWidth0\n * @property {boolean=} rectHeight0\n * @property {boolean=} patternWidth0\n * @property {boolean=} patternHeight0\n * @property {boolean=} imageWidth0\n * @property {boolean=} imageHeight0\n * @property {boolean=} pathEmptyD\n * @property {boolean=} polylineEmptyPoints\n * @property {boolean=} polygonEmptyPoints\n */\n\nconst nonRendering = elemsGroups.nonRendering;\n\nexport const name = 'removeHiddenElems';\nexport const description =\n  'removes hidden elements (zero sized, with absent attributes)';\n\n/**\n * Remove hidden elements with disabled rendering:\n * - display=\"none\"\n * - opacity=\"0\"\n * - circle with zero radius\n * - ellipse with zero x-axis or y-axis radius\n * - rectangle with zero width or height\n * - pattern with zero width or height\n * - image with zero width or height\n * - path with empty data\n * - polyline with empty points\n * - polygon with empty points\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin<RemoveHiddenElemsParams>}\n */\nexport const fn = (root, params) => {\n  const {\n    isHidden = true,\n    displayNone = true,\n    opacity0 = true,\n    circleR0 = true,\n    ellipseRX0 = true,\n    ellipseRY0 = true,\n    rectWidth0 = true,\n    rectHeight0 = true,\n    patternWidth0 = true,\n    patternHeight0 = true,\n    imageWidth0 = true,\n    imageHeight0 = true,\n    pathEmptyD = true,\n    polylineEmptyPoints = true,\n    polygonEmptyPoints = true,\n  } = params;\n  const stylesheet = collectStylesheet(root);\n\n  /**\n   * Skip non-rendered nodes initially, and only detach if they have no ID, or\n   * their ID is not referenced by another node.\n   *\n   * @type {Map<import('../lib/types.js').XastElement, import('../lib/types.js').XastParent>}\n   */\n  const nonRenderedNodes = new Map();\n\n  /**\n   * IDs for removed hidden definitions.\n   *\n   * @type {Set<string>}\n   */\n  const removedDefIds = new Set();\n\n  /** @type {Map<import('../lib/types.js').XastElement, import('../lib/types.js').XastParent>} */\n  const allDefs = new Map();\n\n  /** @type {Set<string>} */\n  const allReferences = new Set();\n\n  /** @type {Map<string, Array<{ node: import('../lib/types.js').XastElement, parentNode: import('../lib/types.js').XastParent }>>} */\n  const referencesById = new Map();\n\n  /**\n   * If styles are present, we can't be sure if a definition is unused or not\n   */\n  let deoptimized = false;\n\n  /**\n   * Nodes can't be removed if they or any of their children have an id attribute that is referenced.\n   * @param {import('../lib/types.js').XastElement} node\n   * @returns boolean\n   */\n  function canRemoveNonRenderingNode(node) {\n    if (allReferences.has(node.attributes.id)) {\n      return false;\n    }\n    for (const child of node.children) {\n      if (child.type === 'element' && !canRemoveNonRenderingNode(child)) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  /**\n   * @param {import('../lib/types.js').XastChild} node\n   * @param {import('../lib/types.js').XastParent} parentNode\n   */\n  function removeElement(node, parentNode) {\n    if (\n      node.type === 'element' &&\n      node.attributes.id != null &&\n      parentNode.type === 'element' &&\n      parentNode.name === 'defs'\n    ) {\n      removedDefIds.add(node.attributes.id);\n    }\n\n    detachNodeFromParent(node, parentNode);\n  }\n\n  visit(root, {\n    element: {\n      enter: (node, parentNode) => {\n        // transparent non-rendering elements still apply where referenced\n        if (nonRendering.has(node.name)) {\n          nonRenderedNodes.set(node, parentNode);\n          return visitSkip;\n        }\n        const computedStyle = computeStyle(stylesheet, node);\n        // opacity=\"0\"\n        //\n        // https://www.w3.org/TR/SVG11/masking.html#ObjectAndGroupOpacityProperties\n        if (\n          opacity0 &&\n          computedStyle.opacity &&\n          computedStyle.opacity.type === 'static' &&\n          computedStyle.opacity.value === '0'\n        ) {\n          if (node.name === 'path') {\n            nonRenderedNodes.set(node, parentNode);\n            return visitSkip;\n          }\n          removeElement(node, parentNode);\n        }\n      },\n    },\n  });\n\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        if (\n          (node.name === 'style' && node.children.length !== 0) ||\n          hasScripts(node)\n        ) {\n          deoptimized = true;\n          return;\n        }\n\n        if (node.name === 'defs') {\n          allDefs.set(node, parentNode);\n        }\n\n        if (node.name === 'use') {\n          for (const attr of Object.keys(node.attributes)) {\n            if (attr !== 'href' && !attr.endsWith(':href')) {\n              continue;\n            }\n            const value = node.attributes[attr];\n            const id = value.slice(1);\n\n            let refs = referencesById.get(id);\n            if (!refs) {\n              refs = [];\n              referencesById.set(id, refs);\n            }\n            refs.push({ node, parentNode });\n          }\n        }\n\n        // Circles with zero radius\n        //\n        // https://www.w3.org/TR/SVG11/shapes.html#CircleElementRAttribute\n        // \"A value of zero disables rendering of the element\"\n        //\n        // <circle r=\"0\">\n        if (\n          circleR0 &&\n          node.name === 'circle' &&\n          node.children.length === 0 &&\n          node.attributes.r === '0'\n        ) {\n          removeElement(node, parentNode);\n          return;\n        }\n\n        // Ellipse with zero x-axis radius\n        //\n        // https://www.w3.org/TR/SVG11/shapes.html#EllipseElementRXAttribute\n        // \"A value of zero disables rendering of the element\"\n        //\n        // <ellipse rx=\"0\">\n        if (\n          ellipseRX0 &&\n          node.name === 'ellipse' &&\n          node.children.length === 0 &&\n          node.attributes.rx === '0'\n        ) {\n          removeElement(node, parentNode);\n          return;\n        }\n\n        // Ellipse with zero y-axis radius\n        //\n        // https://www.w3.org/TR/SVG11/shapes.html#EllipseElementRYAttribute\n        // \"A value of zero disables rendering of the element\"\n        //\n        // <ellipse ry=\"0\">\n        if (\n          ellipseRY0 &&\n          node.name === 'ellipse' &&\n          node.children.length === 0 &&\n          node.attributes.ry === '0'\n        ) {\n          removeElement(node, parentNode);\n          return;\n        }\n\n        // Rectangle with zero width\n        //\n        // https://www.w3.org/TR/SVG11/shapes.html#RectElementWidthAttribute\n        // \"A value of zero disables rendering of the element\"\n        //\n        // <rect width=\"0\">\n        if (\n          rectWidth0 &&\n          node.name === 'rect' &&\n          node.children.length === 0 &&\n          node.attributes.width === '0'\n        ) {\n          removeElement(node, parentNode);\n          return;\n        }\n\n        // Rectangle with zero height\n        //\n        // https://www.w3.org/TR/SVG11/shapes.html#RectElementHeightAttribute\n        // \"A value of zero disables rendering of the element\"\n        //\n        // <rect height=\"0\">\n        if (\n          rectHeight0 &&\n          rectWidth0 &&\n          node.name === 'rect' &&\n          node.children.length === 0 &&\n          node.attributes.height === '0'\n        ) {\n          removeElement(node, parentNode);\n          return;\n        }\n\n        // Pattern with zero width\n        //\n        // https://www.w3.org/TR/SVG11/pservers.html#PatternElementWidthAttribute\n        // \"A value of zero disables rendering of the element (i.e., no paint is applied)\"\n        //\n        // <pattern width=\"0\">\n        if (\n          patternWidth0 &&\n          node.name === 'pattern' &&\n          node.attributes.width === '0'\n        ) {\n          removeElement(node, parentNode);\n          return;\n        }\n\n        // Pattern with zero height\n        //\n        // https://www.w3.org/TR/SVG11/pservers.html#PatternElementHeightAttribute\n        // \"A value of zero disables rendering of the element (i.e., no paint is applied)\"\n        //\n        // <pattern height=\"0\">\n        if (\n          patternHeight0 &&\n          node.name === 'pattern' &&\n          node.attributes.height === '0'\n        ) {\n          removeElement(node, parentNode);\n          return;\n        }\n\n        // Image with zero width\n        //\n        // https://www.w3.org/TR/SVG11/struct.html#ImageElementWidthAttribute\n        // \"A value of zero disables rendering of the element\"\n        //\n        // <image width=\"0\">\n        if (\n          imageWidth0 &&\n          node.name === 'image' &&\n          node.attributes.width === '0'\n        ) {\n          removeElement(node, parentNode);\n          return;\n        }\n\n        // Image with zero height\n        //\n        // https://www.w3.org/TR/SVG11/struct.html#ImageElementHeightAttribute\n        // \"A value of zero disables rendering of the element\"\n        //\n        // <image height=\"0\">\n        if (\n          imageHeight0 &&\n          node.name === 'image' &&\n          node.attributes.height === '0'\n        ) {\n          removeElement(node, parentNode);\n          return;\n        }\n\n        // Polyline with empty points\n        //\n        // https://www.w3.org/TR/SVG11/shapes.html#PolylineElementPointsAttribute\n        //\n        // <polyline points=\"\">\n        if (\n          polylineEmptyPoints &&\n          node.name === 'polyline' &&\n          node.attributes.points == null\n        ) {\n          removeElement(node, parentNode);\n          return;\n        }\n\n        // Polygon with empty points\n        //\n        // https://www.w3.org/TR/SVG11/shapes.html#PolygonElementPointsAttribute\n        //\n        // <polygon points=\"\">\n        if (\n          polygonEmptyPoints &&\n          node.name === 'polygon' &&\n          node.attributes.points == null\n        ) {\n          removeElement(node, parentNode);\n          return;\n        }\n\n        // Removes hidden elements\n        // https://www.w3schools.com/cssref/pr_class_visibility.asp\n        const computedStyle = computeStyle(stylesheet, node);\n        if (\n          isHidden &&\n          computedStyle.visibility &&\n          computedStyle.visibility.type === 'static' &&\n          computedStyle.visibility.value === 'hidden' &&\n          // keep if any descendant enables visibility\n          querySelector(node, '[visibility=visible]') == null\n        ) {\n          removeElement(node, parentNode);\n          return;\n        }\n\n        // display=\"none\"\n        //\n        // https://www.w3.org/TR/SVG11/painting.html#DisplayProperty\n        // \"A value of display: none indicates that the given element\n        // and its children shall not be rendered directly\"\n        if (\n          displayNone &&\n          computedStyle.display &&\n          computedStyle.display.type === 'static' &&\n          computedStyle.display.value === 'none' &&\n          // markers with display: none still rendered\n          node.name !== 'marker'\n        ) {\n          removeElement(node, parentNode);\n          return;\n        }\n\n        // Path with empty data\n        //\n        // https://www.w3.org/TR/SVG11/paths.html#DAttribute\n        //\n        // <path d=\"\"/>\n        if (pathEmptyD && node.name === 'path') {\n          if (node.attributes.d == null) {\n            removeElement(node, parentNode);\n            return;\n          }\n          const pathData = parsePathData(node.attributes.d);\n          if (pathData.length === 0) {\n            removeElement(node, parentNode);\n            return;\n          }\n          // keep single point paths for markers\n          if (\n            pathData.length === 1 &&\n            computedStyle['marker-start'] == null &&\n            computedStyle['marker-end'] == null\n          ) {\n            removeElement(node, parentNode);\n            return;\n          }\n        }\n\n        for (const [name, value] of Object.entries(node.attributes)) {\n          const ids = findReferences(name, value);\n\n          for (const id of ids) {\n            allReferences.add(id);\n          }\n        }\n      },\n    },\n    root: {\n      exit: () => {\n        for (const id of removedDefIds) {\n          const refs = referencesById.get(id);\n          if (refs) {\n            for (const { node, parentNode } of refs) {\n              detachNodeFromParent(node, parentNode);\n            }\n          }\n        }\n\n        if (!deoptimized) {\n          for (const [\n            nonRenderedNode,\n            nonRenderedParent,\n          ] of nonRenderedNodes.entries()) {\n            if (canRemoveNonRenderingNode(nonRenderedNode)) {\n              detachNodeFromParent(nonRenderedNode, nonRenderedParent);\n            }\n          }\n        }\n\n        for (const [node, parentNode] of allDefs.entries()) {\n          if (node.children.length === 0) {\n            detachNodeFromParent(node, parentNode);\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeMetadata.js",
    "content": "import { detachNodeFromParent } from '../lib/xast.js';\n\nexport const name = 'removeMetadata';\nexport const description = 'removes <metadata>';\n\n/**\n * Remove <metadata>.\n *\n * https://www.w3.org/TR/SVG11/metadata.html\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        if (node.name === 'metadata') {\n          detachNodeFromParent(node, parentNode);\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeNonInheritableGroupAttrs.js",
    "content": "import {\n  attrsGroups,\n  inheritableAttrs,\n  presentationNonInheritableGroupAttrs,\n} from './_collections.js';\n\nexport const name = 'removeNonInheritableGroupAttrs';\nexport const description =\n  \"removes non-inheritable group's presentational attributes\";\n\n/**\n * Remove non-inheritable group's \"presentation\" attributes.\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  return {\n    element: {\n      enter: (node) => {\n        if (node.name === 'g') {\n          for (const name of Object.keys(node.attributes)) {\n            if (\n              attrsGroups.presentation.has(name) &&\n              !inheritableAttrs.has(name) &&\n              !presentationNonInheritableGroupAttrs.has(name)\n            ) {\n              delete node.attributes[name];\n            }\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeOffCanvasPaths.js",
    "content": "import { detachNodeFromParent } from '../lib/xast.js';\nimport { visitSkip } from '../lib/util/visit.js';\nimport { parsePathData } from '../lib/path.js';\nimport { intersects } from './_path.js';\n\nexport const name = 'removeOffCanvasPaths';\nexport const description =\n  'removes elements that are drawn outside of the viewBox';\n\n/**\n * Remove elements that are drawn outside of the viewBox.\n *\n * @author JoshyPHP\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  /**\n   * @type {?{\n   *   top: number,\n   *   right: number,\n   *   bottom: number,\n   *   left: number,\n   *   width: number,\n   *   height: number\n   * }}\n   */\n  let viewBoxData = null;\n\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        if (node.name === 'svg' && parentNode.type === 'root') {\n          let viewBox = '';\n          // find viewBox\n          if (node.attributes.viewBox != null) {\n            // remove commas and plus signs, normalize and trim whitespace\n            viewBox = node.attributes.viewBox;\n          } else if (\n            node.attributes.height != null &&\n            node.attributes.width != null\n          ) {\n            viewBox = `0 0 ${node.attributes.width} ${node.attributes.height}`;\n          }\n\n          // parse viewBox\n          // remove commas and plus signs, normalize and trim whitespace\n          viewBox = viewBox\n            .replace(/[,+]|px/g, ' ')\n            .replace(/\\s+/g, ' ')\n            .replace(/^\\s*|\\s*$/g, '');\n          // ensure that the dimensions are 4 values separated by space\n          const m =\n            /^(-?\\d*\\.?\\d+) (-?\\d*\\.?\\d+) (\\d*\\.?\\d+) (\\d*\\.?\\d+)$/.exec(\n              viewBox,\n            );\n          if (m == null) {\n            return;\n          }\n          const left = Number.parseFloat(m[1]);\n          const top = Number.parseFloat(m[2]);\n          const width = Number.parseFloat(m[3]);\n          const height = Number.parseFloat(m[4]);\n\n          // store the viewBox boundaries\n          viewBoxData = {\n            left,\n            top,\n            right: left + width,\n            bottom: top + height,\n            width,\n            height,\n          };\n        }\n\n        // consider that any item with a transform attribute is visible\n        if (node.attributes.transform != null) {\n          return visitSkip;\n        }\n\n        if (\n          node.name === 'path' &&\n          node.attributes.d != null &&\n          viewBoxData != null\n        ) {\n          const pathData = parsePathData(node.attributes.d);\n\n          // consider that an M command within the viewBox is visible\n          let visible = false;\n          for (const pathDataItem of pathData) {\n            if (pathDataItem.command === 'M') {\n              const [x, y] = pathDataItem.args;\n              if (\n                x >= viewBoxData.left &&\n                x <= viewBoxData.right &&\n                y >= viewBoxData.top &&\n                y <= viewBoxData.bottom\n              ) {\n                visible = true;\n              }\n            }\n          }\n          if (visible) {\n            return;\n          }\n\n          if (pathData.length === 2) {\n            // close the path too short for intersects()\n            pathData.push({ command: 'z', args: [] });\n          }\n\n          const { left, top, width, height } = viewBoxData;\n          /** @type {ReadonlyArray<import('../lib/types.js').PathDataItem>} */\n          const viewBoxPathData = [\n            { command: 'M', args: [left, top] },\n            { command: 'h', args: [width] },\n            { command: 'v', args: [height] },\n            { command: 'H', args: [left] },\n            { command: 'z', args: [] },\n          ];\n\n          if (intersects(viewBoxPathData, pathData) === false) {\n            detachNodeFromParent(node, parentNode);\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeRasterImages.js",
    "content": "import { detachNodeFromParent } from '../lib/xast.js';\n\nexport const name = 'removeRasterImages';\nexport const description = 'removes raster images';\n\n/**\n * Remove raster images references in <image>.\n *\n * @see https://bugs.webkit.org/show_bug.cgi?id=63548\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        if (\n          node.name === 'image' &&\n          node.attributes['xlink:href'] != null &&\n          /(\\.|image\\/)(jpe?g|png|gif)/.test(node.attributes['xlink:href'])\n        ) {\n          detachNodeFromParent(node, parentNode);\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeScripts.js",
    "content": "import { attrsGroups } from './_collections.js';\nimport { detachNodeFromParent } from '../lib/xast.js';\n\nexport const name = 'removeScripts';\nexport const description = 'removes scripts';\n\n/** Union of all event attributes. */\nconst eventAttrs = [\n  ...attrsGroups.animationEvent,\n  ...attrsGroups.documentEvent,\n  ...attrsGroups.documentElementEvent,\n  ...attrsGroups.globalEvent,\n  ...attrsGroups.graphicalEvent,\n];\n\n/**\n * Remove scripts.\n *\n * https://www.w3.org/TR/SVG11/script.html\n *\n * @author Patrick Klingemann\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        if (node.name === 'script') {\n          detachNodeFromParent(node, parentNode);\n          return;\n        }\n\n        for (const attr of eventAttrs) {\n          if (node.attributes[attr] != null) {\n            delete node.attributes[attr];\n          }\n        }\n      },\n      exit: (node, parentNode) => {\n        if (node.name !== 'a') {\n          return;\n        }\n\n        for (const attr of Object.keys(node.attributes)) {\n          if (attr === 'href' || attr.endsWith(':href')) {\n            if (\n              node.attributes[attr] == null ||\n              !node.attributes[attr].trimStart().startsWith('javascript:')\n            ) {\n              continue;\n            }\n\n            const index = parentNode.children.indexOf(node);\n            const usefulChildren = node.children.filter(\n              (child) => child.type !== 'text',\n            );\n            parentNode.children.splice(index, 1, ...usefulChildren);\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeStyleElement.js",
    "content": "import { detachNodeFromParent } from '../lib/xast.js';\n\nexport const name = 'removeStyleElement';\nexport const description = 'removes <style> element';\n\n/**\n * Remove <style>.\n *\n * https://www.w3.org/TR/SVG11/styling.html#StyleElement\n *\n * @author Betsy Dupuis\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        if (node.name === 'style') {\n          detachNodeFromParent(node, parentNode);\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeTitle.js",
    "content": "import { detachNodeFromParent } from '../lib/xast.js';\n\nexport const name = 'removeTitle';\nexport const description = 'removes <title>';\n\n/**\n * Remove <title>.\n *\n * https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title\n *\n * @author Igor Kalashnikov\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        if (node.name === 'title') {\n          detachNodeFromParent(node, parentNode);\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeUnknownsAndDefaults.js",
    "content": "import {\n  attrsGroups,\n  attrsGroupsDefaults,\n  elems,\n  elemsGroups,\n  presentationNonInheritableGroupAttrs,\n} from './_collections.js';\nimport { detachNodeFromParent } from '../lib/xast.js';\nimport { visitSkip } from '../lib/util/visit.js';\nimport {\n  collectStylesheet,\n  computeStyle,\n  includesAttrSelector,\n} from '../lib/style.js';\n\n/**\n * @typedef RemoveUnknownsAndDefaultsParams\n * @property {boolean=} unknownContent\n * @property {boolean=} unknownAttrs\n * @property {boolean=} defaultAttrs\n * @property {boolean=} defaultMarkupDeclarations\n *   If to remove XML declarations that are assigned their default value. XML\n *   declarations are the properties in the `<?xml … ?>` block at the top of the\n *   document.\n * @property {boolean=} uselessOverrides\n * @property {boolean=} keepDataAttrs\n * @property {boolean=} keepAriaAttrs\n * @property {boolean=} keepRoleAttr\n */\n\nexport const name = 'removeUnknownsAndDefaults';\nexport const description =\n  'removes unknown elements content and attributes, removes attrs with default values';\n\n// resolve all groups references\n\n/** @type {Map<string, Set<string>>} */\nconst allowedChildrenPerElement = new Map();\n/** @type {Map<string, Set<string>>} */\nconst allowedAttributesPerElement = new Map();\n/** @type {Map<string, Map<string, string>>} */\nconst attributesDefaultsPerElement = new Map();\n\nfor (const [name, config] of Object.entries(elems)) {\n  /** @type {Set<string>} */\n  const allowedChildren = new Set();\n  if (config.content) {\n    for (const elementName of config.content) {\n      allowedChildren.add(elementName);\n    }\n  }\n  if (config.contentGroups) {\n    for (const contentGroupName of config.contentGroups) {\n      const elemsGroup = elemsGroups[contentGroupName];\n      if (elemsGroup) {\n        for (const elementName of elemsGroup) {\n          allowedChildren.add(elementName);\n        }\n      }\n    }\n  }\n  /** @type {Set<string>} */\n  const allowedAttributes = new Set();\n  if (config.attrs) {\n    for (const attrName of config.attrs) {\n      allowedAttributes.add(attrName);\n    }\n  }\n  /** @type {Map<string, string>} */\n  const attributesDefaults = new Map();\n  if (config.defaults) {\n    for (const [attrName, defaultValue] of Object.entries(config.defaults)) {\n      attributesDefaults.set(attrName, defaultValue);\n    }\n  }\n  for (const attrsGroupName of config.attrsGroups) {\n    const attrsGroup = attrsGroups[attrsGroupName];\n    if (attrsGroup) {\n      for (const attrName of attrsGroup) {\n        allowedAttributes.add(attrName);\n      }\n    }\n    const groupDefaults = attrsGroupsDefaults[attrsGroupName];\n    if (groupDefaults) {\n      for (const [attrName, defaultValue] of Object.entries(groupDefaults)) {\n        attributesDefaults.set(attrName, defaultValue);\n      }\n    }\n  }\n  allowedChildrenPerElement.set(name, allowedChildren);\n  allowedAttributesPerElement.set(name, allowedAttributes);\n  attributesDefaultsPerElement.set(name, attributesDefaults);\n}\n\n/**\n * Remove unknown elements content and attributes,\n * remove attributes with default values.\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin<RemoveUnknownsAndDefaultsParams>}\n */\nexport const fn = (root, params) => {\n  const {\n    unknownContent = true,\n    unknownAttrs = true,\n    defaultAttrs = true,\n    defaultMarkupDeclarations = true,\n    uselessOverrides = true,\n    keepDataAttrs = true,\n    keepAriaAttrs = true,\n    keepRoleAttr = false,\n  } = params;\n  const stylesheet = collectStylesheet(root);\n\n  return {\n    instruction: {\n      enter: (node) => {\n        if (defaultMarkupDeclarations) {\n          node.value = node.value.replace(/\\s*standalone\\s*=\\s*([\"'])no\\1/, '');\n        }\n      },\n    },\n    element: {\n      enter: (node, parentNode) => {\n        // skip namespaced elements\n        if (node.name.includes(':')) {\n          return;\n        }\n        // skip visiting foreignObject subtree\n        if (node.name === 'foreignObject') {\n          return visitSkip;\n        }\n\n        // remove unknown element's content\n        if (unknownContent && parentNode.type === 'element') {\n          const allowedChildren = allowedChildrenPerElement.get(\n            parentNode.name,\n          );\n          if (allowedChildren == null || allowedChildren.size === 0) {\n            // remove unknown elements\n            if (allowedChildrenPerElement.get(node.name) == null) {\n              detachNodeFromParent(node, parentNode);\n              return;\n            }\n          } else {\n            // remove not allowed children\n            if (allowedChildren.has(node.name) === false) {\n              detachNodeFromParent(node, parentNode);\n              return;\n            }\n          }\n        }\n\n        const allowedAttributes = allowedAttributesPerElement.get(node.name);\n        const attributesDefaults = attributesDefaultsPerElement.get(node.name);\n        const computedParentStyle =\n          parentNode.type === 'element'\n            ? computeStyle(stylesheet, parentNode)\n            : null;\n\n        // remove element's unknown attrs and attrs with default values\n        for (const [name, value] of Object.entries(node.attributes)) {\n          if (keepDataAttrs && name.startsWith('data-')) {\n            continue;\n          }\n          if (keepAriaAttrs && name.startsWith('aria-')) {\n            continue;\n          }\n          if (keepRoleAttr && name === 'role') {\n            continue;\n          }\n          // skip xmlns attribute\n          if (name === 'xmlns') {\n            continue;\n          }\n          // skip namespaced attributes except xml:* and xlink:*\n          if (name.includes(':')) {\n            const [prefix] = name.split(':');\n            if (prefix !== 'xml' && prefix !== 'xlink') {\n              continue;\n            }\n          }\n\n          if (\n            unknownAttrs &&\n            allowedAttributes &&\n            allowedAttributes.has(name) === false\n          ) {\n            delete node.attributes[name];\n          }\n          if (\n            defaultAttrs &&\n            node.attributes.id == null &&\n            attributesDefaults &&\n            attributesDefaults.get(name) === value\n          ) {\n            // keep defaults if parent has own or inherited style\n            if (\n              computedParentStyle?.[name] == null &&\n              !stylesheet.rules.some((rule) =>\n                includesAttrSelector(rule.selector, name),\n              )\n            ) {\n              delete node.attributes[name];\n            }\n          }\n          if (uselessOverrides && node.attributes.id == null) {\n            const style = computedParentStyle?.[name];\n            if (\n              presentationNonInheritableGroupAttrs.has(name) === false &&\n              style != null &&\n              style.type === 'static' &&\n              style.value === value\n            ) {\n              delete node.attributes[name];\n            }\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeUnusedNS.js",
    "content": "export const name = 'removeUnusedNS';\nexport const description = 'removes unused namespaces declaration';\n\n/**\n * Remove unused namespaces declaration from svg element\n * which are not used in elements or attributes\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  /** @type {Set<string>} */\n  const unusedNamespaces = new Set();\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        // collect all namespaces from svg element\n        // (such as xmlns:xlink=\"http://www.w3.org/1999/xlink\")\n        if (node.name === 'svg' && parentNode.type === 'root') {\n          for (const name of Object.keys(node.attributes)) {\n            if (name.startsWith('xmlns:')) {\n              const local = name.slice('xmlns:'.length);\n              unusedNamespaces.add(local);\n            }\n          }\n        }\n        if (unusedNamespaces.size !== 0) {\n          // preserve namespace used in nested elements names\n          if (node.name.includes(':')) {\n            const [ns] = node.name.split(':');\n            if (unusedNamespaces.has(ns)) {\n              unusedNamespaces.delete(ns);\n            }\n          }\n          // preserve namespace used in nested elements attributes\n          for (const name of Object.keys(node.attributes)) {\n            if (name.includes(':')) {\n              const [ns] = name.split(':');\n              unusedNamespaces.delete(ns);\n            }\n          }\n        }\n      },\n      exit: (node, parentNode) => {\n        // remove unused namespace attributes from svg element\n        if (node.name === 'svg' && parentNode.type === 'root') {\n          for (const name of unusedNamespaces) {\n            delete node.attributes[`xmlns:${name}`];\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeUselessDefs.js",
    "content": "import { detachNodeFromParent } from '../lib/xast.js';\nimport { elemsGroups } from './_collections.js';\n\nexport const name = 'removeUselessDefs';\nexport const description = 'removes elements in <defs> without id';\n\n/**\n * Removes content of defs and properties that aren't rendered directly without ids.\n *\n * @author Lev Solntsev\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        if (\n          node.name === 'defs' ||\n          (elemsGroups.nonRendering.has(node.name) &&\n            node.attributes.id == null)\n        ) {\n          /** @type {import('../lib/types.js').XastElement[]} */\n          const usefulNodes = [];\n          collectUsefulNodes(node, usefulNodes);\n          if (usefulNodes.length === 0) {\n            detachNodeFromParent(node, parentNode);\n          }\n          node.children = usefulNodes;\n        }\n      },\n    },\n  };\n};\n\n/**\n * @param {import('../lib/types.js').XastElement} node\n * @param {import('../lib/types.js').XastElement[]} usefulNodes\n */\nconst collectUsefulNodes = (node, usefulNodes) => {\n  for (const child of node.children) {\n    if (child.type === 'element') {\n      if (child.attributes.id != null || child.name === 'style') {\n        usefulNodes.push(child);\n      } else {\n        collectUsefulNodes(child, usefulNodes);\n      }\n    }\n  }\n};\n"
  },
  {
    "path": "plugins/removeUselessStrokeAndFill.js",
    "content": "import { detachNodeFromParent } from '../lib/xast.js';\nimport { visit, visitSkip } from '../lib/util/visit.js';\nimport { collectStylesheet, computeStyle } from '../lib/style.js';\nimport { hasScripts } from '../lib/svgo/tools.js';\nimport { elemsGroups } from './_collections.js';\n\n/**\n * @typedef RemoveUselessStrokeAndFillParams\n * @property {boolean=} stroke\n * @property {boolean=} fill\n * @property {boolean=} removeNone\n */\n\nexport const name = 'removeUselessStrokeAndFill';\nexport const description = 'removes useless stroke and fill attributes';\n\n/**\n * Remove useless stroke and fill attrs.\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin<RemoveUselessStrokeAndFillParams>}\n */\nexport const fn = (root, params) => {\n  const {\n    stroke: removeStroke = true,\n    fill: removeFill = true,\n    removeNone = false,\n  } = params;\n\n  // style and script elements deoptimize this plugin\n  let hasStyleOrScript = false;\n  visit(root, {\n    element: {\n      enter: (node) => {\n        if (node.name === 'style' || hasScripts(node)) {\n          hasStyleOrScript = true;\n        }\n      },\n    },\n  });\n  if (hasStyleOrScript) {\n    return null;\n  }\n\n  const stylesheet = collectStylesheet(root);\n\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        // id attribute deoptimize the whole subtree\n        if (node.attributes.id != null) {\n          return visitSkip;\n        }\n        if (!elemsGroups.shape.has(node.name)) {\n          return;\n        }\n        const computedStyle = computeStyle(stylesheet, node);\n        const stroke = computedStyle.stroke;\n        const strokeOpacity = computedStyle['stroke-opacity'];\n        const strokeWidth = computedStyle['stroke-width'];\n        const markerEnd = computedStyle['marker-end'];\n        const fill = computedStyle.fill;\n        const fillOpacity = computedStyle['fill-opacity'];\n        const computedParentStyle =\n          parentNode.type === 'element'\n            ? computeStyle(stylesheet, parentNode)\n            : null;\n        const parentStroke =\n          computedParentStyle == null ? null : computedParentStyle.stroke;\n\n        // remove stroke*\n        if (removeStroke) {\n          if (\n            stroke == null ||\n            (stroke.type === 'static' && stroke.value == 'none') ||\n            (strokeOpacity != null &&\n              strokeOpacity.type === 'static' &&\n              strokeOpacity.value === '0') ||\n            (strokeWidth != null &&\n              strokeWidth.type === 'static' &&\n              strokeWidth.value === '0')\n          ) {\n            // stroke-width may affect the size of marker-end\n            // marker is not visible when stroke-width is 0\n            if (\n              (strokeWidth != null &&\n                strokeWidth.type === 'static' &&\n                strokeWidth.value === '0') ||\n              markerEnd == null\n            ) {\n              for (const name of Object.keys(node.attributes)) {\n                if (name.startsWith('stroke')) {\n                  delete node.attributes[name];\n                }\n              }\n              // set explicit none to not inherit from parent\n              if (\n                parentStroke != null &&\n                parentStroke.type === 'static' &&\n                parentStroke.value !== 'none'\n              ) {\n                node.attributes.stroke = 'none';\n              }\n            }\n          }\n        }\n\n        // remove fill*\n        if (removeFill) {\n          if (\n            (fill != null && fill.type === 'static' && fill.value === 'none') ||\n            (fillOpacity != null &&\n              fillOpacity.type === 'static' &&\n              fillOpacity.value === '0')\n          ) {\n            for (const name of Object.keys(node.attributes)) {\n              if (name.startsWith('fill-')) {\n                delete node.attributes[name];\n              }\n            }\n            if (\n              fill == null ||\n              (fill.type === 'static' && fill.value !== 'none')\n            ) {\n              node.attributes.fill = 'none';\n            }\n          }\n        }\n\n        if (removeNone) {\n          if (\n            (stroke == null || node.attributes.stroke === 'none') &&\n            ((fill != null &&\n              fill.type === 'static' &&\n              fill.value === 'none') ||\n              node.attributes.fill === 'none')\n          ) {\n            detachNodeFromParent(node, parentNode);\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeViewBox.js",
    "content": "export const name = 'removeViewBox';\nexport const description = 'removes viewBox attribute when possible';\n\nconst viewBoxElems = new Set(['pattern', 'svg', 'symbol']);\n\n/**\n * Remove viewBox attr which coincides with a width/height box.\n *\n * @see https://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute\n *\n * @example\n * <svg width=\"100\" height=\"50\" viewBox=\"0 0 100 50\">\n *  ⬇\n * <svg width=\"100\" height=\"50\">\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        if (\n          viewBoxElems.has(node.name) &&\n          node.attributes.viewBox != null &&\n          node.attributes.width != null &&\n          node.attributes.height != null\n        ) {\n          // TODO remove width/height for such case instead\n          if (node.name === 'svg' && parentNode.type !== 'root') {\n            return;\n          }\n          const numbers = node.attributes.viewBox.split(/[ ,]+/g);\n          if (\n            numbers[0] === '0' &&\n            numbers[1] === '0' &&\n            node.attributes.width.replace(/px$/, '') === numbers[2] && // could use parseFloat too\n            node.attributes.height.replace(/px$/, '') === numbers[3]\n          ) {\n            delete node.attributes.viewBox;\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeXMLNS.js",
    "content": "export const name = 'removeXMLNS';\nexport const description = 'removes xmlns attribute (for inline svg)';\n\n/**\n * Remove the xmlns attribute when present.\n *\n * @example\n * <svg viewBox=\"0 0 100 50\" xmlns=\"http://www.w3.org/2000/svg\">\n *   ↓\n * <svg viewBox=\"0 0 100 50\">\n *\n * @author Ricardo Tomasi\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  return {\n    element: {\n      enter: (node) => {\n        if (node.name === 'svg') {\n          delete node.attributes.xmlns;\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeXMLProcInst.js",
    "content": "import { detachNodeFromParent } from '../lib/xast.js';\n\nexport const name = 'removeXMLProcInst';\nexport const description = 'removes XML processing instructions';\n\n/**\n * Remove XML Processing Instruction.\n *\n * @example\n * <?xml version=\"1.0\" encoding=\"utf-8\"?>\n *\n * @author Kir Belevich\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  return {\n    instruction: {\n      enter: (node, parentNode) => {\n        if (node.name === 'xml') {\n          detachNodeFromParent(node, parentNode);\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/removeXlink.js",
    "content": "import { elems } from './_collections.js';\n\n/**\n * @typedef RemoveXlinkParams\n * @property {boolean=} includeLegacy\n *   By default this plugin ignores legacy elements that were deprecated or\n *   removed in SVG 2. Set to true to force performing operations on those too.\n */\n\nexport const name = 'removeXlink';\nexport const description =\n  'remove xlink namespace and replaces attributes with the SVG 2 equivalent where applicable';\n\n/** URI indicating the Xlink namespace. */\nconst XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';\n\n/**\n * Map of `xlink:show` values to the SVG 2 `target` attribute values.\n *\n * @type {Record<string, string>}\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:show#usage_notes\n */\nconst SHOW_TO_TARGET = {\n  new: '_blank',\n  replace: '_self',\n};\n\n/**\n * Elements that use xlink:href, but were deprecated in SVG 2 and therefore\n * don't support the SVG 2 href attribute.\n *\n * @type {Set<string>}\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/href\n */\nconst LEGACY_ELEMENTS = new Set([\n  'cursor',\n  'filter',\n  'font-face-uri',\n  'glyphRef',\n  'tref',\n]);\n\n/**\n * @param {import('../lib/types.js').XastElement} node\n * @param {ReadonlyArray<string>} prefixes\n * @param {string} attr\n * @returns {string[]}\n */\nconst findPrefixedAttrs = (node, prefixes, attr) => {\n  return prefixes\n    .map((prefix) => `${prefix}:${attr}`)\n    .filter((attr) => node.attributes[attr] != null);\n};\n\n/**\n * Removes XLink namespace prefixes and converts references to XLink attributes\n * to the native SVG equivalent.\n *\n * XLink namespace is deprecated in SVG 2.\n *\n * @type {import('../lib/types.js').Plugin<RemoveXlinkParams>}\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href\n */\nexport const fn = (_, params) => {\n  const { includeLegacy } = params;\n\n  /**\n   * XLink namespace prefixes that are currently in the stack.\n   *\n   * @type {string[]}\n   */\n  const xlinkPrefixes = [];\n\n  /**\n   * Namespace prefixes that exist in {@link xlinkPrefixes} but were overridden\n   * in a child element to point to another namespace, and is not treated as an\n   * XLink attribute.\n   *\n   * @type {string[]}\n   */\n  const overriddenPrefixes = [];\n\n  /**\n   * Namespace prefixes that were used in one of the {@link LEGACY_ELEMENTS}.\n   *\n   * @type {string[]}\n   */\n  const usedInLegacyElement = [];\n\n  return {\n    element: {\n      enter: (node) => {\n        for (const [key, value] of Object.entries(node.attributes)) {\n          if (key.startsWith('xmlns:')) {\n            const prefix = key.split(':', 2)[1];\n\n            if (value === XLINK_NAMESPACE) {\n              xlinkPrefixes.push(prefix);\n              continue;\n            }\n\n            if (xlinkPrefixes.includes(prefix)) {\n              overriddenPrefixes.push(prefix);\n            }\n          }\n        }\n\n        if (\n          overriddenPrefixes.some((prefix) => xlinkPrefixes.includes(prefix))\n        ) {\n          return;\n        }\n\n        const showAttrs = findPrefixedAttrs(node, xlinkPrefixes, 'show');\n        let showHandled = node.attributes.target != null;\n        for (let i = showAttrs.length - 1; i >= 0; i--) {\n          const attr = showAttrs[i];\n          const value = node.attributes[attr];\n          const mapping = SHOW_TO_TARGET[value];\n\n          if (showHandled || mapping == null) {\n            delete node.attributes[attr];\n            continue;\n          }\n\n          if (mapping !== elems[node.name]?.defaults?.target) {\n            node.attributes.target = mapping;\n          }\n\n          delete node.attributes[attr];\n          showHandled = true;\n        }\n\n        const titleAttrs = findPrefixedAttrs(node, xlinkPrefixes, 'title');\n        for (let i = titleAttrs.length - 1; i >= 0; i--) {\n          const attr = titleAttrs[i];\n          const value = node.attributes[attr];\n          const hasTitle = node.children.filter(\n            (child) => child.type === 'element' && child.name === 'title',\n          );\n\n          if (hasTitle.length > 0) {\n            delete node.attributes[attr];\n            continue;\n          }\n\n          /** @type {import('../lib/types.js').XastElement} */\n          const titleTag = {\n            type: 'element',\n            name: 'title',\n            attributes: {},\n            children: [\n              {\n                type: 'text',\n                value,\n              },\n            ],\n          };\n\n          Object.defineProperty(titleTag, 'parentNode', {\n            writable: true,\n            value: node,\n          });\n\n          node.children.unshift(titleTag);\n          delete node.attributes[attr];\n        }\n\n        const hrefAttrs = findPrefixedAttrs(node, xlinkPrefixes, 'href');\n\n        if (\n          hrefAttrs.length > 0 &&\n          LEGACY_ELEMENTS.has(node.name) &&\n          !includeLegacy\n        ) {\n          hrefAttrs\n            .map((attr) => attr.split(':', 1)[0])\n            .forEach((prefix) => usedInLegacyElement.push(prefix));\n          return;\n        }\n\n        for (let i = hrefAttrs.length - 1; i >= 0; i--) {\n          const attr = hrefAttrs[i];\n          const value = node.attributes[attr];\n\n          if (node.attributes.href != null) {\n            delete node.attributes[attr];\n            continue;\n          }\n\n          node.attributes.href = value;\n          delete node.attributes[attr];\n        }\n      },\n      exit: (node) => {\n        for (const [key, value] of Object.entries(node.attributes)) {\n          const [prefix, attr] = key.split(':', 2);\n\n          if (\n            xlinkPrefixes.includes(prefix) &&\n            !overriddenPrefixes.includes(prefix) &&\n            !usedInLegacyElement.includes(prefix) &&\n            !includeLegacy\n          ) {\n            delete node.attributes[key];\n            continue;\n          }\n\n          if (key.startsWith('xmlns:') && !usedInLegacyElement.includes(attr)) {\n            if (value === XLINK_NAMESPACE) {\n              const index = xlinkPrefixes.indexOf(attr);\n              xlinkPrefixes.splice(index, 1);\n              delete node.attributes[key];\n              continue;\n            }\n\n            if (overriddenPrefixes.includes(prefix)) {\n              const index = overriddenPrefixes.indexOf(attr);\n              overriddenPrefixes.splice(index, 1);\n            }\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/reusePaths.js",
    "content": "import { collectStylesheet } from '../lib/style.js';\nimport { detachNodeFromParent, querySelectorAll } from '../lib/xast.js';\n\nexport const name = 'reusePaths';\nexport const description =\n  'Finds <path> elements with the same d, fill, and ' +\n  'stroke, and converts them to <use> elements ' +\n  'referencing a single <path> def.';\n\n/**\n * Finds <path> elements with the same d, fill, and stroke, and converts them to\n * <use> elements referencing a single <path> def.\n *\n * @author Jacob Howcroft\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = (root) => {\n  const stylesheet = collectStylesheet(root);\n\n  /** @type {Map<string, import('../lib/types.js').XastElement[]>} */\n  const paths = new Map();\n\n  /**\n   * Reference to the first defs element that is a direct child of the svg\n   * element if one exists.\n   *\n   * @type {import('../lib/types.js').XastElement}\n   * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs\n   */\n  let svgDefs;\n\n  /**\n   * Set of hrefs that reference the id of another node.\n   *\n   * @type {Set<string>}\n   */\n  const hrefs = new Set();\n\n  return {\n    element: {\n      enter: (node, parentNode) => {\n        if (node.name === 'path' && node.attributes.d != null) {\n          const d = node.attributes.d;\n          const fill = node.attributes.fill || '';\n          const stroke = node.attributes.stroke || '';\n          const key = d + ';s:' + stroke + ';f:' + fill;\n          let list = paths.get(key);\n          if (list == null) {\n            list = [];\n            paths.set(key, list);\n          }\n          list.push(node);\n        }\n\n        if (\n          svgDefs == null &&\n          node.name === 'defs' &&\n          parentNode.type === 'element' &&\n          parentNode.name === 'svg'\n        ) {\n          svgDefs = node;\n        }\n\n        if (node.name === 'use') {\n          for (const name of ['href', 'xlink:href']) {\n            const href = node.attributes[name];\n\n            if (href != null && href.startsWith('#') && href.length > 1) {\n              hrefs.add(href.slice(1));\n            }\n          }\n        }\n      },\n\n      exit: (node, parentNode) => {\n        if (node.name === 'svg' && parentNode.type === 'root') {\n          let defsTag = svgDefs;\n\n          if (defsTag == null) {\n            defsTag = {\n              type: 'element',\n              name: 'defs',\n              attributes: {},\n              children: [],\n            };\n          }\n\n          let index = 0;\n          for (const list of paths.values()) {\n            if (list.length > 1) {\n              /** @type {import('../lib/types.js').XastElement} */\n              const reusablePath = {\n                type: 'element',\n                name: 'path',\n                attributes: {},\n                children: [],\n              };\n\n              for (const attr of ['fill', 'stroke', 'd']) {\n                if (list[0].attributes[attr] != null) {\n                  reusablePath.attributes[attr] = list[0].attributes[attr];\n                }\n              }\n\n              const originalId = list[0].attributes.id;\n              if (\n                originalId == null ||\n                hrefs.has(originalId) ||\n                stylesheet.rules.some(\n                  (rule) => rule.selector === `#${originalId}`,\n                )\n              ) {\n                reusablePath.attributes.id = 'reuse-' + index++;\n              } else {\n                reusablePath.attributes.id = originalId;\n                delete list[0].attributes.id;\n              }\n              defsTag.children.push(reusablePath);\n              // convert paths to <use>\n              for (const pathNode of list) {\n                delete pathNode.attributes.d;\n                delete pathNode.attributes.stroke;\n                delete pathNode.attributes.fill;\n\n                if (\n                  defsTag.children.includes(pathNode) &&\n                  pathNode.children.length === 0\n                ) {\n                  if (Object.keys(pathNode.attributes).length === 0) {\n                    detachNodeFromParent(pathNode, defsTag);\n                    continue;\n                  }\n\n                  if (\n                    Object.keys(pathNode.attributes).length === 1 &&\n                    pathNode.attributes.id != null\n                  ) {\n                    detachNodeFromParent(pathNode, defsTag);\n                    const selector = `[xlink\\\\:href=#${pathNode.attributes.id}], [href=#${pathNode.attributes.id}]`;\n                    for (const child of querySelectorAll(node, selector)) {\n                      if (child.type !== 'element') {\n                        continue;\n                      }\n                      for (const name of ['href', 'xlink:href']) {\n                        if (child.attributes[name] != null) {\n                          child.attributes[name] =\n                            '#' + reusablePath.attributes.id;\n                        }\n                      }\n                    }\n                    continue;\n                  }\n                }\n\n                pathNode.name = 'use';\n                pathNode.attributes['xlink:href'] =\n                  '#' + reusablePath.attributes.id;\n              }\n            }\n          }\n          if (defsTag.children.length !== 0) {\n            if (node.attributes['xmlns:xlink'] == null) {\n              node.attributes['xmlns:xlink'] = 'http://www.w3.org/1999/xlink';\n            }\n\n            if (svgDefs == null) {\n              node.children.unshift(defsTag);\n            }\n          }\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/sortAttrs.js",
    "content": "/**\n * @typedef SortAttrsParams\n * @property {ReadonlyArray<string>=} order\n * @property {'front' | 'alphabetical'=} xmlnsOrder\n */\n\nexport const name = 'sortAttrs';\nexport const description = 'Sort element attributes for better compression';\n\n/**\n * Sort element attributes for better compression\n *\n * @author Nikolay Frantsev\n *\n * @type {import('../lib/types.js').Plugin<SortAttrsParams>}\n */\nexport const fn = (_root, params) => {\n  const {\n    order = [\n      'id',\n      'width',\n      'height',\n      'x',\n      'x1',\n      'x2',\n      'y',\n      'y1',\n      'y2',\n      'cx',\n      'cy',\n      'r',\n      'fill',\n      'stroke',\n      'marker',\n      'd',\n      'points',\n    ],\n    xmlnsOrder = 'front',\n  } = params;\n\n  /**\n   * @param {string} name\n   * @returns {number}\n   */\n  const getNsPriority = (name) => {\n    if (xmlnsOrder === 'front') {\n      // put xmlns first\n      if (name === 'xmlns') {\n        return 3;\n      }\n      // xmlns:* attributes second\n      if (name.startsWith('xmlns:')) {\n        return 2;\n      }\n    }\n    // other namespaces after and sort them alphabetically\n    if (name.includes(':')) {\n      return 1;\n    }\n    // other attributes\n    return 0;\n  };\n\n  /**\n   * @param {[string, string]} param0\n   * @param {[string, string]} param1\n   * @returns {number}\n   */\n  const compareAttrs = ([aName], [bName]) => {\n    // sort namespaces\n    const aPriority = getNsPriority(aName);\n    const bPriority = getNsPriority(bName);\n    const priorityNs = bPriority - aPriority;\n    if (priorityNs !== 0) {\n      return priorityNs;\n    }\n    // extract the first part from attributes\n    // for example \"fill\" from \"fill\" and \"fill-opacity\"\n    const [aPart] = aName.split('-');\n    const [bPart] = bName.split('-');\n    // rely on alphabetical sort when the first part is the same\n    if (aPart !== bPart) {\n      const aInOrderFlag = order.includes(aPart) ? 1 : 0;\n      const bInOrderFlag = order.includes(bPart) ? 1 : 0;\n      // sort by position in order param\n      if (aInOrderFlag === 1 && bInOrderFlag === 1) {\n        return order.indexOf(aPart) - order.indexOf(bPart);\n      }\n      // put attributes from order param before others\n      const priorityOrder = bInOrderFlag - aInOrderFlag;\n      if (priorityOrder !== 0) {\n        return priorityOrder;\n      }\n    }\n    // sort alphabetically\n    return aName < bName ? -1 : 1;\n  };\n\n  return {\n    element: {\n      enter: (node) => {\n        const attrs = Object.entries(node.attributes);\n        attrs.sort(compareAttrs);\n        /** @type {Record<string, string>} */\n        const sortedAttributes = {};\n        for (const [name, value] of attrs) {\n          sortedAttributes[name] = value;\n        }\n        node.attributes = sortedAttributes;\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/sortDefsChildren.js",
    "content": "export const name = 'sortDefsChildren';\nexport const description = 'Sorts children of <defs> to improve compression';\n\n/**\n * Sorts children of defs in order to improve compression. Sorted first by\n * frequency then by element name length then by element name (to ensure\n * grouping).\n *\n * @author David Leston\n *\n * @type {import('../lib/types.js').Plugin}\n */\nexport const fn = () => {\n  return {\n    element: {\n      enter: (node) => {\n        if (node.name === 'defs') {\n          /** @type {Map<string, number>} */\n          const frequencies = new Map();\n          for (const child of node.children) {\n            if (child.type === 'element') {\n              const frequency = frequencies.get(child.name);\n              if (frequency == null) {\n                frequencies.set(child.name, 1);\n              } else {\n                frequencies.set(child.name, frequency + 1);\n              }\n            }\n          }\n          node.children.sort((a, b) => {\n            if (a.type !== 'element' || b.type !== 'element') {\n              return 0;\n            }\n            const aFrequency = frequencies.get(a.name);\n            const bFrequency = frequencies.get(b.name);\n            if (aFrequency != null && bFrequency != null) {\n              const frequencyComparison = bFrequency - aFrequency;\n              if (frequencyComparison !== 0) {\n                return frequencyComparison;\n              }\n            }\n            const lengthComparison = b.name.length - a.name.length;\n            if (lengthComparison !== 0) {\n              return lengthComparison;\n            }\n            if (a.name !== b.name) {\n              return a.name > b.name ? -1 : 1;\n            }\n            return 0;\n          });\n        }\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "rollup.config.js",
    "content": "import path from 'path';\nimport { fileURLToPath } from 'url';\nimport * as fs from 'node:fs';\nimport { nodeResolve } from '@rollup/plugin-node-resolve';\nimport commonjs from '@rollup/plugin-commonjs';\nimport terser from '@rollup/plugin-terser';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\nconst pkgPath = path.join(__dirname, './package.json');\nconst PKG = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));\n\n/** @type {import('@rollup/plugin-terser').Options} */\nconst terserOptions = {\n  compress: {\n    defaults: false,\n    arrows: true,\n    computed_props: true,\n    conditionals: true,\n    dead_code: true,\n    drop_debugger: true,\n    evaluate: true,\n  },\n  mangle: false,\n  format: {\n    comments: false,\n    keep_numbers: true,\n    semicolons: false,\n    shebang: false,\n  },\n};\n\n/**\n * @type {import('rollup').RollupOptions[]}\n */\nexport default [\n  {\n    input: './lib/svgo-node.js',\n    output: {\n      file: './dist/svgo-node.cjs',\n      format: 'cjs',\n      exports: 'named',\n    },\n    external: [\n      'os',\n      'fs/promises',\n      'url',\n      'path',\n      ...Object.keys(PKG.dependencies),\n    ],\n    onwarn(warning) {\n      throw Error(warning.toString());\n    },\n    plugins: [terser(terserOptions)],\n  },\n  {\n    input: './lib/svgo.js',\n    output: {\n      file: './dist/svgo.browser.js',\n      format: 'esm',\n    },\n    onwarn(warning) {\n      throw Error(warning.toString());\n    },\n    plugins: [\n      nodeResolve({ browser: true, preferBuiltins: false }),\n      commonjs(),\n      terser(terserOptions),\n    ],\n  },\n];\n"
  },
  {
    "path": "scripts/sync-version.js",
    "content": "import fs from 'node:fs/promises';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\nconst pkgPath = path.join(__dirname, '../package.json');\nconst { version } = JSON.parse(await fs.readFile(pkgPath, 'utf-8'));\n\nawait fs.writeFile(\n  './lib/version.js',\n  `/**\\n * Version of SVGO.\\n *\\n * @type {string}\\n * @since 4.0.0\\n */\\nexport const VERSION = '${version}';\\n`,\n);\n"
  },
  {
    "path": "test/browser.js",
    "content": "import assert from 'assert';\nimport fs from 'node:fs/promises';\nimport http from 'http';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { chromium } from 'playwright';\n\nconst PORT = 5001;\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\nconst pkgPath = path.join(__dirname, '../package.json');\nconst { version } = JSON.parse(await fs.readFile(pkgPath, 'utf-8'));\n\nconst fixture = `<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g attr1=\"val1\">\n        <g attr2=\"val2\">\n            <path attr2=\"val3\" d=\"...\"/>\n        </g>\n        <path d=\"...\"/>\n    </g>\n</svg>`;\n\nconst expected = `<svg xmlns=\"http://www.w3.org/2000/svg\">\n  <g attr1=\"val1\">\n    <g attr2=\"val2\">\n      <path attr2=\"val3\" d=\"...\"/>\n    </g>\n    <path d=\"...\"/>\n  </g>\n</svg>\n`;\n\nconst content = `\n<script type=\"module\">\nimport { VERSION, optimize, builtinPlugins, _collections } from '/svgo.browser.js';\nconst result = optimize(${JSON.stringify(fixture)}, {\n  plugins : [],\n  js2svg  : { pretty: true, indent: 2 }\n});\nglobalThis.version = VERSION;\nglobalThis.builtinPlugins = builtinPlugins;\nglobalThis._collections = _collections;\nglobalThis.result = result.data;\n</script>\n`;\n\nconst server = http.createServer(async (req, res) => {\n  if (req.url === '/') {\n    res.setHeader('Content-Type', 'text/html');\n    res.end(content);\n  }\n  if (req.url === '/svgo.browser.js') {\n    res.setHeader('Content-Type', 'application/javascript');\n    res.end(await fs.readFile('./dist/svgo.browser.js'));\n  }\n  res.end();\n});\n\nconst runTest = async () => {\n  const browser = await chromium.launch();\n  const context = await browser.newContext();\n  const page = await context.newPage();\n  await page.goto(`http://localhost:${PORT}`);\n\n  const actual = await page.evaluate(() => ({\n    version: globalThis.version,\n    builtinPlugins: globalThis.builtinPlugins,\n    _collections: globalThis._collections,\n    result: globalThis.result,\n  }));\n\n  assert.strictEqual(actual.version, version);\n  assert.notEqual(\n    actual.builtinPlugins,\n    undefined,\n    'builtinPlugins must be defined',\n  );\n  assert.notEqual(\n    actual._collections,\n    undefined,\n    '_collections must be defined',\n  );\n  assert.equal(actual.result, expected);\n\n  await browser.close();\n};\n\nserver.listen(PORT, async () => {\n  try {\n    await runTest();\n    console.info('Tested successfully');\n    server.close();\n  } catch (error) {\n    server.close();\n    console.error(error.toString());\n    process.exit(1);\n  }\n});\n"
  },
  {
    "path": "test/cli/cli.test.js",
    "content": "import fs from 'fs/promises';\nimport path from 'path';\nimport { spawn } from 'child_process';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\n/**\n * @param {import('child_process').ChildProcessWithoutNullStreams} proc\n * @returns {Promise<string>}\n */\nconst waitStdout = (proc) => {\n  return new Promise((resolve) => {\n    proc.stdout.on('data', (data) => {\n      resolve(data.toString());\n    });\n  });\n};\n\n/**\n * @param {import('child_process').ChildProcessWithoutNullStreams} proc\n * @returns {Promise<void>}\n */\nconst waitClose = (proc) => {\n  return new Promise((resolve) => {\n    proc.on('close', () => {\n      resolve();\n    });\n  });\n};\n\ntest('shows plugins when flag specified', async () => {\n  const proc = spawn(\n    'node',\n    ['../../bin/svgo', '--no-color', '--show-plugins'],\n    { cwd: __dirname },\n  );\n  const stdout = await waitStdout(proc);\n  expect(stdout).toMatch(/Currently available plugins:/);\n});\n\ntest('accepts svg as input stream', async () => {\n  const proc = spawn('node', ['../../bin/svgo', '--no-color', '-'], {\n    cwd: __dirname,\n  });\n  proc.stdin.write('<svg><desc>Created with Love</desc></svg>');\n  proc.stdin.end();\n  const stdout = await waitStdout(proc);\n  expect(stdout).toBe('<svg/>');\n});\n\ntest('accepts svg as string', async () => {\n  const input = '<svg><desc>Created with Love</desc></svg>';\n  const proc = spawn(\n    'node',\n    ['../../bin/svgo', '--no-color', '--string', input],\n    { cwd: __dirname },\n  );\n  const stdout = await waitStdout(proc);\n  expect(stdout).toBe('<svg/>');\n});\n\ntest('accepts svg as filename', async () => {\n  const proc = spawn(\n    'node',\n    ['../../bin/svgo', '--no-color', 'single.svg', '-o', 'output/single.svg'],\n    { cwd: __dirname },\n  );\n  await waitClose(proc);\n  const output = await fs.readFile(\n    path.join(__dirname, 'output/single.svg'),\n    'utf-8',\n  );\n  expect(output).toBe('<svg/>');\n});\n\ntest('output as stream when \"-\" is specified', async () => {\n  const proc = spawn(\n    'node',\n    ['../../bin/svgo', '--no-color', 'single.svg', '-o', '-'],\n    { cwd: __dirname },\n  );\n  const stdout = await waitStdout(proc);\n  expect(stdout).toBe('<svg/>');\n});\n\ntest('should exit with 1 code on syntax error', async () => {\n  const proc = spawn('node', ['../../bin/svgo', '--no-color', 'invalid.svg'], {\n    cwd: __dirname,\n  });\n  const [code, stderr] = await Promise.all([\n    new Promise((resolve) => {\n      proc.on('close', (code) => {\n        resolve(code);\n      });\n    }),\n    new Promise((resolve) => {\n      proc.stderr.on('data', (error) => {\n        resolve(error.toString());\n      });\n    }),\n  ]);\n  expect(code).toBe(1);\n  expect(stderr)\n    .toBe(`SvgoParserError: invalid.svg:2:27: Unquoted attribute value\n\n  1 | <svg>\n> 2 |   <rect x=\"0\" y=\"0\" width=10\" height=\"20\" />\n    |                           ^\n  3 | </svg>\n  4 | \n\n`);\n});\n"
  },
  {
    "path": "test/coa/_index.test.js",
    "content": "import fs from 'fs';\nimport path from 'path';\nimport { Command } from 'commander';\nimport { fileURLToPath } from 'url';\nimport svgo, { checkIsDir } from '../../lib/svgo/coa.js';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nconst svgFolderPath = path.resolve(__dirname, 'testSvg');\nconst svgFolderPathRecursively = path.resolve(__dirname, 'testSvgRecursively');\nconst svgFiles = [\n  path.resolve(__dirname, 'testSvg/test.svg'),\n  path.resolve(__dirname, 'testSvg/test.1.svg'),\n];\nconst tempFolder = 'temp';\n\n/**\n * @param {ReadonlyArray<string>} args\n * @returns {Promise<Command>}\n */\nfunction runProgram(args) {\n  const program = new Command();\n  svgo(program);\n  // prevent running process.exit\n  program.exitOverride(() => {});\n  // parser skips first two arguments\n  return program.parseAsync(['', '', ...args]);\n}\n\ndescribe('coa', function () {\n  beforeEach(async () => {\n    await fs.promises.rm(tempFolder, { force: true, recursive: true });\n    await fs.promises.mkdir(tempFolder);\n  });\n\n  afterAll(async () => {\n    await fs.promises.rm(tempFolder, { force: true, recursive: true });\n  });\n  /**\n   * @param {string} folderPath\n   * @returns {number}\n   */\n  function calcFolderSvgWeight(folderPath) {\n    return fs\n      .readdirSync(folderPath)\n      .reduce(\n        (initWeight, name) =>\n          initWeight +\n          (/.svg/.test(name)\n            ? fs.statSync(path.join(folderPath, name)).size\n            : 0) +\n          (checkIsDir(path.join(folderPath, name))\n            ? calcFolderSvgWeight(path.join(folderPath, name))\n            : 0),\n        0,\n      );\n  }\n\n  it('should generate correct datauri', async () => {\n    const outfilePath = tempFolder + '/test.svg';\n    await runProgram([\n      '-i',\n      path.resolve(__dirname, 'testSvgDatauri') + '/test.svg',\n      '-o',\n      outfilePath,\n      '--datauri',\n      'enc',\n      '--quiet',\n    ]);\n    const outData = fs.readFileSync(outfilePath, 'utf8');\n    expect(outData).toBe(\n      'data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ctext%20x%3D%225%22%20y%3D%2215%22%3ETEST%3C%2Ftext%3E%3C%2Fsvg%3E',\n    );\n  });\n\n  it('should optimize folder', async () => {\n    const initWeight = calcFolderSvgWeight(svgFolderPath);\n    await runProgram([\n      '--folder',\n      svgFolderPath,\n      '--output',\n      tempFolder,\n      '--quiet',\n    ]);\n    const optimizedWeight = calcFolderSvgWeight(svgFolderPath);\n    expect(optimizedWeight).toBeGreaterThan(0);\n    expect(initWeight).toBeLessThanOrEqual(optimizedWeight);\n  });\n\n  it('should optimize folder recursively', async () => {\n    const initWeight = calcFolderSvgWeight(svgFolderPathRecursively);\n    await runProgram([\n      '--folder',\n      svgFolderPathRecursively,\n      '--output',\n      tempFolder,\n      '--quiet',\n      '--recursive',\n    ]);\n    const optimizedWeight = calcFolderSvgWeight(svgFolderPathRecursively);\n    expect(optimizedWeight).toBeGreaterThan(0);\n    expect(initWeight).toBeLessThanOrEqual(optimizedWeight);\n  });\n\n  it('should optimize several files', async () => {\n    const initWeight = calcFolderSvgWeight(svgFolderPath);\n    await runProgram([\n      '--input',\n      ...svgFiles,\n      '--output',\n      tempFolder,\n      '--quiet',\n    ]);\n    const optimizedWeight = calcFolderSvgWeight(tempFolder);\n    expect(optimizedWeight).toBeGreaterThan(0);\n    expect(optimizedWeight).toBeLessThanOrEqual(initWeight);\n    await fs.promises.rm('temp.svg', { force: true });\n  });\n\n  it('should optimize folder, when it stated in input', async () => {\n    const initWeight = calcFolderSvgWeight(svgFolderPath);\n    await runProgram([\n      '--input',\n      svgFolderPath,\n      '--output',\n      tempFolder,\n      '--quiet',\n    ]);\n    const optimizedWeight = calcFolderSvgWeight(svgFolderPath);\n    expect(optimizedWeight).toBeLessThanOrEqual(initWeight);\n  });\n\n  it('should throw error when stated in input folder does not exist', async () => {\n    await expect(\n      runProgram(['--input', svgFolderPath + 'temp', '--output', tempFolder]),\n    ).rejects.toThrow(/no such file or directory/);\n  });\n\n  describe('stdout', () => {\n    it('should show message when the folder is empty', async () => {\n      const emptyFolderPath = path.resolve(__dirname, 'testSvgEmpty');\n      if (!fs.existsSync(emptyFolderPath)) {\n        await fs.promises.mkdir(emptyFolderPath);\n      }\n      await expect(\n        runProgram(['--folder', emptyFolderPath, '--quiet']),\n      ).rejects.toThrow(/No SVG files/);\n    });\n\n    it('should show message when folder does not consists any svg files', async () => {\n      await expect(\n        runProgram([\n          '--folder',\n          path.resolve(__dirname, 'testFolderWithNoSvg'),\n          '--quiet',\n        ]),\n      ).rejects.toThrow(/No SVG files have been found/);\n    });\n  });\n});\n"
  },
  {
    "path": "test/coa/testFolderWithNoSvg/test",
    "content": ""
  },
  {
    "path": "test/fixtures/config-loader/cjs/svgo.config.cjs",
    "content": "module.exports = {\n  plugins: ['cjs'],\n};\n"
  },
  {
    "path": "test/fixtures/config-loader/invalid-array.js",
    "content": "export default [];\n"
  },
  {
    "path": "test/fixtures/config-loader/invalid-null.js",
    "content": "export default null;\n"
  },
  {
    "path": "test/fixtures/config-loader/invalid-runtime.js",
    "content": "/* eslint-disable no-undef */\n// @ts-expect-error Testing malformed configuration.\nexport default { plugins };\n"
  },
  {
    "path": "test/fixtures/config-loader/invalid-runtime.mjs",
    "content": "/* eslint-disable no-undef */\n// @ts-expect-error Testing malformed configuration.\nexport default { plugins };\n"
  },
  {
    "path": "test/fixtures/config-loader/invalid-string.js",
    "content": "export default '';\n"
  },
  {
    "path": "test/fixtures/config-loader/mjs/svgo.config.mjs",
    "content": "export default {\n  plugins: ['mjs'],\n};\n"
  },
  {
    "path": "test/fixtures/config-loader/module-not-found.js",
    "content": "import 'unknown-module';\nexport default {};\n"
  },
  {
    "path": "test/fixtures/config-loader/one/two/config.js",
    "content": "export default { plugins: [] };\n"
  },
  {
    "path": "test/fixtures/config-loader/svgo.config.js",
    "content": "export default { plugins: [] };\n"
  },
  {
    "path": "test/plugins/_collections.test.js",
    "content": "import { elems } from '../../plugins/_collections.js';\n\ndescribe('elems.deprecated', () => {\n  Object.entries(elems).forEach(([tagName, elemConfig]) => {\n    const deprecated = elemConfig.deprecated;\n    if (!deprecated) {\n      return;\n    }\n\n    test(`${tagName} deprecated attributes are all known attributes`, () => {\n      if (deprecated.safe) {\n        deprecated.safe.forEach((attr) => {\n          expect(elemConfig.attrs).toContain(attr);\n        });\n      }\n\n      if (deprecated.unsafe) {\n        deprecated.unsafe.forEach((attr) => {\n          expect(elemConfig.attrs).toContain(attr);\n        });\n      }\n    });\n  });\n});\n"
  },
  {
    "path": "test/plugins/_index.test.js",
    "content": "import fs from 'fs/promises';\nimport path from 'path';\nimport { EOL } from 'os';\nimport { fileURLToPath } from 'url';\nimport { optimize } from '../../lib/svgo.js';\n\nconst regFilename = /^(.*)\\.(\\d+)\\.svg\\.txt$/;\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\nconst files = await fs.readdir(__dirname);\n\ndescribe('plugins tests', function () {\n  for (let file of files) {\n    const match = file.match(regFilename);\n    let index;\n    /** @type {any} */\n    let name;\n\n    if (match) {\n      name = match[1];\n      index = match[2];\n\n      file = path.resolve(__dirname, file);\n\n      it(name + '.' + index, () => {\n        return readFile(file).then(function (data) {\n          // remove description\n          const items = normalize(data).split(/\\s*===\\s*/);\n          const test = items.length === 2 ? items[1] : items[0];\n          // extract test case\n          const [original, should, params] = test.split(/\\s*@@@\\s*/);\n          /** @type {Exclude<import('../../lib/types.js').PluginConfig, import('../../lib/types.js').CustomPlugin>} */\n          const plugin = {\n            name,\n            params: params ? JSON.parse(params) : {},\n          };\n          let lastResultData = original;\n          // test plugins idempotence\n          const exclude = ['addAttributesToSVGElement', 'convertTransform'];\n          const multipass = exclude.includes(name) ? 1 : 2;\n          for (let i = 0; i < multipass; i += 1) {\n            const result = optimize(lastResultData, {\n              path: file,\n              plugins: [plugin],\n              js2svg: { pretty: true },\n            });\n            lastResultData = result.data;\n            //FIXME: results.data has a '\\n' at the end while it should not\n            expect(normalize(result.data)).toStrictEqual(should);\n          }\n        });\n      });\n    }\n  }\n});\n\n/**\n * @param {string} file\n * @returns {string}\n */\nfunction normalize(file) {\n  return file.trim().replaceAll(EOL, '\\n');\n}\n\n/**\n * @param {string} file\n * @returns {Promise<string>}\n */\nfunction readFile(file) {\n  return fs.readFile(file, 'utf-8');\n}\n"
  },
  {
    "path": "test/plugins/_transforms.test.js",
    "content": "import { matrixToTransform } from '../../plugins/_transforms.js';\n\n/** @type {import('../../plugins/_transforms.js').TransformParams} */\nconst params = {\n  floatPrecision: 3,\n  transformPrecision: 5,\n  matrixToTransform: true,\n  shortTranslate: true,\n  shortScale: true,\n  shortRotate: true,\n  removeUseless: true,\n  collapseIntoOne: true,\n  leadingZero: true,\n  negativeExtraSpace: false,\n  convertToShorts: true,\n};\n\n/**\n * Some tests live here instead of in test SVGs because the output\n * is longer, so SVGO doesn't actually use it.\n */\ndescribe('should correctly simplify transforms', () => {\n  it('matrix(0, -1, 99, 0, 0, 0)', () => {\n    const matrix = {\n      name: 'matrix',\n      data: [0, -1, 99, 0, 0, 0],\n    };\n\n    expect(matrixToTransform(matrix, params)).toStrictEqual([\n      {\n        name: 'rotate',\n        data: [-90],\n      },\n      {\n        name: 'scale',\n        data: [1, 99],\n      },\n    ]);\n  });\n\n  it('matrix(0, 1, 1, 0, 0, 0)', () => {\n    const matrix = {\n      name: 'matrix',\n      data: [0, 1, 1, 0, 0, 0],\n    };\n\n    expect(matrixToTransform(matrix, params)).toStrictEqual([\n      {\n        name: 'rotate',\n        data: [90],\n      },\n      {\n        name: 'scale',\n        data: [1, -1],\n      },\n    ]);\n  });\n});\n"
  },
  {
    "path": "test/plugins/addAttributesToSVGElement.01.svg.txt",
    "content": "Add multiple attributes without value\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" data-icon className={classes}>\n    test\n</svg>\n\n@@@\n\n{\"attributes\":[\"data-icon\",\"className={classes}\"]}\n"
  },
  {
    "path": "test/plugins/addAttributesToSVGElement.02.svg.txt",
    "content": "Add single attribute without value\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" data-icon>\n    test\n</svg>\n\n@@@\n\n{\"attribute\":\"data-icon\"}\n"
  },
  {
    "path": "test/plugins/addAttributesToSVGElement.03.svg.txt",
    "content": "Add multiple attributes with values\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" focusable=\"false\" data-image=\"icon\">\n    test\n</svg>\n\n@@@\n\n{\"attributes\":[{\"focusable\":\"false\"},{\"data-image\":\"icon\"}]}\n"
  },
  {
    "path": "test/plugins/addAttributesToSVGElement.04.svg.txt",
    "content": "Ignore nested <svg> elements\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n    <svg />\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" data-icon>\n    test\n    <svg/>\n</svg>\n\n@@@\n\n{\"attributes\":[\"data-icon\"]}\n"
  },
  {
    "path": "test/plugins/addClassesToSVGElement.01.svg.txt",
    "content": "Should add classes when passed as a classNames Array\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"mySvg size-big\">\n    test\n</svg>\n\n@@@\n\n{\"classNames\":[\"mySvg\",\"size-big\"]}\n"
  },
  {
    "path": "test/plugins/addClassesToSVGElement.02.svg.txt",
    "content": "Should add class when passed as a className String\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"mySvg\">\n    test\n</svg>\n\n@@@\n\n{\"className\":\"mySvg\"}\n"
  },
  {
    "path": "test/plugins/addClassesToSVGElement.03.svg.txt",
    "content": "Should avoid adding existing classes\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"mySvg\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"mySvg size-big\">\n    test\n</svg>\n\n@@@\n\n{\"classNames\":[\"mySvg\",\"size-big\"]}\n"
  },
  {
    "path": "test/plugins/addClassesToSVGElement.test.js",
    "content": "import { optimize } from '../../lib/svgo.js';\n\ntest('should accept function as className parameter', () => {\n  const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\"/>`;\n\n  expect(\n    optimize(svg, {\n      path: 'uwu.svg',\n      plugins: [\n        {\n          name: 'addClassesToSVGElement',\n          params: {\n            classNames: [\n              'icon',\n              (_, info) => `icon__${info?.path?.split('.')[0]}`,\n            ],\n          },\n        },\n      ],\n    }).data,\n  ).toBe(`<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon__uwu\"/>`);\n\n  expect(\n    optimize(svg, {\n      path: 'uwu.svg',\n      plugins: [\n        {\n          name: 'addClassesToSVGElement',\n          params: {\n            className: (_, info) => `icon__${info?.path?.split('.')[0]}`,\n          },\n        },\n      ],\n    }).data,\n  ).toBe(`<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon__uwu\"/>`);\n});\n"
  },
  {
    "path": "test/plugins/cleanupAttrs.01.svg.txt",
    "content": "<svg xmlns=\"  http://www.w3.org/2000/svg\n  \" attr=\"a      b\" attr2=\"a\nb\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" attr=\"a b\" attr2=\"a b\">\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupAttrs.02.svg.txt",
    "content": "<svg xmlns=\"  http://www.w3.org/2000/svg\n  \" attr=\"a      b\">\n    test &amp; &lt;&amp; &gt; &apos; &quot; &amp;\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" attr=\"a b\">\n    test &amp; &lt;&amp; &gt; &apos; &quot; &amp;\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupEnableBackground.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100.5\" height=\".5\" enable-background=\"new 0 0 100.5 .5\">\n    <defs>\n        <filter id=\"ShiftBGAndBlur\">\n            <feOffset dx=\"0\" dy=\"75\"/>\n        </filter>\n    </defs>\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100.5\" height=\".5\">\n    <defs>\n        <filter id=\"ShiftBGAndBlur\">\n            <feOffset dx=\"0\" dy=\"75\"/>\n        </filter>\n    </defs>\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupEnableBackground.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"50\" enable-background=\"new 0 0 100 50\">\n    <defs>\n        <filter id=\"ShiftBGAndBlur\">\n            <feOffset dx=\"0\" dy=\"75\"/>\n        </filter>\n    </defs>\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"50\" enable-background=\"new 0 0 100 50\">\n    <defs>\n        <filter id=\"ShiftBGAndBlur\">\n            <feOffset dx=\"0\" dy=\"75\"/>\n        </filter>\n    </defs>\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupEnableBackground.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <filter id=\"ShiftBGAndBlur\">\n            <feOffset dx=\"0\" dy=\"75\"/>\n        </filter>\n    </defs>\n    <mask width=\"100\" height=\"50\" enable-background=\"new 0 0 100 50\">\n        test\n    </mask>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <filter id=\"ShiftBGAndBlur\">\n            <feOffset dx=\"0\" dy=\"75\"/>\n        </filter>\n    </defs>\n    <mask width=\"100\" height=\"50\" enable-background=\"new\">\n        test\n    </mask>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupEnableBackground.04.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <mask width=\"100\" height=\"50\" enable-background=\"new 0 0 100 50\">\n        test\n    </mask>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <mask width=\"100\" height=\"50\">\n        test\n    </mask>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupEnableBackground.05.svg.txt",
    "content": "Should apply to inline styles as well, removing the style attribute if it all\ndeclarations are removed.\n\nSee: https://github.com/svg/svgo/issues/1740\n\n===\n\n<svg height=\"100\" width=\"100\" style=\"enable-background:new 0 0 100 100\">\n  <circle cx=\"50\" cy=\"50\" r=\"40\" stroke=\"#000\" stroke-width=\"3\" fill=\"red\"/>\n</svg>\n\n@@@\n\n<svg height=\"100\" width=\"100\">\n    <circle cx=\"50\" cy=\"50\" r=\"40\" stroke=\"#000\" stroke-width=\"3\" fill=\"red\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupIds.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <defs>\n        <linearGradient id=\"gradient001\">\n            <stop offset=\"5%\" stop-color=\"#F60\"/>\n            <stop offset=\"95%\" stop-color=\"#FF6\"/>\n        </linearGradient>\n        <text id=\"referencedText\">\n            referenced text\n        </text>\n        <path id=\"crochet\" d=\"...\"/>\n        <path id=\"block\" d=\"...\"/>\n        <path id=\"two\" d=\"...\"/>\n        <path id=\"two\" d=\"...\"/>\n    </defs>\n    <g id=\"g001\">\n        <circle id=\"circle001\" fill=\"url(#gradient001)\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <rect fill=\"url('#gradient001')\" x=\"0\" y=\"0\" width=\"500\" height=\"100\"/>\n        <tref xlink:href=\"#referencedText\"/>\n    </g>\n    <g>\n        <tref xlink:href=\"#referencedText\"/>\n    </g>\n    <animateMotion xlink:href=\"#crochet\" dur=\"0.5s\" begin=\"block.mouseover\" fill=\"freeze\" path=\"m 0,0 0,-21\"/>\n    <use xlink:href=\"#two\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <defs>\n        <linearGradient id=\"a\">\n            <stop offset=\"5%\" stop-color=\"#F60\"/>\n            <stop offset=\"95%\" stop-color=\"#FF6\"/>\n        </linearGradient>\n        <text id=\"b\">\n            referenced text\n        </text>\n        <path id=\"c\" d=\"...\"/>\n        <path id=\"d\" d=\"...\"/>\n        <path id=\"e\" d=\"...\"/>\n        <path d=\"...\"/>\n    </defs>\n    <g>\n        <circle fill=\"url(#a)\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <rect fill=\"url('#a')\" x=\"0\" y=\"0\" width=\"500\" height=\"100\"/>\n        <tref xlink:href=\"#b\"/>\n    </g>\n    <g>\n        <tref xlink:href=\"#b\"/>\n    </g>\n    <animateMotion xlink:href=\"#c\" dur=\"0.5s\" begin=\"d.mouseover\" fill=\"freeze\" path=\"m 0,0 0,-21\"/>\n    <use xlink:href=\"#e\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupIds.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <style>\n        .cls-1 { fill: #fff; }\n    </style>\n    <circle id=\"circle001\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <style>\n        .cls-1 { fill: #fff; }\n    </style>\n    <circle id=\"circle001\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupIds.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <script>\n        …\n    </script>\n    <circle id=\"circle001\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <script>\n        …\n    </script>\n    <circle id=\"circle001\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupIds.04.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <defs>\n        <text id=\"__proto__\">\n            referenced text\n        </text>\n        <text id=\"test02\">\n            referenced text\n        </text>\n        <text id=\"test03\">\n            referenced text\n        </text>\n        <text id=\"test04\">\n            referenced text\n        </text>\n        <text id=\"test05\">\n            referenced text\n        </text>\n        <text id=\"test06\">\n            referenced text\n        </text>\n        <text id=\"test07\">\n            referenced text\n        </text>\n        <text id=\"test08\">\n            referenced text\n        </text>\n        <text id=\"test09\">\n            referenced text\n        </text>\n        <text id=\"test10\">\n            referenced text\n        </text>\n        <text id=\"test11\">\n            referenced text\n        </text>\n        <text id=\"test12\">\n            referenced text\n        </text>\n        <text id=\"test13\">\n            referenced text\n        </text>\n        <text id=\"test14\">\n            referenced text\n        </text>\n        <text id=\"test15\">\n            referenced text\n        </text>\n        <text id=\"test16\">\n            referenced text\n        </text>\n        <text id=\"test17\">\n            referenced text\n        </text>\n        <text id=\"test18\">\n            referenced text\n        </text>\n        <text id=\"test19\">\n            referenced text\n        </text>\n        <text id=\"test20\">\n            referenced text\n        </text>\n        <text id=\"test21\">\n            referenced text\n        </text>\n        <text id=\"test22\">\n            referenced text\n        </text>\n        <text id=\"test23\">\n            referenced text\n        </text>\n        <text id=\"test24\">\n            referenced text\n        </text>\n        <text id=\"test25\">\n            referenced text\n        </text>\n        <text id=\"test26\">\n            referenced text\n        </text>\n        <text id=\"test27\">\n            referenced text\n        </text>\n        <text id=\"test28\">\n            referenced text\n        </text>\n        <text id=\"test29\">\n            referenced text\n        </text>\n        <text id=\"test30\">\n            referenced text\n        </text>\n        <text id=\"test31\">\n            referenced text\n        </text>\n        <text id=\"test32\">\n            referenced text\n        </text>\n        <text id=\"test33\">\n            referenced text\n        </text>\n        <text id=\"test34\">\n            referenced text\n        </text>\n        <text id=\"test35\">\n            referenced text\n        </text>\n        <text id=\"test36\">\n            referenced text\n        </text>\n        <text id=\"test37\">\n            referenced text\n        </text>\n        <text id=\"test38\">\n            referenced text\n        </text>\n        <text id=\"test39\">\n            referenced text\n        </text>\n        <text id=\"test40\">\n            referenced text\n        </text>\n        <text id=\"test41\">\n            referenced text\n        </text>\n        <text id=\"test42\">\n            referenced text\n        </text>\n        <text id=\"test43\">\n            referenced text\n        </text>\n        <text id=\"test44\">\n            referenced text\n        </text>\n        <text id=\"test45\">\n            referenced text\n        </text>\n        <text id=\"test46\">\n            referenced text\n        </text>\n        <text id=\"test47\">\n            referenced text\n        </text>\n        <text id=\"test48\">\n            referenced text\n        </text>\n        <text id=\"test49\">\n            referenced text\n        </text>\n        <text id=\"test50\">\n            referenced text\n        </text>\n        <text id=\"test51\">\n            referenced text\n        </text>\n        <text id=\"test52\">\n            referenced text\n        </text>\n        <text id=\"test53\">\n            referenced text\n        </text>\n    </defs>\n    <tref xlink:href=\"#__proto__\"/>\n    <tref xlink:href=\"#__proto__\"/>\n    <tref xlink:href=\"#__proto__\"/>\n    <tref xlink:href=\"#test02\"/>\n    <tref xlink:href=\"#test03\"/>\n    <tref xlink:href=\"#test04\"/>\n    <tref xlink:href=\"#test05\"/>\n    <tref xlink:href=\"#test06\"/>\n    <tref xlink:href=\"#test07\"/>\n    <tref xlink:href=\"#test08\"/>\n    <tref xlink:href=\"#test09\"/>\n    <tref xlink:href=\"#test10\"/>\n    <tref xlink:href=\"#test11\"/>\n    <tref xlink:href=\"#test12\"/>\n    <tref xlink:href=\"#test13\"/>\n    <tref xlink:href=\"#test14\"/>\n    <tref xlink:href=\"#test15\"/>\n    <tref xlink:href=\"#test16\"/>\n    <tref xlink:href=\"#test17\"/>\n    <tref xlink:href=\"#test18\"/>\n    <tref xlink:href=\"#test19\"/>\n    <tref xlink:href=\"#test20\"/>\n    <tref xlink:href=\"#test21\"/>\n    <tref xlink:href=\"#test22\"/>\n    <tref xlink:href=\"#test23\"/>\n    <tref xlink:href=\"#test24\"/>\n    <tref xlink:href=\"#test25\"/>\n    <tref xlink:href=\"#test26\"/>\n    <tref xlink:href=\"#test27\"/>\n    <tref xlink:href=\"#test28\"/>\n    <tref xlink:href=\"#test29\"/>\n    <tref xlink:href=\"#test30\"/>\n    <tref xlink:href=\"#test31\"/>\n    <tref xlink:href=\"#test32\"/>\n    <tref xlink:href=\"#test33\"/>\n    <tref xlink:href=\"#test34\"/>\n    <tref xlink:href=\"#test35\"/>\n    <tref xlink:href=\"#test36\"/>\n    <tref xlink:href=\"#test37\"/>\n    <tref xlink:href=\"#test38\"/>\n    <tref xlink:href=\"#test39\"/>\n    <tref xlink:href=\"#test40\"/>\n    <tref xlink:href=\"#test41\"/>\n    <tref xlink:href=\"#test42\"/>\n    <tref xlink:href=\"#test43\"/>\n    <tref xlink:href=\"#test44\"/>\n    <tref xlink:href=\"#test45\"/>\n    <tref xlink:href=\"#test46\"/>\n    <tref xlink:href=\"#test47\"/>\n    <tref xlink:href=\"#test48\"/>\n    <tref xlink:href=\"#test49\"/>\n    <tref xlink:href=\"#test50\"/>\n    <tref xlink:href=\"#test51\"/>\n    <tref xlink:href=\"#test52\"/>\n    <tref xlink:href=\"#test53\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <defs>\n        <text id=\"a\">\n            referenced text\n        </text>\n        <text id=\"b\">\n            referenced text\n        </text>\n        <text id=\"c\">\n            referenced text\n        </text>\n        <text id=\"d\">\n            referenced text\n        </text>\n        <text id=\"e\">\n            referenced text\n        </text>\n        <text id=\"f\">\n            referenced text\n        </text>\n        <text id=\"g\">\n            referenced text\n        </text>\n        <text id=\"h\">\n            referenced text\n        </text>\n        <text id=\"i\">\n            referenced text\n        </text>\n        <text id=\"j\">\n            referenced text\n        </text>\n        <text id=\"k\">\n            referenced text\n        </text>\n        <text id=\"l\">\n            referenced text\n        </text>\n        <text id=\"m\">\n            referenced text\n        </text>\n        <text id=\"n\">\n            referenced text\n        </text>\n        <text id=\"o\">\n            referenced text\n        </text>\n        <text id=\"p\">\n            referenced text\n        </text>\n        <text id=\"q\">\n            referenced text\n        </text>\n        <text id=\"r\">\n            referenced text\n        </text>\n        <text id=\"s\">\n            referenced text\n        </text>\n        <text id=\"t\">\n            referenced text\n        </text>\n        <text id=\"u\">\n            referenced text\n        </text>\n        <text id=\"v\">\n            referenced text\n        </text>\n        <text id=\"w\">\n            referenced text\n        </text>\n        <text id=\"x\">\n            referenced text\n        </text>\n        <text id=\"y\">\n            referenced text\n        </text>\n        <text id=\"z\">\n            referenced text\n        </text>\n        <text id=\"A\">\n            referenced text\n        </text>\n        <text id=\"B\">\n            referenced text\n        </text>\n        <text id=\"C\">\n            referenced text\n        </text>\n        <text id=\"D\">\n            referenced text\n        </text>\n        <text id=\"E\">\n            referenced text\n        </text>\n        <text id=\"F\">\n            referenced text\n        </text>\n        <text id=\"G\">\n            referenced text\n        </text>\n        <text id=\"H\">\n            referenced text\n        </text>\n        <text id=\"I\">\n            referenced text\n        </text>\n        <text id=\"J\">\n            referenced text\n        </text>\n        <text id=\"K\">\n            referenced text\n        </text>\n        <text id=\"L\">\n            referenced text\n        </text>\n        <text id=\"M\">\n            referenced text\n        </text>\n        <text id=\"N\">\n            referenced text\n        </text>\n        <text id=\"O\">\n            referenced text\n        </text>\n        <text id=\"P\">\n            referenced text\n        </text>\n        <text id=\"Q\">\n            referenced text\n        </text>\n        <text id=\"R\">\n            referenced text\n        </text>\n        <text id=\"S\">\n            referenced text\n        </text>\n        <text id=\"T\">\n            referenced text\n        </text>\n        <text id=\"U\">\n            referenced text\n        </text>\n        <text id=\"V\">\n            referenced text\n        </text>\n        <text id=\"W\">\n            referenced text\n        </text>\n        <text id=\"X\">\n            referenced text\n        </text>\n        <text id=\"Y\">\n            referenced text\n        </text>\n        <text id=\"Z\">\n            referenced text\n        </text>\n        <text id=\"aa\">\n            referenced text\n        </text>\n    </defs>\n    <tref xlink:href=\"#a\"/>\n    <tref xlink:href=\"#a\"/>\n    <tref xlink:href=\"#a\"/>\n    <tref xlink:href=\"#b\"/>\n    <tref xlink:href=\"#c\"/>\n    <tref xlink:href=\"#d\"/>\n    <tref xlink:href=\"#e\"/>\n    <tref xlink:href=\"#f\"/>\n    <tref xlink:href=\"#g\"/>\n    <tref xlink:href=\"#h\"/>\n    <tref xlink:href=\"#i\"/>\n    <tref xlink:href=\"#j\"/>\n    <tref xlink:href=\"#k\"/>\n    <tref xlink:href=\"#l\"/>\n    <tref xlink:href=\"#m\"/>\n    <tref xlink:href=\"#n\"/>\n    <tref xlink:href=\"#o\"/>\n    <tref xlink:href=\"#p\"/>\n    <tref xlink:href=\"#q\"/>\n    <tref xlink:href=\"#r\"/>\n    <tref xlink:href=\"#s\"/>\n    <tref xlink:href=\"#t\"/>\n    <tref xlink:href=\"#u\"/>\n    <tref xlink:href=\"#v\"/>\n    <tref xlink:href=\"#w\"/>\n    <tref xlink:href=\"#x\"/>\n    <tref xlink:href=\"#y\"/>\n    <tref xlink:href=\"#z\"/>\n    <tref xlink:href=\"#A\"/>\n    <tref xlink:href=\"#B\"/>\n    <tref xlink:href=\"#C\"/>\n    <tref xlink:href=\"#D\"/>\n    <tref xlink:href=\"#E\"/>\n    <tref xlink:href=\"#F\"/>\n    <tref xlink:href=\"#G\"/>\n    <tref xlink:href=\"#H\"/>\n    <tref xlink:href=\"#I\"/>\n    <tref xlink:href=\"#J\"/>\n    <tref xlink:href=\"#K\"/>\n    <tref xlink:href=\"#L\"/>\n    <tref xlink:href=\"#M\"/>\n    <tref xlink:href=\"#N\"/>\n    <tref xlink:href=\"#O\"/>\n    <tref xlink:href=\"#P\"/>\n    <tref xlink:href=\"#Q\"/>\n    <tref xlink:href=\"#R\"/>\n    <tref xlink:href=\"#S\"/>\n    <tref xlink:href=\"#T\"/>\n    <tref xlink:href=\"#U\"/>\n    <tref xlink:href=\"#V\"/>\n    <tref xlink:href=\"#W\"/>\n    <tref xlink:href=\"#X\"/>\n    <tref xlink:href=\"#Y\"/>\n    <tref xlink:href=\"#Z\"/>\n    <tref xlink:href=\"#aa\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupIds.05.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:x=\"http://www.w3.org/1999/xlink\">\n    <defs>\n        <g id=\"mid-line\"/>\n        <g id=\"line-plus\">\n            <use x:href=\"#mid-line\"/>\n            <use x:href=\"#plus\"/>\n        </g>\n        <g id=\"plus\"/>\n        <g id=\"line-circle\">\n            <use x:href=\"#mid-line\"/>\n        </g>\n    </defs>\n    <path d=\"M0 0\" id=\"a\"/>\n    <use x:href=\"#a\" x=\"50\" y=\"50\"/>\n    <use x:href=\"#line-plus\"/>\n    <use x:href=\"#line-circle\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:x=\"http://www.w3.org/1999/xlink\">\n    <defs>\n        <g id=\"a\"/>\n        <g id=\"d\">\n            <use x:href=\"#a\"/>\n            <use x:href=\"#b\"/>\n        </g>\n        <g id=\"b\"/>\n        <g id=\"e\">\n            <use x:href=\"#a\"/>\n        </g>\n    </defs>\n    <path d=\"M0 0\" id=\"c\"/>\n    <use x:href=\"#c\" x=\"50\" y=\"50\"/>\n    <use x:href=\"#d\"/>\n    <use x:href=\"#e\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupIds.06.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <style>\n        …\n    </style>\n    <circle id=\"circle001\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <style>\n        …\n    </style>\n    <circle fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n</svg>\n\n@@@\n\n{\"force\": true}\n"
  },
  {
    "path": "test/plugins/cleanupIds.07.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <script>\n        …\n    </script>\n    <circle id=\"circle001\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <script>\n        …\n    </script>\n    <circle fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n</svg>\n\n@@@\n\n{\"force\": true}\n"
  },
  {
    "path": "test/plugins/cleanupIds.08.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 230 120\">\n    <circle id=\"circle001\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <rect id=\"rect001\" fill=\"blue\" x=\"120\" y=\"10\" width=\"100\" height=\"100\"/>\n    <view id=\"circle\" viewBox=\"0 0 120 120\"/>\n    <view id=\"rect\" viewBox=\"110 0 120 120\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 230 120\">\n    <circle fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <rect fill=\"blue\" x=\"120\" y=\"10\" width=\"100\" height=\"100\"/>\n    <view id=\"circle\" viewBox=\"0 0 120 120\"/>\n    <view id=\"rect\" viewBox=\"110 0 120 120\"/>\n</svg>\n\n@@@\n\n{\"preserve\": [\"circle\", \"rect\"]}\n"
  },
  {
    "path": "test/plugins/cleanupIds.09.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 120 120\">\n    <style>\n        svg .hidden { display: none; }\n        svg .hidden:target { display: inline; }\n    </style>\n    <circle id=\"circle\" class=\"hidden\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <rect id=\"rect\" class=\"hidden\" fill=\"blue\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 120 120\">\n    <style>\n        svg .hidden { display: none; }\n        svg .hidden:target { display: inline; }\n    </style>\n    <circle id=\"circle\" class=\"hidden\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <rect id=\"rect\" class=\"hidden\" fill=\"blue\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n{\"force\": true, \"preserve\": [\"circle\", \"rect\"]}\n"
  },
  {
    "path": "test/plugins/cleanupIds.10.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 120 120\">\n    <style>\n        svg .hidden { display: none; }\n        svg .hidden:target { display: inline; }\n    </style>\n    <defs>\n        <circle id=\"circle\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <rect id=\"rect\" fill=\"blue\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    </defs>\n    <g id=\"figure\" class=\"hidden\">\n        <use xlink:href=\"#circle\"/>\n        <use href=\"#rect\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 120 120\">\n    <style>\n        svg .hidden { display: none; }\n        svg .hidden:target { display: inline; }\n    </style>\n    <defs>\n        <circle id=\"a\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <rect id=\"b\" fill=\"blue\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    </defs>\n    <g id=\"figure\" class=\"hidden\">\n        <use xlink:href=\"#a\"/>\n        <use href=\"#b\"/>\n    </g>\n</svg>\n\n@@@\n\n{\"force\": true, \"preserve\": \"figure\"}\n"
  },
  {
    "path": "test/plugins/cleanupIds.11.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <circle cx=\"100\" cy=\"100\" r=\"50\" id=\"circle\"/>\n        <ellipse cx=\"50\" cy=\"50\" rx=\"50\" ry=\"10\" id=\"ellipse\"/>\n        <rect x=\"100\" y=\"50\" width=\"50\" height=\"10\" id=\"rect\"/>\n    </defs>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <circle cx=\"100\" cy=\"100\" r=\"50\" id=\"circle\"/>\n        <ellipse cx=\"50\" cy=\"50\" rx=\"50\" ry=\"10\" id=\"ellipse\"/>\n        <rect x=\"100\" y=\"50\" width=\"50\" height=\"10\" id=\"rect\"/>\n    </defs>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupIds.12.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 230 120\">\n    <circle id=\"garbage1\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <rect id=\"garbage2\" fill=\"blue\" x=\"120\" y=\"10\" width=\"100\" height=\"100\"/>\n    <view id=\"xyzgarbage1\" viewBox=\"0 0 120 120\"/>\n    <view id=\"xyzgarbage2\" viewBox=\"110 0 120 120\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 230 120\">\n    <circle fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <rect fill=\"blue\" x=\"120\" y=\"10\" width=\"100\" height=\"100\"/>\n    <view id=\"xyzgarbage1\" viewBox=\"0 0 120 120\"/>\n    <view id=\"xyzgarbage2\" viewBox=\"110 0 120 120\"/>\n</svg>\n\n@@@\n\n{\"preservePrefixes\": [\"xyz\"]}\n"
  },
  {
    "path": "test/plugins/cleanupIds.13.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 120 120\">\n    <style>\n        svg .hidden { display: none; }\n        svg .hidden:target { display: inline; }\n    </style>\n    <circle id=\"pre1_circle\" class=\"hidden\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <rect id=\"pre2_rect\" class=\"hidden\" fill=\"blue\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 120 120\">\n    <style>\n        svg .hidden { display: none; }\n        svg .hidden:target { display: inline; }\n    </style>\n    <circle id=\"pre1_circle\" class=\"hidden\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <rect id=\"pre2_rect\" class=\"hidden\" fill=\"blue\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n{\"force\": true, \"preservePrefixes\": [\"pre1_\", \"pre2_\"]}\n"
  },
  {
    "path": "test/plugins/cleanupIds.14.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 120 120\">\n    <style>\n        svg .hidden { display: none; }\n        svg .hidden:target { display: inline; }\n    </style>\n    <defs>\n        <circle id=\"circle\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <rect id=\"rect\" fill=\"blue\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    </defs>\n    <g id=\"pre1_figure\" class=\"hidden\">\n        <use xlink:href=\"#circle\"/>\n        <use href=\"#rect\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 120 120\">\n    <style>\n        svg .hidden { display: none; }\n        svg .hidden:target { display: inline; }\n    </style>\n    <defs>\n        <circle id=\"a\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <rect id=\"b\" fill=\"blue\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    </defs>\n    <g id=\"pre1_figure\" class=\"hidden\">\n        <use xlink:href=\"#a\"/>\n        <use href=\"#b\"/>\n    </g>\n</svg>\n\n@@@\n\n{\"force\": true, \"preservePrefixes\": \"pre1_\"}\n"
  },
  {
    "path": "test/plugins/cleanupIds.15.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 230 120\">\n    <circle id=\"circle\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <rect id=\"rect\" fill=\"blue\" x=\"120\" y=\"10\" width=\"100\" height=\"100\"/>\n    <view id=\"circle-suffix\" viewBox=\"0 0 120 120\"/>\n    <view id=\"rect-suffix\" viewBox=\"110 0 120 120\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 230 120\">\n    <circle id=\"circle\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <rect id=\"rect\" fill=\"blue\" x=\"120\" y=\"10\" width=\"100\" height=\"100\"/>\n    <view viewBox=\"0 0 120 120\"/>\n    <view id=\"rect-suffix\" viewBox=\"110 0 120 120\"/>\n</svg>\n\n@@@\n\n{\"preserve\": [\"circle\"], \"preservePrefixes\": [\"suffix\", \"rect\"]}\n"
  },
  {
    "path": "test/plugins/cleanupIds.16.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 230 120\">\n    <defs>\n        <circle id=\"a\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <rect id=\"rect\" fill=\"blue\" x=\"120\" y=\"10\" width=\"100\" height=\"100\"/>\n    </defs>\n    <use xlink:href=\"#a\"/>\n    <use href=\"#rect\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 230 120\">\n    <defs>\n        <circle id=\"a\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <rect id=\"b\" fill=\"blue\" x=\"120\" y=\"10\" width=\"100\" height=\"100\"/>\n    </defs>\n    <use xlink:href=\"#a\"/>\n    <use href=\"#b\"/>\n</svg>\n\n@@@\n\n{\"preserve\": \"a\"}\n"
  },
  {
    "path": "test/plugins/cleanupIds.17.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 230 120\">\n    <defs>\n        <circle id=\"a\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <rect id=\"rect\" fill=\"blue\" x=\"120\" y=\"10\" width=\"100\" height=\"100\"/>\n    </defs>\n    <use xlink:href=\"#a\"/>\n    <use xlink:href=\"#rect\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 230 120\">\n    <defs>\n        <circle id=\"a\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <rect id=\"b\" fill=\"blue\" x=\"120\" y=\"10\" width=\"100\" height=\"100\"/>\n    </defs>\n    <use xlink:href=\"#a\"/>\n    <use xlink:href=\"#b\"/>\n</svg>\n\n@@@\n\n{\"preservePrefixes\": \"a\"}\n"
  },
  {
    "path": "test/plugins/cleanupIds.18.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 230 120\">\n    <defs>\n        <circle id=\"abc\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <rect id=\"rect\" fill=\"blue\" x=\"120\" y=\"10\" width=\"100\" height=\"100\"/>\n    </defs>\n    <use href=\"#abc\"/>\n    <use href=\"#rect\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 230 120\">\n    <defs>\n        <circle id=\"abc\" fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <rect id=\"b\" fill=\"blue\" x=\"120\" y=\"10\" width=\"100\" height=\"100\"/>\n    </defs>\n    <use href=\"#abc\"/>\n    <use href=\"#b\"/>\n</svg>\n\n@@@\n\n{\"preservePrefixes\": \"a\"}\n"
  },
  {
    "path": "test/plugins/cleanupIds.19.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 48 48\">\n    <defs>\n        <style></style>\n        <linearGradient id=\"file-name_svg__file-name_svg__original-id\" x1=\"12\" y1=\"-1\" x2=\"33\" y2=\"46\" gradientUnits=\"userSpaceOnUse\">\n            <stop offset=\"0\" stop-color=\"#6b5aed\" stop-opacity=\"0\" />\n            <stop offset=\"1\" stop-color=\"#6b5aed\" />\n        </linearGradient>\n    </defs>\n    <path d=\"M46 24a21.9 21.9\" fill=\"url(#file-name_svg__file-name_svg__original-id)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 48 48\">\n    <defs>\n        <style/>\n        <linearGradient id=\"a\" x1=\"12\" y1=\"-1\" x2=\"33\" y2=\"46\" gradientUnits=\"userSpaceOnUse\">\n            <stop offset=\"0\" stop-color=\"#6b5aed\" stop-opacity=\"0\"/>\n            <stop offset=\"1\" stop-color=\"#6b5aed\"/>\n        </linearGradient>\n    </defs>\n    <path d=\"M46 24a21.9 21.9\" fill=\"url(#a)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupIds.20.svg.txt",
    "content": "<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n    <g filter=\"url(#filter0_dust)\">\n        <path d=\"M2 8a7 7 0 1 1 14 0A7 7 0 0 1 2 8z\" fill=\"#fff\"/>\n    </g>\n    <path d=\"M4 8a5 5 0 1 1 10 0A5 5 0 0 1 4 8z\" fill=\"currentColor\"/>\n    <defs>\n        <filter id=\"filter0_dust\" x=\"0\" y=\"0\" width=\"18\" height=\"18\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n            <feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n            <feColorMatrix in=\"SourceAlpha\" values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"/>\n            <feOffset dy=\"1\"/>\n            <feGaussianBlur stdDeviation=\"1\"/>\n            <feColorMatrix values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0\"/>\n            <feBlend in2=\"BackgroundImageFix\" result=\"effect1_dropShadow\"/>\n            <feBlend in=\"SourceGraphic\" in2=\"effect1_dropShadow\" result=\"shape\"/>\n        </filter>\n    </defs>\n</svg>\n\n@@@\n\n<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n    <g filter=\"url(#a)\">\n        <path d=\"M2 8a7 7 0 1 1 14 0A7 7 0 0 1 2 8z\" fill=\"#fff\"/>\n    </g>\n    <path d=\"M4 8a5 5 0 1 1 10 0A5 5 0 0 1 4 8z\" fill=\"currentColor\"/>\n    <defs>\n        <filter id=\"a\" x=\"0\" y=\"0\" width=\"18\" height=\"18\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n            <feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n            <feColorMatrix in=\"SourceAlpha\" values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"/>\n            <feOffset dy=\"1\"/>\n            <feGaussianBlur stdDeviation=\"1\"/>\n            <feColorMatrix values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0\"/>\n            <feBlend in2=\"BackgroundImageFix\" result=\"effect1_dropShadow\"/>\n            <feBlend in=\"SourceGraphic\" in2=\"effect1_dropShadow\" result=\"shape\"/>\n        </filter>\n    </defs>\n</svg>\n\n@@@\n\n{\"remove\": \"false\"}\n"
  },
  {
    "path": "test/plugins/cleanupIds.21.svg.txt",
    "content": "<svg width=\"379px\" height=\"134px\" viewBox=\"0 0 379 134\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <circle id=\"6\" cx=\"110.5\" cy=\"5.5\" r=\"5.5\">\n        <animate begin=\"2.5s\" attributeName=\"fill\" calcMode=\"discrete\" values=\"#6ebe28;#D8D8D8\" dur=\"5s\" keyTimes=\"0;0.15\" repeatCount=\"indefinite\"/>\n    </circle>\n    <circle id=\"5\" cx=\"89.5\" cy=\"5.5\" r=\"5.5\">\n        <animate begin=\"2s\" attributeName=\"fill\" calcMode=\"discrete\" values=\"#6ebe28;#D8D8D8\" dur=\"5s\" keyTimes=\"0;0.15\" repeatCount=\"indefinite\"/>\n    </circle>\n    <circle id=\"4\" cx=\"68.5\" cy=\"5.5\" r=\"5.5\">\n        <animate begin=\"1.5s\" attributeName=\"fill\" calcMode=\"discrete\" values=\"#6ebe28;#D8D8D8\" dur=\"5s\" keyTimes=\"0;0.15\" repeatCount=\"indefinite\"/>\n    </circle>\n    <circle id=\"3\" cx=\"47.5\" cy=\"5.5\" r=\"5.5\">\n        <animate begin=\"1s\" attributeName=\"fill\" calcMode=\"discrete\" values=\"#6ebe28;#D8D8D8\" dur=\"5s\" keyTimes=\"0;0.15\" repeatCount=\"indefinite\"/>\n    </circle>\n    <circle id=\"2\" cx=\"26.5\" cy=\"5.5\" r=\"5.5\">\n        <animate begin=\"0.5s\" attributeName=\"fill\" calcMode=\"discrete\" values=\"#6ebe28;#D8D8D8\" dur=\"5s\" keyTimes=\"0;0.15\" repeatCount=\"indefinite\"/>\n    </circle>\n    <circle id=\"1\" cx=\"5.5\" cy=\"5.5\" r=\"5.5\">\n        <animate attributeName=\"fill\" calcMode=\"discrete\" values=\"#6ebe28;#D8D8D8\" dur=\"5s\" keyTimes=\"0;0.15\" repeatCount=\"indefinite\"/>\n    </circle>\n</svg>\n\n@@@\n\n<svg width=\"379px\" height=\"134px\" viewBox=\"0 0 379 134\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <circle cx=\"110.5\" cy=\"5.5\" r=\"5.5\">\n        <animate begin=\"2.5s\" attributeName=\"fill\" calcMode=\"discrete\" values=\"#6ebe28;#D8D8D8\" dur=\"5s\" keyTimes=\"0;0.15\" repeatCount=\"indefinite\"/>\n    </circle>\n    <circle cx=\"89.5\" cy=\"5.5\" r=\"5.5\">\n        <animate begin=\"2s\" attributeName=\"fill\" calcMode=\"discrete\" values=\"#6ebe28;#D8D8D8\" dur=\"5s\" keyTimes=\"0;0.15\" repeatCount=\"indefinite\"/>\n    </circle>\n    <circle cx=\"68.5\" cy=\"5.5\" r=\"5.5\">\n        <animate begin=\"1.5s\" attributeName=\"fill\" calcMode=\"discrete\" values=\"#6ebe28;#D8D8D8\" dur=\"5s\" keyTimes=\"0;0.15\" repeatCount=\"indefinite\"/>\n    </circle>\n    <circle cx=\"47.5\" cy=\"5.5\" r=\"5.5\">\n        <animate begin=\"1s\" attributeName=\"fill\" calcMode=\"discrete\" values=\"#6ebe28;#D8D8D8\" dur=\"5s\" keyTimes=\"0;0.15\" repeatCount=\"indefinite\"/>\n    </circle>\n    <circle cx=\"26.5\" cy=\"5.5\" r=\"5.5\">\n        <animate begin=\"0.5s\" attributeName=\"fill\" calcMode=\"discrete\" values=\"#6ebe28;#D8D8D8\" dur=\"5s\" keyTimes=\"0;0.15\" repeatCount=\"indefinite\"/>\n    </circle>\n    <circle cx=\"5.5\" cy=\"5.5\" r=\"5.5\">\n        <animate attributeName=\"fill\" calcMode=\"discrete\" values=\"#6ebe28;#D8D8D8\" dur=\"5s\" keyTimes=\"0;0.15\" repeatCount=\"indefinite\"/>\n    </circle>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupIds.22.svg.txt",
    "content": "When two IDs are referenced in the same attribute.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1950.1315\" height=\"1740.1298\">\n  <linearGradient id=\"a\">\n    <stop stop-color=\"#f00\" offset=\"0\"/>\n  </linearGradient>\n  <linearGradient id=\"linearGradient3520\" href=\"#a\" gradientUnits=\"userSpaceOnUse\" gradientTransform=\"translate(7991.4092,-7484.0182)\" x1=\"475.01208\" y1=\"29234.521\" x2=\"-1343.6307\" y2=\"29445.83\"/>\n  <filter id=\"c\" style=\"color-interpolation-filters:sRGB\" x=\"-0.2760295\" width=\"1.5520591\" y=\"-0.33142158\" height=\"1.6628431\">\n    <feGaussianBlur stdDeviation=\"331.22039\"/>\n  </filter>\n  <g transform=\"matrix(5.8862959,0,0,5.8862959,-228.3949,1414.6785)\">\n    <path d=\"m 6416.0915,21026.021 c 496.2734,-430.162 1156.7926,-524.889 1495.2326,-581.643 1461.5227,-245.087 1539.467,2033.775 96.1224,2234.099 -524.6707,72.82 -1265.3758,450.675 -1679.5812,-402.754 -315.0174,-535.208 -91.5956,-1058.609 88.2262,-1249.702 z\" style=\"opacity:1;fill:url(#linearGradient3520);fill-opacity:1;stroke:none;stroke-width:16.60000038;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#c)\" transform=\"matrix(0.07412091,0,0,0.07412091,-359.59058,-1695.4044)\"/>\n  </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1950.1315\" height=\"1740.1298\">\n    <linearGradient id=\"a\">\n        <stop stop-color=\"#f00\" offset=\"0\"/>\n    </linearGradient>\n    <linearGradient id=\"b\" href=\"#a\" gradientUnits=\"userSpaceOnUse\" gradientTransform=\"translate(7991.4092,-7484.0182)\" x1=\"475.01208\" y1=\"29234.521\" x2=\"-1343.6307\" y2=\"29445.83\"/>\n    <filter id=\"c\" style=\"color-interpolation-filters:sRGB\" x=\"-0.2760295\" width=\"1.5520591\" y=\"-0.33142158\" height=\"1.6628431\">\n        <feGaussianBlur stdDeviation=\"331.22039\"/>\n    </filter>\n    <g transform=\"matrix(5.8862959,0,0,5.8862959,-228.3949,1414.6785)\">\n        <path d=\"m 6416.0915,21026.021 c 496.2734,-430.162 1156.7926,-524.889 1495.2326,-581.643 1461.5227,-245.087 1539.467,2033.775 96.1224,2234.099 -524.6707,72.82 -1265.3758,450.675 -1679.5812,-402.754 -315.0174,-535.208 -91.5956,-1058.609 88.2262,-1249.702 z\" style=\"opacity:1;fill:url(#b);fill-opacity:1;stroke:none;stroke-width:16.60000038;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#c)\" transform=\"matrix(0.07412091,0,0,0.07412091,-359.59058,-1695.4044)\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupIds.23.svg.txt",
    "content": "When there is a malformed reference that points to a non-existent node, skip\nthat ID if the ID is generated by the plugin.\n\nSee: https://github.com/svg/svgo/issues/1815\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n  <defs>\n    <path id=\"uwu\" d=\"M 2.046875 0 L 10.609375 0 C 12.40625 0 13.734375 -0.5 14.734375 -1.59375 C 15.671875 -2.578125 16.203125 -3.921875 16.203125 -5.40625 C 16.203125 -7.703125 15.15625 -9.078125 12.734375 -10.015625 C 14.484375 -10.8125 15.359375 -12.1875 15.359375 -14.140625 C 15.359375 -15.546875 14.84375 -16.75 13.859375 -17.625 C 12.84375 -18.53125 11.5625 -18.953125 9.75 -18.953125 L 2.046875 -18.953125 Z M 4.46875 -10.796875 L 4.46875 -16.828125 L 9.15625 -16.828125 C 10.5 -16.828125 11.265625 -16.640625 11.90625 -16.140625 C 12.578125 -15.625 12.953125 -14.84375 12.953125 -13.8125 C 12.953125 -12.765625 12.578125 -11.984375 11.90625 -11.46875 C 11.265625 -10.96875 10.5 -10.796875 9.15625 -10.796875 Z M 4.46875 -2.125 L 4.46875 -8.65625 L 10.375 -8.65625 C 12.5 -8.65625 13.78125 -7.4375 13.78125 -5.375 C 13.78125 -3.359375 12.5 -2.125 10.375 -2.125 Z M 4.46875 -2.125\"/>\n  </defs>\n  <use href=\"#a\" x=\"378\" y=\"464\"/>\n  <use href=\"#uwu\" x=\"385\" y=\"464\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <path id=\"b\" d=\"M 2.046875 0 L 10.609375 0 C 12.40625 0 13.734375 -0.5 14.734375 -1.59375 C 15.671875 -2.578125 16.203125 -3.921875 16.203125 -5.40625 C 16.203125 -7.703125 15.15625 -9.078125 12.734375 -10.015625 C 14.484375 -10.8125 15.359375 -12.1875 15.359375 -14.140625 C 15.359375 -15.546875 14.84375 -16.75 13.859375 -17.625 C 12.84375 -18.53125 11.5625 -18.953125 9.75 -18.953125 L 2.046875 -18.953125 Z M 4.46875 -10.796875 L 4.46875 -16.828125 L 9.15625 -16.828125 C 10.5 -16.828125 11.265625 -16.640625 11.90625 -16.140625 C 12.578125 -15.625 12.953125 -14.84375 12.953125 -13.8125 C 12.953125 -12.765625 12.578125 -11.984375 11.90625 -11.46875 C 11.265625 -10.96875 10.5 -10.796875 9.15625 -10.796875 Z M 4.46875 -2.125 L 4.46875 -8.65625 L 10.375 -8.65625 C 12.5 -8.65625 13.78125 -7.4375 13.78125 -5.375 C 13.78125 -3.359375 12.5 -2.125 10.375 -2.125 Z M 4.46875 -2.125\"/>\n    </defs>\n    <use href=\"#a\" x=\"378\" y=\"464\"/>\n    <use href=\"#b\" x=\"385\" y=\"464\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupIds.24.svg.txt",
    "content": "Properly rename IDs, by matching them properly (exclude semicolons, include numbers)\nSee https://github.com/svg/svgo/issues/1775\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n  <circle cx=\"12\" cy=\"12\">\n    <animate id=\"thing1\" fill=\"freeze\" attributeName=\"r\" begin=\"0;thing2.end\" dur=\"1.2s\" values=\"0;11\"/>\n  </circle>\n  <circle cx=\"12\" cy=\"12\">\n    <animate id=\"thing2\" fill=\"freeze\" attributeName=\"r\" begin=\"thing1.begin+0.2s\" dur=\"1.2s\" values=\"0;11\"/>\n  </circle>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n    <circle cx=\"12\" cy=\"12\">\n        <animate id=\"b\" fill=\"freeze\" attributeName=\"r\" begin=\"0;a.end\" dur=\"1.2s\" values=\"0;11\"/>\n    </circle>\n    <circle cx=\"12\" cy=\"12\">\n        <animate id=\"a\" fill=\"freeze\" attributeName=\"r\" begin=\"b.begin+0.2s\" dur=\"1.2s\" values=\"0;11\"/>\n    </circle>\n</svg>"
  },
  {
    "path": "test/plugins/cleanupIds.25.svg.txt",
    "content": "Should handle non-ASCII IDs and resolve URI encoded references.\n\nSee: https://github.com/svg/svgo/issues/1696\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 9 9\">\n  <defs>\n    <path id=\"人口\" d=\"M1 1l2 2\" stroke=\"black\"/>\n  </defs>\n  <use href=\"#%E4%BA%BA%E5%8F%A3\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 9 9\">\n    <defs>\n        <path id=\"a\" d=\"M1 1l2 2\" stroke=\"black\"/>\n    </defs>\n    <use href=\"#a\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupIds.26.svg.txt",
    "content": "Should handle non-ASCII IDs and resolve not correctly URI encoded references.\n\nSee: https://github.com/svg/svgo/issues/1981\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <linearGradient id=\"渐变_1\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n            <stop stop-color=\"#5a2100\" />\n        </linearGradient>\n    </defs>\n    <rect x=\"30\" y=\"30\" height=\"150\" width=\"370\" fill=\"url(#渐变_1)\" />\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <linearGradient id=\"a\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n            <stop stop-color=\"#5a2100\"/>\n        </linearGradient>\n    </defs>\n    <rect x=\"30\" y=\"30\" height=\"150\" width=\"370\" fill=\"url(#a)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupListOfValues.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 500.2132 500.213823642\" enable-background=\"new 0 0 500.224551535 500.213262\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 500.213 500.214\" enable-background=\"new 0 0 500.225 500.213\">\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupListOfValues.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <polygon stroke-dasharray=\"200.22222 200.22522\" points=\"413.74712,290.95212 290.75632  ,  343.89942 183.40744 ,263.8582523 199.05334,  130.871345 322.04442,77.92533 429.39122,157.96555 \"/>\n    test\n    <g fill=\"none\" stroke-dasharray=\"8, 8\" stroke-width=\"3\">\n        <path d=\"M83 250c69-18 140-40 197-84 33-23 48-62 62-99 2-6 3-12 7-16\"/>\n        <path stroke-dasharray=\"none\" stroke-linejoin=\"round\" d=\"M83 250c29-34 57-72 97-94 33-13 69-10 104-11 22 1 45 2 65 13\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <polygon stroke-dasharray=\"200.222 200.225\" points=\"413.747 290.952 290.756 343.899 183.407 263.858 199.053 130.871 322.044 77.925 429.391 157.966\"/>\n    test\n    <g fill=\"none\" stroke-dasharray=\"8 8\" stroke-width=\"3\">\n        <path d=\"M83 250c69-18 140-40 197-84 33-23 48-62 62-99 2-6 3-12 7-16\"/>\n        <path stroke-dasharray=\"none\" stroke-linejoin=\"round\" d=\"M83 250c29-34 57-72 97-94 33-13 69-10 104-11 22 1 45 2 65 13\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupListOfValues.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <text x=\"23.2350 20.2268px 0.22356em 80.0005%\" y=\"23.2350 20.2268px 0.22356em 80.0005%\" dx=\"23.2350 20.2268px 0.22356em 80.0005%\" dy=\"23.2350 20.2268px 0.22356em 80.0005%\">\n        test\n    </text>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <text x=\"23.235 20.227 .224em 80.001%\" y=\"23.235 20.227 .224em 80.001%\" dx=\"23.235 20.227 .224em 80.001%\" dy=\"23.235 20.227 .224em 80.001%\">\n        test\n    </text>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupNumericValues.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"20.000001 -19.99999 17.123456 70.708090\" width=\"50.12356%\" height=\"20px\" x=\".2655\" y=\"-.2346\">\n    <rect width=\"1in\" height=\"12pt\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"20 -20 17.123 70.708\" width=\"50.124%\" height=\"20\" x=\".266\" y=\"-.235\">\n    <rect width=\"96\" height=\"16\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupNumericValues.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0, 0, 20, 20\">\n    <rect width=\"20\" height=\"20\" fill=\"rgba(255,255,255,.85)\" rx=\"20\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\">\n    <rect width=\"20\" height=\"20\" fill=\"rgba(255,255,255,.85)\" rx=\"20\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/cleanupNumericValues.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\" 0 0      150 100 \"/>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 150 100\"/>\n"
  },
  {
    "path": "test/plugins/collapseGroups.01.svg.txt",
    "content": "Collapse groups without attributes\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <g>\n            <path d=\"...\"/>\n        </g>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"...\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/collapseGroups.02.svg.txt",
    "content": "Inherit attributes to single child\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <g attr1=\"val1\">\n            <path d=\"...\"/>\n        </g>\n    </g>\n    <g attr1=\"val1\">\n        <g attr2=\"val2\">\n            <path d=\"...\"/>\n        </g>\n    </g>\n    <g attr1=\"val1\">\n        <g>\n            <path d=\"...\"/>\n        </g>\n        <path d=\"...\"/>\n    </g>\n    <g attr1=\"val1\">\n        <g attr2=\"val2\">\n            <path d=\"...\"/>\n        </g>\n        <path d=\"...\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"...\" attr1=\"val1\"/>\n    <path d=\"...\" attr2=\"val2\" attr1=\"val1\"/>\n    <g attr1=\"val1\">\n        <path d=\"...\"/>\n        <path d=\"...\"/>\n    </g>\n    <g attr1=\"val1\">\n        <path d=\"...\" attr2=\"val2\"/>\n        <path d=\"...\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/collapseGroups.06.svg.txt",
    "content": "Remove inheritable overridden groups attributes\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g attr1=\"val1\">\n        <g fill=\"red\">\n            <path fill=\"green\" d=\"...\"/>\n        </g>\n        <path d=\"...\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g attr1=\"val1\">\n        <path fill=\"green\" d=\"...\"/>\n        <path d=\"...\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/collapseGroups.07.svg.txt",
    "content": "Remove equal overridden groups attributes\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g attr1=\"val1\">\n        <g attr2=\"val2\">\n            <path attr2=\"val2\" d=\"...\"/>\n        </g>\n        <g attr2=\"val2\">\n            <path attr2=\"val3\" d=\"...\"/>\n        </g>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g attr1=\"val1\">\n        <path attr2=\"val2\" d=\"...\"/>\n        <g attr2=\"val2\">\n            <path attr2=\"val3\" d=\"...\"/>\n        </g>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/collapseGroups.08.svg.txt",
    "content": "Combine own child transform and inherited\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g attr1=\"val1\">\n        <g transform=\"rotate(45)\">\n            <path transform=\"scale(2)\" d=\"...\"/>\n        </g>\n        <path d=\"...\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g attr1=\"val1\">\n        <path transform=\"rotate(45) scale(2)\" d=\"...\"/>\n        <path d=\"...\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/collapseGroups.09.svg.txt",
    "content": "Preserve transform when group has clip-path\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <clipPath id=\"a\">\n       <path d=\"...\"/>\n    </clipPath>\n    <clipPath id=\"b\">\n       <path d=\"...\"/>\n    </clipPath>\n    <g transform=\"matrix(0 -1.25 -1.25 0 100 100)\" clip-path=\"url(#a)\">\n        <g transform=\"scale(.2)\">\n            <path d=\"...\"/>\n            <path d=\"...\"/>\n        </g>\n    </g>\n    <g transform=\"matrix(0 -1.25 -1.25 0 100 100)\" clip-path=\"url(#a)\">\n        <g transform=\"scale(.2)\">\n            <g>\n                <g clip-path=\"url(#b)\">\n                    <path d=\"...\"/>\n                    <path d=\"...\"/>\n                </g>\n            </g>\n        </g>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <clipPath id=\"a\">\n        <path d=\"...\"/>\n    </clipPath>\n    <clipPath id=\"b\">\n        <path d=\"...\"/>\n    </clipPath>\n    <g transform=\"matrix(0 -1.25 -1.25 0 100 100)\" clip-path=\"url(#a)\">\n        <g transform=\"scale(.2)\">\n            <path d=\"...\"/>\n            <path d=\"...\"/>\n        </g>\n    </g>\n    <g transform=\"matrix(0 -1.25 -1.25 0 100 100)\" clip-path=\"url(#a)\">\n        <g clip-path=\"url(#b)\" transform=\"scale(.2)\">\n            <path d=\"...\"/>\n            <path d=\"...\"/>\n        </g>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/collapseGroups.11.svg.txt",
    "content": "Preserve groups when clip-path and mask are used without any other attributes\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <clipPath id=\"a\">\n       <path d=\"...\"/>\n    </clipPath>\n    <path d=\"...\"/>\n    <g clip-path=\"url(#a)\">\n        <path d=\"...\" transform=\"scale(.2)\"/>\n    </g>\n    <g mask=\"url(#a)\">\n        <path d=\"...\" transform=\"scale(.2)\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <clipPath id=\"a\">\n        <path d=\"...\"/>\n    </clipPath>\n    <path d=\"...\"/>\n    <g clip-path=\"url(#a)\">\n        <path d=\"...\" transform=\"scale(.2)\"/>\n    </g>\n    <g mask=\"url(#a)\">\n        <path d=\"...\" transform=\"scale(.2)\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/collapseGroups.12.svg.txt",
    "content": "Preserve groups with id attribute or animation elements inside\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g stroke=\"#000\">\n        <g id=\"star\">\n            <path id=\"bar\" d=\"...\"/>\n        </g>\n    </g>\n    <g>\n        <animate id=\"frame0\" attributeName=\"visibility\" values=\"visible\" dur=\"33ms\" begin=\"0s;frame27.end\"/>\n        <path d=\"...\" fill=\"#272727\"/>\n        <path d=\"...\" fill=\"#404040\"/>\n        <path d=\"...\" fill=\"#2d2d2d\"/>\n    </g>\n    <g transform=\"rotate(-90 25 0)\">\n        <circle stroke-dasharray=\"110\" r=\"20\" stroke=\"#10cfbd\" fill=\"none\" stroke-width=\"3\" stroke-linecap=\"round\">\n            <animate attributeName=\"stroke-dashoffset\" values=\"360;140\" dur=\"2.2s\" keyTimes=\"0;1\" calcMode=\"spline\" fill=\"freeze\" keySplines=\"0.41,0.314,0.8,0.54\" repeatCount=\"indefinite\" begin=\"0\"/>\n            <animateTransform attributeName=\"transform\" type=\"rotate\" values=\"0;274;360\" keyTimes=\"0;0.74;1\" calcMode=\"linear\" dur=\"2.2s\" repeatCount=\"indefinite\" begin=\"0\"/>\n        </circle>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g stroke=\"#000\">\n        <g id=\"star\">\n            <path id=\"bar\" d=\"...\"/>\n        </g>\n    </g>\n    <g>\n        <animate id=\"frame0\" attributeName=\"visibility\" values=\"visible\" dur=\"33ms\" begin=\"0s;frame27.end\"/>\n        <path d=\"...\" fill=\"#272727\"/>\n        <path d=\"...\" fill=\"#404040\"/>\n        <path d=\"...\" fill=\"#2d2d2d\"/>\n    </g>\n    <g transform=\"rotate(-90 25 0)\">\n        <circle stroke-dasharray=\"110\" r=\"20\" stroke=\"#10cfbd\" fill=\"none\" stroke-width=\"3\" stroke-linecap=\"round\">\n            <animate attributeName=\"stroke-dashoffset\" values=\"360;140\" dur=\"2.2s\" keyTimes=\"0;1\" calcMode=\"spline\" fill=\"freeze\" keySplines=\"0.41,0.314,0.8,0.54\" repeatCount=\"indefinite\" begin=\"0\"/>\n            <animateTransform attributeName=\"transform\" type=\"rotate\" values=\"0;274;360\" keyTimes=\"0;0.74;1\" calcMode=\"linear\" dur=\"2.2s\" repeatCount=\"indefinite\" begin=\"0\"/>\n        </circle>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/collapseGroups.13.svg.txt",
    "content": "Preserve groups with classes\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .n{display:none}\n        .i{display:inline}\n    </style>\n    <g id=\"a\">\n        <g class=\"i\"/>\n    </g>\n    <g id=\"b\" class=\"n\">\n        <g class=\"i\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .n{display:none}\n        .i{display:inline}\n    </style>\n    <g class=\"i\" id=\"a\"/>\n    <g id=\"b\" class=\"n\">\n        <g class=\"i\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/collapseGroups.14.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <switch>\n        <g id=\"a\">\n            <g class=\"i\"/>\n        </g>\n        <g id=\"b\" class=\"n\">\n            <g class=\"i\"/>\n        </g>\n        <g>\n            <g/>\n        </g>\n    </switch>\n\n</svg>\n\n@@@\n\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <switch>\n        <g id=\"a\">\n            <g class=\"i\"/>\n        </g>\n        <g id=\"b\" class=\"n\">\n            <g class=\"i\"/>\n        </g>\n        <g>\n            <g/>\n        </g>\n    </switch>\n</svg>"
  },
  {
    "path": "test/plugins/collapseGroups.15.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n\t<g color=\"red\">\n\t\t<g color=\"inherit\" fill=\"none\" stroke=\"none\">\n\t\t\t<circle cx=\"130\" cy=\"80\" r=\"60\" fill=\"currentColor\"/>\n\t\t\t<circle cx=\"350\" cy=\"80\" r=\"60\" stroke=\"currentColor\" stroke-width=\"4\"/>\n\t\t</g>\n\t</g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g color=\"red\" fill=\"none\" stroke=\"none\">\n        <circle cx=\"130\" cy=\"80\" r=\"60\" fill=\"currentColor\"/>\n        <circle cx=\"350\" cy=\"80\" r=\"60\" stroke=\"currentColor\" stroke-width=\"4\"/>\n    </g>\n</svg>"
  },
  {
    "path": "test/plugins/collapseGroups.16.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g filter=\"url(#...)\">\n        <g>\n            <path d=\"...\"/>\n        </g>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g filter=\"url(#...)\">\n        <path d=\"...\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/collapseGroups.17.svg.txt",
    "content": "Don't collapse group with a single child unless all attributes can be moved to the child.\nSee issue #1928 for context.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 88 88\">\n  <filter id=\"a\">\n    <feGaussianBlur stdDeviation=\"1\"/>\n  </filter>\n  <g transform=\"matrix(0.6875,0,0,0.6875,20.34375,66.34375)\" style=\"filter:url(#a)\">\n    <path d=\"M 33.346591,-83.471591 L -10.744318,-36.471591 L -10.49989,-32.5\" style=\"fill-opacity:1\"/>\n  </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 88 88\">\n    <filter id=\"a\">\n        <feGaussianBlur stdDeviation=\"1\"/>\n    </filter>\n    <g transform=\"matrix(0.6875,0,0,0.6875,20.34375,66.34375)\" style=\"filter:url(#a)\">\n        <path d=\"M 33.346591,-83.471591 L -10.744318,-36.471591 L -10.49989,-32.5\" style=\"fill-opacity:1\"/>\n    </g>\n</svg>"
  },
  {
    "path": "test/plugins/collapseGroups.18.svg.txt",
    "content": "Don't collapse groups if outer group has filter (as style or attribute).\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <clipPath id=\"a\">\n        <circle cx=\"25\" cy=\"15\" r=\"10\"/>\n    </clipPath>\n    <filter id=\"b\">\n        <feColorMatrix type=\"saturate\"/>\n    </filter>\n    <g filter=\"url(#b)\">\n        <g clip-path=\"url(#a)\">\n            <circle cx=\"30\" cy=\"10\" r=\"10\" fill=\"yellow\" id=\"c1\"/>\n        </g>\n    </g>\n    <g style=\"filter:url(#b)\">\n        <g clip-path=\"url(#a)\">\n            <circle cx=\"20\" cy=\"10\" r=\"10\" fill=\"blue\" id=\"c2\"/>\n        </g>\n    </g>\n    <circle cx=\"25\" cy=\"15\" r=\"10\" stroke=\"black\" stroke-width=\".1\" fill=\"none\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <clipPath id=\"a\">\n        <circle cx=\"25\" cy=\"15\" r=\"10\"/>\n    </clipPath>\n    <filter id=\"b\">\n        <feColorMatrix type=\"saturate\"/>\n    </filter>\n    <g filter=\"url(#b)\">\n        <g clip-path=\"url(#a)\">\n            <circle cx=\"30\" cy=\"10\" r=\"10\" fill=\"yellow\" id=\"c1\"/>\n        </g>\n    </g>\n    <g style=\"filter:url(#b)\">\n        <g clip-path=\"url(#a)\">\n            <circle cx=\"20\" cy=\"10\" r=\"10\" fill=\"blue\" id=\"c2\"/>\n        </g>\n    </g>\n    <circle cx=\"25\" cy=\"15\" r=\"10\" stroke=\"black\" stroke-width=\".1\" fill=\"none\"/>\n</svg>"
  },
  {
    "path": "test/plugins/convertColors.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g color=\"black\"/>\n    <g color=\"BLACK\"/>\n    <path fill=\"rgb(64 64 64)\"/>\n    <path fill=\"rgb(64, 64, 64)\"/>\n    <path fill=\"rgb(86.27451%,86.666667%,87.058824%)\"/>\n    <path fill=\"rgb(-255,100,500)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g color=\"#000\"/>\n    <g color=\"#000\"/>\n    <path fill=\"#404040\"/>\n    <path fill=\"#404040\"/>\n    <path fill=\"#dcddde\"/>\n    <path fill=\"#0064ff\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertColors.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g color=\"#ff00aa\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g color=\"#f0a\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertColors.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g color=\"#FF0000\"/>\n    <g color=\"#f00\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g color=\"red\"/>\n    <g color=\"red\"/>\n</svg>\n\n@@@\n\n{ \"shorthex\": false }\n"
  },
  {
    "path": "test/plugins/convertColors.04.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g color=\"black\"/>\n    <g color=\"BLACK\"/>\n    <g color=\"none\"/>\n    <path fill=\"rgb(64, 64, 64)\"/>\n    <path fill=\"rgb(86.27451%,86.666667%,87.058824%)\"/>\n    <path fill=\"rgb(-255,100,500)\"/>\n    <path fill=\"none\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g color=\"currentColor\"/>\n    <g color=\"currentColor\"/>\n    <g color=\"none\"/>\n    <path fill=\"currentColor\"/>\n    <path fill=\"currentColor\"/>\n    <path fill=\"currentColor\"/>\n    <path fill=\"none\"/>\n</svg>\n\n@@@\n\n{ \"currentColor\": true }\n"
  },
  {
    "path": "test/plugins/convertColors.05.svg.txt",
    "content": "Do not touch the casing of URL references in color attributes.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 150 150\">\n    <linearGradient id=\"Aa\">\n        <stop stop-color=\"ReD\" offset=\"5%\"/>\n    </linearGradient>\n    <text x=\"0\" y=\"32\" fill=\"gold\">uwu</text>\n    <text x=\"0\" y=\"64\" fill=\"GOLD\">owo</text>\n    <text x=\"0\" y=\"96\" fill=\"url(#Aa)\">eue</text>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 150 150\">\n    <linearGradient id=\"Aa\">\n        <stop stop-color=\"red\" offset=\"5%\"/>\n    </linearGradient>\n    <text x=\"0\" y=\"32\" fill=\"gold\">uwu</text>\n    <text x=\"0\" y=\"64\" fill=\"gold\">owo</text>\n    <text x=\"0\" y=\"96\" fill=\"url(#Aa)\">eue</text>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertColors.06.svg.txt",
    "content": "Do not apply currentColor to masks.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path fill=\"white\"/>\n    <mask id=\"mask1\" fill=\"white\" />\n    <mask id=\"mask2\">\n        <path fill=\"rgba(255,255,255,0.75)\"/>\n    </mask>\n    <mask id=\"mask3\">\n        <g>\n            <path fill=\"white\"/>\n            <path stroke=\"black\"/>\n        </g>\n        <mask id=\"inner-mask\" fill=\"rgba(0,0,0,.5)\"></mask>\n    </mask>\n    <path fill=\"red\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path fill=\"currentColor\"/>\n    <mask id=\"mask1\" fill=\"#fff\"/>\n    <mask id=\"mask2\">\n        <path fill=\"rgba(255,255,255,0.75)\"/>\n    </mask>\n    <mask id=\"mask3\">\n        <g>\n            <path fill=\"#fff\"/>\n            <path stroke=\"#000\"/>\n        </g>\n        <mask id=\"inner-mask\" fill=\"rgba(0,0,0,.5)\"/>\n    </mask>\n    <path fill=\"currentColor\"/>\n</svg>\n\n@@@\n\n{ \"currentColor\": true }\n"
  },
  {
    "path": "test/plugins/convertEllipseToCircle.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <ellipse rx=\"5\" ry=\"5\"/>\n    <ellipse rx=\"auto\" ry=\"5\"/>\n    <ellipse rx=\"5\" ry=\"auto\"/>\n    <ellipse />\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <circle r=\"5\"/>\n    <circle r=\"5\"/>\n    <circle r=\"5\"/>\n    <circle r=\"0\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertOneStopGradients.01.svg.txt",
    "content": "Convert both a one-stop gradient configured from attribute and styles.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"744.09448\" height=\"1052.3622\">\n  <defs>\n    <linearGradient id=\"a\">\n      <stop stop-color=\"#ddc4cc\"/>\n    </linearGradient>\n    <linearGradient id=\"b\">\n      <stop style=\"stop-color:#a8c4cc\"/>\n    </linearGradient>\n  </defs>\n  <rect width=\"150\" height=\"150\" x=\"350\" y=\"350\" fill=\"url(#a)\"/>\n  <rect width=\"150\" height=\"150\" x=\"50\" y=\"350\" style=\"fill:url(#b)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"744.09448\" height=\"1052.3622\">\n    <rect width=\"150\" height=\"150\" x=\"350\" y=\"350\" fill=\"#ddc4cc\"/>\n    <rect width=\"150\" height=\"150\" x=\"50\" y=\"350\" style=\"fill:#a8c4cc\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertOneStopGradients.02.svg.txt",
    "content": "Convert a one-stop gradient that references another one-stop gradient. Remove\nxlink:href namespace since we remove the only reference to it.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\"\n  xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" width=\"744.09448\" height=\"1052.3622\">\n  <defs>\n    <linearGradient id=\"a\">\n      <stop style=\"stop-color:#a8c4cc\"/>\n    </linearGradient>\n    <linearGradient x1=\"353.83112\" y1=\"396.85037\" x2=\"496.56262\" y2=\"396.85037\" id=\"b\" xlink:href=\"#a\"/>\n  </defs>\n  <rect width=\"150\" height=\"150\" x=\"350\" y=\"350\" style=\"fill:url(#b)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"744.09448\" height=\"1052.3622\">\n    <rect width=\"150\" height=\"150\" x=\"350\" y=\"350\" style=\"fill:#a8c4cc\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertOneStopGradients.03.svg.txt",
    "content": "If a one-stop gradient has the color defined via both attribute and style, style\ntakes precedence.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\"\n  xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" width=\"744.09448\" height=\"1052.3622\">\n  <defs>\n    <linearGradient id=\"a\">\n      <stop stop-color=\"#ff0000\" style=\"stop-color:#00ff00\"/>\n    </linearGradient>\n    <linearGradient x1=\"353.83112\" y1=\"396.85037\" x2=\"496.56262\" y2=\"396.85037\" id=\"b\" xlink:href=\"#a\"/>\n  </defs>\n  <rect width=\"150\" height=\"150\" x=\"350\" y=\"350\" style=\"fill:url(#b)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"744.09448\" height=\"1052.3622\">\n    <rect width=\"150\" height=\"150\" x=\"350\" y=\"350\" style=\"fill:#00ff00\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M 10,50\"/>\n    <path d=\"M 10 50\"/>\n    <path d=\"M10 50\"/>\n    <path d=\"M10,50\"/>\n    <path d=\"M10-3.05176e-005\"/>\n    <path d=\"M10-50.2.30-2\"/>\n    <path d=\"M10-50l.2.30\"/>\n    <path d=\"M 10 , 50\"/>\n    <path d=\"M -10,-50\"/>\n    <path d=\"M -10 -50\"/>\n    <path d=\"M-10 -50\"/>\n    <path d=\"M-10-50\"/>\n    <path d=\"M-10,-50\"/>\n    <path d=\"M -10 , -50\"/>\n    <path d=\"...\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M10 50\"/>\n    <path d=\"M10 50\"/>\n    <path d=\"M10 50\"/>\n    <path d=\"M10 50\"/>\n    <path d=\"M10 0\"/>\n    <path d=\"M10-50.2.3-2\"/>\n    <path d=\"m10-50 .2.3\"/>\n    <path d=\"M10 50\"/>\n    <path d=\"M-10-50\"/>\n    <path d=\"M-10-50\"/>\n    <path d=\"M-10-50\"/>\n    <path d=\"M-10-50\"/>\n    <path d=\"M-10-50\"/>\n    <path d=\"M-10-50\"/>\n    <path d=\"...\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M 10,50 L 20,30\"/>\n    <path d=\"M 10,50 C 20,30 40,50 60,70\"/>\n    <path d=\"M 10,50 C 20,30 40,50 60,70 S 20,30 30,60\"/>\n    <path d=\"M 10,50 Q 30,60 30,70\"/>\n    <path d=\"M 10,50 Q 30,60 30,70 T 40,70\"/>\n    <path d=\"M 10,50 A 20,60 45 0,1 40,70\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"m10 50 10-20\"/>\n    <path d=\"M10 50c10-20 30 0 50 20\"/>\n    <path d=\"M10 50c10-20 30 0 50 20S20 30 30 60\"/>\n    <path d=\"M10 50q20 10 20 20\"/>\n    <path d=\"M10 50q20 10 20 20t10 0\"/>\n    <path d=\"M10 50a20 60 45 0 1 30 20\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M 10,50 M 20,60\"/>\n    <path d=\"M 10,50 20,60\"/>\n    <path d=\"M 10,50 L 20,30 L 40,60\"/>\n    <path d=\"M 10,50 L 20,30 40,60\"/>\n    <path d=\"M 10,50 C 20,30 40,50 60,70 C 40,40 50,60 70,80\"/>\n    <path d=\"M 10,50 C 20,30 40,50 60,70 40,40 50,60 70,80\"/>\n    <path d=\"M 10,50 C 20,30 40,50 60,70 S 30,30 40,50 S 60,70 80,100\"/>\n    <path d=\"M 10,50 C 20,30 40,50 60,70 S 30,30 40,50 60,70 80,100\"/>\n    <path d=\"M 10,50 Q 30,60 30,70 Q 40,70 50,90\"/>\n    <path d=\"M 10,50 Q 30,60 30,70 40,70 50,90\"/>\n    <path d=\"M 10,50 Q 30,60 30,70 T 40,70 T 50,90\"/>\n    <path d=\"M 10,50 Q 30,60 30,70 T 40,70 50,90\"/>\n    <path d=\"M 10,50 A 20,60 45 0,1 40,70 A 30,50 -30 1,1 50,70\"/>\n    <path d=\"M 10,50 A 20,60 45 0,1 40,70 30,50 -30 1,1 50,70\"/>\n    <style>\n      .marker-mid { marker-mid: url(#); }\n    </style>\n    <path d=\"M0,0 0,5 0,10\" class=\"marker-mid\"/>\n    <path d=\"M0,0 0,5 0,10\" marker-mid=\"url(#)\"/>\n    <style>\n      .linecap-round { stroke: black; stroke-linecap: round; }\n      .linecap-butt { stroke: black; stroke-linecap: butt; }\n    </style>\n    <path d=\"M0,0 0,0\" stroke=\"black\" stroke-linecap=\"round\"/>\n    <path d=\"M0,0 0,0\" class=\"linecap-round\"/>\n    <path d=\"M0,0 0,0\" stroke=\"black\" stroke-linecap=\"butt\"/>\n    <path d=\"M0,0 0,0\" class=\"linecap-butt\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M20 60\"/>\n    <path d=\"m10 50 10 10\"/>\n    <path d=\"m10 50 10-20 20 30\"/>\n    <path d=\"m10 50 10-20 20 30\"/>\n    <path d=\"M10 50c10-20 30 0 50 20-20-30-10-10 10 10\"/>\n    <path d=\"M10 50c10-20 30 0 50 20-20-30-10-10 10 10\"/>\n    <path d=\"M10 50c10-20 30 0 50 20S30 30 40 50s20 20 40 50\"/>\n    <path d=\"M10 50c10-20 30 0 50 20S30 30 40 50s20 20 40 50\"/>\n    <path d=\"M10 50q20 10 20 20 10 0 20 20\"/>\n    <path d=\"M10 50q20 10 20 20 10 0 20 20\"/>\n    <path d=\"M10 50q20 10 20 20t10 0 10 20\"/>\n    <path d=\"M10 50q20 10 20 20t10 0 10 20\"/>\n    <path d=\"M10 50a20 60 45 0 1 30 20 30 50-30 1 1 10 0\"/>\n    <path d=\"M10 50a20 60 45 0 1 30 20 30 50-30 1 1 10 0\"/>\n    <style>\n        .marker-mid { marker-mid: url(#); }\n    </style>\n    <path d=\"M0 0v5 5\" class=\"marker-mid\"/>\n    <path d=\"M0 0v5 5\" marker-mid=\"url(#)\"/>\n    <style>\n        .linecap-round { stroke: black; stroke-linecap: round; }\n      .linecap-butt { stroke: black; stroke-linecap: butt; }\n    </style>\n    <path d=\"M0 0h0\" stroke=\"black\" stroke-linecap=\"round\"/>\n    <path d=\"M0 0h0\" class=\"linecap-round\"/>\n    <path d=\"M0 0\" stroke=\"black\" stroke-linecap=\"butt\"/>\n    <path d=\"M0 0\" class=\"linecap-butt\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.04.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M 10,50 l 20,30 L 20,30\"/>\n    <path d=\"M 10,50 c 20,30 40,50 60,70 C 20,30 40,50 60,70\"/>\n    <path d=\"M 10,50 c 20,30 40,50 60,70 s 20,40 40,50 L 10,20\"/>\n    <path d=\"M 10,50 q 20,60 30,70 Q 20,60 30,70\"/>\n    <path d=\"M 10,50 q 20,60 30,70 t 40,70 L 10,20\"/>\n    <path d=\"M 10,50 a 20,60 45 0,1 40,70 A 20,60 45 0,1 40,70\"/>\n    <path d=\"M1 1 v8 c0-2 0-4 0-6\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"m10 50 20 30-10-50\"/>\n    <path d=\"M10 50c20 30 40 50 60 70-50-90-30-70-10-50\"/>\n    <path d=\"M10 50c20 30 40 50 60 70s20 40 40 50L10 20\"/>\n    <path d=\"M10 50q20 60 30 70-20-60-10-50\"/>\n    <path d=\"M10 50q20 60 30 70t40 70L10 20\"/>\n    <path d=\"M10 50a20 60 45 0 1 40 70 20 60 45 0 1-10-50\"/>\n    <path d=\"M1 1v8-6\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.05.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M 10.3467,50.09 L 10.0000,50.20\"/>\n    <path d=\"m 10 10 l 1 1 M 20 20\"/>\n    <path d=\"m 0 0 l .1133 1 l .1133 2 l .1133 3\"/>\n    <path d=\"m 0 0 l .0025 3 .0025 2 .0025 3 .0025 2\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M10.347 50.09 10 50.2\"/>\n    <path d=\"m10 10 1 1m9 9\"/>\n    <path d=\"m0 0 .113 1 .114 2L.34 6\"/>\n    <path d=\"m0 0 .003 3 .002 2 .003 3 .002 2\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.06.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M 10,50 L 10,50\"/>\n    <path d=\"M 10,50 L 20,50\"/>\n    <path d=\"M 10,50 L 10,60\"/>\n    <path d=\"M 10,50 L 20,30 10,30\"/>\n    <path d=\"M 10,50 L 20,30 20,20\"/>\n    <path d=\"M 10,50 L 20,30 10,30 40,50\"/>\n    <path d=\"M 10,50 L 20,30 20,20 40,50\"/>\n    <path d=\"M 10,50 L 20,50 L 30,50\"/>\n    <path d=\"M 10,50 L 20,50 30,50\"/>\n    <path d=\"M 10,50 L 20,50 L 30,50 L 40,50\"/>\n    <path d=\"M 10,50 L 10,60 L 10,70\"/>\n    <path d=\"M 10,50 L 10,60 10,70\"/>\n    <path d=\"M 10,50 L 10,60 L 10,70 L 10,80\"/>\n</svg>\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M10 50\"/>\n    <path d=\"M10 50h10\"/>\n    <path d=\"M10 50v10\"/>\n    <path d=\"m10 50 10-20H10\"/>\n    <path d=\"m10 50 10-20V20\"/>\n    <path d=\"m10 50 10-20H10l30 20\"/>\n    <path d=\"m10 50 10-20V20l20 30\"/>\n    <path d=\"M10 50h20\"/>\n    <path d=\"M10 50h20\"/>\n    <path d=\"M10 50h30\"/>\n    <path d=\"M10 50v20\"/>\n    <path d=\"M10 50v20\"/>\n    <path d=\"M10 50v30\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.07.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"m 0,0\"/>\n    <path d=\"m 0,0l 0,0\"/>\n    <path d=\"m 0,0h 0\"/>\n    <path d=\"m 0,0v 0\"/>\n    <path d=\"m 0,0c 0,0 0,0 0,0 s 0,0 0,0\"/>\n    <path d=\"m 0,0q 0,0 0,0 t 0,0\"/>\n    <path d=\"m 0,0a 25,25 -30 0,1 0,0\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M0 0\"/>\n    <path d=\"M0 0\"/>\n    <path d=\"M0 0\"/>\n    <path d=\"M0 0\"/>\n    <path d=\"M0 0\"/>\n    <path d=\"M0 0\"/>\n    <path d=\"M0 0\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.08.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M100,200 C200,200 300,200 400,200\"/>\n    <path d=\"M100,200 C100,200 250,200 250,200 S300,200 400,200\"/>\n    <path d=\"M100,200 C100,200 250,200 250,200 S300,300 400,210\"/>\n    <path d=\"M100,200 S250,250 250,250 S400,250 500,250\"/>\n    <path d=\"M100,200 Q200,200 300,200\"/>\n    <path d=\"M100,200 Q400,200 600,200 T800,200\"/>\n    <path d=\"M100,200 Q400,200 600,200 T800,300\"/>\n    <path d=\"M100,200 Q200,200 200,300 T200,500 T300,500\"/>\n    <path d=\"M100,200 Q400,200 600,200 T800,200 T900,300\"/>\n    <path d=\"M100,200 T800,300\"/>\n    <path d=\"M100,200 A0,150 0 0,0 150,150\"/>\n    <path d=\"M100,200 A150,0 0 0,0 150,150\"/>\n    <path d=\"M100,200 c-2.5 10.5-4 21-4 32 0 64 63.5 128 127.5 128s32.5 0 96.5 0 128-64 128-128-64-128-128-128\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M100 200h300\"/>\n    <path d=\"M100 200h300\"/>\n    <path d=\"M100 200h150s50 100 150 10\"/>\n    <path d=\"m100 200 150 50h250\"/>\n    <path d=\"M100 200h200\"/>\n    <path d=\"M100 200h700\"/>\n    <path d=\"M100 200h500q200 0 200 100\"/>\n    <path d=\"M100 200q100 0 100 100t0 200 100 0\"/>\n    <path d=\"M100 200h700l100 100\"/>\n    <path d=\"m100 200 700 100\"/>\n    <path d=\"m100 200 50-50\"/>\n    <path d=\"m100 200 50-50\"/>\n    <path d=\"M100 200c-2.5 10.5-4 21-4 32 0 64 63.5 128 127.5 128H320c64 0 128-64 128-128s-64-128-128-128\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.09.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M100,200 C100,100 450,100 250,200 C50,300 400,300 400,200\"/>\n    <path d=\"M100,200 S250,100 250,200 C250,300 300,250 400,200\"/>\n    <path d=\"M100,200 C100,200 250,100 250,200\"/>\n    <path d=\"M200,300 Q400,50 600,300 Q 800,550 1000,300\"/>\n    <path d=\"M200,300 Q400,50 600,300 T1000,300 Q1200,50 1400,300\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M100 200c0-100 350-100 150 0s150 100 150 0\"/>\n    <path d=\"M100 200s150-100 150 0 50 50 150 0\"/>\n    <path d=\"M100 200s150-100 150 0\"/>\n    <path d=\"M200 300q200-250 400 0t400 0\"/>\n    <path d=\"M200 300q200-250 400 0t400 0 400 0\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.10.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"m100,200 300,400 z m100,200 L 300,400\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"m100 200 300 400zm100 200h100\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.11.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path transform=\"translate(100,0)\" d=\"M0,0 V100 L 70,50 z M70,50 L140,0 V100 z\"/>\n    <path transform=\"\" d=\"M0,0 V100 L 70,50 z M70,50 L140,0 V100 z\"/>\n    <path fill=\"red\" transform=\"rotate(15) scale(.5) skewX(5) translate(200,100)\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n    <path fill=\"red\" stroke=\"red\" transform=\"rotate(15) scale(.5) skewX(5) translate(200,100)\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n    <path fill=\"red\" stroke=\"red\" transform=\"rotate(15) scale(.5) skewX(5) translate(200,100)\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 a150,150 0 1,0 150,-150 z\"/>\n    <path fill=\"red\" stroke=\"red\" transform=\"rotate(15) scale(.5) translate(200,100)\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n    <path fill=\"red\" stroke=\"red\" transform=\"rotate(15) scale(1.5) translate(200,100)\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n    <path fill=\"red\" stroke=\"red\" transform=\"rotate(15) scale(0.33) translate(200,100)\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n    <g stroke=\"red\">\n        <path fill=\"red\" transform=\"rotate(15) scale(.5) translate(200,100)\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n    </g>\n    <g stroke=\"red\" stroke-width=\"2\">\n        <path fill=\"red\" transform=\"rotate(15) scale(.5) translate(200,100)\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n    </g>\n    <path transform=\"scale(10)\" id=\"a\" d=\"M0,0 V100 L 70,50 z M70,50 L140,0 V100 z\"/>\n    <path transform=\"scale(10)\" id=\"a\" d=\"M0,0 V100 L 70,50 z M70,50 L140,0 V100 z\" stroke=\"#000\"/>\n    <path transform=\"scale(10)\" id=\"a\" d=\"M0,0 V100 L 70,50 z M70,50 L140,0 V100 z\" stroke=\"#000\" stroke-width=\".5\"/>\n    <g stroke=\"#000\" stroke-width=\"5\">\n        <path transform=\"scale(10)\" id=\"a\" d=\"M0,0 V100 L 70,50 z M70,50 L140,0 V100 z\"/>\n    </g>\n    <path fill=\"url(#gradient)\" transform=\"rotate(15) scale(0.33) translate(200,100)\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n    <path clip-path=\"url(#a)\" transform=\"rotate(15) scale(0.33) translate(200,100)\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n    <path d=\"M5 0a10 10 0 1 0 20 0\" transform=\"matrix(1 0 0 1 5 0)\"/>\n    <path d=\"M5 0a10 10 0 1 0 20 0\" transform=\"rotate(15) scale(.8,1.2) \"/>\n    <path d=\"M5 0a10 10 0 1 0 20 0\" transform=\"rotate(45)\"/>\n    <path d=\"M5 0a10 10 0 1 0 20 0\" transform=\"skewX(45)\"/>\n    <path d=\"M0 300a1 2 0 1 0 200 0a1 2 0 1 0 -200 0\" transform=\"rotate(15 100 300) scale(.8 1.2)\"/>\n    <path d=\"M700 300a1 2 0 1 0 200 0a1 2 0 1 0 -200 0\" transform=\"rotate(-75 700 300) scale(.8 1.2)\"/>\n    <path d=\"M12.6 8.6l-3.1-3.2-3.1 3.2-.8-.7 3.9-3.9 3.9 3.9zM9 5h1v10h-1z\" transform=\"rotate(-90 9.5 9.5)\"/>\n    <path d=\"M637.43 482.753a43.516 94.083 0 1 1-87.033 0 43.516 94.083 0 1 1 87.032 0z\" transform=\"matrix(1.081 .234 -.187 .993 -37.573 -235.766)\"/>\n    <path d=\"m-1.26-1.4a6.53 1.8-15.2 1 1 12.55-3.44\" transform=\"translate(0, 0)\"/>\n    <path d=\"M0 0c.07 1.33.14 2.66.21 3.99.07 1.33.14 2.66.21 3.99\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M100 0v100l70-50zm70 50 70-50v100z\"/>\n    <path transform=\"\" d=\"M0 0v100l70-50zm70 50 70-50v100z\"/>\n    <path fill=\"red\" d=\"m118.742 187.108 79.162 124.74-96.593-25.883 8.716-49.428c17.43-98.857 89.875-79.446 81.16-30.017s63.728 68.84 72.444 19.411q13.073-74.143 87.877 75.31t193.185 51.764z\"/>\n    <path fill=\"red\" stroke=\"red\" transform=\"rotate(15) scale(.5) skewX(5) translate(200,100)\" d=\"m100 200 200 200H100V300c0-200 150-200 150-100s150 100 150 0q0-150 200 100t400 0z\"/>\n    <path fill=\"red\" stroke=\"red\" transform=\"rotate(15) scale(.5) skewX(5) translate(200,100)\" d=\"m100 200 200 200H100V300c0-200 150-200 150-100s150 100 150 0q0-150 200 100t400 0a150 150 0 1 0 150-150z\"/>\n    <path fill=\"red\" stroke=\"red\" d=\"m106.066 183.712 70.71 122.474-96.592-25.882 12.941-48.296c25.882-96.593 98.326-77.181 85.385-28.885s59.504 67.708 72.445 19.412q19.411-72.445 83.652 74.178t193.185 51.764z\" stroke-width=\".5\"/>\n    <path fill=\"red\" stroke=\"red\" d=\"M318.198 551.135 530.33 918.56l-289.778-77.646 38.823-144.889c77.646-289.778 294.98-231.543 256.156-86.655s178.51 203.124 217.334 58.235q58.234-217.334 250.955 222.534t579.555 155.292z\" stroke-width=\"1.5\"/>\n    <path fill=\"red\" stroke=\"red\" d=\"m70.004 121.25 46.669 80.833L52.922 185l8.54-31.876c17.083-63.75 64.896-50.94 56.355-19.064s39.272 44.687 47.813 12.812q12.812-47.814 55.21 48.957t127.503 34.165z\" stroke-width=\".33\"/>\n    <g stroke=\"red\">\n        <path fill=\"red\" d=\"m106.066 183.712 70.71 122.474-96.592-25.882 12.941-48.296c25.882-96.593 98.326-77.181 85.385-28.885s59.504 67.708 72.445 19.412q19.411-72.445 83.652 74.178t193.185 51.764z\" stroke-width=\".5\"/>\n    </g>\n    <g stroke=\"red\" stroke-width=\"2\">\n        <path fill=\"red\" d=\"m106.066 183.712 70.71 122.474-96.592-25.882 12.941-48.296c25.882-96.593 98.326-77.181 85.385-28.885s59.504 67.708 72.445 19.412q19.411-72.445 83.652 74.178t193.185 51.764z\" stroke-width=\"1\"/>\n    </g>\n    <path transform=\"scale(10)\" id=\"a\" d=\"M0 0v100l70-50zm70 50 70-50v100z\"/>\n    <path transform=\"scale(10)\" id=\"a\" d=\"M0 0v100l70-50zm70 50 70-50v100z\" stroke=\"#000\"/>\n    <path transform=\"scale(10)\" id=\"a\" d=\"M0 0v100l70-50zm70 50 70-50v100z\" stroke=\"#000\" stroke-width=\".5\"/>\n    <g stroke=\"#000\" stroke-width=\"5\">\n        <path transform=\"scale(10)\" id=\"a\" d=\"M0 0v100l70-50zm70 50 70-50v100z\"/>\n    </g>\n    <path fill=\"url(#gradient)\" transform=\"rotate(15) scale(0.33) translate(200,100)\" d=\"m100 200 200 200H100V300c0-200 150-200 150-100s150 100 150 0q0-150 200 100t400 0z\"/>\n    <path clip-path=\"url(#a)\" transform=\"rotate(15) scale(0.33) translate(200,100)\" d=\"m100 200 200 200H100V300c0-200 150-200 150-100s150 100 150 0q0-150 200 100t400 0z\"/>\n    <path d=\"M10 0a10 10 0 1 0 20 0\"/>\n    <path d=\"M3.864 1.035a8 12 15 1 0 15.455 4.141\"/>\n    <path d=\"M3.536 3.536a10 10 0 1 0 14.142 14.142\"/>\n    <path d=\"M5 0a16.18 6.18 31.717 1 0 20 0\"/>\n    <path d=\"M-12.122 332.074a80 240 15 1 0 154.548 41.41 80 240 15 1 0-154.548-41.41\"/>\n    <path d=\"M721.72 450.759a240 80 15 1 0 41.412-154.548 240 80 15 1 0-41.411 154.548\"/>\n    <path d=\"M8.6 6.4 5.4 9.5l3.2 3.1-.7.8L4 9.5l3.9-3.9zM5 10V9h10v1z\"/>\n    <path d=\"M561.214 392.766a48.107 95.08 10.132 1 1-94.083-20.365 48.107 95.079 10.132 1 1 94.082 20.365z\"/>\n    <path d=\"M-1.26-1.4a6.53 1.8-15.2 1 1 12.55-3.44\"/>\n    <path d=\"m0 0 .21 3.99.21 3.99\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.12.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M10 50h30h-30\"/>\n    <path d=\"M10 50h-30h30\"/>\n    <path d=\"M10 50h-30h-50\"/>\n    <path d=\"M10 50h30h50\"/>\n    <path d=\"M10 50v30v-30\"/>\n    <path d=\"M10 50v-30v30\"/>\n    <path d=\"M10 50v-30v-50\"/>\n    <path d=\"M10 50v30v50\"/>\n    <path d=\"M10 50L10 80L10 0\"/>\n    <path d=\"M10 50L10 10L10 80\"/>\n    <path d=\"M10 50l10 10l20 20l10 10\"/>\n    <path d=\"M10 50L80 50L0 50\"/>\n    <path d=\"M10 50L0 50L80 50\"/>\n    <path d=\"M10 50L0 50M80 50M30 10L10 80\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M10 50h30z\"/>\n    <path d=\"M10 50h-30z\"/>\n    <path d=\"M10 50h-80\"/>\n    <path d=\"M10 50h80\"/>\n    <path d=\"M10 50v30z\"/>\n    <path d=\"M10 50V20z\"/>\n    <path d=\"M10 50v-80\"/>\n    <path d=\"M10 50v80\"/>\n    <path d=\"M10 50v30V0\"/>\n    <path d=\"M10 50V10v70\"/>\n    <path d=\"m10 50 10 10 20 20 10 10\"/>\n    <path d=\"M10 50h70H0\"/>\n    <path d=\"M10 50H0h80\"/>\n    <path d=\"M10 50H0m30-40L10 80\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.13.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M213 543q0 -41 20 -66.5q20 -25.5 50 -45.5l49 228q-54 -4 -86.5 -34q-32.5 -30 -32.5 -82zt0 0zM371 48z\" />\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M213 543q0-41 20-66.5t50-45.5l49 228q-54-4-86.5-34T213 543M371 48\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.14.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M0 0L0 0c2.761 0 5 2.239 5 5\"/>\n    <path d=\"M0 0L0 0c2.761 0 5 2.239 5 5l5-5\"/>\n    <path d=\"M15 10c-2.761 0-5-2.239-5-5s2.239-5 5-5s5 2.239 5 5l-5 5\"/>\n    <path d=\"M41.008 0.102c1.891 0.387 3.393 1.841 3.849 3.705\"/>\n    <path d=\"M7.234 19.474C6.562 19.811 5.803 20 5 20c-2.761 0-5-2.239-5-5 0-1.767 0.917-3.32 2.301-4.209\"/>\n    <path d=\"M60 0c-2.761 0-5 2.239-5 5s2.239 5 5 5s5-2.239 5-5S62.761 0 60 0z\"/>\n    <path d=\"M15 23.54 c-2.017,0 -3.87,-.7 -5.33,-1.87 -.032,-.023 -.068,-.052 -.11,-.087 .042,.035 .078,.064 .11,.087 .048,.04 .08,.063 .08,.063 \"/>\n    <path d=\"M-9.5,82.311c-2.657,0-4.81-2.152-4.81-4.811c0-2.656,2.153-4.811,4.81-4.811S-4.69,74.844-4.69,77.5 C-4.69,80.158-6.843,82.311-9.5,82.311z\"/>\n    <path d=\"M1.5,13.4561 C1.5,15.3411 3.033,16.8751 4.918,16.8751 C6.478,16.8751 7.84,15.8201 8.229,14.3101 Z\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M0 0a5 5 0 0 1 5 5\"/>\n    <path d=\"M0 0a5 5 0 0 1 5 5l5-5\"/>\n    <path d=\"M15 10a5 5 0 1 1 5-5z\"/>\n    <path d=\"M41.008.102a5.01 5.01 0 0 1 3.849 3.705\"/>\n    <path d=\"M7.234 19.474a5 5 0 0 1-4.933-8.683\"/>\n    <path d=\"M60 0a5 5 0 1 0 .001 10.001A5 5 0 0 0 60 0\"/>\n    <path d=\"M15 23.54a8.5 8.5 0 0 1-5.25-1.807\"/>\n    <path d=\"M-9.5 82.311a4.81 4.81 0 1 1 .002-9.622A4.81 4.81 0 0 1-9.5 82.31\"/>\n    <path d=\"M1.5 13.456a3.418 3.418 0 0 0 6.729.854Z\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.15.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M.49 8.8c-.3-.75-.44-1.55-.44-2.35 0-3.54 2.88-6.43 6.43-6.43 3.53 0 6.42 2.88 6.42 6.43 0 .8-.15 1.6-.43 2.35\"/>\n    <path d=\"M13.4 6.62c0-2.5-1.98-4.57-4.4-4.57S4.6 4.1 4.6 6.62\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M.49 8.8A6.44 6.44 0 0 1 6.48.02a6.44 6.44 0 0 1 5.99 8.78\"/>\n    <path d=\"M13.4 6.62c0-2.5-1.98-4.57-4.4-4.57S4.6 4.1 4.6 6.62\"/>\n</svg>\n\n@@@\n\n{ \"floatPrecision\": 2 }\n"
  },
  {
    "path": "test/plugins/convertPathData.16.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M.49 8.8c-.3-.75-.44-1.55-.44-2.35 0-3.54 2.88-6.43 6.43-6.43 3.53 0 6.42 2.88 6.42 6.43 0 .8-.15 1.6-.43 2.35\"/>\n    <path d=\"M13.4 6.62c0-2.5-1.98-4.57-4.4-4.57S4.6 4.1 4.6 6.62\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M0 9V6a6 6 0 1 1 12 3\"/>\n    <path d=\"M13 7q0-5-4-5-5 0-4 5\"/>\n</svg>\n\n@@@\n\n{ \"floatPrecision\": 0 }\n"
  },
  {
    "path": "test/plugins/convertPathData.17.svg.txt",
    "content": "<svg width=\"100\" height=\"100\" viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <path d=\"M33.027833,1.96545901 C33.097408,2.03503401 38.0413624,6.97898843 38.0413624,6.97898842 C38.0413625,6.97898834 38.0094318,4.0346712 38.0094318,4.0346712 L34,0.0252395624 L34,0 L13,0 L13,2 L33.062374,2 Z\"></path>\n</svg>\n\n@@@\n\n<svg width=\"100\" height=\"100\" viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <path d=\"m33.027833 1.96545901 5.0135294 5.01352941c1e-7-8e-8-.0319306-2.94431722-.0319306-2.94431722L34 .02523956V0H13v2h20.062374Z\"/>\n</svg>\n\n@@@\n\n{ \"floatPrecision\": 8 }\n"
  },
  {
    "path": "test/plugins/convertPathData.18.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 36 36\">\n    <path d=\"M32 4a4 4 0 0 0-4-4H8a4 4 0 0 1-4 4v28a4 4 0 0 1 4 4h20a4 4 0 0 0 4-4V4z\" fill=\"#888\" transform=\"matrix(1 0 0 -1 0 36)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 36 36\">\n    <path d=\"M32 32a4 4 0 0 1-4 4H8a4 4 0 0 0-4-4V4a4 4 0 0 0 4-4h20a4 4 0 0 1 4 4z\" fill=\"#888\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.19.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 500 500\">\n    <path transform=\"translate(250, 250) scale(1.5, 1.5) translate(-250, -250)\" fill=\"#7ED321\" stroke=\"#000\" stroke-width=\"15\" vector-effect=\"non-scaling-stroke\" d=\"M125 125h250v250h-250v-250z\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 500 500\">\n    <path fill=\"#7ED321\" stroke=\"#000\" stroke-width=\"15\" vector-effect=\"non-scaling-stroke\" d=\"M62.5 62.5h375v375h-375z\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.20.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 36 36\">\n    <path d=\"M32 4a4 4 0 00-4-4H8a4 4 0 01-4 4v28a4 4 0 014 4h20a4 4 0 004-4V4z\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 36 36\">\n    <path d=\"M32 4a4 4 0 0 0-4-4H8a4 4 0 0 1-4 4v28a4 4 0 0 1 4 4h20a4 4 0 0 0 4-4z\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.21.svg.txt",
    "content": "<svg viewBox=\"0 0 1200 400\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M300 200 h-150 a150 150 0 1 0 150 -150 z\" fill=\"red\" stroke=\"blue\" stroke-width=\"5\" />\n</svg>\n\n@@@\n\n<svg viewBox=\"0 0 1200 400\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M300 200H150A150 150 0 1 0 300 50z\" fill=\"red\" stroke=\"blue\" stroke-width=\"5\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.22.svg.txt",
    "content": "<svg width=\"480\" height=\"360\" xmlns=\"http://www.w3.org/2000/svg\">\n  <path transform=\"scale(1.8)\" stroke=\"black\" stroke-width=\"10\" fill=\"none\" stroke-dasharray=\"none\" d=\"   M  20 20   L  200 20\"/>\n  <path transform=\"scale(1.8)\" stroke=\"black\" stroke-width=\"10\" fill=\"none\" stroke-dasharray=\"0\" d=\"   M  20 40   L  200 40\"/>\n  <path transform=\"scale(1.8)\" stroke=\"black\" stroke-width=\"20\" fill=\"none\" stroke-dasharray=\"5,2,5,5,2,5\" d=\"   M  20 60   L  200 60\"/>\n  <path transform=\"scale(1.8)\" stroke=\"blue\" stroke-width=\"10\" fill=\"none\" stroke-dasharray=\"5,2,5\" d=\"   M  20 60   L  200 60\"/>\n  <path transform=\"scale(1.8)\" stroke=\"black\" stroke-width=\"10\" fill=\"none\" stroke-dasharray=\"2\" d=\"   M  20 80   L  200 80\"/>\n  <path transform=\"scale(1.8)\" stroke=\"blue\" stroke-width=\"10\" fill=\"none\" stroke-dasharray=\"2\" stroke-dashoffset=\"2\" d=\"         M  20 90   L  200 90\"/>\n</svg>\n\n@@@\n\n<svg width=\"480\" height=\"360\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path stroke=\"black\" stroke-width=\"18\" fill=\"none\" stroke-dasharray=\"none\" d=\"M36 36h324\"/>\n    <path stroke=\"black\" stroke-width=\"18\" fill=\"none\" stroke-dasharray=\"0\" d=\"M36 72h324\"/>\n    <path stroke=\"black\" stroke-width=\"36\" fill=\"none\" stroke-dasharray=\"9,3.6,9,9,3.6,9\" d=\"M36 108h324\"/>\n    <path stroke=\"blue\" stroke-width=\"18\" fill=\"none\" stroke-dasharray=\"9,3.6,9\" d=\"M36 108h324\"/>\n    <path stroke=\"black\" stroke-width=\"18\" fill=\"none\" stroke-dasharray=\"3.6\" d=\"M36 144h324\"/>\n    <path stroke=\"blue\" stroke-width=\"18\" fill=\"none\" stroke-dasharray=\"3.6\" stroke-dashoffset=\"3.6\" d=\"M36 162h324\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.23.svg.txt",
    "content": "<svg width=\"200\" height=\"100\">\n  <path transform=\"scale(2)\" style=\"stroke:black;stroke-width:10;\" d=\"M 20 20 H 80\" />\n  <path transform=\"scale(2)\" stroke=\"black\" stroke-width=\"10\" d=\"M 20 20 H 80\" />\n</svg>\n\n@@@\n\n<svg width=\"200\" height=\"100\">\n    <path transform=\"scale(2)\" style=\"stroke:black;stroke-width:10;\" d=\"M20 20h60\"/>\n    <path stroke=\"black\" stroke-width=\"20\" d=\"M40 40h120\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.24.svg.txt",
    "content": "Apply transforms\n\n- both absolute and relative arcs should be transformed correctly\n\n===\n\n<svg width=\"1200\" height=\"1200\">\n  <path transform=\"translate(100) scale(2)\" d=\"m200 200 h-100 a100 100 0 1 0 100 -100 z\"/>\n  <path transform=\"translate(100) scale(2)\" d=\"M400 200 H300 A100 100 0 1 0 400 100 z\"/>\n</svg>\n\n@@@\n\n<svg width=\"1200\" height=\"1200\">\n    <path d=\"M500 400H300a200 200 0 1 0 200-200z\"/>\n    <path d=\"M900 400H700a200 200 0 1 0 200-200z\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.25.svg.txt",
    "content": "Current cursor is reset by closepath command with the first moveto coords of segment\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 800 400\" fill=\"#E7DACB\">\n  <path\n    d=\"\n      M 152 65\n      V 158\n      H 49\n      V 65\n      z\n      m -14 75\n      V 83\n      H 67\n      V 141\n      z\n    \"\n    transform=\"translate(-24, -41)\"\n  />\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 800 400\" fill=\"#E7DACB\">\n    <path d=\"M128 24v93H25V24zm-14 75V42H43v58z\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.26.svg.txt",
    "content": "Applying transform to arc with zero radius should not produce NaNs\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 31.6 31.6\">\n  <path d=\"m5.25,2.2H25.13a0,0,0,0,1-.05-.05V14.18Z\" transform=\"translate(0 0)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 31.6 31.6\">\n    <path d=\"M5.25 2.2h19.88l-.05-.05v12.03Z\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.27.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 32\">\n  <path d=\"M 6 12 v -6 h 6 a 3 3 0 0 1 -6 6 z\" />\n  <path d=\"M 18 12 v -6 h 6 a 3 3 0 0 1 -6 6 z\" stroke=\"#f00\" stroke-width=\"4\" />\n  <path d=\"M 30 12 v -6 h 6 a 3 3 0 0 1 -6 6 z\" stroke=\"#f00\" stroke-width=\"4\" stroke-linejoin=\"round\" stroke-linecap=\"round\" />\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 32\">\n    <path d=\"M6 12V6h6a3 3 0 0 1-6 6\"/>\n    <path d=\"M18 12V6h6a3 3 0 0 1-6 6z\" stroke=\"#f00\" stroke-width=\"4\"/>\n    <path d=\"M30 12V6h6a3 3 0 0 1-6 6\" stroke=\"#f00\" stroke-width=\"4\" stroke-linejoin=\"round\" stroke-linecap=\"round\"/>\n</svg>"
  },
  {
    "path": "test/plugins/convertPathData.28.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\">\n    <path d=\"M6 32.845 6 14.766 6 32.845\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\">\n    <path d=\"M6 32.845V14.766z\"/>\n</svg>"
  },
  {
    "path": "test/plugins/convertPathData.29.svg.txt",
    "content": "Should merge M and m, even when Z command is used between.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n  <path d=\"M1 1m1 1\"/>\n  <path fill=\"black\" d=\"M8.5 12Zm0 8q3.35 0 5.675-2.325\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n    <path d=\"M2 2\"/>\n    <path fill=\"black\" d=\"M8.5 20q3.35 0 5.675-2.325\"/>\n</svg>"
  },
  {
    "path": "test/plugins/convertPathData.30.svg.txt",
    "content": "Should use relative instead of absolute here. (Checking for proper rounding of relative data)\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\">\n    <path d=\"M 6 6 h 0.1 h 0.2\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\">\n    <path d=\"M6 6h.3\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.31.svg.txt",
    "content": "Should have no commands here. (Checking for removing useless before trying to convert to z)\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\">\n    <path d=\"M 6 6 h 0.0005\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\">\n    <path d=\"M6 6\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.32.svg.txt",
    "content": "Should convert arc to line\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\">\n    <path d=\"m 1 1 a 10000 10000 0 0 0 8 0\" stroke=\"black\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\">\n    <path d=\"M1 1h8\" stroke=\"black\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.33.svg.txt",
    "content": "Should round radius considering the sagitta\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\">\n    <path d=\"m 1 1 a 10.567 10.567 0 0 0 1 0\" stroke=\"black\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\">\n    <path d=\"M1 1a11 11 0 0 0 1 0\" stroke=\"black\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.34.svg.txt",
    "content": "Shouldn't incorrectly convert q to t. Should convert q to t when feasible.\n\n===\n\n<svg viewBox=\"0 0 20 20\">\n    <path d=\"M0 0q2 0 5 5t5 5q5 0 5 5\"/>\n    <path d=\"M0 0q2 0 5 5t5 5q2 0 5-2\"/>\n</svg>\n\n@@@\n\n\n<svg viewBox=\"0 0 20 20\">\n    <path d=\"M0 0q2 0 5 5t5 5q5 0 5 5\"/>\n    <path d=\"M0 0q2 0 5 5t5 5 5-2\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.35.svg.txt",
    "content": "Should convert C to Q\n\n===\n\n<svg>\n    <path d=\"m 0 12 C 4 4 8 4 12 12\"/>\n</svg>\n\n@@@\n\n<svg>\n    <path d=\"M0 12q6-12 12 0\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.36.svg.txt",
    "content": "Should process/optimize q correctly even if useless commands in between.\n\nSee: https://github.com/svg/svgo/issues/1926\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1 20\">\n  <path d=\"M-6.3 9.9q.7-4.5.2-5-.5-.5-1.5-.5l0 0q-.4 0-2 .3\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1 20\">\n    <path d=\"M-6.3 9.9q.7-4.5.2-5t-1.5-.5q-.4 0-2 .3\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.37.svg.txt",
    "content": "Must preserve vertex for markers only path for consistent rendering across clients.\nMust not add vertices if markers only path did not have commands other than M/m anyway.\n\nSee: https://github.com/svg/svgo/issues/1493\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 9 9\">\n    <marker id=\"a\" stroke=\"red\" viewBox=\"0 0 5 5\">\n        <circle cx=\"2\" cy=\"2\" r=\"1\"/>\n    </marker>\n    <marker id=\"b\" stroke=\"green\" viewBox=\"0 0 5 5\">\n        <circle cx=\"2\" cy=\"2\" r=\"0.5\"/>\n    </marker>\n    <path marker-start=\"url(#a)\" d=\"M5 5h0\"/>\n    <path marker-start=\"url(#b)\" d=\"M5 5\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 9 9\">\n    <marker id=\"a\" stroke=\"red\" viewBox=\"0 0 5 5\">\n        <circle cx=\"2\" cy=\"2\" r=\"1\"/>\n    </marker>\n    <marker id=\"b\" stroke=\"green\" viewBox=\"0 0 5 5\">\n        <circle cx=\"2\" cy=\"2\" r=\"0.5\"/>\n    </marker>\n    <path marker-start=\"url(#a)\" d=\"M5 5z\"/>\n    <path marker-start=\"url(#b)\" d=\"M5 5\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.38.svg.txt",
    "content": "Should not break dots.\n\nSee: https://github.com/svg/svgo/issues/2163\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n    <path d=\"M10 10z\" stroke=\"#00f\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n    <path d=\"M10 10z\" stroke=\"#00f\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.39.svg.txt",
    "content": "Should drop truely useless commands even when a linecap is present.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n    <path d=\"M 10 50 h 10 v 0\" stroke=\"#00f\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n    <path d=\"M10 50h10\" stroke=\"#00f\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertPathData.40.svg.txt",
    "content": "Should convert t commands to l when previous command is not quadratic.\nShould convert t->t sequences to l->q properly.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <path d=\"M10 10t20 0t20 20\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <path d=\"M10 10h20q20 0 20 20\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertShapeToPath.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <rect width=\"100%\"/>\n    <rect width=\"100%\" height=\"100%\"/>\n    <rect x=\"25%\" y=\"25%\" width=\"50%\" height=\"50%\"/>\n    <rect x=\"25pt\" y=\"25pt\" width=\"50pt\" height=\"50pt\"/>\n    <rect x=\"10\" y=\"10\" width=\"50\" height=\"50\" rx=\"4\"/>\n    <rect x=\"0\" y=\"0\" width=\"20\" height=\"20\" ry=\"5\"/>\n    <rect width=\"32\" height=\"32\"/>\n    <rect x=\"20\" y=\"10\" width=\"50\" height=\"40\"/>\n    <rect fill=\"#666\" x=\"10\" y=\"10\" width=\"10\" height=\"10\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <rect width=\"100%\"/>\n    <rect width=\"100%\" height=\"100%\"/>\n    <rect x=\"25%\" y=\"25%\" width=\"50%\" height=\"50%\"/>\n    <rect x=\"25pt\" y=\"25pt\" width=\"50pt\" height=\"50pt\"/>\n    <rect x=\"10\" y=\"10\" width=\"50\" height=\"50\" rx=\"4\"/>\n    <rect x=\"0\" y=\"0\" width=\"20\" height=\"20\" ry=\"5\"/>\n    <path d=\"M0 0H32V32H0z\"/>\n    <path d=\"M20 10H70V50H20z\"/>\n    <path fill=\"#666\" d=\"M10 10H20V20H10z\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertShapeToPath.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <line x2=\"100%\" y2=\"100%\"/>\n    <line x1=\"24\" y2=\"24\"/>\n    <line x1=\"10\" y1=\"10\" x2=\"50\" y2=\"20\"/>\n    <line stroke=\"#000\" x1=\"10\" y1=\"10\" x2=\"50\" y2=\"20\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <line x2=\"100%\" y2=\"100%\"/>\n    <path d=\"M24 0 0 24\"/>\n    <path d=\"M10 10 50 20\"/>\n    <path stroke=\"#000\" d=\"M10 10 50 20\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertShapeToPath.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <polyline points=\"10,10 20\"/>\n    <polyline points=\"10,80 20,50 50,20 80,10\"/>\n    <polyline points=\"20 ,10  50    40 30.5-1e-1 , 20 10\"/>\n    <polyline stroke=\"#000\" points=\"10,10 20,20 10,20\"/>\n    <polygon points=\"10,10 20\"/>\n    <polygon points=\"10,80 20,50 50,20 80,10\"/>\n    <polygon points=\"20 10  50 40 30,20\"/>\n    <polygon stroke=\"#000\" points=\"10,10 20,20 10,20\"/>\n    <polygon stroke=\"none\" points=\"10,10 20,20 10,20\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M10 80 20 50 50 20 80 10\"/>\n    <path d=\"M20 10 50 40 30.5-.1 20 10\"/>\n    <path stroke=\"#000\" d=\"M10 10 20 20 10 20\"/>\n    <path d=\"M10 80 20 50 50 20 80 10z\"/>\n    <path d=\"M20 10 50 40 30 20z\"/>\n    <path stroke=\"#000\" d=\"M10 10 20 20 10 20z\"/>\n    <path stroke=\"none\" d=\"M10 10 20 20 10 20z\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertShapeToPath.04.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <circle cx=\"10\" cy=\"10\" r=\"5\"/>\n    <ellipse cx=\"10\" cy=\"10\" rx=\"5\" ry=\"5\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M10 5A5 5 0 1 0 10 15 5 5 0 1 0 10 5z\"/>\n    <path d=\"M10 5A5 5 0 1 0 10 15 5 5 0 1 0 10 5z\"/>\n</svg>\n\n@@@\n\n{ \"convertArcs\": true }\n"
  },
  {
    "path": "test/plugins/convertShapeToPath.05.svg.txt",
    "content": "Precision should be applied to all converted shapes\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"65mm\" height=\"45mm\" viewBox=\"0 0 65 45\">\n  <rect x=\"26.614\" y=\"29.232\" width=\"34.268\" height=\"8.1757\"/>\n  <line x1=\"26.6142\" y1=\"29.2322\" x2=\"34.2682\" y2=\"8.1757\"/>\n  <polyline points=\"26.6142,29.2322 34.2682,8.1757\"/>\n  <polygon points=\"26.6142,29.2322 34.2682,8.1757\"/>\n  <circle cx=\"26.6142\" cy=\"29.2322\" r=\"34.2682\"/>\n  <ellipse cx=\"26.6142\" cy=\"29.2322\" rx=\"34.2682\" ry=\"8.1757\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"65mm\" height=\"45mm\" viewBox=\"0 0 65 45\">\n    <path d=\"M26.614 29.232H60.882V37.408H26.614z\"/>\n    <path d=\"M26.614 29.232 34.268 8.176\"/>\n    <path d=\"M26.614 29.232 34.268 8.176\"/>\n    <path d=\"M26.614 29.232 34.268 8.176z\"/>\n    <path d=\"M26.614-5.036A34.268 34.268 0 1 0 26.614 63.5 34.268 34.268 0 1 0 26.614-5.036z\"/>\n    <path d=\"M26.614 21.057A34.268 8.176 0 1 0 26.614 37.408 34.268 8.176 0 1 0 26.614 21.057z\"/>\n</svg>\n\n@@@\n\n{ \"floatPrecision\": 3, \"convertArcs\": true }\n"
  },
  {
    "path": "test/plugins/convertStyleToAttrs.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g style=\"fill:#000;\"/>\n    <g style=\"font-family:'Helvetica Neue'\"/>\n    <g style=\"    fill:#000; color: #fff  ;  \"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g fill=\"#000\"/>\n    <g font-family=\"Helvetica Neue\"/>\n    <g fill=\"#000\" color=\"#fff\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertStyleToAttrs.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g style=\"    fill:#000; c\\olor: #fff; /**/illegal-'declaration/*'; -webkit-blah: 123  ; -webkit-trolo: 'lolo'; illegal2*/\"/>\n    <g style=\"font:15px serif\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g style=\"-webkit-blah:123;-webkit-trolo:'lolo'\" fill=\"#000\" color=\"#fff\"/>\n    <g style=\"font:15px serif\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertStyleToAttrs.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g style=\"background/*-image*/:url(data:image/png;base64,iVBORw...)\"/>\n    <g style=\"fill:url(data:image/png;base64,iVBORw...)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g style=\"background:url(data:image/png;base64,iVBORw...)\"/>\n    <g fill=\"url(data:image/png;base64,iVBORw...)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertStyleToAttrs.04.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" class=\"blue red\" style=\"fill:red!important\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" class=\"blue red\" fill=\"red\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertStyleToAttrs.05.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" class=\"blue red\" style=\"fill:red!important\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" class=\"blue red\" style=\"fill:red!important\"/>\n</svg>\n\n@@@\n\n{ \"keepImportant\": true }\n"
  },
  {
    "path": "test/plugins/convertTransform.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"300\" height=\"300\">\n    <rect width=\"10\" height=\"20\" transform=\"matrix(0.707 -0.707 0.707 0.707 255.03 111.21)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"matrix(1 0 0 1 50 90),matrix(0.707 -0.707 0.707 0.707 0 0) ,matrix(1 0 0 1 130 160)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"translate(50 90) , rotate(-45)   translate(130 160)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"matrix(0.707 -0.707 0.707 0.707 255.03 111.21) scale(2)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"matrix(0.707 -0.707 0.707 0.707 255.03 111.21) skewX(45)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"matrix( 0.707 -0.707 0.707 0.707 255.03 111.21 ) skewY( 45 )\"/>\n    <rect width=\"10\" height=\"20\" transform=\"matrix(1 0 1 1 0 0)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"matrix(1.25,0,0,-1.25,0,56.26) scale(1,-1)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"matrix(1.25,0,0,-1.25,0,56.26) matrix(0.1325312,0,0,-0.1325312,-31.207631,89.011662)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"matrix(1 0 0 -1 0 0)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"matrix(-1 0 0 1 0 0)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"matrix(0 1-1 0 0 0)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"matrix(0-1 1 0 0 0)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"matrix(0.707 -0.707 -0.707 -0.707 0 0)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"matrix(-0.707 0.707 0.707 0.707 0 0)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"matrix(-0.707 0.707 -0.707 -0.707 0 0)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"matrix(0.707 0.707 -0.707 0.707 0 0)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"matrix(.647 -.647 -.6443 -.6443 0 0)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"300\" height=\"300\">\n    <rect width=\"10\" height=\"20\" transform=\"rotate(-45 261.757 -252.243)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"rotate(-45 261.757 -252.243)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"rotate(-45 261.777 -252.28)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"rotate(-45 261.757 -252.243)scale(2)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"rotate(-45 261.757 -252.243)skewX(45)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"rotate(-45 261.757 -252.243)skewY(45)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"skewX(45)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"translate(0 56.26)scale(1.25)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"translate(-39.01 -55.005)scale(.16566)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"scale(1 -1)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"scale(-1 1)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"rotate(90)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"rotate(-90)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"rotate(-45)scale(1 -1)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"rotate(135)scale(1 -1)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"rotate(135)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"rotate(45)\"/>\n    <rect width=\"10\" height=\"20\" transform=\"rotate(-45)scale(.915 -.9112)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertTransform.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g transform=\"translate(50 0) scale(2 2)\"/>\n    <g transform=\"translate(50) scale(2 2)\"/>\n    <g transform=\"translate(10 20) rotate(45) translate(-10-20)\"/>\n    <g transform=\"scale(2) translate(10 20) rotate(45) translate(-10-20)\"/>\n    <g transform=\"rotate(15) scale(2 1)\"/>\n    <g transform=\"scale(2 1) rotate(15)\"/>\n    <g transform=\"translate(10 20) rotate(45) translate(-10-20) scale(2)\"/>\n    <g transform=\"translate(15, 3) translate(13) rotate(47 39.885486 39.782373)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g transform=\"matrix(2 0 0 2 50 0)\"/>\n    <g transform=\"matrix(2 0 0 2 50 0)\"/>\n    <g transform=\"rotate(45 10 20)\"/>\n    <g transform=\"rotate(45 20 40)scale(2)\"/>\n    <g transform=\"rotate(15)scale(2 1)\"/>\n    <g transform=\"matrix(1.93185 .25882 -.51764 .96593 0 0)\"/>\n    <g transform=\"rotate(45 10 20)scale(2)\"/>\n    <g transform=\"rotate(47 50.436 73.48)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertTransform.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g transform=\"matrix(1 0 0 1 50 100)\"/>\n    <g transform=\"matrix(0.5 0 0 2 0 0)\"/>\n    <g transform=\"matrix(.707-.707.707.707 0 0)\"/>\n    <g transform=\"matrix(1 0 0.466 1 0 0)\"/>\n    <g transform=\"matrix(1 0.466 0 1 0 0)\"/>\n    <g transform=\"matrix(1 0 0 1 50 90) matrix(1 0 0 1 60 20) matrix(1 0 0 1 20 40)\"/>\n    <g transform=\"matrix(-0.10443115234375 0 0 -0.10443115234375 182.15 61.15)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g transform=\"translate(50 100)\"/>\n    <g transform=\"scale(.5 2)\"/>\n    <g transform=\"rotate(-45)\"/>\n    <g transform=\"skewX(24.99)\"/>\n    <g transform=\"skewY(24.99)\"/>\n    <g transform=\"translate(130 150)\"/>\n    <g transform=\"translate(182.15 61.15)scale(-.10443)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertTransform.04.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g transform=\"\"/>\n    <g transform=\"translate(0)\"/>\n    <g transform=\"translate(0 0)\"/>\n    <g transform=\"translate(0 50)\"/>\n    <g transform=\"scale(1)\"/>\n    <g transform=\"scale(1 2)\"/>\n    <g transform=\"rotate(0)\"/>\n    <g transform=\"rotate(0 100 100)\"/>\n    <g transform=\"skewX(0)\"/>\n    <g transform=\"skewY(0)\"/>\n    <g transform=\"translate(0,-100) translate(0,100)\"/>\n    <g transform=\"rotate(45, 34, 34\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n    <g/>\n    <g/>\n    <g transform=\"translate(0 50)\"/>\n    <g/>\n    <g transform=\"scale(1 2)\"/>\n    <g/>\n    <g/>\n    <g/>\n    <g/>\n    <g/>\n    <g/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertTransform.05.svg.txt",
    "content": "Correctly optimize transform with same sign non-zero shears and.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 128 128\">\n  <rect x=\"-45\" y=\"-77\" height=\"3\" width=\"8\" transform=\"matrix(0,-1,-1,0,0,0)\" />\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 128 128\">\n    <rect x=\"-45\" y=\"-77\" height=\"3\" width=\"8\" transform=\"rotate(90)scale(-1 1)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertTransform.06.svg.txt",
    "content": "Test matrices which are identities after rounding.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\">\n  <text y=\"32\" transform=\"matrix(1.0000002 0 0 1 0 0)\">uwu</text>\n  <text y=\"64\" transform=\"matrix(1 0 0 1 0.00002 0)\">uwu</text>\n  <text y=\"96\" transform=\"matrix(0.9999999847691 1.745329243133368e-4 -1.745329243133368e-4 0.9999999847691 0 0)\">uwu</text>\n  <text y=\"128\" transform=\"matrix(1.0000002 0 0 1 0.00002 0)\">uwu</text>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\">\n    <text y=\"32\">uwu</text>\n    <text y=\"64\">uwu</text>\n    <text y=\"96\">uwu</text>\n    <text y=\"128\">uwu</text>\n</svg>\n\n@@@\n\n{\"degPrecision\":1}"
  },
  {
    "path": "test/plugins/convertTransform.07.svg.txt",
    "content": "Test with skewX and sx != sy\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\">\n  <text x=\"-32\" y=\"32\" transform=\"matrix(-1,0,-0.3,0.9,0,0)\">uwu</text>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\">\n    <text x=\"-32\" y=\"32\" transform=\"scale(-1 .9)skewX(16.7)\">uwu</text>\n</svg>\n\n@@@\n\n{\"degPrecision\":3}"
  },
  {
    "path": "test/plugins/convertTransform.10.svg.txt",
    "content": "Make sure translate(n,n) and translate(n) work.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"500\" height=\"500\" viewBox=\"-100 -100 100 100\">\n    <rect x=\"0\" y=\"0\" width=\"10\" height=\"20\" transform=\"matrix(1,0,0,1,3,0)\"/>\n    <rect x=\"0\" y=\"0\" width=\"10\" height=\"20\" transform=\"matrix(1,0,0,1,3,3)\"/>\n</svg>\n\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"500\" height=\"500\" viewBox=\"-100 -100 100 100\">\n    <rect x=\"0\" y=\"0\" width=\"10\" height=\"20\" transform=\"translate(3)\"/>\n    <rect x=\"0\" y=\"0\" width=\"10\" height=\"20\" transform=\"translate(3 3)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertTransform.11.svg.txt",
    "content": "Test with 180 degree rotation, translation, and no scaling in matrix. Matrix not changed,\nsince it is shorter than translate(5,7)scale(-1).\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"500\" height=\"500\" viewBox=\"-100 -100 100 100\">\n    <rect x=\"0\" y=\"0\" width=\"10\" height=\"20\" transform=\"matrix(-1,0,0,-1,5,7)\"/>\n</svg>\n\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"500\" height=\"500\" viewBox=\"-100 -100 100 100\">\n    <rect x=\"0\" y=\"0\" width=\"10\" height=\"20\" transform=\"matrix(-1 0 0 -1 5 7)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertTransform.12.svg.txt",
    "content": "Test with 180 degree rotation and no scaling in matrix. \n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"500\" height=\"500\" viewBox=\"-100 -100 100 100\">\n    <rect x=\"0\" y=\"0\" width=\"10\" height=\"20\" transform=\"matrix(-1,0,0,-1,0 0)\"/>\n</svg>\n\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"500\" height=\"500\" viewBox=\"-100 -100 100 100\">\n    <rect x=\"0\" y=\"0\" width=\"10\" height=\"20\" transform=\"scale(-1)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/convertTransform.13.svg.txt",
    "content": "Test rotate()scale(), rotate()skewX() when starting with matrix.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-50 -50 100 100\">\n    <rect x=\"0\" y=\"0\" width=\"10\" height=\"20\" transform=\"matrix(1.93185,0.51764,-0.25882,0.96593,0,0)\"/>\n    <rect x=\"-20\" y=\"-20\" width=\"10\" height=\"20\" transform=\"matrix(0.85606,0.66883,-0.25882,0.96593,0,0)\"/>\n</svg>\n\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-50 -50 100 100\">\n    <rect x=\"0\" y=\"0\" width=\"10\" height=\"20\" transform=\"rotate(15)scale(2 1)\"/>\n    <rect x=\"-20\" y=\"-20\" width=\"10\" height=\"20\" transform=\"rotate(15)skewY(23)\"/>\n</svg>"
  },
  {
    "path": "test/plugins/convertTransform.14.svg.txt",
    "content": "Test to make sure rotate(180) inverts scale(1).\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 200 200\">\n    <rect x=\"20\" y=\"30\" width=\"40\" height=\"50\" transform=\"matrix(-1,-4.371139e-8,4.371139e-8,-1,139.2007,136.8)\"/>\n</svg>\n\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 200 200\">\n    <rect x=\"20\" y=\"30\" width=\"40\" height=\"50\" transform=\"translate(139.2007 136.8)scale(-1)\"/>\n</svg>\n\n@@@\n\n{\n    \"degPrecision\":4,\n    \"floatPrecision\":6,\n    \"transformPrecision\":8\n}"
  },
  {
    "path": "test/plugins/convertTransform.15.svg.txt",
    "content": "Make sure scale(n,0) is handled correctly.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-10 -10 100 150\">\n    <rect x=\"0\" y=\"10\" width=\"5\" height=\"8\" fill=\"red\" transform=\"translate(5,70) scale(.4 0)\"/>\n</svg>\n\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-10 -10 100 150\">\n    <rect x=\"0\" y=\"10\" width=\"5\" height=\"8\" fill=\"red\" transform=\"matrix(.4 0 0 0 5 70)\"/>\n</svg>\n\n"
  },
  {
    "path": "test/plugins/inlineStyles.01.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" class=\"st0\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" class=\"st0\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.02.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .st0{fill:blue;}\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" style=\"fill:blue\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" id=\"dark\" viewBox=\"0 0 258.12 225.88\">\n<!-- for https://github.com/svg/svgo/pull/592#issuecomment-266327016 -->\n    <style>\n        .cls-7 {\n            only-cls-7: 1;\n        }\n        .cls-7,\n        .cls-8 {\n            cls-7-and-8: 1;\n        }\n    </style>\n\n    <path class=\"cls-7\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" id=\"dark\" viewBox=\"0 0 258.12 225.88\">\n<!--for https://github.com/svg/svgo/pull/592#issuecomment-266327016-->\n    <style>\n        .cls-8{cls-7-and-8:1}\n    </style>\n    <path style=\"only-cls-7:1;cls-7-and-8:1\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.04.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .st0{fill:blue;}\n        .st1{fill:red; }\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0 st1\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" style=\"fill:red\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.05.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .st1 {\n            fill: red;\n        }\n        .st0 {\n            color: blue;\n        }\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0 st1\" style=\"color:yellow\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" style=\"fill:red;color:yellow\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.06.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .red {\n            fill: red;\n        }\n        .blue {\n            fill: blue;\n        }\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"red blue\"/>\n    <rect width=\"100\" height=\"100\" class=\"blue red\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" style=\"fill:blue\"/>\n    <rect width=\"100\" height=\"100\" style=\"fill:blue\"/>\n</svg>\n\n@@@\n\n{\"onlyMatchedOnce\":false}\n"
  },
  {
    "path": "test/plugins/inlineStyles.07.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .red {\n            fill: red !important;\n        }\n        .blue {\n            fill: blue;\n        }\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"blue red\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" style=\"fill:red!important\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.08.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .red {\n            fill: red !important;\n        }\n        .blue {\n            fill: blue;\n        }\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"blue red\" style=\"fill:yellow\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" style=\"fill:red!important\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.09.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .red {\n            fill: red !important;\n        }\n        .blue {\n            fill: blue;\n        }\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"blue red\" style=\"fill:yellow !important\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" style=\"fill:yellow!important\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.10.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        <![CDATA[\n            .st0{fill:blue;}\n        ]]>\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" style=\"fill:blue\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.11.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .st0{fill:blue;}\n        .st0:hover{stroke:red;}\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .st0:hover{stroke:red}\n    </style>\n    <rect width=\"100\" height=\"100\" style=\"fill:blue\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.12.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .st0:hover{stroke:red;}\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" style=\"stroke:red\"/>\n</svg>\n\n@@@\n\n{\"usePseudos\":[\":hover\"]}\n"
  },
  {
    "path": "test/plugins/inlineStyles.13.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 81.285 81.285\">\n    <defs>\n        <style>\n\n            /* Simple Atrules */\n            @charset 'UTF-8';\n\n            @namespace svg url(http://www.w3.org/2000/svg);\n\n            @import url('https://fonts.googleapis.com/css?family=Roboto');\n\n            /* Atrules with block */\n            @font-face {\n                font-family: SomeFont;\n                src: local(\"Some Font\"), local(\"SomeFont\"), url(SomeFont.ttf);\n                font-weight: bold;\n            }\n\n            @viewport {\n                    zoom: 0.8;\n                min-zoom: 0.4;\n                max-zoom: 0.9;\n            }\n\n            @keyframes identifier {\n                  0% { top:  0; }\n                 50% { top: 30px; left: 20px; }\n                 50% { top: 10px; }\n                100% { top:  0; }\n            }\n\n\n            /* Nested rules */\n            @page :first {\n                margin: 1in;\n            }\n\n            @supports (display: flex) {\n                .module { display: flex; }\n            }\n\n            @document url('http://example.com/test.html') {\n                rect {\n                    stroke: red;\n                }\n            }\n\n\n            .blue {\n                fill: blue;\n            }\n    </style>\n    </defs>\n    <rect width=\"100\" height=\"100\" class=\"blue\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 81.285 81.285\">\n    <defs>\n        <style>\n            @charset &quot;UTF-8&quot;;@namespace svg url(http://www.w3.org/2000/svg);@import url(https://fonts.googleapis.com/css?family=Roboto);@font-face{font-family:SomeFont;src:local(&quot;Some Font&quot;), local(&quot;SomeFont&quot;), url(SomeFont.ttf);font-weight:bold}@viewport{zoom:0.8;min-zoom:0.4;max-zoom:0.9}@keyframes identifier{0%{top:0}50%{top:30px;left:20px}50%{top:10px}100%{top:0}}@page :first{margin:1in}@supports (display:flex){.module{display:flex}}@document url(http://example.com/test.html){rect{stroke:red}}\n        </style>\n    </defs>\n    <rect width=\"100\" height=\"100\" style=\"fill:blue\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.14.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 81.285 81.285\">\n    <defs>\n        <style>\n            @media only screen\n            and (min-device-width: 320px)\n            and (max-device-width: 480px)\n            and (-webkit-min-device-pixel-ratio: 2) {\n\n                .blue { fill: blue; }\n\n            }\n        </style>\n    </defs>\n    <rect width=\"100\" height=\"100\" class=\"blue\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 81.285 81.285\">\n    <defs>\n        <style>\n            @media only screen and (min-device-width:320px) and (max-device-width:480px) and (-webkit-min-device-pixel-ratio:2){}\n        </style>\n    </defs>\n    <rect width=\"100\" height=\"100\" style=\"fill:blue\"/>\n</svg>\n\n@@@\n\n{\"useMqs\": [\"media only screen and (min-device-width:320px) and (max-device-width:480px) and (-webkit-min-device-pixel-ratio:2)\"]}\n"
  },
  {
    "path": "test/plugins/inlineStyles.15.svg.txt",
    "content": "<?xml version=\"1.0\" standalone=\"no\"?>\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <defs xmlns=\"http://www.w3.org/1999/xhtml\">\n        <style type=\"text/css\">\n            html /deep/ [layout][horizontal], html /deep/ [layout][vertical] { display: flex; }\n            html /deep/ [layout][horizontal][inline], html /deep/ [layout][vertical][inline] { display: inline-flex; }\n            html /deep/ [layout][horizontal] { flex-direction: row; }\n            html /deep/ [layout][horizontal][reverse] { flex-direction: row-reverse; }\n            html /deep/ [layout][vertical] { flex-direction: column; }\n            html /deep/ [layout][vertical][reverse] { flex-direction: column-reverse; }\n            html /deep/ [layout][wrap] { flex-wrap: wrap; }\n            html /deep/ [layout][wrap-reverse] { flex-wrap: wrap-reverse; }\n            html /deep/ [flex] { flex: 1 1 0px; }\n            html /deep/ [flex][auto] { flex: 1 1 auto; }\n            html /deep/ [flex][none] { flex: 0 0 auto; }\n            html /deep/ [flex][one] { flex: 1 1 0px; }\n            html /deep/ [flex][two] { flex: 2 1 0px; }\n            html /deep/ [flex][three] { flex: 3 1 0px; }\n            html /deep/ [flex][four] { flex: 4 1 0px; }\n            html /deep/ [flex][five] { flex: 5 1 0px; }\n            html /deep/ [flex][six] { flex: 6 1 0px; }\n            html /deep/ [flex][seven] { flex: 7 1 0px; }\n            html /deep/ [flex][eight] { flex: 8 1 0px; }\n            html /deep/ [flex][nine] { flex: 9 1 0px; }\n            html /deep/ [flex][ten] { flex: 10 1 0px; }\n            html /deep/ [flex][eleven] { flex: 11 1 0px; }\n            html /deep/ [flex][twelve] { flex: 12 1 0px; }\n            html /deep/ [layout][start] { align-items: flex-start; }\n            html /deep/ [layout][center] { align-items: center; }\n            html /deep/ [layout][end] { align-items: flex-end; }\n            html /deep/ [layout][start-justified] { justify-content: flex-start; }\n            html /deep/ [layout][center-justified] { justify-content: center; }\n            html /deep/ [layout][end-justified] { justify-content: flex-end; }\n            html /deep/ [layout][around-justified] { justify-content: space-around; }\n            html /deep/ [layout][justified] { justify-content: space-between; }\n            html /deep/ [self-start] { align-self: flex-start; }\n            html /deep/ [self-center] { align-self: center; }\n            html /deep/ [self-end] { align-self: flex-end; }\n            html /deep/ [self-stretch] { align-self: stretch; }\n            html /deep/ [block] { display: block; }\n            html /deep/ [hidden] { display: none !important; }\n            html /deep/ [relative] { position: relative; }\n            html /deep/ [fit] { position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px; }\n            body[fullbleed] { margin: 0px; height: 100vh; }\n            html /deep/ [segment], html /deep/ segment { display: block; position: relative; box-sizing: border-box; margin: 1em 0.5em; padding: 1em; -webkit-box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 0px 1px; box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 0px 1px; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; background-color: white; }\n            html /deep/ core-icon { display: inline-block; vertical-align: middle; background-repeat: no-repeat; }\n            html /deep/ core-icon[size=\"\"] { position: relative; }\n        </style>\n    </defs>\n    <g id=\"airplanemode-on\">\n        <path d=\"M10.2,9\"/>\n    </g>\n</svg>\n\n@@@\n\n<?xml version=\"1.0\" standalone=\"no\"?>\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <defs xmlns=\"http://www.w3.org/1999/xhtml\">\n        <style type=\"text/css\">\n            html/deep/[layout][horizontal],html/deep/[layout][vertical]{display:flex}html/deep/[layout][horizontal][inline],html/deep/[layout][vertical][inline]{display:inline-flex}html/deep/[layout][horizontal]{flex-direction:row}html/deep/[layout][horizontal][reverse]{flex-direction:row-reverse}html/deep/[layout][vertical]{flex-direction:column}html/deep/[layout][vertical][reverse]{flex-direction:column-reverse}html/deep/[layout][wrap]{flex-wrap:wrap}html/deep/[layout][wrap-reverse]{flex-wrap:wrap-reverse}html/deep/[flex]{flex:1 1 0px}html/deep/[flex][auto]{flex:1 1 auto}html/deep/[flex][none]{flex:0 0 auto}html/deep/[flex][one]{flex:1 1 0px}html/deep/[flex][two]{flex:2 1 0px}html/deep/[flex][three]{flex:3 1 0px}html/deep/[flex][four]{flex:4 1 0px}html/deep/[flex][five]{flex:5 1 0px}html/deep/[flex][six]{flex:6 1 0px}html/deep/[flex][seven]{flex:7 1 0px}html/deep/[flex][eight]{flex:8 1 0px}html/deep/[flex][nine]{flex:9 1 0px}html/deep/[flex][ten]{flex:10 1 0px}html/deep/[flex][eleven]{flex:11 1 0px}html/deep/[flex][twelve]{flex:12 1 0px}html/deep/[layout][start]{align-items:flex-start}html/deep/[layout][center]{align-items:center}html/deep/[layout][end]{align-items:flex-end}html/deep/[layout][start-justified]{justify-content:flex-start}html/deep/[layout][center-justified]{justify-content:center}html/deep/[layout][end-justified]{justify-content:flex-end}html/deep/[layout][around-justified]{justify-content:space-around}html/deep/[layout][justified]{justify-content:space-between}html/deep/[self-start]{align-self:flex-start}html/deep/[self-center]{align-self:center}html/deep/[self-end]{align-self:flex-end}html/deep/[self-stretch]{align-self:stretch}html/deep/[block]{display:block}html/deep/[hidden]{display:none!important}html/deep/[relative]{position:relative}html/deep/[fit]{position:absolute;top:0px;right:0px;bottom:0px;left:0px}body[fullbleed]{margin:0px;height:100vh}html/deep/[segment],html/deep/segment{display:block;position:relative;box-sizing:border-box;margin:1em 0.5em;padding:1em;-webkit-box-shadow:rgba(0, 0, 0, 0.0980392) 0px 0px 0px 1px;box-shadow:rgba(0, 0, 0, 0.0980392) 0px 0px 0px 1px;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;background-color:white}html/deep/core-icon{display:inline-block;vertical-align:middle;background-repeat:no-repeat}html/deep/core-icon[size=&quot;&quot;]{position:relative}\n        </style>\n    </defs>\n    <g id=\"airplanemode-on\">\n        <path d=\"M10.2,9\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.16.svg.txt",
    "content": "<svg id=\"Ebene_1\" data-name=\"Ebene 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 222 57.28\">\n    <defs>\n        <style>\n            #id0 {\n                stroke: red;\n            }\n\n            .cls-1 {\n                fill: #37d0cd;\n            }\n\n            .cls-2{\n                fill: #fff;\n            }\n        </style>\n    </defs>\n    <title>button</title>\n    <rect id=\"id0\" class=\"cls-1\" width=\"222\" height=\"57.28\" rx=\"28.64\" ry=\"28.64\"/>\n    <path class=\"cls-2\" d=\"M312.75,168.66A2.15,2.15,0,0,1,311.2,165L316,160l-4.8-5a2.15,2.15,0,1,1,3.1-3l6.21,6.49a2.15,2.15,0,0,1,0,3L314.31,168a2.14,2.14,0,0,1-1.56.67Zm0,0\" transform=\"translate(-119 -131.36)\"/>\n    <circle class=\"cls-2\" cx=\"33.5\" cy=\"27.25\" r=\"2.94\"/>\n    <circle class=\"cls-2\" cx=\"162.5\" cy=\"158.61\" r=\"2.94\" transform=\"translate(-181.03 61.15) rotate(-52.89)\"/>\n    <circle class=\"cls-2\" cx=\"172.5\" cy=\"158.61\" r=\"2.94\" transform=\"translate(-157.03 -75.67) rotate(-16.55)\"/>\n</svg>\n\n@@@\n\n<svg id=\"Ebene_1\" data-name=\"Ebene 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 222 57.28\">\n    <defs/>\n    <title>button</title>\n    <rect width=\"222\" height=\"57.28\" rx=\"28.64\" ry=\"28.64\" style=\"fill:#37d0cd;stroke:red\"/>\n    <path d=\"M312.75,168.66A2.15,2.15,0,0,1,311.2,165L316,160l-4.8-5a2.15,2.15,0,1,1,3.1-3l6.21,6.49a2.15,2.15,0,0,1,0,3L314.31,168a2.14,2.14,0,0,1-1.56.67Zm0,0\" transform=\"translate(-119 -131.36)\" style=\"fill:#fff\"/>\n    <circle cx=\"33.5\" cy=\"27.25\" r=\"2.94\" style=\"fill:#fff\"/>\n    <circle cx=\"162.5\" cy=\"158.61\" r=\"2.94\" transform=\"translate(-181.03 61.15) rotate(-52.89)\" style=\"fill:#fff\"/>\n    <circle cx=\"172.5\" cy=\"158.61\" r=\"2.94\" transform=\"translate(-157.03 -75.67) rotate(-16.55)\" style=\"fill:#fff\"/>\n</svg>\n\n@@@\n\n{\"onlyMatchedOnce\":false}\n"
  },
  {
    "path": "test/plugins/inlineStyles.17.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\">\n  <foreignObject width=\"100%\" height=\"100%\">\n    <style>div { color: red; }</style>\n    <body xmlns=\"http://www.w3.org/1999/xhtml\"><div>hello, world</div></body>\n  </foreignObject>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\">\n    <foreignObject width=\"100%\" height=\"100%\">\n        <style>\n            div { color: red; }\n        </style>\n        <body xmlns=\"http://www.w3.org/1999/xhtml\">\n            <div>\n                hello, world\n            </div>\n        </body>\n    </foreignObject>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.18.svg.txt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->\n<svg version=\"1.1\" id=\"Logo\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 24 24\" style=\"enable-background:new 0 0 24 24;\" xml:space=\"preserve\">\n<style type=\"text/css\">\n\t.st0{fill:#D1DAE5;}\n</style>\n<g>\n\t<path class=\"st0\" d=\"M16.9,12.3c0-0.1,0.1-0.2,0.1-0.3c0,0,0-0.1,0-0.1c0-0.1,0-0.2,0-0.2c0,0,0,0,0,0c0-0.1-0.1-0.2-0.2-0.3\n\t\tc0,0,0-0.1,0-0.1c0,0,0,0,0,0c0,0,0,0,0,0l-3.5-3.5c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l1.8,1.8H7.5c-0.6,0-1,0.4-1,1s0.4,1,1,1h6.1\n\t\tl-1.9,1.9c-0.4,0.4-0.4,1,0,1.4c0.2,0.2,0.5,0.3,0.7,0.3c0.3,0,0.5-0.1,0.7-0.3l3.6-3.6c0,0,0,0,0,0c0.1-0.1,0.2-0.2,0.2-0.3\n\t\tc0,0,0,0,0,0C16.9,12.3,16.9,12.3,16.9,12.3z\"/>\n\t<path class=\"st0\" d=\"M12,0C5.4,0,0,5.4,0,12s5.4,12,12,12s12-5.4,12-12S18.6,0,12,0z M12,22C6.5,22,2,17.5,2,12S6.5,2,12,2\n\t\ts10,4.5,10,10S17.5,22,12,22z\"/>\n</g>\n</svg>\n\n@@@\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)-->\n<svg version=\"1.1\" id=\"Logo\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 24 24\" style=\"enable-background:new 0 0 24 24;\" xml:space=\"preserve\">\n    <style type=\"text/css\">\n        .st0{fill:#D1DAE5}\n    </style>\n    <g>\n        <path class=\"st0\" d=\"M16.9,12.3c0-0.1,0.1-0.2,0.1-0.3c0,0,0-0.1,0-0.1c0-0.1,0-0.2,0-0.2c0,0,0,0,0,0c0-0.1-0.1-0.2-0.2-0.3\n\t\tc0,0,0-0.1,0-0.1c0,0,0,0,0,0c0,0,0,0,0,0l-3.5-3.5c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l1.8,1.8H7.5c-0.6,0-1,0.4-1,1s0.4,1,1,1h6.1\n\t\tl-1.9,1.9c-0.4,0.4-0.4,1,0,1.4c0.2,0.2,0.5,0.3,0.7,0.3c0.3,0,0.5-0.1,0.7-0.3l3.6-3.6c0,0,0,0,0,0c0.1-0.1,0.2-0.2,0.2-0.3\n\t\tc0,0,0,0,0,0C16.9,12.3,16.9,12.3,16.9,12.3z\"/>\n        <path class=\"st0\" d=\"M12,0C5.4,0,0,5.4,0,12s5.4,12,12,12s12-5.4,12-12S18.6,0,12,0z M12,22C6.5,22,2,17.5,2,12S6.5,2,12,2\n\t\ts10,4.5,10,10S17.5,22,12,22z\"/>\n    </g>\n</svg>\n\n@@@\n\n{\"onlyMatchedOnce\":true}\n"
  },
  {
    "path": "test/plugins/inlineStyles.19.svg.txt",
    "content": "<svg id=\"icon_time\" data-name=\"icon time\" xmlns=\"http://www.w3.org/2000/svg\" width=\"51\" height=\"51\" viewBox=\"0 0 51 51\">\n  <defs>\n    <style>\n      .cls-1, .cls-2, .cls-3 {\n        fill: #f5f5f5;\n        stroke: gray;\n      }\n\n      .cls-1, .cls-2 {\n        stroke-width: 1px;\n      }\n\n      .cls-2 {\n        fill-rule: evenodd;\n      }\n\n      .cls-3 {\n        stroke-width: 2px;\n      }\n    </style>\n  </defs>\n  <circle class=\"cls-1\" cx=\"25.5\" cy=\"25.5\" r=\"25\"/>\n  <g>\n    <path class=\"cls-2\" d=\"M1098,2415a8,8,0,0,1,8,8v2h-16v-2A8,8,0,0,1,1098,2415Z\" transform=\"translate(-1072.5 -2389.5)\"/>\n    <path id=\"Ellipse_14_copy\" data-name=\"Ellipse 14 copy\" class=\"cls-2\" d=\"M1098,2415a8,8,0,0,0,8-8v-2h-16v2A8,8,0,0,0,1098,2415Z\" transform=\"translate(-1072.5 -2389.5)\"/>\n    <path class=\"cls-2\" d=\"M1089,2427v-1h18v1h-18Z\" transform=\"translate(-1072.5 -2389.5)\"/>\n    <path id=\"Shape_10_copy\" data-name=\"Shape 10 copy\" class=\"cls-2\" d=\"M1089,2404v-1h18v1h-18Z\" transform=\"translate(-1072.5 -2389.5)\"/>\n    <circle id=\"Ellipse_13_copy\" data-name=\"Ellipse 13 copy\" class=\"cls-3\" cx=\"25.5\" cy=\"31.5\" r=\"1\"/>\n    <circle id=\"Ellipse_13_copy_3\" data-name=\"Ellipse 13 copy 3\" class=\"cls-3\" cx=\"28.5\" cy=\"31.5\" r=\"1\"/>\n    <circle id=\"Ellipse_13_copy_2\" data-name=\"Ellipse 13 copy 2\" class=\"cls-3\" cx=\"22.5\" cy=\"31.5\" r=\"1\"/>\n  </g>\n</svg>\n\n@@@\n\n<svg id=\"icon_time\" data-name=\"icon time\" xmlns=\"http://www.w3.org/2000/svg\" width=\"51\" height=\"51\" viewBox=\"0 0 51 51\">\n    <defs>\n        <style>\n            .cls-2,.cls-3{fill:#f5f5f5;stroke:gray}.cls-2{stroke-width:1px}.cls-2{fill-rule:evenodd}.cls-3{stroke-width:2px}\n        </style>\n    </defs>\n    <circle cx=\"25.5\" cy=\"25.5\" r=\"25\" style=\"fill:#f5f5f5;stroke:gray;stroke-width:1px\"/>\n    <g>\n        <path class=\"cls-2\" d=\"M1098,2415a8,8,0,0,1,8,8v2h-16v-2A8,8,0,0,1,1098,2415Z\" transform=\"translate(-1072.5 -2389.5)\"/>\n        <path id=\"Ellipse_14_copy\" data-name=\"Ellipse 14 copy\" class=\"cls-2\" d=\"M1098,2415a8,8,0,0,0,8-8v-2h-16v2A8,8,0,0,0,1098,2415Z\" transform=\"translate(-1072.5 -2389.5)\"/>\n        <path class=\"cls-2\" d=\"M1089,2427v-1h18v1h-18Z\" transform=\"translate(-1072.5 -2389.5)\"/>\n        <path id=\"Shape_10_copy\" data-name=\"Shape 10 copy\" class=\"cls-2\" d=\"M1089,2404v-1h18v1h-18Z\" transform=\"translate(-1072.5 -2389.5)\"/>\n        <circle id=\"Ellipse_13_copy\" data-name=\"Ellipse 13 copy\" class=\"cls-3\" cx=\"25.5\" cy=\"31.5\" r=\"1\"/>\n        <circle id=\"Ellipse_13_copy_3\" data-name=\"Ellipse 13 copy 3\" class=\"cls-3\" cx=\"28.5\" cy=\"31.5\" r=\"1\"/>\n        <circle id=\"Ellipse_13_copy_2\" data-name=\"Ellipse 13 copy 2\" class=\"cls-3\" cx=\"22.5\" cy=\"31.5\" r=\"1\"/>\n    </g>\n</svg>\n\n@@@\n\n{\"onlyMatchedOnce\":true}\n"
  },
  {
    "path": "test/plugins/inlineStyles.20.svg.txt",
    "content": "<style> may have type attribute. Values other than the empty string\nor text/css are ignored.\n\n===\n\n<svg>\n  <style type=\"text/invalid\">\n    .invalid { fill: red; }\n  </style>\n  <style type=\"text/css\">\n    .css { fill: green; }\n  </style>\n  <style type=\"\">\n    .empty { fill: blue; }\n  </style>\n  <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" class=\"invalid\" />\n  <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" class=\"css\" />\n  <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" class=\"empty\" />\n</svg>\n\n@@@\n\n<svg>\n    <style type=\"text/invalid\">\n        .invalid { fill: red; }\n    </style>\n    <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" class=\"invalid\"/>\n    <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" style=\"fill:green\"/>\n    <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" style=\"fill:blue\"/>\n</svg>\n\n"
  },
  {
    "path": "test/plugins/inlineStyles.21.svg.txt",
    "content": "Selectors matching two classes should remove both classes from the matched\nelement.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1570.062\" height=\"2730\" viewBox=\"0 0 415.412 722.312\">\n  <style>\n    .segment.minor {\n      stroke-width: 1.5;\n      stroke: #15c6aa;\n    }\n  </style>\n  <g transform=\"translate(200.662 362.87)\">\n    <path d=\"M163.502-303.979h3.762\" class=\"segment minor\"/>\n  </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1570.062\" height=\"2730\" viewBox=\"0 0 415.412 722.312\">\n    <g transform=\"translate(200.662 362.87)\">\n        <path d=\"M163.502-303.979h3.762\" style=\"stroke-width:1.5;stroke:#15c6aa\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.22.svg.txt",
    "content": "Selectors matching two classes should remove both classes from the matched\nelement, and further selectors of those classes should still apply.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1570.062\" height=\"2730\" viewBox=\"0 0 415.412 722.312\">\n  <style>\n    .segment.minor {\n      stroke-width: 1.5;\n    }\n    .minor {\n      stroke: #15c6aa;\n    }\n  </style>\n  <g transform=\"translate(200.662 362.87)\">\n    <path d=\"M163.502-303.979h3.762\" class=\"segment minor\"/>\n  </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1570.062\" height=\"2730\" viewBox=\"0 0 415.412 722.312\">\n    <g transform=\"translate(200.662 362.87)\">\n        <path d=\"M163.502-303.979h3.762\" style=\"stroke:#15c6aa;stroke-width:1.5\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.23.svg.txt",
    "content": "Empty selectors should just be dropped.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 45 35\">\n  <style>\n    .a {}\n  </style>\n  <g class=\"a\">\n    <circle class=\"b\" cx=\"42.97\" cy=\"24.92\" r=\"1.14\"/>\n  </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 45 35\">\n    <g>\n        <circle class=\"b\" cx=\"42.97\" cy=\"24.92\" r=\"1.14\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.24.svg.txt",
    "content": "If we're going to inline styles for property that is also a presentation\nattribute, and that presentation attribute was already defined in the node, we\ncan just drop the presentation attribute as it would be overridden by the style\nanyway.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 269 349\">\n  <style type=\"text/css\">\n    .a {\n      fill: #059669;\n    }\n  </style>\n  <path class=\"a\" d=\"M191.5,324.1V355l9.6-31.6A77.49,77.49,0,0,1,191.5,324.1Z\" fill=\"#059669\" transform=\"translate(-57.17 -13.4)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 269 349\">\n    <path d=\"M191.5,324.1V355l9.6-31.6A77.49,77.49,0,0,1,191.5,324.1Z\" transform=\"translate(-57.17 -13.4)\" style=\"fill:#059669\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.25.svg.txt",
    "content": "Don't remove the redundant presentation attribute if it's used in a CSS\nselector in a `<style> tag.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\">\n  <style>\n    .a {\n      stroke: red;\n    }\n\n    [stroke] + path {\n      stroke: purple;\n    }\n  </style>\n  <path class=\"a\" d=\"M10 10h20\" stroke=\"red\"/>\n  <path d=\"M10 20h20\"/>\n  <path d=\"M10 30h20\" stroke=\"yellow\"/>\n  <path d=\"M10 40h20\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\">\n    <style>\n        [stroke]+path{stroke:purple}\n    </style>\n    <path d=\"M10 10h20\" stroke=\"red\" style=\"stroke:red\"/>\n    <path d=\"M10 20h20\"/>\n    <path d=\"M10 30h20\" stroke=\"yellow\"/>\n    <path d=\"M10 40h20\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.26.svg.txt",
    "content": "Don't remove the class from a wrapper element if it's traversed in another\nselector.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 45 35\">\n  <style>\n    .a {}\n\n    .a .b {\n      fill: none;\n      stroke: #000;\n    }\n  </style>\n  <g class=\"a\">\n    <circle class=\"b\" cx=\"42.97\" cy=\"24.92\" r=\"1.14\"/>\n    <path class=\"b\" d=\"M26,31s11.91-1.31,15.86-5.64\"/>\n  </g>\n</svg>\n\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 45 35\">\n    <style>\n        .a .b{fill:none;stroke:#000}\n    </style>\n    <g class=\"a\">\n        <circle class=\"b\" cx=\"42.97\" cy=\"24.92\" r=\"1.14\"/>\n        <path class=\"b\" d=\"M26,31s11.91-1.31,15.86-5.64\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.27.svg.txt",
    "content": "Pseudo-classes that can be evaluated during optimization should not be toggled\nthrough the usePseudos parameter.\n\nSee: https://github.com/svg/svgo/commit/72b972261d03f0c40315cd6b9325100d7305a5d6#diff-c625ac4b082b2484280f2d83e11189fc2524e9c21946b4cfab3cc3bf2ab3dcc9R185\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\">\n  <style>\n    path:not([fill=blue]) {\n      stroke: purple;\n    }\n  </style>\n  <path fill=\"red\" d=\"M5 5H10\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\">\n    <path fill=\"red\" d=\"M5 5H10\" style=\"stroke:purple\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/inlineStyles.28.svg.txt",
    "content": "Pseudo-classes that can be evaluated during optimization but don't match any\nnodes should do nothing, and especially shouldn't crash.\n\nSee: https://github.com/svg/svgo/issues/1859\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\">\n  <style>\n    path:not([fill=red]) {\n      stroke: purple;\n    }\n  </style>\n  <path fill=\"red\" d=\"M5 5H10\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\">\n    <style>\n        path:not([fill=red]){stroke:purple}\n    </style>\n    <path fill=\"red\" d=\"M5 5H10\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergePaths.01.svg.txt",
    "content": "Merge sequences of paths without attributes\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M 0,0 z\"/>\n    <path d=\"M 10,10 z\"/>\n    <path d=\"M 20,20 l 10,10 M 30,0 c 10,0 20,10 20,20\"/>\n    <path d=\"M 30,30 z\"/>\n    <path d=\"M 30,30 z\" fill=\"#f00\"/>\n    <path d=\"M 40,40 z\"/>\n    <path d=\"m 50,50 0,10 20,30 40,0\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M0 0zM10 10zM20 20l10 10M30 0c10 0 20 10 20 20M30 30z\"/>\n    <path d=\"M 30,30 z\" fill=\"#f00\"/>\n    <path d=\"M40 40zM50 50l0 10 20 30 40 0\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergePaths.02.svg.txt",
    "content": "Merge sequences of paths with the same attributes\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M 0,0 z\" fill=\"#fff\" stroke=\"#333\"/>\n    <path d=\"M 10,10 z\" fill=\"#fff\" stroke=\"#333\"/>\n    <path d=\"M 20,20\" fill=\"#fff\" stroke=\"#333\"/>\n    <path d=\"M 30,30 z\" fill=\"#fff\" stroke=\"#333\"/>\n    <path d=\"M 30,30 z\" fill=\"#f00\"/>\n    <path d=\"M 40,40 z\"/>\n    <path d=\"m 50,50 z\"/>\n    <path d=\"M 40,40\"/>\n    <path d=\"m 50,50\"/>\n    <path d=\"M 40,40 z\" fill=\"#fff\" stroke=\"#333\"/>\n    <path d=\"m 50,50 z\" fill=\"#fff\" stroke=\"#333\"/>\n    <path d=\"M 40,40\" fill=\"#fff\" stroke=\"#333\"/>\n    <path d=\"m 50,50\" fill=\"#fff\" stroke=\"#333\"/>\n    <path d=\"m 50,50 z\" fill=\"#fff\" stroke=\"#333\"/>\n    <path d=\"M0 0v100h100V0z\" fill=\"red\"/>\n    <path d=\"M200 0v100h100V0z\" fill=\"red\"/>\n    <path d=\"M0 0v100h100V0z\" fill=\"blue\"/>\n    <path d=\"M200 0v100h100V0zM0 200h100v100H0z\" fill=\"blue\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M0 0zM10 10zM30 30z\" fill=\"#fff\" stroke=\"#333\"/>\n    <path d=\"M 30,30 z\" fill=\"#f00\"/>\n    <path d=\"M40 40zM50 50zM50 50\"/>\n    <path d=\"M40 40zM50 50zM50 50z\" fill=\"#fff\" stroke=\"#333\"/>\n    <path d=\"M0 0v100h100V0zM200 0v100h100V0z\" fill=\"red\"/>\n    <path d=\"M0 0v100h100V0zM200 0v100h100V0zM0 200h100v100H0z\" fill=\"blue\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergePaths.03.svg.txt",
    "content": "Merge only intersected paths\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M30 0L0 40H60z\"/>\n    <path d=\"M0 10H60L30 50z\"/>\n    <path d=\"M0 0V50L50 0\"/>\n    <path d=\"M0 60L50 10V60\"/>\n    <g>\n        <path d=\"M100 0a50 50 0 0 1 0 100\"/>\n        <path d=\"M25 25H75V75H25z\"/>\n        <path d=\"M135 85H185V135H135z\"/>\n    </g>\n    <g>\n        <path d=\"M10 14H7v1h3v-1z\"/>\n        <path d=\"M9 21H8v1h1v-1z\"/>\n    </g>\n    <g>\n        <path d=\"M30 32.705V40h10.42L30 32.705z\"/>\n        <path d=\"M46.25 34.928V30h-7.04l7.04 4.928z\"/>\n    </g>\n    <g>\n        <path d=\"M20 20H60L100 30\"/>\n        <path d=\"M20 20L50 30H100\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M30 0L0 40H60z\"/>\n    <path d=\"M0 10H60L30 50z\"/>\n    <path d=\"M0 0V50L50 0M0 60 50 10V60\"/>\n    <g>\n        <path d=\"M100 0a50 50 0 0 1 0 100M25 25H75V75H25z\"/>\n        <path d=\"M135 85H185V135H135z\"/>\n    </g>\n    <g>\n        <path d=\"M10 14H7v1h3v-1zM9 21H8v1h1v-1z\"/>\n    </g>\n    <g>\n        <path d=\"M30 32.705V40h10.42L30 32.705zM46.25 34.928V30h-7.04l7.04 4.928z\"/>\n    </g>\n    <g>\n        <path d=\"M20 20H60L100 30M20 20 50 30H100\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergePaths.04.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M320 60c17.466-8.733 33.76-12.78 46.593-12.484 12.856.297 22.254 4.936 26.612 12.484 4.358 7.548 3.676 18.007-2.494 29.29-6.16 11.26-17.812 23.348-34.107 34.107-16.26 10.735-37.164 20.14-60.72 26.613C272.356 156.473 246.178 160 220 160c-26.18 0-52.357-3.527-75.882-9.99-23.557-6.472-44.462-15.878-60.72-26.613-16.296-10.76-27.95-22.846-34.11-34.108-6.17-11.283-6.85-21.742-2.493-29.29 4.358-7.548 13.756-12.187 26.612-12.484C86.24 47.22 102.535 51.266 120 60c17.426 8.713 36.024 22.114 53.407 39.28C190.767 116.42 206.91 137.33 220 160c13.09 22.67 23.124 47.106 29.29 70.71 6.173 23.638 8.48 46.445 7.313 65.893-1.17 19.49-5.812 35.627-12.485 46.592C237.432 354.18 228.716 360 220 360s-17.432-5.82-24.118-16.805c-6.673-10.965-11.315-27.1-12.485-46.592-1.167-19.448 1.14-42.255 7.314-65.892 6.166-23.604 16.2-48.04 29.29-70.71 13.09-22.67 29.233-43.58 46.593-60.72C283.976 82.113 302.573 68.712 320 60z\"/>\n    <path d=\"M280 320l100-173.2h200l100 173.2-100 173.2h-200\"/>\n    <g>\n        <path d=\"M706.69 299.29c-.764-11.43-6.036-56.734-16.338-71.32 0 0 9.997 14.14 11.095 76.806l5.243-5.486z\"/>\n        <path d=\"M705.16 292.54c-5.615-35.752-25.082-67.015-25.082-67.015 7.35 15.128 20.257 53.835 23.64 77.45l2.33-2.24-.888-8.195z\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M320 60c17.466-8.733 33.76-12.78 46.593-12.484 12.856.297 22.254 4.936 26.612 12.484 4.358 7.548 3.676 18.007-2.494 29.29-6.16 11.26-17.812 23.348-34.107 34.107-16.26 10.735-37.164 20.14-60.72 26.613C272.356 156.473 246.178 160 220 160c-26.18 0-52.357-3.527-75.882-9.99-23.557-6.472-44.462-15.878-60.72-26.613-16.296-10.76-27.95-22.846-34.11-34.108-6.17-11.283-6.85-21.742-2.493-29.29 4.358-7.548 13.756-12.187 26.612-12.484C86.24 47.22 102.535 51.266 120 60c17.426 8.713 36.024 22.114 53.407 39.28C190.767 116.42 206.91 137.33 220 160c13.09 22.67 23.124 47.106 29.29 70.71 6.173 23.638 8.48 46.445 7.313 65.893-1.17 19.49-5.812 35.627-12.485 46.592C237.432 354.18 228.716 360 220 360s-17.432-5.82-24.118-16.805c-6.673-10.965-11.315-27.1-12.485-46.592-1.167-19.448 1.14-42.255 7.314-65.892 6.166-23.604 16.2-48.04 29.29-70.71 13.09-22.67 29.233-43.58 46.593-60.72C283.976 82.113 302.573 68.712 320 60zM280 320l100-173.2h200l100 173.2-100 173.2h-200\"/>\n    <g>\n        <path d=\"M706.69 299.29c-.764-11.43-6.036-56.734-16.338-71.32 0 0 9.997 14.14 11.095 76.806l5.243-5.486z\"/>\n        <path d=\"M705.16 292.54c-5.615-35.752-25.082-67.015-25.082-67.015 7.35 15.128 20.257 53.835 23.64 77.45l2.33-2.24-.888-8.195z\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergePaths.05.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"499.25\" height=\"732.44\">\n    <g fill=\"#ffe900\" fill-rule=\"evenodd\" stroke=\"#1b1918\">\n        <g stroke-width=\"2.52\">\n            <path d=\"M373.27 534.98c-8.092-54.74-4.391-98.636 56.127-90.287 77.894 55.595-9.147 98.206-5.311 151.74 21.027 45.08 17.096 66.495-7.512 68.302-17.258 10.998-32.537 13.238-46.236 8.48-.246-1.867-.69-3.845-1.368-5.94l-19.752-40.751c44.709 19.982 82.483-.171 51.564-24.28zm32.16-40.207c-5.449-9.977 3.342-14.397 8.048-3.55 12.4 31.857 6.043 40.206-16.136 72.254l-1.911-2.463c11.558-13.292 20.249-27.75 21.334-39.194.899-9.481-5.973-16.736-11.335-27.048z\"/>\n            <path d=\"M407.72 580.04c40.745 49.516-3.991 92.385-40.977 82.64\"/>\n        </g>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"499.25\" height=\"732.44\">\n    <g fill=\"#ffe900\" fill-rule=\"evenodd\" stroke=\"#1b1918\">\n        <g stroke-width=\"2.52\">\n            <path d=\"M373.27 534.98c-8.092-54.74-4.391-98.636 56.127-90.287 77.894 55.595-9.147 98.206-5.311 151.74 21.027 45.08 17.096 66.495-7.512 68.302-17.258 10.998-32.537 13.238-46.236 8.48-.246-1.867-.69-3.845-1.368-5.94l-19.752-40.751c44.709 19.982 82.483-.171 51.564-24.28zm32.16-40.207c-5.449-9.977 3.342-14.397 8.048-3.55 12.4 31.857 6.043 40.206-16.136 72.254l-1.911-2.463c11.558-13.292 20.249-27.75 21.334-39.194.899-9.481-5.973-16.736-11.335-27.048z\"/>\n            <path d=\"M407.72 580.04c40.745 49.516-3.991 92.385-40.977 82.64\"/>\n        </g>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergePaths.06.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1221.3\" height=\"1297.3\" viewBox=\"0 0 1145 1216.2\">\n    <g stroke=\"gray\" stroke-width=\"1.46\">\n        <path d=\"M2236.1 787.25c6.625.191 11.52.01 11.828-2.044-8.189-9.2 8.854-46.86-11.828-48.722-17.83 3.99-6.438 26.66-11.828 48.722-.133 2.352 7.537 2.028 11.828 2.044z\" transform=\"matrix(-.02646 -1.4538 -1.2888 .02985 1465.1 3284.4)\"/>\n        <path d=\"M2243.9 787.13c-7.561-19.76 6.33-43.05-7.817-50.642\" transform=\"matrix(-.02646 -1.4538 -1.2888 .02985 1465.1 3284.4)\"/>\n        <path d=\"M2238.8 787.31c-4.873-19.48 2.772-37.1-2.667-50.82\" transform=\"matrix(-.02646 -1.4538 -1.2888 .02985 1465.1 3284.4)\"/>\n        <path d=\"M2228.3 787.13c4.104-21.9-3.13-44.68 7.817-50.642\" transform=\"matrix(-.02646 -1.4538 -1.2888 .02985 1465.1 3284.4)\"/>\n        <path d=\"M2233.4 787.31c-.692-5.383-1.098-39.17 2.667-50.82\" transform=\"matrix(-.02646 -1.4538 -1.2888 .02985 1465.1 3284.4)\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1221.3\" height=\"1297.3\" viewBox=\"0 0 1145 1216.2\">\n    <g stroke=\"gray\" stroke-width=\"1.46\">\n        <path d=\"M2236.1 787.25c6.625.191 11.52.01 11.828-2.044-8.189-9.2 8.854-46.86-11.828-48.722-17.83 3.99-6.438 26.66-11.828 48.722-.133 2.352 7.537 2.028 11.828 2.044z\" transform=\"matrix(-.02646 -1.4538 -1.2888 .02985 1465.1 3284.4)\"/>\n        <path d=\"M2243.9 787.13c-7.561-19.76 6.33-43.05-7.817-50.642\" transform=\"matrix(-.02646 -1.4538 -1.2888 .02985 1465.1 3284.4)\"/>\n        <path d=\"M2238.8 787.31c-4.873-19.48 2.772-37.1-2.667-50.82M2228.3 787.13c4.104-21.9-3.13-44.68 7.817-50.642\" transform=\"matrix(-.02646 -1.4538 -1.2888 .02985 1465.1 3284.4)\"/>\n        <path d=\"M2233.4 787.31c-.692-5.383-1.098-39.17 2.667-50.82\" transform=\"matrix(-.02646 -1.4538 -1.2888 .02985 1465.1 3284.4)\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergePaths.07.svg.txt",
    "content": "Merged paths lose their ends and markers are rendered incorrectly\n\n===\n\n<svg width=\"100\" height=\"100\">\n  <defs>\n    <style>\n      .a {marker-end: url(#arrowhead_end);}\n    </style>\n    <marker id=\"arrowhead_end\" markerWidth=\"10\" markerHeight=\"10\" refX=\"6\" refY=\"3\">\n      <path d=\"M 0,0 l 6,3 l -6,3\" stroke=\"black\" />\n    </marker>\n  </defs>\n  <path d=\"M 10,10 h50\" stroke=\"black\" marker-end=\"url(#arrowhead_end)\" />\n  <path d=\"M 10,50 h50\" stroke=\"black\" marker-end=\"url(#arrowhead_end)\" />\n  <path d=\"M 10,60 h60\" stroke=\"black\" class=\"a\" />\n  <path d=\"M 10,70 h60\" stroke=\"black\" class=\"a\"/>\n</svg>\n\n@@@\n\n<svg width=\"100\" height=\"100\">\n    <defs>\n        <style>\n            .a {marker-end: url(#arrowhead_end);}\n        </style>\n        <marker id=\"arrowhead_end\" markerWidth=\"10\" markerHeight=\"10\" refX=\"6\" refY=\"3\">\n            <path d=\"M 0,0 l 6,3 l -6,3\" stroke=\"black\"/>\n        </marker>\n    </defs>\n    <path d=\"M 10,10 h50\" stroke=\"black\" marker-end=\"url(#arrowhead_end)\"/>\n    <path d=\"M 10,50 h50\" stroke=\"black\" marker-end=\"url(#arrowhead_end)\"/>\n    <path d=\"M 10,60 h60\" stroke=\"black\" class=\"a\"/>\n    <path d=\"M 10,70 h60\" stroke=\"black\" class=\"a\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergePaths.08.svg.txt",
    "content": "Don't merge paths with a linearGradient fill (issue #1267).\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 300 300\">\n    <style>\n        path.lg{fill:url(#gradient);}\n    </style>\n    <linearGradient id=\"gradient\">\n        <stop offset=\"0\" stop-color=\"#ff0000\"/>\n        <stop offset=\"1\" stop-color=\"#0000ff\"/>\n    </linearGradient>\n    <path fill=\"url(#gradient)\" d=\"M 0 0 H 100 V 80 H 0 z\"/>\n    <path fill=\"url(#gradient)\" d=\"M 200 0 H 300 V 80 H 200 z\"/>\n    <path style=\"fill:url(#gradient)\" d=\"M 0 100 h 100 v 80 H 0 z\"/>\n    <path style=\"fill:url(#gradient)\" d=\"M 200 100 H 300 v 80 H 200 z\"/>\n    <path class=\"lg\" d=\"M 0 200 h 100 v 80 H 0 z\"/>\n    <path class=\"lg\" d=\"M 200 200 H 300 v 80 H 200 z\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 300 300\">\n    <style>\n        path.lg{fill:url(#gradient);}\n    </style>\n    <linearGradient id=\"gradient\">\n        <stop offset=\"0\" stop-color=\"#ff0000\"/>\n        <stop offset=\"1\" stop-color=\"#0000ff\"/>\n    </linearGradient>\n    <path fill=\"url(#gradient)\" d=\"M 0 0 H 100 V 80 H 0 z\"/>\n    <path fill=\"url(#gradient)\" d=\"M 200 0 H 300 V 80 H 200 z\"/>\n    <path style=\"fill:url(#gradient)\" d=\"M 0 100 h 100 v 80 H 0 z\"/>\n    <path style=\"fill:url(#gradient)\" d=\"M 200 100 H 300 v 80 H 200 z\"/>\n    <path class=\"lg\" d=\"M 0 200 h 100 v 80 H 0 z\"/>\n    <path class=\"lg\" d=\"M 200 200 H 300 v 80 H 200 z\"/>\n</svg>"
  },
  {
    "path": "test/plugins/mergePaths.09.svg.txt",
    "content": "Don't merge paths with a linearGradient stroke (issue #1267).\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-5 -5 300 300\">\n    <style>\n        path.lg{stroke:url(#gradient);}\n    </style>\n    <linearGradient id=\"gradient\">\n        <stop offset=\"0\" stop-color=\"#ff0000\"/>\n        <stop offset=\"1\" stop-color=\"#0000ff\"/>\n    </linearGradient>\n    <path stroke=\"url(#gradient)\" stroke-width=\"10\" d=\"M 0 0 H 100 V 80 H 0 z\"/>\n    <path stroke=\"url(#gradient)\" stroke-width=\"10\" d=\"M 200 0 H 300 V 80 H 200 z\"/>\n    <path style=\"stroke:url(#gradient)\" stroke-width=\"10\" d=\"M 0 100 h 100 v 80 H 0 z\"/>\n    <path style=\"stroke:url(#gradient)\" stroke-width=\"10\" d=\"M 200 100 H 300 v 80 H 200 z\"/>\n    <path class=\"lg\" stroke-width=\"10\" d=\"M 0 200 h 100 v 80 H 0 z\"/>\n    <path class=\"lg\" stroke-width=\"10\" d=\"M 200 200 H 300 v 80 H 200 z\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-5 -5 300 300\">\n    <style>\n        path.lg{stroke:url(#gradient);}\n    </style>\n    <linearGradient id=\"gradient\">\n        <stop offset=\"0\" stop-color=\"#ff0000\"/>\n        <stop offset=\"1\" stop-color=\"#0000ff\"/>\n    </linearGradient>\n    <path stroke=\"url(#gradient)\" stroke-width=\"10\" d=\"M 0 0 H 100 V 80 H 0 z\"/>\n    <path stroke=\"url(#gradient)\" stroke-width=\"10\" d=\"M 200 0 H 300 V 80 H 200 z\"/>\n    <path style=\"stroke:url(#gradient)\" stroke-width=\"10\" d=\"M 0 100 h 100 v 80 H 0 z\"/>\n    <path style=\"stroke:url(#gradient)\" stroke-width=\"10\" d=\"M 200 100 H 300 v 80 H 200 z\"/>\n    <path class=\"lg\" stroke-width=\"10\" d=\"M 0 200 h 100 v 80 H 0 z\"/>\n    <path class=\"lg\" stroke-width=\"10\" d=\"M 200 200 H 300 v 80 H 200 z\"/>\n</svg>"
  },
  {
    "path": "test/plugins/mergePaths.10.svg.txt",
    "content": "Don't merge paths with a filter URL (issue #1267).\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-5 -5 300 300\">\n    <style>\n        path.lg{filter:url(#blurMe);}\n    </style>\n    <filter id=\"blurMe\" x=\".1\">\n        <feGaussianBlur stdDeviation=\"5\"/>\n    </filter>\n    <path filter=\"url(#blurMe)\" fill=\"red\" d=\"M 0 0 H 100 V 80 H 0 z\"/>\n    <path filter=\"url(#blurMe)\" fill=\"red\" d=\"M 200 0 H 300 V 80 H 200 z\"/>\n    <path style=\"filter:url(#blurMe)\" fill=\"red\" d=\"M 0 100 h 100 v 80 H 0 z\"/>\n    <path style=\"filter:url(#blurMe)\" fill=\"red\" d=\"M 200 100 H 300 v 80 H 200 z\"/>\n    <path class=\"lg\" fill=\"red\" d=\"M 0 200 h 100 v 80 H 0 z\"/>\n    <path class=\"lg\" fill=\"red\" d=\"M 200 200 H 300 v 80 H 200 z\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-5 -5 300 300\">\n    <style>\n        path.lg{filter:url(#blurMe);}\n    </style>\n    <filter id=\"blurMe\" x=\".1\">\n        <feGaussianBlur stdDeviation=\"5\"/>\n    </filter>\n    <path filter=\"url(#blurMe)\" fill=\"red\" d=\"M 0 0 H 100 V 80 H 0 z\"/>\n    <path filter=\"url(#blurMe)\" fill=\"red\" d=\"M 200 0 H 300 V 80 H 200 z\"/>\n    <path style=\"filter:url(#blurMe)\" fill=\"red\" d=\"M 0 100 h 100 v 80 H 0 z\"/>\n    <path style=\"filter:url(#blurMe)\" fill=\"red\" d=\"M 200 100 H 300 v 80 H 200 z\"/>\n    <path class=\"lg\" fill=\"red\" d=\"M 0 200 h 100 v 80 H 0 z\"/>\n    <path class=\"lg\" fill=\"red\" d=\"M 200 200 H 300 v 80 H 200 z\"/>\n</svg>"
  },
  {
    "path": "test/plugins/mergePaths.11.svg.txt",
    "content": "Don't merge paths with a clip-path (issue #1267).\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-5 -5 400 400\">\n    <style>\n        path.lg{clip-path:url(#myClip);}\n    </style>\n    <clipPath id=\"myClip\" clipPathUnits=\"objectBoundingBox\">\n        <circle cx=\".5\" cy=\".5\" r=\".5\"/>\n    </clipPath>\n    <path clip-path=\"url(#myClip)\" fill=\"red\" d=\"M 0 0 H 100 V 80 H 0 z\"/>\n    <path clip-path=\"url(#myClip)\" fill=\"red\" d=\"M 200 0 H 300 V 80 H 200 z\"/>\n    <path style=\"clip-path:url(#myClip)\" fill=\"red\" d=\"M 0 100 h 100 v 80 H 0 z\"/>\n    <path style=\"clip-path:url(#myClip)\" fill=\"red\" d=\"M 200 100 H 300 v 80 H 200 z\"/>\n    <path class=\"lg\" fill=\"red\" d=\"M 0 200 h 100 v 80 H 0 z\"/>\n    <path class=\"lg\" fill=\"red\" d=\"M 200 200 H 300 v 80 H 200 z\"/>\n    <path style=\"clip-path:circle(25%)\" fill=\"red\" d=\"M 0 300 h 100 v 80 H 0 z\"/>\n    <path style=\"clip-path:circle(25%)\" fill=\"red\" d=\"M 200 300 H 300 v 80 H 200 z\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-5 -5 400 400\">\n    <style>\n        path.lg{clip-path:url(#myClip);}\n    </style>\n    <clipPath id=\"myClip\" clipPathUnits=\"objectBoundingBox\">\n        <circle cx=\".5\" cy=\".5\" r=\".5\"/>\n    </clipPath>\n    <path clip-path=\"url(#myClip)\" fill=\"red\" d=\"M 0 0 H 100 V 80 H 0 z\"/>\n    <path clip-path=\"url(#myClip)\" fill=\"red\" d=\"M 200 0 H 300 V 80 H 200 z\"/>\n    <path style=\"clip-path:url(#myClip)\" fill=\"red\" d=\"M 0 100 h 100 v 80 H 0 z\"/>\n    <path style=\"clip-path:url(#myClip)\" fill=\"red\" d=\"M 200 100 H 300 v 80 H 200 z\"/>\n    <path class=\"lg\" fill=\"red\" d=\"M 0 200 h 100 v 80 H 0 z\"/>\n    <path class=\"lg\" fill=\"red\" d=\"M 200 200 H 300 v 80 H 200 z\"/>\n    <path style=\"clip-path:circle(25%)\" fill=\"red\" d=\"M 0 300 h 100 v 80 H 0 z\"/>\n    <path style=\"clip-path:circle(25%)\" fill=\"red\" d=\"M 200 300 H 300 v 80 H 200 z\"/>\n</svg>"
  },
  {
    "path": "test/plugins/mergePaths.12.svg.txt",
    "content": "Don't merge paths with a mask (issue #1267).\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-5 -5 400 400\">\n    <style>\n        path.lg{mask:url(#mask);}\n    </style>\n    <mask id=\"mask\" maskContentUnits=\"objectBoundingBox\">\n        <rect fill=\"white\" x=\"0\" y=\"0\" width=\"100%\" height=\"100%\"/>\n        <circle fill=\"black\" cx=\".5\" cy=\".5\" r=\".5\"/>\n    </mask>\n    <path mask=\"url(#mask)\" fill=\"red\" d=\"M 0 0 H 100 V 80 H 0 z\"/>\n    <path mask=\"url(#mask)\" fill=\"red\" d=\"M 200 0 H 300 V 80 H 200 z\"/>\n    <path style=\"mask:url(#mask)\" fill=\"red\" d=\"M 0 100 h 100 v 80 H 0 z\"/>\n    <path style=\"mask:url(#mask)\" fill=\"red\" d=\"M 200 100 H 300 v 80 H 200 z\"/>\n    <path class=\"lg\" fill=\"red\" d=\"M 0 200 h 100 v 80 H 0 z\"/>\n    <path class=\"lg\" fill=\"red\" d=\"M 200 200 H 300 v 80 H 200 z\"/>\n    <path style=\"mask-image: linear-gradient(to left top,black, transparent)\" fill=\"red\" d=\"M 0 300 h 100 v 80 H 0 z\"/>\n    <path style=\"mask-image: linear-gradient(to left top,black, transparent)\" fill=\"red\" d=\"M 200 300 H 300 v 80 H 200 z\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-5 -5 400 400\">\n    <style>\n        path.lg{mask:url(#mask);}\n    </style>\n    <mask id=\"mask\" maskContentUnits=\"objectBoundingBox\">\n        <rect fill=\"white\" x=\"0\" y=\"0\" width=\"100%\" height=\"100%\"/>\n        <circle fill=\"black\" cx=\".5\" cy=\".5\" r=\".5\"/>\n    </mask>\n    <path mask=\"url(#mask)\" fill=\"red\" d=\"M 0 0 H 100 V 80 H 0 z\"/>\n    <path mask=\"url(#mask)\" fill=\"red\" d=\"M 200 0 H 300 V 80 H 200 z\"/>\n    <path style=\"mask:url(#mask)\" fill=\"red\" d=\"M 0 100 h 100 v 80 H 0 z\"/>\n    <path style=\"mask:url(#mask)\" fill=\"red\" d=\"M 200 100 H 300 v 80 H 200 z\"/>\n    <path class=\"lg\" fill=\"red\" d=\"M 0 200 h 100 v 80 H 0 z\"/>\n    <path class=\"lg\" fill=\"red\" d=\"M 200 200 H 300 v 80 H 200 z\"/>\n    <path style=\"mask-image: linear-gradient(to left top,black, transparent)\" fill=\"red\" d=\"M 0 300 h 100 v 80 H 0 z\"/>\n    <path style=\"mask-image: linear-gradient(to left top,black, transparent)\" fill=\"red\" d=\"M 200 300 H 300 v 80 H 200 z\"/>\n</svg>"
  },
  {
    "path": "test/plugins/mergeStyles.01.svg.txt",
    "content": "Check whether plugin works with only one style element (no further merging needed, noop).\n\n===\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; }\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; }\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergeStyles.02.svg.txt",
    "content": "Check whether plugin works with only one style element (no further merging needed, noop) and a media query.\n\n===\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>.st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; }</style>\n    <style>\n        @media screen and (max-width: 200px) { .st0 { display: none; } }\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; }@media screen and (max-width: 200px) { .st0 { display: none; } }\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergeStyles.03.svg.txt",
    "content": "Check whether plugin works with merging styles of two style elements (no media queries).\n\n===\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style media=\"print\">.st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; }</style>\n    <style>.test { background: red; }</style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        @media print{.st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; }}.test { background: red; }\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergeStyles.04.svg.txt",
    "content": "Check whether plugin works with two style elements that contain styles that also uses media queries.\n\n===\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style media=\"print\">.st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; }</style>\n    <style>.test { background: red; }</style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n    <style media=\"only screen and (min-width: 600px)\">.wrapper { color: blue; }</style>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        @media print{.st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; }}.test { background: red; }@media only screen and (min-width: 600px){.wrapper { color: blue; }}\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergeStyles.05.svg.txt",
    "content": "Check whether plugin works with no style elements at all (no merging needed, noop).\n\n===\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" class=\"st0\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" class=\"st0\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergeStyles.06.svg.txt",
    "content": "Check whether plugin removes empty <style> elements\n\n===\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n\t<style></style>\n    <style>\n        .st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; }\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; }\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergeStyles.07.svg.txt",
    "content": "Check whether plugin removes empty <style> elements with only empty <style> elements\n\n===\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n\t<style></style>\n    <style>\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergeStyles.08.svg.txt",
    "content": "Check whether plugin removes empty <style> elements mixed with non-empty <style> elements\n\n===\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style></style>\n    <style></style>\n    <style>\n        .test { color: red; }\n    </style>\n    <style></style>\n    <style></style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .test { color: red; }\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergeStyles.09.svg.txt",
    "content": "Check whether plugin removes empty <style> elements mixed with non-empty <style> elements\n\n===\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n\t  .a { fill: blue; }\n\t</style>\n\t<style type=\"\">\n\t  .b { fill: green; }\n\t</style>\n    <style type=\"text/css\">\n\t  .c { fill: red; }\n\t</style>\n\t<style type=\"text/invalid\">\n\t  .d { fill: blue; }\n\t</style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .a { fill: blue; }.b { fill: green; }.c { fill: red; }\n    </style>\n    <style type=\"text/invalid\">\n        .d { fill: blue; }\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergeStyles.10.svg.txt",
    "content": "Check whether plugin removes one empty <style> element that is also the only <style> element.\n\n===\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n\t  </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin-top:1em;margin-right:1em;margin-bottom:1em;margin-left:1em\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergeStyles.11.svg.txt",
    "content": "Convert content to cdata if any style element contains cdata\n\n===\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .st0 { fill: yellow; }\n    </style>\n    <style>\n        <![CDATA[\n            .st1 { fill: red; }\n        ]]>\n    </style>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        <![CDATA[.st0 { fill: yellow; }\n            .st1 { fill: red; }\n        ]]>\n    </style>\n</svg>\n"
  },
  {
    "path": "test/plugins/mergeStyles.12.svg.txt",
    "content": "Skip styles inside foreignObject element\n\n===\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n  <foreignObject>\n    <style>\n      .st0 { fill: yellow; }\n    </style>\n  </foreignObject>\n  <style>\n    .st1 { fill: red; }\n  </style>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <foreignObject>\n        <style>\n            .st0 { fill: yellow; }\n        </style>\n    </foreignObject>\n    <style>\n        .st1 { fill: red; }\n    </style>\n</svg>\n"
  },
  {
    "path": "test/plugins/minifyStyles.01.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; } @media screen and (max-width: 200px) { .st0 { display: none; } }\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em;\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .st0{fill:red;padding:1em}@media screen and (max-width:200px){.st0{display:none}}\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin:1em\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/minifyStyles.02.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        <![CDATA[\n            .st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; } @media screen and (max-width: 200px) { .st0 { display: none; } }\n        ]]>\n    </style>\n    <style></style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em;\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        .st0{fill:red;padding:1em}@media screen and (max-width:200px){.st0{display:none}}\n    </style>\n    <style/>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin:1em\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/minifyStyles.03.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        <![CDATA[\n            .st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; background-image: url('data:image/svg,<svg width=\"16\" height=\"16\"/>') } @media screen and (max-width: 200px) { .st0 { display: none; } }\n        ]]>\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em;\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <style>\n        <![CDATA[.st0{fill:red;padding:1em;background-image:url('data:image/svg,<svg width=\"16\" height=\"16\"/>')}@media screen and (max-width:200px){.st0{display:none}}]]>\n    </style>\n    <rect width=\"100\" height=\"100\" class=\"st0\" style=\"stroke-width:3;margin:1em\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/minifyStyles.04.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .used { p: 1 }\n        .unused { p: 2 }\n        #used { p: 3 }\n        #unused { p: 4 }\n        g { p: 5 }\n        unused { p: 6 }\n    </style>\n    <g id=\"used\" class=\"used\">\n        test\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .used{p:1}#used{p:3}g{p:5}\n    </style>\n    <g id=\"used\" class=\"used\">\n        test\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/minifyStyles.05.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .used { p: 1 }\n        .unused { p: 2 }\n        #used { p: 3 }\n        #unused { p: 4 }\n        g { p: 5 }\n        unused { p: 6 }\n    </style>\n    <g id=\"used\" class=\"used\">\n        test\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .used{p:1}#used{p:3}#unused{p:4}g{p:5}unused{p:6}\n    </style>\n    <g id=\"used\" class=\"used\">\n        test\n    </g>\n</svg>\n\n@@@\n\n{\"usage\":{\"ids\":false,\"tags\":false}}\n"
  },
  {
    "path": "test/plugins/minifyStyles.06.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .used { p: 1 }\n        .unused { p: 2 }\n        #used { p: 3 }\n        #unused { p: 4 }\n        g { p: 5 }\n        unused { p: 6 }\n    </style>\n    <g id=\"used\" class=\"used\">\n        test\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .used{p:1}.unused{p:2}#used{p:3}#unused{p:4}g{p:5}unused{p:6}\n    </style>\n    <g id=\"used\" class=\"used\">\n        test\n    </g>\n</svg>\n\n@@@\n\n{\"usage\":false}\n"
  },
  {
    "path": "test/plugins/minifyStyles.07.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .used { p: 1 }\n        .unused { p: 2 }\n    </style>\n    <script>\n        /* script element prevents removing unused styles */\n    </script>\n    <g class=\"used\">\n        test\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .used{p:1}.unused{p:2}\n    </style>\n    <script>\n        /* script element prevents removing unused styles */\n    </script>\n    <g class=\"used\">\n        test\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/minifyStyles.08.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .used { p: 1 }\n        .unused { p: 2 }\n    </style>\n    <g class=\"used\" onclick=\"/* on* attributes prevents removing unused styles */\">\n        test\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .used{p:1}.unused{p:2}\n    </style>\n    <g class=\"used\" onclick=\"/* on* attributes prevents removing unused styles */\">\n        test\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/minifyStyles.09.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .used { p: 1 }\n        .unused { p: 2 }\n    </style>\n    <script>\n        /* with usage.force=true script element does not prevent removing unused styles */\n    </script>\n    <g class=\"used\" onclick=\"/* with usage.force=true on* attributes doesn't prevent removing unused styles */\">\n        test\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .used{p:1}\n    </style>\n    <script>\n        /* with usage.force=true script element does not prevent removing unused styles */\n    </script>\n    <g class=\"used\" onclick=\"/* with usage.force=true on* attributes doesn't prevent removing unused styles */\">\n        test\n    </g>\n</svg>\n\n@@@\n{ \"usage\": { \"force\": true } }"
  },
  {
    "path": "test/plugins/minifyStyles.10.svg.txt",
    "content": "<svg viewBox=\"0 0 2203 1777\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style type=\"text/css\">\n        .st6{font-family:Helvetica LT Std, Helvetica, Arial; font-size:118px;; stroke-opacity:0; fill-opacity:0;}\n    </style>\n    <text class=\"st6\" transform=\"translate(353.67 1514)\">\n        tell stories in 250 characters\n    </text>\n</svg>\n\n@@@\n\n<svg viewBox=\"0 0 2203 1777\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style type=\"text/css\">\n        .st6{font-family:Helvetica LT Std,Helvetica,Arial;font-size:118px;stroke-opacity:0;fill-opacity:0}\n    </style>\n    <text class=\"st6\" transform=\"translate(353.67 1514)\">\n        tell stories in 250 characters\n    </text>\n</svg>\n"
  },
  {
    "path": "test/plugins/minifyStyles.11.svg.txt",
    "content": "Ensure all unused styles are removed, even if no there are no classes in\nthe document.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 113.9 130.4\">\n  <style>\n  .st1{fill:#453624;stroke:#453624;stroke-width:0.7495;stroke-miterlimit:10;}\n  .st2{fill:#FFFFFF;}\n  .st3{fill:#FCBF2A;}\n  </style>\n  <path d=\"\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 113.9 130.4\">\n    <path d=\"\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/moveElemsAttrsToGroup.01.svg.txt",
    "content": "Move common children attributes to group\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g attr1=\"val1\">\n        <g fill=\"red\" color=\"#000\" stroke=\"blue\">\n            text\n        </g>\n        <g>\n          <rect fill=\"red\" color=\"#000\" />\n          <ellipsis fill=\"red\" color=\"#000\" />\n        </g>\n        <circle fill=\"red\" color=\"#000\" attr3=\"val3\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g attr1=\"val1\" fill=\"red\" color=\"#000\">\n        <g stroke=\"blue\">\n            text\n        </g>\n        <g>\n            <rect/>\n            <ellipsis/>\n        </g>\n        <circle attr3=\"val3\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/moveElemsAttrsToGroup.02.svg.txt",
    "content": "Override group attributes with children attributes\n\n===\n\n<svg>\n  <g fill=\"red\">\n    <rect fill=\"blue\" />\n    <circle fill=\"blue\" />\n  </g>\n</svg>\n\n@@@\n\n<svg>\n    <g fill=\"blue\">\n        <rect/>\n        <circle/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/moveElemsAttrsToGroup.03.svg.txt",
    "content": "Move to group only inheritable attributes\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g attr1=\"val1\">\n        <g attr2=\"val2\">\n            text\n        </g>\n        <circle attr2=\"val2\" attr3=\"val3\"/>\n        <path d=\"...\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g attr1=\"val1\">\n        <g attr2=\"val2\">\n            text\n        </g>\n        <circle attr2=\"val2\" attr3=\"val3\"/>\n        <path d=\"...\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/moveElemsAttrsToGroup.04.svg.txt",
    "content": "Merge common group children transform attribute with the group transform\n\nPreserve transform on children when group has clip-path or mask\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <mask id=\"mask\">\n        <path/>\n    </mask>\n    <g transform=\"rotate(45)\">\n        <g transform=\"scale(2)\" fill=\"red\">\n            <path d=\"...\"/>\n        </g>\n        <circle fill=\"red\" transform=\"scale(2)\"/>\n    </g>\n    <g clip-path=\"url(#clipPath)\">\n        <g transform=\"translate(10 10)\"/>\n        <g transform=\"translate(10 10)\"/>\n    </g>\n    <g mask=\"url(#mask)\">\n        <g transform=\"translate(10 10)\"/>\n        <g transform=\"translate(10 10)\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <mask id=\"mask\">\n        <path/>\n    </mask>\n    <g transform=\"rotate(45) scale(2)\" fill=\"red\">\n        <g>\n            <path d=\"...\"/>\n        </g>\n        <circle/>\n    </g>\n    <g clip-path=\"url(#clipPath)\">\n        <g transform=\"translate(10 10)\"/>\n        <g transform=\"translate(10 10)\"/>\n    </g>\n    <g mask=\"url(#mask)\">\n        <g transform=\"translate(10 10)\"/>\n        <g transform=\"translate(10 10)\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/moveElemsAttrsToGroup.06.svg.txt",
    "content": "Preserve transform when all children are paths\nso the transform could be applied to path data by other plugins\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <path transform=\"scale(2)\" d=\"M0,0 L10,20\"/>\n        <path transform=\"scale(2)\" d=\"M0,10 L20,30\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <path transform=\"scale(2)\" d=\"M0,0 L10,20\"/>\n        <path transform=\"scale(2)\" d=\"M0,10 L20,30\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/moveElemsAttrsToGroup.07.svg.txt",
    "content": "Plugin is deoptimized when style element is present\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style id=\"current-color-scheme\">\n        .ColorScheme-Highlight{color:#3daee9}\n    </style>\n    <g>\n        <path transform=\"matrix(-1 0 0 1 72 51)\" class=\"ColorScheme-Highlight\" fill=\"currentColor\" d=\"M5-28h26v2H5z\"/>\n        <path transform=\"matrix(-1 0 0 1 72 51)\" class=\"ColorScheme-Highlight\" fill=\"currentColor\" d=\"M5-29h26v1H5z\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style id=\"current-color-scheme\">\n        .ColorScheme-Highlight{color:#3daee9}\n    </style>\n    <g>\n        <path transform=\"matrix(-1 0 0 1 72 51)\" class=\"ColorScheme-Highlight\" fill=\"currentColor\" d=\"M5-28h26v2H5z\"/>\n        <path transform=\"matrix(-1 0 0 1 72 51)\" class=\"ColorScheme-Highlight\" fill=\"currentColor\" d=\"M5-29h26v1H5z\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/moveElemsAttrsToGroup.08.svg.txt",
    "content": "Don't move transform if there is a filter attribute on group.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\">\n    <defs>\n        <filter id=\"a\" x=\"17\" y=\"13\" width=\"12\" height=\"10\" filterUnits=\"userSpaceOnUse\">\n            <feGaussianBlur stdDeviation=\".01\"/>\n        </filter>\n    </defs>\n    <g filter=\"url(#a)\">\n        <rect x=\"19\" y=\"12\" width=\"14\" height=\"6\" rx=\"3\" transform=\"rotate(31 19 12.79)\"/>\n        <rect x=\"19\" y=\"12\" width=\"14\" height=\"6\" rx=\"3\" transform=\"rotate(31 19 12.79)\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\">\n    <defs>\n        <filter id=\"a\" x=\"17\" y=\"13\" width=\"12\" height=\"10\" filterUnits=\"userSpaceOnUse\">\n            <feGaussianBlur stdDeviation=\".01\"/>\n        </filter>\n    </defs>\n    <g filter=\"url(#a)\">\n        <rect x=\"19\" y=\"12\" width=\"14\" height=\"6\" rx=\"3\" transform=\"rotate(31 19 12.79)\"/>\n        <rect x=\"19\" y=\"12\" width=\"14\" height=\"6\" rx=\"3\" transform=\"rotate(31 19 12.79)\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/moveGroupAttrsToElems.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g transform=\"scale(2)\">\n        <path transform=\"rotate(45)\" d=\"M0,0 L10,20\"/>\n        <path transform=\"translate(10, 20)\" d=\"M0,10 L20,30\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <path transform=\"scale(2) rotate(45)\" d=\"M0,0 L10,20\"/>\n        <path transform=\"scale(2) translate(10, 20)\" d=\"M0,10 L20,30\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/moveGroupAttrsToElems.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g transform=\"scale(2)\">\n        <path d=\"M0,0 L10,20\"/>\n        <path d=\"M0,10 L20,30\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <path d=\"M0,0 L10,20\" transform=\"scale(2)\"/>\n        <path d=\"M0,10 L20,30\" transform=\"scale(2)\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/moveGroupAttrsToElems.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g transform=\"rotate(30)\">\n        <g transform=\"scale(2)\">\n            <path d=\"M0,0 L10,20\"/>\n            <path d=\"M0,10 L20,30\"/>\n        </g>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <g>\n            <path d=\"M0,0 L10,20\" transform=\"rotate(30) scale(2)\"/>\n            <path d=\"M0,10 L20,30\" transform=\"rotate(30) scale(2)\"/>\n        </g>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/moveGroupAttrsToElems.04.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g transform=\"rotate(30)\">\n        <g>\n            <g transform=\"scale(2)\">\n                <path d=\"M0,0 L10,20\"/>\n                <path d=\"M0,10 L20,30\"/>\n            </g>\n        </g>\n        <path d=\"M0,10 L20,30\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <g>\n            <g>\n                <path d=\"M0,0 L10,20\" transform=\"rotate(30) scale(2)\"/>\n                <path d=\"M0,10 L20,30\" transform=\"rotate(30) scale(2)\"/>\n            </g>\n        </g>\n        <path d=\"M0,10 L20,30\" transform=\"rotate(30)\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/moveGroupAttrsToElems.05.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g transform=\"scale(2)\" clip-path=\"url(#a)\">\n        <path d=\"M0,0 L10,20\"/>\n        <path d=\"M0,10 L20,30\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g transform=\"scale(2)\" clip-path=\"url(#a)\">\n        <path d=\"M0,0 L10,20\"/>\n        <path d=\"M0,10 L20,30\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/moveGroupAttrsToElems.06.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <g transform=\"translate(0 -140)\">\n        <path id=\"c\" transform=\"scale(.5)\" d=\"M0,0 L10,20\"/>\n    </g>\n    <use xlink:href=\"#c\" transform=\"translate(-140)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <g transform=\"translate(0 -140)\">\n        <path id=\"c\" transform=\"scale(.5)\" d=\"M0,0 L10,20\"/>\n    </g>\n    <use xlink:href=\"#c\" transform=\"translate(-140)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/prefixIds.01.svg.txt",
    "content": "<svg width=\"120\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .test {\n            color: blue;\n        }\n        #test {\n            color: red;\n        }\n\n    </style>\n    <rect class=\"test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect class=\"\" id=\"test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n<svg width=\"120\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .prefixIds_01_svg_txt__test{color:blue}#prefixIds_01_svg_txt__test{color:red}\n    </style>\n    <rect class=\"prefixIds_01_svg_txt__test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect class=\"\" id=\"prefixIds_01_svg_txt__test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/prefixIds.02.svg.txt",
    "content": "<svg width=\"120\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <linearGradient id=\"MyGradient\">\n            <stop offset=\"5%\" stop-color=\"green\"/>\n            <stop offset=\"95%\" stop-color=\"gold\"/>\n        </linearGradient>\n    </defs>\n    <rect fill=\"url(#MyGradient)\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n<svg width=\"120\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <linearGradient id=\"prefixIds_02_svg_txt__MyGradient\">\n            <stop offset=\"5%\" stop-color=\"green\"/>\n            <stop offset=\"95%\" stop-color=\"gold\"/>\n        </linearGradient>\n    </defs>\n    <rect fill=\"url(#prefixIds_02_svg_txt__MyGradient)\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/prefixIds.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <use xlink:href=\"#Port\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <use xlink:href=\"#prefixIds_03_svg_txt__Port\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/prefixIds.04.svg.txt",
    "content": "<svg width=\"120\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        rect {\n            cursor: pointer;\n            shape-rendering: crispEdges;\n            fill:url(\"#MyGradient\");\n        }\n\n    </style>\n    <rect x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n<svg width=\"120\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        rect{cursor:pointer;shape-rendering:crispEdges;fill:url(#prefixIds_04_svg_txt__MyGradient)}\n    </style>\n    <rect x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/prefixIds.05.svg.txt",
    "content": "<svg width=\"340\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <linearGradient id=\"gradient_1\">\n            <stop offset=\"5%\" stop-color=\"green\"/>\n            <stop offset=\"95%\" stop-color=\"gold\"/>\n        </linearGradient>\n        <linearGradient id=\"gradient_2\">\n            <stop offset=\"5%\" stop-color=\"red\"/>\n            <stop offset=\"95%\" stop-color=\"black\"/>\n        </linearGradient>\n        <linearGradient id=\"gradient_3\">\n            <stop offset=\"5%\" stop-color=\"blue\"/>\n            <stop offset=\"95%\" stop-color=\"orange\"/>\n        </linearGradient>\n    </defs>\n    <rect fill=\"url(#gradient_1)\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect fill=\"url(#gradient_2)\" x=\"120\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect fill=\"url(#gradient_3)\" x=\"230\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n<svg width=\"340\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <linearGradient id=\"prefixIds_05_svg_txt__gradient_1\">\n            <stop offset=\"5%\" stop-color=\"green\"/>\n            <stop offset=\"95%\" stop-color=\"gold\"/>\n        </linearGradient>\n        <linearGradient id=\"prefixIds_05_svg_txt__gradient_2\">\n            <stop offset=\"5%\" stop-color=\"red\"/>\n            <stop offset=\"95%\" stop-color=\"black\"/>\n        </linearGradient>\n        <linearGradient id=\"prefixIds_05_svg_txt__gradient_3\">\n            <stop offset=\"5%\" stop-color=\"blue\"/>\n            <stop offset=\"95%\" stop-color=\"orange\"/>\n        </linearGradient>\n    </defs>\n    <rect fill=\"url(#prefixIds_05_svg_txt__gradient_1)\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect fill=\"url(#prefixIds_05_svg_txt__gradient_2)\" x=\"120\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect fill=\"url(#prefixIds_05_svg_txt__gradient_3)\" x=\"230\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/prefixIds.06.svg.txt",
    "content": "<svg width=\"120\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .test {\n            color: blue;\n        }\n        .test2 {\n            color: green;\n        }\n        #test {\n            color: red;\n        }\n        .test3 .test4 {\n            color: black;\n        }\n        .test5.test6 {\n            color: brown;\n        }\n        .test5.test6 #test7 {\n            color: yellow;\n        }\n    </style>\n    <rect class=\"test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect class=\"test test2\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect class=\"test  test2\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect class=\"\" id=\"test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n<svg width=\"120\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .prefixIds_06_svg_txt__test{color:blue}.prefixIds_06_svg_txt__test2{color:green}#prefixIds_06_svg_txt__test{color:red}.prefixIds_06_svg_txt__test3 .prefixIds_06_svg_txt__test4{color:black}.prefixIds_06_svg_txt__test5.prefixIds_06_svg_txt__test6{color:brown}.prefixIds_06_svg_txt__test5.prefixIds_06_svg_txt__test6 #prefixIds_06_svg_txt__test7{color:yellow}\n    </style>\n    <rect class=\"prefixIds_06_svg_txt__test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect class=\"prefixIds_06_svg_txt__test prefixIds_06_svg_txt__test2\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect class=\"prefixIds_06_svg_txt__test prefixIds_06_svg_txt__test2\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect class=\"\" id=\"prefixIds_06_svg_txt__test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/prefixIds.07.svg.txt",
    "content": "<svg width=\"120\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .test {\n            color: blue;\n        }\n        #test {\n            color: red;\n        }\n\n    </style>\n    <rect class=\"test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect class=\"\" id=\"test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n<svg width=\"120\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .prefixIds_07_svg_txt__test{color:blue}#test{color:red}\n    </style>\n    <rect class=\"prefixIds_07_svg_txt__test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect class=\"\" id=\"test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n{\"prefixIds\":false}\n"
  },
  {
    "path": "test/plugins/prefixIds.08.svg.txt",
    "content": "<svg width=\"120\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .test {\n            color: blue;\n        }\n        #test {\n            color: red;\n        }\n\n    </style>\n    <rect class=\"test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect class=\"\" id=\"test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n<svg width=\"120\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .test{color:blue}#prefixIds_08_svg_txt__test{color:red}\n    </style>\n    <rect class=\"test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect class=\"\" id=\"prefixIds_08_svg_txt__test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n{\"prefixClassNames\":false}\n"
  },
  {
    "path": "test/plugins/prefixIds.09.svg.txt",
    "content": "<svg width=\"120\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .test {\n            color: blue;\n        }\n        #test {\n            color: red;\n        }\n\n    </style>\n    <rect class=\"test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect class=\"\" id=\"test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n<svg width=\"120\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .test{color:blue}#test{color:red}\n    </style>\n    <rect class=\"test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n    <rect class=\"\" id=\"test\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n{\"prefixIds\":false,\"prefixClassNames\":false}\n"
  },
  {
    "path": "test/plugins/prefixIds.10.svg.txt",
    "content": "<g xmlns=\"http://www.w3.org/2000/svg\" transform=\"translate(130, 112)\">\n    <path class=\"st1\" d=\"M27,0h-37v64C-10,64,27,64.2,27,0z\" transform=\"scale(0.811377 1)\">\n    <animateTransform id=\"t_1s\" attributeName=\"transform\" type=\"scale\" from=\"1 1\" to=\"-1 1\" begin=\"0s; t_2s.end\" dur=\"0.5s\" repeatCount=\"0\"/>\n    <animateTransform id=\"t_2s\" attributeName=\"transform\" type=\"scale\" from=\"-1 1\" to=\"1 1\" begin=\"t_1s.end\" dur=\"0.5s\" repeatCount=\"0\"/>\n    </path>\n</g>\n\n@@@\n\n<g xmlns=\"http://www.w3.org/2000/svg\" transform=\"translate(130, 112)\">\n    <path class=\"prefixIds_10_svg_txt__st1\" d=\"M27,0h-37v64C-10,64,27,64.2,27,0z\" transform=\"scale(0.811377 1)\">\n        <animateTransform id=\"prefixIds_10_svg_txt__t_1s\" attributeName=\"transform\" type=\"scale\" from=\"1 1\" to=\"-1 1\" begin=\"0s; prefixIds_10_svg_txt__t_2s.end\" dur=\"0.5s\" repeatCount=\"0\"/>\n        <animateTransform id=\"prefixIds_10_svg_txt__t_2s\" attributeName=\"transform\" type=\"scale\" from=\"-1 1\" to=\"1 1\" begin=\"prefixIds_10_svg_txt__t_1s.end\" dur=\"0.5s\" repeatCount=\"0\"/>\n    </path>\n</g>\n"
  },
  {
    "path": "test/plugins/prefixIds.11.svg.txt",
    "content": "prefixIds should correctly handle url()s in style attribute, including multiple ones\n\n===\n\n<svg width=\"120\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <linearGradient id=\"fill\"/>\n        <linearGradient id=\"stroke\"/>\n    </defs>\n    <rect style=\"fill:url(#fill); stroke: url(#stroke)\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n<svg width=\"120\" height=\"120\" xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <linearGradient id=\"prefixIds_11_svg_txt__fill\"/>\n        <linearGradient id=\"prefixIds_11_svg_txt__stroke\"/>\n    </defs>\n    <rect style=\"fill:url(#prefixIds_11_svg_txt__fill); stroke: url(#prefixIds_11_svg_txt__stroke)\" x=\"10\" y=\"10\" width=\"100\" height=\"100\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/prefixIds.12.svg.txt",
    "content": "Prefix IDs should apply to all nodes in styles, namely when styles are split\ninto multiple nodes due to XML comments.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1 1\">\n  <style>\n    <!-- uwu -->\n    #a {}\n  </style>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1 1\">\n    <style>\n<!--uwu-->\n        #prefixIds_12_svg_txt__a{}\n    </style>\n</svg>\n"
  },
  {
    "path": "test/plugins/prefixIds.13.svg.txt",
    "content": "Prefix IDs should apply to all nodes in styles, namely when styles are split\ninto multiple nodes due to XML comments.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1 1\">\n  <style>\n    <!-- uwu -->\n    #a13 {} <!-- xyz -->\n    #b13 {}\n  </style>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1 1\">\n    <style>\n<!--uwu-->\n        #prefixIds_13_svg_txt__a13{}\n<!--xyz-->\n        #prefixIds_13_svg_txt__b13{}\n    </style>\n</svg>\n"
  },
  {
    "path": "test/plugins/prefixIds.test.js",
    "content": "import { optimize } from '../../lib/svgo.js';\n\ntest('should extract prefix from path basename', () => {\n  const svg = `<svg id=\"my-id\"></svg>`;\n  expect(\n    optimize(svg, {\n      plugins: ['prefixIds'],\n    }).data,\n  ).toBe(`<svg id=\"prefix__my-id\"/>`);\n  expect(\n    optimize(svg, {\n      plugins: ['prefixIds'],\n      path: 'input.svg',\n    }).data,\n  ).toBe(`<svg id=\"input_svg__my-id\"/>`);\n  expect(\n    optimize(svg, {\n      plugins: ['prefixIds'],\n      path: 'path/to/input.svg',\n    }).data,\n  ).toBe(`<svg id=\"input_svg__my-id\"/>`);\n});\n"
  },
  {
    "path": "test/plugins/removeAttributesBySelector.01.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" fill=\"#00ff00\" stroke=\"#00ff00\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" stroke=\"#00ff00\"/>\n</svg>\n\n@@@\n\n{ \"selector\": \"[fill='#00ff00']\", \"attributes\": \"fill\" }\n"
  },
  {
    "path": "test/plugins/removeAttributesBySelector.02.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" fill=\"#00ff00\" stroke=\"#00ff00\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n{ \"selector\": \"[fill='#00ff00']\", \"attributes\": [\"fill\", \"stroke\"] }\n"
  },
  {
    "path": "test/plugins/removeAttributesBySelector.03.svg.txt",
    "content": "<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect id=\"remove\" x=\"0\" y=\"0\" width=\"100\" height=\"100\" fill=\"#00ff00\" stroke=\"#00ff00\"/>\n</svg>\n\n@@@\n\n<svg id=\"test\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\"/>\n</svg>\n\n@@@\n\n{ \"selectors\": [{ \"selector\": \"[fill='#00ff00']\", \"attributes\": \"fill\" }, { \"selector\": \"#remove\", \"attributes\": [\"stroke\", \"id\"] }] }\n"
  },
  {
    "path": "test/plugins/removeAttrs.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <circle fill=\"red\" stroke-width=\"6\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <path fill=\"red\" stroke=\"red\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <circle fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle cx=\"60\" cy=\"60\" r=\"50\"/>\n    <path stroke=\"red\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n</svg>\n\n@@@\n\n{\"attrs\":[\"circle:stroke.*\",\"path:fill\"]}\n"
  },
  {
    "path": "test/plugins/removeAttrs.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <circle fill=\"red\" stroke-width=\"6\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <path fill=\"red\" stroke=\"red\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <circle stroke-width=\"6\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <path d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n</svg>\n\n@@@\n\n{\"attrs\":\"(fill|stroke)\"}\n"
  },
  {
    "path": "test/plugins/removeAttrs.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <circle fill=\"currentColor\" stroke-width=\"6\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke=\"currentColor\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <path fill=\"red\" stroke=\"red\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <circle fill=\"currentColor\" stroke-width=\"6\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke=\"currentColor\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <path d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n</svg>\n\n@@@\n\n{\"attrs\":\"(fill|stroke)\", \"preserveCurrentColor\": true}\n"
  },
  {
    "path": "test/plugins/removeAttrs.04.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <circle fill=\"red\" stroke-width=\"6\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke=\"#FFF\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"25\"/>\n    <path fill=\"red\" stroke=\"red\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <circle stroke-width=\"6\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke=\"#FFF\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"25\"/>\n    <path d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n</svg>\n\n@@@\n\n{\"attrs\":\"*:(stroke|fill):red\"}\n"
  },
  {
    "path": "test/plugins/removeAttrs.05.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <circle fill=\"red\" stroke-width=\"6\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke=\"#FFF\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"25\"/>\n    <path fill=\"red\" stroke=\"red\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <circle stroke-width=\"6\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke=\"#FFF\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"25\"/>\n    <path d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n</svg>\n\n@@@\n\n{\"attrs\":\"*:(stroke|fill):((?!^#FFF$).)*\"}\n"
  },
  {
    "path": "test/plugins/removeAttrs.06.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <circle fill=\"red\" stroke-width=\"6\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke=\"#FFF\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"25\"/>\n    <path fill=\"red\" stroke=\"red\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <circle fill=\"red\" stroke-width=\"6\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle stroke=\"#FFF\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"25\"/>\n    <path fill=\"red\" stroke=\"red\" d=\"M100,200 300,400 H100 V300 C100,100 250,100 250,200 S400,300 400,200 Q400,50 600,300 T1000,300 z\"/>\n</svg>\n\n@@@\n\n{}\n"
  },
  {
    "path": "test/plugins/removeAttrs.07.svg.txt",
    "content": "The preserveCurrentColor param should be case-insensitive.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 150 150\">\n    <linearGradient id=\"A\">\n        <stop stop-color=\"ReD\" offset=\"5%\"/>\n    </linearGradient>\n    <text x=\"0\" y=\"32\" fill=\"currentColor\">uwu</text>\n    <text x=\"0\" y=\"64\" fill=\"currentcolor\">owo</text>\n    <text x=\"0\" y=\"96\" fill=\"url(#A)\">eue</text>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 150 150\">\n    <linearGradient id=\"A\">\n        <stop stop-color=\"ReD\" offset=\"5%\"/>\n    </linearGradient>\n    <text x=\"0\" y=\"32\" fill=\"currentColor\">uwu</text>\n    <text x=\"0\" y=\"64\" fill=\"currentcolor\">owo</text>\n    <text x=\"0\" y=\"96\">eue</text>\n</svg>\n\n@@@\n\n{\"attrs\":\"fill\", \"preserveCurrentColor\": true}\n"
  },
  {
    "path": "test/plugins/removeComments.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <!--- test -->\n    <g>\n        <!--- test -->\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeComments.02.svg.txt",
    "content": "<!--!Icon Font v1 by @iconfont - Copyright 2023 Icon Font CIC.-->\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n</svg>\n\n@@@\n\n<!--!Icon Font v1 by @iconfont - Copyright 2023 Icon Font CIC.-->\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/removeComments.03.svg.txt",
    "content": "<!--!Icon Font v1 by @iconfont - Copyright 2023 Icon Font CIC.-->\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n</svg>\n\n@@@\n\n{\"preservePatterns\":false}\n"
  },
  {
    "path": "test/plugins/removeDeprecatedAttrs.01.svg.txt",
    "content": "Removes safe deprecated version attribute from svg node.\n\n===\n\n<svg version=\"1.1\" viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n    <rect x=\"10\" y=\"10\" width=\"80\" height=\"80\"/>\n</svg>\n\n@@@\n\n<svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n    <rect x=\"10\" y=\"10\" width=\"80\" height=\"80\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeDeprecatedAttrs.02.svg.txt",
    "content": "Does not remove unsafe deprecated viewTarget attribute from view node by default.\n\n===\n\n<svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n    <view id=\"one\" viewBox=\"0 0 100 100\" viewTarget=\"\"/>\n</svg>\n\n@@@\n\n<svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n    <view id=\"one\" viewBox=\"0 0 100 100\" viewTarget=\"\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeDeprecatedAttrs.03.svg.txt",
    "content": "Remove unsafe deprecated viewTarget attribute from view node with param.\n\n===\n\n<svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n    <view id=\"one\" viewBox=\"0 0 100 100\" viewTarget=\"\"/>\n</svg>\n\n@@@\n\n<svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n    <view id=\"one\" viewBox=\"0 0 100 100\"/>\n</svg>\n\n@@@\n\n{ \"removeUnsafe\": true }\n"
  },
  {
    "path": "test/plugins/removeDeprecatedAttrs.04.svg.txt",
    "content": "Removes deprecated presentation group attribute enable-background.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100.5\" height=\".5\" enable-background=\"new 0 0 100.5 .5\">\n    <defs>\n        <filter id=\"ShiftBGAndBlur\">\n            <feOffset dx=\"0\" dy=\"75\"/>\n        </filter>\n    </defs>\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100.5\" height=\".5\">\n    <defs>\n        <filter id=\"ShiftBGAndBlur\">\n            <feOffset dx=\"0\" dy=\"75\"/>\n        </filter>\n    </defs>\n    test\n</svg>\n\n@@@\n\n{ \"removeUnsafe\": true }\n"
  },
  {
    "path": "test/plugins/removeDeprecatedAttrs.05.svg.txt",
    "content": "Removes deprecated xml:lang attribute when lang attribute exists.\n\n===\n\n<svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n    <text xml:lang=\"en-CA\" lang=\"en-US\">English text</text>\n</svg>\n\n@@@\n\n<svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n    <text lang=\"en-US\">English text</text>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeDeprecatedAttrs.06.svg.txt",
    "content": "Keeps xml:lang attribute when lang attribute doesn't exist.\n\n===\n\n<svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n    <text xml:lang=\"en-US\">English text</text>\n</svg>\n\n@@@\n\n<svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n    <text xml:lang=\"en-US\">English text</text>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeDeprecatedAttrs.07.svg.txt",
    "content": "Removes unsafe xml:lang attribute when lang attribute doesn't exist with removeUnsafe param.\n\n===\n\n<svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n    <text xml:lang=\"en-US\">English text</text>\n</svg>\n\n@@@\n\n<svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n    <text>English text</text>\n</svg>\n\n@@@\n\n{ \"removeUnsafe\": true }\n"
  },
  {
    "path": "test/plugins/removeDeprecatedAttrs.08.svg.txt",
    "content": "Keeps deprecated version attribute when it is a CSS selectors\n\n===\n\n<svg version=\"1.1\" viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        <![CDATA[svg[version=\"1.1\"]{fill:blue;}rect[clip]{fill:green;}]]>\n    </style>\n    <rect x=\"10\" y=\"10\" width=\"80\" height=\"80\" clip=\"1\"/>\n</svg>\n\n@@@\n\n<svg version=\"1.1\" viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        <![CDATA[svg[version=\"1.1\"]{fill:blue;}rect[clip]{fill:green;}]]>\n    </style>\n    <rect x=\"10\" y=\"10\" width=\"80\" height=\"80\" clip=\"1\"/>\n</svg>\n\n@@@\n\n{ \"removeUnsafe\": true }\n"
  },
  {
    "path": "test/plugins/removeDesc.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <desc>Created with Sketch.</desc>\n    <g/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeDimensions.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100.5\" height=\".5\" viewBox=\"0 0 100.5 .5\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100.5 .5\">\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/removeDimensions.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"50\" viewBox=\"0 0 100 50\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 50\">\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/removeDimensions.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" viewBox=\"0 0 100 50\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 50\">\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/removeDimensions.04.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"50\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 50\">\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/removeDimensions.05.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100.5\" height=\"0.5\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100.5 0.5\">\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/removeDoctype.01.svg.txt",
    "content": "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/removeEditorsNSData.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\">\n    <sodipodi:namedview>\n        ...\n    </sodipodi:namedview>\n\n    <path d=\"...\" sodipodi:nodetypes=\"cccc\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"...\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeEditorsNSData.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:sodipodi=\"http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd\">\n    <sodipodi:namedview>\n        ...\n    </sodipodi:namedview>\n\n    <path d=\"...\" sodipodi:nodetypes=\"cccc\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"...\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeElementsByAttr.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"19\" height=\"19\" viewBox=\"0 0 19 19\">\n    <rect id=\"someID\" width=\"19\" height=\"19\"/>\n    <path id=\"close\" d=\"M1093.5,31.792l-0.72.721-8.27-8.286-8.28,8.286-0.72-.721,8.28-8.286-8.28-8.286,0.72-.721,8.28,8.286,8.27-8.286,0.72,0.721-8.27,8.286Z\" transform=\"translate(-1075 -14)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"19\" height=\"19\" viewBox=\"0 0 19 19\">\n    <rect id=\"someID\" width=\"19\" height=\"19\"/>\n    <path id=\"close\" d=\"M1093.5,31.792l-0.72.721-8.27-8.286-8.28,8.286-0.72-.721,8.28-8.286-8.28-8.286,0.72-.721,8.28,8.286,8.27-8.286,0.72,0.721-8.27,8.286Z\" transform=\"translate(-1075 -14)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeElementsByAttr.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"19\" height=\"19\" viewBox=\"0 0 19 19\">\n    <rect id=\"someID\" width=\"19\" height=\"19\"/>\n    <path id=\"close\" d=\"M1093.5,31.792l-0.72.721-8.27-8.286-8.28,8.286-0.72-.721,8.28-8.286-8.28-8.286,0.72-.721,8.28,8.286,8.27-8.286,0.72,0.721-8.27,8.286Z\" transform=\"translate(-1075 -14)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"19\" height=\"19\" viewBox=\"0 0 19 19\">\n    <path id=\"close\" d=\"M1093.5,31.792l-0.72.721-8.27-8.286-8.28,8.286-0.72-.721,8.28-8.286-8.28-8.286,0.72-.721,8.28,8.286,8.27-8.286,0.72,0.721-8.27,8.286Z\" transform=\"translate(-1075 -14)\"/>\n</svg>\n\n@@@\n\n{ \"id\": \"someID\" }\n"
  },
  {
    "path": "test/plugins/removeElementsByAttr.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"19\" height=\"19\" viewBox=\"0 0 19 19\">\n    <rect id=\"someID\" width=\"19\" height=\"19\"/>\n    <path id=\"anotherID\" d=\"M1093.5,31.792l-0.72.721-8.27-8.286-8.28,8.286-0.72-.721,8.28-8.286-8.28-8.286,0.72-.721,8.28,8.286,8.27-8.286,0.72,0.721-8.27,8.286Z\" transform=\"translate(-1075 -14)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"19\" height=\"19\" viewBox=\"0 0 19 19\"/>\n\n@@@\n\n{ \"id\": [\"someID\", \"anotherID\"] }\n"
  },
  {
    "path": "test/plugins/removeElementsByAttr.04.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"19\" height=\"19\" viewBox=\"0 0 19 19\">\n    <rect class=\"someClass\" width=\"19\" height=\"19\"/>\n    <path class=\"close\" d=\"M1093.5,31.792l-0.72.721-8.27-8.286-8.28,8.286-0.72-.721,8.28-8.286-8.28-8.286,0.72-.721,8.28,8.286,8.27-8.286,0.72,0.721-8.27,8.286Z\" transform=\"translate(-1075 -14)\"/>\n    <rect class=\"someClass extraClass\"/>\n    <rect class=\"SOMEclass case-sensitive\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"19\" height=\"19\" viewBox=\"0 0 19 19\">\n    <path class=\"close\" d=\"M1093.5,31.792l-0.72.721-8.27-8.286-8.28,8.286-0.72-.721,8.28-8.286-8.28-8.286,0.72-.721,8.28,8.286,8.27-8.286,0.72,0.721-8.27,8.286Z\" transform=\"translate(-1075 -14)\"/>\n    <rect class=\"SOMEclass case-sensitive\"/>\n</svg>\n\n@@@\n\n{ \"class\": \"someClass\" }\n"
  },
  {
    "path": "test/plugins/removeElementsByAttr.05.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"19\" height=\"19\" viewBox=\"0 0 19 19\">\n    <rect class=\"someClass\" width=\"19\" height=\"19\"/>\n    <path class=\"anotherClass\" d=\"M1093.5,31.792l-0.72.721-8.27-8.286-8.28,8.286-0.72-.721,8.28-8.286-8.28-8.286,0.72-.721,8.28,8.286,8.27-8.286,0.72,0.721-8.27,8.286Z\" transform=\"translate(-1075 -14)\"/>\n    <rect class=\"someClass extraClass\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"19\" height=\"19\" viewBox=\"0 0 19 19\"/>\n\n@@@\n\n{ \"class\": [\"someClass\", \"anotherClass\"] }\n"
  },
  {
    "path": "test/plugins/removeElementsByAttr.06.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"19\" height=\"19\" viewBox=\"0 0 19 19\">\n    <rect class=\"someClass\" width=\"19\" height=\"19\"/>\n    <path class=\"someClass extraClass\" d=\"M1093.5,31.792l-0.72.721-8.27-8.286-8.28,8.286-0.72-.721,8.28-8.286-8.28-8.286,0.72-.721,8.28,8.286,8.27-8.286,0.72,0.721-8.27,8.286Z\" transform=\"translate(-1075 -14)\"/>\n    <rect class=\"anotherClass\"/>\n    <path id=\"someID\" class=\"anotherID\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"19\" height=\"19\" viewBox=\"0 0 19 19\">\n    <rect class=\"anotherClass\"/>\n</svg>\n\n@@@\n\n{ \"id\": \"someID\", \"class\": \"someClass\" }\n"
  },
  {
    "path": "test/plugins/removeElementsByAttr.07.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"19\" height=\"19\" viewBox=\"0 0 19 19\">\n    <rect class=\"some-class\" width=\"19\" height=\"19\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"19\" height=\"19\" viewBox=\"0 0 19 19\">\n    <rect class=\"some-class\" width=\"19\" height=\"19\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeEmptyAttrs.01.svg.txt",
    "content": "Removes empty attributes\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g attr1=\"\" attr2=\"\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeEmptyAttrs.02.svg.txt",
    "content": "Empty conditional processing attributes should be preserved\nto hide elements\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g requiredFeatures=\"\"/>\n    <g requiredExtensions=\"\"/>\n    <g systemLanguage=\"\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g requiredFeatures=\"\"/>\n    <g requiredExtensions=\"\"/>\n    <g systemLanguage=\"\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeEmptyContainers.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <pattern/>\n    <g>\n        <marker>\n            <a/>\n        </marker>\n    </g>\n    <path d=\"...\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"...\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeEmptyContainers.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <defs>\n        <pattern id=\"a\">\n            <rect/>\n        </pattern>\n        <pattern xlink:href=\"url(#a)\" id=\"b\"/>\n    </defs>\n    <g>\n        <marker>\n            <a/>\n        </marker>\n        <path d=\"...\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <defs>\n        <pattern id=\"a\">\n            <rect/>\n        </pattern>\n        <pattern xlink:href=\"url(#a)\" id=\"b\"/>\n    </defs>\n    <g>\n        <path d=\"...\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeEmptyContainers.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:x=\"http://www.w3.org/1999/xlink\">\n    <defs>\n        <pattern id=\"a\">\n            <rect/>\n        </pattern>\n        <pattern x:href=\"url(#a)\" id=\"b\"/>\n    </defs>\n    <g>\n        <marker>\n            <a/>\n        </marker>\n        <path d=\"...\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:x=\"http://www.w3.org/1999/xlink\">\n    <defs>\n        <pattern id=\"a\">\n            <rect/>\n        </pattern>\n        <pattern x:href=\"url(#a)\" id=\"b\"/>\n    </defs>\n    <g>\n        <path d=\"...\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeEmptyContainers.04.svg.txt",
    "content": "<svg>\n  <defs>\n    <filter id=\"feTileFilter\" filterUnits=\"userSpaceOnUse\" primitiveUnits=\"userSpaceOnUse\" x=\"115\" y=\"40\" width=\"250\" height=\"250\">\n      <feFlood x=\"115\" y=\"40\" width=\"54\" height=\"19\" flood-color=\"lime\"/>\n      <feOffset x=\"115\" y=\"40\" width=\"50\" height=\"25\" dx=\"6\" dy=\"6\" result=\"offset\"/>\n      <feTile/>\n    </filter>\n  </defs>\n  <g filter=\"url(#feTileFilter)\"/>\n</svg>\n\n@@@\n\n<svg>\n    <defs>\n        <filter id=\"feTileFilter\" filterUnits=\"userSpaceOnUse\" primitiveUnits=\"userSpaceOnUse\" x=\"115\" y=\"40\" width=\"250\" height=\"250\">\n            <feFlood x=\"115\" y=\"40\" width=\"54\" height=\"19\" flood-color=\"lime\"/>\n            <feOffset x=\"115\" y=\"40\" width=\"50\" height=\"25\" dx=\"6\" dy=\"6\" result=\"offset\"/>\n            <feTile/>\n        </filter>\n    </defs>\n    <g filter=\"url(#feTileFilter)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeEmptyContainers.05.svg.txt",
    "content": "<svg width=\"480\" height=\"360\" xmlns=\"http://www.w3.org/2000/svg\">\n  <mask id=\"testMask\" />\n  <rect x=\"100\" y=\"100\" width=\"250\" height=\"150\" fill=\"green\" />\n  <rect x=\"100\" y=\"100\" width=\"250\" height=\"150\" fill=\"red\" mask=\"url(#testMask)\" />\n</svg>\n\n@@@\n\n<svg width=\"480\" height=\"360\" xmlns=\"http://www.w3.org/2000/svg\">\n    <mask id=\"testMask\"/>\n    <rect x=\"100\" y=\"100\" width=\"250\" height=\"150\" fill=\"green\"/>\n    <rect x=\"100\" y=\"100\" width=\"250\" height=\"150\" fill=\"red\" mask=\"url(#testMask)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeEmptyContainers.06.svg.txt",
    "content": "In switch elements, don't remove non-rendering children that contain\nconditional attributes like requiredFeatures, requiredExtensions, or\nsystemLanguage.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 462 352\">\n  <switch>\n    <g requiredFeatures=\"http://www.w3.org/TR/SVG11/feature#Extensibility\"/>\n    <a transform=\"translate(0,-5)\" href=\"https://www.diagrams.net/doc/faq/svg-export-text-problems\" target=\"_blank\">\n      <text text-anchor=\"middle\" font-size=\"10px\" x=\"50%\" y=\"100%\">Viewer does not support full SVG 1.1</text>\n    </a>\n  </switch>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 462 352\">\n    <switch>\n        <g requiredFeatures=\"http://www.w3.org/TR/SVG11/feature#Extensibility\"/>\n        <a transform=\"translate(0,-5)\" href=\"https://www.diagrams.net/doc/faq/svg-export-text-problems\" target=\"_blank\">\n      <text text-anchor=\"middle\" font-size=\"10px\" x=\"50%\" y=\"100%\">Viewer does not support full SVG 1.1</text>\n    </a>\n    </switch>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeEmptyContainers.07.svg.txt",
    "content": "Empty <g> nodes should not be removed if they contain a filter, including\nfilters applied via CSS.\n\n===\n\n<svg viewBox=\"0 0 50 50\" xmlns=\"http://www.w3.org/2000/svg\">\n    <filter id=\"a\" x=\"0\" y=\"0\" width=\"50\" height=\"50\" filterUnits=\"userSpaceOnUse\">\n        <feFlood flood-color=\"#aaa\"/>\n    </filter>\n    <mask id=\"b\" x=\"0\" y=\"0\" width=\"50\" height=\"50\">\n        <g style=\"filter: url(#a)\"/>\n    </mask>\n    <text x=\"16\" y=\"16\" style=\"mask: url(#b)\">•ᴗ•</text>\n</svg>\n\n\n@@@\n\n<svg viewBox=\"0 0 50 50\" xmlns=\"http://www.w3.org/2000/svg\">\n    <filter id=\"a\" x=\"0\" y=\"0\" width=\"50\" height=\"50\" filterUnits=\"userSpaceOnUse\">\n        <feFlood flood-color=\"#aaa\"/>\n    </filter>\n    <mask id=\"b\" x=\"0\" y=\"0\" width=\"50\" height=\"50\">\n        <g style=\"filter: url(#a)\"/>\n    </mask>\n    <text x=\"16\" y=\"16\" style=\"mask: url(#b)\">•ᴗ•</text>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeEmptyContainers.08.svg.txt",
    "content": "If a container with an id attribute is removed, remove any <use>s associated with the id.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 100 100\">\n    <symbol id=\"a\">\n        <path d=\"M 10 10 H 90\" style=\"stroke:black;stroke-width:2\"/>\n    </symbol>\n    <symbol id=\"b\">\n        <path d=\"M 10 20 H 90\"/>\n    </symbol>\n    <symbol id=\"c\"/>\n    <symbol id=\"d\"/>\n    <use xlink:href=\"#a\"/>\n    <use href=\"#b\" style=\"stroke:red;stroke-width:2\"/>\n    <use xlink:href=\"#c\"/>\n    <use href=\"#d\" style=\"stroke:red;stroke-width:2\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 100 100\">\n    <symbol id=\"a\">\n        <path d=\"M 10 10 H 90\" style=\"stroke:black;stroke-width:2\"/>\n    </symbol>\n    <symbol id=\"b\">\n        <path d=\"M 10 20 H 90\"/>\n    </symbol>\n    <use xlink:href=\"#a\"/>\n    <use href=\"#b\" style=\"stroke:red;stroke-width:2\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeEmptyText.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <text></text>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeEmptyText.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <tspan></tspan>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeEmptyText.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <tref>...</tref>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.01.svg.txt",
    "content": "Remove elements with display=none\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n      .a { display: block; }\n    </style>\n    <g>\n        <rect display=\"none\" x=\"0\" y=\"0\" width=\"20\" height=\"20\" />\n        <rect display=\"none\" class=\"a\" x=\"0\" y=\"0\" width=\"20\" height=\"20\" />\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .a { display: block; }\n    </style>\n    <g>\n        <rect display=\"none\" class=\"a\" x=\"0\" y=\"0\" width=\"20\" height=\"20\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.02.svg.txt",
    "content": "Remove elements with zero opacity\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n      .a { opacity: 0.5; }\n    </style>\n    <g>\n        <rect opacity=\"0\" x=\"0\" y=\"0\" width=\"20\" height=\"20\" />\n        <rect opacity=\"0\" class=\"a\" x=\"0\" y=\"0\" width=\"20\" height=\"20\" />\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .a { opacity: 0.5; }\n    </style>\n    <g>\n        <rect opacity=\"0\" class=\"a\" x=\"0\" y=\"0\" width=\"20\" height=\"20\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.03.svg.txt",
    "content": "Remove circle element with zero radius but preserve when animation element is inside\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <circle r=\"0\"/>\n    </g>\n    <circle cx=\"16\" cy=\"3\" r=\"0\">\n        <animate attributeName=\"r\" values=\"0;3;0;0\" dur=\"1s\" repeatCount=\"indefinite\" begin=\"0\" keySplines=\"0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8\" calcMode=\"spline\"/>\n    </circle>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n    <circle cx=\"16\" cy=\"3\" r=\"0\">\n        <animate attributeName=\"r\" values=\"0;3;0;0\" dur=\"1s\" repeatCount=\"indefinite\" begin=\"0\" keySplines=\"0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8\" calcMode=\"spline\"/>\n    </circle>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.04.svg.txt",
    "content": "Remove ellipse element with zero radius\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <ellipse rx=\"0\"/>\n        <ellipse ry=\"0\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.05.svg.txt",
    "content": "Remove rect element with zero size\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <rect width=\"0\"/>\n        <rect height=\"0\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.06.svg.txt",
    "content": "Remove pattern element with zero size\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <pattern width=\"0\"/>\n        <pattern height=\"0\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.07.svg.txt",
    "content": "Remove image element with zero size\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <image width=\"0\"/>\n        <image height=\"0\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.08.svg.txt",
    "content": "Remove empty or single point paths without markers\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <path/>\n        <path d=\"z\"/>\n        <path d=\"M 50 50\"/>\n        <path d=\"M 50 50 L 0\"/>\n        <path d=\"M1.25.75\"/>\n        <path d=\"M 50 50 20 20\"/>\n        <path d=\"M 50,50 20,20\"/>\n        <path d=\"M 50 50 H 10\"/>\n        <path d=\"M4.1.5.5.1\"/>\n        <path d=\"M10.77.45c-.19-.2-.51-.2-.7 0\"/>\n        <path d=\"M 6.39441613e-11,8.00287799 C2.85816855e-11,3.58301052 3.5797863,0 8.00005106,0\"/>\n        <path d=\"\" marker-start=\"url(#id)\"/>\n        <path d=\"\" marker-end=\"url(#id)\"/>\n        <path d=\"M 50 50\" marker-start=\"url(#id)\"/>\n        <path d=\"M 50 50\" marker-end=\"url(#id)\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <path d=\"M 50 50 20 20\"/>\n        <path d=\"M 50,50 20,20\"/>\n        <path d=\"M 50 50 H 10\"/>\n        <path d=\"M4.1.5.5.1\"/>\n        <path d=\"M10.77.45c-.19-.2-.51-.2-.7 0\"/>\n        <path d=\"M 6.39441613e-11,8.00287799 C2.85816855e-11,3.58301052 3.5797863,0 8.00005106,0\"/>\n        <path d=\"M 50 50\" marker-start=\"url(#id)\"/>\n        <path d=\"M 50 50\" marker-end=\"url(#id)\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.09.svg.txt",
    "content": "Remove polyline without points\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <polyline/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.10.svg.txt",
    "content": "Remove polygon without points\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        <polygon/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.11.svg.txt",
    "content": "Preserve transparent rect inside clipPath element\n\n===\n\n<svg width=\"480\" height=\"360\" xmlns=\"http://www.w3.org/2000/svg\">\n  <clipPath id=\"opacityclip\">\n    <rect width=\"100\" height=\"100\" opacity=\"0\"/>\n  </clipPath>\n  <rect x=\"0.5\" y=\"0.5\" width=\"99\" height=\"99\" fill=\"red\"/>\n  <rect width=\"100\" height=\"100\" fill=\"lime\" clip-path=\"url(#opacityclip)\"/>\n</svg>\n\n@@@\n\n<svg width=\"480\" height=\"360\" xmlns=\"http://www.w3.org/2000/svg\">\n    <clipPath id=\"opacityclip\">\n        <rect width=\"100\" height=\"100\" opacity=\"0\"/>\n    </clipPath>\n    <rect x=\"0.5\" y=\"0.5\" width=\"99\" height=\"99\" fill=\"red\"/>\n    <rect width=\"100\" height=\"100\" fill=\"lime\" clip-path=\"url(#opacityclip)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.12.svg.txt",
    "content": "Keep invisible elements which have visible ones inside\nand resolve styles\n\n===\n\n<svg width=\"480\" height=\"360\" xmlns=\"http://www.w3.org/2000/svg\">\n  <style>\n    .a { visibility: visible; }\n  </style>\n  <rect x=\"96\" y=\"96\" width=\"96\" height=\"96\" fill=\"lime\" />\n  <g visibility=\"hidden\">\n    <rect x=\"96\" y=\"96\" width=\"96\" height=\"96\" fill=\"red\" />\n  </g>\n  <rect x=\"196.5\" y=\"196.5\" width=\"95\" height=\"95\" fill=\"red\"/>\n  <g visibility=\"hidden\">\n    <rect x=\"196\" y=\"196\" width=\"96\" height=\"96\" fill=\"lime\" visibility=\"visible\" />\n  </g>\n  <rect x=\"96\" y=\"96\" width=\"96\" height=\"96\" visibility=\"hidden\" class=\"a\" />\n</svg>\n\n@@@\n\n<svg width=\"480\" height=\"360\" xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        .a { visibility: visible; }\n    </style>\n    <rect x=\"96\" y=\"96\" width=\"96\" height=\"96\" fill=\"lime\"/>\n    <rect x=\"196.5\" y=\"196.5\" width=\"95\" height=\"95\" fill=\"red\"/>\n    <g visibility=\"hidden\">\n        <rect x=\"196\" y=\"196\" width=\"96\" height=\"96\" fill=\"lime\" visibility=\"visible\"/>\n    </g>\n    <rect x=\"96\" y=\"96\" width=\"96\" height=\"96\" visibility=\"hidden\" class=\"a\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.13.svg.txt",
    "content": "When removing a useless definition, remove references to that definition.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\">\n  <defs>\n    <path d=\"M15.852 62.452\" id=\"a\"/>\n  </defs>\n  <use href=\"#a\"/>\n  <use opacity=\".35\" href=\"#a\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\"/>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.14.svg.txt",
    "content": "Remove unused defs\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <linearGradient id=\"a\">\n        </linearGradient>\n    </defs>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\"/>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.15.svg.txt",
    "content": "Don't remove used defs\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <rect fill=\"url(#a)\" width=\"64\" height=\"64\"/>\n    <defs>\n        <linearGradient id=\"a\">\n        </linearGradient>\n    </defs>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <rect fill=\"url(#a)\" width=\"64\" height=\"64\"/>\n    <defs>\n        <linearGradient id=\"a\"/>\n    </defs>\n</svg>"
  },
  {
    "path": "test/plugins/removeHiddenElems.16.svg.txt",
    "content": "Don't remove non-rendering elements if children have IDs. \n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <rect fill=\"url(#a)\" width=\"64\" height=\"64\"/>\n    <symbol>\n        <linearGradient id=\"a\">\n            <stop offset=\"5%\" stop-color=\"gold\" />\n        </linearGradient>\n    </symbol>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <rect fill=\"url(#a)\" width=\"64\" height=\"64\"/>\n    <symbol>\n        <linearGradient id=\"a\">\n            <stop offset=\"5%\" stop-color=\"gold\"/>\n        </linearGradient>\n    </symbol>\n</svg>"
  },
  {
    "path": "test/plugins/removeHiddenElems.17.svg.txt",
    "content": "Don't remove nodes that have children with referenced IDs.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <rect fill=\"url(#a)\" width=\"64\" height=\"64\"/>\n    <g>\n        <linearGradient id=\"a\">\n            <stop offset=\"5%\" stop-color=\"gold\" />\n        </linearGradient>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <rect fill=\"url(#a)\" width=\"64\" height=\"64\"/>\n    <g>\n        <linearGradient id=\"a\">\n            <stop offset=\"5%\" stop-color=\"gold\"/>\n        </linearGradient>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.18.svg.txt",
    "content": "Preserve <defs> with referenced path.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <g id=\"test-body-content\">\n        <defs>\n            <path id=\"reference\" d=\"M240 1h239v358H240z\"/>\n        </defs>\n        <use xlink:href=\"#reference\" id=\"use\" fill=\"gray\" onclick=\"test(evt)\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <g id=\"test-body-content\">\n        <defs>\n            <path id=\"reference\" d=\"M240 1h239v358H240z\"/>\n        </defs>\n        <use xlink:href=\"#reference\" id=\"use\" fill=\"gray\" onclick=\"test(evt)\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeHiddenElems.19.svg.txt",
    "content": "Preserve referenced path, even when path has opacity=0.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <defs>\n        <path id=\"path2\" d=\"M200 200 l50 -300\" style=\"opacity:0\"/>\n    </defs>\n    <text style=\"font-size:24px;\">\n        <textPath xlink:href=\"#path2\">\n        this is path 2\n        </textPath>\n    </text>\n    <path id=\"path1\" d=\"M200 200 l50 -300\" style=\"opacity:0\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <defs>\n        <path id=\"path2\" d=\"M200 200 l50 -300\" style=\"opacity:0\"/>\n    </defs>\n    <text style=\"font-size:24px;\">\n        <textPath xlink:href=\"#path2\">\n        this is path 2\n        </textPath>\n    </text>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeMetadata.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <metadata>...</metadata>\n    <g/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeNonInheritableGroupAttrs.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g class=\"test\" clip-path=\"url(#clip1)\" transform=\"rotate(45)\" display=\"none\" opacity=\"0.5\" visibility=\"visible\">\n        <path d=\"M0 0 L 10 20\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g class=\"test\" clip-path=\"url(#clip1)\" transform=\"rotate(45)\" display=\"none\" opacity=\"0.5\" visibility=\"visible\">\n        <path d=\"M0 0 L 10 20\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeNonInheritableGroupAttrs.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g vector-effect=\"non-scaling-stroke\" stroke=\"blue\">\n        <path d=\"M0 0 L 10 20\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g stroke=\"blue\">\n        <path d=\"M0 0 L 10 20\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeOffCanvasPaths.01.svg.txt",
    "content": "<svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M10 10 h 80 v 80 h -80 z\"/>\n    <path d=\"M10 -90 h 80 v 80 h -80 z\"/>\n    <path d=\"M110 10 h 80 v 80 h -80 z\"/>\n    <path d=\"M10 110 h 80 v 80 h -80 z\"/>\n    <path d=\"M-90 10 h 80 v 80 h -80 z\"/>\n</svg>\n\n@@@\n\n<svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M10 10 h 80 v 80 h -80 z\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeOffCanvasPaths.02.svg.txt",
    "content": "<svg height=\"1000\" width=\"1000\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M10 10 h 80 v 80 h -80 z\"/>\n    <path d=\"M10 -90 h 80 v 80 h -80 z\"/>\n    <path d=\"M110 10 h 80 v 80 h -80 z\"/>\n    <path d=\"M10 110 h 80 v 80 h -80 z\"/>\n    <path d=\"M-90 10 h 80 v 80 h -80 z\"/>\n</svg>\n\n@@@\n\n<svg height=\"1000\" width=\"1000\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M10 10 h 80 v 80 h -80 z\"/>\n    <path d=\"M110 10 h 80 v 80 h -80 z\"/>\n    <path d=\"M10 110 h 80 v 80 h -80 z\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeOffCanvasPaths.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 128 128\">\n    <path d=\"M0 0h128v128H0z\" fill=\"none\" stroke=\"red\"/>\n    <path d=\"M10.14 51.5c4.07 1.56 7.52 4.47 7.37 11.16\" fill=\"none\" stroke=\"#00f\"/>\n    <path d=\"M100 200c4.07 1.56 7.52 4.47 7.37 11.16\" fill=\"none\" stroke=\"#00f\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 128 128\">\n    <path d=\"M0 0h128v128H0z\" fill=\"none\" stroke=\"red\"/>\n    <path d=\"M10.14 51.5c4.07 1.56 7.52 4.47 7.37 11.16\" fill=\"none\" stroke=\"#00f\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeOffCanvasPaths.04.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 128 128\">\n    <path d=\"M20.16 107.3l13.18-12.18m-1.6-5.41l-16.32 6.51M13 84.5h18m77 22.8L94.83 95.12m1.6-5.41l16.32 6.51M115 84.5H98\" fill=\"none\" stroke=\"#444\" stroke-width=\"3\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 128 128\">\n    <path d=\"M20.16 107.3l13.18-12.18m-1.6-5.41l-16.32 6.51M13 84.5h18m77 22.8L94.83 95.12m1.6-5.41l16.32 6.51M115 84.5H98\" fill=\"none\" stroke=\"#444\" stroke-width=\"3\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeOffCanvasPaths.05.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <path d=\"M-100-100h50v50h-50z\" fill=\"red\" transform=\"translate(100 100)\"/>\n    <g transform=\"translate(150 150)\">\n        <path d=\"M-100-100h50v50h-50z\" fill=\"blue\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <path d=\"M-100-100h50v50h-50z\" fill=\"red\" transform=\"translate(100 100)\"/>\n    <g transform=\"translate(150 150)\">\n        <path d=\"M-100-100h50v50h-50z\" fill=\"blue\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeOffCanvasPaths.06.svg.txt",
    "content": "Should not throw when viewBox isn't present\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M10 10 h 80 v 80 h -80 z\"/>\n    <path d=\"M10 -90 h 80 v 80 h -80 z\"/>\n    <path d=\"M110 10 h 80 v 80 h -80 z\"/>\n    <path d=\"M10 110 h 80 v 80 h -80 z\"/>\n    <path d=\"M-90 10 h 80 v 80 h -80 z\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M10 10 h 80 v 80 h -80 z\"/>\n    <path d=\"M10 -90 h 80 v 80 h -80 z\"/>\n    <path d=\"M110 10 h 80 v 80 h -80 z\"/>\n    <path d=\"M10 110 h 80 v 80 h -80 z\"/>\n    <path d=\"M-90 10 h 80 v 80 h -80 z\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeRasterImages.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <g>\n        <image xlink:href=\"raster.jpg\" width=\"100\" height=\"100\"/>\n        <image xlink:href=\"raster.png\" width=\"100\" height=\"100\"/>\n        <image xlink:href=\"raster.gif\" width=\"100\" height=\"100\"/>\n        <image xlink:href=\"raster.svg\" width=\"100\" height=\"100\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <g>\n        <image xlink:href=\"raster.svg\" width=\"100\" height=\"100\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeRasterImages.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <g>\n        <image xlink:href=\"data:image/jpg;base64,...\" width=\"100\" height=\"100\"/>\n        <image xlink:href=\"data:image/png;base64,...\" width=\"100\" height=\"100\"/>\n        <image xlink:href=\"data:image/gif;base64,...\" width=\"100\" height=\"100\"/>\n        <image xlink:href=\"data:image/svg+xml;base64,...\" width=\"100\" height=\"100\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <g>\n        <image xlink:href=\"data:image/svg+xml;base64,...\" width=\"100\" height=\"100\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeScripts.01.svg.txt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n    <svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 100 100\" style=\"enable-background:new 0 0 100 100;\" xml:space=\"preserve\">\n        <script></script>\n        <circle class=\"st0\" cx=\"50\" cy=\"50\" r=\"50\" />\n    </svg>\n\n@@@\n\n<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 100 100\" style=\"enable-background:new 0 0 100 100;\" xml:space=\"preserve\">\n    <circle class=\"st0\" cx=\"50\" cy=\"50\" r=\"50\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeScripts.02.svg.txt",
    "content": "Collapses links to JavaScript functions, and removes event attributes from\nnodes including children of a collapsed links.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n  <a href=\"javascript:(() => { alert('uwu') })();\">\n    <text y=\"10\" onclick=\"alert('uwu')\">uwu</text>\n  </a>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <text y=\"10\">uwu</text>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeScripts.03.svg.txt",
    "content": "Does not remove normal links, and does remove event attributes.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n  <a href=\"https://yewtu.be/watch?v=dQw4w9WgXcQ\">\n    <text y=\"10\" onclick=\"alert('uwu')\">uwu</text>\n  </a>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <a href=\"https://yewtu.be/watch?v=dQw4w9WgXcQ\">\n    <text y=\"10\">uwu</text>\n  </a>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeScripts.04.svg.txt",
    "content": "If making different modifications to two different nodes in the same parent,\ndrop attributes and collapse nodes appropriately without losing elements.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" version=\"1.1\">\n  <script>alert('uwu')</script>\n  <g onclick=\"alert('uwu')\">\n    <text y=\"10\">uwu</text>\n  </g>\n  <a href=\"javascript:(() => { alert('uwu') })();\">\n    <text y=\"20\">uwu</text>\n  </a>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" version=\"1.1\">\n    <g>\n        <text y=\"10\">uwu</text>\n    </g>\n    <text y=\"20\">uwu</text>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeScripts.05.svg.txt",
    "content": "Removes hrefs to JavaScript URIs, including unconventional namespaces.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:uwu=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 100 100\" version=\"1.1\">\n  <a href=\"javascript:(() => { alert('uwu') })();\">\n    <text y=\"20\">uwu</text>\n  </a>\n  <a uwu:href=\"javascript:(() => { alert('uwu') })();\">\n    <text y=\"30\">uwu</text>\n  </a>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:uwu=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 100 100\" version=\"1.1\">\n    <text y=\"20\">uwu</text>\n    <text y=\"30\">uwu</text>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeStyleElement.01.svg.txt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n    <svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 100 100\" style=\"enable-background:new 0 0 100 100;\" xml:space=\"preserve\">\n        <style type=\"text/css\">\n        .st0 {\n            fill: #231F20;\n        }\n        </style>\n        <circle class=\"st0\" cx=\"50\" cy=\"50\" r=\"50\" />\n    </svg>\n\n@@@\n\n<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 100 100\" style=\"enable-background:new 0 0 100 100;\" xml:space=\"preserve\">\n    <circle class=\"st0\" cx=\"50\" cy=\"50\" r=\"50\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeTitle.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <title>...</title>\n    <g/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.01.svg.txt",
    "content": "<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://\" attr=\"val\" x=\"0\" y=\"10\" test:attr=\"val\" xml:space=\"preserve\">\n    <rect fill=\"#000\"/>\n    <rect fill=\"#000\" id=\"black-rect\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://\" y=\"10\" test:attr=\"val\" xml:space=\"preserve\">\n    <rect/>\n    <rect fill=\"#000\" id=\"black-rect\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://\">\n    <test>\n        test\n    </test>\n    <test:test>\n        test\n    </test:test>\n    <g>\n        test\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://\">\n    <test:test>\n        test\n    </test:test>\n    <g>\n        test\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g fill=\"red\">\n        <path fill=\"#000\" d=\"M118.8 186.9l79.2\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g fill=\"red\">\n        <path fill=\"#000\" d=\"M118.8 186.9l79.2\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.04.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g fill=\"black\">\n        <g fill=\"red\">\n            <path fill=\"red\" d=\"M118.8 186.9l79.2\"/>\n        </g>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g fill=\"black\">\n        <g fill=\"red\">\n            <path d=\"M118.8 186.9l79.2\"/>\n        </g>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.05.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g fill=\"red\">\n        <g fill=\"red\">\n            <g fill=\"green\">\n                <g fill=\"green\">\n                    <path fill=\"red\" d=\"M18.8 86.9l39.2\"/>\n                </g>\n            </g>\n            <path fill=\"red\" d=\"M118.8 186.9l79.2\"/>\n            <path id=\"red\" fill=\"red\" d=\"M118.8 186.9l79.2\"/>\n        </g>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g fill=\"red\">\n        <g>\n            <g fill=\"green\">\n                <g>\n                    <path fill=\"red\" d=\"M18.8 86.9l39.2\"/>\n                </g>\n            </g>\n            <path d=\"M118.8 186.9l79.2\"/>\n            <path id=\"red\" fill=\"red\" d=\"M118.8 186.9l79.2\"/>\n        </g>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.06.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g fill=\"red\" data-foo=\"bar\">\n        <path fill=\"#000\" d=\"M118.8 186.9l79.2\" data-bind=\"smth\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g fill=\"red\" data-foo=\"bar\">\n        <path fill=\"#000\" d=\"M118.8 186.9l79.2\" data-bind=\"smth\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.07.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://\">\n    <foreignObject>\n        <div class=\"test\">\n            fallback test\n        </div>\n    </foreignObject>\n\n    <test>\n        test\n    </test>\n    <test:test>\n        test\n    </test:test>\n    <g>\n        test\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://\">\n    <foreignObject>\n        <div class=\"test\">\n            fallback test\n        </div>\n    </foreignObject>\n    <test:test>\n        test\n    </test:test>\n    <g>\n        test\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.08.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" x=\"0\" y=\"0\">\n    <svg x=\"10\" y=\"10\">\n        <svg x=\"0\" y=\"0\">\n            <path/>\n        </svg>\n        <svg x=\"0\" y=\"10\">\n            <path/>\n        </svg>\n        <svg x=\"50\" y=\"0\">\n            <path/>\n        </svg>\n    </svg>\n    <svg x=\"100\" y=\"100\">\n        <path/>\n    </svg>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <svg x=\"10\" y=\"10\">\n        <svg>\n            <path/>\n        </svg>\n        <svg y=\"10\">\n            <path/>\n        </svg>\n        <svg x=\"50\">\n            <path/>\n        </svg>\n    </svg>\n    <svg x=\"100\" y=\"100\">\n        <path/>\n    </svg>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.09.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <metadata>\n        <sfw>\n            <slices></slices>\n            <sliceSourceBounds height=\"67.3\" width=\"85.9\" y=\"-40.8\" x=\"-42.5\" bottomLeftOrigin=\"true\"></sliceSourceBounds>\n        </sfw>\n        <ellipse/>\n    </metadata>\n    <ellipse>\n        <font-face/>\n    </ellipse>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <metadata>\n        <ellipse/>\n    </metadata>\n    <ellipse/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.10.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g transform=\"translate(792)\">\n        <g transform=\"translate(792)\">\n            <path d=\"M118.8 186.9l79.2\"/>\n        </g>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g transform=\"translate(792)\">\n        <g transform=\"translate(792)\">\n            <path d=\"M118.8 186.9l79.2\"/>\n        </g>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.11.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" aria-labelledby=\"title\">\n    <title id=\"title\">\n        Title\n    </title>\n    <g aria-label=\"foo\">\n        test\n    </g>\n    <path id=\"t\" d=\"M10 10h10L10 20\"/>\n    <use href=\"#t\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" aria-labelledby=\"title\">\n    <title id=\"title\">\n        Title\n    </title>\n    <g aria-label=\"foo\">\n        test\n    </g>\n    <path id=\"t\" d=\"M10 10h10L10 20\"/>\n    <use href=\"#t\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.12.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" aria-labelledby=\"title\">\n    <title id=\"title\">\n        Title\n    </title>\n    <g aria-label=\"foo\">\n        test\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <title id=\"title\">\n        Title\n    </title>\n    <g>\n        test\n    </g>\n</svg>\n\n@@@\n\n{ \"keepAriaAttrs\": false }\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.13.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" role=\"img\">\n    <g/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.14.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" role=\"img\">\n    <g/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" role=\"img\">\n    <g/>\n</svg>\n\n@@@\n\n{ \"keepRoleAttr\": true }\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.15.svg.txt",
    "content": "<svg width=\"480\" height=\"360\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n  <text x=\"50\" y=\"50\">\n    A <a xlink:href=\"#\"><tspan>link around tspan</tspan></a> for testing\n  </text>\n</svg>\n\n@@@\n\n<svg width=\"480\" height=\"360\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <text x=\"50\" y=\"50\">\n    A <a xlink:href=\"#\"><tspan>link around tspan</tspan></a> for testing\n  </text>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.16.svg.txt",
    "content": "Removes standalone=\"no\" XML declaration.\n\nSee: https://github.com/svg/svgo/issues/836\n\n===\n\n<?xml version=\"1.0\" standalone=\"no\"?>\n<svg width=\"64\" height=\"18\" xmlns=\"http://www.w3.org/2000/svg\">\n  <text x=\"4\" y=\"18\">uwu</text>\n</svg>\n\n@@@\n\n<?xml version=\"1.0\"?>\n<svg width=\"64\" height=\"18\" xmlns=\"http://www.w3.org/2000/svg\">\n    <text x=\"4\" y=\"18\">uwu</text>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnknownsAndDefaults.17.svg.txt",
    "content": "Don't remove unknown attributes or attributes with default values if that\nattribute is referenced in an attribute selector in CSS.\n\nSee: https://mastodon.social/@sir_pepe/114319751487861964\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-1 -1 202 40\">\n  <style>\n      [preserveAspectRatio] { fill: yellow; stroke: black; }\n  </style>\n  <svg viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid meet\">\n    <path d=\"M50,10 A40,40,1,1,1,50,90 A40,40,1,1,1,50,10 M30,40 Q36,35,42,40 M58,40 Q64,35,70,40 M30,60 Q50,75,70,60 Q50,75,30,60\"/>\n  </svg>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-1 -1 202 40\">\n    <style>\n        [preserveAspectRatio] { fill: yellow; stroke: black; }\n    </style>\n    <svg viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid meet\">\n        <path d=\"M50,10 A40,40,1,1,1,50,90 A40,40,1,1,1,50,10 M30,40 Q36,35,42,40 M58,40 Q64,35,70,40 M30,60 Q50,75,70,60 Q50,75,30,60\"/>\n    </svg>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnusedNS.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://trololololololololololo.com/\">\n    <g>\n        test\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g>\n        test\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnusedNS.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://trololololololololololo.com/\">\n    <g test:attr=\"val\">\n        test\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://trololololololololololo.com/\">\n    <g test:attr=\"val\">\n        test\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnusedNS.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://trololololololololololo.com/\" xmlns:test2=\"http://trololololololololololo.com/\">\n    <g test:attr=\"val\">\n        <g>\n            test\n        </g>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://trololololololololololo.com/\">\n    <g test:attr=\"val\">\n        <g>\n            test\n        </g>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnusedNS.04.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://trololololololololololo.com/\" xmlns:test2=\"http://trololololololololololo.com/\">\n    <g test:attr=\"val\">\n        <g test2:attr=\"val\">\n            test\n        </g>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://trololololololololololo.com/\" xmlns:test2=\"http://trololololololololololo.com/\">\n    <g test:attr=\"val\">\n        <g test2:attr=\"val\">\n            test\n        </g>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnusedNS.05.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://trololololololololololo.com/\" xmlns:test2=\"http://trololololololololololo.com/\">\n    <g>\n        <test:elem>\n            test\n        </test:elem>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://trololololololololololo.com/\">\n    <g>\n        <test:elem>\n            test\n        </test:elem>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnusedNS.06.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://trololololololololololo.com/\" xmlns:test2=\"http://trololololololololololo.com/\">\n    <test:elem>\n        <test2:elem>\n            test\n        </test2:elem>\n    </test:elem>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:test=\"http://trololololololololololo.com/\" xmlns:test2=\"http://trololololololololololo.com/\">\n    <test:elem>\n        <test2:elem>\n            test\n        </test2:elem>\n    </test:elem>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUnusedNS.07.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" inkscape:version=\"0.92.2 (5c3e80d, 2017-08-06)\" sodipodi:docname=\"test.svg\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" inkscape:version=\"0.92.2 (5c3e80d, 2017-08-06)\" sodipodi:docname=\"test.svg\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\">\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUselessDefs.01.svg.txt",
    "content": "<svg>\n    <defs>\n        <path d=\"...\"/>\n        <g>\n            <path d=\"...\" id=\"a\"/>\n        </g>\n    </defs>\n</svg>\n\n@@@\n\n<svg>\n    <defs>\n        <path d=\"...\" id=\"a\"/>\n    </defs>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUselessDefs.02.svg.txt",
    "content": "<svg>\n    <linearGradient id=\"linear\">\n        <stop/>\n        <stop/>\n    </linearGradient>\n    <radialGradient id=\"radial\">\n        <stop/>\n        <stop/>\n    </radialGradient>\n    <pattern id=\"pattern\">\n        <rect/>\n    </pattern>\n    <clipPath id=\"clip\">\n        <path/>\n    </clipPath>\n    <mask id=\"mask\">\n        <rect/>\n    </mask>\n    <marker id=\"marker\">\n        <path/>\n    </marker>\n    <symbol id=\"symbol\">\n        <rect/>\n    </symbol>\n    <solidColor id=\"color\"/>\n</svg>\n\n@@@\n\n<svg>\n    <linearGradient id=\"linear\">\n        <stop/>\n        <stop/>\n    </linearGradient>\n    <radialGradient id=\"radial\">\n        <stop/>\n        <stop/>\n    </radialGradient>\n    <pattern id=\"pattern\">\n        <rect/>\n    </pattern>\n    <clipPath id=\"clip\">\n        <path/>\n    </clipPath>\n    <mask id=\"mask\">\n        <rect/>\n    </mask>\n    <marker id=\"marker\">\n        <path/>\n    </marker>\n    <symbol id=\"symbol\">\n        <rect/>\n    </symbol>\n    <solidColor id=\"color\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUselessDefs.03.svg.txt",
    "content": "<svg>\n    <linearGradient>\n        <stop/>\n        <stop/>\n    </linearGradient>\n    <radialGradient>\n        <stop/>\n        <stop/>\n    </radialGradient>\n    <pattern>\n        <rect/>\n    </pattern>\n    <clipPath>\n        <path/>\n    </clipPath>\n    <mask>\n        <rect/>\n    </mask>\n    <marker>\n        <path/>\n    </marker>\n    <symbol>\n        <rect/>\n    </symbol>\n    <solidColor/>\n    <path/>\n</svg>\n\n@@@\n\n<svg>\n    <path/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUselessDefs.04.svg.txt",
    "content": "Don't remove non-rendering elements if children have IDs.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <rect fill=\"url(#a)\" width=\"64\" height=\"64\"/>\n    <symbol>\n        <linearGradient id=\"a\">\n            <stop offset=\"5%\" stop-color=\"gold\" />\n        </linearGradient>\n    </symbol>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <rect fill=\"url(#a)\" width=\"64\" height=\"64\"/>\n    <symbol>\n        <linearGradient id=\"a\">\n            <stop offset=\"5%\" stop-color=\"gold\"/>\n        </linearGradient>\n    </symbol>\n</svg>"
  },
  {
    "path": "test/plugins/removeUselessDefs.05.svg.txt",
    "content": "Don't remove nodes that have children with referenced IDs.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <rect fill=\"url(#a)\" width=\"64\" height=\"64\"/>\n    <g>\n        <linearGradient id=\"a\">\n            <stop offset=\"5%\" stop-color=\"gold\" />\n        </linearGradient>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <rect fill=\"url(#a)\" width=\"64\" height=\"64\"/>\n    <g>\n        <linearGradient id=\"a\">\n            <stop offset=\"5%\" stop-color=\"gold\"/>\n        </linearGradient>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUselessStrokeAndFill.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <g id=\"test\">\n            <rect stroke-dashoffset=\"5\" width=\"100\" height=\"100\"/>\n        </g>\n    </defs>\n    <circle fill=\"red\" stroke-width=\"6\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" stroke=\"#000\" stroke-width=\"0\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <g stroke=\"#000\" stroke-width=\"6\">\n        <circle fill=\"red\" stroke=\"red\" stroke-width=\"0\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <circle fill=\"red\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    </g>\n    <g stroke=\"#000\">\n        <circle fill=\"red\" stroke-width=\"0\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <circle fill=\"red\" stroke=\"none\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <g id=\"test\">\n            <rect stroke-dashoffset=\"5\" width=\"100\" height=\"100\"/>\n        </g>\n    </defs>\n    <circle fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <g stroke=\"#000\" stroke-width=\"6\">\n        <circle fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\" stroke=\"none\"/>\n        <circle fill=\"red\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    </g>\n    <g stroke=\"#000\">\n        <circle fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\" stroke=\"none\"/>\n        <circle fill=\"red\" cx=\"60\" cy=\"60\" r=\"50\" stroke=\"none\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUselessStrokeAndFill.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <g id=\"test\">\n            <rect fill-opacity=\".5\" width=\"100\" height=\"100\"/>\n        </g>\n    </defs>\n    <circle fill=\"none\" fill-rule=\"evenodd\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" fill-opacity=\"0\" cx=\"90\" cy=\"90\" r=\"50\"/>\n    <circle fill-opacity=\"0\" fill-rule=\"evenodd\" cx=\"90\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" fill-opacity=\".5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <g fill=\"none\">\n        <circle fill-opacity=\".5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <g id=\"test\">\n            <rect fill-opacity=\".5\" width=\"100\" height=\"100\"/>\n        </g>\n    </defs>\n    <circle fill=\"none\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"none\" cx=\"90\" cy=\"90\" r=\"50\"/>\n    <circle cx=\"90\" cy=\"60\" r=\"50\" fill=\"none\"/>\n    <circle fill=\"red\" fill-opacity=\".5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <g fill=\"none\">\n        <circle cx=\"60\" cy=\"60\" r=\"50\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUselessStrokeAndFill.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        …\n    </style>\n    <circle fill=\"none\" fill-rule=\"evenodd\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill-opacity=\"0\" fill-rule=\"evenodd\" cx=\"90\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" stroke-width=\"6\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <style>\n        …\n    </style>\n    <circle fill=\"none\" fill-rule=\"evenodd\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill-opacity=\"0\" fill-rule=\"evenodd\" cx=\"90\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" stroke-width=\"6\" stroke-dashoffset=\"5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" stroke=\"#000\" stroke-width=\"6\" stroke-dashoffset=\"5\" stroke-opacity=\"0\" cx=\"60\" cy=\"60\" r=\"50\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUselessStrokeAndFill.04.svg.txt",
    "content": "<svg width=\"480\" height=\"360\" xmlns=\"http://www.w3.org/2000/svg\">\n  <defs>\n    <marker id=\"testMarker\">\n      <rect width=\"100\" height=\"100\" fill=\"blue\" />\n    </marker>\n  </defs>\n  <line x1=\"150\" y1=\"150\" x2=\"165\" y2=\"150\" stroke=\"red\" stroke-width=\"25\" marker-end=\"url(#testMarker)\" />\n  <line x1=\"250\" y1=\"250\" x2=\"265\" y2=\"250\" stroke=\"red\" stroke-width=\"0\" marker-end=\"url(#testMarker)\" />\n</svg>\n\n@@@\n\n<svg width=\"480\" height=\"360\" xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <marker id=\"testMarker\">\n            <rect width=\"100\" height=\"100\" fill=\"blue\"/>\n        </marker>\n    </defs>\n    <line x1=\"150\" y1=\"150\" x2=\"165\" y2=\"150\" stroke=\"red\" stroke-width=\"25\" marker-end=\"url(#testMarker)\"/>\n    <line x1=\"250\" y1=\"250\" x2=\"265\" y2=\"250\" marker-end=\"url(#testMarker)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeUselessStrokeAndFill.05.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <g id=\"test\">\n            <rect fill-opacity=\".5\" width=\"100\" height=\"100\"/>\n        </g>\n    </defs>\n    <circle fill=\"none\" fill-rule=\"evenodd\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" fill-opacity=\"0\" cx=\"90\" cy=\"90\" r=\"50\"/>\n    <circle fill-opacity=\"0\" fill-rule=\"evenodd\" cx=\"90\" cy=\"60\" r=\"50\"/>\n    <circle fill=\"red\" fill-opacity=\".5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <g fill=\"none\">\n        <circle fill-opacity=\".5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <g id=\"test\">\n            <rect fill-opacity=\".5\" width=\"100\" height=\"100\"/>\n        </g>\n    </defs>\n    <circle fill=\"red\" fill-opacity=\".5\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    <g fill=\"none\"/>\n</svg>\n\n@@@\n\n{ \"removeNone\": true }\n"
  },
  {
    "path": "test/plugins/removeViewBox.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100.5\" height=\".5\" viewBox=\"0 0 100.5 .5\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100.5\" height=\".5\">\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/removeViewBox.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"50\" viewBox=\"0 0 100 50\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"50\" viewBox=\"0 0 100 50\">\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/removeViewBox.03.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"50\" viewBox=\"0, 0, 100, 50\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"50\">\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/removeViewBox.04.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"50\" viewBox=\"-25 -25 50 50\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"50\" viewBox=\"-25 -25 50 50\">\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/removeViewBox.05.svg.txt",
    "content": "ViewBox in nested <svg> should be preserved to not break scale\n\n===\n\n<svg width=\"480\" height=\"360\" viewBox=\"0 0 480 360\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n  <defs>\n    <svg id=\"svg-sub-root\" viewBox=\"0 0 450 450\" width=\"450\" height=\"450\">\n      <rect x=\"225\" y=\"0\" width=\"220\" height=\"220\" style=\"fill:magenta\"/>\n      <rect x=\"0\" y=\"225\" width=\"220\" height=\"220\" style=\"fill:#f0f\"/>\n      <rect x=\"225\" y=\"225\" width=\"220\" height=\"220\" fill=\"#f0f\"/>\n    </svg>\n  </defs>\n  <use x=\"60\" y=\"50\" width=\"240\" height=\"240\" xlink:href=\"#svg-sub-root\"/>\n  <rect x=\"300\" y=\"170\" width=\"118\" height=\"118\" fill=\"magenta\"/>\n</svg>\n\n@@@\n\n<svg width=\"480\" height=\"360\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <defs>\n        <svg id=\"svg-sub-root\" viewBox=\"0 0 450 450\" width=\"450\" height=\"450\">\n            <rect x=\"225\" y=\"0\" width=\"220\" height=\"220\" style=\"fill:magenta\"/>\n            <rect x=\"0\" y=\"225\" width=\"220\" height=\"220\" style=\"fill:#f0f\"/>\n            <rect x=\"225\" y=\"225\" width=\"220\" height=\"220\" fill=\"#f0f\"/>\n        </svg>\n    </defs>\n    <use x=\"60\" y=\"50\" width=\"240\" height=\"240\" xlink:href=\"#svg-sub-root\"/>\n    <rect x=\"300\" y=\"170\" width=\"118\" height=\"118\" fill=\"magenta\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeXMLNS.01.svg.txt",
    "content": "Should remove xmlns if requested\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n</svg>\n\n@@@\n\n<svg>\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/removeXMLProcInst.01.svg.txt",
    "content": "<?xml version=\"1.0\" standalone=\"no\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/removeXMLProcInst.02.svg.txt",
    "content": "<?xml-stylesheet href=\"style.css\" type=\"text/css\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n</svg>\n\n@@@\n\n<?xml-stylesheet href=\"style.css\" type=\"text/css\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    test\n</svg>\n"
  },
  {
    "path": "test/plugins/removeXlink.01.svg.txt",
    "content": "Remove xmlns:xlink and replace xlink:href with href attribute\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 348.61 100\">\n  <defs>\n    <linearGradient id=\"a\" x1=\"263.36\" y1=\"14.74\" x2=\"333.47\" y2=\"84.85\" gradientUnits=\"userSpaceOnUse\">\n      <stop offset=\"0\" stop-color=\"#45afe4\"/>\n      <stop offset=\"1\" stop-color=\"#364f9e\"/>\n    </linearGradient>\n    <linearGradient id=\"b\" x1=\"262.64\" y1=\"15.46\" x2=\"332.75\" y2=\"85.57\" xlink:href=\"#a\"/>\n  </defs>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 348.61 100\">\n    <defs>\n        <linearGradient id=\"a\" x1=\"263.36\" y1=\"14.74\" x2=\"333.47\" y2=\"84.85\" gradientUnits=\"userSpaceOnUse\">\n            <stop offset=\"0\" stop-color=\"#45afe4\"/>\n            <stop offset=\"1\" stop-color=\"#364f9e\"/>\n        </linearGradient>\n        <linearGradient id=\"b\" x1=\"262.64\" y1=\"15.46\" x2=\"332.75\" y2=\"85.57\" href=\"#a\"/>\n    </defs>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeXlink.02.svg.txt",
    "content": "Remove xlink namespace even if it's under another prefix.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:uwu=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 348.61 100\">\n  <defs>\n    <linearGradient id=\"a\" x1=\"263.36\" y1=\"14.74\" x2=\"333.47\" y2=\"84.85\" gradientUnits=\"userSpaceOnUse\">\n      <stop offset=\"0\" stop-color=\"#45afe4\"/>\n      <stop offset=\"1\" stop-color=\"#364f9e\"/>\n    </linearGradient>\n    <linearGradient id=\"b\" x1=\"262.64\" y1=\"15.46\" x2=\"332.75\" y2=\"85.57\" uwu:href=\"#a\"/>\n  </defs>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 348.61 100\">\n    <defs>\n        <linearGradient id=\"a\" x1=\"263.36\" y1=\"14.74\" x2=\"333.47\" y2=\"84.85\" gradientUnits=\"userSpaceOnUse\">\n            <stop offset=\"0\" stop-color=\"#45afe4\"/>\n            <stop offset=\"1\" stop-color=\"#364f9e\"/>\n        </linearGradient>\n        <linearGradient id=\"b\" x1=\"262.64\" y1=\"15.46\" x2=\"332.75\" y2=\"85.57\" href=\"#a\"/>\n    </defs>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeXlink.03.svg.txt",
    "content": "Convert xlink:href and xlink:show to href and target, and convert xlink:title\nto title node. \n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 50 50\">\n  <a xlink:href=\"https://duckduckgo.com\" xlink:show=\"new\" xlink:title=\"DuckDuckGo Homepage\">\n    <text x=\"0\" y=\"10\">uwu</text>\n  </a>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\">\n    <a target=\"_blank\" href=\"https://duckduckgo.com\"><title>DuckDuckGo Homepage</title>\n    <text x=\"0\" y=\"10\">uwu</text>\n  </a>\n</svg>\n"
  },
  {
    "path": "test/plugins/removeXlink.04.svg.txt",
    "content": "Drops other xlink attributes. \n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 50 50\">\n  <defs>\n    <linearGradient id=\"a\" x1=\"263.36\" y1=\"14.74\" x2=\"333.47\" y2=\"84.85\" gradientUnits=\"userSpaceOnUse\">\n      <stop offset=\"0\" stop-color=\"#45afe4\"/>\n      <stop offset=\"1\" stop-color=\"#364f9e\"/>\n    </linearGradient>\n    <linearGradient id=\"b\" x1=\"262.64\" y1=\"15.46\" x2=\"332.75\" y2=\"85.57\" xlink:href=\"#a\" xlink:type=\"simple\"/>\n  </defs>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\">\n    <defs>\n        <linearGradient id=\"a\" x1=\"263.36\" y1=\"14.74\" x2=\"333.47\" y2=\"84.85\" gradientUnits=\"userSpaceOnUse\">\n            <stop offset=\"0\" stop-color=\"#45afe4\"/>\n            <stop offset=\"1\" stop-color=\"#364f9e\"/>\n        </linearGradient>\n        <linearGradient id=\"b\" x1=\"262.64\" y1=\"15.46\" x2=\"332.75\" y2=\"85.57\" href=\"#a\"/>\n    </defs>\n</svg>\n"
  },
  {
    "path": "test/plugins/reusePaths.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path id=\"test0\" d=\"M 10,50 l 20,30 L 20,30\"/>\n    <path transform=\"translate(10, 10)\"\n          d=\"M 10,50 c 20,30 40,50 60,70 C 20,30 40,50 60,70\"/>\n    <path transform=\"translate(20, 20)\"\n          d=\"M 10,50 c 20,30 40,50 60,70 C 20,30 40,50 60,70\"/>\n    <path d=\"M 10,50 c 20,30 40,50 60,70 C 20,30 40,50 60,70\"/>\n    <path id=\"test1\" d=\"M 10,50 l 20,30 L 20,30\"/>\n    <path d=\"M 10,50 a 20,60 45 0,1 40,70 A 20,60 45 0,1 40,70\"/>\n    <path d=\"M 20,30 a 20,60 45 0,1 40,70 A 20,60 45 0,1 40,70\"/>\n    <g>\n      <path id=\"test2\" d=\"M 10,50 l 20,30 L 20,30\"/>\n    </g>\n    <path d=\"M 10,50 c 20,30 40,50 60,70 C 20,30 40,50 60,70\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <defs>\n        <path d=\"M 10,50 l 20,30 L 20,30\" id=\"test0\"/>\n        <path d=\"M 10,50 c 20,30 40,50 60,70 C 20,30 40,50 60,70\" id=\"reuse-0\"/>\n    </defs>\n    <use xlink:href=\"#test0\"/>\n    <use transform=\"translate(10, 10)\" xlink:href=\"#reuse-0\"/>\n    <use transform=\"translate(20, 20)\" xlink:href=\"#reuse-0\"/>\n    <use xlink:href=\"#reuse-0\"/>\n    <use id=\"test1\" xlink:href=\"#test0\"/>\n    <path d=\"M 10,50 a 20,60 45 0,1 40,70 A 20,60 45 0,1 40,70\"/>\n    <path d=\"M 20,30 a 20,60 45 0,1 40,70 A 20,60 45 0,1 40,70\"/>\n    <g>\n        <use id=\"test2\" xlink:href=\"#test0\"/>\n    </g>\n    <use xlink:href=\"#reuse-0\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/reusePaths.02.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <path id=\"test0\" d=\"M 10,50 l 20,30 L 20,30\"/>\n    <path id=\"test1\" stroke=\"red\" d=\"M 10,50 l 20,30 L 20,30\"/>\n    <path id=\"test2\" stroke=\"blue\" d=\"M 10,50 l 20,30 L 20,30\"/>\n    <path id=\"test3\" d=\"M 10,50 l 20,30 L 20,30\"/>\n    <path id=\"test4\" stroke=\"blue\" d=\"M 10,50 l 20,30 L 20,30\"/>\n    <path id=\"test1\" stroke=\"red\" fill=\"green\" d=\"M 10,50 l 20,30 L 20,30\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <defs>\n        <path d=\"M 10,50 l 20,30 L 20,30\" id=\"test0\"/>\n        <path stroke=\"blue\" d=\"M 10,50 l 20,30 L 20,30\" id=\"test2\"/>\n    </defs>\n    <use xlink:href=\"#test0\"/>\n    <path id=\"test1\" stroke=\"red\" d=\"M 10,50 l 20,30 L 20,30\"/>\n    <use xlink:href=\"#test2\"/>\n    <use id=\"test3\" xlink:href=\"#test0\"/>\n    <use id=\"test4\" xlink:href=\"#test2\"/>\n    <path id=\"test1\" stroke=\"red\" fill=\"green\" d=\"M 10,50 l 20,30 L 20,30\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/reusePaths.03.svg.txt",
    "content": "<svg viewBox=\"0 0 200 200\" xmlns=\"http://www.w3.org/2000/svg\">\n    <text>\n        text element\n    </text>\n</svg>\n\n@@@\n\n<svg viewBox=\"0 0 200 200\" xmlns=\"http://www.w3.org/2000/svg\">\n    <text>\n        text element\n    </text>\n</svg>\n"
  },
  {
    "path": "test/plugins/reusePaths.04.svg.txt",
    "content": "Don't create a new defs tag if one already exists as a direct child of the svg\nelement.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\"\n  xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"-29.947 60.987 69.975 102.505\">\n  <defs></defs>\n  <path fill=\"#000\" d=\"M0 0v1h.5Z\"/>\n  <path fill=\"#000\" d=\"M0 0v1h.5Z\"/>\n  <path fill=\"#000\" d=\"M0 0v1h.5Z\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"-29.947 60.987 69.975 102.505\">\n    <defs>\n        <path fill=\"#000\" d=\"M0 0v1h.5Z\" id=\"reuse-0\"/>\n    </defs>\n    <use xlink:href=\"#reuse-0\"/>\n    <use xlink:href=\"#reuse-0\"/>\n    <use xlink:href=\"#reuse-0\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/reusePaths.05.svg.txt",
    "content": "When merging existing defs, remove redundant paths with no attributes or only\nan ID attribute.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.0\" viewBox=\"0 0 400 360\">\n  <defs>\n    <path id=\"a\" d=\"M51.94 428.2c14.5-32.39 36.88-59.5 64.38-81.96 13.76-11.23 65.04-24.09 73.86-16.58 9.45 8.06 13.45 26.18 5.53 38.45-1.23 1.9-37.38 26.83-39.1 28.32-2.19 1.9-38.65 17.58-43.76 19.51-14.02 5.28-29.47 10.43-44.31 12.71-3.19.5-14.98 3.85-16.6-.45z\"/>\n    <path id=\"b\" d=\"M51.94 428.2c14.5-32.39 36.88-59.5 64.38-81.96 13.76-11.23 65.04-24.09 73.86-16.58 9.45 8.06 13.45 26.18 5.53 38.45-1.23 1.9-37.38 26.83-39.1 28.32-2.19 1.9-38.65 17.58-43.76 19.51-14.02 5.28-29.47 10.43-44.31 12.71-3.19.5-14.98 3.85-16.6-.45z\"/>\n    <clipPath id=\"c\">\n      <use xlink:href=\"#b\" width=\"100%\" height=\"100%\" overflow=\"visible\"/>\n    </clipPath>\n  </defs>\n  <g transform=\"matrix(.491 0 0 .491 10.63 63.15)\">\n    <use xlink:href=\"#b\" width=\"100%\" height=\"100%\" fill=\"#fff\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" overflow=\"visible\"/>\n    <path fill=\"none\" stroke=\"#c8cacc\" stroke-miterlimit=\"3.86\" stroke-width=\"66.34\" d=\"M48.33 412.36c14.5-32.39 36.89-59.5 64.39-81.96 13.75-11.23 65.03-24.09 73.85-16.58 9.45 8.06 13.45 26.18 5.53 38.45-1.22 1.9-37.38 26.83-39.09 28.32-2.2 1.9-38.65 17.58-43.77 19.51-14.01 5.28-29.47 10.44-44.3 12.71-3.2.5-14.99 3.85-16.61-.45z\" clip-path=\"url(#c)\"/>\n  </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.0\" viewBox=\"0 0 400 360\">\n    <defs>\n        <clipPath id=\"c\">\n            <use xlink:href=\"#a\" width=\"100%\" height=\"100%\" overflow=\"visible\"/>\n        </clipPath>\n        <path d=\"M51.94 428.2c14.5-32.39 36.88-59.5 64.38-81.96 13.76-11.23 65.04-24.09 73.86-16.58 9.45 8.06 13.45 26.18 5.53 38.45-1.23 1.9-37.38 26.83-39.1 28.32-2.19 1.9-38.65 17.58-43.76 19.51-14.02 5.28-29.47 10.43-44.31 12.71-3.19.5-14.98 3.85-16.6-.45z\" id=\"a\"/>\n    </defs>\n    <g transform=\"matrix(.491 0 0 .491 10.63 63.15)\">\n        <use xlink:href=\"#a\" width=\"100%\" height=\"100%\" fill=\"#fff\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" overflow=\"visible\"/>\n        <path fill=\"none\" stroke=\"#c8cacc\" stroke-miterlimit=\"3.86\" stroke-width=\"66.34\" d=\"M48.33 412.36c14.5-32.39 36.89-59.5 64.39-81.96 13.75-11.23 65.03-24.09 73.85-16.58 9.45 8.06 13.45 26.18 5.53 38.45-1.22 1.9-37.38 26.83-39.09 28.32-2.2 1.9-38.65 17.58-43.77 19.51-14.01 5.28-29.47 10.44-44.3 12.71-3.2.5-14.99 3.85-16.61-.45z\" clip-path=\"url(#c)\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/plugins/reusePaths.06.svg.txt",
    "content": "Don't remove and reuse the ID of the duplicate path if it's already being linked\nin an href by another node.\n\n===\n\n<svg xmlns=\"http://www.w3.org/2000/svg\"\n  xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"-29.947 60.987 69.975 102.505\">\n  <g transform=\"translate(-59 64)\">\n    <g id=\"b\">\n      <path id=\"a\" fill=\"#000\" d=\"M0 0v1h.5Z\" transform=\"rotate(18 3.157 -.5)\"/>\n      <use xlink:href=\"#a\" width=\"1\" height=\"1\" transform=\"scale(-1 1)\"/>\n    </g>\n    <use xlink:href=\"#b\" width=\"1\" height=\"1\" transform=\"rotate(72)\"/>\n    <use xlink:href=\"#b\" width=\"1\" height=\"1\" transform=\"rotate(-72)\"/>\n    <use xlink:href=\"#b\" width=\"1\" height=\"1\" transform=\"rotate(144)\"/>\n    <use xlink:href=\"#b\" width=\"1\" height=\"1\" transform=\"rotate(-144)\"/>\n  </g>\n  <path id=\"c\" fill=\"#000\" d=\"M0 0v1h.5Z\" transform=\"rotate(18 3.157 -.5)\"/>\n  <use xlink:href=\"#c\" width=\"1\" height=\"1\" transform=\"scale(-1 1)\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"-29.947 60.987 69.975 102.505\">\n    <defs>\n        <path fill=\"#000\" d=\"M0 0v1h.5Z\" id=\"reuse-0\"/>\n    </defs>\n    <g transform=\"translate(-59 64)\">\n        <g id=\"b\">\n            <use id=\"a\" transform=\"rotate(18 3.157 -.5)\" xlink:href=\"#reuse-0\"/>\n            <use xlink:href=\"#a\" width=\"1\" height=\"1\" transform=\"scale(-1 1)\"/>\n        </g>\n        <use xlink:href=\"#b\" width=\"1\" height=\"1\" transform=\"rotate(72)\"/>\n        <use xlink:href=\"#b\" width=\"1\" height=\"1\" transform=\"rotate(-72)\"/>\n        <use xlink:href=\"#b\" width=\"1\" height=\"1\" transform=\"rotate(144)\"/>\n        <use xlink:href=\"#b\" width=\"1\" height=\"1\" transform=\"rotate(-144)\"/>\n    </g>\n    <use id=\"c\" transform=\"rotate(18 3.157 -.5)\" xlink:href=\"#reuse-0\"/>\n    <use xlink:href=\"#c\" width=\"1\" height=\"1\" transform=\"scale(-1 1)\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/sortAttrs.01.svg.txt",
    "content": "Sort according default list and alphabetically\n\n===\n\n<svg r=\"\" b=\"\" x2=\"\" cx=\"\" y1=\"\" a=\"\" y=\"\" y2=\"\" x1=\"\" cy=\"\" x=\"\"></svg>\n\n@@@\n\n<svg x=\"\" x1=\"\" x2=\"\" y=\"\" y1=\"\" y2=\"\" cx=\"\" cy=\"\" r=\"\" a=\"\" b=\"\"/>\n"
  },
  {
    "path": "test/plugins/sortAttrs.02.svg.txt",
    "content": "Sort derived attributes like fill and fill-opacity\n\n===\n\n<svg a=\"\" fill-opacity=\"\" stroke=\"\" fill=\"\" stroke-opacity=\"\"></svg>\n\n@@@\n\n<svg fill=\"\" fill-opacity=\"\" stroke=\"\" stroke-opacity=\"\" a=\"\"/>\n"
  },
  {
    "path": "test/plugins/sortAttrs.03.svg.txt",
    "content": "Put xmlns and namespace attributes before others by default\n\n===\n\n<svg xmlns:editor2=\"link\" fill=\"\" b=\"\" xmlns:xlink=\"\" xmlns:editor1=\"link\" xmlns=\"\" d=\"\">\n  <rect editor2:b=\"\" editor1:b=\"\" editor2:a=\"\" editor1:a=\"\" />\n</svg>\n\n@@@\n\n<svg xmlns=\"\" xmlns:editor1=\"link\" xmlns:editor2=\"link\" xmlns:xlink=\"\" fill=\"\" d=\"\" b=\"\">\n    <rect editor1:a=\"\" editor1:b=\"\" editor2:a=\"\" editor2:b=\"\"/>\n</svg>\n"
  },
  {
    "path": "test/plugins/sortAttrs.04.svg.txt",
    "content": "Optionally sort xmlns and xmlns:* attributes alphabetically\n\n===\n\n<svg foo=\"bar\" xmlns=\"http://www.w3.org/2000/svg\" height=\"10\" baz=\"quux\" width=\"10\" hello=\"world\">\n    <rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" stroke-width=\"1\" stroke-linejoin=\"round\" fill=\"red\" stroke=\"orange\" xmlns=\"http://www.w3.org/2000/svg\"/>\n    test\n</svg>\n\n@@@\n\n<svg width=\"10\" height=\"10\" baz=\"quux\" foo=\"bar\" hello=\"world\" xmlns=\"http://www.w3.org/2000/svg\">\n    <rect width=\"100\" height=\"100\" x=\"0\" y=\"0\" fill=\"red\" stroke=\"orange\" stroke-linejoin=\"round\" stroke-width=\"1\" xmlns=\"http://www.w3.org/2000/svg\"/>\n    test\n</svg>\n\n@@@\n\n{ \"xmlnsOrder\": \"alphabetical\" }\n"
  },
  {
    "path": "test/plugins/sortDefsChildren.01.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <text id=\"a\">\n            referenced text\n        </text>\n        <path id=\"b\" d=\"M0 0zM10 10zM20 20l10 10M30 0c10 0 20 10 20 20M30 30z\"/>\n        <text id=\"c\">\n            referenced text\n        </text>\n        <path id=\"d\" d=\"M 30,30 z\"/>\n        <circle id=\"e\" fill=\"none\" fill-rule=\"evenodd\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <circle id=\"f\" fill=\"none\" fill-rule=\"evenodd\" cx=\"60\" cy=\"60\" r=\"50\"/>\n    </defs>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <defs>\n        <circle id=\"e\" fill=\"none\" fill-rule=\"evenodd\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <circle id=\"f\" fill=\"none\" fill-rule=\"evenodd\" cx=\"60\" cy=\"60\" r=\"50\"/>\n        <text id=\"a\">\n            referenced text\n        </text>\n        <text id=\"c\">\n            referenced text\n        </text>\n        <path id=\"b\" d=\"M0 0zM10 10zM20 20l10 10M30 0c10 0 20 10 20 20M30 30z\"/>\n        <path id=\"d\" d=\"M 30,30 z\"/>\n    </defs>\n</svg>\n"
  },
  {
    "path": "test/regression/compare.js",
    "content": "import fs from 'node:fs/promises';\nimport os from 'node:os';\nimport path from 'node:path';\nimport pixelmatch from 'pixelmatch';\nimport { chromium } from 'playwright';\nimport { PNG } from 'pngjs';\nimport { expectMismatch, ignore, skip } from './file-lists.js';\nimport { pathToPosix, printReport } from './lib.js';\nimport {\n  readReport,\n  readVersion,\n  REGRESSION_DIFFS_PATH,\n  REGRESSION_FIXTURES_PATH,\n  REGRESSION_OPTIMIZED_PATH,\n  writeReport,\n} from './regression-io.js';\n\nconst NAVIGATION_TIMEOUT_MS = 0;\nconst WIDTH = 960;\nconst HEIGHT = 720;\n\n/** @type {import('playwright').PageScreenshotOptions} */\nconst screenshotOptions = {\n  omitBackground: true,\n  animations: 'disabled',\n};\n\n/**\n * @param {ReadonlyArray<string>} list\n * @returns {Promise<Omit<import('./regression-io.js').TestReport, 'metrics' | 'checksums'>>}\n */\nconst runTests = async (list) => {\n  const version = await readVersion();\n  const listCopy = [...list];\n\n  /** @type {Omit<import('./regression-io.js').TestReport, 'metrics' | 'checksums'>} */\n  const report = {\n    version,\n    files: {\n      toMatch: listCopy.length - expectMismatch.length - ignore.length,\n      toMismatch: expectMismatch.length,\n      toIgnore: ignore.length,\n      toSkip: skip.length,\n    },\n    results: {\n      match: 0,\n      expectMismatch: 0,\n      ignored: 0,\n    },\n    errors: {\n      shouldHaveMatched: [],\n      shouldHaveMismatched: [],\n    },\n  };\n\n  const totalFiles = listCopy.length;\n  let tested = 0;\n\n  /**\n   * @param {import('playwright').Page} page\n   * @param {string} name\n   */\n  const processFile = async (page, name) => {\n    await page.goto(`file://${path.join(REGRESSION_FIXTURES_PATH, name)}`);\n    let element = await page.waitForSelector('svg');\n    const originalBuffer = await element.screenshot(screenshotOptions);\n\n    await page.goto(`file://${path.join(REGRESSION_OPTIMIZED_PATH, name)}`);\n    element = await page.waitForSelector('svg');\n    const optimizedBufferPromise = element.screenshot(screenshotOptions);\n\n    const originalPng = PNG.sync.read(originalBuffer);\n    const optimizedPng = PNG.sync.read(await optimizedBufferPromise);\n    const writeDiffs = process.env.NO_DIFF == null;\n    const diff = writeDiffs\n      ? new PNG({ width: originalPng.width, height: originalPng.height })\n      : null;\n\n    const matched = pixelmatch(\n      originalPng.data,\n      optimizedPng.data,\n      diff?.data,\n      originalPng.width,\n      originalPng.height,\n    );\n\n    // ignore small aliasing issues\n    const threshold = originalPng.width <= 16 ? 3 : 4;\n    const isMatch = matched <= threshold;\n    const namePosix = pathToPosix(name);\n    const expectedToMismatch = expectMismatch.includes(namePosix);\n\n    if (isMatch) {\n      if (expectedToMismatch) {\n        report.errors.shouldHaveMismatched.push(namePosix);\n      } else if (ignore.includes(namePosix)) {\n        report.results.ignored++;\n      } else {\n        report.results.match++;\n      }\n    } else {\n      if (expectedToMismatch) {\n        report.results.expectMismatch++;\n      } else if (!ignore.includes(namePosix)) {\n        report.errors.shouldHaveMatched.push(namePosix);\n      }\n\n      if (diff) {\n        const file = path.join(REGRESSION_DIFFS_PATH, `${name}.diff.png`);\n        await fs.mkdir(path.dirname(file), { recursive: true });\n        await fs.writeFile(file, PNG.sync.write(diff));\n      }\n    }\n\n    if (process.stdout.isTTY) {\n      process.stdout.clearLine(0);\n      process.stdout.write(\n        `\\rCompared ${(++tested).toLocaleString()} of ${totalFiles.toLocaleString()}…`,\n      );\n    }\n  };\n\n  const worker = async () => {\n    let item;\n    const page = await context.newPage();\n    while ((item = listCopy.pop())) {\n      await processFile(page, item);\n    }\n    await page.close();\n  };\n\n  const browser = await chromium.launch();\n  const context = await browser.newContext({\n    javaScriptEnabled: false,\n    viewport: { width: WIDTH, height: HEIGHT },\n  });\n  context.setDefaultTimeout(NAVIGATION_TIMEOUT_MS);\n\n  await Promise.all(\n    Array.from(new Array(os.cpus().length * 2), () => worker()),\n  );\n  await browser.close();\n\n  if (process.stdout.isTTY) {\n    console.log();\n  }\n\n  return report;\n};\n\n(async () => {\n  try {\n    const filesPromise = fs.readdir(REGRESSION_FIXTURES_PATH, {\n      recursive: true,\n    });\n    const list = (await filesPromise).filter((name) => name.endsWith('.svg'));\n\n    const report = await runTests(list);\n    const metrics = await readReport();\n    const combinedReport = {\n      ...report,\n      ...metrics,\n    };\n\n    printReport(\n      /** @type {import('./regression-io.js').TestReport}*/ (combinedReport),\n    );\n    await writeReport(combinedReport);\n\n    const failed =\n      report.results.match !== report.files.toMatch ||\n      report.results.expectMismatch !== report.files.toMismatch;\n\n    if (failed) {\n      process.exit(1);\n    }\n  } catch (error) {\n    console.error(error);\n    process.exit(1);\n  }\n})();\n"
  },
  {
    "path": "test/regression/delta.js",
    "content": "#!/usr/bin/env node\n\nimport { bytesToHumanReadable, secsToHumanReadable } from './lib.js';\nimport { readReport } from './regression-io.js';\n\n/**\n * @typedef {object} DeltaReport\n * @property {number} filesAffected Files that changed between the two reports.\n * @property {number} totalFiles Total files that were in the test suite.\n * @property {number} bytesDelta\n *   Difference in total bytes saved. Positive if we reduce more bytes, or\n *   negative if we reduce less bytes. Higher is better!\n * @property {number} secsDelta\n *   Difference in total time taken. Positive if we took longer to optimize, or\n *   negative if we took less time to optimize. Lower is better!\n * @property {number} memDelta\n *   Difference in peak memory allocation. Positive if we used more memory, or\n *   negative if we used less memory. Lower is better!\n */\n\nconst HEADING = '▶ Relative to svg/svgo.git#main';\n\n/**\n * @param {import('./regression-io.js').TestReport} reportMain\n * @param {import('./regression-io.js').TestReport} reportHead\n * @returns {DeltaReport}\n */\nfunction deltaReport(reportMain, reportHead) {\n  if (reportMain.version !== reportHead.version) {\n    console.error(`${HEADING}\n  Previous test report used a different version of SVGO Test Suite.\n  Rerun regression tests on main to regenerate test report, then try again.`);\n    process.exit(1);\n  }\n\n  const filesAffected = Object.keys(reportMain.checksums).reduce((acc, val) => {\n    return reportMain.checksums[val] === reportHead.checksums[val]\n      ? acc\n      : acc + 1;\n  }, 0);\n\n  return {\n    filesAffected,\n    totalFiles:\n      reportMain.files.toMatch +\n      reportMain.files.toMismatch +\n      reportMain.files.toIgnore,\n    bytesDelta: reportHead.metrics.bytesSaved - reportMain.metrics.bytesSaved,\n    secsDelta:\n      reportHead.metrics.timeTakenSecs - reportMain.metrics.timeTakenSecs,\n    memDelta:\n      reportHead.metrics.peakMemoryAlloc - reportMain.metrics.peakMemoryAlloc,\n  };\n}\n\n/**\n * @param {DeltaReport} deltaReport\n */\nfunction writeReport(deltaReport) {\n  const { bytesDelta, filesAffected, memDelta, secsDelta, totalFiles } =\n    deltaReport;\n\n  console.log(`${HEADING}\n       Files Affected: ${filesAffected.toLocaleString()} / ${totalFiles.toLocaleString()}\n        Bytes Saved Δ: ${toDisplayString(bytesDelta, (n) => bytesToHumanReadable(n))}\n         Time Taken Δ: ${toDisplayString(secsDelta, (n) => secsToHumanReadable(n))}\n  Peak Memory Alloc Δ: ${toDisplayString(memDelta, (n) => bytesToHumanReadable(n, 'KiB'))}`);\n}\n\n/**\n * @param {number} num\n * @param {(num: number) => string} fn\n */\nfunction toDisplayString(num, fn) {\n  if (num === 0) {\n    return fn(0);\n  }\n\n  if (num > 0) {\n    return `+${fn(num)}`;\n  }\n\n  return `-${fn(Math.abs(num))}`;\n}\n\nconst reportMain = /** @type {import('./regression-io.js').TestReport} */ (\n  await readReport(process.argv[2])\n);\nconst reportHead = /** @type {import('./regression-io.js').TestReport} */ (\n  await readReport(process.argv[3])\n);\nconst report = deltaReport(reportMain, reportHead);\nwriteReport(report);\n"
  },
  {
    "path": "test/regression/extract.js",
    "content": "/**\n * @fileoverview Download and extracts the latest version of SVGO Test Suite.\n */\n\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport stream from 'node:stream';\nimport util from 'node:util';\nimport zlib from 'node:zlib';\nimport tarStream from 'tar-stream';\nimport { skip, validateFileLists } from './file-lists.js';\nimport {\n  readPrevEtag,\n  REGRESSION_FIXTURES_PATH,\n  writeEtag,\n  TEMP_DIR_PATH,\n} from './regression-io.js';\n\nconst pipeline = util.promisify(stream.pipeline);\n\n/**\n * @param {string} url\n * @param {string} baseDir\n */\nconst extractTarGz = async (url, baseDir) => {\n  /** @type {string[]} */\n  const svgs = [];\n  const extract = tarStream.extract();\n\n  extract.on('entry', async (header, stream, next) => {\n    const name = header.name.slice(16);\n    const isSvg = name.endsWith('.svg');\n\n    if (name === 'VERSION' || isSvg) {\n      if (isSvg) {\n        svgs.push(name);\n      }\n\n      if (!skip.includes(name)) {\n        if (name.includes('..')) {\n          throw Error(`File in archive includes path traversal: ${name}`);\n        }\n\n        try {\n          const file = path.join(baseDir, name);\n          await fs.promises.mkdir(path.dirname(file), { recursive: true });\n          await pipeline(stream, fs.createWriteStream(file));\n        } catch (error) {\n          console.error(error);\n          process.exit(1);\n        }\n      }\n    }\n\n    stream.resume();\n    next();\n  });\n\n  const etag = await readPrevEtag();\n\n  /** @type {Record<string, string>} */\n  const headers = {};\n\n  if (etag) {\n    headers['If-None-Match'] = etag;\n  }\n\n  const response = await fetch(url, {\n    headers,\n  });\n\n  if (response.status === 200 && response.body) {\n    console.info('Downloading SVGO Test Suite and extracting files…');\n    await fs.promises.rm(REGRESSION_FIXTURES_PATH, {\n      recursive: true,\n      force: true,\n    });\n    await pipeline(response.body, zlib.createGunzip(), extract);\n    await validateFileLists(svgs);\n\n    const etag = response.headers.get('ETag');\n    if (etag) {\n      await writeEtag(etag);\n    }\n  } else if (response.status === 304) {\n    console.info('Reusing local copy of SVGO Test Suite');\n  }\n};\n\n(async () => {\n  try {\n    console.info('Using temporary directory: %s\\n', TEMP_DIR_PATH);\n    await extractTarGz(\n      'https://svg.github.io/svgo-test-suite/svgo-test-suite.tar.gz',\n      REGRESSION_FIXTURES_PATH,\n    );\n  } catch (error) {\n    console.error(error);\n    process.exit(1);\n  }\n})();\n"
  },
  {
    "path": "test/regression/file-lists.js",
    "content": "/**\n * @fileoverview\n *   Helpers to interact with file lists. File lists are used to configure\n *   exceptions in SVGO Test Suite.\n *\n *   All file lists are defined in `./lists`.\n *\n *   Syntax:\n *   * All entires must be written with POSIX file separators.\n *   * Comments can be written by putting `#` at the start of the line.\n *   * Blank lines are ignored.\n */\n\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { readFileList, toBulletPointList } from './lib.js';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\n/**\n * SVGs that we know are broken by SVGO. The build will fail if during the\n * regression pipeline, we determine that one of them are actually not broken.\n * This is for when we've intentionally or incidentally fixed an SVG.\n */\nexport const expectMismatch = await readFileList(\n  path.join(__dirname, 'lists', 'expect-mismatch.txt'),\n);\n\n/**\n * Ignore the results of these SVGs as they are finicky. They sometimes pass,\n * sometimes fail, we'll figure out why eventually. We'll report the status of\n * them regardless, but the result has no effect on the pipeline status.\n */\nexport const ignore = await readFileList(\n  path.join(__dirname, 'lists', 'ignore.txt'),\n);\n\n/**\n * SVGs that we shouldn't extract. We only have one SVG for this scenario right\n * now, which takes too long to optimize to be practical for CI environments.\n */\nexport const skip = await readFileList(\n  path.join(__dirname, 'lists', 'skip.txt'),\n);\n\n/**\n * @param {string[]} svgs SVGs names that are available.\n * @throws {Exception} If any of the file lists are malformed.\n */\nexport async function validateFileLists(svgs) {\n  let errored = false;\n\n  const allFiles = [...expectMismatch, ...ignore, ...skip];\n  /** @type {string[]} */\n  const duplicates = [];\n\n  for (const file of allFiles) {\n    if (allFiles.indexOf(file) != allFiles.lastIndexOf(file)) {\n      if (!duplicates.includes(file)) {\n        duplicates.push(file);\n      }\n    }\n  }\n\n  if (duplicates.length !== 0) {\n    console.error(\n      `Files name may only ever appear once across all file lists:\\n${toBulletPointList(duplicates)}\\n`,\n    );\n    errored = true;\n  }\n\n  const fileLists = [\n    ['expect-mismatch.txt', expectMismatch],\n    ['ignore.txt', ignore],\n    ['skip.txt', skip],\n  ];\n\n  for (const [name, fileList] of fileLists) {\n    const errors = [];\n\n    for (const file of fileList) {\n      if (!svgs.includes(file)) {\n        errors.push(file);\n      }\n    }\n\n    if (errors.length !== 0) {\n      console.error(\n        `${name} has files that don't exist in SVGO Test Suite:\\n${toBulletPointList(errors)}\\n`,\n      );\n      errored = true;\n    }\n  }\n\n  if (errored) {\n    throw new Error('Validation for test suite file lists failed.');\n  }\n}\n"
  },
  {
    "path": "test/regression/lib.js",
    "content": "/**\n * @fileoverview Utilities to manage manage regression tests.\n */\n\nimport { exec } from 'node:child_process';\nimport crypto from 'node:crypto';\nimport path from 'node:path';\nimport fs from 'node:fs/promises';\nimport picocolors from 'picocolors';\n\n/**\n * @typedef {'KiB' | 'MiB' | 'GiB' | 'TiB'} StorageUnit\n */\n\n/** @type {StorageUnit[]} */\nconst UNITS = ['KiB', 'MiB', 'GiB', 'TiB'];\n\n/**\n * Reads a list of file paths from a file in predefine, ignoring empty lines and\n * any lines starting with a # as these are treated as comments.\n *\n * @param {string} path\n *   Path to a file relative to the working directory of the process.\n * @returns {Promise<string[]>}\n *   File paths that were listed at the given path.\n */\nexport async function readFileList(path) {\n  const content = await fs.readFile(path, 'utf-8');\n  return content.split('\\n').filter((l) => l.length !== 0 && l[0] !== '#');\n}\n\n/**\n * @param {string} value\n * @returns {string}\n */\nexport function md5sum(value) {\n  const hasher = crypto.createHash('md5');\n  return hasher.update(value).digest('hex');\n}\n\n/**\n * @param {import('./regression-io.js').TestReport} report\n */\nexport async function printReport(report) {\n  const { shouldHaveMatched, shouldHaveMismatched } = report.errors;\n\n  console.log(`SVGO Test Suite Version: ${report.version}\n\n▶ Test Results\n              Match: ${report.results.match.toLocaleString()} / ${report.files.toMatch.toLocaleString()}\n  Expected Mismatch: ${report.results.expectMismatch.toLocaleString()} / ${report.files.toMismatch.toLocaleString()}\n            Ignored: ${report.results.ignored.toLocaleString()} / ${report.files.toIgnore.toLocaleString()}\n            Skipped: ${report.files.toSkip.toLocaleString()}\n\n▶ Metrics\n        Bytes Saved: ${bytesToHumanReadable(report.metrics.bytesSaved)}\n         Time Taken: ${secsToHumanReadable(report.metrics.timeTakenSecs)}\n  Peak Memory Alloc: ${bytesToHumanReadable(report.metrics.peakMemoryAlloc, 'KiB')}${\n    shouldHaveMatched.length !== 0\n      ? picocolors.red(\n          `\\n\\n▶ Expected match, but actually mismatched:\\n${toBulletPointList(shouldHaveMatched, '✖')}`,\n        )\n      : ''\n  }${\n    shouldHaveMismatched.length !== 0\n      ? picocolors.red(\n          `\\n\\n▶ Expected mismatch, but actually matched:\\n${toBulletPointList(shouldHaveMismatched, '✖')}`,\n        )\n      : ''\n  }`);\n}\n\n/**\n * @param {number} bytes\n * @param {StorageUnit=} startingUnits\n *   If the first argument is specified in a unit other than bytes, then a\n *   string representing the units that was passed.\n * @returns {string}\n */\nexport function bytesToHumanReadable(bytes, startingUnits) {\n  let units = startingUnits ? UNITS.indexOf(startingUnits) : 0;\n  let value = startingUnits ? bytes : bytes / 1024;\n\n  while (value > 1024) {\n    units++;\n    value /= 1024;\n  }\n\n  return `${value.toLocaleString(undefined, {\n    maximumFractionDigits: 3,\n  })} ${UNITS[units]}`;\n}\n\n/**\n * @param {number} secs\n * @returns {string}\n */\nexport function secsToHumanReadable(secs) {\n  const hours = Math.floor(secs / 3600);\n  secs -= hours * 3600;\n\n  const minutes = Math.floor(secs / 60);\n  secs -= minutes * 60;\n\n  const arr = new Array(1);\n\n  if (hours) {\n    arr.push(`${hours}h`);\n  }\n\n  if (minutes) {\n    arr.push(`${minutes.toString().padStart(2, '0')}m`);\n  }\n\n  arr.push(`${Math.round(secs).toString().padStart(2, '0')}s`);\n  return arr.join('');\n}\n\n/**\n * @param {string[]} arr\n * @param {string} bullet\n * @returns {string}\n */\nexport function toBulletPointList(arr, bullet = '*') {\n  return arr.map((s) => `${bullet} ${s}`).join('\\n');\n}\n\n/**\n * @param {string} filepath\n *   Path that uses file separators for the current operating system.\n *   ({@link path.sep})\n * @returns {string}\n *   Same path but with POSIX file separators. ({@link path.posix.sep})\n */\nexport function pathToPosix(filepath) {\n  return filepath.replaceAll(path.sep, path.posix.sep);\n}\n\n/**\n * @returns {Promise<string>}\n */\nexport async function getCommitRef() {\n  return new Promise((res, rej) => {\n    exec('git rev-parse HEAD', (err, stdout) => {\n      if (err) {\n        rej(err);\n        return;\n      }\n\n      res(stdout.trim());\n    });\n  });\n}\n"
  },
  {
    "path": "test/regression/lists/expect-mismatch.txt",
    "content": "# messed gradients\nW3C_SVG_11_TestSuite/svg/pservers-grad-18-b.svg\n\n# rect is converted to path which matches wrong styles\nW3C_SVG_11_TestSuite/svg/styling-css-08-f.svg\n\n# complex selectors are messed because of converting shapes to paths\nW3C_SVG_11_TestSuite/svg/struct-use-10-f.svg\nW3C_SVG_11_TestSuite/svg/struct-use-11-f.svg\nW3C_SVG_11_TestSuite/svg/styling-css-01-b.svg\nW3C_SVG_11_TestSuite/svg/styling-css-04-f.svg\n\n# broken and pending fix\ncharm-icons-0.18.0/docs/img/splash.svg\noxygen-icons-5.116.0/scalable/actions/hidef/tools-rip-audio-cd.svg\noxygen-icons-5.116.0/scalable/actions/im-ban-kick-user.svg\noxygen-icons-5.116.0/scalable/actions/im-ban-user.svg\noxygen-icons-5.116.0/scalable/actions/irc-close-channel.svg\noxygen-icons-5.116.0/scalable/actions/irc-remove-operator.svg\noxygen-icons-5.116.0/scalable/actions/irc-unvoice.svg\noxygen-icons-5.116.0/scalable/actions/list-add.svg\noxygen-icons-5.116.0/scalable/actions/list-remove-user.svg\noxygen-icons-5.116.0/scalable/actions/list-remove.svg\noxygen-icons-5.116.0/scalable/actions/mail-send.svg\noxygen-icons-5.116.0/scalable/actions/player-volume.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/document-edit-decrypt.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/document-edit-encrypt.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/document-edit-sign.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/document-edit-verify.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/im-ban-user.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/im-yahoo.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/irc-close-channel.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/irc-remove-operator.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/irc-unvoice.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/list-add-user.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/mail-encrypted-full.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/mail-encrypted-part.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/mail-encrypted.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/mail-signature-unknown.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/mail-signed-full.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/mail-signed-part.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/mail-signed.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/mail-tagged.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/tools-media-optical-burn-image.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/view-calendar-list.svg\noxygen-icons-5.116.0/scalable/actions/small/16x16/view-time-schedule-calculus.svg\noxygen-icons-5.116.0/scalable/actions/small/22x22/edit-select-none.svg\noxygen-icons-5.116.0/scalable/actions/small/22x22/im-google.svg\noxygen-icons-5.116.0/scalable/actions/small/22x22/irc-close-channel.svg\noxygen-icons-5.116.0/scalable/actions/small/22x22/list-add-user.svg\noxygen-icons-5.116.0/scalable/actions/small/22x22/mail-forward.svg\noxygen-icons-5.116.0/scalable/actions/small/22x22/mail-queue.svg\noxygen-icons-5.116.0/scalable/actions/small/22x22/mail-receive.svg\noxygen-icons-5.116.0/scalable/actions/small/22x22/mixer-cd.svg\noxygen-icons-5.116.0/scalable/actions/small/22x22/news-unsubscribe.svg\noxygen-icons-5.116.0/scalable/actions/small/22x22/tools-media-optical-burn-image.svg\noxygen-icons-5.116.0/scalable/actions/small/22x22/tools-media-optical-copy.svg\noxygen-icons-5.116.0/scalable/actions/small/22x22/view-calendar-list.svg\noxygen-icons-5.116.0/scalable/actions/small/22x22/view-time-schedule-baselined-remove.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/documentation.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/edit-table-delete-column.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/edit-table-delete-row.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/im-ban-kick-user.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/im-ban-user.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/im-google.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/mail-mark-junk.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/tools-media-optical-burn-image.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/tools-rip-video-dvd.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/view-calendar-birthday.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/view-calendar-holiday.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/view-calendar-special-occasion.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/view-calendar-wedding-anniversary.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/view-time-schedule-baselined-add.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/view-time-schedule-baselined-remove.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/view-time-schedule-baselined.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/view-time-schedule-calculus.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/view-time-schedule-child-insert.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/view-time-schedule-edit.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/view-time-schedule-insert.svg\noxygen-icons-5.116.0/scalable/actions/small/32x32/view-time-schedule.svg\noxygen-icons-5.116.0/scalable/actions/small/48x48/im-google.svg\noxygen-icons-5.116.0/scalable/actions/small/48x48/preflight-verifier.svg\noxygen-icons-5.116.0/scalable/actions/small/48x48/tools-media-optical-burn-image.svg\noxygen-icons-5.116.0/scalable/actions/small/48x48/view-time-schedule-calculus.svg\noxygen-icons-5.116.0/scalable/actions/tools-media-optical-burn-image.svg\noxygen-icons-5.116.0/scalable/actions/tools-rip-audio-cd.svg\noxygen-icons-5.116.0/scalable/actions/user-properties.svg\noxygen-icons-5.116.0/scalable/actions/view-pim-mail.svg\noxygen-icons-5.116.0/scalable/applets/org.kde.plasma.clipboard.svg\noxygen-icons-5.116.0/scalable/applets/org.kde.plasma.devicenotifier.svg\noxygen-icons-5.116.0/scalable/applets/org.kde.plasma.icontasks.svg\noxygen-icons-5.116.0/scalable/applets/org.kde.plasma.kickerdash.svg\noxygen-icons-5.116.0/scalable/applets/org.kde.plasma.quicklaunch.svg\noxygen-icons-5.116.0/scalable/apps/accessories-text-editor.svg\noxygen-icons-5.116.0/scalable/apps/basket.svg\noxygen-icons-5.116.0/scalable/apps/graphics-viewer-document.svg\noxygen-icons-5.116.0/scalable/apps/hardware.svg\noxygen-icons-5.116.0/scalable/apps/hidef/kmail2.svg\noxygen-icons-5.116.0/scalable/apps/hidef/preferences-desktop-locale.svg\noxygen-icons-5.116.0/scalable/apps/hwinfo.svg\noxygen-icons-5.116.0/scalable/apps/kde-gtk-config.svg\noxygen-icons-5.116.0/scalable/apps/kjournal.svg\noxygen-icons-5.116.0/scalable/apps/kmail2.svg\noxygen-icons-5.116.0/scalable/apps/kmymoney.svg\noxygen-icons-5.116.0/scalable/apps/kplato.svg\noxygen-icons-5.116.0/scalable/apps/ksudoku.svg\noxygen-icons-5.116.0/scalable/apps/okteta.svg\noxygen-icons-5.116.0/scalable/apps/picmi.svg\noxygen-icons-5.116.0/scalable/apps/preferences-desktop-user-password.svg\noxygen-icons-5.116.0/scalable/apps/preferences-system-time.svg\noxygen-icons-5.116.0/scalable/apps/scribus.svg\noxygen-icons-5.116.0/scalable/apps/small/22x22/basket.svg\noxygen-icons-5.116.0/scalable/apps/small/32x32/preferences-system-windows-move.svg\noxygen-icons-5.116.0/scalable/apps/small/48x48/kig.svg\noxygen-icons-5.116.0/scalable/apps/small/64x64/kplato.svg\noxygen-icons-5.116.0/scalable/apps/strigi.svg\noxygen-icons-5.116.0/scalable/apps/timevault.svg\noxygen-icons-5.116.0/scalable/apps/utilities-log-viewer.svg\noxygen-icons-5.116.0/scalable/categories/applications-education-preschool.svg\noxygen-icons-5.116.0/scalable/devices/audio-card.svg\noxygen-icons-5.116.0/scalable/devices/camera-web.svg\noxygen-icons-5.116.0/scalable/devices/hidef/input-keyboard.svg\noxygen-icons-5.116.0/scalable/devices/hidef/media-optical-audio.svg\noxygen-icons-5.116.0/scalable/devices/input-keyboard.svg\noxygen-icons-5.116.0/scalable/devices/media-optical-audio.svg\noxygen-icons-5.116.0/scalable/devices/scanner.svg\noxygen-icons-5.116.0/scalable/devices/small/16x16/media-optical-audio.svg\noxygen-icons-5.116.0/scalable/devices/small/16x16/media-optical-data.svg\noxygen-icons-5.116.0/scalable/devices/small/22x22/media-optical-audio.svg\noxygen-icons-5.116.0/scalable/devices/small/22x22/media-optical-data.svg\noxygen-icons-5.116.0/scalable/devices/small/32x32/media-optical-audio.svg\noxygen-icons-5.116.0/scalable/devices/small/48x48/media-optical-audio.svg\noxygen-icons-5.116.0/scalable/mimetypes/application-x-cd-image.svg\noxygen-icons-5.116.0/scalable/mimetypes/application-x-cue.svg\noxygen-icons-5.116.0/scalable/mimetypes/application-x-kvtml.svg\noxygen-icons-5.116.0/scalable/mimetypes/hidef/application-rtf.svg\noxygen-icons-5.116.0/scalable/mimetypes/hidef/application-sxw.svg\noxygen-icons-5.116.0/scalable/mimetypes/small/22x22/application-javascript.svg\noxygen-icons-5.116.0/scalable/mimetypes/small/22x22/application-pdf.svg\noxygen-icons-5.116.0/scalable/mimetypes/small/22x22/application-x-javascript.svg\noxygen-icons-5.116.0/scalable/mimetypes/small/22x22/application-x-srt.svg\noxygen-icons-5.116.0/scalable/mimetypes/small/22x22/application-x-srtrip.svg\noxygen-icons-5.116.0/scalable/mimetypes/small/22x22/text-csharp.svg\noxygen-icons-5.116.0/scalable/mimetypes/small/22x22/text-css.svg\noxygen-icons-5.116.0/scalable/mimetypes/small/22x22/text-plain.svg\noxygen-icons-5.116.0/scalable/mimetypes/small/32x32/application-x-applix-word.svg\noxygen-icons-5.116.0/scalable/mimetypes/small/32x32/application-x-lyx.svg\noxygen-icons-5.116.0/scalable/mimetypes/small/48x48/application-x-cd-image.svg\noxygen-icons-5.116.0/scalable/mimetypes/small/48x48/application-x-cda.svg\noxygen-icons-5.116.0/scalable/mimetypes/small/48x48/application-x-cue.svg\noxygen-icons-5.116.0/scalable/mimetypes/small/48x48/help.svg\noxygen-icons-5.116.0/scalable/mimetypes/small/64x64/application-x-cue.svg\noxygen-icons-5.116.0/scalable/places/small/64x64/folder-tar.svg\noxygen-icons-5.116.0/scalable/places/small/64x64/network-server-database.svg\noxygen-icons-5.116.0/scalable/places/small/64x64/server-database.svg\nW3C_SVG_11_TestSuite/svg/color-prop-04-t.svg\nW3C_SVG_11_TestSuite/svg/coords-units-03-b.svg\nW3C_SVG_11_TestSuite/svg/filters-displace-01-f.svg\nW3C_SVG_11_TestSuite/svg/fonts-kern-01-t.svg\nW3C_SVG_11_TestSuite/svg/interact-pevents-01-b.svg\nW3C_SVG_11_TestSuite/svg/struct-cond-03-t.svg\nwikimedia-commons/Aegean_sea_Anatolia_and_Armenian_highlands_regions_large_topographic_basemap.svg\nwikimedia-commons/Italy_-_Regions_and_provinces.svg\nwikimedia-commons/Saariston_Rengastie_route_labels.svg\nwikimedia-commons/Spain_languages-de.svg\n"
  },
  {
    "path": "test/regression/lists/ignore.txt",
    "content": "# animations\nW3C_SVG_11_TestSuite/svg/animate-dom-01-f.svg\nW3C_SVG_11_TestSuite/svg/animate-dom-02-f.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-02-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-03-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-04-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-05-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-06-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-07-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-08-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-09-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-10-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-11-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-12-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-13-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-14-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-15-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-17-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-19-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-20-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-21-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-22-b.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-23-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-24-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-25-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-26-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-27-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-28-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-29-b.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-30-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-31-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-32-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-33-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-34-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-35-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-36-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-37-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-38-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-39-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-40-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-41-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-44-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-46-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-52-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-53-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-60-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-61-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-62-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-63-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-64-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-65-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-66-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-67-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-68-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-69-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-70-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-77-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-78-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-80-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-81-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-82-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-83-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-84-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-85-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-86-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-87-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-88-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-89-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-90-b.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-91-t.svg\nW3C_SVG_11_TestSuite/svg/animate-elem-92-t.svg\nW3C_SVG_11_TestSuite/svg/animate-interact-events-01-t.svg\nW3C_SVG_11_TestSuite/svg/animate-interact-pevents-01-t.svg\nW3C_SVG_11_TestSuite/svg/animate-interact-pevents-02-t.svg\nW3C_SVG_11_TestSuite/svg/animate-interact-pevents-03-t.svg\nW3C_SVG_11_TestSuite/svg/animate-interact-pevents-04-t.svg\nW3C_SVG_11_TestSuite/svg/animate-pservers-grad-01-b.svg\nW3C_SVG_11_TestSuite/svg/animate-script-elem-01-b.svg\nW3C_SVG_11_TestSuite/svg/animate-struct-dom-01-b.svg\n\n# other animations\nW3C_SVG_11_TestSuite/svg/filters-composite-05-f.svg\nW3C_SVG_11_TestSuite/svg/filters-light-04-f.svg\n\n# strange artifact inconsistently breaks regression tests\nW3C_SVG_11_TestSuite/svg/filters-conv-05-f.svg\n"
  },
  {
    "path": "test/regression/lists/skip.txt",
    "content": "# SVGO can not handle this SVG in a reasonable amount of time\nwikimedia-commons/1_42_polytope_7-cube.svg\n"
  },
  {
    "path": "test/regression/optimize.js",
    "content": "import fs from 'node:fs/promises';\nimport os from 'node:os';\nimport path from 'node:path';\nimport {\n  REGRESSION_FIXTURES_PATH,\n  REGRESSION_OPTIMIZED_PATH,\n  writeReport,\n} from './regression-io.js';\nimport { md5sum, pathToPosix } from './lib.js';\nimport { optimize } from '../../lib/svgo.js';\n\n/** @type {import('../../lib/types.js').Config} */\nconst SVGO_OPTS = { floatPrecision: 4 };\n\n/**\n * @param {string[]} list\n * @returns {Promise<Partial<import('./regression-io.js').TestReport>>}\n */\nconst optimizeFixtures = async (list) => {\n  const totalFiles = list.length;\n  let processed = 0;\n\n  /** @type {Pick<import('./regression-io.js').TestReport, 'metrics' | 'checksums'>} */\n  const report = {\n    metrics: {\n      bytesSaved: 0,\n      timeTakenSecs: 0,\n      peakMemoryAlloc: 0,\n    },\n    checksums: {},\n  };\n\n  /**\n   * @param {string} name\n   */\n  const processFile = async (name) => {\n    const original = await fs.readFile(\n      path.join(REGRESSION_FIXTURES_PATH, name),\n      'utf-8',\n    );\n    const optimized = optimize(original, SVGO_OPTS).data;\n    const namePosix = pathToPosix(name);\n    report.checksums[namePosix] = md5sum(optimized);\n\n    const prevFileSize = Buffer.byteLength(original, 'utf8');\n    const resultFileSize = Buffer.byteLength(optimized, 'utf8');\n    report.metrics.bytesSaved += prevFileSize - resultFileSize;\n\n    const file = path.join(REGRESSION_OPTIMIZED_PATH, name);\n    await fs.mkdir(path.dirname(file), { recursive: true });\n    await fs.writeFile(file, optimized);\n\n    if (process.stdout.isTTY) {\n      process.stdout.clearLine(0);\n      process.stdout.write(\n        `\\rOptimized ${(++processed).toLocaleString()} of ${totalFiles.toLocaleString()}…`,\n      );\n    }\n  };\n\n  const worker = async () => {\n    let item;\n    while ((item = list.pop())) {\n      await processFile(item);\n    }\n  };\n\n  await Promise.all(\n    Array.from(new Array(os.cpus().length * 2), () => worker()),\n  );\n\n  report.metrics.timeTakenSecs = process.uptime();\n  report.metrics.peakMemoryAlloc = process.resourceUsage().maxRSS;\n  return report;\n};\n\n(async () => {\n  try {\n    const filesPromise = fs.readdir(REGRESSION_FIXTURES_PATH, {\n      recursive: true,\n    });\n    const list = (await filesPromise).filter((name) => name.endsWith('.svg'));\n    const report = await optimizeFixtures(list);\n    console.log();\n    await writeReport(report);\n  } catch (error) {\n    console.error(error);\n    process.exit(1);\n  }\n})();\n"
  },
  {
    "path": "test/regression/regression-io.js",
    "content": "import fs from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\nimport path from 'node:path';\nimport { getCommitRef } from './lib.js';\n\n/**\n * @typedef Files\n * @property {number} toMatch Total SVGs expected to pass tests.\n * @property {number} toMismatch Total SVGs expected to fail tests.\n * @property {number} toIgnore\n *   Total SVGs where we don't care if they pass or fail.\n * @property {number} toSkip Total SVGs we're not testing at all.\n *\n * @typedef Results\n * @property {number} match\n *   Total SVGs that were expected to match which did match.\n * @property {number} expectMismatch\n *   Total SVGs that were expected to mismatch which did mismatch.\n * @property {number} ignored\n *   Number of SVGs that matched, but the the result don't affect the success\n *   status anyway, and is not explicitly reported.\n *\n * @typedef Metrics\n * @property {number} bytesSaved Total bytes saved throughout this test run.\n * @property {number} timeTakenSecs Total time taken throughout this test run.\n * @property {number} peakMemoryAlloc\n *   Peak memory allocation throughout this test run in kibibytes (1,024 bytes).\n *\n * @typedef Errors\n * @property {string[]} shouldHaveMatched\n * @property {string[]} shouldHaveMismatched\n *\n * @typedef TestReport\n * @property {string} version SVGO Test Suite version.\n * @property {Files} files\n * @property {Results} results\n * @property {Metrics} metrics\n * @property {Errors} errors\n * @property {Record<string, string>} checksums\n *   Dictionary of checksums after an SVG has been optimized. Keys are filepaths\n *   with POSIX file separators.\n */\n\nconst GIT_COMMIT_REF = await getCommitRef();\n\nexport const TEMP_DIR_PATH = path.join(tmpdir(), `svgo.${GIT_COMMIT_REF}`);\nexport const REGRESSION_FIXTURES_PATH = path.join(\n  TEMP_DIR_PATH,\n  'regression-fixtures',\n);\nexport const REGRESSION_OPTIMIZED_PATH = path.join(\n  TEMP_DIR_PATH,\n  'regression-optimized',\n);\nexport const REGRESSION_DIFFS_PATH = path.join(\n  TEMP_DIR_PATH,\n  'regression-diff',\n);\nexport const REGRESSION_VERSION_PATH = path.join(\n  REGRESSION_FIXTURES_PATH,\n  'VERSION',\n);\nexport const OPTIMIZATION_REPORT_PATH = path.join(\n  TEMP_DIR_PATH,\n  'svgo-test-report.json',\n);\n\n/**\n * Path to a file that stores the `ETag` header returned from the\n * webserver when download the SVGO Test Suite.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/ETag\n */\nexport const ETAG_PATH = path.join(TEMP_DIR_PATH, '.etag');\n\n/**\n * @param {Partial<TestReport>} data\n */\nexport async function writeReport(data) {\n  await fs.writeFile(OPTIMIZATION_REPORT_PATH, JSON.stringify(data));\n}\n\n/**\n * @returns {Promise<Partial<TestReport>>}\n */\nexport async function readReport(path = OPTIMIZATION_REPORT_PATH) {\n  const text = await fs.readFile(path, 'utf-8');\n  return JSON.parse(text);\n}\n\n/**\n * @returns {Promise<string>}\n */\nexport async function readVersion() {\n  return (await fs.readFile(REGRESSION_VERSION_PATH, 'utf-8')).trimEnd();\n}\n\n/**\n * @param {string} etag\n */\nexport async function writeEtag(etag) {\n  await fs.writeFile(ETAG_PATH, etag);\n}\n\n/**\n * @returns {Promise<string?>}\n *   ETag value associated with the previously retrieved archive.\n */\nexport async function readPrevEtag() {\n  try {\n    return (await fs.readFile(ETAG_PATH, 'utf-8')).trimEnd();\n  } catch (err) {\n    // @ts-expect-error Safe to assume `Error`, and works even if `code` is undefined.\n    if (err.code === 'ENOENT') {\n      return null;\n    }\n\n    throw err;\n  }\n}\n"
  },
  {
    "path": "test/svg2js/_index.test.js",
    "content": "import fs from 'fs';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { parseSvg } from '../../lib/parser.js';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\ndescribe('svg2js', () => {\n  describe('working svg', () => {\n    const filepath = path.resolve(__dirname, './test.svg');\n    /** @type {any} */\n    let root;\n\n    beforeAll((done) => {\n      fs.readFile(filepath, 'utf8', (err, data) => {\n        if (err) {\n          throw err;\n        }\n\n        root = parseSvg(data);\n        done();\n      });\n    });\n\n    describe('root', () => {\n      it('should exist', () => {\n        expect(root).toStrictEqual(expect.anything());\n      });\n\n      it('should be an instance of Object', () => {\n        expect(root).toBeInstanceOf(Object);\n      });\n\n      it('should have property \"children\"', () => {\n        expect(root).toHaveProperty('children');\n      });\n    });\n\n    describe('root.children', () => {\n      it('should be an instance of Array', () => {\n        expect(root.children).toBeInstanceOf(Array);\n      });\n\n      it('should have length 4', () => {\n        expect(root.children).toHaveLength(4);\n      });\n    });\n\n    it('the first node should be instruction', () => {\n      expect(root.children[0]).toStrictEqual({\n        type: 'instruction',\n        name: 'xml',\n        value: 'version=\"1.0\" encoding=\"utf-8\"',\n      });\n    });\n\n    it('the second node should be comment', () => {\n      expect(root.children[1]).toStrictEqual({\n        type: 'comment',\n        value:\n          'Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)',\n      });\n    });\n\n    it('the third node should be doctype', () => {\n      expect(root.children[2]).toStrictEqual({\n        type: 'doctype',\n        name: 'svg',\n        data: {\n          doctype:\n            ' svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"',\n        },\n      });\n    });\n\n    describe('name', () => {\n      it('should have property name: \"svg\"', function () {\n        expect(root.children[3]).toStrictEqual(\n          expect.objectContaining({\n            name: 'svg',\n          }),\n        );\n      });\n    });\n\n    describe('children', () => {\n      it('should exist', () => {\n        expect(root.children[3].children).toStrictEqual(expect.anything());\n      });\n\n      it('should be an instance of Array', () => {\n        expect(root.children[3].children).toBeInstanceOf(Array);\n      });\n\n      it('should eventually have length 3', () => {\n        expect(root.children[3].children).toHaveLength(3);\n      });\n    });\n\n    describe('text nodes', () => {\n      it('should contain preserved whitespace', () => {\n        const textNode = root.children[3].children[1].children[0].children[1];\n        expect(textNode.children[0].value).toBe('  test  ');\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "test/svgo/_index.test.js",
    "content": "import fs from 'node:fs/promises';\nimport path from 'path';\nimport { EOL } from 'os';\nimport { fileURLToPath } from 'url';\nimport { VERSION, builtinPlugins, optimize } from '../../lib/svgo.js';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\n/**\n * @param {string} file\n * @returns {string}\n */\nconst normalize = (file) => {\n  return file.trim().replaceAll(EOL, '\\n');\n};\n\n/**\n * @param {string} file\n * @returns {Promise<string[]>}\n */\nconst parseFixture = async (file) => {\n  const filepath = path.resolve(__dirname, file);\n  const content = await fs.readFile(filepath, 'utf-8');\n  return normalize(content).split(/\\s*@@@\\s*/);\n};\n\ndescribe('svgo', () => {\n  it('version should match package.json', async () => {\n    const pkgPath = path.resolve(__dirname, '../../package.json');\n    const { version } = JSON.parse(await fs.readFile(pkgPath, 'utf-8'));\n    expect(VERSION).toStrictEqual(version);\n  });\n\n  it('should have all exported members', async () => {\n    expect(VERSION).toBeDefined();\n    expect(optimize).toBeDefined();\n    expect(builtinPlugins).toBeDefined();\n  });\n\n  it('should create indent with 2 spaces', async () => {\n    const [original, expected] = await parseFixture('test.svg.txt');\n    const result = optimize(original, {\n      plugins: [],\n      js2svg: { pretty: true, indent: 2 },\n    });\n    expect(normalize(result.data)).toStrictEqual(expected);\n  });\n  it('should handle plugins order properly', async () => {\n    const [original, expected] = await parseFixture('plugins-order.svg.txt');\n    const result = optimize(original, { path: 'input.svg' });\n    expect(normalize(result.data)).toStrictEqual(expected);\n  });\n  it('should handle empty svg tag', async () => {\n    const result = optimize('<svg />', { path: 'input.svg' });\n    expect(result.data).toBe('<svg/>');\n  });\n  it('should preserve style specificity over attributes', async () => {\n    const [original, expected] = await parseFixture(\n      'style-specificity.svg.txt',\n    );\n    const result = optimize(original, {\n      path: 'input.svg',\n      js2svg: { pretty: true },\n    });\n    expect(normalize(result.data)).toStrictEqual(expected);\n  });\n  it('should inline entities', async () => {\n    const [original, expected] = await parseFixture('entities.svg.txt');\n    const result = optimize(original, {\n      path: 'input.svg',\n      plugins: [],\n      js2svg: { pretty: true },\n    });\n    expect(normalize(result.data)).toStrictEqual(expected);\n  });\n  it('should preserve whitespaces between tspan tags', async () => {\n    const [original, expected] = await parseFixture('whitespaces.svg.txt');\n    const result = optimize(original, {\n      path: 'input.svg',\n      js2svg: { pretty: true },\n    });\n    expect(normalize(result.data)).toStrictEqual(expected);\n  });\n  it('should preserve \"to\" keyframe selector', async () => {\n    const [original, expected] = await parseFixture(\n      'keyframe-selectors.svg.txt',\n    );\n    const result = optimize(original, {\n      path: 'input.svg',\n      js2svg: { pretty: true },\n    });\n    expect(normalize(result.data)).toStrictEqual(expected);\n  });\n  it('should not trim whitespace at start and end of pre element', async () => {\n    const [original, expected] = await parseFixture('pre-element.svg.txt');\n    const result = optimize(original, {\n      path: 'input.svg',\n    });\n    expect(normalize(result.data)).toStrictEqual(expected);\n  });\n  it('should not add whitespace in pre element', async () => {\n    const [original, expected] = await parseFixture(\n      'pre-element-pretty.svg.txt',\n    );\n    const result = optimize(original, {\n      path: 'input.svg',\n      js2svg: { pretty: true },\n    });\n    expect(normalize(result.data)).toStrictEqual(expected);\n  });\n});\n"
  },
  {
    "path": "test/svgo/billion-laughs.test.js",
    "content": "import { readFile } from 'node:fs/promises';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { optimize } from '../../lib/svgo.js';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\ndescribe('svgo', () => {\n  it('should throw on excessive expansion depth', async () => {\n    const original = await readFile(\n      path.join(__dirname, 'billion-laughs.svg'),\n      'utf-8',\n    );\n\n    expect(() => {\n      optimize(original);\n    }).toThrow('Parsed entity depth exceeds max entity depth');\n  });\n\n  it('should throw on excessive expansion count', async () => {\n    const original = await readFile(\n      path.join(__dirname, 'billion-laughs-flat.svg'),\n      'utf-8',\n    );\n\n    expect(() => {\n      optimize(original);\n    }).toThrow('Parsed entity count exceeds max entity count');\n  });\n});\n"
  },
  {
    "path": "test/svgo/entities.svg.txt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\" [\n<!ENTITY ns_extend \"http://ns.adobe.com/Extensibility/1.0/\">\n<!ENTITY ns_ai \"http://ns.adobe.com/AdobeIllustrator/10.0/\">\n<!ENTITY ns_graphs \"http://ns.adobe.com/Graphs/1.0/\">\n<!ENTITY Viewport \"<rect x='.5' y='.5' width='49' height='29'/>\">\n]>\n<svg xmlns:x=\"&ns_extend;\" xmlns:i=\"&ns_ai;\" xmlns:graph=\"&ns_graphs;\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" x=\"0px\" y=\"0px\" width=\"583.029px\" height=\"45px\" viewBox=\"0 0 583.029 45\" enable-background=\"new 0 0 583.029 45\" xml:space=\"preserve\">\n  <g>\n    &Viewport;\n  </g>\n</svg>\n\n@@@\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)-->\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\" [\n<!ENTITY ns_extend \"http://ns.adobe.com/Extensibility/1.0/\">\n<!ENTITY ns_ai \"http://ns.adobe.com/AdobeIllustrator/10.0/\">\n<!ENTITY ns_graphs \"http://ns.adobe.com/Graphs/1.0/\">\n<!ENTITY Viewport \"<rect x='.5' y='.5' width='49' height='29'/>\">\n]>\n<svg xmlns:x=\"http://ns.adobe.com/Extensibility/1.0/\" xmlns:i=\"http://ns.adobe.com/AdobeIllustrator/10.0/\" xmlns:graph=\"http://ns.adobe.com/Graphs/1.0/\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" x=\"0px\" y=\"0px\" width=\"583.029px\" height=\"45px\" viewBox=\"0 0 583.029 45\" enable-background=\"new 0 0 583.029 45\" xml:space=\"preserve\">\n    <g>\n        <rect x=\".5\" y=\".5\" width=\"49\" height=\"29\"/>\n    </g>\n</svg>\n"
  },
  {
    "path": "test/svgo/keyframe-selectors.svg.txt",
    "content": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 12.7 12.7\" xmlns=\"http://www.w3.org/2000/svg\">\n  <style>@keyframes a{0%,to{clip-path:inset(84%0 0)}4%,96%{clip-path:inset(74%0 0)}16%,52%,84%{clip-path:inset(16%0 0)}20%,48%{clip-path:inset(19%0 0)}24%,44%{clip-path:inset(26%0 0)}28%,64%,72%{clip-path:inset(29%0 0)}32%{clip-path:inset(45%0 0)}36%,40%{clip-path:inset(35%0 0)}60%,76%{clip-path:inset(23%0 0)}68%{clip-path:inset(32%0 0)}}</style>\n  <path d=\"M2.117 2.249h2.38v8.202h-2.38z\" fill=\"#FFF\" style=\"animation:a 1.25s linear infinite\"/>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 0 12.7 12.7\">\n    <style>\n        @keyframes a{0%,to{clip-path:inset(84%0 0)}4%,96%{clip-path:inset(74%0 0)}16%,52%,84%{clip-path:inset(16%0 0)}20%,48%{clip-path:inset(19%0 0)}24%,44%{clip-path:inset(26%0 0)}28%,64%,72%{clip-path:inset(29%0 0)}32%{clip-path:inset(45%0 0)}36%,40%{clip-path:inset(35%0 0)}60%,76%{clip-path:inset(23%0 0)}68%{clip-path:inset(32%0 0)}}\n    </style>\n    <path fill=\"#fff\" d=\"M2.117 2.249h2.38v8.202h-2.38z\" style=\"animation:a 1.25s linear infinite\"/>\n</svg>\n"
  },
  {
    "path": "test/svgo/plugins-order.svg.txt",
    "content": "<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\" viewBox=\"0 0 733 801\">\n  <path d=\"M375.6,443.1\"/>\n  <path d=\"M289,397.4c7.7,24.8,7.8,47.3,7.8,47.3l-2.2,1.6l-6.7,8.1l-2,7.7l1.1,5.4l4.7,4.7l6.4,4.3l9.3,3.5l12.1,1.2\n  l23.8-2.4l15.3-6.4l7.4-5.5h0.2l7.9-7.3l3.4-8.3l-2.1-8.3l-4.6-5.2l-1.9-0.5v-0.1l9.3-44.4c77.3-50.5,85.1-214.5,85.1-214.5\n  s2.1-40.8-0.7-44c-2.8-3.2-28.1-38.7-28.1-38.7l-67.7-18l-82,6L233.7,97l-15.2,59.8l-2.2,15.5C216.3,172.3,208.4,352.8,289,397.4z\"\n  />\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 733 801\"><path d=\"M289 397.4c7.7 24.8 7.8 47.3 7.8 47.3l-2.2 1.6-6.7 8.1-2 7.7 1.1 5.4 4.7 4.7 6.4 4.3 9.3 3.5 12.1 1.2 23.8-2.4 15.3-6.4 7.4-5.5h.2l7.9-7.3 3.4-8.3-2.1-8.3-4.6-5.2-1.9-.5v-.1l9.3-44.4c77.3-50.5 85.1-214.5 85.1-214.5s2.1-40.8-.7-44-28.1-38.7-28.1-38.7l-67.7-18-82 6L233.7 97l-15.2 59.8-2.2 15.5s-7.9 180.5 72.7 225.1\"/></svg>\n"
  },
  {
    "path": "test/svgo/pre-element-pretty.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 854 340\">\n  <foreignObject width=\"100%\" height=\"100%\">\n    <div xmlns=\"http://www.w3.org/1999/xhtml\">\n      <pre style=\"text-align:center\"> OOO   PPPP   EEEEE  N   N  SSSSS   OOO   U   U  RRRR    CCCC  EEEEE\nO   O  P   P  E      NN  N  SS     O   O  U   U  R   R  C      E    \nO   O  PPPP   EEE    N N N   SSS   O   O  U   U  RRRR   C      EEE  \nO   O  P      E      N  NN     SS  O   O  U   U  R R    C      E    \n OOO   P      EEEEE  N   N  SSSSS   OOO    UUU   R  R    CCCC  EEEEE\n\nM   M   AAA   IIIII  N   N  TTTTT   AAA   IIIII  N   N  EEEEE  RRRR \nMM MM  A   A    I    NN  N    T    A   A    I    NN  N  E      R   R\nM M M  AAAAA    I    N N N    T    AAAAA    I    N N N  EEE    RRRR \nM   M  A   A    I    N  NN    T    A   A    I    N  NN  E      R R  \nM   M  A   A  IIIII  N   N    T    A   A  IIIII  N   N  EEEEE  R  R </pre>\n    </div>\n  </foreignObject>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 854 340\">\n    <foreignObject width=\"100%\" height=\"100%\">\n        <div xmlns=\"http://www.w3.org/1999/xhtml\">\n            <pre style=\"text-align:center\"> OOO   PPPP   EEEEE  N   N  SSSSS   OOO   U   U  RRRR    CCCC  EEEEE\nO   O  P   P  E      NN  N  SS     O   O  U   U  R   R  C      E    \nO   O  PPPP   EEE    N N N   SSS   O   O  U   U  RRRR   C      EEE  \nO   O  P      E      N  NN     SS  O   O  U   U  R R    C      E    \n OOO   P      EEEEE  N   N  SSSSS   OOO    UUU   R  R    CCCC  EEEEE\n\nM   M   AAA   IIIII  N   N  TTTTT   AAA   IIIII  N   N  EEEEE  RRRR \nMM MM  A   A    I    NN  N    T    A   A    I    NN  N  E      R   R\nM M M  AAAAA    I    N N N    T    AAAAA    I    N N N  EEE    RRRR \nM   M  A   A    I    N  NN    T    A   A    I    N  NN  E      R R  \nM   M  A   A  IIIII  N   N    T    A   A  IIIII  N   N  EEEEE  R  R </pre>\n        </div>\n    </foreignObject>\n</svg>\n"
  },
  {
    "path": "test/svgo/pre-element.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 854 340\">\n  <foreignObject width=\"100%\" height=\"100%\">\n    <div xmlns=\"http://www.w3.org/1999/xhtml\">\n      <pre style=\"text-align:center\"> OOO   PPPP   EEEEE  N   N  SSSSS   OOO   U   U  RRRR    CCCC  EEEEE\nO   O  P   P  E      NN  N  SS     O   O  U   U  R   R  C      E    \nO   O  PPPP   EEE    N N N   SSS   O   O  U   U  RRRR   C      EEE  \nO   O  P      E      N  NN     SS  O   O  U   U  R R    C      E    \n OOO   P      EEEEE  N   N  SSSSS   OOO    UUU   R  R    CCCC  EEEEE\n\nM   M   AAA   IIIII  N   N  TTTTT   AAA   IIIII  N   N  EEEEE  RRRR \nMM MM  A   A    I    NN  N    T    A   A    I    NN  N  E      R   R\nM M M  AAAAA    I    N N N    T    AAAAA    I    N N N  EEE    RRRR \nM   M  A   A    I    N  NN    T    A   A    I    N  NN  E      R R  \nM   M  A   A  IIIII  N   N    T    A   A  IIIII  N   N  EEEEE  R  R </pre>\n    </div>\n  </foreignObject>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 854 340\"><foreignObject width=\"100%\" height=\"100%\"><div xmlns=\"http://www.w3.org/1999/xhtml\"><pre style=\"text-align:center\"> OOO   PPPP   EEEEE  N   N  SSSSS   OOO   U   U  RRRR    CCCC  EEEEE\nO   O  P   P  E      NN  N  SS     O   O  U   U  R   R  C      E    \nO   O  PPPP   EEE    N N N   SSS   O   O  U   U  RRRR   C      EEE  \nO   O  P      E      N  NN     SS  O   O  U   U  R R    C      E    \n OOO   P      EEEEE  N   N  SSSSS   OOO    UUU   R  R    CCCC  EEEEE\n\nM   M   AAA   IIIII  N   N  TTTTT   AAA   IIIII  N   N  EEEEE  RRRR \nMM MM  A   A    I    NN  N    T    A   A    I    NN  N  E      R   R\nM M M  AAAAA    I    N N N    T    AAAAA    I    N N N  EEE    RRRR \nM   M  A   A    I    N  NN    T    A   A    I    N  NN  E      R R  \nM   M  A   A  IIIII  N   N    T    A   A  IIIII  N   N  EEEEE  R  R </pre></div></foreignObject></svg>\n"
  },
  {
    "path": "test/svgo/style-specificity.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\">\n  <style>\n    .fill-red { fill: red; }\n  </style>\n  <rect x=\"20\" y=\"20\" width=\"10\" height=\"10\" class=\"fill-red\" style=\"fill:green;\" />\n  <rect x=\"70\" y=\"20\" width=\"10\" height=\"10\" class=\"fill-red\" style=\"fill:blue;\" />\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\">\n    <style>\n        .fill-red{fill:red}\n    </style>\n    <path d=\"M20 20h10v10H20z\" class=\"fill-red\" style=\"fill:green\"/>\n    <path d=\"M70 20h10v10H70z\" class=\"fill-red\" style=\"fill:#00f\"/>\n</svg>\n"
  },
  {
    "path": "test/svgo/test.svg.txt",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g attr1=\"val1\">\n        <g attr2=\"val2\">\n            <path attr2=\"val3\" d=\"...\"/>\n        </g>\n        <path d=\"...\"/>\n    </g>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n  <g attr1=\"val1\">\n    <g attr2=\"val2\">\n      <path attr2=\"val3\" d=\"...\"/>\n    </g>\n    <path d=\"...\"/>\n  </g>\n</svg>\n"
  },
  {
    "path": "test/svgo/whitespaces.svg.txt",
    "content": "<svg width=\"480\" height=\"360\" xmlns=\"http://www.w3.org/2000/svg\">\n  <text x=\"20\" y=\"20\">\n    <tspan>Another tspan</tspan>\n    <tspan>Inside tspan</tspan> - outside tspan\n  </text>\n</svg>\n\n@@@\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"480\" height=\"360\">\n    <text x=\"20\" y=\"20\">\n    <tspan>Another tspan</tspan>\n    <tspan>Inside tspan</tspan> - outside tspan\n  </text>\n</svg>\n"
  },
  {
    "path": "test/svgo.cjs",
    "content": "const assert = require('assert');\nconst {\n  VERSION,\n  optimize,\n  builtinPlugins,\n  loadConfig,\n  querySelector,\n  querySelectorAll,\n  _collections,\n} = require('../dist/svgo-node.cjs');\nconst PKG = require('../package.json');\n\nconst fixture = `<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g attr1=\"val1\">\n        <g attr2=\"val2\">\n            <path attr2=\"val3\" d=\"...\"/>\n        </g>\n        <path d=\"...\"/>\n    </g>\n</svg>`;\n\nconst expected = `<svg xmlns=\"http://www.w3.org/2000/svg\">\n  <g attr1=\"val1\">\n    <g attr2=\"val2\">\n      <path attr2=\"val3\" d=\"...\"/>\n    </g>\n    <path d=\"...\"/>\n  </g>\n</svg>\n`;\n\nconst runTest = () => {\n  const result = optimize(fixture, {\n    plugins: [],\n    js2svg: { pretty: true, indent: 2, eol: 'lf' },\n  });\n  const actual = result.data;\n\n  assert.strictEqual(VERSION, PKG.version);\n  assert.equal(actual, expected);\n  assert.notEqual(builtinPlugins, undefined);\n  assert.notEqual(loadConfig, undefined);\n  assert.notEqual(querySelector, undefined);\n  assert.notEqual(querySelectorAll, undefined);\n  assert.notEqual(_collections, undefined);\n};\n\nrunTest();\n"
  },
  {
    "path": "test-d/lib/svgo-node.test-d.ts",
    "content": "import { expectType, expectAssignable } from 'tsd';\nimport {\n  BuiltinPlugin,\n  type Config,\n  type DataUri,\n  type Output,\n  builtinPlugins,\n  loadConfig,\n  optimize,\n} from '../../types/lib/svgo-node.js';\n\nexpectType<Output>(optimize('<svg></svg>'));\nexpectAssignable<DataUri>('enc');\n\nexpectType<Promise<Config | null>>(loadConfig());\nexpectType<Promise<Config | null>>(loadConfig(undefined));\nexpectType<Promise<Config | null>>(loadConfig(null));\nexpectType<Promise<Config>>(loadConfig('svgo.config.js'));\n\nconst presetDefault = builtinPlugins.find(\n  (plugin) => plugin.name === 'preset-default',\n)!;\nif (!presetDefault.isPreset) {\n  throw Error('Could not find preset-default.');\n}\n\nexpectType<ReadonlyArray<BuiltinPlugin<string, Object>>>(presetDefault.plugins);\nexpectType<'preset-default'>(presetDefault.name);\n"
  },
  {
    "path": "tsconfig.build.json",
    "content": "{\n  \"extends\": \"./tsconfig.json\",\n  \"compilerOptions\": {\n    \"noEmit\": false,\n    \"declaration\": true,\n    \"emitDeclarationOnly\": true,\n    \"outDir\": \"types/\"\n  },\n  \"include\": [\"lib/svgo-node.js\", \"lib/svgo.js\"]\n}\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"noEmit\": true,\n    \"module\": \"node16\",\n    \"target\": \"es2021\",\n    \"lib\": [\"es2021\"],\n    \"allowJs\": true,\n    \"checkJs\": true,\n    \"strict\": true,\n    \"resolveJsonModule\": true,\n    \"skipLibCheck\": true\n  },\n  \"exclude\": [\n    \".yarn/\",\n    \"coverage/\",\n    \"dist/\",\n    \"node_modules/\",\n    \"rollup.config.js\",\n    \"test-d/\",\n    \"test/browser.js\",\n    \"test/svgo.cjs\"\n  ]\n}\n"
  }
]