{deck}
version:1
card:3
size:[512,342]
script:"0"
name:"The Entire Enchilada"

{script:0}
on foo do
 print["you called *me*, man."]
end
{end}

{sounds}
sosumi:"%%SND0DAwMDAwMDA0PERUTCQYEAgQJDxYaIBEBBQgLDxIWGBoZAgAABQsSGB0eHxcAAAAABQ4WHB4fEgAABAwWHyUfGhkEAAAHFxgNFBkgJBEAAQAAAA4cJi4oEQAAAAcSGCEoKhEAAAACFic1PjIPAAAAAAYWJCQRFhkOBQoPEQkABBgeFgoDDA8CDBAYIychDwAAAAAIJDtBQSUAAAAABx8uKiILAAAADxkZISENBgcAAAADFyQdGh8VDgYBBgkAAAAGIDM3KxcAAAAAECo8Oh0AAAAAEigwLioSAAAAAAADGy0tIBcHAAAFFiAWAgAAAQkSIiodBAAHDhcZEgAAAAAIKT9BORgAAAAAABAeLjkyFgAAAAADGiorHAYAAAAHGiksGwUAAAQLFBcKAAAAEygvJxMAAAAADxweFg4CAAAADhsnMTMhAgAAAAAHLEBBOhcAAAAABxsgFAYFCxMcHxcHAAAAChccFAkEAQAGEhwfHRcNAAAAAAAPJDIxHwIAAAAIJjs6IQAAAAADITY6KxYGAAAAAAAABxAbJislFggAAAAAAAYQHCUnHw8AAAADGSkqGQAAAAAOLT8+KAUAAAAAESInIhYJAgABBAgPFxsZEwsAAAACDhQWFRMWGx4YCgAAAAAJKz9BMhAAAAAADyInHgwAAAALGiIiHRMGAAAAAAIWKTEsHAgAAAAFEBQQCQYKFB0gGAcAAAALIzEvGgAAAAAEHzM4LxwHAAAAAAESISkmGgoAAAAOGx8XBgAAAAccKywgDgAAAgkNCgEAAAUZLDQtGQEAAAAADyApKSESAgAAAAQYKTAnEgAAAAAMJTMvHQgAAAAMFBMKAQAEEBwiHhMHAAAGDhIRCwUBAwgQGR8iIBkLAAAAAAAcNkE6IAAAAAADHCooGAYAAAQRGRsVDQgICg0MCAMCBg0VGxwYEgwHAwAAAAYRHCMhFQQAAAASJCsjDQAAAAASKjUxIQwAAAAAAgoQFhodGxYNBQEBBgsODw0MDRASEQ0IBQgPFxsYDQAAAAASIysmFwUAAAAIFBsaFA0HBAUIDBEVGBcSCwMAAAILFRsbFxEMCgoKCAQBAQcRHCIfFQgAAAAJFBoZEgkDAgYNFBgYFA8JBAEBBAsTGRsYEAgCAgYNEhQSDQgHCQ4REQ4LCQsPExUSCwMAAAYQGR4cFg0FAAACBw0TFhcUDwoGBQkOExQRCwUCBAsSGBkVDgkGBwoMDQwKCg0QFBUSDggFBQgMERMTEQ4KCAcICw8UFxYSCgMAAAYPFxsZEwsFBAcLDxAODAoKDRAREQ8NCwoLDA0MCwoLDA4QEREQDw0KCAUFBwwSFxkVDwcBAQYNFBcVEAkFBQgNERMSEA0LCwoKCgsLDQ4QEBAPDQwMCwsKCgsMDxERDwwKCQsPEhMQCwYDBAkQFxkXEQoFAwUIDRASEhEPDQwLCgsMDg8ODQwLCwwODg4NDAwNDxAQDQkGBgkOExUUEAsHBggMEBIRDgsJCAoMDxESEhANCQcGBwoPEhQTEA0KCQoLDAwMCwwOEBISDwwIBwkMEBIRDwsJCAoNEBISEA4LCQgJCg0PERIQDQoICQsOERIQDAkICQsPEREQDgwMDQ0NCwoJCQwPEhMSDwwJBwgJDA4QEREPDQsJCgsOEBEPDAkHCAsPEhMRDgsJCQsNDg4NDAwNDg4ODQwLDAwNDg4NDAsLCwwNDg8QERAOCgcGBwoPExQTDwsIBwkMDxAPDQwLDA0ODw8ODQwMDAwMDAwNDg4PDg4NDAwMCwsLDA0ODxAODQsJCgsNDxAPDQsKCgsNDg4ODQwMDAwMDAwMDAwMDAwM"
amen:"%%[encoded data, 18512 characters]"

{card:buttons}
{widgets}
AA:{"type":"button","size":[50,30],"pos":[10,20],"text":"Label"}
AB:{"type":"button","size":[50,30],"pos":[80,20],"text":"Label","style":"rect"}
AC:{"type":"button","size":[50,30],"pos":[140,20],"text":"Label","style":"check"}
AD:{"type":"button","size":[50,30],"pos":[200,20],"text":"Label","style":"invisible"}
BA:{"type":"button","size":[50,30],"pos":[10,60],"show":"transparent","text":"Label"}
BB:{"type":"button","size":[50,30],"pos":[80,60],"show":"transparent","text":"Label","style":"rect"}
BC:{"type":"button","size":[50,30],"pos":[140,60],"show":"transparent","text":"Label","style":"check"}
BD:{"type":"button","size":[50,30],"pos":[200,60],"show":"transparent","text":"Label","style":"invisible"}
CA:{"type":"button","size":[50,30],"pos":[10,100],"show":"invert","text":"Label"}
CB:{"type":"button","size":[50,30],"pos":[80,100],"show":"invert","text":"Label","style":"rect"}
CC:{"type":"button","size":[50,30],"pos":[140,100],"show":"invert","text":"Label","style":"check"}
CD:{"type":"button","size":[50,30],"pos":[200,100],"show":"invert","text":"Label","style":"invisible"}

{card:canvases}
{widgets}
one:{"type":"canvas","size":[50,50],"pos":[80,20],"border":1,"image":"%%IMG0ADIAMv///////8CAAAAAAABAgAAAAAAAQIAAAAAAAECAAAAAAABAgAAAAAAAQIAAAAAAAECAAAAAAABAgH/gAAAAQIBtoAAAAECAbaAAAABAgHfgAAAAQIA+YAAAAECAa8AAAABAgHvgAAAAQIBeYAAAAECAbcAAAABAgAAAAAAAQIAAAAAAAECB/////+BAgf//gEAgQIH/toFAIECB/+2QQCBAgf/fhkAgQIH/24hAIECB/3uBQCBAgf/upEAgQIH/u4DAIECB/////+BAgAAAAAAAQIAAAAAAAECAAAAAAABAgASSB/4AQIABAAf+AECACEgH/gBAgAICB/4AQIAAkAf+AECACAQH/gBAgAJAB/4AQIAAEgf+AECACSAAAABAgAAIAAAAQIAEggAAAECAAAAAAABAgAAAAAAAQIAAAAAAAECAAAAAAABAgAAAAAAAQIAAAAAAAED////////A"}
two:{"type":"canvas","size":[50,50],"pos":[140,20],"show":"transparent","border":0,"image":"%%IMG0ADIAMv///////8CAAAAAAABAgAAAAAAAQIAAAAAAAECAAAAAAABAgAAAAAAAQIAAAAAAAECAAAAAAABAgH/gAAAAQIBtoAAAAECAbaAAAABAgHfgAAAAQIA+YAAAAECAa8AAAABAgHvgAAAAQIBeYAAAAECAbcAAAABAgAAAAAAAQIAAAAAAAECB/////+BAgf//gEAgQIH/toFAIECB/+2QQCBAgf/fhkAgQIH/24hAIECB/3uBQCBAgf/upEAgQIH/u4DAIECB/////+BAgAAAAAAAQIAAAAAAAECAAAAAAABAgASSB/4AQIABAAf+AECACEgH/gBAgAICB/4AQIAAkAf+AECACAQH/gBAgAJAB/4AQIAAEgf+AECACSAAAABAgAAIAAAAQIAEggAAAECAAAAAAABAgAAAAAAAQIAAAAAAAECAAAAAAABAgAAAAAAAQIAAAAAAAED////////A"}
three:{"type":"canvas","size":[50,50],"pos":[200,20],"show":"invert","border":1,"image":"%%IMG0ADIAMv///////8CAAAAAAABAgAAAAAAAQIAAAAAAAECAAAAAAABAgAAAAAAAQIAAAAAAAECAAAAAAABAgH/gAAAAQIBtoAAAAECAbaAAAABAgHfgAAAAQIA+YAAAAECAa8AAAABAgHvgAAAAQIBeYAAAAECAbcAAAABAgAAAAAAAQIAAAAAAAECB/////+BAgf//gEAgQIH/toFAIECB/+2QQCBAgf/fhkAgQIH/24hAIECB/3uBQCBAgf/upEAgQIH/u4DAIECB/////+BAgAAAAAAAQIAAAAAAAECAAAAAAABAgASSB/4AQIABAAf+AECACEgH/gBAgAICB/4AQIAAkAf+AECACAQH/gBAgAJAB/4AQIAAEgf+AECACSAAAABAgAAIAAAAQIAEggAAAECAAAAAAABAgAAAAAAAQIAAAAAAAECAAAAAAABAgAAAAAAAQIAAAAAAAED////////A"}
four:{"type":"canvas","size":[150,120],"pos":[80,80],"border":1,"brush":16,"pattern":35}
pointy:{"type":"canvas","size":[100,100],"pos":[353,185],"script":"canvases.0","image":"%%IMG2AGQAZAD/AP8A/wD/AP8A/wD/AP8A3gEBAGMBAQBiAQEAYwEBAGIBAQBjAQEAYgEBAGMBAQBjAQEAYgEBAGMBAQBiAQEAYwEBAGIBAQBjAQEAYwEBAGIBAQBjAQEAYgEBAGMBAQBiAQEAYwEBAGMBAQBiAQEAYwEBAGIBAQBjAQEAYgEBAGMBAQD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AGg=","scale":1}

{script:canvases.0}
on drag pos do
 c:me.size/2
 p:30*unit heading pos-c
 me.clear[]
 me.line[c c+p]
end
{end}

{card:grids}
{widgets}
one:{"type":"grid","size":[120,90],"pos":[20,30],"scrollbar":1,"headers":0,"format":"scf","value":{"fruit":["apple","cherry","banana"],"price":[1,0.35,0.75],"amount":[1,15,2]}}
two:{"type":"grid","size":[160,70],"pos":[150,30],"scrollbar":1,"headers":1,"format":"scf","value":{"fruit":["apple","cherry","banana","durian","elderberry","fungus","galena","hoho","ice","jar","k"],"price":[1,0.35,0.75,2.99,0.92,0.23,6.25,1.99,0.25,1.5,1337],"amount":[1,15,2,5,1,395,1,3,1,5,420]}}
three:{"type":"grid","size":[120,70],"pos":[20,150],"locked":1,"scrollbar":1,"headers":1,"format":"scf","value":{}}
four:{"type":"grid","size":[100,70],"pos":[37,246],"show":"invert","scrollbar":0,"headers":1,"format":"scf","value":{"fruit":[],"price":[],"amount":[]}}
icons:{"type":"grid","size":[130,138],"pos":[165,135],"scrollbar":0,"headers":1,"lines":0,"widths":[25,42],"format":"Iss","value":{"icon":[0,1,2,3,4,5,6,7,8],"number":[0,1,2,3,4,5,6,7,8],"name":["Directory","Document","Sound","Font","Application","Lil","Pattern","Check","(No Icon)"]}}
checklist:{"type":"grid","size":[119,91],"pos":[324,133],"headers":0,"lines":1,"widths":[20],"format":"BL","value":{"chosen":[0,1,1,0,1],"name":["First","Second","Third","Fourth","Fifth"]},"row":3}

