<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {{canvas.width}} {{canvas.height}}" xml:lang="fa" direction="rtl">
  {{#if measure}}
    <script>
      <![CDATA[{{> measure}}]]>
    </script>
  {{/if}}
  <style type="text/css">
    <![CDATA[{{> fonts}}]]>
  </style>
  <rect id="svg-container" x="0" y="0" width="{{canvas.width}}" height="{{canvas.height}}" fill="white"/>
  {{#if (boolean variant "===" "with-sidebar")}}
    {{> sidebar canvas=canvas info=dataset.info qrcode=qrcode titleAppend=titleAppend}}
  {{/if}}
  {{#if (isArray spec.profile.dimensions)}}
    {{setVar "profDim" (lookup spec.profile.dimensions (math page '-' 1))}}
  {{else}}
    {{setVar "profDim" spec.profile.dimensions}}
  {{/if}}
  <svg x="{{canvas.profile.padding}}" y="{{math (ternary (boolean variant '===' 'with-sidebar') canvas.header.height 0) '+' canvas.profile.padding}}"
    width="{{math canvas.profile.width '-' (math 2 '*' canvas.profile.padding)}}"
    height="{{math canvas.profile.height '-' (math 2 '*' canvas.profile.padding)}}"
    viewBox="0 0 {{profDim.width}} {{profDim.height}}"
    font-family="DanaFaNum" overflow="visible">
    {{> @partial-block}}
  </svg>
</svg>