{
    "tailapp": 2,
    "manifest": {
        "format": 2,
        "app_id": "scanner",
        "name": "Scanner",
        "version": 1,
        "schema": "tailapps/v0",
        "exported_at": 1795564620,
        "from": "gallery",
        "connections": [],
        "files": {
            "app.json": "733a58e0a0ba13750d8da79d13d09af3645db7e02576ee6e2604ad7e322e78a9"
        },
        "signature": "4l5sTJid2z0MzMap2s/B2PrA88WFFeikXU2voBSsS5MLzmf4IyGQ5onDrAwO1nrloyJ++mePoWquvi+GWCOmBw==",
        "key_id": "gallery-1"
    },
    "app": {
        "schema": "tailapps/v0",
        "app": "scanner",
        "name": "Scanner",
        "description": "Scan QR codes and barcodes with the camera and keep the last twenty, ready to copy. On the iPhone and the Mac, with no script.",
        "icon": "qrcode.viewfinder",
        "version": 1,
        "permissions": [
            "camera",
            "clipboard.write"
        ],
        "state": {
            "codes": {
                "type": "list",
                "default": []
            }
        },
        "actions": {
            "scan": {
                "steps": [
                    {
                        "scan.code": [],
                        "as": "code"
                    },
                    {
                        "remove": {
                            "codes": {
                                "match": {
                                    "value": "$code.value"
                                }
                            }
                        }
                    },
                    {
                        "push": {
                            "codes": {
                                "type": "$code.type",
                                "value": "$code.value",
                                "at": "$now"
                            }
                        },
                        "at": "front",
                        "max": 20
                    }
                ]
            },
            "copy": {
                "args": {
                    "value": "text"
                },
                "steps": [
                    {
                        "clipboard.write": {
                            "text": "$args.value"
                        }
                    }
                ]
            },
            "clear": {
                "confirm": "Forget every scanned code?",
                "steps": [
                    {
                        "set": {
                            "codes": []
                        }
                    }
                ]
            }
        },
        "cards": [
            {
                "id": "main",
                "layout": {
                    "column": [
                        {
                            "button": "Scan a Code",
                            "on": "scan",
                            "style": "primary",
                            "icon": "qrcode.viewfinder",
                            "size": "l",
                            "grow": true
                        },
                        {
                            "column": [
                                {
                                    "list": "$codes",
                                    "item": {
                                        "cell": "$item.value",
                                        "subtitle": "{$item.type | upper} \u00b7 {$item.at | ago}",
                                        "leading": "$item.type | map:{qr:'qrcode', else:'barcode'}",
                                        "trailing": {
                                            "button": "Copy",
                                            "on": "copy",
                                            "args": {
                                                "value": "$item.value"
                                            },
                                            "icon": "doc.on.doc",
                                            "icon_only": true
                                        }
                                    }
                                }
                            ],
                            "style": "inset",
                            "when": "$codes | count"
                        },
                        {
                            "button": "Clear",
                            "on": "clear",
                            "style": "secondary",
                            "when": "$codes | count"
                        }
                    ],
                    "gap": "m"
                }
            }
        ],
        "views": {
            "menubar": {
                "icon": "qrcode.viewfinder",
                "card": "main"
            },
            "floating": {
                "card": "main",
                "width": "default"
            }
        }
    },
    "app_json": "{\n  \"schema\": \"tailapps/v0\",\n  \"app\": \"scanner\",\n  \"name\": \"Scanner\",\n  \"description\": \"Scan QR codes and barcodes with the camera and keep the last twenty, ready to copy. On the iPhone and the Mac, with no script.\",\n  \"icon\": \"qrcode.viewfinder\",\n  \"version\": 1,\n  \"permissions\": [\"camera\", \"clipboard.write\"],\n  \"state\": {\n    \"codes\": { \"type\": \"list\", \"default\": [] }\n  },\n  \"actions\": {\n    \"scan\": {\n      \"steps\": [\n        { \"scan.code\": {}, \"as\": \"code\" },\n        { \"remove\": { \"codes\": { \"match\": { \"value\": \"$code.value\" } } } },\n        { \"push\": { \"codes\": { \"type\": \"$code.type\", \"value\": \"$code.value\", \"at\": \"$now\" } }, \"at\": \"front\", \"max\": 20 }\n      ]\n    },\n    \"copy\": {\n      \"args\": { \"value\": \"text\" },\n      \"steps\": [{ \"clipboard.write\": { \"text\": \"$args.value\" } }]\n    },\n    \"clear\": {\n      \"confirm\": \"Forget every scanned code?\",\n      \"steps\": [{ \"set\": { \"codes\": [] } }]\n    }\n  },\n  \"cards\": [\n    {\n      \"id\": \"main\",\n      \"layout\": {\n        \"column\": [\n          { \"button\": \"Scan a Code\", \"on\": \"scan\", \"style\": \"primary\", \"icon\": \"qrcode.viewfinder\", \"size\": \"l\", \"grow\": true },\n          {\n            \"column\": [\n              {\n                \"list\": \"$codes\",\n                \"item\": {\n                  \"cell\": \"$item.value\",\n                  \"subtitle\": \"{$item.type | upper} \u00b7 {$item.at | ago}\",\n                  \"leading\": \"$item.type | map:{qr:'qrcode', else:'barcode'}\",\n                  \"trailing\": { \"button\": \"Copy\", \"on\": \"copy\", \"args\": { \"value\": \"$item.value\" }, \"icon\": \"doc.on.doc\", \"icon_only\": true }\n                }\n              }\n            ],\n            \"style\": \"inset\",\n            \"when\": \"$codes | count\"\n          },\n          { \"button\": \"Clear\", \"on\": \"clear\", \"style\": \"secondary\", \"when\": \"$codes | count\" }\n        ],\n        \"gap\": \"m\"\n      }\n    }\n  ],\n  \"views\": {\n    \"menubar\": { \"icon\": \"qrcode.viewfinder\", \"card\": \"main\" },\n    \"floating\": { \"card\": \"main\", \"width\": \"default\" }\n  }\n}\n",
    "files": []
}