{card:bycell}
{widgets}
one:{"type":"grid","size":[120,90],"pos":[20,30],"scrollbar":1,"headers":0,"bycell":1,"format":"scf","value":{"fruit":["apple","cherry","banana"],"price":[1,0.35,0.75],"amount":[1,15,2]},"row":2,"col":2}
two:{"type":"grid","size":[160,70],"pos":[189,43],"scrollbar":1,"headers":1,"bycell":1,"format":"scf","value":{"fruit":["apple","banana","cherry","durian","elderberry","fungus","galena","hoho","ice","jar","k"],"price":[1,0.75,0.35,2.99,0.92,0.23,6.25,1.99,0.25,1.5,1337],"amount":[1,2,15,5,1,395,1,3,1,5,420]},"row":1,"col":2}
icons:{"type":"grid","size":[130,138],"pos":[155,186],"scrollbar":0,"headers":1,"lines":0,"bycell":1,"widths":[25,42],"format":"Iss","value":{"icon":[0,1,2,3,4,5,6,7,8],"number":[0,1,2,3,4,5,6,7,8],"name":["Directory","Document","Sound","Font","Application","Lil","Pattern","Check","(No Icon)"]},"row":8,"col":2}
checklist:{"type":"grid","size":[119,91],"pos":[299,233],"headers":0,"lines":1,"bycell":1,"widths":[20],"format":"BL","value":{"chosen":[0,1,1,0,1],"name":["First","Second","Third","Fourth","Fifth"]},"row":0,"col":1}
field1:{"type":"field","size":[100,20],"pos":[368,49],"animated":1,"script":"bycell.0","value":"[2,1,\"amount\"]"}

{script:bycell.0}
on view do
 me.text:"%j" format list two.cell,two.colname
end
{end}

{card:fields}
{widgets}
one:{"type":"field","size":[110,100],"pos":[20,20],"border":1,"scrollbar":1,"value":{"text":["","Glorious\n","Rich text flows freely\n\n","on foo x do\n  baz[x]\nend","\n\nHuzzah, ","this thing"," is complete!\n\n","i","\n\nLet's conclude with a longer passage of text so that scrolling is easy to test."],"font":["","menu","","mono","","","","",""],"arg":["","","","","","boop","","%%IMG2AFEASAD/AP8AlAEDAE0BPgATAT8AEgE/ABMBPgATAT4AEwEFAA4BBQAMAQUAEAEFABMBBQAOAQUADAEFABABBQATAQUADgEFAAwBBQAQAQUAEwEFAA4BBQAMAQUAEAEFABMBBQAOAQUADAEFABABBQATAQUADgEFAAwBBQAQAQUAEwEFAA4BBQAMAQUAEAEFABMBBQAOAQUADAEFABABBQATAQUADgEPAAIBBQAQAQUAEwEFAA4BFgAQAQUAEwEFAA4BFgAQAQUAEwEFAA4BFgAQAQUAEwEFAA0BFwAQAQUAEwEFAA0BBwAHAQkAEAEFABMBBQANAQYADAEFAA8BBgATAQUADQEFAA0BBQAPAQYAEwEFAA0BBQANAQUADwEFABQBBQANAQUADQEFAA8BBQAUAQUADQEFAA0BBQAPAQUAFAEFAA0BBQANAQUADwEFABQBBQANAQUADQEFAA8BBQAUAQUADQEFAA0BBQAPAQYAEwEFAA0BBQANAQUADwEGABMBBQANAQUADQEFABABBQATAQUADQEXABABBQATAQUADQEXABABBQATAQUADQEYAA8BBQATAQUADQEYAA8BBQATAQUADQEYAA8BBQATAQUADgEHAAgBCAAPAQUAEwEFACABBQAPAQUAEwEFACABBQAPAQUAEwEFACABBQAPAQUAEwEFACABBQAPAQUAEwEFACABBgAOAQUAEgEGACABBgAOAQUAEgEGACEBBQAOAQUAEgEFACIBBQAOAQUAEgEFACIBBQAOAQUAEgEFACIBBQAOAQUAEgEFACIBBQAOAQUAEgEFACIBBQAOAQUAEgEFACIBBQAOAQUAEgEFACIBBQAOAQUAEgESABUBBQANAQYAEgEhAAMBGwASAT8AEgE/ABMBPgAiAS4AMgEHAAIBBQD/AP8AVA==",""]}}
two:{"type":"field","size":[110,100],"pos":[150,20],"locked":1,"border":1,"scrollbar":1,"align":"center","value":{"text":["Glorious\n","Rich text flows freely\n\n","on foo x do\n  baz[x]\nend","\n\nHuzzah, ","this thing"," is complete!\nLet's conclude with a longer passage of text so that scrolling is easy to test."],"font":["menu","","mono","","",""],"arg":["","","","","boop",""]}}
three:{"type":"field","size":[110,100],"pos":[20,130],"border":1,"scrollbar":1,"value":"nuffing much."}
four:{"type":"field","size":[160,60],"pos":[150,130],"script":"fields.0","border":1,"scrollbar":1,"style":"code","value":"on click\n  # a line comment\n  show 3+2\n  foo.text:\"one\"\nend"}
but:{"type":"button","size":[70,30],"pos":[200,200],"text":"Click Me!"}

{script:fields.0}
on run x do
  alert["tried to run <%s>" format x]
end
{end}

{card:sliders}
{widgets}
one:{"type":"slider","size":[150,25],"pos":[20,30],"value":50,"step":0.5,"format":"%0.1f%%","style":"bar"}
two:{"type":"slider","size":[150,25],"pos":[20,70],"interval":[-37.5,12],"value":12,"style":"compact"}
three:{"type":"slider","size":[150,25],"pos":[20,110],"script":"sliders.0","interval":[0,4]}
four:{"type":"slider","size":[30,150],"pos":[200,30],"script":"sliders.1","interval":[-50,75],"style":"vert"}
five:{"type":"field","size":[100,20],"pos":[250,30]}
six:{"type":"field","size":[100,20],"pos":[250,70]}
slider1:{"type":"slider","size":[150,25],"pos":[20,180],"interval":[3,12],"value":3,"style":"compact"}

{script:sliders.0}
on change val do five.text:val end
{end}

{script:sliders.1}
on change val do six.text:val end
{end}

{card:modals}
{widgets}
one:{"type":"button","size":[60,20],"pos":[20,30],"script":"modals.0","text":"Alert"}
two:{"type":"button","size":[60,20],"pos":[20,55],"script":"modals.1","text":"Confirm"}
three:{"type":"button","size":[60,20],"pos":[20,80],"script":"modals.2","text":"Input"}
four:{"type":"button","size":[60,20],"pos":[20,130],"script":"modals.3","text":"Read"}
five:{"type":"button","size":[60,20],"pos":[20,155],"script":"modals.4","text":"Write"}
button1:{"type":"button","size":[60,20],"pos":[20,105],"script":"modals.5","text":"Choose"}
rich:{"type":"field","size":[200,100],"pos":[292,217],"show":"invert","align":"center","value":{"text":["","Rich Text Alert Example","\nAlerts can contain rich text, ","too","?\nthis is so amazing I'm ","losing my mind!"],"font":["","menu","","","","mono"],"arg":["","","","anything","",""]}}
button2:{"type":"button","size":[86,23],"pos":[285,138],"script":"modals.6","text":"Read Image"}
preview:{"type":"canvas","size":[100,100],"pos":[280,31],"scale":1}
button3:{"type":"button","size":[86,23],"pos":[285,168],"script":"modals.7","text":"Write Image"}
button4:{"type":"button","size":[100,38],"pos":[385,138],"script":"modals.8","text":"Read Image\n(Dithered)"}

{script:modals.0}
on click do
  alert["A modal alert!"]
  alert["These can be sequenced!"]
  alert[rich.value]
end
{end}

{script:modals.1}
on click do
  x:alert["Frobnicate?" "bool" "DoIt"]
  alert["Value was: %j" format x]
end
{end}

{script:modals.2}
on click do
  x:alert["What?" "string"]
  alert["Value was: %j" format x]
end
{end}

{script:modals.3}
on click do
  x:read[]
  alert["Value was: %j" format x]
end
{end}

{script:modals.4}
on click do
  x:write["file wrote out ok, I guess."]
  alert["Value was: %j" format x]
end
{end}

{script:modals.5}
on click do
  x:alert["choose of nothing" "choose"]
  y:alert["choose of list" "choose" "one","two","three" "two"]
  z:alert["choose of dict" "choose" (("one","two","three") dict 11,22,33)]
  alert["Values were:\n%j\n%j\n%j" format x,y,z]
end
{end}

{script:modals.6}
on click do
  x:read["image"]
  preview.paste[x (0,0),preview.size]
end
{end}

{script:modals.7}
on click do
  write[preview.copy[]]
end
{end}

{script:modals.8}
on click do
  x:read["image" "gray"]
  preview.paste[x (0,0),preview.size]
  preview.paste[preview.copy[].transform["dither"]]
end
{end}

{card:Transitions A}
image:"%%IMG2AgABVgT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8EowEMBP8E6gEXBP8E5wEaBP8E4wEeBP8E1gErBP8E1QEiAgUBBQT/BNUBFwIQAQYE/wTUARQCEwEGBP8E1AEQAhgBBgT/BNMBBQIjAQYE/wTTAQUCJAEFBP8E0wEFAiQBBgT/BNIBBQIkAQYE/wTRAQYCJQEGBP8E0AEGAiUBBgT/B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YCFAEFBDABBQIBARQE/wSYAQUCFQEFBDABFQT/BJ0BBQIVAQUEMAEOBP8EpAEFAhUBBQQwAQwE/wSlAQYCFQEFBDABCwT/BKYBBgIVAQUEMQEHBP8EqQEFAhYBBQT/BOABBgIWAQUE/wTdARACDwEFBP8E3AElBP8E2wEmBP8E2wEmBP8E2wEmBP8E3AEDBAEBBgQFARUE/wTiAQQE/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8E/wT/BP8ELgAB"
{widgets}
button1:{"type":"button","size":[68,20],"pos":[427,131],"script":"Transitions A.0","text":"SlideRight"}
button2:{"type":"button","size":[68,20],"pos":[427,156],"script":"Transitions A.0","text":"WipeRight"}
button3:{"type":"button","size":[68,20],"pos":[14,132],"script":"Transitions A.0","text":"SlideLeft"}
button4:{"type":"button","size":[68,20],"pos":[14,157],"script":"Transitions A.0","text":"WipeLeft"}
button5:{"type":"button","size":[68,20],"pos":[213,28],"script":"Transitions A.0","text":"SlideUp"}
button6:{"type":"button","size":[68,20],"pos":[213,53],"script":"Transitions A.0","text":"WipeUp"}
button7:{"type":"button","size":[68,20],"pos":[205,288],"script":"Transitions A.0","text":"SlideDown"}
button8:{"type":"button","size":[68,20],"pos":[205,313],"script":"Transitions A.0","text":"WipeDown"}
button9:{"type":"button","size":[68,20],"pos":[317,229],"script":"Transitions A.0","text":"BoxIn"}
button10:{"type":"button","size":[68,20],"pos":[317,254],"script":"Transitions A.0","text":"BoxOut"}
button11:{"type":"button","size":[68,20],"pos":[424,26],"script":"Transitions A.0","text":"StarIn"}
button12:{"type":"button","size":[68,20],"pos":[424,51],"script":"Transitions A.0","text":"StarOut"}
button13:{"type":"button","size":[68,20],"pos":[26,27],"script":"Transitions A.0","text":"HeartIn"}
button14:{"type":"button","size":[68,20],"pos":[26,52],"script":"Transitions A.0","text":"HeartOut"}
button15:{"type":"button","size":[68,20],"pos":[395,229],"script":"Transitions A.0","text":"Dissolve"}
button16:{"type":"button","size":[93,21],"pos":[394,255],"script":"Transitions A.0","text":"CircleInClick"}
button17:{"type":"button","size":[93,21],"pos":[395,283],"script":"Transitions A.0","text":"CircleOutClick"}
button18:{"type":"button","size":[89,20],"pos":[104,33],"script":"Transitions A.1","text":"HeartIn Slow"}
button19:{"type":"button","size":[89,20],"pos":[105,56],"script":"Transitions A.2","text":"HeartIn Fast"}

