{
  "version": 3,
  "sources": ["../../src/bindings/TLArrowBinding.ts"],
  "sourcesContent": ["import { T } from '@tldraw/validate'\nimport { VecModel, vecModelValidator } from '../misc/geometry-types'\nimport {\n\tcreateBindingPropsMigrationIds,\n\tcreateBindingPropsMigrationSequence,\n} from '../records/TLBinding'\nimport { RecordProps } from '../recordsWithProps'\nimport { arrowShapeVersions } from '../shapes/TLArrowShape'\nimport { TLBaseBinding } from './TLBaseBinding'\n\n/** @public */\nexport const ElbowArrowSnap = T.literalEnum('center', 'edge-point', 'edge', 'none')\n/** @public */\nexport type ElbowArrowSnap = T.TypeOf<typeof ElbowArrowSnap>\n\n/** @public */\nexport interface TLArrowBindingProps {\n\tterminal: 'start' | 'end'\n\tnormalizedAnchor: VecModel\n\t/**\n\t * exact is whether the arrow head 'enters' the bound shape to point directly at the binding\n\t * anchor point\n\t */\n\tisExact: boolean\n\t/**\n\t * precise is whether to bind to the normalizedAnchor, or to the middle of the shape\n\t */\n\tisPrecise: boolean\n\tsnap: ElbowArrowSnap\n}\n\n/** @public */\nexport const arrowBindingProps: RecordProps<TLArrowBinding> = {\n\tterminal: T.literalEnum('start', 'end'),\n\tnormalizedAnchor: vecModelValidator,\n\tisExact: T.boolean,\n\tisPrecise: T.boolean,\n\tsnap: ElbowArrowSnap,\n}\n\n/** @public */\nexport type TLArrowBinding = TLBaseBinding<'arrow', TLArrowBindingProps>\n\n/** @public */\nexport const arrowBindingVersions = createBindingPropsMigrationIds('arrow', {\n\tAddSnap: 1,\n})\n\n/** @public */\nexport const arrowBindingMigrations = createBindingPropsMigrationSequence({\n\tsequence: [\n\t\t{ dependsOn: [arrowShapeVersions.ExtractBindings] },\n\t\t{\n\t\t\tid: arrowBindingVersions.AddSnap,\n\t\t\tup: (props) => {\n\t\t\t\tprops.snap = 'none'\n\t\t\t},\n\t\t\tdown: (props) => {\n\t\t\t\tdelete props.snap\n\t\t\t},\n\t\t},\n\t],\n})\n"],
  "mappings": "AAAA,SAAS,SAAS;AAClB,SAAmB,yBAAyB;AAC5C;AAAA,EACC;AAAA,EACA;AAAA,OACM;AAEP,SAAS,0BAA0B;AAI5B,MAAM,iBAAiB,EAAE,YAAY,UAAU,cAAc,QAAQ,MAAM;AAqB3E,MAAM,oBAAiD;AAAA,EAC7D,UAAU,EAAE,YAAY,SAAS,KAAK;AAAA,EACtC,kBAAkB;AAAA,EAClB,SAAS,EAAE;AAAA,EACX,WAAW,EAAE;AAAA,EACb,MAAM;AACP;AAMO,MAAM,uBAAuB,+BAA+B,SAAS;AAAA,EAC3E,SAAS;AACV,CAAC;AAGM,MAAM,yBAAyB,oCAAoC;AAAA,EACzE,UAAU;AAAA,IACT,EAAE,WAAW,CAAC,mBAAmB,eAAe,EAAE;AAAA,IAClD;AAAA,MACC,IAAI,qBAAqB;AAAA,MACzB,IAAI,CAAC,UAAU;AACd,cAAM,OAAO;AAAA,MACd;AAAA,MACA,MAAM,CAAC,UAAU;AAChB,eAAO,MAAM;AAAA,MACd;AAAA,IACD;AAAA,EACD;AACD,CAAC;",
  "names": []
}
