@wirecat/zoom-cli 0.83.0 → 0.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/contracts/wirecat.json +34 -1
- package/dist/account-removal.d.ts +1 -1
- package/dist/account-removal.d.ts.map +1 -1
- package/dist/account-removal.js +1 -1
- package/dist/account-removal.js.map +1 -1
- package/dist/agent-skill.js +1 -1
- package/dist/agent-skill.js.map +1 -1
- package/dist/answer-entities.d.ts +1 -1
- package/dist/answer-entities.d.ts.map +1 -1
- package/dist/answer-entities.js +1 -1
- package/dist/answer-entities.js.map +1 -1
- package/dist/answer-output.d.ts +2 -2
- package/dist/answer-output.d.ts.map +1 -1
- package/dist/answer-output.js +1 -1
- package/dist/answer-output.js.map +1 -1
- package/dist/answer-policy.d.ts.map +1 -1
- package/dist/answer-policy.js +1 -2
- package/dist/answer-policy.js.map +1 -1
- package/dist/answers.js +1 -1
- package/dist/answers.js.map +1 -1
- package/dist/api.d.ts +2 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +1 -1
- package/dist/api.js.map +1 -1
- package/dist/archive-commands.d.ts +1 -1
- package/dist/archive-commands.d.ts.map +1 -1
- package/dist/archive-commands.js +1 -2
- package/dist/archive-commands.js.map +1 -1
- package/dist/archive-import.d.ts +1 -1
- package/dist/archive-import.d.ts.map +1 -1
- package/dist/archive-import.js +1 -1
- package/dist/archive-import.js.map +1 -1
- package/dist/archive-transcripts.d.ts +1 -1
- package/dist/archive-transcripts.d.ts.map +1 -1
- package/dist/archive-transcripts.js +1 -2
- package/dist/archive-transcripts.js.map +1 -1
- package/dist/bin/main.js +3 -3
- package/dist/bin/main.js.map +1 -1
- package/dist/bin/zm.js +11 -11
- package/dist/bundle/answer-policy-OQQWAUHH.js +33 -0
- package/dist/bundle/chunk-3YDF76DP.js +922 -0
- package/dist/bundle/chunk-AEWYRB6F.js +8 -0
- package/dist/bundle/{chunk-OGTN2KVG.js → chunk-AF2Z6VOG.js} +4 -14
- package/dist/bundle/{chunk-26TW5RZ6.js → chunk-DAYBU7WR.js} +61 -94
- package/dist/bundle/{chunk-2DK5BBFF.js → chunk-JD63PEI3.js} +3 -8
- package/dist/bundle/{chunk-H6A4NWYJ.js → chunk-L5ZYKXAY.js} +114 -128
- package/dist/bundle/{chunk-R6IA5UQB.js → chunk-W4TDCCT3.js} +8 -2
- package/dist/bundle/{chunk-XEOZTA3H.js → chunk-W6YFWJDR.js} +2 -5
- package/dist/bundle/{chunk-434YFJAE.js → chunk-WSGD5Q6L.js} +3 -9
- package/dist/bundle/config-MP5YLHEY.js +29 -0
- package/dist/bundle/{folders-ROKVKSCT.js → folders-B2GKJOC2.js} +2 -7
- package/dist/bundle/{main-GCK3VYAA.js → main-YZPLPXB7.js} +19 -41
- package/dist/bundle/{output-file-RYIOIXMD.js → output-file-PKA7MJEP.js} +3 -11
- package/dist/bundle/{program-OYLVYA4Z.js → program-7JY6XJ6K.js} +642 -801
- package/dist/bundle/run-log-ML7ZCWXD.js +54 -0
- package/dist/bundle/store-connection-LQGKS3DN.js +21 -0
- package/dist/bundle/streaming-PRGWGNHY.js +12 -0
- package/dist/bundle/tokens-57RJVBK6.js +18 -0
- package/dist/bundle/zm.js +4 -161
- package/dist/bundle/{zoom-app-4F4YY4OI.js → zoom-app-EYJST6GF.js} +5 -13
- package/dist/chat-file.d.ts +1 -1
- package/dist/chat-file.d.ts.map +1 -1
- package/dist/commands.js +1 -1
- package/dist/commands.js.map +1 -1
- package/dist/config-issues.d.ts +1 -1
- package/dist/config-issues.d.ts.map +1 -1
- package/dist/config-issues.js +1 -1
- package/dist/config-issues.js.map +1 -1
- package/dist/config.d.ts +1 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -2
- package/dist/config.js.map +1 -1
- package/dist/contacts-commands.d.ts +1 -1
- package/dist/contacts-commands.d.ts.map +1 -1
- package/dist/contacts-commands.js +1 -1
- package/dist/contacts-commands.js.map +1 -1
- package/dist/contract-overrides.js +1 -1
- package/dist/contract-overrides.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/execution.d.ts +1 -1
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +1 -1
- package/dist/execution.js.map +1 -1
- package/dist/files.d.ts +2 -2
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +1 -1
- package/dist/files.js.map +1 -1
- package/dist/first-screen.js +1 -1
- package/dist/first-screen.js.map +1 -1
- package/dist/identity.d.ts +1 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +6 -0
- package/dist/identity.js.map +1 -1
- package/dist/ingestion-search-commands.d.ts +1 -1
- package/dist/ingestion-search-commands.d.ts.map +1 -1
- package/dist/ingestion-search-commands.js +1 -1
- package/dist/ingestion-search-commands.js.map +1 -1
- package/dist/local-transcription-commands.d.ts +1 -1
- package/dist/local-transcription-commands.d.ts.map +1 -1
- package/dist/local-transcription-commands.js +1 -2
- package/dist/local-transcription-commands.js.map +1 -1
- package/dist/local-transcription.d.ts +1 -2
- package/dist/local-transcription.d.ts.map +1 -1
- package/dist/local-transcription.js +3 -3
- package/dist/local-transcription.js.map +1 -1
- package/dist/meeting-commands.d.ts +1 -1
- package/dist/meeting-commands.d.ts.map +1 -1
- package/dist/meeting-commands.js +1 -2
- package/dist/meeting-commands.js.map +1 -1
- package/dist/meeting-communications-binding.d.ts +1 -2
- package/dist/meeting-communications-binding.d.ts.map +1 -1
- package/dist/meeting-communications-binding.js.map +1 -1
- package/dist/meeting-context-commands.d.ts +1 -1
- package/dist/meeting-context-commands.d.ts.map +1 -1
- package/dist/meeting-context-commands.js +1 -1
- package/dist/meeting-context-commands.js.map +1 -1
- package/dist/meeting-context.d.ts +2 -4
- package/dist/meeting-context.d.ts.map +1 -1
- package/dist/meeting-context.js +1 -1
- package/dist/meeting-context.js.map +1 -1
- package/dist/meeting-integration-commands.d.ts +1 -1
- package/dist/meeting-integration-commands.d.ts.map +1 -1
- package/dist/meeting-integration-commands.js +1 -2
- package/dist/meeting-integration-commands.js.map +1 -1
- package/dist/meeting-integration.d.ts +1 -1
- package/dist/meeting-integration.d.ts.map +1 -1
- package/dist/meeting-integration.js +1 -1
- package/dist/meeting-integration.js.map +1 -1
- package/dist/meeting-inventory.d.ts +1 -1
- package/dist/meeting-inventory.d.ts.map +1 -1
- package/dist/meeting-inventory.js +1 -1
- package/dist/meeting-inventory.js.map +1 -1
- package/dist/meeting-preparation.d.ts +1 -2
- package/dist/meeting-preparation.d.ts.map +1 -1
- package/dist/meeting-preparation.js +1 -1
- package/dist/meeting-preparation.js.map +1 -1
- package/dist/meeting-project-candidates.d.ts +1 -1
- package/dist/meeting-project-candidates.d.ts.map +1 -1
- package/dist/meeting-project-evidence-commands.d.ts +1 -1
- package/dist/meeting-project-evidence-commands.d.ts.map +1 -1
- package/dist/meeting-project-evidence-commands.js +1 -2
- package/dist/meeting-project-evidence-commands.js.map +1 -1
- package/dist/meeting-read-command-bindings.js +1 -1
- package/dist/meeting-read-command-bindings.js.map +1 -1
- package/dist/meeting-review-commands.d.ts +1 -3
- package/dist/meeting-review-commands.d.ts.map +1 -1
- package/dist/meeting-review-commands.js +1 -2
- package/dist/meeting-review-commands.js.map +1 -1
- package/dist/meeting-search-commands.d.ts +2 -3
- package/dist/meeting-search-commands.d.ts.map +1 -1
- package/dist/meeting-search-commands.js +2 -4
- package/dist/meeting-search-commands.js.map +1 -1
- package/dist/meeting-searches-commands.d.ts +1 -2
- package/dist/meeting-searches-commands.d.ts.map +1 -1
- package/dist/meeting-searches-commands.js +1 -2
- package/dist/meeting-searches-commands.js.map +1 -1
- package/dist/meeting-selection-options.d.ts +1 -1
- package/dist/meeting-selection-options.d.ts.map +1 -1
- package/dist/meeting-selection-options.js +1 -2
- package/dist/meeting-selection-options.js.map +1 -1
- package/dist/meeting-semantic-commands.d.ts +1 -2
- package/dist/meeting-semantic-commands.d.ts.map +1 -1
- package/dist/meeting-semantic-commands.js +1 -1
- package/dist/meeting-semantic-commands.js.map +1 -1
- package/dist/meeting-semantic.d.ts +2 -2
- package/dist/meeting-semantic.d.ts.map +1 -1
- package/dist/meeting-semantic.js +1 -1
- package/dist/meeting-semantic.js.map +1 -1
- package/dist/meeting-source.d.ts +1 -1
- package/dist/meeting-source.d.ts.map +1 -1
- package/dist/meeting-stats-commands.d.ts +1 -3
- package/dist/meeting-stats-commands.d.ts.map +1 -1
- package/dist/meeting-stats-commands.js +1 -2
- package/dist/meeting-stats-commands.js.map +1 -1
- package/dist/models-commands.d.ts +1 -1
- package/dist/models-commands.d.ts.map +1 -1
- package/dist/models-commands.js +1 -1
- package/dist/models-commands.js.map +1 -1
- package/dist/occurrence-schedule.d.ts +1 -1
- package/dist/occurrence-schedule.d.ts.map +1 -1
- package/dist/permissions.d.ts +1 -1
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +1 -2
- package/dist/permissions.js.map +1 -1
- package/dist/profile.js +1 -1
- package/dist/profile.js.map +1 -1
- package/dist/program-bindings.js +1 -1
- package/dist/program-bindings.js.map +1 -1
- package/dist/program.d.ts +1 -2
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +1 -1
- package/dist/program.js.map +1 -1
- package/dist/progress-commands.d.ts +1 -1
- package/dist/progress-commands.d.ts.map +1 -1
- package/dist/progress-commands.js +1 -2
- package/dist/progress-commands.js.map +1 -1
- package/dist/read-only.js +1 -1
- package/dist/read-only.js.map +1 -1
- package/dist/recording-archive.d.ts.map +1 -1
- package/dist/recording-archive.js +1 -2
- package/dist/recording-archive.js.map +1 -1
- package/dist/recording-manifest.js +1 -1
- package/dist/recording-manifest.js.map +1 -1
- package/dist/recording-partial-store.d.ts +2 -3
- package/dist/recording-partial-store.d.ts.map +1 -1
- package/dist/recording-partial-store.js +1 -1
- package/dist/recording-partial-store.js.map +1 -1
- package/dist/recording-promotion-store.d.ts +1 -2
- package/dist/recording-promotion-store.d.ts.map +1 -1
- package/dist/recording-promotion-store.js +1 -2
- package/dist/recording-promotion-store.js.map +1 -1
- package/dist/recording-schedule-commands.d.ts +1 -1
- package/dist/recording-schedule-commands.d.ts.map +1 -1
- package/dist/recording-schedule-commands.js +1 -1
- package/dist/recording-schedule-commands.js.map +1 -1
- package/dist/recording-schedule-store.js +1 -1
- package/dist/recording-schedule-store.js.map +1 -1
- package/dist/recording-schedule-systemd.js +1 -1
- package/dist/recording-schedule-systemd.js.map +1 -1
- package/dist/recording-schedule.d.ts +1 -1
- package/dist/recording-schedule.d.ts.map +1 -1
- package/dist/recording-schedule.js +1 -1
- package/dist/recording-schedule.js.map +1 -1
- package/dist/recording-sync-store.d.ts +1 -1
- package/dist/recording-sync-store.d.ts.map +1 -1
- package/dist/recording-sync-store.js +1 -2
- package/dist/recording-sync-store.js.map +1 -1
- package/dist/recording-sync.d.ts +1 -1
- package/dist/recording-sync.d.ts.map +1 -1
- package/dist/recording-sync.js +1 -1
- package/dist/recording-sync.js.map +1 -1
- package/dist/recording-writer-lease.d.ts +1 -1
- package/dist/recording-writer-lease.d.ts.map +1 -1
- package/dist/recording-writer-lease.js +1 -1
- package/dist/recording-writer-lease.js.map +1 -1
- package/dist/recordings.d.ts +1 -1
- package/dist/recordings.d.ts.map +1 -1
- package/dist/recordings.js.map +1 -1
- package/dist/remote-meetings.d.ts +19 -19
- package/dist/remote-meetings.d.ts.map +1 -1
- package/dist/remote-meetings.js +1 -1
- package/dist/remote-meetings.js.map +1 -1
- package/dist/request-events.d.ts +1 -1
- package/dist/request-events.d.ts.map +1 -1
- package/dist/request-events.js +1 -1
- package/dist/request-events.js.map +1 -1
- package/dist/run-log.d.ts +1 -1
- package/dist/run-log.d.ts.map +1 -1
- package/dist/run-log.js +1 -1
- package/dist/run-log.js.map +1 -1
- package/dist/run.d.ts +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +1 -2
- package/dist/run.js.map +1 -1
- package/dist/series-inventory.d.ts +2 -2
- package/dist/series-inventory.js +1 -1
- package/dist/series-inventory.js.map +1 -1
- package/dist/setup-commands.d.ts +1 -1
- package/dist/setup-commands.d.ts.map +1 -1
- package/dist/setup-commands.js +1 -1
- package/dist/setup-commands.js.map +1 -1
- package/dist/store-commands.d.ts +1 -1
- package/dist/store-commands.d.ts.map +1 -1
- package/dist/store-commands.js +1 -2
- package/dist/store-commands.js.map +1 -1
- package/dist/store-connection.d.ts +1 -3
- package/dist/store-connection.d.ts.map +1 -1
- package/dist/store-connection.js +14 -14
- package/dist/store-connection.js.map +1 -1
- package/dist/sync-progress.d.ts +4 -4
- package/dist/sync-progress.d.ts.map +1 -1
- package/dist/sync-progress.js +1 -1
- package/dist/sync-progress.js.map +1 -1
- package/dist/tokens.d.ts +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +1 -1
- package/dist/tokens.js.map +1 -1
- package/dist/unified-search.d.ts +1 -1
- package/dist/unified-search.d.ts.map +1 -1
- package/dist/upcoming-meetings.d.ts +2 -2
- package/dist/upcoming-meetings.js +1 -1
- package/dist/upcoming-meetings.js.map +1 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +1 -2
- package/dist/upgrade.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/watch-commands.d.ts +1 -2
- package/dist/watch-commands.d.ts.map +1 -1
- package/dist/watch-commands.js +1 -2
- package/dist/watch-commands.js.map +1 -1
- package/dist/watch-service.d.ts +1 -1
- package/dist/watch-service.d.ts.map +1 -1
- package/dist/watch-service.js +1 -1
- package/dist/watch-service.js.map +1 -1
- package/dist/zoom-app.d.ts +2 -2
- package/dist/zoom-app.d.ts.map +1 -1
- package/dist/zoom-app.js +1 -1
- package/dist/zoom-app.js.map +1 -1
- package/dist/zoom-search-commands.d.ts +1 -1
- package/dist/zoom-search-commands.d.ts.map +1 -1
- package/dist/zoom-search-commands.js +1 -1
- package/dist/zoom-search-commands.js.map +1 -1
- package/dist/zoom-session.d.ts +1 -1
- package/dist/zoom-session.d.ts.map +1 -1
- package/dist/zoom-session.js +1 -1
- package/dist/zoom-session.js.map +1 -1
- package/package.json +3 -3
- package/scenarios/person-in-meetings.md +1 -1
- package/skills/zoom-cli/SKILL.md +1 -1
- package/skills/zoom-cli/references/people-and-projects.md +5 -5
- package/skills/zoom-cli/references/prepare.md +2 -2
- package/dist/bundle/agent-3HDWEZ5M.js +0 -47
- package/dist/bundle/all-profiles-RY2OMSDL.js +0 -321
- package/dist/bundle/answer-policy-IFVXPPGW.js +0 -131
- package/dist/bundle/anthropic-36VPSF7B.js +0 -91
- package/dist/bundle/app-server-ZVJVUGB7.js +0 -267
- package/dist/bundle/bun-F4M4KCNA.js +0 -169
- package/dist/bundle/bun-sqlite-IOPYIUA7.js +0 -76
- package/dist/bundle/chunk-2IBKKVVZ.js +0 -335
- package/dist/bundle/chunk-2S54TM4N.js +0 -230
- package/dist/bundle/chunk-3AQHKXVR.js +0 -161
- package/dist/bundle/chunk-3CW2C7ZA.js +0 -217
- package/dist/bundle/chunk-3KUEZK5Z.js +0 -73
- package/dist/bundle/chunk-3PXUQFHX.js +0 -2333
- package/dist/bundle/chunk-3QN5KDFZ.js +0 -3012
- package/dist/bundle/chunk-575JMTDR.js +0 -562
- package/dist/bundle/chunk-5B2LV4MS.js +0 -26
- package/dist/bundle/chunk-5WL5RHOO.js +0 -167
- package/dist/bundle/chunk-6C7ESL5N.js +0 -295
- package/dist/bundle/chunk-6E4KLYNP.js +0 -229
- package/dist/bundle/chunk-7JDXR75Q.js +0 -465
- package/dist/bundle/chunk-AK3H2C65.js +0 -1349
- package/dist/bundle/chunk-AQ5RIOUE.js +0 -633
- package/dist/bundle/chunk-AQLUAQXJ.js +0 -1259
- package/dist/bundle/chunk-ASTLGFTR.js +0 -12270
- package/dist/bundle/chunk-ATHBB7OU.js +0 -106
- package/dist/bundle/chunk-B2NM65RD.js +0 -80
- package/dist/bundle/chunk-B4KHDXJE.js +0 -64
- package/dist/bundle/chunk-BAFC7WNI.js +0 -276
- package/dist/bundle/chunk-BBGJQMRI.js +0 -34
- package/dist/bundle/chunk-BTLZYRIW.js +0 -1007
- package/dist/bundle/chunk-BZDS2X6Y.js +0 -5150
- package/dist/bundle/chunk-C7JPYWYQ.js +0 -77
- package/dist/bundle/chunk-CDQUW25G.js +0 -3752
- package/dist/bundle/chunk-CJWGJBHW.js +0 -1044
- package/dist/bundle/chunk-D72URWJE.js +0 -532
- package/dist/bundle/chunk-D7RCUODT.js +0 -185
- package/dist/bundle/chunk-DFDN6AUB.js +0 -21
- package/dist/bundle/chunk-DNCLQPOM.js +0 -7
- package/dist/bundle/chunk-DQJECJUE.js +0 -2257
- package/dist/bundle/chunk-E4JQ3MCW.js +0 -2338
- package/dist/bundle/chunk-E4ODYLEK.js +0 -209
- package/dist/bundle/chunk-EE45N67Q.js +0 -86
- package/dist/bundle/chunk-EEEU4MKK.js +0 -210
- package/dist/bundle/chunk-ESN3W2MZ.js +0 -2624
- package/dist/bundle/chunk-ETIZGA4P.js +0 -340
- package/dist/bundle/chunk-F44QK6CK.js +0 -52
- package/dist/bundle/chunk-FH2UFNH6.js +0 -54
- package/dist/bundle/chunk-FTH6WGYO.js +0 -24
- package/dist/bundle/chunk-FWACRG4X.js +0 -160
- package/dist/bundle/chunk-FXBHOCJK.js +0 -24600
- package/dist/bundle/chunk-G5SZL7G2.js +0 -150
- package/dist/bundle/chunk-G6CHEFAG.js +0 -108
- package/dist/bundle/chunk-GHJD7PE6.js +0 -1068
- package/dist/bundle/chunk-GZ7WBU5Y.js +0 -18
- package/dist/bundle/chunk-HKLRI2LB.js +0 -555
- package/dist/bundle/chunk-HMD4FZYY.js +0 -133
- package/dist/bundle/chunk-HO4JGD4Q.js +0 -16
- package/dist/bundle/chunk-HTQTIKWP.js +0 -928
- package/dist/bundle/chunk-HUAHLO6N.js +0 -29
- package/dist/bundle/chunk-IANKXHSE.js +0 -46
- package/dist/bundle/chunk-IQZXFWFI.js +0 -170
- package/dist/bundle/chunk-ISQ23VKV.js +0 -123
- package/dist/bundle/chunk-JEH33ZCD.js +0 -58
- package/dist/bundle/chunk-JUNQYWQ2.js +0 -228
- package/dist/bundle/chunk-JUXMVQWJ.js +0 -799
- package/dist/bundle/chunk-KHQDWYCG.js +0 -82
- package/dist/bundle/chunk-KYRYD4CR.js +0 -38
- package/dist/bundle/chunk-LBGT6W4R.js +0 -377
- package/dist/bundle/chunk-LN7HRYTH.js +0 -80
- package/dist/bundle/chunk-MEB7HBTM.js +0 -95
- package/dist/bundle/chunk-MEEFWYX3.js +0 -388
- package/dist/bundle/chunk-MNOAMJ6H.js +0 -94
- package/dist/bundle/chunk-MYHPXJDG.js +0 -142
- package/dist/bundle/chunk-NGI37RFW.js +0 -692
- package/dist/bundle/chunk-NZMWD7Y3.js +0 -68149
- package/dist/bundle/chunk-O6IECJRM.js +0 -54
- package/dist/bundle/chunk-OBWL3BUV.js +0 -800
- package/dist/bundle/chunk-OEEWVKJX.js +0 -53
- package/dist/bundle/chunk-OQYZ3W4K.js +0 -374
- package/dist/bundle/chunk-P3ZCTYGW.js +0 -101
- package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
- package/dist/bundle/chunk-PVEBAHFU.js +0 -100
- package/dist/bundle/chunk-R2B6PUVI.js +0 -206
- package/dist/bundle/chunk-RLOH7RDN.js +0 -362
- package/dist/bundle/chunk-RQ4AXSCJ.js +0 -616
- package/dist/bundle/chunk-RYGTCRFZ.js +0 -140
- package/dist/bundle/chunk-S4PXWIE4.js +0 -408
- package/dist/bundle/chunk-SDZZYZLL.js +0 -58
- package/dist/bundle/chunk-SHQAYUK6.js +0 -1199
- package/dist/bundle/chunk-T3W4V4A6.js +0 -63
- package/dist/bundle/chunk-TCT5D2X2.js +0 -6848
- package/dist/bundle/chunk-TDWPOSPR.js +0 -198
- package/dist/bundle/chunk-TER3N27H.js +0 -353
- package/dist/bundle/chunk-TMTNP7QN.js +0 -214
- package/dist/bundle/chunk-TO5UEWXR.js +0 -288
- package/dist/bundle/chunk-TXDR6YSF.js +0 -23
- package/dist/bundle/chunk-TY7NDMFY.js +0 -46
- package/dist/bundle/chunk-UAWSINMC.js +0 -875
- package/dist/bundle/chunk-UBH7YF3C.js +0 -9354
- package/dist/bundle/chunk-UEAE3JUU.js +0 -46576
- package/dist/bundle/chunk-UHR363OD.js +0 -357
- package/dist/bundle/chunk-UM52A76S.js +0 -259
- package/dist/bundle/chunk-URP6BTHN.js +0 -624
- package/dist/bundle/chunk-UWQEAA6S.js +0 -13
- package/dist/bundle/chunk-VR7QZGRU.js +0 -185
- package/dist/bundle/chunk-VRH5PBSL.js +0 -755
- package/dist/bundle/chunk-VTLQTQKY.js +0 -1756
- package/dist/bundle/chunk-VTYNLTDW.js +0 -331
- package/dist/bundle/chunk-WY7XG6TE.js +0 -76
- package/dist/bundle/chunk-XH23ML2V.js +0 -195
- package/dist/bundle/chunk-XYF76A26.js +0 -27556
- package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
- package/dist/bundle/chunk-ZDYJAEVB.js +0 -84
- package/dist/bundle/chunk-ZJ63HDBT.js +0 -71
- package/dist/bundle/chunk-ZT4ZPUIO.js +0 -218
- package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
- package/dist/bundle/cli-JK6PQSSN.js +0 -1270
- package/dist/bundle/command-contract-F3QNBKPX.js +0 -46
- package/dist/bundle/command-server-entry-DJLGN62J.js +0 -176
- package/dist/bundle/config-TYYMV3HV.js +0 -118
- package/dist/bundle/decode-ZZICNNFF.js +0 -31
- package/dist/bundle/dispatch-FKMIPCPQ.js +0 -412
- package/dist/bundle/dist-NQPF25XI.js +0 -322
- package/dist/bundle/dist-PAKDDIBT.js +0 -191
- package/dist/bundle/dist-XUFQCJXW.js +0 -7577
- package/dist/bundle/echarts-QMAA7HH5.js +0 -42501
- package/dist/bundle/embed-T64EUKUI.js +0 -38
- package/dist/bundle/embedder-ZEKISZXI.js +0 -111
- package/dist/bundle/failure-XTWBYI2A.js +0 -25
- package/dist/bundle/first-run-ZFNY4RRH.js +0 -29
- package/dist/bundle/first-screen-LPGCHRHZ.js +0 -47
- package/dist/bundle/instructions-4H7UREH2.js +0 -11
- package/dist/bundle/mcp-5HFPWC3W.js +0 -167
- package/dist/bundle/meeting-combined-7HDPOUPB.js +0 -28
- package/dist/bundle/meeting-model-MVUW7UPQ.js +0 -26
- package/dist/bundle/meeting-semantic-IF633WGX.js +0 -23
- package/dist/bundle/meetings-RY2AAPHV.js +0 -332
- package/dist/bundle/node-KM3CUABH.js +0 -2340
- package/dist/bundle/node-P3PUHKYH.js +0 -176
- package/dist/bundle/node-TLZSIHIJ.js +0 -21
- package/dist/bundle/node-sqlite-ASAZJNHE.js +0 -74
- package/dist/bundle/oauth-4U3OCK3W.js +0 -20
- package/dist/bundle/oauth-AJARLPSY.js +0 -46
- package/dist/bundle/open-SEJRY2ZI.js +0 -23
- package/dist/bundle/openai-FZDSC2AA.js +0 -28
- package/dist/bundle/process-AFIXYXWL.js +0 -91
- package/dist/bundle/prompt-BCRD64F4.js +0 -17
- package/dist/bundle/public-SVJILCNI.js +0 -206
- package/dist/bundle/recognize-25ITJWGX.js +0 -26
- package/dist/bundle/remote-5FBAJX7O.js +0 -32
- package/dist/bundle/rerank-2HGWWORY.js +0 -52
- package/dist/bundle/run-log-7HRF4Y47.js +0 -145
- package/dist/bundle/serve-RL35MSJD.js +0 -199
- package/dist/bundle/server-QUSBWACP.js +0 -229
- package/dist/bundle/server-SCK2SRDK.js +0 -96
- package/dist/bundle/services-BGRIQNDC.js +0 -609
- package/dist/bundle/speech-4W3ZMTFK.js +0 -89
- package/dist/bundle/sqlite-runtime-K3KLRZCV.js +0 -20
- package/dist/bundle/state-GYL4C74G.js +0 -36
- package/dist/bundle/store-27UQMNEO.js +0 -189
- package/dist/bundle/store-NLYH5SQX.js +0 -316
- package/dist/bundle/store-connection-CZILWRSR.js +0 -112
- package/dist/bundle/store-maintenance-command-Z3QLNSXJ.js +0 -84
- package/dist/bundle/streaming-73EKEGPF.js +0 -18
- package/dist/bundle/surface-CV3C4RV2.js +0 -82
- package/dist/bundle/tokens-PY3S22LY.js +0 -27
- /package/dist/bundle/{chunk-7ECP5ZQR.js → chunk-7O7XM37N.js} +0 -0
|
@@ -1,2338 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
validateFormattedText
|
|
5
|
-
} from "./chunk-NGI37RFW.js";
|
|
6
|
-
import {
|
|
7
|
-
inputPolicy
|
|
8
|
-
} from "./chunk-KHQDWYCG.js";
|
|
9
|
-
import {
|
|
10
|
-
RECORDS_SCHEMA_VERSION,
|
|
11
|
-
RECORD_TYPES,
|
|
12
|
-
pointerOf
|
|
13
|
-
} from "./chunk-DQJECJUE.js";
|
|
14
|
-
import {
|
|
15
|
-
indent
|
|
16
|
-
} from "./chunk-3QN5KDFZ.js";
|
|
17
|
-
import {
|
|
18
|
-
CliError
|
|
19
|
-
} from "./chunk-IANKXHSE.js";
|
|
20
|
-
import {
|
|
21
|
-
__name
|
|
22
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
23
|
-
|
|
24
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/checks.js
|
|
25
|
-
var spelled = /* @__PURE__ */ __name((check, args) => `${check.replaceAll(".", " ")}${args === void 0 ? "" : ` ${args}`}`, "spelled");
|
|
26
|
-
var bareCheck = /* @__PURE__ */ __name((check, args) => `\`${spelled(check, args)}\``, "bareCheck");
|
|
27
|
-
var checkWords = /* @__PURE__ */ __name((command, profile) => (check, args) => `\`${command} ${profile === void 0 ? "" : `${profile} `}${spelled(check, args)}\``, "checkWords");
|
|
28
|
-
|
|
29
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/markdown.js
|
|
30
|
-
var MARKERS = [
|
|
31
|
-
["**", "bold"],
|
|
32
|
-
["~~", "strike"],
|
|
33
|
-
["`", "code"],
|
|
34
|
-
["_", "italic"],
|
|
35
|
-
["*", "italic"]
|
|
36
|
-
];
|
|
37
|
-
var WORD = /[\p{L}\p{N}]/u;
|
|
38
|
-
var parseMarkdown = /* @__PURE__ */ __name((input) => {
|
|
39
|
-
let text = "";
|
|
40
|
-
const markup = [];
|
|
41
|
-
let index = 0;
|
|
42
|
-
while (index < input.length) {
|
|
43
|
-
const char = input[index];
|
|
44
|
-
if (char === "\\" && index + 1 < input.length) {
|
|
45
|
-
text += input[index + 1];
|
|
46
|
-
index += 2;
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
const found = MARKERS.find(([marker]) => input.startsWith(marker, index));
|
|
50
|
-
const span = found && closing(input, index, found[0]);
|
|
51
|
-
if (found && span !== void 0) {
|
|
52
|
-
const inner = input.slice(index + found[0].length, span);
|
|
53
|
-
markup.push({ type: found[1], from: text.length, length: inner.length });
|
|
54
|
-
text += inner;
|
|
55
|
-
index = span + found[0].length;
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
text += char;
|
|
59
|
-
index += 1;
|
|
60
|
-
}
|
|
61
|
-
return { text, markup };
|
|
62
|
-
}, "parseMarkdown");
|
|
63
|
-
var closing = /* @__PURE__ */ __name((input, open, marker) => {
|
|
64
|
-
const start = open + marker.length;
|
|
65
|
-
const end = input.indexOf(marker, start);
|
|
66
|
-
if (end <= start || input.slice(start, end).includes("\n"))
|
|
67
|
-
return void 0;
|
|
68
|
-
if (marker === "_" || marker === "*") {
|
|
69
|
-
if (WORD.test(input[open - 1] ?? "") || WORD.test(input[end + 1] ?? ""))
|
|
70
|
-
return void 0;
|
|
71
|
-
}
|
|
72
|
-
return end;
|
|
73
|
-
}, "closing");
|
|
74
|
-
|
|
75
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/markdown-spans.js
|
|
76
|
-
var STYLES = [
|
|
77
|
-
["**", "bold"],
|
|
78
|
-
["__", "underline"],
|
|
79
|
-
["~~", "strike"],
|
|
80
|
-
["||", "spoiler"],
|
|
81
|
-
["*", "bold"],
|
|
82
|
-
["_", "italic"],
|
|
83
|
-
["~", "strike"]
|
|
84
|
-
];
|
|
85
|
-
var WORD2 = /[\p{L}\p{N}]/u;
|
|
86
|
-
var before = /* @__PURE__ */ __name((input, at) => {
|
|
87
|
-
const code = input.charCodeAt(at - 1);
|
|
88
|
-
return code >= 56320 && code <= 57343 ? input.slice(at - 2, at) : input[at - 1] ?? "";
|
|
89
|
-
}, "before");
|
|
90
|
-
var after = /* @__PURE__ */ __name((input, at) => String.fromCodePoint(input.codePointAt(at) ?? 0), "after");
|
|
91
|
-
var fail = /* @__PURE__ */ __name((message) => {
|
|
92
|
-
throw new CliError("validation_error", message);
|
|
93
|
-
}, "fail");
|
|
94
|
-
var balanced = /* @__PURE__ */ __name((input, start, open, close) => {
|
|
95
|
-
let depth = 1;
|
|
96
|
-
for (let at = start + 1; at < input.length; at++) {
|
|
97
|
-
if (input[at] === "\\") {
|
|
98
|
-
at++;
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
if (input[at] === open) {
|
|
102
|
-
if (++depth > 32)
|
|
103
|
-
fail("Markdown nesting exceeds 32 levels");
|
|
104
|
-
}
|
|
105
|
-
if (input[at] === close && --depth === 0)
|
|
106
|
-
return at;
|
|
107
|
-
}
|
|
108
|
-
return void 0;
|
|
109
|
-
}, "balanced");
|
|
110
|
-
var parse = /* @__PURE__ */ __name((input, depth = 0) => {
|
|
111
|
-
if (depth > 32)
|
|
112
|
-
fail("Markdown nesting exceeds 32 levels");
|
|
113
|
-
let text = "", at = 0;
|
|
114
|
-
const spans = [];
|
|
115
|
-
const links = input.includes("](");
|
|
116
|
-
const append = /* @__PURE__ */ __name((part, type, extra = {}) => {
|
|
117
|
-
const from = text.length;
|
|
118
|
-
text += part.text;
|
|
119
|
-
for (const span of part.spans)
|
|
120
|
-
spans.push({ ...span, from: from + span.from });
|
|
121
|
-
if (type && part.text.length > 0)
|
|
122
|
-
spans.push({ type, from, length: part.text.length, ...extra });
|
|
123
|
-
if (spans.length > 100)
|
|
124
|
-
fail("Markdown has more than 100 formatting spans");
|
|
125
|
-
}, "append");
|
|
126
|
-
while (at < input.length) {
|
|
127
|
-
const lineStart = at === 0 || input[at - 1] === "\n";
|
|
128
|
-
if (lineStart && input.startsWith("```", at)) {
|
|
129
|
-
const opening = /^```([\w.+#-]*)[ \t]*\r?\n/u.exec(input.slice(at));
|
|
130
|
-
const inline = opening ? null : /^```([^`\r\n]+)```/u.exec(input.slice(at));
|
|
131
|
-
if (inline) {
|
|
132
|
-
append({ text: inline[1] ?? "", spans: [] }, "pre", { language: "" });
|
|
133
|
-
at += inline[0].length;
|
|
134
|
-
continue;
|
|
135
|
-
}
|
|
136
|
-
if (!opening)
|
|
137
|
-
throw new CliError("validation_error", "a Markdown code fence needs a newline and an optional language token");
|
|
138
|
-
if (opening) {
|
|
139
|
-
const bodyStart = at + opening[0].length;
|
|
140
|
-
const closing2 = /^(?:```)[ \t]*(?:\r?\n|$)/gmu;
|
|
141
|
-
closing2.lastIndex = bodyStart;
|
|
142
|
-
const end = closing2.exec(input);
|
|
143
|
-
if (!end)
|
|
144
|
-
throw new CliError("validation_error", "a Markdown code fence needs a closing fence");
|
|
145
|
-
append({ text: input.slice(bodyStart, end.index), spans: [] }, "pre", { language: opening[1] ?? "" });
|
|
146
|
-
at = end.index + end[0].length;
|
|
147
|
-
continue;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
if (lineStart && /^>(?: |\r?\n|$)/u.test(input.slice(at))) {
|
|
151
|
-
const quoted = [];
|
|
152
|
-
let trailing = "";
|
|
153
|
-
while (at < input.length && /^>(?: |\r?\n|$)/u.test(input.slice(at))) {
|
|
154
|
-
const end = input.indexOf("\n", at);
|
|
155
|
-
const lineEnd = end === -1 ? input.length : end;
|
|
156
|
-
const line = input.slice(at, lineEnd);
|
|
157
|
-
quoted.push(line.replace(/^> ?/u, ""));
|
|
158
|
-
at = end === -1 ? input.length : end + 1;
|
|
159
|
-
trailing = end === -1 ? "" : "\n";
|
|
160
|
-
}
|
|
161
|
-
append(parse(quoted.join("\n"), depth + 1), "blockquote");
|
|
162
|
-
text += trailing;
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
|
-
if (lineStart) {
|
|
166
|
-
const heading = /^#{1,6} +([^\r\n]*)(\r?\n|$)/u.exec(input.slice(at));
|
|
167
|
-
if (heading) {
|
|
168
|
-
append(parse(heading[1] ?? "", depth + 1), "heading");
|
|
169
|
-
text += heading[2] ?? "";
|
|
170
|
-
at += heading[0].length;
|
|
171
|
-
continue;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
if (input[at] === "\\" && at + 1 < input.length) {
|
|
175
|
-
text += input[at + 1];
|
|
176
|
-
at += 2;
|
|
177
|
-
continue;
|
|
178
|
-
}
|
|
179
|
-
if (links && input[at] === "[") {
|
|
180
|
-
const labelEnd = balanced(input, at, "[", "]");
|
|
181
|
-
if (labelEnd !== void 0 && input[labelEnd + 1] === "(") {
|
|
182
|
-
const urlEnd = balanced(input, labelEnd + 1, "(", ")");
|
|
183
|
-
if (urlEnd !== void 0) {
|
|
184
|
-
const url = input.slice(labelEnd + 2, urlEnd).replace(/\\([\\()])/gu, "$1");
|
|
185
|
-
append(parse(input.slice(at + 1, labelEnd), depth + 1), "link", { url });
|
|
186
|
-
at = urlEnd + 1;
|
|
187
|
-
continue;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
if (input[at] === "`" && !input.startsWith("```", at)) {
|
|
192
|
-
const end = input.indexOf("`", at + 1);
|
|
193
|
-
if (end > at + 1) {
|
|
194
|
-
const content = input.slice(at + 1, end);
|
|
195
|
-
if (!content.includes("\n") && !content.includes("\r")) {
|
|
196
|
-
append({ text: content, spans: [] }, "code");
|
|
197
|
-
at = end + 1;
|
|
198
|
-
continue;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
const style = STYLES.find(([marker]) => input.startsWith(marker, at));
|
|
203
|
-
if (style) {
|
|
204
|
-
const [marker, type] = style;
|
|
205
|
-
let end = input.indexOf(marker, at + marker.length);
|
|
206
|
-
while (end !== -1 && (() => {
|
|
207
|
-
let escapes = 0;
|
|
208
|
-
for (let i = end - 1; i >= 0 && input[i] === "\\"; i--)
|
|
209
|
-
escapes++;
|
|
210
|
-
return escapes % 2 === 1;
|
|
211
|
-
})())
|
|
212
|
-
end = input.indexOf(marker, end + marker.length);
|
|
213
|
-
const edge = marker !== "_" && marker !== "*" || !WORD2.test(before(input, at)) && !WORD2.test(after(input, end + marker.length));
|
|
214
|
-
if (end > at + marker.length && edge) {
|
|
215
|
-
append(parse(input.slice(at + marker.length, end), depth + 1), type);
|
|
216
|
-
at = end + marker.length;
|
|
217
|
-
continue;
|
|
218
|
-
}
|
|
219
|
-
text += marker;
|
|
220
|
-
at += marker.length;
|
|
221
|
-
continue;
|
|
222
|
-
}
|
|
223
|
-
text += input[at];
|
|
224
|
-
at++;
|
|
225
|
-
}
|
|
226
|
-
return { text, spans };
|
|
227
|
-
}, "parse");
|
|
228
|
-
var parseMarkdownSpans = /* @__PURE__ */ __name((input) => {
|
|
229
|
-
const result = parse(input);
|
|
230
|
-
const block = /* @__PURE__ */ __name((span) => span.type === "blockquote" || span.type === "heading" ? 0 : 1, "block");
|
|
231
|
-
result.spans.sort((a, b) => a.from - b.from || b.length - a.length || block(a) - block(b) || a.type.localeCompare(b.type));
|
|
232
|
-
return validateFormattedText(result);
|
|
233
|
-
}, "parseMarkdownSpans");
|
|
234
|
-
|
|
235
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/polls.js
|
|
236
|
-
var countedPoll = /* @__PURE__ */ __name((poll, votes, self) => {
|
|
237
|
-
const cast = votes.filter((vote) => vote.answers.length > 0);
|
|
238
|
-
const mine = self === null ? void 0 : votes.find((vote) => vote.person.id === self);
|
|
239
|
-
return {
|
|
240
|
-
...poll,
|
|
241
|
-
answers: poll.answers.map((answer) => ({
|
|
242
|
-
...answer,
|
|
243
|
-
voters: cast.filter((vote) => vote.answers.includes(answer.id)).length,
|
|
244
|
-
chosen: mine ? mine.answers.includes(answer.id) : answer.chosen
|
|
245
|
-
})),
|
|
246
|
-
voters: cast.length
|
|
247
|
-
};
|
|
248
|
-
}, "countedPoll");
|
|
249
|
-
|
|
250
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/records-table.js
|
|
251
|
-
var TABLE_RECORD_TYPES = Object.keys(RECORD_TYPES).filter((type) => RECORD_TYPES[type].sheet !== false);
|
|
252
|
-
var TableError = class extends Error {
|
|
253
|
-
static {
|
|
254
|
-
__name(this, "TableError");
|
|
255
|
-
}
|
|
256
|
-
errors;
|
|
257
|
-
constructor(errors) {
|
|
258
|
-
super(errors.map((e) => e.message).join("; "));
|
|
259
|
-
this.errors = errors;
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
var LIST_SEPARATOR = "|";
|
|
263
|
-
var BOM = "\uFEFF";
|
|
264
|
-
var specOf = /* @__PURE__ */ __name((type) => RECORD_TYPES[type], "specOf");
|
|
265
|
-
var typesOf = /* @__PURE__ */ __name((schema) => schema.type === void 0 ? [] : typeof schema.type === "string" ? [schema.type] : [...schema.type], "typesOf");
|
|
266
|
-
var shapeOf = /* @__PURE__ */ __name((schema) => {
|
|
267
|
-
const types = typesOf(schema);
|
|
268
|
-
if (types.includes("integer"))
|
|
269
|
-
return "integer";
|
|
270
|
-
if (types.includes("boolean"))
|
|
271
|
-
return "boolean";
|
|
272
|
-
if (types.includes("array"))
|
|
273
|
-
return "list";
|
|
274
|
-
if (schema.pattern?.includes("T[0-9]{2}"))
|
|
275
|
-
return "instant";
|
|
276
|
-
if (schema.pattern?.startsWith("^[0-9]{4}-"))
|
|
277
|
-
return "day";
|
|
278
|
-
if (schema.pattern?.includes("[A-Za-z]{3}"))
|
|
279
|
-
return "currency";
|
|
280
|
-
if (schema.pattern?.includes("(\\.[0-9]"))
|
|
281
|
-
return "decimal";
|
|
282
|
-
return "text";
|
|
283
|
-
}, "shapeOf");
|
|
284
|
-
var valuesOf = /* @__PURE__ */ __name((schema) => schema.enum?.filter((v) => v !== null), "valuesOf");
|
|
285
|
-
var flat = /* @__PURE__ */ __name((schema) => {
|
|
286
|
-
const types = typesOf(schema);
|
|
287
|
-
return !types.includes("object") && !(types.includes("array") && schema.items?.type === "object");
|
|
288
|
-
}, "flat");
|
|
289
|
-
var fieldColumn = /* @__PURE__ */ __name((name, schema, required, kind) => {
|
|
290
|
-
const values = valuesOf(schema);
|
|
291
|
-
const shape = shapeOf(schema);
|
|
292
|
-
return {
|
|
293
|
-
name,
|
|
294
|
-
kind,
|
|
295
|
-
required,
|
|
296
|
-
shape,
|
|
297
|
-
description: schema.description ?? "",
|
|
298
|
-
...values ? { values } : {},
|
|
299
|
-
...shape === "list" ? { many: true } : {}
|
|
300
|
-
};
|
|
301
|
-
}, "fieldColumn");
|
|
302
|
-
var roleColumn = /* @__PURE__ */ __name((name, role) => ({
|
|
303
|
-
name,
|
|
304
|
-
kind: "role",
|
|
305
|
-
required: role.required === true,
|
|
306
|
-
shape: "text",
|
|
307
|
-
description: role.targets.length === 1 ? `The ${role.targets[0]}'s external id` : `<type>:<external id>, the type one of ${role.targets.join(", ")}`,
|
|
308
|
-
targets: role.targets,
|
|
309
|
-
...role.many ? { many: true } : {}
|
|
310
|
-
}), "roleColumn");
|
|
311
|
-
var recordColumns = /* @__PURE__ */ __name((type) => {
|
|
312
|
-
const spec = specOf(type);
|
|
313
|
-
if (!spec || spec.sheet === false)
|
|
314
|
-
return [];
|
|
315
|
-
const fields = spec.fields.properties ?? {};
|
|
316
|
-
const required = spec.fields.required ?? [];
|
|
317
|
-
const lists = Object.entries(fields).filter(([, schema]) => !flat(schema));
|
|
318
|
-
return [
|
|
319
|
-
{ name: "external_id", kind: "id", required: true, shape: "text", description: "Its id in your system" },
|
|
320
|
-
...Object.entries(fields).filter(([, schema]) => flat(schema)).map(([name, schema]) => fieldColumn(name, schema, required.includes(name), "field")),
|
|
321
|
-
...Object.entries(spec.roles).filter(([, role]) => !role.linked).map(([name, role]) => roleColumn(name, role)),
|
|
322
|
-
...lists.flatMap(([list, schema]) => {
|
|
323
|
-
const item = schema.items ?? {};
|
|
324
|
-
const own = item.required ?? [];
|
|
325
|
-
return Object.entries(item.properties ?? {}).map(([key, s]) => fieldColumn(`${list}.${key}`, s, required.includes(list) && own.includes(key), "item"));
|
|
326
|
-
})
|
|
327
|
-
];
|
|
328
|
-
}, "recordColumns");
|
|
329
|
-
var csvCell = /* @__PURE__ */ __name((value, separator) => /["\r\n]/.test(value) || value.includes(separator) ? `"${value.replaceAll('"', '""')}"` : value, "csvCell");
|
|
330
|
-
var example = /* @__PURE__ */ __name((column) => {
|
|
331
|
-
if (column.values?.[0])
|
|
332
|
-
return column.values[0];
|
|
333
|
-
switch (column.shape) {
|
|
334
|
-
case "decimal":
|
|
335
|
-
return "100.00";
|
|
336
|
-
case "day":
|
|
337
|
-
return "2026-01-31";
|
|
338
|
-
case "instant":
|
|
339
|
-
return "2026-01-31T09:00:00Z";
|
|
340
|
-
case "currency":
|
|
341
|
-
return "EUR";
|
|
342
|
-
case "integer":
|
|
343
|
-
return 1;
|
|
344
|
-
case "boolean":
|
|
345
|
-
return true;
|
|
346
|
-
case "list":
|
|
347
|
-
return ["\u2026"];
|
|
348
|
-
default:
|
|
349
|
-
return column.description || "\u2026";
|
|
350
|
-
}
|
|
351
|
-
}, "example");
|
|
352
|
-
var exampleRef = /* @__PURE__ */ __name((column) => ({
|
|
353
|
-
role: column.name,
|
|
354
|
-
type: column.targets?.[0] ?? "",
|
|
355
|
-
external_id: `${column.targets?.[0] ?? "record"}-1`
|
|
356
|
-
}), "exampleRef");
|
|
357
|
-
var recordTemplate = /* @__PURE__ */ __name((type, format, { source, separator = "," } = {}) => {
|
|
358
|
-
const columns = recordColumns(type);
|
|
359
|
-
if (columns.length === 0)
|
|
360
|
-
throw new TableError([unknownType(type)]);
|
|
361
|
-
if (format === "csv")
|
|
362
|
-
return `${BOM}${columns.map((c) => csvCell(c.name, separator)).join(separator)}\r
|
|
363
|
-
`;
|
|
364
|
-
const fields = {};
|
|
365
|
-
for (const c of columns.filter((c2) => c2.kind === "field"))
|
|
366
|
-
fields[c.name] = example(c);
|
|
367
|
-
for (const c of columns.filter((c2) => c2.kind === "item")) {
|
|
368
|
-
const [list = "", key = ""] = c.name.split(".");
|
|
369
|
-
fields[list] ??= [{}];
|
|
370
|
-
const [first] = fields[list];
|
|
371
|
-
if (first)
|
|
372
|
-
first[key] = example(c);
|
|
373
|
-
}
|
|
374
|
-
const envelope = {
|
|
375
|
-
schema_version: RECORDS_SCHEMA_VERSION,
|
|
376
|
-
source: {
|
|
377
|
-
// An import-only type is refused under a sheet's provider: `import` is the one any folder or export may use.
|
|
378
|
-
provider: source?.provider ?? (specOf(type)?.importOnly ? "import" : "sheet"),
|
|
379
|
-
account: source?.account ?? "main",
|
|
380
|
-
batch_id: source?.batch_id ?? "first-import"
|
|
381
|
-
},
|
|
382
|
-
records: [
|
|
383
|
-
{
|
|
384
|
-
key: `${type}-1`,
|
|
385
|
-
type,
|
|
386
|
-
external_id: `${type}-1`,
|
|
387
|
-
operation: "upsert",
|
|
388
|
-
fields,
|
|
389
|
-
relations: columns.filter((c) => c.kind === "role").map(exampleRef)
|
|
390
|
-
}
|
|
391
|
-
]
|
|
392
|
-
};
|
|
393
|
-
return `${JSON.stringify(envelope, null, 2)}
|
|
394
|
-
`;
|
|
395
|
-
}, "recordTemplate");
|
|
396
|
-
var csvRows = /* @__PURE__ */ __name((text, separator) => {
|
|
397
|
-
const rows = [];
|
|
398
|
-
let cells = [];
|
|
399
|
-
let cell = "";
|
|
400
|
-
let quoted = false;
|
|
401
|
-
let line = 1;
|
|
402
|
-
let start = 1;
|
|
403
|
-
const end = /* @__PURE__ */ __name(() => {
|
|
404
|
-
cells.push(cell);
|
|
405
|
-
cell = "";
|
|
406
|
-
}, "end");
|
|
407
|
-
for (let i = 0; i < text.length; i++) {
|
|
408
|
-
const c = text[i];
|
|
409
|
-
if (quoted) {
|
|
410
|
-
if (c === '"' && text[i + 1] === '"') {
|
|
411
|
-
cell += '"';
|
|
412
|
-
i++;
|
|
413
|
-
} else if (c === '"')
|
|
414
|
-
quoted = false;
|
|
415
|
-
else {
|
|
416
|
-
if (c === "\n")
|
|
417
|
-
line++;
|
|
418
|
-
cell += c;
|
|
419
|
-
}
|
|
420
|
-
} else if (c === '"' && cell === "")
|
|
421
|
-
quoted = true;
|
|
422
|
-
else if (c === separator)
|
|
423
|
-
end();
|
|
424
|
-
else if (c === "\n" || c === "\r") {
|
|
425
|
-
if (c === "\r" && text[i + 1] === "\n")
|
|
426
|
-
i++;
|
|
427
|
-
end();
|
|
428
|
-
rows.push({ cells, line: start });
|
|
429
|
-
cells = [];
|
|
430
|
-
line++;
|
|
431
|
-
start = line;
|
|
432
|
-
} else
|
|
433
|
-
cell += c;
|
|
434
|
-
}
|
|
435
|
-
if (cell !== "" || cells.length > 0) {
|
|
436
|
-
end();
|
|
437
|
-
rows.push({ cells, line: start });
|
|
438
|
-
}
|
|
439
|
-
return rows.filter((r) => r.cells.some((c) => c.trim() !== ""));
|
|
440
|
-
}, "csvRows");
|
|
441
|
-
var csvSeparator = /* @__PURE__ */ __name((header) => {
|
|
442
|
-
const count = /* @__PURE__ */ __name((s) => header.split(s).length - 1, "count");
|
|
443
|
-
return [";", " ", ","].reduce((best, s) => count(s) > count(best) ? s : best, ",");
|
|
444
|
-
}, "csvSeparator");
|
|
445
|
-
var DAY_DOTTED = /^(\d{1,2})[./](\d{1,2})[./](\d{4})$/;
|
|
446
|
-
var normalized = /* @__PURE__ */ __name((column, raw) => {
|
|
447
|
-
const value = raw.trim();
|
|
448
|
-
switch (column.shape) {
|
|
449
|
-
case "decimal": {
|
|
450
|
-
const plain = value.replace(/[\s ]/g, "");
|
|
451
|
-
return /^\d+,\d+$/.test(plain) ? plain.replace(",", ".") : plain;
|
|
452
|
-
}
|
|
453
|
-
case "day": {
|
|
454
|
-
const dotted = DAY_DOTTED.exec(value);
|
|
455
|
-
return dotted ? `${dotted[3]}-${dotted[2]?.padStart(2, "0")}-${dotted[1]?.padStart(2, "0")}` : value;
|
|
456
|
-
}
|
|
457
|
-
case "currency":
|
|
458
|
-
return value.toUpperCase();
|
|
459
|
-
case "integer":
|
|
460
|
-
return /^-?\d+$/.test(value) ? Number(value) : value;
|
|
461
|
-
case "boolean":
|
|
462
|
-
return /^(true|yes|1|да|sí|si)$/i.test(value) ? true : /^(false|no|0|нет)$/i.test(value) ? false : value;
|
|
463
|
-
case "list":
|
|
464
|
-
return value.split(LIST_SEPARATOR).map((v) => v.trim()).filter(Boolean);
|
|
465
|
-
default:
|
|
466
|
-
return column.many ? value.split(LIST_SEPARATOR).map((v) => v.trim()).filter(Boolean) : value;
|
|
467
|
-
}
|
|
468
|
-
}, "normalized");
|
|
469
|
-
var unknownType = /* @__PURE__ */ __name((type) => ({
|
|
470
|
-
pointer: "",
|
|
471
|
-
code: "record.type",
|
|
472
|
-
message: `no table for ${type}: use one of ${TABLE_RECORD_TYPES.join(", ")}`
|
|
473
|
-
}), "unknownType");
|
|
474
|
-
var relationsOf = /* @__PURE__ */ __name((column, raw) => {
|
|
475
|
-
const targets = column.targets ?? [];
|
|
476
|
-
const values = column.many ? raw.split(LIST_SEPARATOR) : [raw];
|
|
477
|
-
const out = [];
|
|
478
|
-
for (const value of values.map((v) => v.trim()).filter(Boolean)) {
|
|
479
|
-
const at = value.indexOf(":");
|
|
480
|
-
const named = at > 0 ? value.slice(0, at) : "";
|
|
481
|
-
if (targets.length === 1 && !targets.includes(named)) {
|
|
482
|
-
out.push({ role: column.name, type: targets[0], external_id: value });
|
|
483
|
-
continue;
|
|
484
|
-
}
|
|
485
|
-
if (!targets.includes(named) || at === value.length - 1)
|
|
486
|
-
return {
|
|
487
|
-
pointer: "",
|
|
488
|
-
code: "record.invalid",
|
|
489
|
-
message: `${column.name} takes <type>:<external id>, the type one of ${targets.join(", ")}: not ${value}`
|
|
490
|
-
};
|
|
491
|
-
out.push({ role: column.name, type: named, external_id: value.slice(at + 1) });
|
|
492
|
-
}
|
|
493
|
-
return out;
|
|
494
|
-
}, "relationsOf");
|
|
495
|
-
var envelopeOfCsv = /* @__PURE__ */ __name((text, { type, source, options }) => {
|
|
496
|
-
const columns = recordColumns(type);
|
|
497
|
-
if (columns.length === 0)
|
|
498
|
-
throw new TableError([unknownType(type)]);
|
|
499
|
-
const body = text.startsWith(BOM) ? text.slice(1) : text;
|
|
500
|
-
const separator = csvSeparator(body.slice(0, body.search(/\r?\n|$/)));
|
|
501
|
-
const [head, ...rows] = csvRows(body, separator);
|
|
502
|
-
if (!head)
|
|
503
|
-
throw new TableError([{ pointer: "", code: "envelope.invalid", message: "the file has no header row" }]);
|
|
504
|
-
const byName = new Map(columns.map((c) => [c.name, c]));
|
|
505
|
-
const header = head.cells.map((name) => name.trim());
|
|
506
|
-
const unknown = header.filter((name) => name !== "" && !byName.has(name));
|
|
507
|
-
if (unknown.length > 0)
|
|
508
|
-
throw new TableError([
|
|
509
|
-
{
|
|
510
|
-
pointer: "",
|
|
511
|
-
code: "envelope.invalid",
|
|
512
|
-
message: `columns ${type} has no field for: ${unknown.join(", ")}. Download the ${type} template for the list`,
|
|
513
|
-
place: { line: 1, column: unknown[0] }
|
|
514
|
-
}
|
|
515
|
-
]);
|
|
516
|
-
if (!header.includes("external_id"))
|
|
517
|
-
throw new TableError([
|
|
518
|
-
{ pointer: "", code: "envelope.invalid", message: "the header has no external_id column", place: { line: 1 } }
|
|
519
|
-
]);
|
|
520
|
-
const records = [];
|
|
521
|
-
const indexById = /* @__PURE__ */ new Map();
|
|
522
|
-
const places = /* @__PURE__ */ new Map();
|
|
523
|
-
const errors = [];
|
|
524
|
-
for (const row of rows) {
|
|
525
|
-
const cell = /* @__PURE__ */ __name((name) => row.cells[header.indexOf(name)] ?? "", "cell");
|
|
526
|
-
const id = cell("external_id").trim();
|
|
527
|
-
if (!id) {
|
|
528
|
-
errors.push({
|
|
529
|
-
pointer: "",
|
|
530
|
-
code: "record.invalid",
|
|
531
|
-
message: "a row has no external_id",
|
|
532
|
-
place: { line: row.line, column: "external_id" }
|
|
533
|
-
});
|
|
534
|
-
continue;
|
|
535
|
-
}
|
|
536
|
-
const known = indexById.get(id);
|
|
537
|
-
const index = known ?? records.length;
|
|
538
|
-
const record = records[index] ?? {
|
|
539
|
-
key: `${type}:${id}`,
|
|
540
|
-
type,
|
|
541
|
-
external_id: id,
|
|
542
|
-
operation: "upsert",
|
|
543
|
-
fields: {},
|
|
544
|
-
relations: []
|
|
545
|
-
};
|
|
546
|
-
if (known === void 0) {
|
|
547
|
-
records.push(record);
|
|
548
|
-
indexById.set(id, index);
|
|
549
|
-
places.set(pointerOf("records", index), { line: row.line });
|
|
550
|
-
}
|
|
551
|
-
const fields = record.fields;
|
|
552
|
-
const item = {};
|
|
553
|
-
let list = "";
|
|
554
|
-
header.forEach((name, i) => {
|
|
555
|
-
const column = byName.get(name);
|
|
556
|
-
const raw = row.cells[i] ?? "";
|
|
557
|
-
if (!column || column.kind === "id" || raw.trim() === "")
|
|
558
|
-
return;
|
|
559
|
-
const at = { line: row.line, column: name };
|
|
560
|
-
if (column.kind === "field") {
|
|
561
|
-
fields[name] = normalized(column, raw);
|
|
562
|
-
places.set(pointerOf("records", index, "fields", name), at);
|
|
563
|
-
} else if (column.kind === "role") {
|
|
564
|
-
const relations = relationsOf(column, raw);
|
|
565
|
-
if (!Array.isArray(relations)) {
|
|
566
|
-
errors.push({ ...relations, pointer: pointerOf("records", index, "relations"), key: record.key, place: at });
|
|
567
|
-
return;
|
|
568
|
-
}
|
|
569
|
-
record.relations = [...(record.relations ?? []).filter((r) => r.role !== name), ...relations];
|
|
570
|
-
places.set(pointerOf("records", index, "relations"), at);
|
|
571
|
-
} else {
|
|
572
|
-
const [of = "", key = ""] = name.split(".");
|
|
573
|
-
list = of;
|
|
574
|
-
item[key] = normalized(column, raw);
|
|
575
|
-
}
|
|
576
|
-
});
|
|
577
|
-
if (list) {
|
|
578
|
-
fields[list] ??= [];
|
|
579
|
-
const items = fields[list];
|
|
580
|
-
places.set(pointerOf("records", index, "fields", list, items.length), { line: row.line });
|
|
581
|
-
items.push(item);
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
if (errors.length > 0)
|
|
585
|
-
throw new TableError(errors);
|
|
586
|
-
const envelope = {
|
|
587
|
-
schema_version: RECORDS_SCHEMA_VERSION,
|
|
588
|
-
source,
|
|
589
|
-
...options ? { options } : {},
|
|
590
|
-
records
|
|
591
|
-
};
|
|
592
|
-
return {
|
|
593
|
-
envelope,
|
|
594
|
-
placeOf(pointer) {
|
|
595
|
-
const item = /^\/records\/\d+\/fields\/([^/]+)\/\d+\/([^/]+)/.exec(pointer);
|
|
596
|
-
for (let at = pointer; at !== ""; at = at.slice(0, at.lastIndexOf("/"))) {
|
|
597
|
-
const place = places.get(at);
|
|
598
|
-
if (place)
|
|
599
|
-
return item && !place.column ? { ...place, column: `${item[1]}.${item[2]}` } : place;
|
|
600
|
-
}
|
|
601
|
-
return void 0;
|
|
602
|
-
}
|
|
603
|
-
};
|
|
604
|
-
}, "envelopeOfCsv");
|
|
605
|
-
|
|
606
|
-
// node_modules/.pnpm/qrcode-generator@2.0.4/node_modules/qrcode-generator/dist/qrcode.mjs
|
|
607
|
-
var qrcode = /* @__PURE__ */ __name(function(typeNumber, errorCorrectionLevel) {
|
|
608
|
-
const PAD0 = 236;
|
|
609
|
-
const PAD1 = 17;
|
|
610
|
-
let _typeNumber = typeNumber;
|
|
611
|
-
const _errorCorrectionLevel = QRErrorCorrectionLevel[errorCorrectionLevel];
|
|
612
|
-
let _modules = null;
|
|
613
|
-
let _moduleCount = 0;
|
|
614
|
-
let _dataCache = null;
|
|
615
|
-
const _dataList = [];
|
|
616
|
-
const _this = {};
|
|
617
|
-
const makeImpl = /* @__PURE__ */ __name(function(test, maskPattern) {
|
|
618
|
-
_moduleCount = _typeNumber * 4 + 17;
|
|
619
|
-
_modules = (function(moduleCount) {
|
|
620
|
-
const modules2 = new Array(moduleCount);
|
|
621
|
-
for (let row = 0; row < moduleCount; row += 1) {
|
|
622
|
-
modules2[row] = new Array(moduleCount);
|
|
623
|
-
for (let col = 0; col < moduleCount; col += 1) {
|
|
624
|
-
modules2[row][col] = null;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
return modules2;
|
|
628
|
-
})(_moduleCount);
|
|
629
|
-
setupPositionProbePattern(0, 0);
|
|
630
|
-
setupPositionProbePattern(_moduleCount - 7, 0);
|
|
631
|
-
setupPositionProbePattern(0, _moduleCount - 7);
|
|
632
|
-
setupPositionAdjustPattern();
|
|
633
|
-
setupTimingPattern();
|
|
634
|
-
setupTypeInfo(test, maskPattern);
|
|
635
|
-
if (_typeNumber >= 7) {
|
|
636
|
-
setupTypeNumber(test);
|
|
637
|
-
}
|
|
638
|
-
if (_dataCache == null) {
|
|
639
|
-
_dataCache = createData(_typeNumber, _errorCorrectionLevel, _dataList);
|
|
640
|
-
}
|
|
641
|
-
mapData(_dataCache, maskPattern);
|
|
642
|
-
}, "makeImpl");
|
|
643
|
-
const setupPositionProbePattern = /* @__PURE__ */ __name(function(row, col) {
|
|
644
|
-
for (let r = -1; r <= 7; r += 1) {
|
|
645
|
-
if (row + r <= -1 || _moduleCount <= row + r) continue;
|
|
646
|
-
for (let c = -1; c <= 7; c += 1) {
|
|
647
|
-
if (col + c <= -1 || _moduleCount <= col + c) continue;
|
|
648
|
-
if (0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4) {
|
|
649
|
-
_modules[row + r][col + c] = true;
|
|
650
|
-
} else {
|
|
651
|
-
_modules[row + r][col + c] = false;
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
}, "setupPositionProbePattern");
|
|
656
|
-
const getBestMaskPattern = /* @__PURE__ */ __name(function() {
|
|
657
|
-
let minLostPoint = 0;
|
|
658
|
-
let pattern = 0;
|
|
659
|
-
for (let i = 0; i < 8; i += 1) {
|
|
660
|
-
makeImpl(true, i);
|
|
661
|
-
const lostPoint = QRUtil.getLostPoint(_this);
|
|
662
|
-
if (i == 0 || minLostPoint > lostPoint) {
|
|
663
|
-
minLostPoint = lostPoint;
|
|
664
|
-
pattern = i;
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
return pattern;
|
|
668
|
-
}, "getBestMaskPattern");
|
|
669
|
-
const setupTimingPattern = /* @__PURE__ */ __name(function() {
|
|
670
|
-
for (let r = 8; r < _moduleCount - 8; r += 1) {
|
|
671
|
-
if (_modules[r][6] != null) {
|
|
672
|
-
continue;
|
|
673
|
-
}
|
|
674
|
-
_modules[r][6] = r % 2 == 0;
|
|
675
|
-
}
|
|
676
|
-
for (let c = 8; c < _moduleCount - 8; c += 1) {
|
|
677
|
-
if (_modules[6][c] != null) {
|
|
678
|
-
continue;
|
|
679
|
-
}
|
|
680
|
-
_modules[6][c] = c % 2 == 0;
|
|
681
|
-
}
|
|
682
|
-
}, "setupTimingPattern");
|
|
683
|
-
const setupPositionAdjustPattern = /* @__PURE__ */ __name(function() {
|
|
684
|
-
const pos = QRUtil.getPatternPosition(_typeNumber);
|
|
685
|
-
for (let i = 0; i < pos.length; i += 1) {
|
|
686
|
-
for (let j = 0; j < pos.length; j += 1) {
|
|
687
|
-
const row = pos[i];
|
|
688
|
-
const col = pos[j];
|
|
689
|
-
if (_modules[row][col] != null) {
|
|
690
|
-
continue;
|
|
691
|
-
}
|
|
692
|
-
for (let r = -2; r <= 2; r += 1) {
|
|
693
|
-
for (let c = -2; c <= 2; c += 1) {
|
|
694
|
-
if (r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0) {
|
|
695
|
-
_modules[row + r][col + c] = true;
|
|
696
|
-
} else {
|
|
697
|
-
_modules[row + r][col + c] = false;
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
}, "setupPositionAdjustPattern");
|
|
704
|
-
const setupTypeNumber = /* @__PURE__ */ __name(function(test) {
|
|
705
|
-
const bits = QRUtil.getBCHTypeNumber(_typeNumber);
|
|
706
|
-
for (let i = 0; i < 18; i += 1) {
|
|
707
|
-
const mod = !test && (bits >> i & 1) == 1;
|
|
708
|
-
_modules[Math.floor(i / 3)][i % 3 + _moduleCount - 8 - 3] = mod;
|
|
709
|
-
}
|
|
710
|
-
for (let i = 0; i < 18; i += 1) {
|
|
711
|
-
const mod = !test && (bits >> i & 1) == 1;
|
|
712
|
-
_modules[i % 3 + _moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
|
|
713
|
-
}
|
|
714
|
-
}, "setupTypeNumber");
|
|
715
|
-
const setupTypeInfo = /* @__PURE__ */ __name(function(test, maskPattern) {
|
|
716
|
-
const data = _errorCorrectionLevel << 3 | maskPattern;
|
|
717
|
-
const bits = QRUtil.getBCHTypeInfo(data);
|
|
718
|
-
for (let i = 0; i < 15; i += 1) {
|
|
719
|
-
const mod = !test && (bits >> i & 1) == 1;
|
|
720
|
-
if (i < 6) {
|
|
721
|
-
_modules[i][8] = mod;
|
|
722
|
-
} else if (i < 8) {
|
|
723
|
-
_modules[i + 1][8] = mod;
|
|
724
|
-
} else {
|
|
725
|
-
_modules[_moduleCount - 15 + i][8] = mod;
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
for (let i = 0; i < 15; i += 1) {
|
|
729
|
-
const mod = !test && (bits >> i & 1) == 1;
|
|
730
|
-
if (i < 8) {
|
|
731
|
-
_modules[8][_moduleCount - i - 1] = mod;
|
|
732
|
-
} else if (i < 9) {
|
|
733
|
-
_modules[8][15 - i - 1 + 1] = mod;
|
|
734
|
-
} else {
|
|
735
|
-
_modules[8][15 - i - 1] = mod;
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
_modules[_moduleCount - 8][8] = !test;
|
|
739
|
-
}, "setupTypeInfo");
|
|
740
|
-
const mapData = /* @__PURE__ */ __name(function(data, maskPattern) {
|
|
741
|
-
let inc = -1;
|
|
742
|
-
let row = _moduleCount - 1;
|
|
743
|
-
let bitIndex = 7;
|
|
744
|
-
let byteIndex = 0;
|
|
745
|
-
const maskFunc = QRUtil.getMaskFunction(maskPattern);
|
|
746
|
-
for (let col = _moduleCount - 1; col > 0; col -= 2) {
|
|
747
|
-
if (col == 6) col -= 1;
|
|
748
|
-
while (true) {
|
|
749
|
-
for (let c = 0; c < 2; c += 1) {
|
|
750
|
-
if (_modules[row][col - c] == null) {
|
|
751
|
-
let dark = false;
|
|
752
|
-
if (byteIndex < data.length) {
|
|
753
|
-
dark = (data[byteIndex] >>> bitIndex & 1) == 1;
|
|
754
|
-
}
|
|
755
|
-
const mask = maskFunc(row, col - c);
|
|
756
|
-
if (mask) {
|
|
757
|
-
dark = !dark;
|
|
758
|
-
}
|
|
759
|
-
_modules[row][col - c] = dark;
|
|
760
|
-
bitIndex -= 1;
|
|
761
|
-
if (bitIndex == -1) {
|
|
762
|
-
byteIndex += 1;
|
|
763
|
-
bitIndex = 7;
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
row += inc;
|
|
768
|
-
if (row < 0 || _moduleCount <= row) {
|
|
769
|
-
row -= inc;
|
|
770
|
-
inc = -inc;
|
|
771
|
-
break;
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
}, "mapData");
|
|
776
|
-
const createBytes = /* @__PURE__ */ __name(function(buffer, rsBlocks) {
|
|
777
|
-
let offset = 0;
|
|
778
|
-
let maxDcCount = 0;
|
|
779
|
-
let maxEcCount = 0;
|
|
780
|
-
const dcdata = new Array(rsBlocks.length);
|
|
781
|
-
const ecdata = new Array(rsBlocks.length);
|
|
782
|
-
for (let r = 0; r < rsBlocks.length; r += 1) {
|
|
783
|
-
const dcCount = rsBlocks[r].dataCount;
|
|
784
|
-
const ecCount = rsBlocks[r].totalCount - dcCount;
|
|
785
|
-
maxDcCount = Math.max(maxDcCount, dcCount);
|
|
786
|
-
maxEcCount = Math.max(maxEcCount, ecCount);
|
|
787
|
-
dcdata[r] = new Array(dcCount);
|
|
788
|
-
for (let i = 0; i < dcdata[r].length; i += 1) {
|
|
789
|
-
dcdata[r][i] = 255 & buffer.getBuffer()[i + offset];
|
|
790
|
-
}
|
|
791
|
-
offset += dcCount;
|
|
792
|
-
const rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
|
|
793
|
-
const rawPoly = qrPolynomial(dcdata[r], rsPoly.getLength() - 1);
|
|
794
|
-
const modPoly = rawPoly.mod(rsPoly);
|
|
795
|
-
ecdata[r] = new Array(rsPoly.getLength() - 1);
|
|
796
|
-
for (let i = 0; i < ecdata[r].length; i += 1) {
|
|
797
|
-
const modIndex = i + modPoly.getLength() - ecdata[r].length;
|
|
798
|
-
ecdata[r][i] = modIndex >= 0 ? modPoly.getAt(modIndex) : 0;
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
let totalCodeCount = 0;
|
|
802
|
-
for (let i = 0; i < rsBlocks.length; i += 1) {
|
|
803
|
-
totalCodeCount += rsBlocks[i].totalCount;
|
|
804
|
-
}
|
|
805
|
-
const data = new Array(totalCodeCount);
|
|
806
|
-
let index = 0;
|
|
807
|
-
for (let i = 0; i < maxDcCount; i += 1) {
|
|
808
|
-
for (let r = 0; r < rsBlocks.length; r += 1) {
|
|
809
|
-
if (i < dcdata[r].length) {
|
|
810
|
-
data[index] = dcdata[r][i];
|
|
811
|
-
index += 1;
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
for (let i = 0; i < maxEcCount; i += 1) {
|
|
816
|
-
for (let r = 0; r < rsBlocks.length; r += 1) {
|
|
817
|
-
if (i < ecdata[r].length) {
|
|
818
|
-
data[index] = ecdata[r][i];
|
|
819
|
-
index += 1;
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
return data;
|
|
824
|
-
}, "createBytes");
|
|
825
|
-
const createData = /* @__PURE__ */ __name(function(typeNumber2, errorCorrectionLevel2, dataList) {
|
|
826
|
-
const rsBlocks = QRRSBlock.getRSBlocks(typeNumber2, errorCorrectionLevel2);
|
|
827
|
-
const buffer = qrBitBuffer();
|
|
828
|
-
for (let i = 0; i < dataList.length; i += 1) {
|
|
829
|
-
const data = dataList[i];
|
|
830
|
-
buffer.put(data.getMode(), 4);
|
|
831
|
-
buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber2));
|
|
832
|
-
data.write(buffer);
|
|
833
|
-
}
|
|
834
|
-
let totalDataCount = 0;
|
|
835
|
-
for (let i = 0; i < rsBlocks.length; i += 1) {
|
|
836
|
-
totalDataCount += rsBlocks[i].dataCount;
|
|
837
|
-
}
|
|
838
|
-
if (buffer.getLengthInBits() > totalDataCount * 8) {
|
|
839
|
-
throw "code length overflow. (" + buffer.getLengthInBits() + ">" + totalDataCount * 8 + ")";
|
|
840
|
-
}
|
|
841
|
-
if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
|
|
842
|
-
buffer.put(0, 4);
|
|
843
|
-
}
|
|
844
|
-
while (buffer.getLengthInBits() % 8 != 0) {
|
|
845
|
-
buffer.putBit(false);
|
|
846
|
-
}
|
|
847
|
-
while (true) {
|
|
848
|
-
if (buffer.getLengthInBits() >= totalDataCount * 8) {
|
|
849
|
-
break;
|
|
850
|
-
}
|
|
851
|
-
buffer.put(PAD0, 8);
|
|
852
|
-
if (buffer.getLengthInBits() >= totalDataCount * 8) {
|
|
853
|
-
break;
|
|
854
|
-
}
|
|
855
|
-
buffer.put(PAD1, 8);
|
|
856
|
-
}
|
|
857
|
-
return createBytes(buffer, rsBlocks);
|
|
858
|
-
}, "createData");
|
|
859
|
-
_this.addData = function(data, mode) {
|
|
860
|
-
mode = mode || "Byte";
|
|
861
|
-
let newData = null;
|
|
862
|
-
switch (mode) {
|
|
863
|
-
case "Numeric":
|
|
864
|
-
newData = qrNumber(data);
|
|
865
|
-
break;
|
|
866
|
-
case "Alphanumeric":
|
|
867
|
-
newData = qrAlphaNum(data);
|
|
868
|
-
break;
|
|
869
|
-
case "Byte":
|
|
870
|
-
newData = qr8BitByte(data);
|
|
871
|
-
break;
|
|
872
|
-
case "Kanji":
|
|
873
|
-
newData = qrKanji(data);
|
|
874
|
-
break;
|
|
875
|
-
default:
|
|
876
|
-
throw "mode:" + mode;
|
|
877
|
-
}
|
|
878
|
-
_dataList.push(newData);
|
|
879
|
-
_dataCache = null;
|
|
880
|
-
};
|
|
881
|
-
_this.isDark = function(row, col) {
|
|
882
|
-
if (row < 0 || _moduleCount <= row || col < 0 || _moduleCount <= col) {
|
|
883
|
-
throw row + "," + col;
|
|
884
|
-
}
|
|
885
|
-
return _modules[row][col];
|
|
886
|
-
};
|
|
887
|
-
_this.getModuleCount = function() {
|
|
888
|
-
return _moduleCount;
|
|
889
|
-
};
|
|
890
|
-
_this.make = function() {
|
|
891
|
-
if (_typeNumber < 1) {
|
|
892
|
-
let typeNumber2 = 1;
|
|
893
|
-
for (; typeNumber2 < 40; typeNumber2++) {
|
|
894
|
-
const rsBlocks = QRRSBlock.getRSBlocks(typeNumber2, _errorCorrectionLevel);
|
|
895
|
-
const buffer = qrBitBuffer();
|
|
896
|
-
for (let i = 0; i < _dataList.length; i++) {
|
|
897
|
-
const data = _dataList[i];
|
|
898
|
-
buffer.put(data.getMode(), 4);
|
|
899
|
-
buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber2));
|
|
900
|
-
data.write(buffer);
|
|
901
|
-
}
|
|
902
|
-
let totalDataCount = 0;
|
|
903
|
-
for (let i = 0; i < rsBlocks.length; i++) {
|
|
904
|
-
totalDataCount += rsBlocks[i].dataCount;
|
|
905
|
-
}
|
|
906
|
-
if (buffer.getLengthInBits() <= totalDataCount * 8) {
|
|
907
|
-
break;
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
_typeNumber = typeNumber2;
|
|
911
|
-
}
|
|
912
|
-
makeImpl(false, getBestMaskPattern());
|
|
913
|
-
};
|
|
914
|
-
_this.createTableTag = function(cellSize, margin) {
|
|
915
|
-
cellSize = cellSize || 2;
|
|
916
|
-
margin = typeof margin == "undefined" ? cellSize * 4 : margin;
|
|
917
|
-
let qrHtml = "";
|
|
918
|
-
qrHtml += '<table style="';
|
|
919
|
-
qrHtml += " border-width: 0px; border-style: none;";
|
|
920
|
-
qrHtml += " border-collapse: collapse;";
|
|
921
|
-
qrHtml += " padding: 0px; margin: " + margin + "px;";
|
|
922
|
-
qrHtml += '">';
|
|
923
|
-
qrHtml += "<tbody>";
|
|
924
|
-
for (let r = 0; r < _this.getModuleCount(); r += 1) {
|
|
925
|
-
qrHtml += "<tr>";
|
|
926
|
-
for (let c = 0; c < _this.getModuleCount(); c += 1) {
|
|
927
|
-
qrHtml += '<td style="';
|
|
928
|
-
qrHtml += " border-width: 0px; border-style: none;";
|
|
929
|
-
qrHtml += " border-collapse: collapse;";
|
|
930
|
-
qrHtml += " padding: 0px; margin: 0px;";
|
|
931
|
-
qrHtml += " width: " + cellSize + "px;";
|
|
932
|
-
qrHtml += " height: " + cellSize + "px;";
|
|
933
|
-
qrHtml += " background-color: ";
|
|
934
|
-
qrHtml += _this.isDark(r, c) ? "#000000" : "#ffffff";
|
|
935
|
-
qrHtml += ";";
|
|
936
|
-
qrHtml += '"/>';
|
|
937
|
-
}
|
|
938
|
-
qrHtml += "</tr>";
|
|
939
|
-
}
|
|
940
|
-
qrHtml += "</tbody>";
|
|
941
|
-
qrHtml += "</table>";
|
|
942
|
-
return qrHtml;
|
|
943
|
-
};
|
|
944
|
-
_this.createSvgTag = function(cellSize, margin, alt, title) {
|
|
945
|
-
let opts = {};
|
|
946
|
-
if (typeof arguments[0] == "object") {
|
|
947
|
-
opts = arguments[0];
|
|
948
|
-
cellSize = opts.cellSize;
|
|
949
|
-
margin = opts.margin;
|
|
950
|
-
alt = opts.alt;
|
|
951
|
-
title = opts.title;
|
|
952
|
-
}
|
|
953
|
-
cellSize = cellSize || 2;
|
|
954
|
-
margin = typeof margin == "undefined" ? cellSize * 4 : margin;
|
|
955
|
-
alt = typeof alt === "string" ? { text: alt } : alt || {};
|
|
956
|
-
alt.text = alt.text || null;
|
|
957
|
-
alt.id = alt.text ? alt.id || "qrcode-description" : null;
|
|
958
|
-
title = typeof title === "string" ? { text: title } : title || {};
|
|
959
|
-
title.text = title.text || null;
|
|
960
|
-
title.id = title.text ? title.id || "qrcode-title" : null;
|
|
961
|
-
const size = _this.getModuleCount() * cellSize + margin * 2;
|
|
962
|
-
let c, mc, r, mr, qrSvg = "", rect;
|
|
963
|
-
rect = "l" + cellSize + ",0 0," + cellSize + " -" + cellSize + ",0 0,-" + cellSize + "z ";
|
|
964
|
-
qrSvg += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"';
|
|
965
|
-
qrSvg += !opts.scalable ? ' width="' + size + 'px" height="' + size + 'px"' : "";
|
|
966
|
-
qrSvg += ' viewBox="0 0 ' + size + " " + size + '" ';
|
|
967
|
-
qrSvg += ' preserveAspectRatio="xMinYMin meet"';
|
|
968
|
-
qrSvg += title.text || alt.text ? ' role="img" aria-labelledby="' + escapeXml([title.id, alt.id].join(" ").trim()) + '"' : "";
|
|
969
|
-
qrSvg += ">";
|
|
970
|
-
qrSvg += title.text ? '<title id="' + escapeXml(title.id) + '">' + escapeXml(title.text) + "</title>" : "";
|
|
971
|
-
qrSvg += alt.text ? '<description id="' + escapeXml(alt.id) + '">' + escapeXml(alt.text) + "</description>" : "";
|
|
972
|
-
qrSvg += '<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>';
|
|
973
|
-
qrSvg += '<path d="';
|
|
974
|
-
for (r = 0; r < _this.getModuleCount(); r += 1) {
|
|
975
|
-
mr = r * cellSize + margin;
|
|
976
|
-
for (c = 0; c < _this.getModuleCount(); c += 1) {
|
|
977
|
-
if (_this.isDark(r, c)) {
|
|
978
|
-
mc = c * cellSize + margin;
|
|
979
|
-
qrSvg += "M" + mc + "," + mr + rect;
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
qrSvg += '" stroke="transparent" fill="black"/>';
|
|
984
|
-
qrSvg += "</svg>";
|
|
985
|
-
return qrSvg;
|
|
986
|
-
};
|
|
987
|
-
_this.createDataURL = function(cellSize, margin) {
|
|
988
|
-
cellSize = cellSize || 2;
|
|
989
|
-
margin = typeof margin == "undefined" ? cellSize * 4 : margin;
|
|
990
|
-
const size = _this.getModuleCount() * cellSize + margin * 2;
|
|
991
|
-
const min = margin;
|
|
992
|
-
const max = size - margin;
|
|
993
|
-
return createDataURL(size, size, function(x, y) {
|
|
994
|
-
if (min <= x && x < max && min <= y && y < max) {
|
|
995
|
-
const c = Math.floor((x - min) / cellSize);
|
|
996
|
-
const r = Math.floor((y - min) / cellSize);
|
|
997
|
-
return _this.isDark(r, c) ? 0 : 1;
|
|
998
|
-
} else {
|
|
999
|
-
return 1;
|
|
1000
|
-
}
|
|
1001
|
-
});
|
|
1002
|
-
};
|
|
1003
|
-
_this.createImgTag = function(cellSize, margin, alt) {
|
|
1004
|
-
cellSize = cellSize || 2;
|
|
1005
|
-
margin = typeof margin == "undefined" ? cellSize * 4 : margin;
|
|
1006
|
-
const size = _this.getModuleCount() * cellSize + margin * 2;
|
|
1007
|
-
let img = "";
|
|
1008
|
-
img += "<img";
|
|
1009
|
-
img += ' src="';
|
|
1010
|
-
img += _this.createDataURL(cellSize, margin);
|
|
1011
|
-
img += '"';
|
|
1012
|
-
img += ' width="';
|
|
1013
|
-
img += size;
|
|
1014
|
-
img += '"';
|
|
1015
|
-
img += ' height="';
|
|
1016
|
-
img += size;
|
|
1017
|
-
img += '"';
|
|
1018
|
-
if (alt) {
|
|
1019
|
-
img += ' alt="';
|
|
1020
|
-
img += escapeXml(alt);
|
|
1021
|
-
img += '"';
|
|
1022
|
-
}
|
|
1023
|
-
img += "/>";
|
|
1024
|
-
return img;
|
|
1025
|
-
};
|
|
1026
|
-
const escapeXml = /* @__PURE__ */ __name(function(s) {
|
|
1027
|
-
let escaped = "";
|
|
1028
|
-
for (let i = 0; i < s.length; i += 1) {
|
|
1029
|
-
const c = s.charAt(i);
|
|
1030
|
-
switch (c) {
|
|
1031
|
-
case "<":
|
|
1032
|
-
escaped += "<";
|
|
1033
|
-
break;
|
|
1034
|
-
case ">":
|
|
1035
|
-
escaped += ">";
|
|
1036
|
-
break;
|
|
1037
|
-
case "&":
|
|
1038
|
-
escaped += "&";
|
|
1039
|
-
break;
|
|
1040
|
-
case '"':
|
|
1041
|
-
escaped += """;
|
|
1042
|
-
break;
|
|
1043
|
-
default:
|
|
1044
|
-
escaped += c;
|
|
1045
|
-
break;
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
return escaped;
|
|
1049
|
-
}, "escapeXml");
|
|
1050
|
-
const _createHalfASCII = /* @__PURE__ */ __name(function(margin) {
|
|
1051
|
-
const cellSize = 1;
|
|
1052
|
-
margin = typeof margin == "undefined" ? cellSize * 2 : margin;
|
|
1053
|
-
const size = _this.getModuleCount() * cellSize + margin * 2;
|
|
1054
|
-
const min = margin;
|
|
1055
|
-
const max = size - margin;
|
|
1056
|
-
let y, x, r1, r2, p;
|
|
1057
|
-
const blocks = {
|
|
1058
|
-
"\u2588\u2588": "\u2588",
|
|
1059
|
-
"\u2588 ": "\u2580",
|
|
1060
|
-
" \u2588": "\u2584",
|
|
1061
|
-
" ": " "
|
|
1062
|
-
};
|
|
1063
|
-
const blocksLastLineNoMargin = {
|
|
1064
|
-
"\u2588\u2588": "\u2580",
|
|
1065
|
-
"\u2588 ": "\u2580",
|
|
1066
|
-
" \u2588": " ",
|
|
1067
|
-
" ": " "
|
|
1068
|
-
};
|
|
1069
|
-
let ascii = "";
|
|
1070
|
-
for (y = 0; y < size; y += 2) {
|
|
1071
|
-
r1 = Math.floor((y - min) / cellSize);
|
|
1072
|
-
r2 = Math.floor((y + 1 - min) / cellSize);
|
|
1073
|
-
for (x = 0; x < size; x += 1) {
|
|
1074
|
-
p = "\u2588";
|
|
1075
|
-
if (min <= x && x < max && min <= y && y < max && _this.isDark(r1, Math.floor((x - min) / cellSize))) {
|
|
1076
|
-
p = " ";
|
|
1077
|
-
}
|
|
1078
|
-
if (min <= x && x < max && min <= y + 1 && y + 1 < max && _this.isDark(r2, Math.floor((x - min) / cellSize))) {
|
|
1079
|
-
p += " ";
|
|
1080
|
-
} else {
|
|
1081
|
-
p += "\u2588";
|
|
1082
|
-
}
|
|
1083
|
-
ascii += margin < 1 && y + 1 >= max ? blocksLastLineNoMargin[p] : blocks[p];
|
|
1084
|
-
}
|
|
1085
|
-
ascii += "\n";
|
|
1086
|
-
}
|
|
1087
|
-
if (size % 2 && margin > 0) {
|
|
1088
|
-
return ascii.substring(0, ascii.length - size - 1) + Array(size + 1).join("\u2580");
|
|
1089
|
-
}
|
|
1090
|
-
return ascii.substring(0, ascii.length - 1);
|
|
1091
|
-
}, "_createHalfASCII");
|
|
1092
|
-
_this.createASCII = function(cellSize, margin) {
|
|
1093
|
-
cellSize = cellSize || 1;
|
|
1094
|
-
if (cellSize < 2) {
|
|
1095
|
-
return _createHalfASCII(margin);
|
|
1096
|
-
}
|
|
1097
|
-
cellSize -= 1;
|
|
1098
|
-
margin = typeof margin == "undefined" ? cellSize * 2 : margin;
|
|
1099
|
-
const size = _this.getModuleCount() * cellSize + margin * 2;
|
|
1100
|
-
const min = margin;
|
|
1101
|
-
const max = size - margin;
|
|
1102
|
-
let y, x, r, p;
|
|
1103
|
-
const white = Array(cellSize + 1).join("\u2588\u2588");
|
|
1104
|
-
const black = Array(cellSize + 1).join(" ");
|
|
1105
|
-
let ascii = "";
|
|
1106
|
-
let line = "";
|
|
1107
|
-
for (y = 0; y < size; y += 1) {
|
|
1108
|
-
r = Math.floor((y - min) / cellSize);
|
|
1109
|
-
line = "";
|
|
1110
|
-
for (x = 0; x < size; x += 1) {
|
|
1111
|
-
p = 1;
|
|
1112
|
-
if (min <= x && x < max && min <= y && y < max && _this.isDark(r, Math.floor((x - min) / cellSize))) {
|
|
1113
|
-
p = 0;
|
|
1114
|
-
}
|
|
1115
|
-
line += p ? white : black;
|
|
1116
|
-
}
|
|
1117
|
-
for (r = 0; r < cellSize; r += 1) {
|
|
1118
|
-
ascii += line + "\n";
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
return ascii.substring(0, ascii.length - 1);
|
|
1122
|
-
};
|
|
1123
|
-
_this.renderTo2dContext = function(context, cellSize) {
|
|
1124
|
-
cellSize = cellSize || 2;
|
|
1125
|
-
const length = _this.getModuleCount();
|
|
1126
|
-
for (let row = 0; row < length; row++) {
|
|
1127
|
-
for (let col = 0; col < length; col++) {
|
|
1128
|
-
context.fillStyle = _this.isDark(row, col) ? "black" : "white";
|
|
1129
|
-
context.fillRect(col * cellSize, row * cellSize, cellSize, cellSize);
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
};
|
|
1133
|
-
return _this;
|
|
1134
|
-
}, "qrcode");
|
|
1135
|
-
qrcode.stringToBytes = function(s) {
|
|
1136
|
-
const bytes = [];
|
|
1137
|
-
for (let i = 0; i < s.length; i += 1) {
|
|
1138
|
-
const c = s.charCodeAt(i);
|
|
1139
|
-
bytes.push(c & 255);
|
|
1140
|
-
}
|
|
1141
|
-
return bytes;
|
|
1142
|
-
};
|
|
1143
|
-
qrcode.createStringToBytes = function(unicodeData, numChars) {
|
|
1144
|
-
const unicodeMap = (function() {
|
|
1145
|
-
const bin = base64DecodeInputStream(unicodeData);
|
|
1146
|
-
const read = /* @__PURE__ */ __name(function() {
|
|
1147
|
-
const b = bin.read();
|
|
1148
|
-
if (b == -1) throw "eof";
|
|
1149
|
-
return b;
|
|
1150
|
-
}, "read");
|
|
1151
|
-
let count = 0;
|
|
1152
|
-
const unicodeMap2 = {};
|
|
1153
|
-
while (true) {
|
|
1154
|
-
const b0 = bin.read();
|
|
1155
|
-
if (b0 == -1) break;
|
|
1156
|
-
const b1 = read();
|
|
1157
|
-
const b2 = read();
|
|
1158
|
-
const b3 = read();
|
|
1159
|
-
const k = String.fromCharCode(b0 << 8 | b1);
|
|
1160
|
-
const v = b2 << 8 | b3;
|
|
1161
|
-
unicodeMap2[k] = v;
|
|
1162
|
-
count += 1;
|
|
1163
|
-
}
|
|
1164
|
-
if (count != numChars) {
|
|
1165
|
-
throw count + " != " + numChars;
|
|
1166
|
-
}
|
|
1167
|
-
return unicodeMap2;
|
|
1168
|
-
})();
|
|
1169
|
-
const unknownChar = "?".charCodeAt(0);
|
|
1170
|
-
return function(s) {
|
|
1171
|
-
const bytes = [];
|
|
1172
|
-
for (let i = 0; i < s.length; i += 1) {
|
|
1173
|
-
const c = s.charCodeAt(i);
|
|
1174
|
-
if (c < 128) {
|
|
1175
|
-
bytes.push(c);
|
|
1176
|
-
} else {
|
|
1177
|
-
const b = unicodeMap[s.charAt(i)];
|
|
1178
|
-
if (typeof b == "number") {
|
|
1179
|
-
if ((b & 255) == b) {
|
|
1180
|
-
bytes.push(b);
|
|
1181
|
-
} else {
|
|
1182
|
-
bytes.push(b >>> 8);
|
|
1183
|
-
bytes.push(b & 255);
|
|
1184
|
-
}
|
|
1185
|
-
} else {
|
|
1186
|
-
bytes.push(unknownChar);
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
}
|
|
1190
|
-
return bytes;
|
|
1191
|
-
};
|
|
1192
|
-
};
|
|
1193
|
-
var QRMode = {
|
|
1194
|
-
MODE_NUMBER: 1 << 0,
|
|
1195
|
-
MODE_ALPHA_NUM: 1 << 1,
|
|
1196
|
-
MODE_8BIT_BYTE: 1 << 2,
|
|
1197
|
-
MODE_KANJI: 1 << 3
|
|
1198
|
-
};
|
|
1199
|
-
var QRErrorCorrectionLevel = {
|
|
1200
|
-
L: 1,
|
|
1201
|
-
M: 0,
|
|
1202
|
-
Q: 3,
|
|
1203
|
-
H: 2
|
|
1204
|
-
};
|
|
1205
|
-
var QRMaskPattern = {
|
|
1206
|
-
PATTERN000: 0,
|
|
1207
|
-
PATTERN001: 1,
|
|
1208
|
-
PATTERN010: 2,
|
|
1209
|
-
PATTERN011: 3,
|
|
1210
|
-
PATTERN100: 4,
|
|
1211
|
-
PATTERN101: 5,
|
|
1212
|
-
PATTERN110: 6,
|
|
1213
|
-
PATTERN111: 7
|
|
1214
|
-
};
|
|
1215
|
-
var QRUtil = (function() {
|
|
1216
|
-
const PATTERN_POSITION_TABLE = [
|
|
1217
|
-
[],
|
|
1218
|
-
[6, 18],
|
|
1219
|
-
[6, 22],
|
|
1220
|
-
[6, 26],
|
|
1221
|
-
[6, 30],
|
|
1222
|
-
[6, 34],
|
|
1223
|
-
[6, 22, 38],
|
|
1224
|
-
[6, 24, 42],
|
|
1225
|
-
[6, 26, 46],
|
|
1226
|
-
[6, 28, 50],
|
|
1227
|
-
[6, 30, 54],
|
|
1228
|
-
[6, 32, 58],
|
|
1229
|
-
[6, 34, 62],
|
|
1230
|
-
[6, 26, 46, 66],
|
|
1231
|
-
[6, 26, 48, 70],
|
|
1232
|
-
[6, 26, 50, 74],
|
|
1233
|
-
[6, 30, 54, 78],
|
|
1234
|
-
[6, 30, 56, 82],
|
|
1235
|
-
[6, 30, 58, 86],
|
|
1236
|
-
[6, 34, 62, 90],
|
|
1237
|
-
[6, 28, 50, 72, 94],
|
|
1238
|
-
[6, 26, 50, 74, 98],
|
|
1239
|
-
[6, 30, 54, 78, 102],
|
|
1240
|
-
[6, 28, 54, 80, 106],
|
|
1241
|
-
[6, 32, 58, 84, 110],
|
|
1242
|
-
[6, 30, 58, 86, 114],
|
|
1243
|
-
[6, 34, 62, 90, 118],
|
|
1244
|
-
[6, 26, 50, 74, 98, 122],
|
|
1245
|
-
[6, 30, 54, 78, 102, 126],
|
|
1246
|
-
[6, 26, 52, 78, 104, 130],
|
|
1247
|
-
[6, 30, 56, 82, 108, 134],
|
|
1248
|
-
[6, 34, 60, 86, 112, 138],
|
|
1249
|
-
[6, 30, 58, 86, 114, 142],
|
|
1250
|
-
[6, 34, 62, 90, 118, 146],
|
|
1251
|
-
[6, 30, 54, 78, 102, 126, 150],
|
|
1252
|
-
[6, 24, 50, 76, 102, 128, 154],
|
|
1253
|
-
[6, 28, 54, 80, 106, 132, 158],
|
|
1254
|
-
[6, 32, 58, 84, 110, 136, 162],
|
|
1255
|
-
[6, 26, 54, 82, 110, 138, 166],
|
|
1256
|
-
[6, 30, 58, 86, 114, 142, 170]
|
|
1257
|
-
];
|
|
1258
|
-
const G15 = 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0;
|
|
1259
|
-
const G18 = 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0;
|
|
1260
|
-
const G15_MASK = 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1;
|
|
1261
|
-
const _this = {};
|
|
1262
|
-
const getBCHDigit = /* @__PURE__ */ __name(function(data) {
|
|
1263
|
-
let digit = 0;
|
|
1264
|
-
while (data != 0) {
|
|
1265
|
-
digit += 1;
|
|
1266
|
-
data >>>= 1;
|
|
1267
|
-
}
|
|
1268
|
-
return digit;
|
|
1269
|
-
}, "getBCHDigit");
|
|
1270
|
-
_this.getBCHTypeInfo = function(data) {
|
|
1271
|
-
let d = data << 10;
|
|
1272
|
-
while (getBCHDigit(d) - getBCHDigit(G15) >= 0) {
|
|
1273
|
-
d ^= G15 << getBCHDigit(d) - getBCHDigit(G15);
|
|
1274
|
-
}
|
|
1275
|
-
return (data << 10 | d) ^ G15_MASK;
|
|
1276
|
-
};
|
|
1277
|
-
_this.getBCHTypeNumber = function(data) {
|
|
1278
|
-
let d = data << 12;
|
|
1279
|
-
while (getBCHDigit(d) - getBCHDigit(G18) >= 0) {
|
|
1280
|
-
d ^= G18 << getBCHDigit(d) - getBCHDigit(G18);
|
|
1281
|
-
}
|
|
1282
|
-
return data << 12 | d;
|
|
1283
|
-
};
|
|
1284
|
-
_this.getPatternPosition = function(typeNumber) {
|
|
1285
|
-
return PATTERN_POSITION_TABLE[typeNumber - 1];
|
|
1286
|
-
};
|
|
1287
|
-
_this.getMaskFunction = function(maskPattern) {
|
|
1288
|
-
switch (maskPattern) {
|
|
1289
|
-
case QRMaskPattern.PATTERN000:
|
|
1290
|
-
return function(i, j) {
|
|
1291
|
-
return (i + j) % 2 == 0;
|
|
1292
|
-
};
|
|
1293
|
-
case QRMaskPattern.PATTERN001:
|
|
1294
|
-
return function(i, j) {
|
|
1295
|
-
return i % 2 == 0;
|
|
1296
|
-
};
|
|
1297
|
-
case QRMaskPattern.PATTERN010:
|
|
1298
|
-
return function(i, j) {
|
|
1299
|
-
return j % 3 == 0;
|
|
1300
|
-
};
|
|
1301
|
-
case QRMaskPattern.PATTERN011:
|
|
1302
|
-
return function(i, j) {
|
|
1303
|
-
return (i + j) % 3 == 0;
|
|
1304
|
-
};
|
|
1305
|
-
case QRMaskPattern.PATTERN100:
|
|
1306
|
-
return function(i, j) {
|
|
1307
|
-
return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
|
|
1308
|
-
};
|
|
1309
|
-
case QRMaskPattern.PATTERN101:
|
|
1310
|
-
return function(i, j) {
|
|
1311
|
-
return i * j % 2 + i * j % 3 == 0;
|
|
1312
|
-
};
|
|
1313
|
-
case QRMaskPattern.PATTERN110:
|
|
1314
|
-
return function(i, j) {
|
|
1315
|
-
return (i * j % 2 + i * j % 3) % 2 == 0;
|
|
1316
|
-
};
|
|
1317
|
-
case QRMaskPattern.PATTERN111:
|
|
1318
|
-
return function(i, j) {
|
|
1319
|
-
return (i * j % 3 + (i + j) % 2) % 2 == 0;
|
|
1320
|
-
};
|
|
1321
|
-
default:
|
|
1322
|
-
throw "bad maskPattern:" + maskPattern;
|
|
1323
|
-
}
|
|
1324
|
-
};
|
|
1325
|
-
_this.getErrorCorrectPolynomial = function(errorCorrectLength) {
|
|
1326
|
-
let a = qrPolynomial([1], 0);
|
|
1327
|
-
for (let i = 0; i < errorCorrectLength; i += 1) {
|
|
1328
|
-
a = a.multiply(qrPolynomial([1, QRMath.gexp(i)], 0));
|
|
1329
|
-
}
|
|
1330
|
-
return a;
|
|
1331
|
-
};
|
|
1332
|
-
_this.getLengthInBits = function(mode, type) {
|
|
1333
|
-
if (1 <= type && type < 10) {
|
|
1334
|
-
switch (mode) {
|
|
1335
|
-
case QRMode.MODE_NUMBER:
|
|
1336
|
-
return 10;
|
|
1337
|
-
case QRMode.MODE_ALPHA_NUM:
|
|
1338
|
-
return 9;
|
|
1339
|
-
case QRMode.MODE_8BIT_BYTE:
|
|
1340
|
-
return 8;
|
|
1341
|
-
case QRMode.MODE_KANJI:
|
|
1342
|
-
return 8;
|
|
1343
|
-
default:
|
|
1344
|
-
throw "mode:" + mode;
|
|
1345
|
-
}
|
|
1346
|
-
} else if (type < 27) {
|
|
1347
|
-
switch (mode) {
|
|
1348
|
-
case QRMode.MODE_NUMBER:
|
|
1349
|
-
return 12;
|
|
1350
|
-
case QRMode.MODE_ALPHA_NUM:
|
|
1351
|
-
return 11;
|
|
1352
|
-
case QRMode.MODE_8BIT_BYTE:
|
|
1353
|
-
return 16;
|
|
1354
|
-
case QRMode.MODE_KANJI:
|
|
1355
|
-
return 10;
|
|
1356
|
-
default:
|
|
1357
|
-
throw "mode:" + mode;
|
|
1358
|
-
}
|
|
1359
|
-
} else if (type < 41) {
|
|
1360
|
-
switch (mode) {
|
|
1361
|
-
case QRMode.MODE_NUMBER:
|
|
1362
|
-
return 14;
|
|
1363
|
-
case QRMode.MODE_ALPHA_NUM:
|
|
1364
|
-
return 13;
|
|
1365
|
-
case QRMode.MODE_8BIT_BYTE:
|
|
1366
|
-
return 16;
|
|
1367
|
-
case QRMode.MODE_KANJI:
|
|
1368
|
-
return 12;
|
|
1369
|
-
default:
|
|
1370
|
-
throw "mode:" + mode;
|
|
1371
|
-
}
|
|
1372
|
-
} else {
|
|
1373
|
-
throw "type:" + type;
|
|
1374
|
-
}
|
|
1375
|
-
};
|
|
1376
|
-
_this.getLostPoint = function(qrcode2) {
|
|
1377
|
-
const moduleCount = qrcode2.getModuleCount();
|
|
1378
|
-
let lostPoint = 0;
|
|
1379
|
-
for (let row = 0; row < moduleCount; row += 1) {
|
|
1380
|
-
for (let col = 0; col < moduleCount; col += 1) {
|
|
1381
|
-
let sameCount = 0;
|
|
1382
|
-
const dark = qrcode2.isDark(row, col);
|
|
1383
|
-
for (let r = -1; r <= 1; r += 1) {
|
|
1384
|
-
if (row + r < 0 || moduleCount <= row + r) {
|
|
1385
|
-
continue;
|
|
1386
|
-
}
|
|
1387
|
-
for (let c = -1; c <= 1; c += 1) {
|
|
1388
|
-
if (col + c < 0 || moduleCount <= col + c) {
|
|
1389
|
-
continue;
|
|
1390
|
-
}
|
|
1391
|
-
if (r == 0 && c == 0) {
|
|
1392
|
-
continue;
|
|
1393
|
-
}
|
|
1394
|
-
if (dark == qrcode2.isDark(row + r, col + c)) {
|
|
1395
|
-
sameCount += 1;
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
}
|
|
1399
|
-
if (sameCount > 5) {
|
|
1400
|
-
lostPoint += 3 + sameCount - 5;
|
|
1401
|
-
}
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
;
|
|
1405
|
-
for (let row = 0; row < moduleCount - 1; row += 1) {
|
|
1406
|
-
for (let col = 0; col < moduleCount - 1; col += 1) {
|
|
1407
|
-
let count = 0;
|
|
1408
|
-
if (qrcode2.isDark(row, col)) count += 1;
|
|
1409
|
-
if (qrcode2.isDark(row + 1, col)) count += 1;
|
|
1410
|
-
if (qrcode2.isDark(row, col + 1)) count += 1;
|
|
1411
|
-
if (qrcode2.isDark(row + 1, col + 1)) count += 1;
|
|
1412
|
-
if (count == 0 || count == 4) {
|
|
1413
|
-
lostPoint += 3;
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
|
-
for (let row = 0; row < moduleCount; row += 1) {
|
|
1418
|
-
for (let col = 0; col < moduleCount - 6; col += 1) {
|
|
1419
|
-
if (qrcode2.isDark(row, col) && !qrcode2.isDark(row, col + 1) && qrcode2.isDark(row, col + 2) && qrcode2.isDark(row, col + 3) && qrcode2.isDark(row, col + 4) && !qrcode2.isDark(row, col + 5) && qrcode2.isDark(row, col + 6)) {
|
|
1420
|
-
lostPoint += 40;
|
|
1421
|
-
}
|
|
1422
|
-
}
|
|
1423
|
-
}
|
|
1424
|
-
for (let col = 0; col < moduleCount; col += 1) {
|
|
1425
|
-
for (let row = 0; row < moduleCount - 6; row += 1) {
|
|
1426
|
-
if (qrcode2.isDark(row, col) && !qrcode2.isDark(row + 1, col) && qrcode2.isDark(row + 2, col) && qrcode2.isDark(row + 3, col) && qrcode2.isDark(row + 4, col) && !qrcode2.isDark(row + 5, col) && qrcode2.isDark(row + 6, col)) {
|
|
1427
|
-
lostPoint += 40;
|
|
1428
|
-
}
|
|
1429
|
-
}
|
|
1430
|
-
}
|
|
1431
|
-
let darkCount = 0;
|
|
1432
|
-
for (let col = 0; col < moduleCount; col += 1) {
|
|
1433
|
-
for (let row = 0; row < moduleCount; row += 1) {
|
|
1434
|
-
if (qrcode2.isDark(row, col)) {
|
|
1435
|
-
darkCount += 1;
|
|
1436
|
-
}
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
const ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
|
|
1440
|
-
lostPoint += ratio * 10;
|
|
1441
|
-
return lostPoint;
|
|
1442
|
-
};
|
|
1443
|
-
return _this;
|
|
1444
|
-
})();
|
|
1445
|
-
var QRMath = (function() {
|
|
1446
|
-
const EXP_TABLE = new Array(256);
|
|
1447
|
-
const LOG_TABLE = new Array(256);
|
|
1448
|
-
for (let i = 0; i < 8; i += 1) {
|
|
1449
|
-
EXP_TABLE[i] = 1 << i;
|
|
1450
|
-
}
|
|
1451
|
-
for (let i = 8; i < 256; i += 1) {
|
|
1452
|
-
EXP_TABLE[i] = EXP_TABLE[i - 4] ^ EXP_TABLE[i - 5] ^ EXP_TABLE[i - 6] ^ EXP_TABLE[i - 8];
|
|
1453
|
-
}
|
|
1454
|
-
for (let i = 0; i < 255; i += 1) {
|
|
1455
|
-
LOG_TABLE[EXP_TABLE[i]] = i;
|
|
1456
|
-
}
|
|
1457
|
-
const _this = {};
|
|
1458
|
-
_this.glog = function(n) {
|
|
1459
|
-
if (n < 1) {
|
|
1460
|
-
throw "glog(" + n + ")";
|
|
1461
|
-
}
|
|
1462
|
-
return LOG_TABLE[n];
|
|
1463
|
-
};
|
|
1464
|
-
_this.gexp = function(n) {
|
|
1465
|
-
while (n < 0) {
|
|
1466
|
-
n += 255;
|
|
1467
|
-
}
|
|
1468
|
-
while (n >= 256) {
|
|
1469
|
-
n -= 255;
|
|
1470
|
-
}
|
|
1471
|
-
return EXP_TABLE[n];
|
|
1472
|
-
};
|
|
1473
|
-
return _this;
|
|
1474
|
-
})();
|
|
1475
|
-
var qrPolynomial = /* @__PURE__ */ __name(function(num, shift) {
|
|
1476
|
-
if (typeof num.length == "undefined") {
|
|
1477
|
-
throw num.length + "/" + shift;
|
|
1478
|
-
}
|
|
1479
|
-
const _num = (function() {
|
|
1480
|
-
let offset = 0;
|
|
1481
|
-
while (offset < num.length && num[offset] == 0) {
|
|
1482
|
-
offset += 1;
|
|
1483
|
-
}
|
|
1484
|
-
const _num2 = new Array(num.length - offset + shift);
|
|
1485
|
-
for (let i = 0; i < num.length - offset; i += 1) {
|
|
1486
|
-
_num2[i] = num[i + offset];
|
|
1487
|
-
}
|
|
1488
|
-
return _num2;
|
|
1489
|
-
})();
|
|
1490
|
-
const _this = {};
|
|
1491
|
-
_this.getAt = function(index) {
|
|
1492
|
-
return _num[index];
|
|
1493
|
-
};
|
|
1494
|
-
_this.getLength = function() {
|
|
1495
|
-
return _num.length;
|
|
1496
|
-
};
|
|
1497
|
-
_this.multiply = function(e) {
|
|
1498
|
-
const num2 = new Array(_this.getLength() + e.getLength() - 1);
|
|
1499
|
-
for (let i = 0; i < _this.getLength(); i += 1) {
|
|
1500
|
-
for (let j = 0; j < e.getLength(); j += 1) {
|
|
1501
|
-
num2[i + j] ^= QRMath.gexp(QRMath.glog(_this.getAt(i)) + QRMath.glog(e.getAt(j)));
|
|
1502
|
-
}
|
|
1503
|
-
}
|
|
1504
|
-
return qrPolynomial(num2, 0);
|
|
1505
|
-
};
|
|
1506
|
-
_this.mod = function(e) {
|
|
1507
|
-
if (_this.getLength() - e.getLength() < 0) {
|
|
1508
|
-
return _this;
|
|
1509
|
-
}
|
|
1510
|
-
const ratio = QRMath.glog(_this.getAt(0)) - QRMath.glog(e.getAt(0));
|
|
1511
|
-
const num2 = new Array(_this.getLength());
|
|
1512
|
-
for (let i = 0; i < _this.getLength(); i += 1) {
|
|
1513
|
-
num2[i] = _this.getAt(i);
|
|
1514
|
-
}
|
|
1515
|
-
for (let i = 0; i < e.getLength(); i += 1) {
|
|
1516
|
-
num2[i] ^= QRMath.gexp(QRMath.glog(e.getAt(i)) + ratio);
|
|
1517
|
-
}
|
|
1518
|
-
return qrPolynomial(num2, 0).mod(e);
|
|
1519
|
-
};
|
|
1520
|
-
return _this;
|
|
1521
|
-
}, "qrPolynomial");
|
|
1522
|
-
var QRRSBlock = (function() {
|
|
1523
|
-
const RS_BLOCK_TABLE = [
|
|
1524
|
-
// L
|
|
1525
|
-
// M
|
|
1526
|
-
// Q
|
|
1527
|
-
// H
|
|
1528
|
-
// 1
|
|
1529
|
-
[1, 26, 19],
|
|
1530
|
-
[1, 26, 16],
|
|
1531
|
-
[1, 26, 13],
|
|
1532
|
-
[1, 26, 9],
|
|
1533
|
-
// 2
|
|
1534
|
-
[1, 44, 34],
|
|
1535
|
-
[1, 44, 28],
|
|
1536
|
-
[1, 44, 22],
|
|
1537
|
-
[1, 44, 16],
|
|
1538
|
-
// 3
|
|
1539
|
-
[1, 70, 55],
|
|
1540
|
-
[1, 70, 44],
|
|
1541
|
-
[2, 35, 17],
|
|
1542
|
-
[2, 35, 13],
|
|
1543
|
-
// 4
|
|
1544
|
-
[1, 100, 80],
|
|
1545
|
-
[2, 50, 32],
|
|
1546
|
-
[2, 50, 24],
|
|
1547
|
-
[4, 25, 9],
|
|
1548
|
-
// 5
|
|
1549
|
-
[1, 134, 108],
|
|
1550
|
-
[2, 67, 43],
|
|
1551
|
-
[2, 33, 15, 2, 34, 16],
|
|
1552
|
-
[2, 33, 11, 2, 34, 12],
|
|
1553
|
-
// 6
|
|
1554
|
-
[2, 86, 68],
|
|
1555
|
-
[4, 43, 27],
|
|
1556
|
-
[4, 43, 19],
|
|
1557
|
-
[4, 43, 15],
|
|
1558
|
-
// 7
|
|
1559
|
-
[2, 98, 78],
|
|
1560
|
-
[4, 49, 31],
|
|
1561
|
-
[2, 32, 14, 4, 33, 15],
|
|
1562
|
-
[4, 39, 13, 1, 40, 14],
|
|
1563
|
-
// 8
|
|
1564
|
-
[2, 121, 97],
|
|
1565
|
-
[2, 60, 38, 2, 61, 39],
|
|
1566
|
-
[4, 40, 18, 2, 41, 19],
|
|
1567
|
-
[4, 40, 14, 2, 41, 15],
|
|
1568
|
-
// 9
|
|
1569
|
-
[2, 146, 116],
|
|
1570
|
-
[3, 58, 36, 2, 59, 37],
|
|
1571
|
-
[4, 36, 16, 4, 37, 17],
|
|
1572
|
-
[4, 36, 12, 4, 37, 13],
|
|
1573
|
-
// 10
|
|
1574
|
-
[2, 86, 68, 2, 87, 69],
|
|
1575
|
-
[4, 69, 43, 1, 70, 44],
|
|
1576
|
-
[6, 43, 19, 2, 44, 20],
|
|
1577
|
-
[6, 43, 15, 2, 44, 16],
|
|
1578
|
-
// 11
|
|
1579
|
-
[4, 101, 81],
|
|
1580
|
-
[1, 80, 50, 4, 81, 51],
|
|
1581
|
-
[4, 50, 22, 4, 51, 23],
|
|
1582
|
-
[3, 36, 12, 8, 37, 13],
|
|
1583
|
-
// 12
|
|
1584
|
-
[2, 116, 92, 2, 117, 93],
|
|
1585
|
-
[6, 58, 36, 2, 59, 37],
|
|
1586
|
-
[4, 46, 20, 6, 47, 21],
|
|
1587
|
-
[7, 42, 14, 4, 43, 15],
|
|
1588
|
-
// 13
|
|
1589
|
-
[4, 133, 107],
|
|
1590
|
-
[8, 59, 37, 1, 60, 38],
|
|
1591
|
-
[8, 44, 20, 4, 45, 21],
|
|
1592
|
-
[12, 33, 11, 4, 34, 12],
|
|
1593
|
-
// 14
|
|
1594
|
-
[3, 145, 115, 1, 146, 116],
|
|
1595
|
-
[4, 64, 40, 5, 65, 41],
|
|
1596
|
-
[11, 36, 16, 5, 37, 17],
|
|
1597
|
-
[11, 36, 12, 5, 37, 13],
|
|
1598
|
-
// 15
|
|
1599
|
-
[5, 109, 87, 1, 110, 88],
|
|
1600
|
-
[5, 65, 41, 5, 66, 42],
|
|
1601
|
-
[5, 54, 24, 7, 55, 25],
|
|
1602
|
-
[11, 36, 12, 7, 37, 13],
|
|
1603
|
-
// 16
|
|
1604
|
-
[5, 122, 98, 1, 123, 99],
|
|
1605
|
-
[7, 73, 45, 3, 74, 46],
|
|
1606
|
-
[15, 43, 19, 2, 44, 20],
|
|
1607
|
-
[3, 45, 15, 13, 46, 16],
|
|
1608
|
-
// 17
|
|
1609
|
-
[1, 135, 107, 5, 136, 108],
|
|
1610
|
-
[10, 74, 46, 1, 75, 47],
|
|
1611
|
-
[1, 50, 22, 15, 51, 23],
|
|
1612
|
-
[2, 42, 14, 17, 43, 15],
|
|
1613
|
-
// 18
|
|
1614
|
-
[5, 150, 120, 1, 151, 121],
|
|
1615
|
-
[9, 69, 43, 4, 70, 44],
|
|
1616
|
-
[17, 50, 22, 1, 51, 23],
|
|
1617
|
-
[2, 42, 14, 19, 43, 15],
|
|
1618
|
-
// 19
|
|
1619
|
-
[3, 141, 113, 4, 142, 114],
|
|
1620
|
-
[3, 70, 44, 11, 71, 45],
|
|
1621
|
-
[17, 47, 21, 4, 48, 22],
|
|
1622
|
-
[9, 39, 13, 16, 40, 14],
|
|
1623
|
-
// 20
|
|
1624
|
-
[3, 135, 107, 5, 136, 108],
|
|
1625
|
-
[3, 67, 41, 13, 68, 42],
|
|
1626
|
-
[15, 54, 24, 5, 55, 25],
|
|
1627
|
-
[15, 43, 15, 10, 44, 16],
|
|
1628
|
-
// 21
|
|
1629
|
-
[4, 144, 116, 4, 145, 117],
|
|
1630
|
-
[17, 68, 42],
|
|
1631
|
-
[17, 50, 22, 6, 51, 23],
|
|
1632
|
-
[19, 46, 16, 6, 47, 17],
|
|
1633
|
-
// 22
|
|
1634
|
-
[2, 139, 111, 7, 140, 112],
|
|
1635
|
-
[17, 74, 46],
|
|
1636
|
-
[7, 54, 24, 16, 55, 25],
|
|
1637
|
-
[34, 37, 13],
|
|
1638
|
-
// 23
|
|
1639
|
-
[4, 151, 121, 5, 152, 122],
|
|
1640
|
-
[4, 75, 47, 14, 76, 48],
|
|
1641
|
-
[11, 54, 24, 14, 55, 25],
|
|
1642
|
-
[16, 45, 15, 14, 46, 16],
|
|
1643
|
-
// 24
|
|
1644
|
-
[6, 147, 117, 4, 148, 118],
|
|
1645
|
-
[6, 73, 45, 14, 74, 46],
|
|
1646
|
-
[11, 54, 24, 16, 55, 25],
|
|
1647
|
-
[30, 46, 16, 2, 47, 17],
|
|
1648
|
-
// 25
|
|
1649
|
-
[8, 132, 106, 4, 133, 107],
|
|
1650
|
-
[8, 75, 47, 13, 76, 48],
|
|
1651
|
-
[7, 54, 24, 22, 55, 25],
|
|
1652
|
-
[22, 45, 15, 13, 46, 16],
|
|
1653
|
-
// 26
|
|
1654
|
-
[10, 142, 114, 2, 143, 115],
|
|
1655
|
-
[19, 74, 46, 4, 75, 47],
|
|
1656
|
-
[28, 50, 22, 6, 51, 23],
|
|
1657
|
-
[33, 46, 16, 4, 47, 17],
|
|
1658
|
-
// 27
|
|
1659
|
-
[8, 152, 122, 4, 153, 123],
|
|
1660
|
-
[22, 73, 45, 3, 74, 46],
|
|
1661
|
-
[8, 53, 23, 26, 54, 24],
|
|
1662
|
-
[12, 45, 15, 28, 46, 16],
|
|
1663
|
-
// 28
|
|
1664
|
-
[3, 147, 117, 10, 148, 118],
|
|
1665
|
-
[3, 73, 45, 23, 74, 46],
|
|
1666
|
-
[4, 54, 24, 31, 55, 25],
|
|
1667
|
-
[11, 45, 15, 31, 46, 16],
|
|
1668
|
-
// 29
|
|
1669
|
-
[7, 146, 116, 7, 147, 117],
|
|
1670
|
-
[21, 73, 45, 7, 74, 46],
|
|
1671
|
-
[1, 53, 23, 37, 54, 24],
|
|
1672
|
-
[19, 45, 15, 26, 46, 16],
|
|
1673
|
-
// 30
|
|
1674
|
-
[5, 145, 115, 10, 146, 116],
|
|
1675
|
-
[19, 75, 47, 10, 76, 48],
|
|
1676
|
-
[15, 54, 24, 25, 55, 25],
|
|
1677
|
-
[23, 45, 15, 25, 46, 16],
|
|
1678
|
-
// 31
|
|
1679
|
-
[13, 145, 115, 3, 146, 116],
|
|
1680
|
-
[2, 74, 46, 29, 75, 47],
|
|
1681
|
-
[42, 54, 24, 1, 55, 25],
|
|
1682
|
-
[23, 45, 15, 28, 46, 16],
|
|
1683
|
-
// 32
|
|
1684
|
-
[17, 145, 115],
|
|
1685
|
-
[10, 74, 46, 23, 75, 47],
|
|
1686
|
-
[10, 54, 24, 35, 55, 25],
|
|
1687
|
-
[19, 45, 15, 35, 46, 16],
|
|
1688
|
-
// 33
|
|
1689
|
-
[17, 145, 115, 1, 146, 116],
|
|
1690
|
-
[14, 74, 46, 21, 75, 47],
|
|
1691
|
-
[29, 54, 24, 19, 55, 25],
|
|
1692
|
-
[11, 45, 15, 46, 46, 16],
|
|
1693
|
-
// 34
|
|
1694
|
-
[13, 145, 115, 6, 146, 116],
|
|
1695
|
-
[14, 74, 46, 23, 75, 47],
|
|
1696
|
-
[44, 54, 24, 7, 55, 25],
|
|
1697
|
-
[59, 46, 16, 1, 47, 17],
|
|
1698
|
-
// 35
|
|
1699
|
-
[12, 151, 121, 7, 152, 122],
|
|
1700
|
-
[12, 75, 47, 26, 76, 48],
|
|
1701
|
-
[39, 54, 24, 14, 55, 25],
|
|
1702
|
-
[22, 45, 15, 41, 46, 16],
|
|
1703
|
-
// 36
|
|
1704
|
-
[6, 151, 121, 14, 152, 122],
|
|
1705
|
-
[6, 75, 47, 34, 76, 48],
|
|
1706
|
-
[46, 54, 24, 10, 55, 25],
|
|
1707
|
-
[2, 45, 15, 64, 46, 16],
|
|
1708
|
-
// 37
|
|
1709
|
-
[17, 152, 122, 4, 153, 123],
|
|
1710
|
-
[29, 74, 46, 14, 75, 47],
|
|
1711
|
-
[49, 54, 24, 10, 55, 25],
|
|
1712
|
-
[24, 45, 15, 46, 46, 16],
|
|
1713
|
-
// 38
|
|
1714
|
-
[4, 152, 122, 18, 153, 123],
|
|
1715
|
-
[13, 74, 46, 32, 75, 47],
|
|
1716
|
-
[48, 54, 24, 14, 55, 25],
|
|
1717
|
-
[42, 45, 15, 32, 46, 16],
|
|
1718
|
-
// 39
|
|
1719
|
-
[20, 147, 117, 4, 148, 118],
|
|
1720
|
-
[40, 75, 47, 7, 76, 48],
|
|
1721
|
-
[43, 54, 24, 22, 55, 25],
|
|
1722
|
-
[10, 45, 15, 67, 46, 16],
|
|
1723
|
-
// 40
|
|
1724
|
-
[19, 148, 118, 6, 149, 119],
|
|
1725
|
-
[18, 75, 47, 31, 76, 48],
|
|
1726
|
-
[34, 54, 24, 34, 55, 25],
|
|
1727
|
-
[20, 45, 15, 61, 46, 16]
|
|
1728
|
-
];
|
|
1729
|
-
const qrRSBlock = /* @__PURE__ */ __name(function(totalCount, dataCount) {
|
|
1730
|
-
const _this2 = {};
|
|
1731
|
-
_this2.totalCount = totalCount;
|
|
1732
|
-
_this2.dataCount = dataCount;
|
|
1733
|
-
return _this2;
|
|
1734
|
-
}, "qrRSBlock");
|
|
1735
|
-
const _this = {};
|
|
1736
|
-
const getRsBlockTable = /* @__PURE__ */ __name(function(typeNumber, errorCorrectionLevel) {
|
|
1737
|
-
switch (errorCorrectionLevel) {
|
|
1738
|
-
case QRErrorCorrectionLevel.L:
|
|
1739
|
-
return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
|
|
1740
|
-
case QRErrorCorrectionLevel.M:
|
|
1741
|
-
return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
|
|
1742
|
-
case QRErrorCorrectionLevel.Q:
|
|
1743
|
-
return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
|
|
1744
|
-
case QRErrorCorrectionLevel.H:
|
|
1745
|
-
return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
|
|
1746
|
-
default:
|
|
1747
|
-
return void 0;
|
|
1748
|
-
}
|
|
1749
|
-
}, "getRsBlockTable");
|
|
1750
|
-
_this.getRSBlocks = function(typeNumber, errorCorrectionLevel) {
|
|
1751
|
-
const rsBlock = getRsBlockTable(typeNumber, errorCorrectionLevel);
|
|
1752
|
-
if (typeof rsBlock == "undefined") {
|
|
1753
|
-
throw "bad rs block @ typeNumber:" + typeNumber + "/errorCorrectionLevel:" + errorCorrectionLevel;
|
|
1754
|
-
}
|
|
1755
|
-
const length = rsBlock.length / 3;
|
|
1756
|
-
const list = [];
|
|
1757
|
-
for (let i = 0; i < length; i += 1) {
|
|
1758
|
-
const count = rsBlock[i * 3 + 0];
|
|
1759
|
-
const totalCount = rsBlock[i * 3 + 1];
|
|
1760
|
-
const dataCount = rsBlock[i * 3 + 2];
|
|
1761
|
-
for (let j = 0; j < count; j += 1) {
|
|
1762
|
-
list.push(qrRSBlock(totalCount, dataCount));
|
|
1763
|
-
}
|
|
1764
|
-
}
|
|
1765
|
-
return list;
|
|
1766
|
-
};
|
|
1767
|
-
return _this;
|
|
1768
|
-
})();
|
|
1769
|
-
var qrBitBuffer = /* @__PURE__ */ __name(function() {
|
|
1770
|
-
const _buffer = [];
|
|
1771
|
-
let _length = 0;
|
|
1772
|
-
const _this = {};
|
|
1773
|
-
_this.getBuffer = function() {
|
|
1774
|
-
return _buffer;
|
|
1775
|
-
};
|
|
1776
|
-
_this.getAt = function(index) {
|
|
1777
|
-
const bufIndex = Math.floor(index / 8);
|
|
1778
|
-
return (_buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
|
|
1779
|
-
};
|
|
1780
|
-
_this.put = function(num, length) {
|
|
1781
|
-
for (let i = 0; i < length; i += 1) {
|
|
1782
|
-
_this.putBit((num >>> length - i - 1 & 1) == 1);
|
|
1783
|
-
}
|
|
1784
|
-
};
|
|
1785
|
-
_this.getLengthInBits = function() {
|
|
1786
|
-
return _length;
|
|
1787
|
-
};
|
|
1788
|
-
_this.putBit = function(bit) {
|
|
1789
|
-
const bufIndex = Math.floor(_length / 8);
|
|
1790
|
-
if (_buffer.length <= bufIndex) {
|
|
1791
|
-
_buffer.push(0);
|
|
1792
|
-
}
|
|
1793
|
-
if (bit) {
|
|
1794
|
-
_buffer[bufIndex] |= 128 >>> _length % 8;
|
|
1795
|
-
}
|
|
1796
|
-
_length += 1;
|
|
1797
|
-
};
|
|
1798
|
-
return _this;
|
|
1799
|
-
}, "qrBitBuffer");
|
|
1800
|
-
var qrNumber = /* @__PURE__ */ __name(function(data) {
|
|
1801
|
-
const _mode = QRMode.MODE_NUMBER;
|
|
1802
|
-
const _data = data;
|
|
1803
|
-
const _this = {};
|
|
1804
|
-
_this.getMode = function() {
|
|
1805
|
-
return _mode;
|
|
1806
|
-
};
|
|
1807
|
-
_this.getLength = function(buffer) {
|
|
1808
|
-
return _data.length;
|
|
1809
|
-
};
|
|
1810
|
-
_this.write = function(buffer) {
|
|
1811
|
-
const data2 = _data;
|
|
1812
|
-
let i = 0;
|
|
1813
|
-
while (i + 2 < data2.length) {
|
|
1814
|
-
buffer.put(strToNum(data2.substring(i, i + 3)), 10);
|
|
1815
|
-
i += 3;
|
|
1816
|
-
}
|
|
1817
|
-
if (i < data2.length) {
|
|
1818
|
-
if (data2.length - i == 1) {
|
|
1819
|
-
buffer.put(strToNum(data2.substring(i, i + 1)), 4);
|
|
1820
|
-
} else if (data2.length - i == 2) {
|
|
1821
|
-
buffer.put(strToNum(data2.substring(i, i + 2)), 7);
|
|
1822
|
-
}
|
|
1823
|
-
}
|
|
1824
|
-
};
|
|
1825
|
-
const strToNum = /* @__PURE__ */ __name(function(s) {
|
|
1826
|
-
let num = 0;
|
|
1827
|
-
for (let i = 0; i < s.length; i += 1) {
|
|
1828
|
-
num = num * 10 + chatToNum(s.charAt(i));
|
|
1829
|
-
}
|
|
1830
|
-
return num;
|
|
1831
|
-
}, "strToNum");
|
|
1832
|
-
const chatToNum = /* @__PURE__ */ __name(function(c) {
|
|
1833
|
-
if ("0" <= c && c <= "9") {
|
|
1834
|
-
return c.charCodeAt(0) - "0".charCodeAt(0);
|
|
1835
|
-
}
|
|
1836
|
-
throw "illegal char :" + c;
|
|
1837
|
-
}, "chatToNum");
|
|
1838
|
-
return _this;
|
|
1839
|
-
}, "qrNumber");
|
|
1840
|
-
var qrAlphaNum = /* @__PURE__ */ __name(function(data) {
|
|
1841
|
-
const _mode = QRMode.MODE_ALPHA_NUM;
|
|
1842
|
-
const _data = data;
|
|
1843
|
-
const _this = {};
|
|
1844
|
-
_this.getMode = function() {
|
|
1845
|
-
return _mode;
|
|
1846
|
-
};
|
|
1847
|
-
_this.getLength = function(buffer) {
|
|
1848
|
-
return _data.length;
|
|
1849
|
-
};
|
|
1850
|
-
_this.write = function(buffer) {
|
|
1851
|
-
const s = _data;
|
|
1852
|
-
let i = 0;
|
|
1853
|
-
while (i + 1 < s.length) {
|
|
1854
|
-
buffer.put(
|
|
1855
|
-
getCode(s.charAt(i)) * 45 + getCode(s.charAt(i + 1)),
|
|
1856
|
-
11
|
|
1857
|
-
);
|
|
1858
|
-
i += 2;
|
|
1859
|
-
}
|
|
1860
|
-
if (i < s.length) {
|
|
1861
|
-
buffer.put(getCode(s.charAt(i)), 6);
|
|
1862
|
-
}
|
|
1863
|
-
};
|
|
1864
|
-
const getCode = /* @__PURE__ */ __name(function(c) {
|
|
1865
|
-
if ("0" <= c && c <= "9") {
|
|
1866
|
-
return c.charCodeAt(0) - "0".charCodeAt(0);
|
|
1867
|
-
} else if ("A" <= c && c <= "Z") {
|
|
1868
|
-
return c.charCodeAt(0) - "A".charCodeAt(0) + 10;
|
|
1869
|
-
} else {
|
|
1870
|
-
switch (c) {
|
|
1871
|
-
case " ":
|
|
1872
|
-
return 36;
|
|
1873
|
-
case "$":
|
|
1874
|
-
return 37;
|
|
1875
|
-
case "%":
|
|
1876
|
-
return 38;
|
|
1877
|
-
case "*":
|
|
1878
|
-
return 39;
|
|
1879
|
-
case "+":
|
|
1880
|
-
return 40;
|
|
1881
|
-
case "-":
|
|
1882
|
-
return 41;
|
|
1883
|
-
case ".":
|
|
1884
|
-
return 42;
|
|
1885
|
-
case "/":
|
|
1886
|
-
return 43;
|
|
1887
|
-
case ":":
|
|
1888
|
-
return 44;
|
|
1889
|
-
default:
|
|
1890
|
-
throw "illegal char :" + c;
|
|
1891
|
-
}
|
|
1892
|
-
}
|
|
1893
|
-
}, "getCode");
|
|
1894
|
-
return _this;
|
|
1895
|
-
}, "qrAlphaNum");
|
|
1896
|
-
var qr8BitByte = /* @__PURE__ */ __name(function(data) {
|
|
1897
|
-
const _mode = QRMode.MODE_8BIT_BYTE;
|
|
1898
|
-
const _data = data;
|
|
1899
|
-
const _bytes = qrcode.stringToBytes(data);
|
|
1900
|
-
const _this = {};
|
|
1901
|
-
_this.getMode = function() {
|
|
1902
|
-
return _mode;
|
|
1903
|
-
};
|
|
1904
|
-
_this.getLength = function(buffer) {
|
|
1905
|
-
return _bytes.length;
|
|
1906
|
-
};
|
|
1907
|
-
_this.write = function(buffer) {
|
|
1908
|
-
for (let i = 0; i < _bytes.length; i += 1) {
|
|
1909
|
-
buffer.put(_bytes[i], 8);
|
|
1910
|
-
}
|
|
1911
|
-
};
|
|
1912
|
-
return _this;
|
|
1913
|
-
}, "qr8BitByte");
|
|
1914
|
-
var qrKanji = /* @__PURE__ */ __name(function(data) {
|
|
1915
|
-
const _mode = QRMode.MODE_KANJI;
|
|
1916
|
-
const _data = data;
|
|
1917
|
-
const stringToBytes2 = qrcode.stringToBytes;
|
|
1918
|
-
!(function(c, code) {
|
|
1919
|
-
const test = stringToBytes2(c);
|
|
1920
|
-
if (test.length != 2 || (test[0] << 8 | test[1]) != code) {
|
|
1921
|
-
throw "sjis not supported.";
|
|
1922
|
-
}
|
|
1923
|
-
})("\u53CB", 38726);
|
|
1924
|
-
const _bytes = stringToBytes2(data);
|
|
1925
|
-
const _this = {};
|
|
1926
|
-
_this.getMode = function() {
|
|
1927
|
-
return _mode;
|
|
1928
|
-
};
|
|
1929
|
-
_this.getLength = function(buffer) {
|
|
1930
|
-
return ~~(_bytes.length / 2);
|
|
1931
|
-
};
|
|
1932
|
-
_this.write = function(buffer) {
|
|
1933
|
-
const data2 = _bytes;
|
|
1934
|
-
let i = 0;
|
|
1935
|
-
while (i + 1 < data2.length) {
|
|
1936
|
-
let c = (255 & data2[i]) << 8 | 255 & data2[i + 1];
|
|
1937
|
-
if (33088 <= c && c <= 40956) {
|
|
1938
|
-
c -= 33088;
|
|
1939
|
-
} else if (57408 <= c && c <= 60351) {
|
|
1940
|
-
c -= 49472;
|
|
1941
|
-
} else {
|
|
1942
|
-
throw "illegal char at " + (i + 1) + "/" + c;
|
|
1943
|
-
}
|
|
1944
|
-
c = (c >>> 8 & 255) * 192 + (c & 255);
|
|
1945
|
-
buffer.put(c, 13);
|
|
1946
|
-
i += 2;
|
|
1947
|
-
}
|
|
1948
|
-
if (i < data2.length) {
|
|
1949
|
-
throw "illegal char at " + (i + 1);
|
|
1950
|
-
}
|
|
1951
|
-
};
|
|
1952
|
-
return _this;
|
|
1953
|
-
}, "qrKanji");
|
|
1954
|
-
var byteArrayOutputStream = /* @__PURE__ */ __name(function() {
|
|
1955
|
-
const _bytes = [];
|
|
1956
|
-
const _this = {};
|
|
1957
|
-
_this.writeByte = function(b) {
|
|
1958
|
-
_bytes.push(b & 255);
|
|
1959
|
-
};
|
|
1960
|
-
_this.writeShort = function(i) {
|
|
1961
|
-
_this.writeByte(i);
|
|
1962
|
-
_this.writeByte(i >>> 8);
|
|
1963
|
-
};
|
|
1964
|
-
_this.writeBytes = function(b, off, len) {
|
|
1965
|
-
off = off || 0;
|
|
1966
|
-
len = len || b.length;
|
|
1967
|
-
for (let i = 0; i < len; i += 1) {
|
|
1968
|
-
_this.writeByte(b[i + off]);
|
|
1969
|
-
}
|
|
1970
|
-
};
|
|
1971
|
-
_this.writeString = function(s) {
|
|
1972
|
-
for (let i = 0; i < s.length; i += 1) {
|
|
1973
|
-
_this.writeByte(s.charCodeAt(i));
|
|
1974
|
-
}
|
|
1975
|
-
};
|
|
1976
|
-
_this.toByteArray = function() {
|
|
1977
|
-
return _bytes;
|
|
1978
|
-
};
|
|
1979
|
-
_this.toString = function() {
|
|
1980
|
-
let s = "";
|
|
1981
|
-
s += "[";
|
|
1982
|
-
for (let i = 0; i < _bytes.length; i += 1) {
|
|
1983
|
-
if (i > 0) {
|
|
1984
|
-
s += ",";
|
|
1985
|
-
}
|
|
1986
|
-
s += _bytes[i];
|
|
1987
|
-
}
|
|
1988
|
-
s += "]";
|
|
1989
|
-
return s;
|
|
1990
|
-
};
|
|
1991
|
-
return _this;
|
|
1992
|
-
}, "byteArrayOutputStream");
|
|
1993
|
-
var base64EncodeOutputStream = /* @__PURE__ */ __name(function() {
|
|
1994
|
-
let _buffer = 0;
|
|
1995
|
-
let _buflen = 0;
|
|
1996
|
-
let _length = 0;
|
|
1997
|
-
let _base64 = "";
|
|
1998
|
-
const _this = {};
|
|
1999
|
-
const writeEncoded = /* @__PURE__ */ __name(function(b) {
|
|
2000
|
-
_base64 += String.fromCharCode(encode(b & 63));
|
|
2001
|
-
}, "writeEncoded");
|
|
2002
|
-
const encode = /* @__PURE__ */ __name(function(n) {
|
|
2003
|
-
if (n < 0) {
|
|
2004
|
-
throw "n:" + n;
|
|
2005
|
-
} else if (n < 26) {
|
|
2006
|
-
return 65 + n;
|
|
2007
|
-
} else if (n < 52) {
|
|
2008
|
-
return 97 + (n - 26);
|
|
2009
|
-
} else if (n < 62) {
|
|
2010
|
-
return 48 + (n - 52);
|
|
2011
|
-
} else if (n == 62) {
|
|
2012
|
-
return 43;
|
|
2013
|
-
} else if (n == 63) {
|
|
2014
|
-
return 47;
|
|
2015
|
-
} else {
|
|
2016
|
-
throw "n:" + n;
|
|
2017
|
-
}
|
|
2018
|
-
}, "encode");
|
|
2019
|
-
_this.writeByte = function(n) {
|
|
2020
|
-
_buffer = _buffer << 8 | n & 255;
|
|
2021
|
-
_buflen += 8;
|
|
2022
|
-
_length += 1;
|
|
2023
|
-
while (_buflen >= 6) {
|
|
2024
|
-
writeEncoded(_buffer >>> _buflen - 6);
|
|
2025
|
-
_buflen -= 6;
|
|
2026
|
-
}
|
|
2027
|
-
};
|
|
2028
|
-
_this.flush = function() {
|
|
2029
|
-
if (_buflen > 0) {
|
|
2030
|
-
writeEncoded(_buffer << 6 - _buflen);
|
|
2031
|
-
_buffer = 0;
|
|
2032
|
-
_buflen = 0;
|
|
2033
|
-
}
|
|
2034
|
-
if (_length % 3 != 0) {
|
|
2035
|
-
const padlen = 3 - _length % 3;
|
|
2036
|
-
for (let i = 0; i < padlen; i += 1) {
|
|
2037
|
-
_base64 += "=";
|
|
2038
|
-
}
|
|
2039
|
-
}
|
|
2040
|
-
};
|
|
2041
|
-
_this.toString = function() {
|
|
2042
|
-
return _base64;
|
|
2043
|
-
};
|
|
2044
|
-
return _this;
|
|
2045
|
-
}, "base64EncodeOutputStream");
|
|
2046
|
-
var base64DecodeInputStream = /* @__PURE__ */ __name(function(str) {
|
|
2047
|
-
const _str = str;
|
|
2048
|
-
let _pos = 0;
|
|
2049
|
-
let _buffer = 0;
|
|
2050
|
-
let _buflen = 0;
|
|
2051
|
-
const _this = {};
|
|
2052
|
-
_this.read = function() {
|
|
2053
|
-
while (_buflen < 8) {
|
|
2054
|
-
if (_pos >= _str.length) {
|
|
2055
|
-
if (_buflen == 0) {
|
|
2056
|
-
return -1;
|
|
2057
|
-
}
|
|
2058
|
-
throw "unexpected end of file./" + _buflen;
|
|
2059
|
-
}
|
|
2060
|
-
const c = _str.charAt(_pos);
|
|
2061
|
-
_pos += 1;
|
|
2062
|
-
if (c == "=") {
|
|
2063
|
-
_buflen = 0;
|
|
2064
|
-
return -1;
|
|
2065
|
-
} else if (c.match(/^\s$/)) {
|
|
2066
|
-
continue;
|
|
2067
|
-
}
|
|
2068
|
-
_buffer = _buffer << 6 | decode(c.charCodeAt(0));
|
|
2069
|
-
_buflen += 6;
|
|
2070
|
-
}
|
|
2071
|
-
const n = _buffer >>> _buflen - 8 & 255;
|
|
2072
|
-
_buflen -= 8;
|
|
2073
|
-
return n;
|
|
2074
|
-
};
|
|
2075
|
-
const decode = /* @__PURE__ */ __name(function(c) {
|
|
2076
|
-
if (65 <= c && c <= 90) {
|
|
2077
|
-
return c - 65;
|
|
2078
|
-
} else if (97 <= c && c <= 122) {
|
|
2079
|
-
return c - 97 + 26;
|
|
2080
|
-
} else if (48 <= c && c <= 57) {
|
|
2081
|
-
return c - 48 + 52;
|
|
2082
|
-
} else if (c == 43) {
|
|
2083
|
-
return 62;
|
|
2084
|
-
} else if (c == 47) {
|
|
2085
|
-
return 63;
|
|
2086
|
-
} else {
|
|
2087
|
-
throw "c:" + c;
|
|
2088
|
-
}
|
|
2089
|
-
}, "decode");
|
|
2090
|
-
return _this;
|
|
2091
|
-
}, "base64DecodeInputStream");
|
|
2092
|
-
var gifImage = /* @__PURE__ */ __name(function(width, height) {
|
|
2093
|
-
const _width = width;
|
|
2094
|
-
const _height = height;
|
|
2095
|
-
const _data = new Array(width * height);
|
|
2096
|
-
const _this = {};
|
|
2097
|
-
_this.setPixel = function(x, y, pixel) {
|
|
2098
|
-
_data[y * _width + x] = pixel;
|
|
2099
|
-
};
|
|
2100
|
-
_this.write = function(out) {
|
|
2101
|
-
out.writeString("GIF87a");
|
|
2102
|
-
out.writeShort(_width);
|
|
2103
|
-
out.writeShort(_height);
|
|
2104
|
-
out.writeByte(128);
|
|
2105
|
-
out.writeByte(0);
|
|
2106
|
-
out.writeByte(0);
|
|
2107
|
-
out.writeByte(0);
|
|
2108
|
-
out.writeByte(0);
|
|
2109
|
-
out.writeByte(0);
|
|
2110
|
-
out.writeByte(255);
|
|
2111
|
-
out.writeByte(255);
|
|
2112
|
-
out.writeByte(255);
|
|
2113
|
-
out.writeString(",");
|
|
2114
|
-
out.writeShort(0);
|
|
2115
|
-
out.writeShort(0);
|
|
2116
|
-
out.writeShort(_width);
|
|
2117
|
-
out.writeShort(_height);
|
|
2118
|
-
out.writeByte(0);
|
|
2119
|
-
const lzwMinCodeSize = 2;
|
|
2120
|
-
const raster = getLZWRaster(lzwMinCodeSize);
|
|
2121
|
-
out.writeByte(lzwMinCodeSize);
|
|
2122
|
-
let offset = 0;
|
|
2123
|
-
while (raster.length - offset > 255) {
|
|
2124
|
-
out.writeByte(255);
|
|
2125
|
-
out.writeBytes(raster, offset, 255);
|
|
2126
|
-
offset += 255;
|
|
2127
|
-
}
|
|
2128
|
-
out.writeByte(raster.length - offset);
|
|
2129
|
-
out.writeBytes(raster, offset, raster.length - offset);
|
|
2130
|
-
out.writeByte(0);
|
|
2131
|
-
out.writeString(";");
|
|
2132
|
-
};
|
|
2133
|
-
const bitOutputStream = /* @__PURE__ */ __name(function(out) {
|
|
2134
|
-
const _out = out;
|
|
2135
|
-
let _bitLength = 0;
|
|
2136
|
-
let _bitBuffer = 0;
|
|
2137
|
-
const _this2 = {};
|
|
2138
|
-
_this2.write = function(data, length) {
|
|
2139
|
-
if (data >>> length != 0) {
|
|
2140
|
-
throw "length over";
|
|
2141
|
-
}
|
|
2142
|
-
while (_bitLength + length >= 8) {
|
|
2143
|
-
_out.writeByte(255 & (data << _bitLength | _bitBuffer));
|
|
2144
|
-
length -= 8 - _bitLength;
|
|
2145
|
-
data >>>= 8 - _bitLength;
|
|
2146
|
-
_bitBuffer = 0;
|
|
2147
|
-
_bitLength = 0;
|
|
2148
|
-
}
|
|
2149
|
-
_bitBuffer = data << _bitLength | _bitBuffer;
|
|
2150
|
-
_bitLength = _bitLength + length;
|
|
2151
|
-
};
|
|
2152
|
-
_this2.flush = function() {
|
|
2153
|
-
if (_bitLength > 0) {
|
|
2154
|
-
_out.writeByte(_bitBuffer);
|
|
2155
|
-
}
|
|
2156
|
-
};
|
|
2157
|
-
return _this2;
|
|
2158
|
-
}, "bitOutputStream");
|
|
2159
|
-
const getLZWRaster = /* @__PURE__ */ __name(function(lzwMinCodeSize) {
|
|
2160
|
-
const clearCode = 1 << lzwMinCodeSize;
|
|
2161
|
-
const endCode = (1 << lzwMinCodeSize) + 1;
|
|
2162
|
-
let bitLength = lzwMinCodeSize + 1;
|
|
2163
|
-
const table = lzwTable();
|
|
2164
|
-
for (let i = 0; i < clearCode; i += 1) {
|
|
2165
|
-
table.add(String.fromCharCode(i));
|
|
2166
|
-
}
|
|
2167
|
-
table.add(String.fromCharCode(clearCode));
|
|
2168
|
-
table.add(String.fromCharCode(endCode));
|
|
2169
|
-
const byteOut = byteArrayOutputStream();
|
|
2170
|
-
const bitOut = bitOutputStream(byteOut);
|
|
2171
|
-
bitOut.write(clearCode, bitLength);
|
|
2172
|
-
let dataIndex = 0;
|
|
2173
|
-
let s = String.fromCharCode(_data[dataIndex]);
|
|
2174
|
-
dataIndex += 1;
|
|
2175
|
-
while (dataIndex < _data.length) {
|
|
2176
|
-
const c = String.fromCharCode(_data[dataIndex]);
|
|
2177
|
-
dataIndex += 1;
|
|
2178
|
-
if (table.contains(s + c)) {
|
|
2179
|
-
s = s + c;
|
|
2180
|
-
} else {
|
|
2181
|
-
bitOut.write(table.indexOf(s), bitLength);
|
|
2182
|
-
if (table.size() < 4095) {
|
|
2183
|
-
if (table.size() == 1 << bitLength) {
|
|
2184
|
-
bitLength += 1;
|
|
2185
|
-
}
|
|
2186
|
-
table.add(s + c);
|
|
2187
|
-
}
|
|
2188
|
-
s = c;
|
|
2189
|
-
}
|
|
2190
|
-
}
|
|
2191
|
-
bitOut.write(table.indexOf(s), bitLength);
|
|
2192
|
-
bitOut.write(endCode, bitLength);
|
|
2193
|
-
bitOut.flush();
|
|
2194
|
-
return byteOut.toByteArray();
|
|
2195
|
-
}, "getLZWRaster");
|
|
2196
|
-
const lzwTable = /* @__PURE__ */ __name(function() {
|
|
2197
|
-
const _map = {};
|
|
2198
|
-
let _size = 0;
|
|
2199
|
-
const _this2 = {};
|
|
2200
|
-
_this2.add = function(key) {
|
|
2201
|
-
if (_this2.contains(key)) {
|
|
2202
|
-
throw "dup key:" + key;
|
|
2203
|
-
}
|
|
2204
|
-
_map[key] = _size;
|
|
2205
|
-
_size += 1;
|
|
2206
|
-
};
|
|
2207
|
-
_this2.size = function() {
|
|
2208
|
-
return _size;
|
|
2209
|
-
};
|
|
2210
|
-
_this2.indexOf = function(key) {
|
|
2211
|
-
return _map[key];
|
|
2212
|
-
};
|
|
2213
|
-
_this2.contains = function(key) {
|
|
2214
|
-
return typeof _map[key] != "undefined";
|
|
2215
|
-
};
|
|
2216
|
-
return _this2;
|
|
2217
|
-
}, "lzwTable");
|
|
2218
|
-
return _this;
|
|
2219
|
-
}, "gifImage");
|
|
2220
|
-
var createDataURL = /* @__PURE__ */ __name(function(width, height, getPixel) {
|
|
2221
|
-
const gif = gifImage(width, height);
|
|
2222
|
-
for (let y = 0; y < height; y += 1) {
|
|
2223
|
-
for (let x = 0; x < width; x += 1) {
|
|
2224
|
-
gif.setPixel(x, y, getPixel(x, y));
|
|
2225
|
-
}
|
|
2226
|
-
}
|
|
2227
|
-
const b = byteArrayOutputStream();
|
|
2228
|
-
gif.write(b);
|
|
2229
|
-
const base64 = base64EncodeOutputStream();
|
|
2230
|
-
const bytes = b.toByteArray();
|
|
2231
|
-
for (let i = 0; i < bytes.length; i += 1) {
|
|
2232
|
-
base64.writeByte(bytes[i]);
|
|
2233
|
-
}
|
|
2234
|
-
base64.flush();
|
|
2235
|
-
return "data:image/gif;base64," + base64;
|
|
2236
|
-
}, "createDataURL");
|
|
2237
|
-
var qrcode_default = qrcode;
|
|
2238
|
-
var stringToBytes = qrcode.stringToBytes;
|
|
2239
|
-
|
|
2240
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/terminal/qr.js
|
|
2241
|
-
var QUIET_ZONE = 4;
|
|
2242
|
-
var BLACK_ON_WHITE = "\x1B[30;107m";
|
|
2243
|
-
var RESET = "\x1B[0m";
|
|
2244
|
-
var modules = /* @__PURE__ */ __name((link) => {
|
|
2245
|
-
const code = qrcode_default(0, "M");
|
|
2246
|
-
code.addData(link);
|
|
2247
|
-
code.make();
|
|
2248
|
-
const count = code.getModuleCount();
|
|
2249
|
-
const size = count + QUIET_ZONE * 2;
|
|
2250
|
-
const dark = /* @__PURE__ */ __name((row, col) => {
|
|
2251
|
-
const r = row - QUIET_ZONE;
|
|
2252
|
-
const c = col - QUIET_ZONE;
|
|
2253
|
-
return r >= 0 && c >= 0 && r < count && c < count && code.isDark(r, c);
|
|
2254
|
-
}, "dark");
|
|
2255
|
-
return { size, dark };
|
|
2256
|
-
}, "modules");
|
|
2257
|
-
var terminalQr = /* @__PURE__ */ __name((link) => {
|
|
2258
|
-
const { size, dark } = modules(link);
|
|
2259
|
-
const lines = [];
|
|
2260
|
-
for (let row = 0; row < size; row += 2) {
|
|
2261
|
-
let line = "";
|
|
2262
|
-
for (let col = 0; col < size; col++) {
|
|
2263
|
-
const top = dark(row, col);
|
|
2264
|
-
const bottom = row + 1 < size && dark(row + 1, col);
|
|
2265
|
-
line += top && bottom ? "\u2588" : top ? "\u2580" : bottom ? "\u2584" : " ";
|
|
2266
|
-
}
|
|
2267
|
-
lines.push(`${BLACK_ON_WHITE}${line}${RESET}`);
|
|
2268
|
-
}
|
|
2269
|
-
return { text: lines.join("\n"), width: size };
|
|
2270
|
-
}, "terminalQr");
|
|
2271
|
-
var plainQr = /* @__PURE__ */ __name((link) => {
|
|
2272
|
-
const { size, dark } = modules(link);
|
|
2273
|
-
const light = /* @__PURE__ */ __name((row, col) => row < size && !dark(row, col), "light");
|
|
2274
|
-
const lines = [];
|
|
2275
|
-
for (let row = 0; row < size; row += 2) {
|
|
2276
|
-
let line = "";
|
|
2277
|
-
for (let col = 0; col < size; col++) {
|
|
2278
|
-
const top = light(row, col);
|
|
2279
|
-
const bottom = light(row + 1, col);
|
|
2280
|
-
line += top && bottom ? "\u2588" : top ? "\u2580" : bottom ? "\u2584" : " ";
|
|
2281
|
-
}
|
|
2282
|
-
lines.push(line);
|
|
2283
|
-
}
|
|
2284
|
-
return lines.join("\n");
|
|
2285
|
-
}, "plainQr");
|
|
2286
|
-
|
|
2287
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/terminal/login-qr.js
|
|
2288
|
-
var MARGIN = 2;
|
|
2289
|
-
var atTerminal = /* @__PURE__ */ __name((input) => input.isTTY === true && !inputPolicy(input).noInput, "atTerminal");
|
|
2290
|
-
var PASTE_QR = "agents: paste the QR code above into the chat as a code block, exactly as printed; when a new one is printed, paste it and say the old one expired";
|
|
2291
|
-
var loginQr = /* @__PURE__ */ __name(({ diagnostic, note, indent: pad = 0, columns = /* @__PURE__ */ __name(() => process.stderr.columns, "columns"), terminal = process.stderr.isTTY === true, json = false }) => ({
|
|
2292
|
-
show: /* @__PURE__ */ __name((link, scan, expiresAt) => {
|
|
2293
|
-
if (!terminal) {
|
|
2294
|
-
const text = plainQr(link);
|
|
2295
|
-
diagnostic(`
|
|
2296
|
-
${text}
|
|
2297
|
-
`);
|
|
2298
|
-
if (json)
|
|
2299
|
-
diagnostic(JSON.stringify({
|
|
2300
|
-
event: "qr",
|
|
2301
|
-
qr: { text, expires_at: expiresAt?.toISOString() ?? null, scan: scan ?? null }
|
|
2302
|
-
}));
|
|
2303
|
-
note(PASTE_QR);
|
|
2304
|
-
if (scan)
|
|
2305
|
-
note(scan);
|
|
2306
|
-
return;
|
|
2307
|
-
}
|
|
2308
|
-
const drawn = terminalQr(link);
|
|
2309
|
-
const need = drawn.width + pad + MARGIN;
|
|
2310
|
-
const width = columns();
|
|
2311
|
-
if (width !== void 0 && need > width) {
|
|
2312
|
-
diagnostic(`the terminal is ${width} columns wide and the QR code needs ${need} \u2014 widen it`);
|
|
2313
|
-
return;
|
|
2314
|
-
}
|
|
2315
|
-
diagnostic(`
|
|
2316
|
-
${indent(drawn.text, pad + MARGIN)}`);
|
|
2317
|
-
if (scan)
|
|
2318
|
-
note(scan);
|
|
2319
|
-
}, "show")
|
|
2320
|
-
}), "loginQr");
|
|
2321
|
-
|
|
2322
|
-
export {
|
|
2323
|
-
bareCheck,
|
|
2324
|
-
checkWords,
|
|
2325
|
-
parseMarkdown,
|
|
2326
|
-
parseMarkdownSpans,
|
|
2327
|
-
countedPoll,
|
|
2328
|
-
TABLE_RECORD_TYPES,
|
|
2329
|
-
TableError,
|
|
2330
|
-
recordColumns,
|
|
2331
|
-
recordTemplate,
|
|
2332
|
-
envelopeOfCsv,
|
|
2333
|
-
terminalQr,
|
|
2334
|
-
plainQr,
|
|
2335
|
-
atTerminal,
|
|
2336
|
-
PASTE_QR,
|
|
2337
|
-
loginQr
|
|
2338
|
-
};
|