{script:Transitions A.0}
on click do
  go["Transitions B" me.text]
end
{end}

{script:Transitions A.1}
on click do
  go["Transitions B" "HeartIn" 120]
end
{end}

{script:Transitions A.2}
on click do
  go["Transitions B" "HeartIn" 15]
end
{end}

{card:Transitions B}
image:"%%IMG2AgABVgX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F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QX/Bd0BIQX/BeUBDQX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wX/Bf8F/wWeAAE="
{widgets}
button1:{"type":"button","size":[68,20],"pos":[427,131],"script":"Transitions B.0","text":"SlideRight"}
button2:{"type":"button","size":[68,20],"pos":[427,156],"script":"Transitions B.0","text":"WipeRight"}
button3:{"type":"button","size":[68,20],"pos":[14,132],"script":"Transitions B.0","text":"SlideLeft"}
button4:{"type":"button","size":[68,20],"pos":[14,157],"script":"Transitions B.0","text":"WipeLeft"}
button5:{"type":"button","size":[68,20],"pos":[213,28],"script":"Transitions B.0","text":"SlideUp"}
button6:{"type":"button","size":[68,20],"pos":[213,53],"script":"Transitions B.0","text":"WipeUp"}
button7:{"type":"button","size":[68,20],"pos":[205,288],"script":"Transitions B.0","text":"SlideDown"}
button8:{"type":"button","size":[68,20],"pos":[205,313],"script":"Transitions B.0","text":"WipeDown"}
button9:{"type":"button","size":[68,20],"pos":[317,229],"script":"Transitions B.0","text":"BoxIn"}
button10:{"type":"button","size":[68,20],"pos":[317,254],"script":"Transitions B.0","text":"BoxOut"}
button11:{"type":"button","size":[68,20],"pos":[424,26],"script":"Transitions B.0","text":"StarIn"}
button12:{"type":"button","size":[68,20],"pos":[424,51],"script":"Transitions B.0","text":"StarOut"}
button13:{"type":"button","size":[68,20],"pos":[26,27],"script":"Transitions B.0","text":"HeartIn"}
button14:{"type":"button","size":[68,20],"pos":[26,52],"script":"Transitions B.0","text":"HeartOut"}
button15:{"type":"button","size":[68,20],"pos":[395,229],"script":"Transitions B.0","text":"Dissolve"}
button16:{"type":"button","size":[93,21],"pos":[394,255],"script":"Transitions B.0","text":"CircleInClick"}
button17:{"type":"button","size":[93,21],"pos":[395,283],"script":"Transitions B.0","text":"CircleOutClick"}
button18:{"type":"button","size":[89,20],"pos":[104,33],"script":"Transitions B.1","text":"HeartIn Slow"}
button19:{"type":"button","size":[89,20],"pos":[105,56],"script":"Transitions B.2","text":"HeartIn Fast"}

{script:Transitions B.0}
on click do
  go["Transitions A" me.text]
end
{end}

{script:Transitions B.1}
on click do
  go["Transitions A" "HeartIn" 120]
end
{end}

{script:Transitions B.2}
on click do
  go["Transitions A" "HeartIn" 15]
end
{end}

{card:Draggables}
image:"%%IMG2AgABVgD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/A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EA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wCgAWEA/wChAV8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AFc="
script:"Draggables.0"
{widgets}
container:{"type":"canvas","size":[181,140],"pos":[22,35],"locked":1,"scale":1}
canvas2:{"type":"canvas","size":[54,44],"pos":[111,84],"script":"Draggables.1","image":"%%IMG2ADYALAD/AJMBAQA0AQEAAQEBADMBAQABAQEAMgEBAAMBAQAxAQEAAwEBADABAQAFAQEALwEBAAUBAQAvAQEABgEBAC0BAQAHAQEALQEBAAgBAQAsAQEACQEBACoBAQAKAQEAKgEBAAsBAQAoAQEADQEBACcBAQAOAQEABgEDABwBAQAMAQoAHwEBAAYBBgAEAQEAIwEIAAsBAQAiAQEAEwEBACABAQAVAQEAHwEBABUBAQAeAQEAFwEBAB0BAQAXAQEAHAEBABkBAQAaAQEAGgEBABkBAQAbAQEANgEBADUBAQD/APQ=","draggable":1,"scale":1}
target:{"type":"canvas","size":[101,99],"pos":[142,210],"locked":1,"image":"%%IMG2AGUAYwD/AP8A/wD/AP8A/wD/AP8AxwEBADEBAQAyAQEAMAEBADQBAQAuAQEANgECACsBAQA5AQEAKgEBADoBAQAoAQEAPAECACUBAQA/AQEAJAEBAEABAQAiAQEAQgECAB8BAQBFAQEAHgEBAEYBAQAcAQEASAECABkBAQBLAQEAGAEBAEwBAgAVAQEATwEBABMBAQBRAQIAEAEBAFQBAgAOAQEAVgEBAAwBAQBYAQEACgEBAFoBAQAJAQEAWwEBAAcBAQBdAQEABQEBAF8BAQADAQEAYQEBAAEBAQBjAQEAYwEBAAEBAQBiAQEAAgEBAGABAQAEAQEAXgEBAAYBAQBcAQEACAEBAFoBAQAKAQEAWAEBAAwBAQBWAQEADgEBAFQBAQAQAQEAUgEBABIBAQBQAQEAFAEBAE4BAQAWAQEATAEBABgBAQBKAQEAGQEBAEoBAQAaAQEASAEBABwBAQBGAQEAHgEBAEQBAQAgAQEAQwEBACABAQBCAQEAIgEBAEABAQAkAQEAPgEBACYBAQA8AQEAJwEBADwBAQAoAQIAOQEBAGMBAQBkAQEAYwEBAGMBAQBkAQEA/wD/AP8A/wD/AP8A/wD/AJ0=","scale":1}
canvas1:{"type":"canvas","size":[68,68],"pos":[265,67],"script":"Draggables.2","image":"%%IMG2AEQARAD/AP8A/wCOARMALgEDABIBAQAqAQQAFQEBACoBAQAYAQEAKgEBABgBAQAqAQEAGAEBACoBAQAYAQEAKgEBABgBAQAqAQEAGAEBACoBAQAWAQIAKwEBABQBAgAtAQEAEwEBAC8BAQARAQIAMAEBAA8BAwAyAQEACgELAC4BAQAVAQMAKwEBABgBAgApAQEAGgEBACgBAQAaAQEAKQEBABoBAQAoAQEAGgEBACgBAQAaAQEAKAEBABsBAQAoAQEAGgEBACgBAQAaAQEAKAEBABkBAQApAQEAGQEBACoBAQAXAQEAKwEBABYBAQAsAQEAFQEBAC0BAQAUAQEALgEBAA8BBQAwAQEACAEGADEBDQA7AQEA/wD/AP8A/wD/AIM=","draggable":1,"scale":1}
canvas3:{"type":"canvas","size":[46,41],"pos":[402,161],"script":"Draggables.3","image":"%%IMG2AC4AKQD/AOIBBgAnAQEABgEBACQBAgAIAQEAIgEBACwBAQAtAQEAKwECACsBAQAtAQEALQEBACwBAQAtAQEALQEBAC0BAQAtAQEALgEBAC4BAQAPAQEAHQEBAA8BAQAeAQEADgEBAB8BAQANAQEAIAEBAAwBAQAhAQIACQECACMBAgAFAQIAJwEFAP8AVg==","draggable":1,"scale":1}
held:{"type":"button","size":[72,23],"pos":[408,31],"locked":1,"text":"B held","style":"check","value":0}

{script:Draggables.0}
on overlaps a b do
 min(a.pos<b.pos+b.size),b.pos<a.pos+a.size
end

on inside a b do
 min(a.pos>b.pos),(a.pos+a.size)<b.pos+b.size
end
{end}

{script:Draggables.1}
on drag do
 c:container
 me.pos:(c.pos+c.size-me.size)&c.pos|me.pos
end
{end}

{script:Draggables.2}
on click do
 held.value:1
end

on drag do
 target.show:if overlaps[me target] "invert" else "solid" end
end

on release do
 held.value:0
 if overlaps[me target]
  alert["you dropped me on the target!"]
 end
end
{end}

{script:Draggables.3}
on drag do
 target.show:if inside[me target] "invert" else "solid" end
end

on release pos do
 if inside[me target]
  alert["you dropped me inside the target!"]
 else
  me.pos:pos # snap back to original position
 end
end
{end}

{card:Shortcuts}
script:"Shortcuts.0"
{widgets}
button1:{"type":"button","size":[50,42],"pos":[40,111],"text":"a","shortcut":"a"}
button2:{"type":"button","size":[50,42],"pos":[101,112],"text":"s","shortcut":"s"}
button3:{"type":"button","size":[50,42],"pos":[101,59],"text":"w","shortcut":"w"}
button4:{"type":"button","size":[50,42],"pos":[163,111],"text":"d","shortcut":"d"}
log:{"type":"field","size":[114,126],"pos":[260,59],"scrollbar":1}
button5:{"type":"button","size":[60,20],"pos":[393,117],"script":"Shortcuts.1","text":"clear"}
field1:{"type":"field","size":[100,20],"pos":[263,196]}

{script:Shortcuts.0}
on click do
 log.text:"%s\n%s" format log.text,me.text
 log.scroll:1000000
end
{end}

{script:Shortcuts.1}
on click do
 log.text:""
end
{end}

