{"version":3,"sources":["jsdelivr-header.js","/npm/vue-chevron@0.1.0/dist/vue-chevron.common.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACDA,aAEA,IAAI,YACA,SAAW,KAEf,SAAS,OAAO,GACd,OAAO,CACT,CAEA,SAAS,QAAQ,EAAU,GACzB,SAAW,EAAU,UAAY,EAAI,YAAY,MAAQ,SACzD,IAAI,EAAY,SAAU,GACxB,IAAI,GAAY,EAAI,UAAY,EAChC,GAAI,GAAY,EAId,OAHA,OAAO,qBAAqB,aAC5B,EAAU,cAAgB,OAC1B,EAAU,SAAW,GAGvB,EAAU,SAAW,EAAU,OAAO,GACtC,YAAc,OAAO,sBAAsB,EAC7C,EACA,YAAc,OAAO,sBAAsB,EAC7C,CAEA,SAAS,kBACP,EACA,EACA,EACA,EACA,GAEA,IAAI,EACoB,IAAtB,EAA0B,EAAW,GAAY,EAAI,GASvD,OAPI,GAAqB,IACvB,EAAoB,GAMf,EAHI,EAAiB,EAAS,EAAI,EAAoB,EAC/C,EAAiB,EAAS,EAAI,EAAoB,CAGlE,CAEA,IAAI,MAAQ,CACV,KAAM,aACN,MAAO,CACL,UAAW,CACT,KAAM,QACN,SAAS,GAEX,SAAU,CACR,KAAM,OACN,QAAS,KAEX,UAAW,CACT,KAAM,OACN,QAAS,GAEX,MAAO,CACL,KAAM,OACN,QAAS,IAEX,WAAY,CACV,KAAM,QACN,SAAS,GAEX,OAAQ,CACN,KAAM,SACN,QAAS,SAGb,KAAM,WACJ,MAAO,CACL,SAAU,EACV,cAAe,EACf,SAAS,EACT,WAAY,GAEhB,EACA,SAAU,CACR,KAAM,WACJ,IAAI,EAAW,KAAK,SAChB,EAAM,KAAK,oBACX,EAAQ,EAAI,MACZ,EAAS,EAAI,OACb,EAAQ,KAAK,cACb,EAAI,EAAM,EACV,EAAI,EAAM,EACV,EAAgB,KAAK,cAErB,EAAS,kBACX,KAAK,UACL,EACA,EACA,EACA,GASF,MAAQ,KAAO,EAAI,GAAS,IAAM,EAAS,KAAO,EAAI,IAPxC,mBACX,KAAK,UACN,EACA,EACA,EACA,GAEoE,KAAO,EAAI,GAAS,IAAM,CAClG,EACA,oBAAqB,WACnB,IAAI,EAAS,KAAK,WAAa,KAAK,IAAI,KAAK,OAAS,KAAK,GAAK,MAEhE,MAAO,CACL,MAFU,KAAK,WAAa,KAAK,IAAI,KAAK,OAAS,KAAK,GAAK,MAG7D,OAAQ,EAEZ,EACA,cAAe,WACb,IAAI,EAAM,KAAK,YAGf,MAAO,CAAE,EAFG,EAAI,MAEI,EAAG,EADV,EAAI,OACkB,EACrC,EACA,YAAa,WACX,IAAI,EAAa,KAAK,WAClB,EAAY,KAAK,UAMrB,MAAO,CAAE,MAJG,KAAK,KAAkB,EAAb,EAA6B,EAAZ,GAIhB,OAHV,KAAK,KACH,EAAb,EAAiB,KAAK,IAAI,KAAK,OAAS,KAAK,GAAK,MAAoB,EAAZ,GAG9D,GAEF,MAAO,CACL,UAAW,WACT,KAAK,cAAgB,KAAK,SAC1B,KAAK,SAAW,EAChB,OAAO,qBAAqB,aAC5B,QAAQ,KAAK,SAAU,KACzB,GAEF,OAAQ,SAAgB,GACtB,IAAI,EAAiB,KAAK,WAAa,QAAU,SAC7C,EAAM,KAAK,YAIf,OAAO,EACL,MACA,CACE,MAAO,CACL,OAAQ,GACR,MAAO,GACP,MAAO,6BACP,QAAU,OAVJ,EAAI,MAUiB,IATpB,EAAI,SAYf,CACE,EAAE,QAAS,eACX,EAAE,OAAQ,CACR,MAAO,CACL,EAAG,KAAK,KACR,KAAM,OACN,iBAAkB,EAClB,eAAgB,KAAK,UACrB,kBAAmB,EACnB,OAAQ,mBAKlB,GAGF,OAAO,QAAU","file":"/npm/vue-chevron@0.1.0/dist/vue-chevron.common.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/vue-chevron@0.1.0/dist/vue-chevron.common.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*!\n * vue-chevron v0.1.0\n * (c) 2017-present Ispal <irpa.oss@gmail.com>\n * Released under the MIT License.\n */\n'use strict';\n\nvar animationId;\nvar lastTime = null;\n\nfunction linear(t) {\n  return t;\n}\n\nfunction animate(duration, component) {\n  lastTime = component.progress <= 1 ? performance.now() : lastTime;\n  var animation = function (t) {\n    var progress = (t - lastTime) / duration;\n    if (progress >= 1) {\n      window.cancelAnimationFrame(animationId);\n      component.clickProgress = 1;\n      component.progress = 1;\n      return;\n    }\n    component.progress = component.easing(progress);\n    animationId = window.requestAnimationFrame(animation);\n  };\n  animationId = window.requestAnimationFrame(animation);\n}\n\nfunction calculatePosition(\n  pointDown,\n  progress,\n  lastClickProgress,\n  height,\n  viewBoxCenterY\n) {\n  var progressWithClick =\n    lastClickProgress === 1 ? progress : progress + (1 - lastClickProgress);\n\n  if (progressWithClick >= 1) {\n    progressWithClick = 1;\n  }\n\n  var topY = viewBoxCenterY + height / 2 - progressWithClick * height;\n  var bottomY = viewBoxCenterY - height / 2 + progressWithClick * height;\n\n  return pointDown ? topY : bottomY;\n}\n\nvar index = {\n  name: \"VueChevron\",\n  props: {\n    pointDown: {\n      type: Boolean,\n      default: true\n    },\n    duration: {\n      type: Number,\n      default: 500\n    },\n    thickness: {\n      type: Number,\n      default: 4\n    },\n    angle: {\n      type: Number,\n      default: 40\n    },\n    roundEdges: {\n      type: Boolean,\n      default: true\n    },\n    easing: {\n      type: Function,\n      default: linear\n    }\n  },\n  data: function data() {\n    return {\n      progress: 1,\n      clickProgress: 1,\n      reverse: false,\n      lineLength: 30\n    };\n  },\n  computed: {\n    path: function path() {\n      var progress = this.progress;\n      var ref = this.triangleSideLengths;\n      var width = ref.width;\n      var height = ref.height;\n      var ref$1 = this.viewBoxCenter;\n      var x = ref$1.x;\n      var y = ref$1.y;\n      var clickProgress = this.clickProgress;\n\n      var sidesY = calculatePosition(\n        this.pointDown,\n        progress,\n        clickProgress,\n        height,\n        y\n      );\n      var centerY = calculatePosition(\n        !this.pointDown,\n        progress,\n        clickProgress,\n        height,\n        y\n      );\n      return (\"M\" + (x - width) + \",\" + sidesY + \", \" + x + \",\" + centerY + \" \" + (x + width) + \",\" + sidesY);\n    },\n    triangleSideLengths: function triangleSideLengths() {\n      var height = this.lineLength * Math.sin(this.angle * (Math.PI / 180));\n      var width = this.lineLength * Math.cos(this.angle * (Math.PI / 180));\n      return {\n        width: width,\n        height: height\n      };\n    },\n    viewBoxCenter: function viewBoxCenter() {\n      var ref = this.viewBoxSize;\n      var width = ref.width;\n      var height = ref.height;\n      return { x: width / 2, y: height / 2 };\n    },\n    viewBoxSize: function viewBoxSize() {\n      var lineLength = this.lineLength;\n      var thickness = this.thickness;\n\n      var width = Math.ceil(lineLength * 2 + thickness * 2);\n      var height = Math.ceil(\n        lineLength * 2 * Math.sin(this.angle * (Math.PI / 180)) + thickness * 2\n      );\n      return { width: width, height: height };\n    }\n  },\n  watch: {\n    pointDown: function() {\n      this.clickProgress = this.progress;\n      this.progress = 0;\n      window.cancelAnimationFrame(animationId);\n      animate(this.duration, this);\n    }\n  },\n  render: function render(h) {\n    var lineCapAndJoin = this.roundEdges ? \"round\" : \"square\";\n    var ref = this.viewBoxSize;\n    var width = ref.width;\n    var height = ref.height;\n\n    return h(\n      \"svg\",\n      {\n        attrs: {\n          height: 32,\n          width: 32,\n          xmlns: \"http://www.w3.org/2000/svg\",\n          viewBox: (\"0 0 \" + width + \" \" + height)\n        }\n      },\n      [\n        h(\"title\", \"vue-chevron\"),\n        h(\"path\", {\n          attrs: {\n            d: this.path,\n            fill: \"none\",\n            \"stroke-linecap\": lineCapAndJoin,\n            \"stroke-width\": this.thickness,\n            \"stroke-linejoin\": lineCapAndJoin,\n            stroke: \"currentColor\"\n          }\n        })\n      ]\n    );\n  }\n};\n\nmodule.exports = index;\n"]}