{card:card2}
{widgets}
field1:{"type":"field","size":[100,20],"pos":[75,19],"border":0,"align":"center","value":"reference:"}
ref:{"type":"canvas","size":[160,127],"pos":[47,45],"locked":1,"image":"%%IMG2AKAAfwD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AtAEuAGsBNgBmATsAYAEQDS4BAwBaAQ4NNQEDAFUBDw06AQMATwEPDT8BBABIARANRQEEAEYBDA1LAQMARgEHDVABAwBFAQMNVQEDAEUBAw1WAQMARAEDDVYBAwBEAQMNVwEDAEMBAw0ZAQgNNgEDAEMBAw0WAQwNNgEDAEIBAw0UARANHgEKDQ0BAwBBAQMNEwEGDQgBBA0aAQ4NDAEDAEEBAw0RAQYNCwEEDRgBEA0MAQMAQAEDDRABBQ0OAQQNGAEEDQkBAw0LAQMAQAEDDQ8BBA0RAQMNJQEEDQoBAwBAAQMNDgEDDRQBAQ0nAQMNCwEDAD8BAw0OAQMNPQEDDQoBAwA/AQMNDQEDDT4BAw0KAQMAPwEDDQ0BAw0+AQMNCgEDAD8BAw0NAQMNDAEGDR4BBg0IAQMNCgEDAD8BAw0NAQMNCwEJDRsBCA0IAQMNCQEDAD8BAw0NAQMNCgELDRkBCg0HAQMNCQEDAD8BAw0NAQMNCQEHAAIBBA0YAQQAAwEDDQcBAw0JAQMAPwEDDQ0BAw0JAQYABAEDDRgBBAADAQQNBwEDDQgBAwA/AQMNDQEDDQgBAwUBAQMABAEDDRcBBQAEAQQNBgEDDQgBAwA/AQMNDQEDDQgBAwUBAQMABQEDDRYBBQAFAQMNBgEDDQgBAwA/AQMNDQEDDQcBBAUCAQMABAEDDRYBBQAFAQMNBgEEDQcBAwA/AQMNDQEDDQcBAwUDAQMABQEDDRUBBwADAQMNBwEDDQcBAwA/AQMNDQEDDQcBAwUEAQQAAwEDDRUBD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EDDQcBBw0DAQMAPwEDDQ4BAw0HAQMFCQEEDRUBAwUHAQMNBwEGDQQBAwA/AQMNDgEDDQcBAwUJAQMNFwEDBQYBAw0GAQUNBgEDAD8BAw0OAQMNCAEDBQgBAw0XAQMFBQEDDQcBAw0IAQMAPwEDDQ4BAw0IAQQFBwEDDRgBCg0IAQENCQEDAD8BAw0OAQMNCQEEBQUBAw0ZAQkNEwEDAD8BAw0JAQgNCgELDRoBBw0UAQMAPwEDDQgBCQ0MAQgNNgEDAEABAw0IAQcNDgEGDTYBAwBBAQMNWQEDAEIBAw1YAQMAQgEDDVgBAwBCAQMNWAEDAEMBAw1WAQMARAEDDVYBAwBEAQMNVgEDAEQBAw1WAQMARAEDDVYBAwBFAQMNVQEDAEUBAw1VAQMARQEDDVUBAwBGAQMNVAEDAEcBAw1TAQMARwEDDVMBAwBHAQMNUwEDAEcBAw1TAQMARwEDDR8BAQ0ZAQENGQEDAEgBAw0dAQMNFwEDDRgBAwBIAQMNHQEEDRQBBA0ZAQMASAEDDR4BBA0RAQUNFwEGAEkBAw0fAQQNDQEGDRYBBwBKAQMNIAEFDQoBBQ0VAQkASwEDDSEBBg0GAQUNFAEIAE8BAw0iAQ8NEwEIAFIBAw0jAQsNEQEJAFUBAw0mAQYNEAEJAFgBAw02AQ0AWwEDDS8BDwBfAT4AYwE3AGoBMAD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wBU","scale":1}
button1:{"type":"button","size":[60,20],"pos":[445,165],"script":"card2.0","text":"+"}
button2:{"type":"button","size":[60,21],"pos":[311,165],"script":"card2.1","text":"-"}
button3:{"type":"button","size":[60,20],"pos":[379,165],"script":"card2.2","text":"reset"}
button4:{"type":"button","size":[60,20],"pos":[445,191],"script":"card2.3","text":"spin +"}
button5:{"type":"button","size":[60,20],"pos":[311,192],"script":"card2.4","text":"spin -"}
steps:{"type":"field","size":[60,20],"pos":[379,192],"value":"65"}
src1:{"type":"canvas","size":[160,127],"pos":[8,195],"locked":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MNVQEDFRsBBSQDAQUVHAEDDVQBAxUbAQUkAwEFFR0BAw1TAQMVGwEFJAMBBRUdAQMNUwEDFRsBBSQDAQUVHQEDDVMBAxUbAQUkAwEFFR0BAw1TAQMVGwEFJAMBBRUdAQMNHwEBDRkBAQ0ZAQMVGwEFJAMBBRUeAQMNHQEDDRcBAw0YAQMVGwEFJAMBBRUeAQMNHQEEDRQBBA0ZAQMVGwEFJAMBBRUeAQMNHgEEDREBBQ0XAQYVGwEFJAMBBRUfAQMNHwEEDQ0BBg0WAQcVHAEFJAMBBRUfAQMNIAEFDQoBBQ0VAQkVHQEFJAMBBRUfAQMNIQEGDQYBBQ0UAQgVIQEFJAMBBRUfAQMNIgEPDRMBCBUjAQUkAwEFFSABAw0jAQsNEQEJFSYBBSQDAQUVIAEDDSYBBg0QAQkVKQEFJAMBBRUgAQMNNgENFSsBBSQDAQUVIQEDDS8BDxUvAQUkAwEFFSEBPhUyAQUkAwEFFSIBNxU4AQUkAwEFFSMBMBU+AQUkAwEFFZEBBSQDAQUVkQEFJAMBBRWRAQUkAwEFFZEBBSQDAQUVkQEFJAMBBRWRAQUkAwEFFZEBBSQDAQUVkQEFJAMBBRWRAQUkAwEFFZEBBSQDAQUVkQEFJAMBBRWRAQUkAwEFFZEBBSQDAQUVkQEFJAMBBRWRAQUkAwEFFZEBBSQDAQUVkQEFJAMBmyQDAZskAwGbJAMBmyQEAZkk/yQ/","pattern":36,"scale":1}
button6:{"type":"button","size":[38,20],"pos":[253,301],"script":"card2.5","text":"B"}
button7:{"type":"button","size":[38,20],"pos":[12,299],"script":"card2.6","text":"A"}

{script:card2.0}
on click do
 c.paste[c.copy[].rotate[pi/16]]
end
{end}

{script:card2.1}
on click do
 c.paste[c.copy[].rotate[-pi/16]]
end
{end}

{script:card2.2}
on click do
 c.paste[ref.copy[]]
end
{end}

{script:card2.3}
on rot m do
 c.paste[ref.copy[].rotate[m*pi/16]]
end

on click do
 each v in range 0+steps.text
  rot[v]
  sleep[3]
 end
end
{end}

{script:card2.4}
on rot m do
 c.paste[ref.copy[].rotate[-m*pi/16]]
end

on click do
 each v in range 0+steps.text
  rot[v]
  sleep[3]
 end
end
{end}

{script:card2.5}
on click do
 ref.paste[src2.copy[]]
end
{end}

{script:card2.6}
on click do
 ref.paste[src1.copy[]]
end
{end}

{card:segmentation}
image:"%%IMG2AgABVgD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8ArgEDAP8A6QE3AP8AyAE8AP8AxAFAAP8AwQFBAP8AvwFCAP8AvgEHDRkBBA0WAQoA/wC9AQYNNgEIAP8AvAEGDToBBQD/ALwBBg06AQYA/wC6AQYNOwEGAP8AugEGDTsBBgD/ALoBBQ09AQUAIAEFAP8AlQEFDT0BBQAfAQEnASEDIwEBAQD/AJMBBg09AQUAHwEBJwElASQBIwIBAQD/AJMBBg0MAAINHQAGDQwBBQAfAQEnASQBJQEjAgEBAP8AkwEGDQwAJQ0MAQUAHwEBKAMjAgEBAP8AkwEFDQ0AJQ0MAQUAHwEBKAQjAQEBAP8AkwEFDQ0AJQ0MAQUAIAEGAP8AkwEGDQ0AJA0MAQUA/wC5AQYNDQAkDQwBBQD/ALoBBg0MACQNDAEFAP8AugEHDQsAJA0MAQUA/wC7AQYNCwAkDQwBBQD/ALwBBg0KACQNDAEFAP8AvAEGDQoAJA0MAQUA/wC9AQUNCgAkDQwBBQD/AL0BBQ0KACQNDAEFAP8AvQEFDQoAJA0MAQUA/wC9AQUNCgAkDQwBBQD/AL0BBQ0KACQNDAEFAP8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ACQNDAEFAAQBBg0MACQNDAEFAAQBBw0LACQNDAEFAAUBBg0LACQNDAEFAAYBBg0KACQNDAEFAAYBBg0KACQNDAEFAAcBBQ0KACQNDAEFAAcBBQ0KACQNDAEFAAcBBQ0KACQNDAEFAAcBBQ0KACQNDAEFAAcBBQ0KACQNDAEFAAYBBg0KACQNDAEFAAYBBg0JACUNDAEFAAYBBQ0KACUNDAEFAAUBBg0KACUNDAEGAAQBBg0KACUNDAEGAAQBBQ0LACUNDQEFAAQBBQ0LACUNDQEFAAQBBQ0LACUNDQEFAAMBBg0LACUNDQEGAAIBBg0LACYNDAEGAAIBBQ0MACYNDQEFAAIBBQ0LACgNDAEFAAIBBQ0MACcNDAEFAAIBBQ0MACcNDAEFAAIBBQ0MACgNCwEFAAIBBg0LACgNCwEFAAIBBg0LACgNCwEFAAMBBQ0LAAcNDAAVDQsBBQADAQYNDAABDR0ACA0LAQUAAwEGDT0BBgADAQUNPQEGAAMBBQ0+AQUAAwEFDT4BBQADAQUNPgEFAAMBBQ0+AQUAAwEFDT0BBgADAQYNFgEKDRwBBgADAQcNEgEYDQcBDwAEAQkNDgEwAAUBCg0HATUABgFFAAcBGwAGASIACQEXABQBCwAXARMAOwELADQ=","scale":1}
canvas1:{"type":"canvas","size":[233,215],"pos":[200,57],"script":"segmentation.0","image":"%%IMG2AOkA1wD/AP8A/wD/AP8A/wD/AP8A/wBKAQMAIQEDACEBAwAhAQMAZQGkAEMBqQA/Aa0APAGuADoBrwA5AQcNGQEEDSABBA0gAQQNIAEEDRcBCgA4AQYNowEIADcBBg2nAQUANwEGDacBBgA1AQYNqAEGADUBBg2oAQYANQEFDaoBBQA1AQUNqgEFADQBBg2qAQUANAEGDQwAAg0dAAcNHQAHDR0ABw0dAAcNDAEFADQBBg0MAJINDAEFADQBBQ0NAJINDAEFADQBBQ0NAJINDAEFADQBBg0NAJENDAEFADQBBg0NAJENDAEFADUBBg0MAJENDAEFADUBBw0LAJENDAEFADYBBg0LAJENDAEFADcBB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DAEFADgBBQ0KAJENDAEFADcBBg0KAJENDAEFADcBBg0JAJINDAEFADcBBQ0KAJINDAEFADYBBg0KAJINDAEGADUBBQ0LAAcNDAAYDQwAGA0MABgNDAAWDQsBBQA0AQYNDAABDR0ABQ0BAAENHQAFDQEAAQ0dAAUNAQABDR0ABQ0BAAMNCwEFADQBBg2qAQYANAEFDaoBBgA0AQUNqwEFADQBBQ2rAQUANAEFDasBBQA0AQUNqwEFADQBBQ2qAQYANAEGDRYBCg0aAQoNGgEKDRoBCg0dAQYANAEHDRIBGA0MARgNDAEYDQwBGA0IAQ8ANQEJDQ4BHQ0HAR0NBwEdDQcBHQ0BARMANgEKDQcBIg0CASINAgEiDQIBIg0BARMANwGyADgBGwAGAR4ABgEeAAYBHgAGASMAOgEXABQBEAAUARAAFAEQABQBDABIARMAGwEJABsBCQAbAQkAGwEBAFEBCwAgAQQAIAEEACABBAAgAQEA/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AKM=","scale":1}
m:{"type":"field","size":[100,20],"pos":[45,242],"value":"19,16,20,18"}

{script:segmentation.0}

on drag pos do
 m:"%f,%f,%f,%f" parse m.text
 me.clear[]
 me.segment[bord.copy[] 10,10,pos-10 m]
end

{end}

{card:card4}
script:"card4.0"
{widgets}
dispatcher1:{"type":"contraption","size":[100,100],"pos":[289,37],"script":"card4.1","def":"dispatcher","widgets":{"button1":{}}}
field1:{"type":"field","size":[164,58],"pos":[86,61],"locked":1,"border":0,"value":"clicking the button to the right SHOULD do nothing; it'll fire an alert if events are incorrectly bubbling out of contraptions into their containing cards!"}

{script:card4.0}
on click do
 alert["card got a click event from %s!" format me.name]
end
{end}

{script:card4.1}
on click do
 alert["outer contraption got a click event from %s!" format me.name]
end
{end}

{card:card3}
image:"%%[encoded data, 5144 characters]"

{card:Draggables 2}
{widgets}
result:{"type":"canvas","size":[218,144],"pos":[121,95],"locked":1,"scale":1}
handle1:{"type":"canvas","size":[38,35],"pos":[301,204],"image":"%%IMG2ACYAIwD/AEMBAQAkAQMAIwEBAAEBAQAjAQEAAgEBACIBAQACAQEAIgEBAAMBAQAgAQEABAEBACABAQAFAQEAHgEBAAYBAQAeAQEABQEGABoBBgABAQEAHQEBAAgBAQAcAQEACAEBABsBAQAKAQEAGgEBAAoBAQAZAQEADAEBABgBAQAMAQEAFwEBAA4BAQAWAQEAJAEBAP8AJg==","draggable":1,"scale":1}
handle2:{"type":"canvas","size":[44,39],"pos":[121,95],"image":"%%IMG2ACwAJwD/AEABDQAfAQEAAQEBAAoBAgAfAQEADAEDABwBAQAPAQEAHAEBAA4BAQAcAQEADgEBABwBAQANAQIAHAEBAAoBAwAeAQEACAECACEBAQAFAQMAIwEBAAYBCAAdAQEADgEBABwBAQAPAQEAGwEBAA8BAQAbAQEADwEBABsBAQAOAQIAGwEBAA4BAQAcAQEADQEBAB0BAQALAQIAHgEBAAoBAQAgAQEACQEBACEBAQAIAQEAIgEBAAEBBwAjAQEA/wB+","draggable":1,"scale":1}
button1:{"type":"button","size":[78,19],"pos":[407,39],"script":"Draggables 2.0","text":"union"}
button2:{"type":"button","size":[76,21],"pos":[409,81],"script":"Draggables 2.1","text":"intersect"}

{script:Draggables 2.0}
on make a b do
 ("pos","size") dict (list a),(list b)
end
on union a b do
 p:a.pos&b.pos
 make[p ((a.pos+a.size)|(b.pos+b.size))-p]
end

on click do
 r:union[handle1 handle2]
 result.pos :r.pos
 result.size:r.size
end
{end}

{script:Draggables 2.1}
on make a b do
 ("pos","size") dict (list a),(list b)
end
on intersect a b do
 p:a.pos|b.pos
 make[p ((a.pos+a.size)&(b.pos+b.size))-p]
end

on click do
 r:intersect[handle1 handle2]
 result.pos :r.pos
 result.size:r.size
end
{end}

{card:Sound Loops}
{widgets}
button1:{"type":"button","size":[106,28],"pos":[184,104],"script":"Sound Loops.0","text":"Play The Loop"}
button2:{"type":"button","size":[106,28],"pos":[183,145],"script":"Sound Loops.1","text":"Stop The Loop"}
button3:{"type":"button","size":[106,28],"pos":[310,123],"script":"Sound Loops.2","text":"Sosumi"}
button4:{"type":"button","size":[106,28],"pos":[63,124],"script":"Sound Loops.3","text":"Reset The Loop"}
button5:{"type":"button","size":[113,47],"pos":[332,255],"script":"Sound Loops.4","text":"Play and\nBusywait"}

{script:Sound Loops.0}
on click do
 play["amen" "loop"]
end
{end}

{script:Sound Loops.1}
on click do
 play[0 "loop"]
end
{end}

{script:Sound Loops.2}
on click do
  play["sosumi"]
end
{end}

{script:Sound Loops.3}
on click do
 play[0 "loop"]
 play["amen" "loop"]
end
{end}

{script:Sound Loops.4}
on click do
 play["amen"]
 while app.playing end
 alert["finished"]
end
{end}

{card:contraptions}
image:"%%IMG2AgABVgD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AIwElAP8A2wEnAP8A2gEnAP8A2gEnAP8A2AEoAP8A2AEIAP8A+QEIAP8A+QEHAAsBBgD/AOkBBgAHAQ4A/wDlAQYABwERAP8A4wEGAAYBFAD/AOEBBQAGARYA/wDfAQYABQELAAIBCwD/AN0BBwAFAQYACgEJAP8A3AEGAAYBBQANAQgA/wDbAQUABwEFAA8BBgD/ANsBBQAHAQUAEAEFAP8A2wEFAAcBBQAQAQYA/wDaAQUABwEGAA8BBgD/ANoBBQAHAQYADwEGAP8A2gEFAAgBBgANAQYA/wDbA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8N8gD/AA8N8gD/AA8N8gD/AA8N8gD/AA8N8gD/AA8N8gD/AA8N8gD/AA8N8gD/AA8N8gD/ABAN8AD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AAw="
{widgets}
a:{"type":"contraption","size":[150,50],"pos":[40,50],"script":"contraptions.0","def":"spinner","widgets":{"down":{},"up":{},"value":{},"step":{}}}
b:{"type":"contraption","size":[150,50],"pos":[40,150],"def":"spinner","widgets":{"down":{},"up":{},"value":{"value":"45"},"step":{}}}
contraption1:{"type":"contraption","size":[200,140],"pos":[276,89],"def":"enchilada","widgets":{"bool":{},"number":{},"string":{},"code":{},"rich":{}}}
contraption2:{"type":"contraption","size":[150,90],"pos":[54,222],"def":"paintbox","widgets":{}}
smol1:{"type":"contraption","size":[20,20],"pos":[222,268],"def":"smol","widgets":{}}
viewCounter1:{"type":"contraption","size":[102,26],"pos":[326,29],"def":"viewCounter","widgets":{"c":{"value":"11"}}}

{script:contraptions.0}
on change do
 alert["changed spinner!"]
end
{end}

{card:More Contraptions}
{widgets}
dieRoller1:{"type":"contraption","size":[137,23],"pos":[45,66],"def":"dieRoller","widgets":{"result":{"value":"1+1 = 2"},"button1":{}}}
dieRoller2:{"type":"contraption","size":[229,23],"pos":[45,94],"def":"dieRoller","widgets":{"result":{"size":[143,19],"value":"2+10+7+6+10+5+2+4 = 46"},"button1":{"text":"5d10+3d6"}}}
dieRoller3:{"type":"contraption","size":[137,23],"pos":[45,38],"def":"dieRoller","widgets":{"result":{"value":"1"},"button1":{"text":"1d6"}}}
clock1:{"type":"contraption","size":[100,25],"pos":[375,39],"font":"menu","def":"clock","widgets":{"canvas1":{"size":[100,25],"font":"menu","image":"%%IMG0AGQAGQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAePA8eB48AAAAAAAAAM0YZswzZgAAAAAAAADMG2bNs2YAAAAAAAAAzBtmzbNmAAAAAAAAAMwwZswzZgAAAAAAAADMYGZ8Mz4AAAAAAAAAzMBmDDMGAAAAAAAAAM2DZhmzDAAAAAAAAAB5+zxxnjgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="},"tz":{"size":[35,0],"pos":[6,19]},"mil":{"size":[31,0],"pos":[54,18]}}}
datePicker1:{"type":"contraption","size":[109,123],"pos":[371,92],"def":"datePicker","widgets":{"canv":{"image":"%%IMG0AGcAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIIAAAAAAAAAAAAAAADGAAAAAAAAAAAAAAAAqmSAAAAAAAAAAAAAAJIUgAAAAAAAAAAAAACCdIAAAAAAAAAAAAAAgpSAAAAAAAAAAAAAAIJzgAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAggHwBBAH0B4AHAAiAMYAQAQQARAQACIAIJCqYESCowEcELAgYByQkpBEgqSBEhzAHBACkIKQRIFHgRIQgAJwIpCCkESBRAESEIAikBxwgmBDgUMBEhCAHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////+AAAgAIACAAgAIACAAgAAIACAAgAIACAAgAIAACAggcIPiAQg+IDCAAAgYIIiAQgMIICBAgAAICCAIgIIFCDwggIAACAggEIHCCQgCIPCAAAgIICCAIg+IAiCIgAAICCBAgiIBCCIgiIAACAgg+IHCAQgcIHCAAAgAIACAAgAIACAAgAAIACAAgAIACAAgAIAACAAgAIACAAgAIACD////////////////ggAIAD//gAIACAAgAIIACAA//4ACAAgAIACCD4gcP4+IciCIhyI+ggCIIj93mIphiYimBIIBCCI/d4iKIIiAogiCAQgcP4eIiiCIgSIcggIIIj/3iIogiIIiAoICCCI/74iKIIiEIiKCAggcP5+IciCIj6IcggAIAD//gAIACAAgAIIACAA//4ACAAgAIACCAAgAP/+AAgAIACAAg////////////////4IACAAgAIACAAgAIACCAAgAIACAAgAIACAAgiBIj6IMiPohyIcnHIJgyYgmEJgKYimIqKKCIUiPIiCIEiIoiKCigiJIgKI8iBIhyIehIoIj6ICiIogiIiiAoiKCIEiIoiKIIiIogSQigiBIhyIciCIhyIYvnIIACAAgAIACAAgAIACCAAgAIACAAgAIACAAggAIACAAgAIACAAgAIP///////////////+CAAgAIACAAgAIACAAggAIACAAgAIACAAgAIJwiccnPpwSc+nDJz6CiYooqISiMooKJCiCggiIIKCIglILyCgghIIQiEEhHISSEChPIQSCIIiCIgKI+iAoiKIIgkCJBCQikBJCKQikCIL4i++vnL4S+cvnL4iCAAgAIACAAgAIACAAggAIACAAgAIACAAgAIIACAAgAIACAAgAIACD////////////////ggAIACAAgAIAAAAAAAIACAAgAIACAAAAAAACccnHL5y+IgAAAAAAAooqKKEihGIAAAAAAAIKKCiiIogiAAAAAAACEchHpyKcIgAAAAAAAiIogKCigiIAAAAAAAJCKQEooqIiAAAAAAAC+cvmJxycIgAAAAAAAgAIACAAgAIAAAAAAAIACAAgAIACAAAAAAACAAgAIACAAgAAAAAAA/////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="},"val":{"value":"2023-05-09"},"next":{},"prev":{}}}
fancyBorder1:{"type":"contraption","size":[31,45],"pos":[76,142],"def":"fancyBorder","widgets":{}}
fancyBorder2:{"type":"contraption","size":[87,47],"pos":[114,142],"def":"fancyBorder","widgets":{}}
fancyBorder3:{"type":"contraption","size":[124,29],"pos":[76,195],"def":"fancyBorder","widgets":{}}
draggability1:{"type":"contraption","size":[100,100],"pos":[248,203],"def":"draggability","widgets":{"canvas1":{}}}

{card:card1}
{widgets}
patternPicker1:{"type":"contraption","size":[100,100],"pos":[297,130],"script":"card1.0","def":"patternPicker","widgets":{"c":{"image":"%%[encoded data, 4196 characters]"},"v":{"value":1},"cc":{}}}
c:{"type":"canvas","size":[100,100],"pos":[92,69],"scale":1}

{script:card1.0}
on change val do
 c.clear[]
 c.pattern:val
 c.fill[1,1]
end
{end}

{card:gifimport}
{widgets}
frames:{"type":"field","size":[198,255],"pos":[275,52],"scrollbar":1}
button1:{"type":"button","size":[119,44],"pos":[65,166],"script":"gifimport.0","text":"Import a GIF..."}
button2:{"type":"button","size":[119,44],"pos":[65,222],"script":"gifimport.1","text":"Import a GIF...\n(grayscale)"}
button3:{"type":"button","size":[119,44],"pos":[66,275],"script":"gifimport.2","text":"Import a GIF...\n(grayscale 2)"}

{script:gifimport.0}
on click do
 i:read["image" "frames"]
 frames.value:raze each f in i.frames
  rtext.make["" "" f]
 end
end
{end}

{script:gifimport.1}
on click do
 i:read["image" "gray_frames"]
 frames.value:raze each f in i.frames
  rtext.make["" "" f.map[0 dict 255].transform["dither"]]
 end
end
{end}

{script:gifimport.2}
on click do
 i:read["image" "frames"]
 g:"[255,0,255,246,148,108,132,51,61,147,144,86,66,111,185,134,69,0]"
 grays:(0,1,32+range 16) dict "%j" parse g
 frames.value:raze each f in i.frames
  rtext.make["" "" f.map[grays].transform["dither"]]
 end
end
{end}

{card:Reordering}
{widgets}
canvas1:{"type":"canvas","size":[100,100],"pos":[83,65],"locked":1,"image":"%%IMG2AGQAZAD/AP8A/wD/AP8A/wD/ADsBAQBiAQIAYQEBAAEBAQBhAQEAAQEBAGABAQACAQEAXwEBAAMBAQBfAQEAAwEBAF4BAQAEAQEAXgEBAAQBAQBdAQEABQEBAF0BAQAGAQEAWwEBAAcBAQBbAQEACAEBAFkBAQAJAQEAWQEBAAoBAQBYAQEACgEBAFcBAQAMAQEAVgEBAAwBAQBVAQEADgEBAFQBAQAOAQEAUwEBABABAQBSAQEAEAEBAFIBAQARAQEAUAEBABIBAQBQAQEAEgEBAFABAQATAQEATgEBABQBAQBOAQEAFAEBAE0BAQAWAQEATAEBABYBAQBMAQEAFwEBAEoBAQAYAQEAAgEEAEQBAQAWAQUASAEBAA4BCAADAQEASAEBAAkBBgAMAQEARwEBAAMBBgASAQEARwEEABgBAQBFAQIAHAEBAEYBAQAdAQEARAEBAB4BAQBEAQEAHgEBAEQBAQAeAQEAQwEBAB8BAQBDAQEAIAEBAEIBAQAgAQEAQQEBACEBAQBBAQEAIgEBAEABAQAiAQEAYwEBAGQBAQBjAQEAYwEBAGMBAQBkAQEAYwEBAGMBAQBjAQEAZAEBAGMBAQBjAQEA/wD/AP8A/wD/AP8A/wD/AMU="}
canvas2:{"type":"canvas","size":[100,100],"pos":[124,88],"locked":1,"image":"%%IMG2AGQAZAD/AP8A/wD/AP8A/wDUAQIAXQEFAAIBAgBZAQIACQEBAFUBAwAMAQEAUgECAA8BAQBQAQIAEQEBAE4BAgAUAQEASwECABYBAQBLAQEAFwEBAEsBAQAXAQEASwEBABcBAQBMAQEAFgEBAEwBAQAWAQEATAEBABYBAQBMAQEAFgEBAEwBAQAWAQEATQEBABUBAQBNAQEAFQEBAE0BAQAUAQEATwEBABMBAQAFAQwAPgEBABIBAQAEAQIADAECADwBAQASAQEAAQEDABABAgA7AQEADgEFABUBAQA6AQEADAEEABkBAQA6AQEACwEBABwBAQA6AQEAKQEBADkBAQAqAQEAOAEBACsBAQA3AQEALAEBADcBAQArAQEANwEBACwBAQA2AQEALAEBADYBAQAtAQEANgEBACwBAQA2AQEALAEBADcBAQArAQEANwEBACsBAQA3AQEAKwEBADgBAQAqAQEAOAEBACoBAQA5AQEAKQEBADkBAQApAQEAOQEBACgBAQA6AQEAKAEBADoBAQAnAQEAOwEBACUBAgA8AQEAJAEBAD4BAQAjAQEAYQECAGEBAQBhAQIAYAECAGABAgBgAQIAYAECAGABAgBfAQMAXAEFAFkBBgBNAREA/wD/AP8A/wD/AP8A/wD/AP8AQA=="}
canvas3:{"type":"canvas","size":[100,100],"pos":[160,113],"locked":1,"image":"%%IMG2AGQAZAD/AP8A/wD/AP8A/wD/AP8A/wD3ARAAUgECABABAQBPAQIAEgEBAE0BAgAUAQEATAEBAGIBAQBiAQEAYwEBAGIBAQBiAQEAYwEBAGIBAQBiAQEAYwEBAGIBAQBjAQEAYwEBAGIBAQBjAQEAYgEBAGMBAQBjAQEAYgEBAGMBAQBjAQEAYwEBAGIBAQBjAQEAYwEBAGMBAQBiAQEAYwEBAGMBAQBjAQEAYwEBAGMBAQBjAQEAYwEBAGMBAQBjAQEAYwEBAGMBAQBkAQEAYwEBAGMBAQBjAQEAZAEBAGMBAQBkAQIAZAEBAGQBAQBjAQEAZAEBAGQBAQBkAQEAJgECADwBAQAkAQIAPgEBACIBAQBAAQEAIAECAEIBAQAeAQEARQEBABwBAQBHAQEAGgEBAEkBAgAWAQIATAEBABIBAwBPAQIADgECAFQBBAAIAQIAWgEIAP8A/wD/ALQ="}
canvas4:{"type":"canvas","size":[100,100],"pos":[211,151],"locked":1,"image":"%%IMG2AGQAZAD/AP8A/wD/AP8A/gESAFIBAQARAQIAUAEBABMBAgBOAQEAFQECAE0BAQAWAQEATAEBABcBAQBLAQEAGAEBAEoBAQAZAQIASAEBABsBAQBIAQEAGwEBAEcBAQAcAQEARgEBABwBAQBGAQEAHQEBAEUBAQAdAQEARQEBAB4BAQBFAQEAHQEBAEUBAQAeAQEARAEBAB4BAQBEAQEAHgEBAEQBAQAfAQEAQwEBAB8BAQBEAQEAHwEBAEMBAQAfAQEAQwEBAB8BAQBDAQEAHwEBAEMBAQAgAQEAQgEBACABAQBCAQEAIAEBAEMBAQAfAQEAQwEBAB8BAQBDAQEAIAEBAEIBAQAgAQEAQgEBACABAQBCAQEAIAEBAEIBAQAhAQEAQQEBACEBAQBCAQEAIAEBAEIBAQAgAQEAQgEBACABAQBCAQEAIAEBAEIBAQAgAQEAQgEBACABAQBCAQEAIAEBAEMBAQAfAQEAQwEBAB4BAQBEAQEAHgEBAEQBAQAdAQEARgEBABwBAQBGAQEAGwEBAEcBAQAbAQEARwEBABoBAQBIAQEAGgEBAEgBAQAZAQEASQEBABgBAQBKAQEAFwEBAEsBAQAWAQEATAEBABUBAQBNAQEAFAEBAE4BAQASAQIAYQEBAGIBAQBhAQIAXwEDAEsBAwAOAQUAUQEOAP8A/wD/AP8A/wD/AP8A/wAQ"}
canvas5:{"type":"canvas","size":[100,100],"pos":[256,193],"locked":1,"image":"%%IMG2AGQAZAD/AP8A/wD/AP8A/wD/AP8A/wAbAQEAYwEDAGEBAQACAQMAXgEBAAUBBQBZAQEACgEGAFQBAQAPARgAPAEBAGMBAQBjAQEAZAEBAGMBAQBjAQEAYwEBAGMBAQBkAQEAYwEBAGMBAQBjAQEAYwEBAGMBAQBkAQEAYwEBAGMBAQBjAQEAYwEBAGMBAQBkAQEAYwEBAGMBAQBjAQEAYwEBAGMBAQBjAQEAZAEBAGMBAQBjAQEAIQEHADsBAQAcAQUAQgEBABcBBQBHAQEAEwEEAEwBAQAOAQUAUAEBAAcBBwBUAQkAXQEBAGMBAQBjAQEAYwEBAGMBAQBkAQEAYwEBAGMBAQBkAQEAYwEBAGMBAQBjAQEAYwEBAGMBAQA/AQQAIAEBADsBBAAkAQEANQEGACgBAQAuAQcALwEBAB0BEAA2AQEAFAEJAEYBAQANAQcATwEBAAgBBQBWAQEABgECAFsBAQAEAQIAXQEBAAIBAgBfAQMA/wD/AP8A/wAt"}

{card:anime 1}
script:"anime 1.0"
{widgets}
canvas:{"type":"canvas","size":[175,164],"pos":[163,60],"image":"%%IMG2AK8ApAD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8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D/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AEI=","scale":1}
button1:{"type":"button","size":[134,42],"pos":[185,241],"script":"anime 1.1","text":"blocking animation"}

{script:anime 1.0}
on pinwheel t do
 canvas.clear[]
 c:canvas.size/2                 # center of canvas
 r:c[0]*.6+.4*sin 0.05*t         # radius of the pattern
 a:(0.01*t)+(pi/0.5*16)*range 16 # angle per wedge
 p:flip c+flip r*unit a          # points around a circle
 each x i in p
  if 2%i canvas.poly[c x p[(count p)%1+i]] end # draw every other wedge
 end
end
{end}

{script:anime 1.1}
on click do
 frame:0
 while !pointer.held
  pinwheel[frame]
  frame:frame+1
  sleep[1]
 end
end
{end}

{card:anime 2}
script:"anime 2.0"
{widgets}
canvas:{"type":"canvas","size":[175,164],"pos":[163,60],"animated":1,"script":"anime 2.1","image":"%%IMG2AK8ApAD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/ALMBEgCdARIAnQERAJ4BEQCfARAAnwEQAJ8BEACfAQ8AEgEBAHoBAgARAQ8AEgECAHgBBAARAQ4AEQEEAHYBBQARAQ4AEAEGAHQBBwAQAQ4AEAEHAHIBCQAPAQ0AEAEJAHABCgAPAQ0ADwELAG4BDAAPAQwADwEMAGwBDgAOAQwADgEOAGoBDwAOAQwADQEQAGgBEQANAQsADgERAGYBEwANAQoADQETAGQBFAANAQoADAEVAGMBFQAMAQoADAEUAGYBFAALAQoACwEUAGgBEwALAQkACwETAGwBEgALAQgACwESAG4BEgAKAQgACgERAHIBEQAJAQgACQERAHQBEAAJAQgACQEPAHgBDwAIAQgACAEPAHoBDwAIAQYACAEOAH4BDQAIAQYACAENAIABDQAHAQYABwEMAIQBDAAGAQYABgEMAIYBCwAGAQYABgEKAIoBCgAGAQQABgEKAIwBCgAFAQQABQEJAJABCAAFAQQABQEIAJIBCAAEAQQABAEHAB8BAQBUAQUAHQEHAAMBBAADAQcAGwEGAFQBCgAZAQYABAECAAQBBQAYAQsAVAEPABYBBQADAQIAAwEFABUBDwBUARQAEgEFAAIBAgACAQQAEgEUAFQBGQAPAQMAAgECAAIBAwAOARkAVAEfAAoBAwABAQIAAQECAAsBHgBUASQABwECAAIBAgAHASMAVQEoAAMBAQAGASgAVQFaAFUBKAAGAQEAAwEoAFUBIwAHAQIAAgECAAcBJABUAR4ACwECAAEBAgABAQMACgEfAFQBGQAOAQMAAgECAAIBAwAPARkAVAEUABIBBAACAQIAAgEFABIBFABUAQ8AFQEFAAMBAgADAQUAFgEPAFQBCwAYAQUABAECAAQBBgAZAQoAVAEGABsBBwADAQQAAwEHAB0BBQBUAQEAHwEHAAQBBAAEAQgAkgEIAAUBBAAFAQgAkAEJAAUBBAAFAQoAjAEKAAYBBAAGAQoAigEKAAYBBgAGAQsAhgEMAAYBBgAGAQwAhAEMAAcBBgAHAQ0AgAENAAgBBgAIAQ0AfgEOAAgBBgAIAQ8AegEPAAgBCAAIAQ8AeAEPAAkBCAAJARAAdAERAAkBCAAJAREAcgERAAoBCAAKARIAbgESAAsBCAALARIAbAETAAsBCQALARMAaAEUAAsBCgALARQAZgEUAAwBCgAMARUAYwEVAAwBCgANARQAZAETAA0BCgANARMAZgERAA4BCwANAREAaAEQAA0BDAAOAQ8AagEOAA4BDAAOAQ4AbAEMAA8BDAAPAQwAbgELAA8BDQAPAQoAcAEJABABDQAPAQkAcgEHABABDgAQAQcAdAEGABABDgARAQUAdgEEABEBDgARAQQAeAECABIBDwARAQIAegEBABIBDwCfARAAnwEQAJ8BEACfAREAngERAJ0BEgCdARIA/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wAD","scale":1}
button1:{"type":"button","size":[151,29],"pos":[173,240],"script":"anime 2.2","text":"Interrupt"}

{script:anime 2.0}
on pinwheel t do
 canvas.clear[]
 c:canvas.size/2                 # center of canvas
 r:c[0]*.6+.4*sin 0.05*t         # radius of the pattern
 a:(0.01*t)+(pi/0.5*16)*range 16 # angle per wedge
 p:flip c+flip r*unit a          # points around a circle
 each x i in p
  if 2%i canvas.poly[c x p[(count p)%1+i]] end # draw every other wedge
 end
end

{end}

{script:anime 2.1}
on view do
 pinwheel[sys.frame]
end

{end}

{script:anime 2.2}
on click do
 alert["you clicked the button!"]
end
{end}

{module:fancyTransitions}
description:"heart and star wipes"
{data}
lut:"%%IMG1ACAAIE89euIjSGos8HDHDdaH0cTJI1FA4vxarzRTKlUc0N/Az4L8n7UcRCOz68jQ5bwirLO5ymT7VnFa7t3owcHH1cqgoe6SHc4uD3FLVSFBA+RGwQf9ROaTpLZZwFhZhDyTLlt7vyk4AoXn62MWR2jQbwRzFIHNHxlBRAj11jfi9pE29hm9KMYyqAVzUvNLBQ6QWv6nsobtztFugL4AHnxgrdCst32fmiwEDEq95NMtX/gg5w/0S+kSnztUJJhDOverTrq4h+R8G727VJH1Y4SqxSJXntWPre+I+Tay8eCdZULeLyeNZ4oB+6qMGD5u9YKucjH/zh4/zjE3t07rtnf82TF4/qMqAGfSPol2+TmbYy+dm54J4OY0xt30/d6CGVfYmBNgeFdSzHSkakxejZF72l7YrMsxxUDsIdQfF20ZIZbTM8anpEMOgwcEg+Cwi5hZNRrjcCVFtEl6GMIAbzvxqadk+qmqINLbjn5P6gq9nhhyhP9GJ+GTg8heKTd716IoH4bfKNSJeruxCMXMy9qQ7SSxivNrNtcQ6EyNujoGyunVUFIWTTBS90qhd/tOw4s8llGwbIo/p668h25riz/fIFb0CZ3DLAUScmqlbn0vAjaAEdwQc6FV/2Od8ZAJsekhxzq23ZUCXBOxMpQOz5Sv+l+XTCdxFoDMeiYNs4zvLplNCxx1z3g34UZbK6AfXfIUvDP+QQPCviJiKYGW8qM/pjmjZlsi3aUjqqtrmdt2dMMBvvMy1xqvB03s2ZlsjR11JjAAnIHgm2hsVlMqmtLECew+6Vz0k5wISHk9ZmGgFVg4uOOJXefEK1SXRTVHPXnz44lwhUOM2i0r+ECfuxT2TxuBdUHw/8sKuX5RIHdkiFFthZLshFneWPrZBrSUmBOI8fJ42ciuGgN9PG9LosqPmpTNA0TNaD3jzGlCCySM644qCuV/4dM1DjUVoAbkAZB7XEAe20YPt8IMdFsmR3nuv+JtZsn+pl+b/HwHGLU5YsVOLr+yCklQUMumWjuha3Y4nF4RYSy62w1igwEmzSu5aXEbkkh+FXkXz/ALx8n4T+1W5gZ3ZRbGGm/DAoXlZkIUZ2moEIZgjxDTVSf5akWClhK8Qn/cubTyHWSj0V0esqi3qEdcZd52VJ71lzTh2KXClabvc1NMsDuKjtSZ+q0TbPvwKNEzUyR8OTNp3Fd/SSWIujSpLWiXSffnMLjSuHQbF3+OYg2tYQxDpFDWyTgR6C0SlZwwqSX2rqt93Iea7+q23wVF7fi+v+qLSl8EPPclZ/nWStew1di7s+gdtGUIMnI+5nAptZHayMAvTToLD3Wi5Y9dlRX9rKLA6mHBkhyAtX6GYKuvxKUXbUj97hEMWNQ="
{script}
on oval pos size do
 flip pos+size*flip unit 2*pi*(range 20)/20
end

on star c t do
 o:c.size/2
 r:(2.5*t)*o
 i:unit (pi/2)+(range 10)*(pi/5)
 p:each v index in i
  o+(if 2%index 1 else 0.5 end*r)*v
 end
 c.poly[p]
end

on heart c t do
 o:(0.5,0.6)*c.size
 r:t*c.size
 p:each v in (1,0,-1,0)join(0,-1,0,1) o+r*v end
 c.poly[p]
 c.poly[oval[o+r*( 1,-1)/2 r/sqrt 2]]
 c.poly[oval[o+r*(-1,-1)/2 r/sqrt 2]]
end

transition[on StarIn c a b t do
 star[c t]
 c.merge[a b]
end]

transition[on StarOut c a b t do
 star[c 1-t]
 c.merge[b a]
end]

transition[on HeartIn c a b t do
 heart[c t]
 c.merge[a b]
end]

transition[on HeartOut c a b t do
 heart[c 1-t]
 c.merge[b a]
end]

lut:image[data.lut]
transition[on Dissolve c a b t do
 c.merge[lut]
 c.merge[((floor 256*t) take b),(256 take a)]
end]

clickpos:0,0
on circleClick c t do c.poly[oval[clickpos t*max c.size]] end

transition[on CircleInClick c a b t do
  if 0~t clickpos:pointer.start end
  circleClick[c t]
  c.merge[a b]
end]
transition[on CircleOutClick c a b t do
  if 0~t clickpos:pointer.start end
  circleClick[c 1-t]
  c.merge[b a]
end]


{end}

{contraption:spinner}
size:[150,50]
resizable:1
margin:[0,0,0,0]
description:"unbounded numeric picker"
script:"spinner.0p"
template:"on change do\n \nend"
attributes:{"name":["value","step"],"label":["value","step"],"type":["number","number"]}
{widgets}
down:{"type":"button","size":[40,40],"pos":[5,5],"script":"spinner.1p","text":"<"}
up:{"type":"button","size":[40,40],"pos":[105,5],"script":"spinner.2p","text":">"}
value:{"type":"field","size":[40,40],"pos":[55,5],"locked":1,"value":"0"}
step:{"type":"field","size":[8,8],"pos":[0,0],"show":"none","value":"1"}

{script:spinner.0p}
on set_value x do value.text:0+x end
on get_value   do 0+value.text   end
on set_step  x do step.text:0+x  end
on get_step    do 0+step.text    end
{end}

{script:spinner.1p}
on click do
  value.text:value.text-step.text
  card.event["change"]
end
{end}

{script:spinner.2p}
on click do
  value.text:value.text+step.text
  card.event["change"]
end
{end}

{contraption:enchilada}
size:[200,140]
resizable:1
margin:[0,0,0,0]
description:"Demo of every attribute type."
script:"enchilada.0p"
attributes:{"name":["bool","number","string","code","rich"],"label":["Boolean","Number","String","Code","Rich Text"],"type":["bool","number","string","code","rich"]}
{widgets}
bool:{"type":"button","size":[190,20],"pos":[5,5],"text":"boolean value","style":"check","value":1}
number:{"type":"slider","size":[190,20],"pos":[5,30],"value":47,"style":"bar"}
string:{"type":"field","size":[190,20],"pos":[5,55],"value":"some string"}
code:{"type":"field","size":[190,20],"pos":[5,80],"value":"some code"}
rich:{"type":"field","size":[190,20],"pos":[5,105],"value":"some rich text"}

{script:enchilada.0p}
on set_bool   x do bool.value:x   end
on get_bool     do bool.value     end
on set_number x do number.value:x end
on get_number   do number.value   end
on set_string x do string.text:x  end
on get_string   do string.text    end
on set_code   x do code.text:x    end
on get_code     do code.text      end
on set_rich   x do rich.value:x  end
on get_rich     do rich.value    end
{end}

{contraption:paintbox}
size:[150,90]
margin:[0,0,0,0]
description:"blank background image"
image:"%%IMG0ADcANwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/4AAAAAAA//gAAAAAB//8AAAAAB///gAAAAB///8AAAAB//B/gAAAA//AH8AAAAf+AA/gAAAP+AAH8AAAD+AAA/gAAB+AAAH8AAAfgAAA/gAAPwH/AH4AAD8H/4A+AAB+D//APwAAfg//4D8AAHwP//AfAAB8D4PwHwAAfA+D8B8AAHwPgfAfgAB8D4HwH4AAfA+B8A+AAH4PgfAPgAB+D8DgD4AAPg/AAA+AAD4H4AAPgAA+B/AAD4AAPgP4AA+AAD4B/AAfgAA+AP8AP4AAPwB/gP8AAD8AP+P+AAAfAD///AAAH4Af//gAAB+AA//wAAAPgAH/wAAAD4AAfwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="

{contraption:smol}
size:[20,20]
resizable:1
margin:[8,8,8,8]
description:"a smol bean"
image:"%%IMG2ABQAFAAVAQcABAEHAAIBASAFAQEABAEBIAUBAQACAQEgAQEDIAEBBiABAQMgAQEBAAIBASABAQEgAQEBIAEBASAEAQEgAQEDIAEBAQACAQEgAQEDIAEBBiABAQMgAQEBAAIBASAFAQEABAEBIAUBAQACAQcABAEHAAQBASABAQEACAEBIAEBAQAGAQEgAQEBAAgBASABAQEABgEBIAEBAQAIAQEgAQEBAAYBASABAQEACAEBIAEBAQAEAQcABAEHAAIBASAFAQEABAEBIAEBASABAQEgAQEBAAIBASABAQMgAQEHIAEBASABAQIAAgEBIAEBAyABAQEgBAEBIAEBASABAQEgAQEBAAIBASABAQMgAQEHIAEBASABAQIAAgEBIAUBAQAEAQEgAQEBIAEBASABAQEAAgEHAAQBBwAV"
attributes:{"name":[],"label":[],"type":[]}

{contraption:viewCounter}
size:[102,26]
margin:[0,0,0,0]
description:"counts times the view event fires"
script:"viewCounter.0p"
{widgets}
c:{"type":"field","size":[92,20],"pos":[4,3],"value":"0"}

{script:viewCounter.0p}
on view do
 c.text:c.text+1
end
{end}

{contraption:dieRoller}
size:[137,23]
resizable:1
margin:[90,8,8,9]
description:"roll dice using \"1d6+5\" notation."
script:"dieRoller.0p"
attributes:{"name":["formula"],"label":["Formula"],"type":["string"]}
{widgets}
result:{"type":"field","size":[51,19],"pos":[84,2],"style":"plain"}
button1:{"type":"button","size":[79,19],"pos":[2,2],"script":"dieRoller.1p","text":"2d6","style":"rect"}

{script:dieRoller.0p}
on roll x do
 r:() i:0
 x:"" fuse " " split x
 while i<count x
  if x[i]="+"
   i:i+1
  else
   p:"%[n]id%[die]i%[match]m%[i]n" parse i drop x
   r:r,if p.match 1+random[p.die p.n] else p.n end
   i:i+p.i
  end
 end
 r
end

on set_formula x do button1.text:x end
on get_formula   do button1.text   end
{end}

{script:dieRoller.1p}
on click do
 v:roll[me.text]
 result.text:if 1=count v
  v
 else
  v:"%s = %s" format ("+" fuse v),(sum v)
 end
end
{end}

{contraption:clock}
size:[100,100]
resizable:1
margin:[8,8,10,10]
description:"a realtime clock, with a configurable UTC offset."
script:"clock.0p"
attributes:{"name":["utcoffset","24hour"],"label":["UTC Offset","24 hour format"],"type":["number","bool"]}
{widgets}
canvas1:{"type":"canvas","size":[100,100],"pos":[0,0],"locked":1,"animated":1,"script":"clock.1p","image":"%%IMG2AGQAZAD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wAnAQMAAgEFAAcBAQAEAQMABgEFAAIBAwA6AQEAAwEBAAUBAQAGAQIAAwEBAAMBAQAIAQEAAgEBAAMBAQA5AQEAAwEBAAQBAQADAQEABAEBAAMBAQADAQEAAgEBAAQBAQADAQEAAwEBADkBAQADAQEABAEBAAgBAQADAQEAAwEBAAYBAwACAQEAAwEBADkBAQADAQEAAwEBAAkBAQADAQEAAwEBAAkBAQABAQEAAwEBADkBAQADAQEAAwEBAAkBAQADAQEAAwEBAAUBAQADAQEAAQEBAAMBAQA6AQMABAEBAAQBAQAEAQEABAEDAAMBAQADAQMAAwEDAP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AIw=","scale":1}
tz:{"type":"field","size":[35,18],"pos":[6,75],"locked":1,"show":"none","style":"plain","align":"center","value":"-8"}
mil:{"type":"button","size":[31,19],"pos":[54,73],"show":"none","style":"check","value":0}

{script:clock.0p}
on set_utcoffset x do tz.text:x   end
on get_utcoffset   do 0+tz.text   end
on set_24hour    x do mil.value:x end
on get_24hour      do mil.value   end
{end}

{script:clock.1p}
on view do
 h:if mil.value 24 else 12 end
 t:"%i:%i:%i" parse last "T" split "%e" format sys.now
 t:"%02i:%02i:%02i" format (h%t[0]+tz.text),t[1],t[2]
 me.font:card.font
 me.clear[]
 me.text[t me.size/2 "center"]
end
{end}

{contraption:datePicker}
size:[109,123]
margin:[0,0,0,0]
description:"a date picker showing a monthly calendar."
image:"%%IMG2AG0Aew3/Df8N/w3/Df8N/w3/Df8N/w3/Df8N/w3/Df8N/w3/Df8N/w3/Df8N/w3/Df8N/w3/Df8N/w3/Df8N/w3/Df8N/w3/Df8N/w3/Df8N/w3/Df8N/w3/Df8N/w3/Df8N/w3/Df8N/w3/DZM="
script:"datePicker.0p"
template:"on change x do\n \nend"
attributes:{"name":["text"],"label":["Text"],"type":["string"]}
{widgets}
canv:{"type":"canvas","size":[103,100],"pos":[3,3],"script":"datePicker.1p","image":"%%IMG0AGcAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEEAAIAAAAAAAAAAAABjAACAAAAAAAAAAAAAVTLM4AAAAAAAAAAAAEkLEpAAAAAAAAAAAABBOhCQAAAAAAAAAAAAQUoSkAAAAAAAAAAAAEE6DJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAggHwBBAH0B4AHAAiAMYAQAQQARAQACIAIJCqYESCowEcELAgYByQkpBEgqSBEhzAHBACkIKQRIFHgRIQgAJwIpCCkESBRAESEIAikBxwgmBDgUMBEhCAHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////+AAAAAAAD//gAIACAAgAAAAAAA//4ACAAgAIAAAAAAAP9+Bwg+IBCAAAAAAAD+fgiIBCAwgAAAAAAA/34AiAggUIAAAAAAAP9+AQgcIJCAAAAAAAD/fgIIAiD4gAAAAAAA/34ECCIgEIAAAAAAAP9+D4gcIBCAAAAAAAD//gAIACAAgAAAAAAA//4ACAAgAIAAAAAAAP/+AAgAIACD////////////////ggAIACAAgAIACAAgAIIACAAgAIACAAgAIACCD4gMIPiBwgcIhyIIgggIECAIgiIIiYimGIIPCCAgEIIiCIiIogiCAIg8IBCBwgeIiKIIggCIIiAggiIAiIiiCIIIiCIgIIIiAQiIogiCBwgcICCBwgYIhyIIggAIACAAgAIACAAgAIIACAAgAIACAAgAIACCAAgAIACAAgAIACAAg////////////////4IACAAgAIACAAgAIACCAAgAIACAAgAIACAAgiHIj6IEiPogyI+iHIJiKYEmDJiCYQmApiKCICiCIhSI8iIIgSIigiBIhyIkiAojyIEiHIIgiICiPogKIiiCIiKCIQiIogSIiiIogiIigiPohyIEiHIhyIIiHIIACAAgAIACAAgAIACCAAgAIACAAgAIACAAggAIACAAgAIACAAgAIP///////////////+CAAgAIACAAgAIACAAggAIACAAgAIACAAgAIIhyccnCJxyc+nBJz6CYiooqJiiiohKIyiggiIoKKCIggoIiCUgvIIh6EihCIQSEchJIQKCICiIogiIIiAoj6ICgiBJCKQIkEJCKQEkIoIhi+cviL76+cvhL5yCAAgAIACAAgAIACAAggAIACAAgAIACAAgAIIACAAgAIACAAgAIACD////////////////ggAIACAAgAIACAAgAAIACAAgAIACAAgAIAACcMnPpxyccvnL4iAAAokKIKiioooSKEYgAAIKCCEgooKKIiiCIAACE8hBIRyEenIpwiAAAiIogiIiiAoKKCIgAAJCKQIkIpASiioiIAAC+cviL5y+YnHJwiAAAgAIACAAgAIACAAgAAIACAAgAIACAAgAIAACAAgAIACAAgAIACAAA//////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=","scale":1}
val:{"type":"field","size":[103,13],"pos":[3,107],"script":"datePicker.2p","style":"plain","value":"2023-03-01"}
next:{"type":"button","size":[19,13],"pos":[84,6],"script":"datePicker.3p","text":">","style":"rect"}
prev:{"type":"button","size":[19,13],"pos":[6,6],"script":"datePicker.4p","text":"<","style":"rect"}

{script:datePicker.0p}
dateparts: "year","month","day"
dateform: "%04i-%02i-%02i"

on do_change do
 card.event["change" get_value[]]
end

on get_text    do val.text end
on set_text  x do val.text:x view[] end
on get_value   do dateparts dict dateform parse val.text end
on set_value x do val.text:dateform format x @ dateparts view[] end

cellsize:15,14
day_names:"Su","Mo","Tu","We","Th","Fr","Sa"
month_names:"January","February","March","April","May","June","July","August","September","October","November","December"

# in each of these routines,
# - m is a month index [0-11]
# - y is a year (e.g. 2023)

on is_leap_year y do (!4%y)&(!400%y)|(100%y) end
on days_in_month y m do
 r:(31,28,31,30,31,30,31,31,30,31,30,31)[m]
 r+is_leap_year[y]&m=1
end
on first_day_of_month y m do
 mont:0,3,3,6,1,4,6,2,5,0,3,5
 if is_leap_year[y] mont[0]:6 mont[1]:6 end
 r1:(4,2,0,6,4)[floor(y-1700)/100]
 r2:floor 100%y
 r3:floor r2/4
 r4:mont[m]
 7%r1+r2+r3+r4+1
end

on days p do
 f:first_day_of_month[p.year p.month-1]
 c:days_in_month[p.year p.month-1]
 c take f drop flip (2,32)+(cellsize-1)*flip 7 cross 6
end

on view do
 p:get_value[]
 canv.font:"Mono"
 canv.clear[]
 canv.text[month_names[p.month-1] (0,5)+canv.size*.5,0 "top_center"]
 each day in range 7
  canv.text[day_names[day] ((canv.size[0]/7)*day+.5),20 "top_center"]
 end
 each cell index in days[p]
  canv.box[cell cellsize]
  canv.text[("%2i" format 1+index) (1,0)+cell+cellsize/2 "center"]
  if index=p.day-1 canv.invert[cell+1 cellsize-2] end
 end
end
{end}

{script:datePicker.1p}
on inside p r do
 min(p>r)&(p<r+cellsize)
end

on click pos do
 v:get_value[]
 each day index in days[v]
  if inside[pos day]
   v.day:index+1
   set_value[v]
   do_change[]
  end
 end
end

{end}

{script:datePicker.2p}
on change val do
 set_text[val]
 do_change[]
end
{end}

{script:datePicker.3p}
on click do
 v:get_value[]
 if v.month=12
  v.year:v.year+1
  v.month:1
 else
  v.month:v.month+1
 end
 set_value[v]
 do_change[]
end
{end}

{script:datePicker.4p}
on click do
 v:get_value[]
 if v.month=1
  v.year:v.year-1
  v.month:12
 else
  v.month:v.month-1
 end
 set_value[v]
 do_change[]
end
{end}

{contraption:fancyBorder}
size:[22,24]
resizable:1
margin:[10,11,10,11]
description:"a decorative border"
image:"%%IMG2ABYAGAABAQUACQEGAAEBASAFAQMABgEBIAUBAiABAQMgAQEBIAEBAQAGAQEgAQEDIAEBAiABAQEgAQEBIAEBASABAQEABgEBIAEBASABAQEgAQECIAEBAyABAQ4gAQECIAMBASABAQEgDgEGIAEBEAABAQQgAQEBIAEBASAGAQEgAQEBIAIBAgAEAQEgAQEBIAEBCCABAQQABQEBIAEBASABAQYgAQEBIAEBBAAFAQEgAQEBIAEBAQAEAQEgAQEBIAEBAQAIAQEgAQEBIAEBAQAEAQEgAQEBIAEBAQAIAQEgAQEBIAEBAQAEAQEgAQEBIAEBAQAIAQEgAQEBIAEBAQAEAQEgAQEBIAEBAQAFAQQgAQEBIAEBBiABAQEgAQEBAAUBASACAQEgAQEBIAEBASAEAQEgAQEBIAEBAQAFAQ8gAQEEAAEBASAOAQEgAQEBIAMBAiABAQ4gAQEDIAEBAiABAQEgAQEBIAEBCCABAQEgAQEBIAEBASABAQIgAQEDIAEBAQAGAQEgAQEBIAEBAyABAQIgBQEBAAYBAyAFAQEAAQEGAAYBCAACAQUACQEFAAI="

{contraption:draggability}
size:[100,100]
margin:[0,0,0,0]
description:"contraption with an inner draggable thing."
image:"%%IMG2AGQAZAH/ATAAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgEGAF4BBgBeAQYAXgH/ATA="
{widgets}
canvas1:{"type":"canvas","size":[29,28],"pos":[37,28],"locked":1,"image":"%%IMG0AB0AHAAAAAAA/+AAAQAYAAYABgAMAAEACAABAAgAAQAIAAEACD+AgBAgwIAQIECAECBAgBAgQIAQIECAECAggAgh4IAEIACABBABAAIYAQABhAEAAHIBAAABAgAAAIIAAABCAAAAPgAAAAAAAAAAAAAAAAA=","draggable":1,"scale":1}

{contraption:patternPicker}
size:[100,100]
resizable:1
margin:[10,10,10,10]
description:"a palette of patterns and (optionally) colors."
script:"patternPicker.0p"
template:"on change val do\n \nend"
attributes:{"name":["value","color"],"label":["Value","Color"],"type":["number","bool"]}
{widgets}
c:{"type":"canvas","size":[100,100],"pos":[0,0],"locked":1,"border":0,"scale":1}
v:{"type":"slider","size":[60,25],"pos":[2,-41],"locked":1,"show":"none","interval":[0,47]}
cc:{"type":"button","size":[14,20],"pos":[73,-40],"locked":1,"show":"none","style":"check","value":1}

{script:patternPicker.0p}
on get_value do v.value end
on set_value x do v.value:x view[] end
on get_color do cc.value end
on set_color x do cc.value:x view[] end

b:5
r:4+2*cc.value
s:floor(c.size-2*b)/8,r

on boxes do
 flip b+s*flip 8 cross r
end

on view do
 o:-50
 c.clear[]
 each p i in boxes[]
  c.pattern:i
  c.rect[p s]
  c.pattern:1
  c.box[p s+1]
  if i=v.value o:p end
 end
 c.pattern:0
 c.box[o-1 s+3]
 c.pattern:1
 c.box[o-2 s+5]
end

on inside p r do
 min(p>r)&(r+s>p)
end
on click pos do
 each p i in boxes[]
  if inside[pos p]
   set_value[i]
   card.event["change" i]
  end
 end
end

{end}

{contraption:dispatcher}
size:[100,100]
margin:[0,0,0,0]
description:"used to make sure events don't bubble from inside contraptions to their containing card."
{widgets}
button1:{"type":"button","size":[60,20],"pos":[20,40],"text":"Click Me!"}

